diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 78be9afd..6c7bb989 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -14,10 +14,10 @@ jobs: matrix: os: [ubuntu-latest] versions: [ - { java: 8, gradle: 6.8 }, - { java: 11, gradle: 6.8 }, - { java: 16, gradle: 7.3.1 }, - { java: 17, gradle: 7.3.1 } + { java: 8, gradle: 8.5 }, + { java: 11, gradle: 8.5 }, + { java: 16, gradle: 8.5 }, + { java: 17, gradle: 8.5 } ] runs-on: ${{ matrix.os }} steps: @@ -55,8 +55,8 @@ jobs: matrix: os: [ubuntu-latest] versions: [ - { java: 8, gradle: 6.8 }, - { java: 17, gradle: 7.3.1 } + { java: 8, gradle: 8.5 }, + { java: 17, gradle: 8.5 } ] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a7037b47..0f2580db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,6 +33,11 @@ jobs: java-version: '8' distribution: 'temurin' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + gradle-version: 8.5 + - name: Bump version run: | # Read current version diff --git a/build.gradle b/build.gradle index 0b0c8d7b..738a537a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'com.github.johnrengelman.shadow' version '6.1.0' + id 'com.github.johnrengelman.shadow' version '8.1.1' id 'java-library' id 'maven-publish' id 'signing' @@ -150,21 +150,21 @@ task integrationTest(type: Test) { outputs.upToDateWhen { false } } -// Configure Auto Relocation -import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation - -task relocateShadowJar(type: ConfigureShadowRelocation) { - target = tasks.shadowJar - prefix = "io.pinecone.shadow" // Default value is "shadow" - -} - -tasks.shadowJar.dependsOn tasks.relocateShadowJar - -// Shadow META-INF directory +// Configure Shadow JAR with relocations and transformers import com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer shadowJar { + relocate 'io.grpc', 'io.pinecone.shadow.io.grpc' + relocate 'com.google', 'io.pinecone.shadow.com.google' + relocate 'org.slf4j', 'io.pinecone.shadow.org.slf4j' + relocate 'okhttp3', 'io.pinecone.shadow.okhttp3' + relocate 'okio', 'io.pinecone.shadow.okio' + relocate 'com.fasterxml', 'io.pinecone.shadow.com.fasterxml' + relocate 'com.google.gson', 'io.pinecone.shadow.com.google.gson' + relocate 'io.gsonfire', 'io.pinecone.shadow.io.gsonfire' + relocate 'org.openapitools', 'io.pinecone.shadow.org.openapitools' + relocate 'com.google.protobuf', 'io.pinecone.shadow.com.google.protobuf' + relocate 'org.apache.tomcat', 'io.pinecone.shadow.org.apache.tomcat' transform(ServiceFileTransformer) } diff --git a/codegen/apis b/codegen/apis index a9158581..060b57b6 160000 --- a/codegen/apis +++ b/codegen/apis @@ -1 +1 @@ -Subproject commit a91585819b21bcd355fd76dab94546bb7908a008 +Subproject commit 060b57b6a5f17f2d18a83d865f07212166bacb06 diff --git a/codegen/build-oas.sh b/codegen/build-oas.sh index 80829735..3f3b06b6 100755 --- a/codegen/build-oas.sh +++ b/codegen/build-oas.sh @@ -3,7 +3,7 @@ set -eux -o pipefail version=$1 # e.g. 2024-07 -modules=("db_control" "db_data" "inference") +modules=("db_control" "db_data" "inference" "admin") destination="src/main/java/org/openapitools" build_dir="gen" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index da9702f9..a5952066 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/integration/java/io/pinecone/integration/controlPlane/pod/DeletionProtectionTest.java b/src/integration/java/io/pinecone/integration/controlPlane/pod/DeletionProtectionTest.java index 16cd1a3b..23da63f9 100644 --- a/src/integration/java/io/pinecone/integration/controlPlane/pod/DeletionProtectionTest.java +++ b/src/integration/java/io/pinecone/integration/controlPlane/pod/DeletionProtectionTest.java @@ -14,34 +14,44 @@ public class DeletionProtectionTest { .build(); @Test - public void createPodIndexWithDeletionProtectionEnabled() { + public void createPodIndexWithDeletionProtectionEnabled() throws InterruptedException { String indexName = RandomStringBuilder.build("create-pod", 8); // Create pod index with deletion protection enabled controlPlaneClient.createPodsIndex(indexName, 3, "us-east-1-aws", "p1.x1", DeletionProtection.ENABLED); + // Wait for index to be created + Thread.sleep(5000); IndexModel indexModel = controlPlaneClient.describeIndex(indexName); DeletionProtection deletionProtection = indexModel.getDeletionProtection(); Assertions.assertEquals(deletionProtection, DeletionProtection.ENABLED); // Configure index to disable deletionProtection controlPlaneClient.configurePodsIndex(indexName, DeletionProtection.DISABLED); + // Wait for index to be configured + Thread.sleep(5000); // Delete index controlPlaneClient.deleteIndex(indexName); } @Test - public void createPodIndexWithDeletionProtectionDisabled() { + public void createPodIndexWithDeletionProtectionDisabled() throws InterruptedException { String indexName = RandomStringBuilder.build("create-pod", 8); // Create pod index with deletion protection disabled controlPlaneClient.createPodsIndex(indexName, 3, "us-east-1-aws", "p1.x1"); + // Wait for index to be created + Thread.sleep(5000); IndexModel indexModel = controlPlaneClient.describeIndex(indexName); DeletionProtection deletionProtection = indexModel.getDeletionProtection(); Assertions.assertEquals(deletionProtection, DeletionProtection.DISABLED); // Configure index to enable deletionProtection controlPlaneClient.configurePodsIndex(indexName, DeletionProtection.ENABLED); + // Wait for index to be configured + Thread.sleep(5000); indexModel = controlPlaneClient.describeIndex(indexName); deletionProtection = indexModel.getDeletionProtection(); Assertions.assertEquals(deletionProtection, DeletionProtection.ENABLED); // Configure index to disable deletionProtection controlPlaneClient.configurePodsIndex(indexName, DeletionProtection.DISABLED); + // Wait for index to be configured + Thread.sleep(5000); // Delete index controlPlaneClient.deleteIndex(indexName); } diff --git a/src/integration/java/io/pinecone/integration/controlPlane/serverless/DeletionProtectionTest.java b/src/integration/java/io/pinecone/integration/controlPlane/serverless/DeletionProtectionTest.java index 115802dd..bc6ac999 100644 --- a/src/integration/java/io/pinecone/integration/controlPlane/serverless/DeletionProtectionTest.java +++ b/src/integration/java/io/pinecone/integration/controlPlane/serverless/DeletionProtectionTest.java @@ -17,39 +17,47 @@ public class DeletionProtectionTest { .build(); @Test - public void createIndexWithDeletionProtectionEnabled() { + public void createIndexWithDeletionProtectionEnabled() throws InterruptedException { String indexName = RandomStringBuilder.build("create-serv", 8); HashMap expectedTags = new HashMap<>(); expectedTags.put("test", "deletion-protection-enabled"); // Create serverless index with deletion protection enabled controlPlaneClient.createServerlessIndex(indexName, "cosine", 3, "aws", "us-west-2", DeletionProtection.ENABLED, expectedTags); + // Wait for index to be created + Thread.sleep(5000); // Describe index to verify deletion protection is enabled IndexModel indexModel = controlPlaneClient.describeIndex(indexName); DeletionProtection deletionProtection = indexModel.getDeletionProtection(); - Assertions.assertEquals(deletionProtection, DeletionProtection.ENABLED); + Assertions.assertEquals(DeletionProtection.ENABLED, deletionProtection); Map actualTags = indexModel.getTags(); Assertions.assertEquals(expectedTags, actualTags); } @Test - public void createPodIndexWithDeletionProtectionDisabled() { + public void createIndexWithDeletionProtectionDisabled() throws InterruptedException { String indexName = RandomStringBuilder.build("create-pod", 8); HashMap expectedTags = new HashMap<>(); expectedTags.put("test", "deletion-protection-disabled"); // Create serverless index with deletion protection disabled controlPlaneClient.createServerlessIndex(indexName, "cosine", 3, "aws", "us-west-2", DeletionProtection.DISABLED, expectedTags); + // Wait for index to be created + Thread.sleep(5000); IndexModel indexModel = controlPlaneClient.describeIndex(indexName); DeletionProtection deletionProtection = indexModel.getDeletionProtection(); - Assertions.assertEquals(deletionProtection, DeletionProtection.DISABLED); + Assertions.assertEquals(DeletionProtection.DISABLED, deletionProtection); Map actualTags = indexModel.getTags(); Assertions.assertEquals(expectedTags, actualTags); // Configure index to enable deletionProtection controlPlaneClient.configureServerlessIndex(indexName, DeletionProtection.ENABLED, expectedTags, null); + // Wait for index to be configured + Thread.sleep(5000); indexModel = controlPlaneClient.describeIndex(indexName); deletionProtection = indexModel.getDeletionProtection(); - Assertions.assertEquals(deletionProtection, DeletionProtection.ENABLED); + Assertions.assertEquals(DeletionProtection.ENABLED, deletionProtection); // Configure index to disable deletionProtection controlPlaneClient.configureServerlessIndex(indexName, DeletionProtection.DISABLED, expectedTags, null); + // Wait for index to be configured + Thread.sleep(5000); // Delete index controlPlaneClient.deleteIndex(indexName); } diff --git a/src/integration/java/io/pinecone/integration/dataPlane/ListEndpointTest.java b/src/integration/java/io/pinecone/integration/dataPlane/ListEndpointTest.java index 33868017..a20d26c3 100644 --- a/src/integration/java/io/pinecone/integration/dataPlane/ListEndpointTest.java +++ b/src/integration/java/io/pinecone/integration/dataPlane/ListEndpointTest.java @@ -36,7 +36,7 @@ public static void cleanUp() { public void testSyncListEndpoint() throws InterruptedException { // Confirm default vector IDs are returned when no namespace is specified ListResponse listResponseNoArgs = indexConnection.list(); - assertEquals(listResponseNoArgs.getVectorsList().size(), 4); + assertEquals(4, listResponseNoArgs.getVectorsList().size()); assertTrue(listResponseNoArgs.getVectorsList().toString().contains("def-id1")); assertTrue(listResponseNoArgs.getVectorsList().toString().contains("def-id2")); assertTrue(listResponseNoArgs.getVectorsList().toString().contains("def-prefix-id3")); @@ -44,7 +44,7 @@ public void testSyncListEndpoint() throws InterruptedException { // Confirm all vector IDs from custom namespace are returned when pass customNamespace ListResponse listResponseCustomNamespace = indexConnection.list(customNamespace); - assertEquals(listResponseCustomNamespace.getVectorsList().size(), 4); + assertEquals(4, listResponseCustomNamespace.getVectorsList().size()); assertTrue(listResponseCustomNamespace.getVectorsList().toString().contains("cus-id1")); assertTrue(listResponseCustomNamespace.getVectorsList().toString().contains("cus-id2")); assertTrue(listResponseCustomNamespace.getVectorsList().toString().contains("cus-prefix-id3")); @@ -52,7 +52,7 @@ public void testSyncListEndpoint() throws InterruptedException { // Confirm all vector IDs from custom namespace are returned, filtered by given prefix ListResponse listResponseCustomNamespaceWithPrefix = indexConnection.list(customNamespace, "cus-prefix-"); - assertEquals(listResponseCustomNamespaceWithPrefix.getVectorsList().size(), 2); + assertEquals(2, listResponseCustomNamespaceWithPrefix.getVectorsList().size()); assertTrue(listResponseCustomNamespaceWithPrefix.getVectorsList().toString().contains("cus-prefix-id3")); assertTrue(listResponseCustomNamespaceWithPrefix.getVectorsList().toString().contains("cus-prefix-id4")); @@ -62,13 +62,13 @@ public void testSyncListEndpoint() throws InterruptedException { // Confirm all vector IDs from custom namespace are returned using pagination ListResponse listResponseWithPaginationNoPrefix1 = indexConnection.list(customNamespace, 2); - assertEquals(listResponseWithPaginationNoPrefix1.getVectorsList().size(), 2); + assertEquals(2, listResponseWithPaginationNoPrefix1.getVectorsList().size()); ListResponse listResponseWithPaginationNoPrefix2 = indexConnection.list( customNamespace, 2, listResponseWithPaginationNoPrefix1.getPagination().getNext() ); - assertEquals(listResponseWithPaginationNoPrefix2.getVectorsList().size(), 2); + assertEquals(2, listResponseWithPaginationNoPrefix2.getVectorsList().size()); } @Test @@ -76,7 +76,7 @@ public void testAsyncListEndpoint() throws InterruptedException { // Confirm default vector IDs are returned when no namespace is specified ListenableFuture futureResponseNoArgs = asyncIndexConnection.list(); ListResponse asyncListResponseNoArgs = Futures.getUnchecked(futureResponseNoArgs); - assertEquals(asyncListResponseNoArgs.getVectorsList().size(), 4); + assertEquals(4, asyncListResponseNoArgs.getVectorsList().size()); assertTrue(asyncListResponseNoArgs.getVectorsList().toString().contains("def-id1")); assertTrue(asyncListResponseNoArgs.getVectorsList().toString().contains("def-id2")); assertTrue(asyncListResponseNoArgs.getVectorsList().toString().contains("def-prefix-id3")); @@ -94,7 +94,7 @@ public void testAsyncListEndpoint() throws InterruptedException { ListenableFuture futureResponseCustomNamespaceWithPrefix = asyncIndexConnection.list(customNamespace, "cus-prefix-"); ListResponse asyncListResponseCustomNamespaceWithPrefix = Futures.getUnchecked(futureResponseCustomNamespaceWithPrefix); - assertEquals(asyncListResponseCustomNamespaceWithPrefix.getVectorsList().size(), 2); + assertEquals(2, asyncListResponseCustomNamespaceWithPrefix.getVectorsList().size()); assertTrue(asyncListResponseCustomNamespaceWithPrefix.getVectorsList().toString().contains("cus-prefix-id3")); assertTrue(asyncListResponseCustomNamespaceWithPrefix.getVectorsList().toString().contains("cus-prefix-id4")); @@ -106,13 +106,13 @@ public void testAsyncListEndpoint() throws InterruptedException { // Confirm all vector IDs from custom namespace are returned using pagination ListenableFuture futureResponseWithPaginationNoPrefix1 = asyncIndexConnection.list(customNamespace, 2); ListResponse asyncListResponseWithPaginationNoPrefix1 = Futures.getUnchecked(futureResponseWithPaginationNoPrefix1); - assertEquals(asyncListResponseWithPaginationNoPrefix1.getVectorsList().size(), 2); + assertEquals(2, asyncListResponseWithPaginationNoPrefix1.getVectorsList().size()); ListenableFuture futureResponseWithPaginationNoPrefix2 = asyncIndexConnection.list( customNamespace, 2, asyncListResponseWithPaginationNoPrefix1.getPagination().getNext() ); ListResponse asyncListResponseWithPaginationNoPrefix2 = Futures.getUnchecked(futureResponseWithPaginationNoPrefix2); - assertEquals(asyncListResponseWithPaginationNoPrefix2.getVectorsList().size(), 2); + assertEquals(2, asyncListResponseWithPaginationNoPrefix2.getVectorsList().size()); } } diff --git a/src/integration/java/io/pinecone/integration/dataPlane/UpsertAndSearchRecordsTest.java b/src/integration/java/io/pinecone/integration/dataPlane/UpsertAndSearchRecordsTest.java index d83d591e..89ad5055 100644 --- a/src/integration/java/io/pinecone/integration/dataPlane/UpsertAndSearchRecordsTest.java +++ b/src/integration/java/io/pinecone/integration/dataPlane/UpsertAndSearchRecordsTest.java @@ -72,7 +72,7 @@ public void upsertAndSearchRecordsTest() throws ApiException, org.openapitools.d fields.add("chunk_text"); // Wait for vectors to be upserted - Thread.sleep(5000); + Thread.sleep(7500); SearchRecordsResponse recordsResponse = index.searchRecords(namespace, query, fields, null); Assertions.assertEquals(upsertRecords.size(), recordsResponse.getResult().getHits().size()); diff --git a/src/main/java/org/openapitools/admin/client/ApiCallback.java b/src/main/java/org/openapitools/admin/client/ApiCallback.java new file mode 100644 index 00000000..466a2dac --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/src/main/java/org/openapitools/admin/client/ApiClient.java b/src/main/java/org/openapitools/admin/client/ApiClient.java new file mode 100644 index 00000000..5561eab5 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/ApiClient.java @@ -0,0 +1,1565 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.admin.client.auth.Authentication; +import org.openapitools.admin.client.auth.HttpBasicAuth; +import org.openapitools.admin.client.auth.HttpBearerAuth; +import org.openapitools.admin.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

+ */ +public class ApiClient { + + private String basePath = "https://api.pinecone.io"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "https://api.pinecone.io", + "Production API endpoints", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("BearerAuth", new HttpBearerAuth("bearer")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object + */ + public ApiClient(OkHttpClient client) { + init(); + + httpClient = client; + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("BearerAuth", new HttpBearerAuth("bearer")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/2025-04/java"); + + authentications = new HashMap(); + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g https://api.pinecone.io + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client, which must never be null. + * + * @param newHttpClient An instance of OkHttpClient + * @return Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

Getter for the field keyManagers.

+ * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + *

Getter for the field dateFormat.

+ * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + *

Setter for the field dateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link org.openapitools.admin.client.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + JSON.setDateFormat(dateFormat); + return this; + } + + /** + *

Set SqlDateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link org.openapitools.admin.client.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + JSON.setSqlDateFormat(dateFormat); + return this; + } + + /** + *

Set OffsetDateTimeFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link org.openapitools.admin.client.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + *

Set LocalDateFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link org.openapitools.admin.client.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateFormat(dateFormat); + return this; + } + + /** + *

Set LenientOnJson.

+ * + * @param lenientOnJson a boolean + * @return a {@link org.openapitools.admin.client.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + JSON.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = JSON.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(o); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws org.openapitools.admin.client.ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws org.openapitools.admin.client.ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws org.openapitools.admin.client.ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws org.openapitools.admin.client.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws org.openapitools.admin.client.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws org.openapitools.admin.client.ApiException If the response has an unsuccessful status code or + * fail to deserialize the response body + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (Exception e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws org.openapitools.admin.client.ApiException If fail to serialize the request body object + */ + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws org.openapitools.admin.client.ApiException If fail to serialize the request body object + */ + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentTypePure)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param baseUrl The base URL + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); + } + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { + for (Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws org.openapitools.admin.client.ApiException If fails to update the parameters + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.admin.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/src/main/java/org/openapitools/admin/client/ApiException.java b/src/main/java/org/openapitools/admin/client/ApiException.java new file mode 100644 index 00000000..a223ab4d --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/ApiException.java @@ -0,0 +1,165 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client; + +import java.util.Map; +import java.util.List; + + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

+ */ + public ApiException() {} + + /** + *

Constructor for ApiException.

+ * + * @param throwable a {@link java.lang.Throwable} object + */ + public ApiException(Throwable throwable) { + super(throwable); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + */ + public ApiException(String message) { + super(message); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, Map> responseHeaders, String responseBody) { + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message a {@link java.lang.String} object + */ + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/src/main/java/org/openapitools/admin/client/ApiResponse.java b/src/main/java/org/openapitools/admin/client/ApiResponse.java new file mode 100644 index 00000000..f03b23c6 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + /** + *

Get the status code.

+ * + * @return the status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + *

Get the headers.

+ * + * @return a {@link java.util.Map} of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + *

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/src/main/java/org/openapitools/admin/client/Configuration.java b/src/main/java/org/openapitools/admin/client/Configuration.java new file mode 100644 index 00000000..a0104d3b --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class Configuration { + public static final String VERSION = "2025-04"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/src/main/java/org/openapitools/admin/client/GzipRequestInterceptor.java b/src/main/java/org/openapitools/admin/client/GzipRequestInterceptor.java new file mode 100644 index 00000000..d5acda68 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/src/main/java/org/openapitools/admin/client/JSON.java b/src/main/java/org/openapitools/admin/client/JSON.java new file mode 100644 index 00000000..f6f1e0f4 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/JSON.java @@ -0,0 +1,414 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.admin.client.model.APIKey.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.admin.client.model.APIKeyWithSecret.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.admin.client.model.CreateAPIKeyRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.admin.client.model.CreateProjectRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.admin.client.model.ErrorResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.admin.client.model.ErrorResponseError.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.admin.client.model.ListApiKeys200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.admin.client.model.ListOrganizations200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.admin.client.model.ListProjects200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.admin.client.model.Organization.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.admin.client.model.Project.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.admin.client.model.UpdateAPIKeyRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.admin.client.model.UpdateOrganizationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.admin.client.model.UpdateProjectRequest.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/src/main/java/org/openapitools/admin/client/Pair.java b/src/main/java/org/openapitools/admin/client/Pair.java new file mode 100644 index 00000000..33e863bb --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/src/main/java/org/openapitools/admin/client/ProgressRequestBody.java b/src/main/java/org/openapitools/admin/client/ProgressRequestBody.java new file mode 100644 index 00000000..0823ad85 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/src/main/java/org/openapitools/admin/client/ProgressResponseBody.java b/src/main/java/org/openapitools/admin/client/ProgressResponseBody.java new file mode 100644 index 00000000..e4899db5 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/src/main/java/org/openapitools/admin/client/ServerConfiguration.java b/src/main/java/org/openapitools/admin/client/ServerConfiguration.java new file mode 100644 index 00000000..351e3894 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.admin.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/src/main/java/org/openapitools/admin/client/ServerVariable.java b/src/main/java/org/openapitools/admin/client/ServerVariable.java new file mode 100644 index 00000000..b8642586 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.admin.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/src/main/java/org/openapitools/admin/client/StringUtil.java b/src/main/java/org/openapitools/admin/client/StringUtil.java new file mode 100644 index 00000000..05a128bd --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/src/main/java/org/openapitools/admin/client/api/ApiKeysApi.java b/src/main/java/org/openapitools/admin/client/api/ApiKeysApi.java new file mode 100644 index 00000000..635e2187 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/api/ApiKeysApi.java @@ -0,0 +1,800 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.api; + +import org.openapitools.admin.client.ApiCallback; +import org.openapitools.admin.client.ApiClient; +import org.openapitools.admin.client.ApiException; +import org.openapitools.admin.client.ApiResponse; +import org.openapitools.admin.client.Configuration; +import org.openapitools.admin.client.Pair; +import org.openapitools.admin.client.ProgressRequestBody; +import org.openapitools.admin.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.admin.client.model.APIKey; +import org.openapitools.admin.client.model.APIKeyWithSecret; +import org.openapitools.admin.client.model.CreateAPIKeyRequest; +import org.openapitools.admin.client.model.ErrorResponse; +import org.openapitools.admin.client.model.ListApiKeys200Response; +import java.util.UUID; +import org.openapitools.admin.client.model.UpdateAPIKeyRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApiKeysApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ApiKeysApi() { + this(Configuration.getDefaultApiClient()); + } + + public ApiKeysApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createApiKey + * @param projectId Project ID (required) + * @param createAPIKeyRequest The details of the new API key. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 API key created successfully. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Not enough available quota to complete this operation. -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call createApiKeyCall(UUID projectId, CreateAPIKeyRequest createAPIKeyRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createAPIKeyRequest; + + // create path and map variables + String localVarPath = "/admin/projects/{project_id}/api-keys" + .replace("{" + "project_id" + "}", localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createApiKeyValidateBeforeCall(UUID projectId, CreateAPIKeyRequest createAPIKeyRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException("Missing the required parameter 'projectId' when calling createApiKey(Async)"); + } + + // verify the required parameter 'createAPIKeyRequest' is set + if (createAPIKeyRequest == null) { + throw new ApiException("Missing the required parameter 'createAPIKeyRequest' when calling createApiKey(Async)"); + } + + return createApiKeyCall(projectId, createAPIKeyRequest, _callback); + + } + + /** + * Create an API key + * Create a new API key for a project. Developers can use the API key to authenticate requests to Pinecone's Data Plane and Control Plane APIs. + * @param projectId Project ID (required) + * @param createAPIKeyRequest The details of the new API key. (required) + * @return APIKeyWithSecret + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 API key created successfully. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Not enough available quota to complete this operation. -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public APIKeyWithSecret createApiKey(UUID projectId, CreateAPIKeyRequest createAPIKeyRequest) throws ApiException { + ApiResponse localVarResp = createApiKeyWithHttpInfo(projectId, createAPIKeyRequest); + return localVarResp.getData(); + } + + /** + * Create an API key + * Create a new API key for a project. Developers can use the API key to authenticate requests to Pinecone's Data Plane and Control Plane APIs. + * @param projectId Project ID (required) + * @param createAPIKeyRequest The details of the new API key. (required) + * @return ApiResponse<APIKeyWithSecret> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 API key created successfully. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Not enough available quota to complete this operation. -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ApiResponse createApiKeyWithHttpInfo(UUID projectId, CreateAPIKeyRequest createAPIKeyRequest) throws ApiException { + okhttp3.Call localVarCall = createApiKeyValidateBeforeCall(projectId, createAPIKeyRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create an API key (asynchronously) + * Create a new API key for a project. Developers can use the API key to authenticate requests to Pinecone's Data Plane and Control Plane APIs. + * @param projectId Project ID (required) + * @param createAPIKeyRequest The details of the new API key. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 API key created successfully. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Not enough available quota to complete this operation. -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call createApiKeyAsync(UUID projectId, CreateAPIKeyRequest createAPIKeyRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createApiKeyValidateBeforeCall(projectId, createAPIKeyRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteApiKey + * @param apiKeyId API key ID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
202 API key deletion request accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call deleteApiKeyCall(UUID apiKeyId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/admin/api-keys/{api_key_id}" + .replace("{" + "api_key_id" + "}", localVarApiClient.escapeString(apiKeyId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteApiKeyValidateBeforeCall(UUID apiKeyId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'apiKeyId' is set + if (apiKeyId == null) { + throw new ApiException("Missing the required parameter 'apiKeyId' when calling deleteApiKey(Async)"); + } + + return deleteApiKeyCall(apiKeyId, _callback); + + } + + /** + * Delete an API key + * Delete an API key from a project. + * @param apiKeyId API key ID (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
202 API key deletion request accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public void deleteApiKey(UUID apiKeyId) throws ApiException { + deleteApiKeyWithHttpInfo(apiKeyId); + } + + /** + * Delete an API key + * Delete an API key from a project. + * @param apiKeyId API key ID (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
202 API key deletion request accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ApiResponse deleteApiKeyWithHttpInfo(UUID apiKeyId) throws ApiException { + okhttp3.Call localVarCall = deleteApiKeyValidateBeforeCall(apiKeyId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete an API key (asynchronously) + * Delete an API key from a project. + * @param apiKeyId API key ID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
202 API key deletion request accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call deleteApiKeyAsync(UUID apiKeyId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteApiKeyValidateBeforeCall(apiKeyId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for fetchApiKey + * @param apiKeyId API key ID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 The details of the API key, excluding the API key secret. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call fetchApiKeyCall(UUID apiKeyId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/admin/api-keys/{api_key_id}" + .replace("{" + "api_key_id" + "}", localVarApiClient.escapeString(apiKeyId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call fetchApiKeyValidateBeforeCall(UUID apiKeyId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'apiKeyId' is set + if (apiKeyId == null) { + throw new ApiException("Missing the required parameter 'apiKeyId' when calling fetchApiKey(Async)"); + } + + return fetchApiKeyCall(apiKeyId, _callback); + + } + + /** + * Get API key details + * Get the details of an API key, excluding the API key secret. + * @param apiKeyId API key ID (required) + * @return APIKey + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 The details of the API key, excluding the API key secret. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public APIKey fetchApiKey(UUID apiKeyId) throws ApiException { + ApiResponse localVarResp = fetchApiKeyWithHttpInfo(apiKeyId); + return localVarResp.getData(); + } + + /** + * Get API key details + * Get the details of an API key, excluding the API key secret. + * @param apiKeyId API key ID (required) + * @return ApiResponse<APIKey> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 The details of the API key, excluding the API key secret. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ApiResponse fetchApiKeyWithHttpInfo(UUID apiKeyId) throws ApiException { + okhttp3.Call localVarCall = fetchApiKeyValidateBeforeCall(apiKeyId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get API key details (asynchronously) + * Get the details of an API key, excluding the API key secret. + * @param apiKeyId API key ID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 The details of the API key, excluding the API key secret. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call fetchApiKeyAsync(UUID apiKeyId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fetchApiKeyValidateBeforeCall(apiKeyId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listApiKeys + * @param projectId Project ID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 A list of API keys. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call listApiKeysCall(UUID projectId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/admin/projects/{project_id}/api-keys" + .replace("{" + "project_id" + "}", localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listApiKeysValidateBeforeCall(UUID projectId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException("Missing the required parameter 'projectId' when calling listApiKeys(Async)"); + } + + return listApiKeysCall(projectId, _callback); + + } + + /** + * List API keys + * List all API keys in a project. + * @param projectId Project ID (required) + * @return ListApiKeys200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 A list of API keys. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ListApiKeys200Response listApiKeys(UUID projectId) throws ApiException { + ApiResponse localVarResp = listApiKeysWithHttpInfo(projectId); + return localVarResp.getData(); + } + + /** + * List API keys + * List all API keys in a project. + * @param projectId Project ID (required) + * @return ApiResponse<ListApiKeys200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 A list of API keys. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ApiResponse listApiKeysWithHttpInfo(UUID projectId) throws ApiException { + okhttp3.Call localVarCall = listApiKeysValidateBeforeCall(projectId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List API keys (asynchronously) + * List all API keys in a project. + * @param projectId Project ID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 A list of API keys. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call listApiKeysAsync(UUID projectId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listApiKeysValidateBeforeCall(projectId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateApiKey + * @param apiKeyId API key ID (required) + * @param updateAPIKeyRequest Updated name and roles for the API key. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 API key created successfully. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call updateApiKeyCall(UUID apiKeyId, UpdateAPIKeyRequest updateAPIKeyRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateAPIKeyRequest; + + // create path and map variables + String localVarPath = "/admin/api-keys/{api_key_id}" + .replace("{" + "api_key_id" + "}", localVarApiClient.escapeString(apiKeyId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateApiKeyValidateBeforeCall(UUID apiKeyId, UpdateAPIKeyRequest updateAPIKeyRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'apiKeyId' is set + if (apiKeyId == null) { + throw new ApiException("Missing the required parameter 'apiKeyId' when calling updateApiKey(Async)"); + } + + // verify the required parameter 'updateAPIKeyRequest' is set + if (updateAPIKeyRequest == null) { + throw new ApiException("Missing the required parameter 'updateAPIKeyRequest' when calling updateApiKey(Async)"); + } + + return updateApiKeyCall(apiKeyId, updateAPIKeyRequest, _callback); + + } + + /** + * Update an API key + * Update the name and roles of an API key. + * @param apiKeyId API key ID (required) + * @param updateAPIKeyRequest Updated name and roles for the API key. (required) + * @return APIKeyWithSecret + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 API key created successfully. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public APIKeyWithSecret updateApiKey(UUID apiKeyId, UpdateAPIKeyRequest updateAPIKeyRequest) throws ApiException { + ApiResponse localVarResp = updateApiKeyWithHttpInfo(apiKeyId, updateAPIKeyRequest); + return localVarResp.getData(); + } + + /** + * Update an API key + * Update the name and roles of an API key. + * @param apiKeyId API key ID (required) + * @param updateAPIKeyRequest Updated name and roles for the API key. (required) + * @return ApiResponse<APIKeyWithSecret> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 API key created successfully. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ApiResponse updateApiKeyWithHttpInfo(UUID apiKeyId, UpdateAPIKeyRequest updateAPIKeyRequest) throws ApiException { + okhttp3.Call localVarCall = updateApiKeyValidateBeforeCall(apiKeyId, updateAPIKeyRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update an API key (asynchronously) + * Update the name and roles of an API key. + * @param apiKeyId API key ID (required) + * @param updateAPIKeyRequest Updated name and roles for the API key. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
201 API key created successfully. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call updateApiKeyAsync(UUID apiKeyId, UpdateAPIKeyRequest updateAPIKeyRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateApiKeyValidateBeforeCall(apiKeyId, updateAPIKeyRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/org/openapitools/admin/client/api/OrganizationsApi.java b/src/main/java/org/openapitools/admin/client/api/OrganizationsApi.java new file mode 100644 index 00000000..90d54572 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/api/OrganizationsApi.java @@ -0,0 +1,638 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.api; + +import org.openapitools.admin.client.ApiCallback; +import org.openapitools.admin.client.ApiClient; +import org.openapitools.admin.client.ApiException; +import org.openapitools.admin.client.ApiResponse; +import org.openapitools.admin.client.Configuration; +import org.openapitools.admin.client.Pair; +import org.openapitools.admin.client.ProgressRequestBody; +import org.openapitools.admin.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.admin.client.model.ErrorResponse; +import org.openapitools.admin.client.model.ListOrganizations200Response; +import org.openapitools.admin.client.model.Organization; +import org.openapitools.admin.client.model.UpdateOrganizationRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OrganizationsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OrganizationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public OrganizationsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for deleteOrganization + * @param organizationId Organization ID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
202 Organization deletion request accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call deleteOrganizationCall(String organizationId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/admin/organizations/{organization_id}" + .replace("{" + "organization_id" + "}", localVarApiClient.escapeString(organizationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteOrganizationValidateBeforeCall(String organizationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException("Missing the required parameter 'organizationId' when calling deleteOrganization(Async)"); + } + + return deleteOrganizationCall(organizationId, _callback); + + } + + /** + * Delete an organization + * Delete an organization and all its associated configuration. Before deleting an organization, you must delete all projects (including indexes, assistants, backups, and collections) associated with the organization. + * @param organizationId Organization ID (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
202 Organization deletion request accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public void deleteOrganization(String organizationId) throws ApiException { + deleteOrganizationWithHttpInfo(organizationId); + } + + /** + * Delete an organization + * Delete an organization and all its associated configuration. Before deleting an organization, you must delete all projects (including indexes, assistants, backups, and collections) associated with the organization. + * @param organizationId Organization ID (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
202 Organization deletion request accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ApiResponse deleteOrganizationWithHttpInfo(String organizationId) throws ApiException { + okhttp3.Call localVarCall = deleteOrganizationValidateBeforeCall(organizationId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete an organization (asynchronously) + * Delete an organization and all its associated configuration. Before deleting an organization, you must delete all projects (including indexes, assistants, backups, and collections) associated with the organization. + * @param organizationId Organization ID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
202 Organization deletion request accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call deleteOrganizationAsync(String organizationId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteOrganizationValidateBeforeCall(organizationId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for fetchOrganization + * @param organizationId Organization ID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 The details of an organization. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call fetchOrganizationCall(String organizationId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/admin/organizations/{organization_id}" + .replace("{" + "organization_id" + "}", localVarApiClient.escapeString(organizationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call fetchOrganizationValidateBeforeCall(String organizationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException("Missing the required parameter 'organizationId' when calling fetchOrganization(Async)"); + } + + return fetchOrganizationCall(organizationId, _callback); + + } + + /** + * Get organization details + * Get details about an organization. + * @param organizationId Organization ID (required) + * @return Organization + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 The details of an organization. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public Organization fetchOrganization(String organizationId) throws ApiException { + ApiResponse localVarResp = fetchOrganizationWithHttpInfo(organizationId); + return localVarResp.getData(); + } + + /** + * Get organization details + * Get details about an organization. + * @param organizationId Organization ID (required) + * @return ApiResponse<Organization> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 The details of an organization. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ApiResponse fetchOrganizationWithHttpInfo(String organizationId) throws ApiException { + okhttp3.Call localVarCall = fetchOrganizationValidateBeforeCall(organizationId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get organization details (asynchronously) + * Get details about an organization. + * @param organizationId Organization ID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 The details of an organization. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call fetchOrganizationAsync(String organizationId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fetchOrganizationValidateBeforeCall(organizationId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listOrganizations + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 A list of organizations. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call listOrganizationsCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/admin/organizations"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listOrganizationsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return listOrganizationsCall(_callback); + + } + + /** + * List organizations + * List all organizations associated with an account. + * @return ListOrganizations200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 A list of organizations. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ListOrganizations200Response listOrganizations() throws ApiException { + ApiResponse localVarResp = listOrganizationsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List organizations + * List all organizations associated with an account. + * @return ApiResponse<ListOrganizations200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 A list of organizations. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ApiResponse listOrganizationsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listOrganizationsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List organizations (asynchronously) + * List all organizations associated with an account. + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 A list of organizations. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call listOrganizationsAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listOrganizationsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateOrganization + * @param organizationId Organization ID (required) + * @param updateOrganizationRequest Organization details to be updated. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 The organization was successfully updated. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call updateOrganizationCall(String organizationId, UpdateOrganizationRequest updateOrganizationRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateOrganizationRequest; + + // create path and map variables + String localVarPath = "/admin/organizations/{organization_id}" + .replace("{" + "organization_id" + "}", localVarApiClient.escapeString(organizationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateOrganizationValidateBeforeCall(String organizationId, UpdateOrganizationRequest updateOrganizationRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'organizationId' is set + if (organizationId == null) { + throw new ApiException("Missing the required parameter 'organizationId' when calling updateOrganization(Async)"); + } + + // verify the required parameter 'updateOrganizationRequest' is set + if (updateOrganizationRequest == null) { + throw new ApiException("Missing the required parameter 'updateOrganizationRequest' when calling updateOrganization(Async)"); + } + + return updateOrganizationCall(organizationId, updateOrganizationRequest, _callback); + + } + + /** + * Update an organization + * Update an organization's name. + * @param organizationId Organization ID (required) + * @param updateOrganizationRequest Organization details to be updated. (required) + * @return Organization + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 The organization was successfully updated. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public Organization updateOrganization(String organizationId, UpdateOrganizationRequest updateOrganizationRequest) throws ApiException { + ApiResponse localVarResp = updateOrganizationWithHttpInfo(organizationId, updateOrganizationRequest); + return localVarResp.getData(); + } + + /** + * Update an organization + * Update an organization's name. + * @param organizationId Organization ID (required) + * @param updateOrganizationRequest Organization details to be updated. (required) + * @return ApiResponse<Organization> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 The organization was successfully updated. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ApiResponse updateOrganizationWithHttpInfo(String organizationId, UpdateOrganizationRequest updateOrganizationRequest) throws ApiException { + okhttp3.Call localVarCall = updateOrganizationValidateBeforeCall(organizationId, updateOrganizationRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update an organization (asynchronously) + * Update an organization's name. + * @param organizationId Organization ID (required) + * @param updateOrganizationRequest Organization details to be updated. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 The organization was successfully updated. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call updateOrganizationAsync(String organizationId, UpdateOrganizationRequest updateOrganizationRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateOrganizationValidateBeforeCall(organizationId, updateOrganizationRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/org/openapitools/admin/client/api/ProjectsApi.java b/src/main/java/org/openapitools/admin/client/api/ProjectsApi.java new file mode 100644 index 00000000..c4064b8f --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/api/ProjectsApi.java @@ -0,0 +1,787 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.api; + +import org.openapitools.admin.client.ApiCallback; +import org.openapitools.admin.client.ApiClient; +import org.openapitools.admin.client.ApiException; +import org.openapitools.admin.client.ApiResponse; +import org.openapitools.admin.client.Configuration; +import org.openapitools.admin.client.Pair; +import org.openapitools.admin.client.ProgressRequestBody; +import org.openapitools.admin.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.admin.client.model.CreateProjectRequest; +import org.openapitools.admin.client.model.ErrorResponse; +import org.openapitools.admin.client.model.ListProjects200Response; +import org.openapitools.admin.client.model.Project; +import java.util.UUID; +import org.openapitools.admin.client.model.UpdateProjectRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ProjectsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ProjectsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ProjectsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createProject + * @param createProjectRequest The details of the new project. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 The project was successfully created. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call createProjectCall(CreateProjectRequest createProjectRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createProjectRequest; + + // create path and map variables + String localVarPath = "/admin/projects"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createProjectValidateBeforeCall(CreateProjectRequest createProjectRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createProjectRequest' is set + if (createProjectRequest == null) { + throw new ApiException("Missing the required parameter 'createProjectRequest' when calling createProject(Async)"); + } + + return createProjectCall(createProjectRequest, _callback); + + } + + /** + * Create a new project + * Creates a new project. + * @param createProjectRequest The details of the new project. (required) + * @return Project + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 The project was successfully created. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public Project createProject(CreateProjectRequest createProjectRequest) throws ApiException { + ApiResponse localVarResp = createProjectWithHttpInfo(createProjectRequest); + return localVarResp.getData(); + } + + /** + * Create a new project + * Creates a new project. + * @param createProjectRequest The details of the new project. (required) + * @return ApiResponse<Project> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 The project was successfully created. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ApiResponse createProjectWithHttpInfo(CreateProjectRequest createProjectRequest) throws ApiException { + okhttp3.Call localVarCall = createProjectValidateBeforeCall(createProjectRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a new project (asynchronously) + * Creates a new project. + * @param createProjectRequest The details of the new project. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 The project was successfully created. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call createProjectAsync(CreateProjectRequest createProjectRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createProjectValidateBeforeCall(createProjectRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteProject + * @param projectId Project ID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
202 Project deletion request accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call deleteProjectCall(UUID projectId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/admin/projects/{project_id}" + .replace("{" + "project_id" + "}", localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteProjectValidateBeforeCall(UUID projectId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException("Missing the required parameter 'projectId' when calling deleteProject(Async)"); + } + + return deleteProjectCall(projectId, _callback); + + } + + /** + * Delete a project + * Delete a project and all its associated configuration. Before deleting a project, you must delete all indexes, assistants, backups, and collections associated with the project. Other project resources, such as API keys, are automatically deleted when the project is deleted. + * @param projectId Project ID (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
202 Project deletion request accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public void deleteProject(UUID projectId) throws ApiException { + deleteProjectWithHttpInfo(projectId); + } + + /** + * Delete a project + * Delete a project and all its associated configuration. Before deleting a project, you must delete all indexes, assistants, backups, and collections associated with the project. Other project resources, such as API keys, are automatically deleted when the project is deleted. + * @param projectId Project ID (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
202 Project deletion request accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ApiResponse deleteProjectWithHttpInfo(UUID projectId) throws ApiException { + okhttp3.Call localVarCall = deleteProjectValidateBeforeCall(projectId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete a project (asynchronously) + * Delete a project and all its associated configuration. Before deleting a project, you must delete all indexes, assistants, backups, and collections associated with the project. Other project resources, such as API keys, are automatically deleted when the project is deleted. + * @param projectId Project ID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
202 Project deletion request accepted. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call deleteProjectAsync(UUID projectId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteProjectValidateBeforeCall(projectId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for fetchProject + * @param projectId Project ID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 The details of a project. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call fetchProjectCall(UUID projectId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/admin/projects/{project_id}" + .replace("{" + "project_id" + "}", localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call fetchProjectValidateBeforeCall(UUID projectId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException("Missing the required parameter 'projectId' when calling fetchProject(Async)"); + } + + return fetchProjectCall(projectId, _callback); + + } + + /** + * Get project details + * Get details about a project. + * @param projectId Project ID (required) + * @return Project + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 The details of a project. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public Project fetchProject(UUID projectId) throws ApiException { + ApiResponse localVarResp = fetchProjectWithHttpInfo(projectId); + return localVarResp.getData(); + } + + /** + * Get project details + * Get details about a project. + * @param projectId Project ID (required) + * @return ApiResponse<Project> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 The details of a project. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ApiResponse fetchProjectWithHttpInfo(UUID projectId) throws ApiException { + okhttp3.Call localVarCall = fetchProjectValidateBeforeCall(projectId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get project details (asynchronously) + * Get details about a project. + * @param projectId Project ID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 The details of a project. -
401 Unauthorized. Possible causes: Invalid API key. -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call fetchProjectAsync(UUID projectId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fetchProjectValidateBeforeCall(projectId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listProjects + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 A list of projects. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call listProjectsCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/admin/projects"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listProjectsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return listProjectsCall(_callback); + + } + + /** + * List projects + * List all projects in an organization. + * @return ListProjects200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 A list of projects. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ListProjects200Response listProjects() throws ApiException { + ApiResponse localVarResp = listProjectsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List projects + * List all projects in an organization. + * @return ApiResponse<ListProjects200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 A list of projects. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ApiResponse listProjectsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listProjectsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List projects (asynchronously) + * List all projects in an organization. + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 A list of projects. -
401 Unauthorized. Possible causes: Invalid API key. -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call listProjectsAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listProjectsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateProject + * @param projectId Project ID (required) + * @param updateProjectRequest Project details to be updated. Fields that are omitted will not be updated. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 The project was successfully updated. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call updateProjectCall(UUID projectId, UpdateProjectRequest updateProjectRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateProjectRequest; + + // create path and map variables + String localVarPath = "/admin/projects/{project_id}" + .replace("{" + "project_id" + "}", localVarApiClient.escapeString(projectId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateProjectValidateBeforeCall(UUID projectId, UpdateProjectRequest updateProjectRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'projectId' is set + if (projectId == null) { + throw new ApiException("Missing the required parameter 'projectId' when calling updateProject(Async)"); + } + + // verify the required parameter 'updateProjectRequest' is set + if (updateProjectRequest == null) { + throw new ApiException("Missing the required parameter 'updateProjectRequest' when calling updateProject(Async)"); + } + + return updateProjectCall(projectId, updateProjectRequest, _callback); + + } + + /** + * Update a project + * Update a project's configuration details. You can update the project's name, maximum number of Pods, or enable encryption with a customer-managed encryption key (CMEK). + * @param projectId Project ID (required) + * @param updateProjectRequest Project details to be updated. Fields that are omitted will not be updated. (required) + * @return Project + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 The project was successfully updated. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public Project updateProject(UUID projectId, UpdateProjectRequest updateProjectRequest) throws ApiException { + ApiResponse localVarResp = updateProjectWithHttpInfo(projectId, updateProjectRequest); + return localVarResp.getData(); + } + + /** + * Update a project + * Update a project's configuration details. You can update the project's name, maximum number of Pods, or enable encryption with a customer-managed encryption key (CMEK). + * @param projectId Project ID (required) + * @param updateProjectRequest Project details to be updated. Fields that are omitted will not be updated. (required) + * @return ApiResponse<Project> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 The project was successfully updated. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public ApiResponse updateProjectWithHttpInfo(UUID projectId, UpdateProjectRequest updateProjectRequest) throws ApiException { + okhttp3.Call localVarCall = updateProjectValidateBeforeCall(projectId, updateProjectRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update a project (asynchronously) + * Update a project's configuration details. You can update the project's name, maximum number of Pods, or enable encryption with a customer-managed encryption key (CMEK). + * @param projectId Project ID (required) + * @param updateProjectRequest Project details to be updated. Fields that are omitted will not be updated. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 The project was successfully updated. -
400 Bad request. The request body included invalid request parameters. -
401 Unauthorized. Possible causes: Invalid API key. -
403 Forbidden -
404 Not found -
500 Internal server error. -
4XX Unexpected error on request. -
+ */ + public okhttp3.Call updateProjectAsync(UUID projectId, UpdateProjectRequest updateProjectRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateProjectValidateBeforeCall(projectId, updateProjectRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/org/openapitools/admin/client/auth/ApiKeyAuth.java b/src/main/java/org/openapitools/admin/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000..b543e035 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.auth; + +import org.openapitools.admin.client.ApiException; +import org.openapitools.admin.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/src/main/java/org/openapitools/admin/client/auth/Authentication.java b/src/main/java/org/openapitools/admin/client/auth/Authentication.java new file mode 100644 index 00000000..9f1ba036 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.auth; + +import org.openapitools.admin.client.Pair; +import org.openapitools.admin.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/src/main/java/org/openapitools/admin/client/auth/HttpBasicAuth.java b/src/main/java/org/openapitools/admin/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000..1d8ab2dd --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.auth; + +import org.openapitools.admin.client.Pair; +import org.openapitools.admin.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/src/main/java/org/openapitools/admin/client/auth/HttpBearerAuth.java b/src/main/java/org/openapitools/admin/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000..f6d58f69 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.auth; + +import org.openapitools.admin.client.ApiException; +import org.openapitools.admin.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/src/main/java/org/openapitools/admin/client/model/APIKey.java b/src/main/java/org/openapitools/admin/client/model/APIKey.java new file mode 100644 index 00000000..0524a8da --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/model/APIKey.java @@ -0,0 +1,402 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.admin.client.JSON; + +/** + * The details of an API key, without the secret. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class APIKey { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_PROJECT_ID = "project_id"; + @SerializedName(SERIALIZED_NAME_PROJECT_ID) + private UUID projectId; + + public static final String SERIALIZED_NAME_ROLES = "roles"; + @SerializedName(SERIALIZED_NAME_ROLES) + private List roles = new ArrayList<>(); + + public APIKey() { + } + + public APIKey id(UUID id) { + + this.id = id; + return this; + } + + /** + * The unique ID of the API key. + * @return id + **/ + @javax.annotation.Nonnull + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public APIKey name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the API key. + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public APIKey projectId(UUID projectId) { + + this.projectId = projectId; + return this; + } + + /** + * The ID of the project containing the API key. + * @return projectId + **/ + @javax.annotation.Nonnull + public UUID getProjectId() { + return projectId; + } + + + public void setProjectId(UUID projectId) { + this.projectId = projectId; + } + + + public APIKey roles(List roles) { + + this.roles = roles; + return this; + } + + public APIKey addRolesItem(String rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + + /** + * The roles assigned to the API key. + * @return roles + **/ + @javax.annotation.Nonnull + public List getRoles() { + return roles; + } + + + public void setRoles(List roles) { + this.roles = roles; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the APIKey instance itself + */ + public APIKey putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + APIKey apIKey = (APIKey) o; + return Objects.equals(this.id, apIKey.id) && + Objects.equals(this.name, apIKey.name) && + Objects.equals(this.projectId, apIKey.projectId) && + Objects.equals(this.roles, apIKey.roles)&& + Objects.equals(this.additionalProperties, apIKey.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, projectId, roles, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class APIKey {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("project_id"); + openapiFields.add("roles"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("project_id"); + openapiRequiredFields.add("roles"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to APIKey + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!APIKey.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in APIKey is not found in the empty JSON string", APIKey.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : APIKey.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("project_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `project_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("project_id").toString())); + } + // ensure the required json array is present + if (jsonObj.get("roles") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("roles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!APIKey.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'APIKey' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(APIKey.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, APIKey value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public APIKey read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + APIKey instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of APIKey given an JSON string + * + * @param jsonString JSON string + * @return An instance of APIKey + * @throws IOException if the JSON string is invalid with respect to APIKey + */ + public static APIKey fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, APIKey.class); + } + + /** + * Convert an instance of APIKey to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/admin/client/model/APIKeyWithSecret.java b/src/main/java/org/openapitools/admin/client/model/APIKeyWithSecret.java new file mode 100644 index 00000000..3a786395 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/model/APIKeyWithSecret.java @@ -0,0 +1,324 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.admin.client.model.APIKey; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.admin.client.JSON; + +/** + * The details of an API key, including the secret. Only returned on API key creation. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class APIKeyWithSecret { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private APIKey key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public APIKeyWithSecret() { + } + + public APIKeyWithSecret key(APIKey key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + **/ + @javax.annotation.Nonnull + public APIKey getKey() { + return key; + } + + + public void setKey(APIKey key) { + this.key = key; + } + + + public APIKeyWithSecret value(String value) { + + this.value = value; + return this; + } + + /** + * The value to use as an API key. New keys will have the format `\"pckey_<public-label>_<unique-key>\"`. The entire string should be used when authenticating. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the APIKeyWithSecret instance itself + */ + public APIKeyWithSecret putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + APIKeyWithSecret apIKeyWithSecret = (APIKeyWithSecret) o; + return Objects.equals(this.key, apIKeyWithSecret.key) && + Objects.equals(this.value, apIKeyWithSecret.value)&& + Objects.equals(this.additionalProperties, apIKeyWithSecret.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class APIKeyWithSecret {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to APIKeyWithSecret + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!APIKeyWithSecret.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in APIKeyWithSecret is not found in the empty JSON string", APIKeyWithSecret.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : APIKeyWithSecret.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `key` + APIKey.validateJsonElement(jsonObj.get("key")); + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!APIKeyWithSecret.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'APIKeyWithSecret' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(APIKeyWithSecret.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, APIKeyWithSecret value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public APIKeyWithSecret read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + APIKeyWithSecret instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of APIKeyWithSecret given an JSON string + * + * @param jsonString JSON string + * @return An instance of APIKeyWithSecret + * @throws IOException if the JSON string is invalid with respect to APIKeyWithSecret + */ + public static APIKeyWithSecret fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, APIKeyWithSecret.class); + } + + /** + * Convert an instance of APIKeyWithSecret to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/admin/client/model/AbstractOpenApiSchema.java b/src/main/java/org/openapitools/admin/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000..2197711d --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,148 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.model; + +import org.openapitools.admin.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/src/main/java/org/openapitools/admin/client/model/CreateAPIKeyRequest.java b/src/main/java/org/openapitools/admin/client/model/CreateAPIKeyRequest.java new file mode 100644 index 00000000..5b9583e9 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/model/CreateAPIKeyRequest.java @@ -0,0 +1,334 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.admin.client.JSON; + +/** + * CreateAPIKeyRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class CreateAPIKeyRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ROLES = "roles"; + @SerializedName(SERIALIZED_NAME_ROLES) + private List roles; + + public CreateAPIKeyRequest() { + } + + public CreateAPIKeyRequest name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the API key. The name must be 1-80 characters long. + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public CreateAPIKeyRequest roles(List roles) { + + this.roles = roles; + return this; + } + + public CreateAPIKeyRequest addRolesItem(String rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + + /** + * The roles to create the API key with. Default is `[\"ProjectEditor\"]`. + * @return roles + **/ + @javax.annotation.Nullable + public List getRoles() { + return roles; + } + + + public void setRoles(List roles) { + this.roles = roles; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateAPIKeyRequest instance itself + */ + public CreateAPIKeyRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAPIKeyRequest createAPIKeyRequest = (CreateAPIKeyRequest) o; + return Objects.equals(this.name, createAPIKeyRequest.name) && + Objects.equals(this.roles, createAPIKeyRequest.roles)&& + Objects.equals(this.additionalProperties, createAPIKeyRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, roles, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAPIKeyRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("roles"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateAPIKeyRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateAPIKeyRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateAPIKeyRequest is not found in the empty JSON string", CreateAPIKeyRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateAPIKeyRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("roles") != null && !jsonObj.get("roles").isJsonNull() && !jsonObj.get("roles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateAPIKeyRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAPIKeyRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateAPIKeyRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAPIKeyRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateAPIKeyRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateAPIKeyRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateAPIKeyRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateAPIKeyRequest + * @throws IOException if the JSON string is invalid with respect to CreateAPIKeyRequest + */ + public static CreateAPIKeyRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAPIKeyRequest.class); + } + + /** + * Convert an instance of CreateAPIKeyRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/admin/client/model/CreateProjectRequest.java b/src/main/java/org/openapitools/admin/client/model/CreateProjectRequest.java new file mode 100644 index 00000000..c28452c8 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/model/CreateProjectRequest.java @@ -0,0 +1,348 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.admin.client.JSON; + +/** + * CreateProjectRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class CreateProjectRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_MAX_PODS = "max_pods"; + @SerializedName(SERIALIZED_NAME_MAX_PODS) + private Integer maxPods; + + public static final String SERIALIZED_NAME_FORCE_ENCRYPTION_WITH_CMEK = "force_encryption_with_cmek"; + @SerializedName(SERIALIZED_NAME_FORCE_ENCRYPTION_WITH_CMEK) + private Boolean forceEncryptionWithCmek; + + public CreateProjectRequest() { + } + + public CreateProjectRequest name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the new project. + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public CreateProjectRequest maxPods(Integer maxPods) { + + this.maxPods = maxPods; + return this; + } + + /** + * The maximum number of Pods that can be created in the project. Default is `0` (serverless only). + * @return maxPods + **/ + @javax.annotation.Nullable + public Integer getMaxPods() { + return maxPods; + } + + + public void setMaxPods(Integer maxPods) { + this.maxPods = maxPods; + } + + + public CreateProjectRequest forceEncryptionWithCmek(Boolean forceEncryptionWithCmek) { + + this.forceEncryptionWithCmek = forceEncryptionWithCmek; + return this; + } + + /** + * Whether to force encryption with a customer-managed encryption key (CMEK). Default is `false`. + * @return forceEncryptionWithCmek + **/ + @javax.annotation.Nullable + public Boolean getForceEncryptionWithCmek() { + return forceEncryptionWithCmek; + } + + + public void setForceEncryptionWithCmek(Boolean forceEncryptionWithCmek) { + this.forceEncryptionWithCmek = forceEncryptionWithCmek; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateProjectRequest instance itself + */ + public CreateProjectRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateProjectRequest createProjectRequest = (CreateProjectRequest) o; + return Objects.equals(this.name, createProjectRequest.name) && + Objects.equals(this.maxPods, createProjectRequest.maxPods) && + Objects.equals(this.forceEncryptionWithCmek, createProjectRequest.forceEncryptionWithCmek)&& + Objects.equals(this.additionalProperties, createProjectRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, maxPods, forceEncryptionWithCmek, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateProjectRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" maxPods: ").append(toIndentedString(maxPods)).append("\n"); + sb.append(" forceEncryptionWithCmek: ").append(toIndentedString(forceEncryptionWithCmek)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("max_pods"); + openapiFields.add("force_encryption_with_cmek"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateProjectRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateProjectRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateProjectRequest is not found in the empty JSON string", CreateProjectRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateProjectRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateProjectRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateProjectRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateProjectRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateProjectRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateProjectRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateProjectRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateProjectRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateProjectRequest + * @throws IOException if the JSON string is invalid with respect to CreateProjectRequest + */ + public static CreateProjectRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateProjectRequest.class); + } + + /** + * Convert an instance of CreateProjectRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/admin/client/model/ErrorResponse.java b/src/main/java/org/openapitools/admin/client/model/ErrorResponse.java new file mode 100644 index 00000000..82b2d83b --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/model/ErrorResponse.java @@ -0,0 +1,321 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.admin.client.model.ErrorResponseError; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.admin.client.JSON; + +/** + * The response shape used for all error responses. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class ErrorResponse { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Integer status; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private ErrorResponseError error; + + public ErrorResponse() { + } + + public ErrorResponse status(Integer status) { + + this.status = status; + return this; + } + + /** + * The HTTP status code of the error. + * @return status + **/ + @javax.annotation.Nonnull + public Integer getStatus() { + return status; + } + + + public void setStatus(Integer status) { + this.status = status; + } + + + public ErrorResponse error(ErrorResponseError error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nonnull + public ErrorResponseError getError() { + return error; + } + + + public void setError(ErrorResponseError error) { + this.error = error; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ErrorResponse instance itself + */ + public ErrorResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.status, errorResponse.status) && + Objects.equals(this.error, errorResponse.error)&& + Objects.equals(this.additionalProperties, errorResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(status, error, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("error"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("error"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ErrorResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ErrorResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorResponse is not found in the empty JSON string", ErrorResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `error` + ErrorResponseError.validateJsonElement(jsonObj.get("error")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ErrorResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ErrorResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorResponse + * @throws IOException if the JSON string is invalid with respect to ErrorResponse + */ + public static ErrorResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorResponse.class); + } + + /** + * Convert an instance of ErrorResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/admin/client/model/ErrorResponseError.java b/src/main/java/org/openapitools/admin/client/model/ErrorResponseError.java new file mode 100644 index 00000000..bf05741c --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/model/ErrorResponseError.java @@ -0,0 +1,352 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.admin.client.JSON; + +/** + * Detailed information about the error that occurred. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class ErrorResponseError { + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_DETAILS = "details"; + @SerializedName(SERIALIZED_NAME_DETAILS) + private Object details; + + public ErrorResponseError() { + } + + public ErrorResponseError code(String code) { + + this.code = code; + return this; + } + + /** + * The error code. Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`, `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`, `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`, `DATA_LOSS`, `FORBIDDEN`, or `UNPROCESSABLE_ENTITY`. + * @return code + **/ + @javax.annotation.Nonnull + public String getCode() { + return code; + } + + + public void setCode(String code) { + this.code = code; + } + + + public ErrorResponseError message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ErrorResponseError details(Object details) { + + this.details = details; + return this; + } + + /** + * Additional information about the error. This field is not guaranteed to be present. + * @return details + **/ + @javax.annotation.Nullable + public Object getDetails() { + return details; + } + + + public void setDetails(Object details) { + this.details = details; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ErrorResponseError instance itself + */ + public ErrorResponseError putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponseError errorResponseError = (ErrorResponseError) o; + return Objects.equals(this.code, errorResponseError.code) && + Objects.equals(this.message, errorResponseError.message) && + Objects.equals(this.details, errorResponseError.details)&& + Objects.equals(this.additionalProperties, errorResponseError.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, details, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponseError {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("message"); + openapiFields.add("details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("code"); + openapiRequiredFields.add("message"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ErrorResponseError + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ErrorResponseError.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorResponseError is not found in the empty JSON string", ErrorResponseError.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorResponseError.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorResponseError.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorResponseError' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorResponseError.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorResponseError value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ErrorResponseError read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ErrorResponseError instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorResponseError given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorResponseError + * @throws IOException if the JSON string is invalid with respect to ErrorResponseError + */ + public static ErrorResponseError fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorResponseError.class); + } + + /** + * Convert an instance of ErrorResponseError to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/admin/client/model/ListApiKeys200Response.java b/src/main/java/org/openapitools/admin/client/model/ListApiKeys200Response.java new file mode 100644 index 00000000..b42c7e45 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/model/ListApiKeys200Response.java @@ -0,0 +1,306 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.admin.client.model.APIKey; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.admin.client.JSON; + +/** + * ListApiKeys200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class ListApiKeys200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private List data; + + public ListApiKeys200Response() { + } + + public ListApiKeys200Response data(List data) { + + this.data = data; + return this; + } + + public ListApiKeys200Response addDataItem(APIKey dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + public List getData() { + return data; + } + + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ListApiKeys200Response instance itself + */ + public ListApiKeys200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListApiKeys200Response listApiKeys200Response = (ListApiKeys200Response) o; + return Objects.equals(this.data, listApiKeys200Response.data)&& + Objects.equals(this.additionalProperties, listApiKeys200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListApiKeys200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListApiKeys200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListApiKeys200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ListApiKeys200Response is not found in the empty JSON string", ListApiKeys200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + APIKey.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListApiKeys200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListApiKeys200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListApiKeys200Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListApiKeys200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ListApiKeys200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListApiKeys200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListApiKeys200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListApiKeys200Response + * @throws IOException if the JSON string is invalid with respect to ListApiKeys200Response + */ + public static ListApiKeys200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListApiKeys200Response.class); + } + + /** + * Convert an instance of ListApiKeys200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/admin/client/model/ListOrganizations200Response.java b/src/main/java/org/openapitools/admin/client/model/ListOrganizations200Response.java new file mode 100644 index 00000000..f56562b1 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/model/ListOrganizations200Response.java @@ -0,0 +1,306 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.admin.client.model.Organization; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.admin.client.JSON; + +/** + * ListOrganizations200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class ListOrganizations200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private List data; + + public ListOrganizations200Response() { + } + + public ListOrganizations200Response data(List data) { + + this.data = data; + return this; + } + + public ListOrganizations200Response addDataItem(Organization dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + public List getData() { + return data; + } + + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ListOrganizations200Response instance itself + */ + public ListOrganizations200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListOrganizations200Response listOrganizations200Response = (ListOrganizations200Response) o; + return Objects.equals(this.data, listOrganizations200Response.data)&& + Objects.equals(this.additionalProperties, listOrganizations200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListOrganizations200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListOrganizations200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListOrganizations200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ListOrganizations200Response is not found in the empty JSON string", ListOrganizations200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + Organization.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListOrganizations200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListOrganizations200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListOrganizations200Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListOrganizations200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ListOrganizations200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListOrganizations200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListOrganizations200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListOrganizations200Response + * @throws IOException if the JSON string is invalid with respect to ListOrganizations200Response + */ + public static ListOrganizations200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListOrganizations200Response.class); + } + + /** + * Convert an instance of ListOrganizations200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/admin/client/model/ListProjects200Response.java b/src/main/java/org/openapitools/admin/client/model/ListProjects200Response.java new file mode 100644 index 00000000..dab189ba --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/model/ListProjects200Response.java @@ -0,0 +1,306 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.admin.client.model.Project; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.admin.client.JSON; + +/** + * ListProjects200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class ListProjects200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private List data; + + public ListProjects200Response() { + } + + public ListProjects200Response data(List data) { + + this.data = data; + return this; + } + + public ListProjects200Response addDataItem(Project dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + public List getData() { + return data; + } + + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ListProjects200Response instance itself + */ + public ListProjects200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListProjects200Response listProjects200Response = (ListProjects200Response) o; + return Objects.equals(this.data, listProjects200Response.data)&& + Objects.equals(this.additionalProperties, listProjects200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListProjects200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListProjects200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListProjects200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ListProjects200Response is not found in the empty JSON string", ListProjects200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + Project.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListProjects200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListProjects200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListProjects200Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListProjects200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ListProjects200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ListProjects200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListProjects200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListProjects200Response + * @throws IOException if the JSON string is invalid with respect to ListProjects200Response + */ + public static ListProjects200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListProjects200Response.class); + } + + /** + * Convert an instance of ListProjects200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/admin/client/model/Organization.java b/src/main/java/org/openapitools/admin/client/model/Organization.java new file mode 100644 index 00000000..a82af4d7 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/model/Organization.java @@ -0,0 +1,450 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.admin.client.JSON; + +/** + * The details of an organization. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class Organization { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_PLAN = "plan"; + @SerializedName(SERIALIZED_NAME_PLAN) + private String plan; + + public static final String SERIALIZED_NAME_PAYMENT_STATUS = "payment_status"; + @SerializedName(SERIALIZED_NAME_PAYMENT_STATUS) + private String paymentStatus; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_SUPPORT_TIER = "support_tier"; + @SerializedName(SERIALIZED_NAME_SUPPORT_TIER) + private String supportTier; + + public Organization() { + } + + public Organization id(String id) { + + this.id = id; + return this; + } + + /** + * The unique ID of the organization. + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public Organization name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the organization. + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public Organization plan(String plan) { + + this.plan = plan; + return this; + } + + /** + * The current plan the organization is on. + * @return plan + **/ + @javax.annotation.Nonnull + public String getPlan() { + return plan; + } + + + public void setPlan(String plan) { + this.plan = plan; + } + + + public Organization paymentStatus(String paymentStatus) { + + this.paymentStatus = paymentStatus; + return this; + } + + /** + * The current payment status of the organization. + * @return paymentStatus + **/ + @javax.annotation.Nonnull + public String getPaymentStatus() { + return paymentStatus; + } + + + public void setPaymentStatus(String paymentStatus) { + this.paymentStatus = paymentStatus; + } + + + public Organization createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The date and time when the organization was created. + * @return createdAt + **/ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public Organization supportTier(String supportTier) { + + this.supportTier = supportTier; + return this; + } + + /** + * The support tier of the organization. + * @return supportTier + **/ + @javax.annotation.Nonnull + public String getSupportTier() { + return supportTier; + } + + + public void setSupportTier(String supportTier) { + this.supportTier = supportTier; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Organization instance itself + */ + public Organization putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Organization organization = (Organization) o; + return Objects.equals(this.id, organization.id) && + Objects.equals(this.name, organization.name) && + Objects.equals(this.plan, organization.plan) && + Objects.equals(this.paymentStatus, organization.paymentStatus) && + Objects.equals(this.createdAt, organization.createdAt) && + Objects.equals(this.supportTier, organization.supportTier)&& + Objects.equals(this.additionalProperties, organization.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, plan, paymentStatus, createdAt, supportTier, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Organization {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" plan: ").append(toIndentedString(plan)).append("\n"); + sb.append(" paymentStatus: ").append(toIndentedString(paymentStatus)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" supportTier: ").append(toIndentedString(supportTier)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("plan"); + openapiFields.add("payment_status"); + openapiFields.add("created_at"); + openapiFields.add("support_tier"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("plan"); + openapiRequiredFields.add("payment_status"); + openapiRequiredFields.add("created_at"); + openapiRequiredFields.add("support_tier"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Organization + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Organization.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Organization is not found in the empty JSON string", Organization.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Organization.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("plan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan").toString())); + } + if (!jsonObj.get("payment_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_status").toString())); + } + if (!jsonObj.get("support_tier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `support_tier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("support_tier").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Organization.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Organization' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Organization.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Organization value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Organization read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Organization instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Organization given an JSON string + * + * @param jsonString JSON string + * @return An instance of Organization + * @throws IOException if the JSON string is invalid with respect to Organization + */ + public static Organization fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Organization.class); + } + + /** + * Convert an instance of Organization to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/admin/client/model/Project.java b/src/main/java/org/openapitools/admin/client/model/Project.java new file mode 100644 index 00000000..ebbcccf8 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/model/Project.java @@ -0,0 +1,444 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.admin.client.JSON; + +/** + * The details of a project. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class Project { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_MAX_PODS = "max_pods"; + @SerializedName(SERIALIZED_NAME_MAX_PODS) + private Integer maxPods; + + public static final String SERIALIZED_NAME_FORCE_ENCRYPTION_WITH_CMEK = "force_encryption_with_cmek"; + @SerializedName(SERIALIZED_NAME_FORCE_ENCRYPTION_WITH_CMEK) + private Boolean forceEncryptionWithCmek; + + public static final String SERIALIZED_NAME_ORGANIZATION_ID = "organization_id"; + @SerializedName(SERIALIZED_NAME_ORGANIZATION_ID) + private String organizationId; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public Project() { + } + + public Project id(UUID id) { + + this.id = id; + return this; + } + + /** + * The unique ID of the project. + * @return id + **/ + @javax.annotation.Nonnull + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public Project name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the project. + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public Project maxPods(Integer maxPods) { + + this.maxPods = maxPods; + return this; + } + + /** + * The maximum number of Pods that can be created in the project. + * @return maxPods + **/ + @javax.annotation.Nonnull + public Integer getMaxPods() { + return maxPods; + } + + + public void setMaxPods(Integer maxPods) { + this.maxPods = maxPods; + } + + + public Project forceEncryptionWithCmek(Boolean forceEncryptionWithCmek) { + + this.forceEncryptionWithCmek = forceEncryptionWithCmek; + return this; + } + + /** + * Whether to force encryption with a customer-managed encryption key (CMEK). + * @return forceEncryptionWithCmek + **/ + @javax.annotation.Nonnull + public Boolean getForceEncryptionWithCmek() { + return forceEncryptionWithCmek; + } + + + public void setForceEncryptionWithCmek(Boolean forceEncryptionWithCmek) { + this.forceEncryptionWithCmek = forceEncryptionWithCmek; + } + + + public Project organizationId(String organizationId) { + + this.organizationId = organizationId; + return this; + } + + /** + * The unique ID of the organization that the project belongs to. + * @return organizationId + **/ + @javax.annotation.Nonnull + public String getOrganizationId() { + return organizationId; + } + + + public void setOrganizationId(String organizationId) { + this.organizationId = organizationId; + } + + + public Project createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The date and time when the project was created. + * @return createdAt + **/ + @javax.annotation.Nullable + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Project instance itself + */ + public Project putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Project project = (Project) o; + return Objects.equals(this.id, project.id) && + Objects.equals(this.name, project.name) && + Objects.equals(this.maxPods, project.maxPods) && + Objects.equals(this.forceEncryptionWithCmek, project.forceEncryptionWithCmek) && + Objects.equals(this.organizationId, project.organizationId) && + Objects.equals(this.createdAt, project.createdAt)&& + Objects.equals(this.additionalProperties, project.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, maxPods, forceEncryptionWithCmek, organizationId, createdAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Project {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" maxPods: ").append(toIndentedString(maxPods)).append("\n"); + sb.append(" forceEncryptionWithCmek: ").append(toIndentedString(forceEncryptionWithCmek)).append("\n"); + sb.append(" organizationId: ").append(toIndentedString(organizationId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("max_pods"); + openapiFields.add("force_encryption_with_cmek"); + openapiFields.add("organization_id"); + openapiFields.add("created_at"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("max_pods"); + openapiRequiredFields.add("force_encryption_with_cmek"); + openapiRequiredFields.add("organization_id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Project + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Project.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Project is not found in the empty JSON string", Project.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Project.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("organization_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `organization_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organization_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Project.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Project' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Project.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Project value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Project read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Project instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Project given an JSON string + * + * @param jsonString JSON string + * @return An instance of Project + * @throws IOException if the JSON string is invalid with respect to Project + */ + public static Project fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Project.class); + } + + /** + * Convert an instance of Project to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/admin/client/model/UpdateAPIKeyRequest.java b/src/main/java/org/openapitools/admin/client/model/UpdateAPIKeyRequest.java new file mode 100644 index 00000000..f56fe281 --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/model/UpdateAPIKeyRequest.java @@ -0,0 +1,326 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.admin.client.JSON; + +/** + * UpdateAPIKeyRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class UpdateAPIKeyRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ROLES = "roles"; + @SerializedName(SERIALIZED_NAME_ROLES) + private List roles; + + public UpdateAPIKeyRequest() { + } + + public UpdateAPIKeyRequest name(String name) { + + this.name = name; + return this; + } + + /** + * A new name for the API key. The name must be 1-80 characters long. If omitted, the name will not be updated. + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public UpdateAPIKeyRequest roles(List roles) { + + this.roles = roles; + return this; + } + + public UpdateAPIKeyRequest addRolesItem(String rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + + /** + * A new set of roles for the API key. Existing roles will be removed if not included. If this field is omitted, the roles will not be updated. + * @return roles + **/ + @javax.annotation.Nullable + public List getRoles() { + return roles; + } + + + public void setRoles(List roles) { + this.roles = roles; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateAPIKeyRequest instance itself + */ + public UpdateAPIKeyRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAPIKeyRequest updateAPIKeyRequest = (UpdateAPIKeyRequest) o; + return Objects.equals(this.name, updateAPIKeyRequest.name) && + Objects.equals(this.roles, updateAPIKeyRequest.roles)&& + Objects.equals(this.additionalProperties, updateAPIKeyRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, roles, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAPIKeyRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("roles"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateAPIKeyRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateAPIKeyRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateAPIKeyRequest is not found in the empty JSON string", UpdateAPIKeyRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("roles") != null && !jsonObj.get("roles").isJsonNull() && !jsonObj.get("roles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateAPIKeyRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateAPIKeyRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateAPIKeyRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateAPIKeyRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateAPIKeyRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateAPIKeyRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateAPIKeyRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateAPIKeyRequest + * @throws IOException if the JSON string is invalid with respect to UpdateAPIKeyRequest + */ + public static UpdateAPIKeyRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateAPIKeyRequest.class); + } + + /** + * Convert an instance of UpdateAPIKeyRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/admin/client/model/UpdateOrganizationRequest.java b/src/main/java/org/openapitools/admin/client/model/UpdateOrganizationRequest.java new file mode 100644 index 00000000..4d9dd38f --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/model/UpdateOrganizationRequest.java @@ -0,0 +1,284 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.admin.client.JSON; + +/** + * UpdateOrganizationRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class UpdateOrganizationRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public UpdateOrganizationRequest() { + } + + public UpdateOrganizationRequest name(String name) { + + this.name = name; + return this; + } + + /** + * The new name for the organization. + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateOrganizationRequest instance itself + */ + public UpdateOrganizationRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOrganizationRequest updateOrganizationRequest = (UpdateOrganizationRequest) o; + return Objects.equals(this.name, updateOrganizationRequest.name)&& + Objects.equals(this.additionalProperties, updateOrganizationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateOrganizationRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateOrganizationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateOrganizationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateOrganizationRequest is not found in the empty JSON string", UpdateOrganizationRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateOrganizationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateOrganizationRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateOrganizationRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateOrganizationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateOrganizationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateOrganizationRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateOrganizationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateOrganizationRequest + * @throws IOException if the JSON string is invalid with respect to UpdateOrganizationRequest + */ + public static UpdateOrganizationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateOrganizationRequest.class); + } + + /** + * Convert an instance of UpdateOrganizationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/admin/client/model/UpdateProjectRequest.java b/src/main/java/org/openapitools/admin/client/model/UpdateProjectRequest.java new file mode 100644 index 00000000..7a35e29c --- /dev/null +++ b/src/main/java/org/openapitools/admin/client/model/UpdateProjectRequest.java @@ -0,0 +1,340 @@ +/* + * Pinecone Admin API + * Provides an API for managing a Pinecone organization and its resources. + * + * The version of the OpenAPI document: 2025-04 + * Contact: support@pinecone.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.admin.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.admin.client.JSON; + +/** + * UpdateProjectRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:31.311467Z[Etc/UTC]") +public class UpdateProjectRequest { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_MAX_PODS = "max_pods"; + @SerializedName(SERIALIZED_NAME_MAX_PODS) + private Integer maxPods; + + public static final String SERIALIZED_NAME_FORCE_ENCRYPTION_WITH_CMEK = "force_encryption_with_cmek"; + @SerializedName(SERIALIZED_NAME_FORCE_ENCRYPTION_WITH_CMEK) + private Boolean forceEncryptionWithCmek; + + public UpdateProjectRequest() { + } + + public UpdateProjectRequest name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the new project. + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public UpdateProjectRequest maxPods(Integer maxPods) { + + this.maxPods = maxPods; + return this; + } + + /** + * The maximum number of Pods that can be created in the project. + * @return maxPods + **/ + @javax.annotation.Nullable + public Integer getMaxPods() { + return maxPods; + } + + + public void setMaxPods(Integer maxPods) { + this.maxPods = maxPods; + } + + + public UpdateProjectRequest forceEncryptionWithCmek(Boolean forceEncryptionWithCmek) { + + this.forceEncryptionWithCmek = forceEncryptionWithCmek; + return this; + } + + /** + * Whether to force encryption with a customer-managed encryption key (CMEK). Once enabled, CMEK encryption cannot be disabled. + * @return forceEncryptionWithCmek + **/ + @javax.annotation.Nullable + public Boolean getForceEncryptionWithCmek() { + return forceEncryptionWithCmek; + } + + + public void setForceEncryptionWithCmek(Boolean forceEncryptionWithCmek) { + this.forceEncryptionWithCmek = forceEncryptionWithCmek; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateProjectRequest instance itself + */ + public UpdateProjectRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateProjectRequest updateProjectRequest = (UpdateProjectRequest) o; + return Objects.equals(this.name, updateProjectRequest.name) && + Objects.equals(this.maxPods, updateProjectRequest.maxPods) && + Objects.equals(this.forceEncryptionWithCmek, updateProjectRequest.forceEncryptionWithCmek)&& + Objects.equals(this.additionalProperties, updateProjectRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, maxPods, forceEncryptionWithCmek, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateProjectRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" maxPods: ").append(toIndentedString(maxPods)).append("\n"); + sb.append(" forceEncryptionWithCmek: ").append(toIndentedString(forceEncryptionWithCmek)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("max_pods"); + openapiFields.add("force_encryption_with_cmek"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateProjectRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateProjectRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateProjectRequest is not found in the empty JSON string", UpdateProjectRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateProjectRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateProjectRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateProjectRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateProjectRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateProjectRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateProjectRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateProjectRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateProjectRequest + * @throws IOException if the JSON string is invalid with respect to UpdateProjectRequest + */ + public static UpdateProjectRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateProjectRequest.class); + } + + /** + * Convert an instance of UpdateProjectRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/db_control/client/ApiException.java b/src/main/java/org/openapitools/db_control/client/ApiException.java index 16f807ef..79f6b077 100644 --- a/src/main/java/org/openapitools/db_control/client/ApiException.java +++ b/src/main/java/org/openapitools/db_control/client/ApiException.java @@ -21,7 +21,7 @@ *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; diff --git a/src/main/java/org/openapitools/db_control/client/Configuration.java b/src/main/java/org/openapitools/db_control/client/Configuration.java index 34f7bbdd..742ca580 100644 --- a/src/main/java/org/openapitools/db_control/client/Configuration.java +++ b/src/main/java/org/openapitools/db_control/client/Configuration.java @@ -13,7 +13,7 @@ package org.openapitools.db_control.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class Configuration { public static final String VERSION = "2025-04"; diff --git a/src/main/java/org/openapitools/db_control/client/Pair.java b/src/main/java/org/openapitools/db_control/client/Pair.java index 04eaa37e..59a4ff47 100644 --- a/src/main/java/org/openapitools/db_control/client/Pair.java +++ b/src/main/java/org/openapitools/db_control/client/Pair.java @@ -13,7 +13,7 @@ package org.openapitools.db_control.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/org/openapitools/db_control/client/StringUtil.java b/src/main/java/org/openapitools/db_control/client/StringUtil.java index 85bd0759..4c5ebc30 100644 --- a/src/main/java/org/openapitools/db_control/client/StringUtil.java +++ b/src/main/java/org/openapitools/db_control/client/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/org/openapitools/db_control/client/auth/ApiKeyAuth.java b/src/main/java/org/openapitools/db_control/client/auth/ApiKeyAuth.java index ecc29384..4a6bf676 100644 --- a/src/main/java/org/openapitools/db_control/client/auth/ApiKeyAuth.java +++ b/src/main/java/org/openapitools/db_control/client/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/org/openapitools/db_control/client/auth/HttpBearerAuth.java b/src/main/java/org/openapitools/db_control/client/auth/HttpBearerAuth.java index 6a74235e..2c6b6594 100644 --- a/src/main/java/org/openapitools/db_control/client/auth/HttpBearerAuth.java +++ b/src/main/java/org/openapitools/db_control/client/auth/HttpBearerAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; diff --git a/src/main/java/org/openapitools/db_control/client/model/AbstractOpenApiSchema.java b/src/main/java/org/openapitools/db_control/client/model/AbstractOpenApiSchema.java index 632d203a..7c0a3b8c 100644 --- a/src/main/java/org/openapitools/db_control/client/model/AbstractOpenApiSchema.java +++ b/src/main/java/org/openapitools/db_control/client/model/AbstractOpenApiSchema.java @@ -23,7 +23,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/src/main/java/org/openapitools/db_control/client/model/BackupList.java b/src/main/java/org/openapitools/db_control/client/model/BackupList.java index 7b85d129..c1aa58ac 100644 --- a/src/main/java/org/openapitools/db_control/client/model/BackupList.java +++ b/src/main/java/org/openapitools/db_control/client/model/BackupList.java @@ -53,7 +53,7 @@ /** * The list of backups that exist in the project. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class BackupList { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) diff --git a/src/main/java/org/openapitools/db_control/client/model/BackupModel.java b/src/main/java/org/openapitools/db_control/client/model/BackupModel.java index da016430..de1820a6 100644 --- a/src/main/java/org/openapitools/db_control/client/model/BackupModel.java +++ b/src/main/java/org/openapitools/db_control/client/model/BackupModel.java @@ -51,7 +51,7 @@ /** * The BackupModel describes the configuration and status of a Pinecone backup. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class BackupModel { public static final String SERIALIZED_NAME_BACKUP_ID = "backup_id"; @SerializedName(SERIALIZED_NAME_BACKUP_ID) diff --git a/src/main/java/org/openapitools/db_control/client/model/ByocSpec.java b/src/main/java/org/openapitools/db_control/client/model/ByocSpec.java index 0f27c99d..1ee30ae4 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ByocSpec.java +++ b/src/main/java/org/openapitools/db_control/client/model/ByocSpec.java @@ -49,7 +49,7 @@ /** * Configuration needed to deploy an index in a BYOC environment. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class ByocSpec { public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; @SerializedName(SERIALIZED_NAME_ENVIRONMENT) diff --git a/src/main/java/org/openapitools/db_control/client/model/CollectionList.java b/src/main/java/org/openapitools/db_control/client/model/CollectionList.java index 5f3ab79c..0ec29ecf 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CollectionList.java +++ b/src/main/java/org/openapitools/db_control/client/model/CollectionList.java @@ -52,7 +52,7 @@ /** * The list of collections that exist in the project. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class CollectionList { public static final String SERIALIZED_NAME_COLLECTIONS = "collections"; @SerializedName(SERIALIZED_NAME_COLLECTIONS) diff --git a/src/main/java/org/openapitools/db_control/client/model/CollectionModel.java b/src/main/java/org/openapitools/db_control/client/model/CollectionModel.java index f5e5232d..dbf88f15 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CollectionModel.java +++ b/src/main/java/org/openapitools/db_control/client/model/CollectionModel.java @@ -49,7 +49,7 @@ /** * The CollectionModel describes the configuration and status of a Pinecone collection. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class CollectionModel { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) diff --git a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequest.java b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequest.java index 9cd983b5..d7834729 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequest.java +++ b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequest.java @@ -54,7 +54,7 @@ /** * Configuration used to scale an index. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class ConfigureIndexRequest { public static final String SERIALIZED_NAME_SPEC = "spec"; @SerializedName(SERIALIZED_NAME_SPEC) diff --git a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestEmbed.java b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestEmbed.java index 16c0f26e..ee1f4325 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestEmbed.java +++ b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestEmbed.java @@ -49,7 +49,7 @@ /** * Configure the integrated inference embedding settings for this index. You can convert an existing index to an integrated index by specifying the embedding model and field_map. The index vector type and dimension must match the model vector type and dimension, and the index similarity metric must be supported by the model. Refer to the [model guide](https://docs.pinecone.io/guides/index-data/create-an-index#embedding-models) for available models and model details. You can later change the embedding configuration to update the field map, read parameters, or write parameters. Once set, the model cannot be changed. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class ConfigureIndexRequestEmbed { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) diff --git a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpec.java b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpec.java index 8c0ad7e7..e82d7ded 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpec.java +++ b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpec.java @@ -50,7 +50,7 @@ /** * ConfigureIndexRequestSpec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class ConfigureIndexRequestSpec { public static final String SERIALIZED_NAME_POD = "pod"; @SerializedName(SERIALIZED_NAME_POD) diff --git a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpecPod.java b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpecPod.java index 00a99dd7..906b17a3 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpecPod.java +++ b/src/main/java/org/openapitools/db_control/client/model/ConfigureIndexRequestSpecPod.java @@ -49,7 +49,7 @@ /** * ConfigureIndexRequestSpecPod */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class ConfigureIndexRequestSpecPod { public static final String SERIALIZED_NAME_REPLICAS = "replicas"; @SerializedName(SERIALIZED_NAME_REPLICAS) diff --git a/src/main/java/org/openapitools/db_control/client/model/CreateBackupRequest.java b/src/main/java/org/openapitools/db_control/client/model/CreateBackupRequest.java index fc626925..77654384 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CreateBackupRequest.java +++ b/src/main/java/org/openapitools/db_control/client/model/CreateBackupRequest.java @@ -49,7 +49,7 @@ /** * The configuration needed to create a backup of an index. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class CreateBackupRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) diff --git a/src/main/java/org/openapitools/db_control/client/model/CreateCollectionRequest.java b/src/main/java/org/openapitools/db_control/client/model/CreateCollectionRequest.java index fdd0671a..2ded5a30 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CreateCollectionRequest.java +++ b/src/main/java/org/openapitools/db_control/client/model/CreateCollectionRequest.java @@ -49,7 +49,7 @@ /** * The configuration needed to create a Pinecone collection. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class CreateCollectionRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) diff --git a/src/main/java/org/openapitools/db_control/client/model/CreateIndexForModelRequest.java b/src/main/java/org/openapitools/db_control/client/model/CreateIndexForModelRequest.java index 255d9d62..c74c1e24 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CreateIndexForModelRequest.java +++ b/src/main/java/org/openapitools/db_control/client/model/CreateIndexForModelRequest.java @@ -53,7 +53,7 @@ /** * The desired configuration for the index and associated embedding model. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class CreateIndexForModelRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) diff --git a/src/main/java/org/openapitools/db_control/client/model/CreateIndexForModelRequestEmbed.java b/src/main/java/org/openapitools/db_control/client/model/CreateIndexForModelRequestEmbed.java index 8efae735..317d74bd 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CreateIndexForModelRequestEmbed.java +++ b/src/main/java/org/openapitools/db_control/client/model/CreateIndexForModelRequestEmbed.java @@ -49,7 +49,7 @@ /** * Specify the integrated inference embedding configuration for the index. Once set the model cannot be changed, but you can later update the embedding configuration for an integrated inference index including field map, read parameters, or write parameters. Refer to the [model guide](https://docs.pinecone.io/guides/index-data/create-an-index#embedding-models) for available models and model details. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class CreateIndexForModelRequestEmbed { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) diff --git a/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupRequest.java b/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupRequest.java index 4427cb68..3e21c248 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupRequest.java +++ b/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupRequest.java @@ -52,7 +52,7 @@ /** * The configuration needed to create a Pinecone index from a backup. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class CreateIndexFromBackupRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) diff --git a/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupResponse.java b/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupResponse.java index 2afa2964..877abfa4 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupResponse.java +++ b/src/main/java/org/openapitools/db_control/client/model/CreateIndexFromBackupResponse.java @@ -49,7 +49,7 @@ /** * The response for creating an index from a backup. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class CreateIndexFromBackupResponse { public static final String SERIALIZED_NAME_RESTORE_JOB_ID = "restore_job_id"; @SerializedName(SERIALIZED_NAME_RESTORE_JOB_ID) diff --git a/src/main/java/org/openapitools/db_control/client/model/CreateIndexRequest.java b/src/main/java/org/openapitools/db_control/client/model/CreateIndexRequest.java index 7966cb51..c4841060 100644 --- a/src/main/java/org/openapitools/db_control/client/model/CreateIndexRequest.java +++ b/src/main/java/org/openapitools/db_control/client/model/CreateIndexRequest.java @@ -53,7 +53,7 @@ /** * The configuration needed to create a Pinecone index. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class CreateIndexRequest { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) diff --git a/src/main/java/org/openapitools/db_control/client/model/ErrorResponse.java b/src/main/java/org/openapitools/db_control/client/model/ErrorResponse.java index 6df0386b..f465f898 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ErrorResponse.java +++ b/src/main/java/org/openapitools/db_control/client/model/ErrorResponse.java @@ -50,7 +50,7 @@ /** * The response shape used for all error responses. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class ErrorResponse { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) diff --git a/src/main/java/org/openapitools/db_control/client/model/ErrorResponseError.java b/src/main/java/org/openapitools/db_control/client/model/ErrorResponseError.java index 05d5722a..7019315c 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ErrorResponseError.java +++ b/src/main/java/org/openapitools/db_control/client/model/ErrorResponseError.java @@ -49,7 +49,7 @@ /** * Detailed information about the error that occurred. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class ErrorResponseError { /** * Gets or Sets code diff --git a/src/main/java/org/openapitools/db_control/client/model/IndexList.java b/src/main/java/org/openapitools/db_control/client/model/IndexList.java index c215f30d..43cbcdad 100644 --- a/src/main/java/org/openapitools/db_control/client/model/IndexList.java +++ b/src/main/java/org/openapitools/db_control/client/model/IndexList.java @@ -52,7 +52,7 @@ /** * The list of indexes that exist in the project. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class IndexList { public static final String SERIALIZED_NAME_INDEXES = "indexes"; @SerializedName(SERIALIZED_NAME_INDEXES) diff --git a/src/main/java/org/openapitools/db_control/client/model/IndexModel.java b/src/main/java/org/openapitools/db_control/client/model/IndexModel.java index 33c61d51..24c4a802 100644 --- a/src/main/java/org/openapitools/db_control/client/model/IndexModel.java +++ b/src/main/java/org/openapitools/db_control/client/model/IndexModel.java @@ -55,7 +55,7 @@ /** * The IndexModel describes the configuration and status of a Pinecone index. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class IndexModel { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -122,6 +122,10 @@ public MetricEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_HOST) private String host; + public static final String SERIALIZED_NAME_PRIVATE_HOST = "private_host"; + @SerializedName(SERIALIZED_NAME_PRIVATE_HOST) + private String privateHost; + public static final String SERIALIZED_NAME_DELETION_PROTECTION = "deletion_protection"; @SerializedName(SERIALIZED_NAME_DELETION_PROTECTION) private DeletionProtection deletionProtection = DeletionProtection.DISABLED; @@ -235,6 +239,27 @@ public void setHost(String host) { } + public IndexModel privateHost(String privateHost) { + + this.privateHost = privateHost; + return this; + } + + /** + * The private endpoint URL of an index. + * @return privateHost + **/ + @javax.annotation.Nullable + public String getPrivateHost() { + return privateHost; + } + + + public void setPrivateHost(String privateHost) { + this.privateHost = privateHost; + } + + public IndexModel deletionProtection(DeletionProtection deletionProtection) { this.deletionProtection = deletionProtection; @@ -427,6 +452,7 @@ public boolean equals(Object o) { Objects.equals(this.dimension, indexModel.dimension) && Objects.equals(this.metric, indexModel.metric) && Objects.equals(this.host, indexModel.host) && + Objects.equals(this.privateHost, indexModel.privateHost) && Objects.equals(this.deletionProtection, indexModel.deletionProtection) && Objects.equals(this.tags, indexModel.tags) && Objects.equals(this.embed, indexModel.embed) && @@ -438,7 +464,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(name, dimension, metric, host, deletionProtection, tags, embed, spec, status, vectorType, additionalProperties); + return Objects.hash(name, dimension, metric, host, privateHost, deletionProtection, tags, embed, spec, status, vectorType, additionalProperties); } @Override @@ -449,6 +475,7 @@ public String toString() { sb.append(" dimension: ").append(toIndentedString(dimension)).append("\n"); sb.append(" metric: ").append(toIndentedString(metric)).append("\n"); sb.append(" host: ").append(toIndentedString(host)).append("\n"); + sb.append(" privateHost: ").append(toIndentedString(privateHost)).append("\n"); sb.append(" deletionProtection: ").append(toIndentedString(deletionProtection)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" embed: ").append(toIndentedString(embed)).append("\n"); @@ -482,6 +509,7 @@ private String toIndentedString(Object o) { openapiFields.add("dimension"); openapiFields.add("metric"); openapiFields.add("host"); + openapiFields.add("private_host"); openapiFields.add("deletion_protection"); openapiFields.add("tags"); openapiFields.add("embed"); @@ -528,6 +556,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("host").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `host` to be a primitive type in the JSON string but got `%s`", jsonObj.get("host").toString())); } + if ((jsonObj.get("private_host") != null && !jsonObj.get("private_host").isJsonNull()) && !jsonObj.get("private_host").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `private_host` to be a primitive type in the JSON string but got `%s`", jsonObj.get("private_host").toString())); + } // validate the optional field `embed` if (jsonObj.get("embed") != null && !jsonObj.get("embed").isJsonNull()) { ModelIndexEmbed.validateJsonElement(jsonObj.get("embed")); diff --git a/src/main/java/org/openapitools/db_control/client/model/IndexModelSpec.java b/src/main/java/org/openapitools/db_control/client/model/IndexModelSpec.java index ce2ec32a..2901235c 100644 --- a/src/main/java/org/openapitools/db_control/client/model/IndexModelSpec.java +++ b/src/main/java/org/openapitools/db_control/client/model/IndexModelSpec.java @@ -52,7 +52,7 @@ /** * IndexModelSpec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class IndexModelSpec { public static final String SERIALIZED_NAME_BYOC = "byoc"; @SerializedName(SERIALIZED_NAME_BYOC) diff --git a/src/main/java/org/openapitools/db_control/client/model/IndexModelStatus.java b/src/main/java/org/openapitools/db_control/client/model/IndexModelStatus.java index f8088146..b07807f2 100644 --- a/src/main/java/org/openapitools/db_control/client/model/IndexModelStatus.java +++ b/src/main/java/org/openapitools/db_control/client/model/IndexModelStatus.java @@ -49,7 +49,7 @@ /** * IndexModelStatus */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class IndexModelStatus { public static final String SERIALIZED_NAME_READY = "ready"; @SerializedName(SERIALIZED_NAME_READY) diff --git a/src/main/java/org/openapitools/db_control/client/model/IndexSpec.java b/src/main/java/org/openapitools/db_control/client/model/IndexSpec.java index 69f5efb9..01d67990 100644 --- a/src/main/java/org/openapitools/db_control/client/model/IndexSpec.java +++ b/src/main/java/org/openapitools/db_control/client/model/IndexSpec.java @@ -52,7 +52,7 @@ /** * The spec object defines how the index should be deployed. For serverless indexes, you set only the [cloud and region](http://docs.pinecone.io/guides/index-data/create-an-index#cloud-regions) where the index should be hosted. For pod-based indexes, you set the [environment](http://docs.pinecone.io/guides/indexes/pods/understanding-pod-based-indexes#pod-environments) where the index should be hosted, the [pod type and size](http://docs.pinecone.io/guides/indexes/pods/understanding-pod-based-indexes#pod-types) to use, and other index characteristics. For [BYOC indexes](http://docs.pinecone.io/guides/production/bring-your-own-cloud), you set the environment name provided to you during onboarding. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class IndexSpec { public static final String SERIALIZED_NAME_SERVERLESS = "serverless"; @SerializedName(SERIALIZED_NAME_SERVERLESS) diff --git a/src/main/java/org/openapitools/db_control/client/model/ModelIndexEmbed.java b/src/main/java/org/openapitools/db_control/client/model/ModelIndexEmbed.java index 42aa67ec..099f5f30 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ModelIndexEmbed.java +++ b/src/main/java/org/openapitools/db_control/client/model/ModelIndexEmbed.java @@ -49,7 +49,7 @@ /** * The embedding model and document fields mapped to embedding inputs. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class ModelIndexEmbed { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) diff --git a/src/main/java/org/openapitools/db_control/client/model/PaginationResponse.java b/src/main/java/org/openapitools/db_control/client/model/PaginationResponse.java index 8d85c7c7..6044a9af 100644 --- a/src/main/java/org/openapitools/db_control/client/model/PaginationResponse.java +++ b/src/main/java/org/openapitools/db_control/client/model/PaginationResponse.java @@ -49,7 +49,7 @@ /** * The pagination object that is returned with paginated responses. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class PaginationResponse { public static final String SERIALIZED_NAME_NEXT = "next"; @SerializedName(SERIALIZED_NAME_NEXT) diff --git a/src/main/java/org/openapitools/db_control/client/model/PodSpec.java b/src/main/java/org/openapitools/db_control/client/model/PodSpec.java index 87c8414b..a3002300 100644 --- a/src/main/java/org/openapitools/db_control/client/model/PodSpec.java +++ b/src/main/java/org/openapitools/db_control/client/model/PodSpec.java @@ -50,7 +50,7 @@ /** * Configuration needed to deploy a pod-based index. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class PodSpec { public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; @SerializedName(SERIALIZED_NAME_ENVIRONMENT) diff --git a/src/main/java/org/openapitools/db_control/client/model/PodSpecMetadataConfig.java b/src/main/java/org/openapitools/db_control/client/model/PodSpecMetadataConfig.java index 45f9956f..56a8b584 100644 --- a/src/main/java/org/openapitools/db_control/client/model/PodSpecMetadataConfig.java +++ b/src/main/java/org/openapitools/db_control/client/model/PodSpecMetadataConfig.java @@ -51,7 +51,7 @@ /** * Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when `metadata_config` is present, only specified metadata fields are indexed. These configurations are only valid for use with pod-based indexes. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class PodSpecMetadataConfig { public static final String SERIALIZED_NAME_INDEXED = "indexed"; @SerializedName(SERIALIZED_NAME_INDEXED) diff --git a/src/main/java/org/openapitools/db_control/client/model/RestoreJobList.java b/src/main/java/org/openapitools/db_control/client/model/RestoreJobList.java index 6ae2a72f..baa14987 100644 --- a/src/main/java/org/openapitools/db_control/client/model/RestoreJobList.java +++ b/src/main/java/org/openapitools/db_control/client/model/RestoreJobList.java @@ -53,7 +53,7 @@ /** * The list of restore jobs that exist in the project. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class RestoreJobList { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) diff --git a/src/main/java/org/openapitools/db_control/client/model/RestoreJobModel.java b/src/main/java/org/openapitools/db_control/client/model/RestoreJobModel.java index d2822de9..308dd2bd 100644 --- a/src/main/java/org/openapitools/db_control/client/model/RestoreJobModel.java +++ b/src/main/java/org/openapitools/db_control/client/model/RestoreJobModel.java @@ -50,7 +50,7 @@ /** * The RestoreJobModel describes the status of a restore job. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class RestoreJobModel { public static final String SERIALIZED_NAME_RESTORE_JOB_ID = "restore_job_id"; @SerializedName(SERIALIZED_NAME_RESTORE_JOB_ID) diff --git a/src/main/java/org/openapitools/db_control/client/model/ServerlessSpec.java b/src/main/java/org/openapitools/db_control/client/model/ServerlessSpec.java index 3eca9021..5d9dfc6a 100644 --- a/src/main/java/org/openapitools/db_control/client/model/ServerlessSpec.java +++ b/src/main/java/org/openapitools/db_control/client/model/ServerlessSpec.java @@ -49,7 +49,7 @@ /** * Configuration needed to deploy a serverless index. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:13.211110Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:26.361685Z[Etc/UTC]") public class ServerlessSpec { /** * The public cloud where you would like your index hosted. @@ -108,6 +108,10 @@ public CloudEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_REGION) private String region; + public static final String SERIALIZED_NAME_SOURCE_COLLECTION = "source_collection"; + @SerializedName(SERIALIZED_NAME_SOURCE_COLLECTION) + private String sourceCollection; + public ServerlessSpec() { } @@ -152,6 +156,27 @@ public void setRegion(String region) { this.region = region; } + + public ServerlessSpec sourceCollection(String sourceCollection) { + + this.sourceCollection = sourceCollection; + return this; + } + + /** + * The name of the collection to be used as the source for the index. + * @return sourceCollection + **/ + @javax.annotation.Nullable + public String getSourceCollection() { + return sourceCollection; + } + + + public void setSourceCollection(String sourceCollection) { + this.sourceCollection = sourceCollection; + } + /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -208,13 +233,14 @@ public boolean equals(Object o) { } ServerlessSpec serverlessSpec = (ServerlessSpec) o; return Objects.equals(this.cloud, serverlessSpec.cloud) && - Objects.equals(this.region, serverlessSpec.region)&& + Objects.equals(this.region, serverlessSpec.region) && + Objects.equals(this.sourceCollection, serverlessSpec.sourceCollection)&& Objects.equals(this.additionalProperties, serverlessSpec.additionalProperties); } @Override public int hashCode() { - return Objects.hash(cloud, region, additionalProperties); + return Objects.hash(cloud, region, sourceCollection, additionalProperties); } @Override @@ -223,6 +249,7 @@ public String toString() { sb.append("class ServerlessSpec {\n"); sb.append(" cloud: ").append(toIndentedString(cloud)).append("\n"); sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" sourceCollection: ").append(toIndentedString(sourceCollection)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -248,6 +275,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("cloud"); openapiFields.add("region"); + openapiFields.add("source_collection"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -281,6 +309,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("region").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("region").toString())); } + if ((jsonObj.get("source_collection") != null && !jsonObj.get("source_collection").isJsonNull()) && !jsonObj.get("source_collection").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `source_collection` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source_collection").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/org/openapitools/db_data/client/ApiException.java b/src/main/java/org/openapitools/db_data/client/ApiException.java index 58a6e069..3d8155d8 100644 --- a/src/main/java/org/openapitools/db_data/client/ApiException.java +++ b/src/main/java/org/openapitools/db_data/client/ApiException.java @@ -21,7 +21,7 @@ *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; diff --git a/src/main/java/org/openapitools/db_data/client/Configuration.java b/src/main/java/org/openapitools/db_data/client/Configuration.java index 39f15c8e..de744cdc 100644 --- a/src/main/java/org/openapitools/db_data/client/Configuration.java +++ b/src/main/java/org/openapitools/db_data/client/Configuration.java @@ -13,7 +13,7 @@ package org.openapitools.db_data.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class Configuration { public static final String VERSION = "2025-04"; diff --git a/src/main/java/org/openapitools/db_data/client/Pair.java b/src/main/java/org/openapitools/db_data/client/Pair.java index 5745c844..e6d979ff 100644 --- a/src/main/java/org/openapitools/db_data/client/Pair.java +++ b/src/main/java/org/openapitools/db_data/client/Pair.java @@ -13,7 +13,7 @@ package org.openapitools.db_data.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/org/openapitools/db_data/client/StringUtil.java b/src/main/java/org/openapitools/db_data/client/StringUtil.java index ccebcb9a..edc72705 100644 --- a/src/main/java/org/openapitools/db_data/client/StringUtil.java +++ b/src/main/java/org/openapitools/db_data/client/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/org/openapitools/db_data/client/api/NamespaceOperationsApi.java b/src/main/java/org/openapitools/db_data/client/api/NamespaceOperationsApi.java index ed2d1f81..9ba61995 100644 --- a/src/main/java/org/openapitools/db_data/client/api/NamespaceOperationsApi.java +++ b/src/main/java/org/openapitools/db_data/client/api/NamespaceOperationsApi.java @@ -147,7 +147,7 @@ private okhttp3.Call deleteNamespaceValidateBeforeCall(String namespace, final A /** * Delete a namespace - * Delete a namespace from an index. + * Delete a namespace from a serverless index. Deleting a namespace is irreversible; all data in the namespace is permanently deleted. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. * @param namespace The namespace to delete (required) * @return Object * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -167,7 +167,7 @@ public Object deleteNamespace(String namespace) throws ApiException { /** * Delete a namespace - * Delete a namespace from an index. + * Delete a namespace from a serverless index. Deleting a namespace is irreversible; all data in the namespace is permanently deleted. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. * @param namespace The namespace to delete (required) * @return ApiResponse<Object> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -188,7 +188,7 @@ public ApiResponse deleteNamespaceWithHttpInfo(String namespace) throws /** * Delete a namespace (asynchronously) - * Delete a namespace from an index. + * Delete a namespace from a serverless index. Deleting a namespace is irreversible; all data in the namespace is permanently deleted. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. * @param namespace The namespace to delete (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -282,7 +282,7 @@ private okhttp3.Call describeNamespaceValidateBeforeCall(String namespace, final /** * Describe a namespace - * Describe a [namespace](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index, including the total number of vectors in the namespace. + * Describe a namespace in a serverless index, including the total number of vectors in the namespace. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. * @param namespace The namespace to describe (required) * @return NamespaceDescription * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -302,7 +302,7 @@ public NamespaceDescription describeNamespace(String namespace) throws ApiExcept /** * Describe a namespace - * Describe a [namespace](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index, including the total number of vectors in the namespace. + * Describe a namespace in a serverless index, including the total number of vectors in the namespace. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. * @param namespace The namespace to describe (required) * @return ApiResponse<NamespaceDescription> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -323,7 +323,7 @@ public ApiResponse describeNamespaceWithHttpInfo(String na /** * Describe a namespace (asynchronously) - * Describe a [namespace](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index, including the total number of vectors in the namespace. + * Describe a namespace in a serverless index, including the total number of vectors in the namespace. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. * @param namespace The namespace to describe (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -419,7 +419,7 @@ private okhttp3.Call listNamespacesOperationValidateBeforeCall(Integer limit, St /** * List namespaces - * Get a list of all [namespaces](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. + * List all namespaces in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. * @param limit Max number namespaces to return per page. (optional) * @param paginationToken Pagination token to continue a previous listing operation. (optional) * @return ListNamespacesResponse @@ -439,7 +439,7 @@ public ListNamespacesResponse listNamespacesOperation(Integer limit, String pagi /** * List namespaces - * Get a list of all [namespaces](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. + * List all namespaces in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. * @param limit Max number namespaces to return per page. (optional) * @param paginationToken Pagination token to continue a previous listing operation. (optional) * @return ApiResponse<ListNamespacesResponse> @@ -460,7 +460,7 @@ public ApiResponse listNamespacesOperationWithHttpInfo(I /** * List namespaces (asynchronously) - * Get a list of all [namespaces](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. + * List all namespaces in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. * @param limit Max number namespaces to return per page. (optional) * @param paginationToken Pagination token to continue a previous listing operation. (optional) * @param _callback The callback to be executed when the API call finishes diff --git a/src/main/java/org/openapitools/db_data/client/api/VectorOperationsApi.java b/src/main/java/org/openapitools/db_data/client/api/VectorOperationsApi.java index def7e958..10954e0c 100644 --- a/src/main/java/org/openapitools/db_data/client/api/VectorOperationsApi.java +++ b/src/main/java/org/openapitools/db_data/client/api/VectorOperationsApi.java @@ -731,7 +731,7 @@ private okhttp3.Call queryVectorsValidateBeforeCall(QueryRequest queryRequest, f /** * Search with a vector - * Search a namespace using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance and examples, see [Search](https://docs.pinecone.io/guides/search/semantic-search). + * Search a namespace using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview). * @param queryRequest (required) * @return QueryResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -751,7 +751,7 @@ public QueryResponse queryVectors(QueryRequest queryRequest) throws ApiException /** * Search with a vector - * Search a namespace using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance and examples, see [Search](https://docs.pinecone.io/guides/search/semantic-search). + * Search a namespace using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview). * @param queryRequest (required) * @return ApiResponse<QueryResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -772,7 +772,7 @@ public ApiResponse queryVectorsWithHttpInfo(QueryRequest queryReq /** * Search with a vector (asynchronously) - * Search a namespace using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance and examples, see [Search](https://docs.pinecone.io/guides/search/semantic-search). + * Search a namespace using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview). * @param queryRequest (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -873,7 +873,7 @@ private okhttp3.Call searchRecordsNamespaceValidateBeforeCall(String namespace, /** * Search with text - * Search a namespace with a query text, query vector, or record ID and return the most similar records, along with their similarity scores. Optionally, rerank the initial results based on their relevance to the query. Searching with text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). Searching with a query vector or record ID is supported for all indexes. For guidance and examples, see [Search](https://docs.pinecone.io/guides/search/semantic-search). + * Search a namespace with a query text, query vector, or record ID and return the most similar records, along with their similarity scores. Optionally, rerank the initial results based on their relevance to the query. Searching with text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). Searching with a query vector or record ID is supported for all indexes. For guidance, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview). * @param namespace The namespace to search. (required) * @param searchRecordsRequest (required) * @return SearchRecordsResponse @@ -894,7 +894,7 @@ public SearchRecordsResponse searchRecordsNamespace(String namespace, SearchReco /** * Search with text - * Search a namespace with a query text, query vector, or record ID and return the most similar records, along with their similarity scores. Optionally, rerank the initial results based on their relevance to the query. Searching with text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). Searching with a query vector or record ID is supported for all indexes. For guidance and examples, see [Search](https://docs.pinecone.io/guides/search/semantic-search). + * Search a namespace with a query text, query vector, or record ID and return the most similar records, along with their similarity scores. Optionally, rerank the initial results based on their relevance to the query. Searching with text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). Searching with a query vector or record ID is supported for all indexes. For guidance, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview). * @param namespace The namespace to search. (required) * @param searchRecordsRequest (required) * @return ApiResponse<SearchRecordsResponse> @@ -916,7 +916,7 @@ public ApiResponse searchRecordsNamespaceWithHttpInfo(Str /** * Search with text (asynchronously) - * Search a namespace with a query text, query vector, or record ID and return the most similar records, along with their similarity scores. Optionally, rerank the initial results based on their relevance to the query. Searching with text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). Searching with a query vector or record ID is supported for all indexes. For guidance and examples, see [Search](https://docs.pinecone.io/guides/search/semantic-search). + * Search a namespace with a query text, query vector, or record ID and return the most similar records, along with their similarity scores. Optionally, rerank the initial results based on their relevance to the query. Searching with text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). Searching with a query vector or record ID is supported for all indexes. For guidance, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview). * @param namespace The namespace to search. (required) * @param searchRecordsRequest (required) * @param _callback The callback to be executed when the API call finishes @@ -1153,7 +1153,7 @@ private okhttp3.Call upsertRecordsNamespaceValidateBeforeCall(String namespace, /** * Upsert text - * Upsert text into a namespace. Pinecone converts the text to vectors automatically using the hosted embedding model associated with the index. Upserting text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/reference/api/2025-01/control-plane/create_for_model). For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data#upsert-text). + * Upsert text into a namespace. Pinecone converts the text to vectors automatically using the hosted embedding model associated with the index. Upserting text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/reference/api/2025-01/control-plane/create_for_model). For guidance, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data). * @param namespace The namespace to upsert records into. (required) * @param upsertRecord (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -1172,7 +1172,7 @@ public void upsertRecordsNamespace(String namespace, List upsertRe /** * Upsert text - * Upsert text into a namespace. Pinecone converts the text to vectors automatically using the hosted embedding model associated with the index. Upserting text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/reference/api/2025-01/control-plane/create_for_model). For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data#upsert-text). + * Upsert text into a namespace. Pinecone converts the text to vectors automatically using the hosted embedding model associated with the index. Upserting text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/reference/api/2025-01/control-plane/create_for_model). For guidance, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data). * @param namespace The namespace to upsert records into. (required) * @param upsertRecord (required) * @return ApiResponse<Void> @@ -1193,7 +1193,7 @@ public ApiResponse upsertRecordsNamespaceWithHttpInfo(String namespace, Li /** * Upsert text (asynchronously) - * Upsert text into a namespace. Pinecone converts the text to vectors automatically using the hosted embedding model associated with the index. Upserting text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/reference/api/2025-01/control-plane/create_for_model). For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data#upsert-text). + * Upsert text into a namespace. Pinecone converts the text to vectors automatically using the hosted embedding model associated with the index. Upserting text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/reference/api/2025-01/control-plane/create_for_model). For guidance, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data). * @param namespace The namespace to upsert records into. (required) * @param upsertRecord (required) * @param _callback The callback to be executed when the API call finishes @@ -1287,7 +1287,7 @@ private okhttp3.Call upsertVectorsValidateBeforeCall(UpsertRequest upsertRequest /** * Upsert vectors - * Upsert vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data#upsert-vectors). + * Upsert vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data). * @param upsertRequest (required) * @return UpsertResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -1307,7 +1307,7 @@ public UpsertResponse upsertVectors(UpsertRequest upsertRequest) throws ApiExcep /** * Upsert vectors - * Upsert vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data#upsert-vectors). + * Upsert vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data). * @param upsertRequest (required) * @return ApiResponse<UpsertResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -1328,7 +1328,7 @@ public ApiResponse upsertVectorsWithHttpInfo(UpsertRequest upser /** * Upsert vectors (asynchronously) - * Upsert vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data#upsert-vectors). + * Upsert vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data). * @param upsertRequest (required) * @param _callback The callback to be executed when the API call finishes * @return The request call diff --git a/src/main/java/org/openapitools/db_data/client/auth/ApiKeyAuth.java b/src/main/java/org/openapitools/db_data/client/auth/ApiKeyAuth.java index 21b0a552..6632462b 100644 --- a/src/main/java/org/openapitools/db_data/client/auth/ApiKeyAuth.java +++ b/src/main/java/org/openapitools/db_data/client/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/org/openapitools/db_data/client/auth/HttpBearerAuth.java b/src/main/java/org/openapitools/db_data/client/auth/HttpBearerAuth.java index 0b8f4a8f..8f1c2cba 100644 --- a/src/main/java/org/openapitools/db_data/client/auth/HttpBearerAuth.java +++ b/src/main/java/org/openapitools/db_data/client/auth/HttpBearerAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; diff --git a/src/main/java/org/openapitools/db_data/client/model/AbstractOpenApiSchema.java b/src/main/java/org/openapitools/db_data/client/model/AbstractOpenApiSchema.java index 7a64b0cc..91ea03c7 100644 --- a/src/main/java/org/openapitools/db_data/client/model/AbstractOpenApiSchema.java +++ b/src/main/java/org/openapitools/db_data/client/model/AbstractOpenApiSchema.java @@ -23,7 +23,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/src/main/java/org/openapitools/db_data/client/model/DeleteRequest.java b/src/main/java/org/openapitools/db_data/client/model/DeleteRequest.java index 1bfde9b4..7e6cf522 100644 --- a/src/main/java/org/openapitools/db_data/client/model/DeleteRequest.java +++ b/src/main/java/org/openapitools/db_data/client/model/DeleteRequest.java @@ -51,7 +51,7 @@ /** * The request for the `delete` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class DeleteRequest { public static final String SERIALIZED_NAME_IDS = "ids"; @SerializedName(SERIALIZED_NAME_IDS) @@ -150,7 +150,7 @@ public DeleteRequest filter(Object filter) { } /** - * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID. + * If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. See [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata). * @return filter **/ @javax.annotation.Nullable diff --git a/src/main/java/org/openapitools/db_data/client/model/DescribeIndexStatsRequest.java b/src/main/java/org/openapitools/db_data/client/model/DescribeIndexStatsRequest.java index 7db02ffd..3d0d4aa2 100644 --- a/src/main/java/org/openapitools/db_data/client/model/DescribeIndexStatsRequest.java +++ b/src/main/java/org/openapitools/db_data/client/model/DescribeIndexStatsRequest.java @@ -49,7 +49,7 @@ /** * The request for the `describe_index_stats` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class DescribeIndexStatsRequest { public static final String SERIALIZED_NAME_FILTER = "filter"; @SerializedName(SERIALIZED_NAME_FILTER) diff --git a/src/main/java/org/openapitools/db_data/client/model/FetchResponse.java b/src/main/java/org/openapitools/db_data/client/model/FetchResponse.java index 2a3e1a05..f69592ee 100644 --- a/src/main/java/org/openapitools/db_data/client/model/FetchResponse.java +++ b/src/main/java/org/openapitools/db_data/client/model/FetchResponse.java @@ -53,7 +53,7 @@ /** * The response for the `fetch` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class FetchResponse { public static final String SERIALIZED_NAME_VECTORS = "vectors"; @SerializedName(SERIALIZED_NAME_VECTORS) diff --git a/src/main/java/org/openapitools/db_data/client/model/Hit.java b/src/main/java/org/openapitools/db_data/client/model/Hit.java index 7b8d01b3..57107877 100644 --- a/src/main/java/org/openapitools/db_data/client/model/Hit.java +++ b/src/main/java/org/openapitools/db_data/client/model/Hit.java @@ -49,7 +49,7 @@ /** * A record whose vector values are similar to the provided search query. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class Hit { public static final String SERIALIZED_NAME_ID = "_id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/org/openapitools/db_data/client/model/ImportErrorMode.java b/src/main/java/org/openapitools/db_data/client/model/ImportErrorMode.java index 6fb8f885..7ed71304 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ImportErrorMode.java +++ b/src/main/java/org/openapitools/db_data/client/model/ImportErrorMode.java @@ -49,7 +49,7 @@ /** * Indicates how to respond to errors during the import process. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class ImportErrorMode { /** * Indicates how to respond to errors during the import process. diff --git a/src/main/java/org/openapitools/db_data/client/model/ImportModel.java b/src/main/java/org/openapitools/db_data/client/model/ImportModel.java index a3eb13c5..ba380c9b 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ImportModel.java +++ b/src/main/java/org/openapitools/db_data/client/model/ImportModel.java @@ -50,7 +50,7 @@ /** * The model for an import operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class ImportModel { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/org/openapitools/db_data/client/model/IndexDescription.java b/src/main/java/org/openapitools/db_data/client/model/IndexDescription.java index d824cf86..856bb93d 100644 --- a/src/main/java/org/openapitools/db_data/client/model/IndexDescription.java +++ b/src/main/java/org/openapitools/db_data/client/model/IndexDescription.java @@ -52,7 +52,7 @@ /** * The response for the `describe_index_stats` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class IndexDescription { public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; @SerializedName(SERIALIZED_NAME_NAMESPACES) diff --git a/src/main/java/org/openapitools/db_data/client/model/ListImportsResponse.java b/src/main/java/org/openapitools/db_data/client/model/ListImportsResponse.java index 11839919..b4a09545 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ListImportsResponse.java +++ b/src/main/java/org/openapitools/db_data/client/model/ListImportsResponse.java @@ -53,7 +53,7 @@ /** * The response for the `list_imports` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class ListImportsResponse { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) diff --git a/src/main/java/org/openapitools/db_data/client/model/ListItem.java b/src/main/java/org/openapitools/db_data/client/model/ListItem.java index 43a85af4..d05ed335 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ListItem.java +++ b/src/main/java/org/openapitools/db_data/client/model/ListItem.java @@ -49,7 +49,7 @@ /** * ListItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class ListItem { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/org/openapitools/db_data/client/model/ListNamespacesResponse.java b/src/main/java/org/openapitools/db_data/client/model/ListNamespacesResponse.java index 3585e335..49a716a1 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ListNamespacesResponse.java +++ b/src/main/java/org/openapitools/db_data/client/model/ListNamespacesResponse.java @@ -53,7 +53,7 @@ /** * ListNamespacesResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class ListNamespacesResponse { public static final String SERIALIZED_NAME_NAMESPACES = "namespaces"; @SerializedName(SERIALIZED_NAME_NAMESPACES) diff --git a/src/main/java/org/openapitools/db_data/client/model/ListResponse.java b/src/main/java/org/openapitools/db_data/client/model/ListResponse.java index 5d3b65aa..c6f65501 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ListResponse.java +++ b/src/main/java/org/openapitools/db_data/client/model/ListResponse.java @@ -54,7 +54,7 @@ /** * The response for the `list` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class ListResponse { public static final String SERIALIZED_NAME_VECTORS = "vectors"; @SerializedName(SERIALIZED_NAME_VECTORS) diff --git a/src/main/java/org/openapitools/db_data/client/model/NamespaceDescription.java b/src/main/java/org/openapitools/db_data/client/model/NamespaceDescription.java index f3c9b464..f41df3f6 100644 --- a/src/main/java/org/openapitools/db_data/client/model/NamespaceDescription.java +++ b/src/main/java/org/openapitools/db_data/client/model/NamespaceDescription.java @@ -49,7 +49,7 @@ /** * A description of a namespace, including the name and record count. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class NamespaceDescription { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) diff --git a/src/main/java/org/openapitools/db_data/client/model/NamespaceSummary.java b/src/main/java/org/openapitools/db_data/client/model/NamespaceSummary.java index 87b1852a..f5bc18e5 100644 --- a/src/main/java/org/openapitools/db_data/client/model/NamespaceSummary.java +++ b/src/main/java/org/openapitools/db_data/client/model/NamespaceSummary.java @@ -49,7 +49,7 @@ /** * A summary of the contents of a namespace. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class NamespaceSummary { public static final String SERIALIZED_NAME_VECTOR_COUNT = "vectorCount"; @SerializedName(SERIALIZED_NAME_VECTOR_COUNT) diff --git a/src/main/java/org/openapitools/db_data/client/model/Pagination.java b/src/main/java/org/openapitools/db_data/client/model/Pagination.java index 2ec3efb4..6fec5699 100644 --- a/src/main/java/org/openapitools/db_data/client/model/Pagination.java +++ b/src/main/java/org/openapitools/db_data/client/model/Pagination.java @@ -49,7 +49,7 @@ /** * Pagination */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class Pagination { public static final String SERIALIZED_NAME_NEXT = "next"; @SerializedName(SERIALIZED_NAME_NEXT) diff --git a/src/main/java/org/openapitools/db_data/client/model/ProtobufAny.java b/src/main/java/org/openapitools/db_data/client/model/ProtobufAny.java index 4d3467fa..d5d55305 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ProtobufAny.java +++ b/src/main/java/org/openapitools/db_data/client/model/ProtobufAny.java @@ -49,7 +49,7 @@ /** * ProtobufAny */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class ProtobufAny { public static final String SERIALIZED_NAME_TYPE_URL = "typeUrl"; @SerializedName(SERIALIZED_NAME_TYPE_URL) diff --git a/src/main/java/org/openapitools/db_data/client/model/QueryRequest.java b/src/main/java/org/openapitools/db_data/client/model/QueryRequest.java index 441fec35..bd4ad326 100644 --- a/src/main/java/org/openapitools/db_data/client/model/QueryRequest.java +++ b/src/main/java/org/openapitools/db_data/client/model/QueryRequest.java @@ -53,7 +53,7 @@ /** * The request for the `query` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class QueryRequest { public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; @SerializedName(SERIALIZED_NAME_NAMESPACE) diff --git a/src/main/java/org/openapitools/db_data/client/model/QueryResponse.java b/src/main/java/org/openapitools/db_data/client/model/QueryResponse.java index 22436c96..80f7a7fa 100644 --- a/src/main/java/org/openapitools/db_data/client/model/QueryResponse.java +++ b/src/main/java/org/openapitools/db_data/client/model/QueryResponse.java @@ -54,7 +54,7 @@ /** * The response for the `query` operation. These are the matches found for a particular query vector. The matches are ordered from most similar to least similar. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class QueryResponse { public static final String SERIALIZED_NAME_RESULTS = "results"; @Deprecated diff --git a/src/main/java/org/openapitools/db_data/client/model/QueryVector.java b/src/main/java/org/openapitools/db_data/client/model/QueryVector.java index 6773fa7e..cdf11edc 100644 --- a/src/main/java/org/openapitools/db_data/client/model/QueryVector.java +++ b/src/main/java/org/openapitools/db_data/client/model/QueryVector.java @@ -54,7 +54,7 @@ * @deprecated */ @Deprecated -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class QueryVector { public static final String SERIALIZED_NAME_VALUES = "values"; @SerializedName(SERIALIZED_NAME_VALUES) diff --git a/src/main/java/org/openapitools/db_data/client/model/RpcStatus.java b/src/main/java/org/openapitools/db_data/client/model/RpcStatus.java index 20bb1dfe..49613fcf 100644 --- a/src/main/java/org/openapitools/db_data/client/model/RpcStatus.java +++ b/src/main/java/org/openapitools/db_data/client/model/RpcStatus.java @@ -52,7 +52,7 @@ /** * RpcStatus */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class RpcStatus { public static final String SERIALIZED_NAME_CODE = "code"; @SerializedName(SERIALIZED_NAME_CODE) diff --git a/src/main/java/org/openapitools/db_data/client/model/ScoredVector.java b/src/main/java/org/openapitools/db_data/client/model/ScoredVector.java index 5410bb08..92ec9ed5 100644 --- a/src/main/java/org/openapitools/db_data/client/model/ScoredVector.java +++ b/src/main/java/org/openapitools/db_data/client/model/ScoredVector.java @@ -52,7 +52,7 @@ /** * ScoredVector */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class ScoredVector { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequest.java b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequest.java index 8c8e6562..e39c4d15 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequest.java +++ b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequest.java @@ -53,7 +53,7 @@ /** * A search request for records in a specific namespace. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class SearchRecordsRequest { public static final String SERIALIZED_NAME_QUERY = "query"; @SerializedName(SERIALIZED_NAME_QUERY) diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequestQuery.java b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequestQuery.java index 2a65d9d6..ed4250cd 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequestQuery.java +++ b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequestQuery.java @@ -50,7 +50,7 @@ /** * . */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class SearchRecordsRequestQuery { public static final String SERIALIZED_NAME_TOP_K = "top_k"; @SerializedName(SERIALIZED_NAME_TOP_K) diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequestRerank.java b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequestRerank.java index 08388bd5..de28469e 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequestRerank.java +++ b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsRequestRerank.java @@ -53,7 +53,7 @@ /** * Parameters for reranking the initial search results. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class SearchRecordsRequestRerank { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsResponse.java b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsResponse.java index 1afe35ef..d1580513 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsResponse.java +++ b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsResponse.java @@ -51,7 +51,7 @@ /** * The records search response. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class SearchRecordsResponse { public static final String SERIALIZED_NAME_RESULT = "result"; @SerializedName(SERIALIZED_NAME_RESULT) diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsResponseResult.java b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsResponseResult.java index 7d1642f6..b9e19bb0 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsResponseResult.java +++ b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsResponseResult.java @@ -52,7 +52,7 @@ /** * SearchRecordsResponseResult */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class SearchRecordsResponseResult { public static final String SERIALIZED_NAME_HITS = "hits"; @SerializedName(SERIALIZED_NAME_HITS) diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsVector.java b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsVector.java index 43f169d2..e47000f0 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchRecordsVector.java +++ b/src/main/java/org/openapitools/db_data/client/model/SearchRecordsVector.java @@ -51,7 +51,7 @@ /** * SearchRecordsVector */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class SearchRecordsVector { public static final String SERIALIZED_NAME_VALUES = "values"; @SerializedName(SERIALIZED_NAME_VALUES) diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchUsage.java b/src/main/java/org/openapitools/db_data/client/model/SearchUsage.java index 49250b12..8c0b3f5f 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchUsage.java +++ b/src/main/java/org/openapitools/db_data/client/model/SearchUsage.java @@ -49,7 +49,7 @@ /** * SearchUsage */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class SearchUsage { public static final String SERIALIZED_NAME_READ_UNITS = "read_units"; @SerializedName(SERIALIZED_NAME_READ_UNITS) diff --git a/src/main/java/org/openapitools/db_data/client/model/SearchVector.java b/src/main/java/org/openapitools/db_data/client/model/SearchVector.java index fb9f8b68..2400772b 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SearchVector.java +++ b/src/main/java/org/openapitools/db_data/client/model/SearchVector.java @@ -51,7 +51,7 @@ /** * SearchVector */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class SearchVector { public static final String SERIALIZED_NAME_VALUES = "values"; @SerializedName(SERIALIZED_NAME_VALUES) diff --git a/src/main/java/org/openapitools/db_data/client/model/SingleQueryResults.java b/src/main/java/org/openapitools/db_data/client/model/SingleQueryResults.java index bf6684af..b98edbef 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SingleQueryResults.java +++ b/src/main/java/org/openapitools/db_data/client/model/SingleQueryResults.java @@ -52,7 +52,7 @@ /** * SingleQueryResults */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class SingleQueryResults { public static final String SERIALIZED_NAME_MATCHES = "matches"; @SerializedName(SERIALIZED_NAME_MATCHES) diff --git a/src/main/java/org/openapitools/db_data/client/model/SparseValues.java b/src/main/java/org/openapitools/db_data/client/model/SparseValues.java index 67a87bb2..03aa8a9e 100644 --- a/src/main/java/org/openapitools/db_data/client/model/SparseValues.java +++ b/src/main/java/org/openapitools/db_data/client/model/SparseValues.java @@ -51,7 +51,7 @@ /** * Vector sparse data. Represented as a list of indices and a list of corresponded values, which must be with the same length. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class SparseValues { public static final String SERIALIZED_NAME_INDICES = "indices"; @SerializedName(SERIALIZED_NAME_INDICES) diff --git a/src/main/java/org/openapitools/db_data/client/model/StartImportRequest.java b/src/main/java/org/openapitools/db_data/client/model/StartImportRequest.java index 3170abb1..2a6b5762 100644 --- a/src/main/java/org/openapitools/db_data/client/model/StartImportRequest.java +++ b/src/main/java/org/openapitools/db_data/client/model/StartImportRequest.java @@ -50,7 +50,7 @@ /** * The request for the `start_import` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class StartImportRequest { public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) @@ -95,7 +95,7 @@ public StartImportRequest uri(String uri) { } /** - * The [URI prefix](https://docs.pinecone.io/guides/index-data/import-data#prepare-your-data) under which the data to import is available. All data within this prefix will be listed then imported into the target index. Currently only `s3://` URIs are supported. + * The URI of the bucket (or container) and import directory containing the namespaces and Parquet files you want to import. For example, `s3://BUCKET_NAME/IMPORT_DIR` for Amazon S3, `gs://BUCKET_NAME/IMPORT_DIR` for Google Cloud Storage, or `https://STORAGE_ACCOUNT.blob.core.windows.net/CONTAINER_NAME/IMPORT_DIR` for Azure Blob Storage. For more information, see [Import records](https://docs.pinecone.io/guides/index-data/import-data#prepare-your-data). * @return uri **/ @javax.annotation.Nonnull diff --git a/src/main/java/org/openapitools/db_data/client/model/StartImportResponse.java b/src/main/java/org/openapitools/db_data/client/model/StartImportResponse.java index 2519ee44..c7a80132 100644 --- a/src/main/java/org/openapitools/db_data/client/model/StartImportResponse.java +++ b/src/main/java/org/openapitools/db_data/client/model/StartImportResponse.java @@ -49,7 +49,7 @@ /** * The response for the `start_import` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class StartImportResponse { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/org/openapitools/db_data/client/model/UpdateRequest.java b/src/main/java/org/openapitools/db_data/client/model/UpdateRequest.java index 2769225b..9b61b4bf 100644 --- a/src/main/java/org/openapitools/db_data/client/model/UpdateRequest.java +++ b/src/main/java/org/openapitools/db_data/client/model/UpdateRequest.java @@ -52,7 +52,7 @@ /** * The request for the `update` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class UpdateRequest { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/org/openapitools/db_data/client/model/UpsertRecord.java b/src/main/java/org/openapitools/db_data/client/model/UpsertRecord.java index 05833302..380c2b78 100644 --- a/src/main/java/org/openapitools/db_data/client/model/UpsertRecord.java +++ b/src/main/java/org/openapitools/db_data/client/model/UpsertRecord.java @@ -49,7 +49,7 @@ /** * The request for the `upsert` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class UpsertRecord { public static final String SERIALIZED_NAME_ID = "_id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/org/openapitools/db_data/client/model/UpsertRequest.java b/src/main/java/org/openapitools/db_data/client/model/UpsertRequest.java index 64e8da4f..64bbafc2 100644 --- a/src/main/java/org/openapitools/db_data/client/model/UpsertRequest.java +++ b/src/main/java/org/openapitools/db_data/client/model/UpsertRequest.java @@ -52,7 +52,7 @@ /** * The request for the `upsert` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class UpsertRequest { public static final String SERIALIZED_NAME_VECTORS = "vectors"; @SerializedName(SERIALIZED_NAME_VECTORS) @@ -80,7 +80,7 @@ public UpsertRequest addVectorsItem(Vector vectorsItem) { } /** - * An array containing the vectors to upsert. Recommended batch limit is 100 vectors. + * An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors. * @return vectors **/ @javax.annotation.Nonnull diff --git a/src/main/java/org/openapitools/db_data/client/model/UpsertResponse.java b/src/main/java/org/openapitools/db_data/client/model/UpsertResponse.java index 318cc107..d92cca0c 100644 --- a/src/main/java/org/openapitools/db_data/client/model/UpsertResponse.java +++ b/src/main/java/org/openapitools/db_data/client/model/UpsertResponse.java @@ -49,7 +49,7 @@ /** * The response for the `upsert` operation. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class UpsertResponse { public static final String SERIALIZED_NAME_UPSERTED_COUNT = "upsertedCount"; @SerializedName(SERIALIZED_NAME_UPSERTED_COUNT) diff --git a/src/main/java/org/openapitools/db_data/client/model/Usage.java b/src/main/java/org/openapitools/db_data/client/model/Usage.java index 3d09eed8..e885a3ef 100644 --- a/src/main/java/org/openapitools/db_data/client/model/Usage.java +++ b/src/main/java/org/openapitools/db_data/client/model/Usage.java @@ -49,7 +49,7 @@ /** * Usage */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class Usage { public static final String SERIALIZED_NAME_READ_UNITS = "readUnits"; @SerializedName(SERIALIZED_NAME_READ_UNITS) diff --git a/src/main/java/org/openapitools/db_data/client/model/Vector.java b/src/main/java/org/openapitools/db_data/client/model/Vector.java index 23ea788e..4004f565 100644 --- a/src/main/java/org/openapitools/db_data/client/model/Vector.java +++ b/src/main/java/org/openapitools/db_data/client/model/Vector.java @@ -52,7 +52,7 @@ /** * Vector */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:22.496740Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:28.142147Z[Etc/UTC]") public class Vector { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/org/openapitools/inference/client/ApiException.java b/src/main/java/org/openapitools/inference/client/ApiException.java index 97224a48..d2896b56 100644 --- a/src/main/java/org/openapitools/inference/client/ApiException.java +++ b/src/main/java/org/openapitools/inference/client/ApiException.java @@ -21,7 +21,7 @@ *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; diff --git a/src/main/java/org/openapitools/inference/client/Configuration.java b/src/main/java/org/openapitools/inference/client/Configuration.java index 0803810f..12c89561 100644 --- a/src/main/java/org/openapitools/inference/client/Configuration.java +++ b/src/main/java/org/openapitools/inference/client/Configuration.java @@ -13,7 +13,7 @@ package org.openapitools.inference.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class Configuration { public static final String VERSION = "2025-04"; diff --git a/src/main/java/org/openapitools/inference/client/Pair.java b/src/main/java/org/openapitools/inference/client/Pair.java index 60e5aad0..5bf59ae0 100644 --- a/src/main/java/org/openapitools/inference/client/Pair.java +++ b/src/main/java/org/openapitools/inference/client/Pair.java @@ -13,7 +13,7 @@ package org.openapitools.inference.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/org/openapitools/inference/client/StringUtil.java b/src/main/java/org/openapitools/inference/client/StringUtil.java index 5abe3ae4..59123b41 100644 --- a/src/main/java/org/openapitools/inference/client/StringUtil.java +++ b/src/main/java/org/openapitools/inference/client/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/org/openapitools/inference/client/auth/ApiKeyAuth.java b/src/main/java/org/openapitools/inference/client/auth/ApiKeyAuth.java index 8478956a..2081d45c 100644 --- a/src/main/java/org/openapitools/inference/client/auth/ApiKeyAuth.java +++ b/src/main/java/org/openapitools/inference/client/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/org/openapitools/inference/client/auth/HttpBearerAuth.java b/src/main/java/org/openapitools/inference/client/auth/HttpBearerAuth.java index 9ce5e372..e1ce4298 100644 --- a/src/main/java/org/openapitools/inference/client/auth/HttpBearerAuth.java +++ b/src/main/java/org/openapitools/inference/client/auth/HttpBearerAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; diff --git a/src/main/java/org/openapitools/inference/client/model/AbstractOpenApiSchema.java b/src/main/java/org/openapitools/inference/client/model/AbstractOpenApiSchema.java index aeed339c..75249b93 100644 --- a/src/main/java/org/openapitools/inference/client/model/AbstractOpenApiSchema.java +++ b/src/main/java/org/openapitools/inference/client/model/AbstractOpenApiSchema.java @@ -23,7 +23,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/src/main/java/org/openapitools/inference/client/model/DenseEmbedding.java b/src/main/java/org/openapitools/inference/client/model/DenseEmbedding.java index e020495d..1e0bbccf 100644 --- a/src/main/java/org/openapitools/inference/client/model/DenseEmbedding.java +++ b/src/main/java/org/openapitools/inference/client/model/DenseEmbedding.java @@ -51,7 +51,7 @@ /** * A dense embedding of a single input */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class DenseEmbedding { public static final String SERIALIZED_NAME_VALUES = "values"; @SerializedName(SERIALIZED_NAME_VALUES) diff --git a/src/main/java/org/openapitools/inference/client/model/EmbedRequest.java b/src/main/java/org/openapitools/inference/client/model/EmbedRequest.java index 2593c714..346a442e 100644 --- a/src/main/java/org/openapitools/inference/client/model/EmbedRequest.java +++ b/src/main/java/org/openapitools/inference/client/model/EmbedRequest.java @@ -54,7 +54,7 @@ /** * EmbedRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class EmbedRequest { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) diff --git a/src/main/java/org/openapitools/inference/client/model/EmbedRequestInputsInner.java b/src/main/java/org/openapitools/inference/client/model/EmbedRequestInputsInner.java index 4fbd7e7f..f8b98b2c 100644 --- a/src/main/java/org/openapitools/inference/client/model/EmbedRequestInputsInner.java +++ b/src/main/java/org/openapitools/inference/client/model/EmbedRequestInputsInner.java @@ -49,7 +49,7 @@ /** * EmbedRequestInputsInner */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class EmbedRequestInputsInner { public static final String SERIALIZED_NAME_TEXT = "text"; @SerializedName(SERIALIZED_NAME_TEXT) diff --git a/src/main/java/org/openapitools/inference/client/model/Embedding.java b/src/main/java/org/openapitools/inference/client/model/Embedding.java index 84529d3d..b32b6d38 100644 --- a/src/main/java/org/openapitools/inference/client/model/Embedding.java +++ b/src/main/java/org/openapitools/inference/client/model/Embedding.java @@ -61,7 +61,7 @@ import org.openapitools.inference.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class Embedding extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(Embedding.class.getName()); diff --git a/src/main/java/org/openapitools/inference/client/model/EmbeddingsList.java b/src/main/java/org/openapitools/inference/client/model/EmbeddingsList.java index e2575f00..f3c30136 100644 --- a/src/main/java/org/openapitools/inference/client/model/EmbeddingsList.java +++ b/src/main/java/org/openapitools/inference/client/model/EmbeddingsList.java @@ -53,7 +53,7 @@ /** * Embeddings generated for the input. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class EmbeddingsList { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) diff --git a/src/main/java/org/openapitools/inference/client/model/EmbeddingsListUsage.java b/src/main/java/org/openapitools/inference/client/model/EmbeddingsListUsage.java index f8e16f57..bcea1fb4 100644 --- a/src/main/java/org/openapitools/inference/client/model/EmbeddingsListUsage.java +++ b/src/main/java/org/openapitools/inference/client/model/EmbeddingsListUsage.java @@ -49,7 +49,7 @@ /** * Usage statistics for the model inference. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class EmbeddingsListUsage { public static final String SERIALIZED_NAME_TOTAL_TOKENS = "total_tokens"; @SerializedName(SERIALIZED_NAME_TOTAL_TOKENS) diff --git a/src/main/java/org/openapitools/inference/client/model/ErrorResponse.java b/src/main/java/org/openapitools/inference/client/model/ErrorResponse.java index cc0b33af..a75e95af 100644 --- a/src/main/java/org/openapitools/inference/client/model/ErrorResponse.java +++ b/src/main/java/org/openapitools/inference/client/model/ErrorResponse.java @@ -50,7 +50,7 @@ /** * The response shape used for all error responses. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class ErrorResponse { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) diff --git a/src/main/java/org/openapitools/inference/client/model/ErrorResponseError.java b/src/main/java/org/openapitools/inference/client/model/ErrorResponseError.java index 35a1be2b..60c4c61b 100644 --- a/src/main/java/org/openapitools/inference/client/model/ErrorResponseError.java +++ b/src/main/java/org/openapitools/inference/client/model/ErrorResponseError.java @@ -49,7 +49,7 @@ /** * Detailed information about the error that occurred. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class ErrorResponseError { /** * Gets or Sets code diff --git a/src/main/java/org/openapitools/inference/client/model/ModelInfo.java b/src/main/java/org/openapitools/inference/client/model/ModelInfo.java index 15bfd0a8..a9ccc1d6 100644 --- a/src/main/java/org/openapitools/inference/client/model/ModelInfo.java +++ b/src/main/java/org/openapitools/inference/client/model/ModelInfo.java @@ -53,7 +53,7 @@ /** * Represents the model configuration including model type, supported parameters, and other model details. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class ModelInfo { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) diff --git a/src/main/java/org/openapitools/inference/client/model/ModelInfoList.java b/src/main/java/org/openapitools/inference/client/model/ModelInfoList.java index 13167360..e70a3ee3 100644 --- a/src/main/java/org/openapitools/inference/client/model/ModelInfoList.java +++ b/src/main/java/org/openapitools/inference/client/model/ModelInfoList.java @@ -52,7 +52,7 @@ /** * The list of available models. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class ModelInfoList { public static final String SERIALIZED_NAME_MODELS = "models"; @SerializedName(SERIALIZED_NAME_MODELS) diff --git a/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameter.java b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameter.java index a6283480..811db1cc 100644 --- a/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameter.java +++ b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameter.java @@ -54,7 +54,7 @@ /** * Describes a parameter supported by the model, including parameter value constraints. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class ModelInfoSupportedParameter { public static final String SERIALIZED_NAME_PARAMETER = "parameter"; @SerializedName(SERIALIZED_NAME_PARAMETER) diff --git a/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterAllowedValuesInner.java b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterAllowedValuesInner.java index 258ebfd3..cb906880 100644 --- a/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterAllowedValuesInner.java +++ b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterAllowedValuesInner.java @@ -50,7 +50,7 @@ import org.openapitools.inference.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class ModelInfoSupportedParameterAllowedValuesInner extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(ModelInfoSupportedParameterAllowedValuesInner.class.getName()); diff --git a/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterDefault.java b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterDefault.java index f97259c0..0745307c 100644 --- a/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterDefault.java +++ b/src/main/java/org/openapitools/inference/client/model/ModelInfoSupportedParameterDefault.java @@ -50,7 +50,7 @@ import org.openapitools.inference.client.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class ModelInfoSupportedParameterDefault extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(ModelInfoSupportedParameterDefault.class.getName()); diff --git a/src/main/java/org/openapitools/inference/client/model/RankedDocument.java b/src/main/java/org/openapitools/inference/client/model/RankedDocument.java index e5be95d1..3d3c3498 100644 --- a/src/main/java/org/openapitools/inference/client/model/RankedDocument.java +++ b/src/main/java/org/openapitools/inference/client/model/RankedDocument.java @@ -52,7 +52,7 @@ /** * A ranked document with a relevance score and an index position. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class RankedDocument { public static final String SERIALIZED_NAME_INDEX = "index"; @SerializedName(SERIALIZED_NAME_INDEX) diff --git a/src/main/java/org/openapitools/inference/client/model/RerankRequest.java b/src/main/java/org/openapitools/inference/client/model/RerankRequest.java index ff83ac28..0d3d1440 100644 --- a/src/main/java/org/openapitools/inference/client/model/RerankRequest.java +++ b/src/main/java/org/openapitools/inference/client/model/RerankRequest.java @@ -53,7 +53,7 @@ /** * RerankRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class RerankRequest { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) diff --git a/src/main/java/org/openapitools/inference/client/model/RerankResult.java b/src/main/java/org/openapitools/inference/client/model/RerankResult.java index 84c42e9c..07950be3 100644 --- a/src/main/java/org/openapitools/inference/client/model/RerankResult.java +++ b/src/main/java/org/openapitools/inference/client/model/RerankResult.java @@ -53,7 +53,7 @@ /** * The result of a reranking request. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class RerankResult { public static final String SERIALIZED_NAME_MODEL = "model"; @SerializedName(SERIALIZED_NAME_MODEL) diff --git a/src/main/java/org/openapitools/inference/client/model/RerankResultUsage.java b/src/main/java/org/openapitools/inference/client/model/RerankResultUsage.java index 7e2e99ee..4330d391 100644 --- a/src/main/java/org/openapitools/inference/client/model/RerankResultUsage.java +++ b/src/main/java/org/openapitools/inference/client/model/RerankResultUsage.java @@ -49,7 +49,7 @@ /** * Usage statistics for the model inference. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class RerankResultUsage { public static final String SERIALIZED_NAME_RERANK_UNITS = "rerank_units"; @SerializedName(SERIALIZED_NAME_RERANK_UNITS) diff --git a/src/main/java/org/openapitools/inference/client/model/SparseEmbedding.java b/src/main/java/org/openapitools/inference/client/model/SparseEmbedding.java index b280fe88..f9284d80 100644 --- a/src/main/java/org/openapitools/inference/client/model/SparseEmbedding.java +++ b/src/main/java/org/openapitools/inference/client/model/SparseEmbedding.java @@ -51,7 +51,7 @@ /** * A sparse embedding of a single input */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T16:07:32.070880Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-09-22T16:03:29.854319Z[Etc/UTC]") public class SparseEmbedding { public static final String SERIALIZED_NAME_SPARSE_VALUES = "sparse_values"; @SerializedName(SERIALIZED_NAME_SPARSE_VALUES)