From 3e48aa6ed7c65bfbdd9a86f0906b5e6958105c71 Mon Sep 17 00:00:00 2001 From: Jack Ye Date: Tue, 20 May 2025 20:38:49 -0700 Subject: [PATCH 1/2] spec: use dedicated response for DML operations --- .../adapter/ClientToServerResponse.java | 20 ++ .../adapter/NamespaceController.java | 14 +- .../.openapi-generator/FILES | 4 + java/lance-namespace-apache-client/README.md | 4 +- .../api/openapi.yaml | 46 ++- .../docs/CreateNamespaceResponse.md | 15 + .../docs/DropNamespaceResponse.md | 15 + .../docs/NamespaceApi.md | 14 +- .../client/apache/api/NamespaceApi.java | 26 +- .../model/CreateNamespaceResponse.java | 271 ++++++++++++++++++ .../model/DropNamespaceResponse.java | 271 ++++++++++++++++++ .../namespace/client/LanceNamespace.java | 4 +- .../namespace/client/LanceRestNamespace.java | 6 +- .../.openapi-generator/FILES | 2 + .../server/springboot/api/NamespaceApi.java | 48 ++-- .../model/CreateNamespaceResponse.java | 167 +++++++++++ .../model/DropNamespaceResponse.java | 157 ++++++++++ .../.openapi-generator/FILES | 4 + .../lance_namespace_urllib3_client/README.md | 2 + .../docs/CreateNamespaceResponse.md | 31 ++ .../docs/DropNamespaceResponse.md | 31 ++ .../docs/NamespaceApi.md | 13 +- .../__init__.py | 2 + .../api/namespace_api.py | 23 +- .../models/__init__.py | 2 + .../models/create_namespace_response.py | 91 ++++++ .../models/drop_namespace_response.py | 91 ++++++ .../test/test_create_namespace_response.py | 58 ++++ .../test/test_drop_namespace_response.py | 57 ++++ .../.openapi-generator/FILES | 4 + rust/lance-namespace-reqwest-client/README.md | 2 + .../docs/CreateNamespaceResponse.md | 13 + .../docs/DropNamespaceResponse.md | 13 + .../docs/NamespaceApi.md | 8 +- .../src/apis/namespace_api.rs | 12 +- .../src/models/create_namespace_response.rs | 33 +++ .../src/models/drop_namespace_response.rs | 33 +++ .../src/models/mod.rs | 4 + spec/rest.yaml | 37 ++- 39 files changed, 1568 insertions(+), 80 deletions(-) create mode 100644 java/lance-namespace-apache-client/docs/CreateNamespaceResponse.md create mode 100644 java/lance-namespace-apache-client/docs/DropNamespaceResponse.md create mode 100644 java/lance-namespace-apache-client/src/main/java/com/lancedb/lance/namespace/model/CreateNamespaceResponse.java create mode 100644 java/lance-namespace-apache-client/src/main/java/com/lancedb/lance/namespace/model/DropNamespaceResponse.java create mode 100644 java/lance-namespace-springboot-server/src/main/java/com/lancedb/lance/namespace/server/springboot/model/CreateNamespaceResponse.java create mode 100644 java/lance-namespace-springboot-server/src/main/java/com/lancedb/lance/namespace/server/springboot/model/DropNamespaceResponse.java create mode 100644 python/lance_namespace_urllib3_client/docs/CreateNamespaceResponse.md create mode 100644 python/lance_namespace_urllib3_client/docs/DropNamespaceResponse.md create mode 100644 python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_namespace_response.py create mode 100644 python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/drop_namespace_response.py create mode 100644 python/lance_namespace_urllib3_client/test/test_create_namespace_response.py create mode 100644 python/lance_namespace_urllib3_client/test/test_drop_namespace_response.py create mode 100644 rust/lance-namespace-reqwest-client/docs/CreateNamespaceResponse.md create mode 100644 rust/lance-namespace-reqwest-client/docs/DropNamespaceResponse.md create mode 100644 rust/lance-namespace-reqwest-client/src/models/create_namespace_response.rs create mode 100644 rust/lance-namespace-reqwest-client/src/models/drop_namespace_response.rs diff --git a/java/lance-namespace-adapter/src/main/java/com/lancedb/lance/namespace/adapter/ClientToServerResponse.java b/java/lance-namespace-adapter/src/main/java/com/lancedb/lance/namespace/adapter/ClientToServerResponse.java index c2515b1e2..688542278 100644 --- a/java/lance-namespace-adapter/src/main/java/com/lancedb/lance/namespace/adapter/ClientToServerResponse.java +++ b/java/lance-namespace-adapter/src/main/java/com/lancedb/lance/namespace/adapter/ClientToServerResponse.java @@ -13,6 +13,8 @@ */ package com.lancedb.lance.namespace.adapter; +import com.lancedb.lance.namespace.server.springboot.model.CreateNamespaceResponse; +import com.lancedb.lance.namespace.server.springboot.model.DropNamespaceResponse; import com.lancedb.lance.namespace.server.springboot.model.GetNamespaceResponse; import com.lancedb.lance.namespace.server.springboot.model.GetTableResponse; import com.lancedb.lance.namespace.server.springboot.model.ListNamespacesResponse; @@ -38,6 +40,24 @@ public static ListNamespacesResponse listNamespaces( return converted; } + public static CreateNamespaceResponse createNamespace( + com.lancedb.lance.namespace.client.apache.model.CreateNamespaceResponse response) { + CreateNamespaceResponse converted = new CreateNamespaceResponse(); + converted.setParent(response.getParent()); + converted.setProperties(response.getProperties()); + converted.setName(response.getName()); + return converted; + } + + public static DropNamespaceResponse dropNamespace( + com.lancedb.lance.namespace.client.apache.model.DropNamespaceResponse response) { + DropNamespaceResponse converted = new DropNamespaceResponse(); + converted.setParent(response.getParent()); + converted.setProperties(response.getProperties()); + converted.setName(response.getName()); + return converted; + } + public static NamespaceExistsResponse namespaceExists( com.lancedb.lance.namespace.model.NamespaceExistsResponse response) { NamespaceExistsResponse converted = new NamespaceExistsResponse(); diff --git a/java/lance-namespace-adapter/src/main/java/com/lancedb/lance/namespace/adapter/NamespaceController.java b/java/lance-namespace-adapter/src/main/java/com/lancedb/lance/namespace/adapter/NamespaceController.java index a1a165665..2eda9458f 100644 --- a/java/lance-namespace-adapter/src/main/java/com/lancedb/lance/namespace/adapter/NamespaceController.java +++ b/java/lance-namespace-adapter/src/main/java/com/lancedb/lance/namespace/adapter/NamespaceController.java @@ -16,7 +16,9 @@ import com.lancedb.lance.namespace.client.LanceNamespace; import com.lancedb.lance.namespace.server.springboot.api.NamespaceApi; import com.lancedb.lance.namespace.server.springboot.model.CreateNamespaceRequest; +import com.lancedb.lance.namespace.server.springboot.model.CreateNamespaceResponse; import com.lancedb.lance.namespace.server.springboot.model.DropNamespaceRequest; +import com.lancedb.lance.namespace.server.springboot.model.DropNamespaceResponse; import com.lancedb.lance.namespace.server.springboot.model.GetNamespaceRequest; import com.lancedb.lance.namespace.server.springboot.model.GetNamespaceResponse; import com.lancedb.lance.namespace.server.springboot.model.ListNamespacesRequest; @@ -37,18 +39,20 @@ public NamespaceController(LanceNamespace delegate) { } @Override - public ResponseEntity createNamespace( + public ResponseEntity createNamespace( CreateNamespaceRequest createNamespaceRequest) { return ResponseEntity.ok( - ClientToServerResponse.getNamespace( + ClientToServerResponse.createNamespace( delegate.createNamespace( ServerToClientRequest.createNamespace(createNamespaceRequest)))); } @Override - public ResponseEntity dropNamespace(DropNamespaceRequest dropNamespaceRequest) { - delegate.dropNamespace(ServerToClientRequest.dropNamespace(dropNamespaceRequest)); - return ResponseEntity.ok().build(); + public ResponseEntity dropNamespace( + DropNamespaceRequest dropNamespaceRequest) { + return ResponseEntity.ok( + ClientToServerResponse.dropNamespace( + delegate.dropNamespace(ServerToClientRequest.dropNamespace(dropNamespaceRequest)))); } @Override diff --git a/java/lance-namespace-apache-client/.openapi-generator/FILES b/java/lance-namespace-apache-client/.openapi-generator/FILES index 8c644b1ab..d0e4af7b0 100644 --- a/java/lance-namespace-apache-client/.openapi-generator/FILES +++ b/java/lance-namespace-apache-client/.openapi-generator/FILES @@ -2,7 +2,9 @@ README.md api/openapi.yaml docs/CreateNamespaceRequest.md +docs/CreateNamespaceResponse.md docs/DropNamespaceRequest.md +docs/DropNamespaceResponse.md docs/ErrorResponse.md docs/GetNamespaceRequest.md docs/GetNamespaceResponse.md @@ -37,7 +39,9 @@ src/main/java/com/lancedb/lance/namespace/client/apache/auth/Authentication.java src/main/java/com/lancedb/lance/namespace/client/apache/auth/HttpBasicAuth.java src/main/java/com/lancedb/lance/namespace/client/apache/auth/HttpBearerAuth.java src/main/java/com/lancedb/lance/namespace/model/CreateNamespaceRequest.java +src/main/java/com/lancedb/lance/namespace/model/CreateNamespaceResponse.java src/main/java/com/lancedb/lance/namespace/model/DropNamespaceRequest.java +src/main/java/com/lancedb/lance/namespace/model/DropNamespaceResponse.java src/main/java/com/lancedb/lance/namespace/model/ErrorResponse.java src/main/java/com/lancedb/lance/namespace/model/GetNamespaceRequest.java src/main/java/com/lancedb/lance/namespace/model/GetNamespaceResponse.java diff --git a/java/lance-namespace-apache-client/README.md b/java/lance-namespace-apache-client/README.md index ce8288754..ac1db1f9a 100644 --- a/java/lance-namespace-apache-client/README.md +++ b/java/lance-namespace-apache-client/README.md @@ -91,7 +91,7 @@ public class NamespaceApiExample { NamespaceApi apiInstance = new NamespaceApi(defaultClient); CreateNamespaceRequest createNamespaceRequest = new CreateNamespaceRequest(); // CreateNamespaceRequest | try { - GetNamespaceResponse result = apiInstance.createNamespace(createNamespaceRequest); + CreateNamespaceResponse result = apiInstance.createNamespace(createNamespaceRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling NamespaceApi#createNamespace"); @@ -124,7 +124,9 @@ Class | Method | HTTP request | Description ## Documentation for Models - [CreateNamespaceRequest](docs/CreateNamespaceRequest.md) + - [CreateNamespaceResponse](docs/CreateNamespaceResponse.md) - [DropNamespaceRequest](docs/DropNamespaceRequest.md) + - [DropNamespaceResponse](docs/DropNamespaceResponse.md) - [ErrorResponse](docs/ErrorResponse.md) - [GetNamespaceRequest](docs/GetNamespaceRequest.md) - [GetNamespaceResponse](docs/GetNamespaceResponse.md) diff --git a/java/lance-namespace-apache-client/api/openapi.yaml b/java/lance-namespace-apache-client/api/openapi.yaml index a6d293be7..8561b10fd 100644 --- a/java/lance-namespace-apache-client/api/openapi.yaml +++ b/java/lance-namespace-apache-client/api/openapi.yaml @@ -52,7 +52,7 @@ paths: required: true responses: "200": - $ref: '#/components/responses/GetNamespaceResponse' + $ref: '#/components/responses/CreateNamespaceResponse' "400": $ref: '#/components/responses/BadRequestErrorResponse' "401": @@ -333,6 +333,12 @@ components: $ref: '#/components/schemas/GetNamespaceResponse' description: "Returns a namespace, as well as any properties stored on the namespace\ \ if namespace properties are supported by the server." + CreateNamespaceResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateNamespaceResponse' + description: Result of creating a namespace DropNamespaceResponse: content: application/json: @@ -531,6 +537,26 @@ components: required: - mode - name + CreateNamespaceResponse: + example: + parent: + - parent + - parent + name: name + properties: + key: properties + properties: + name: + type: string + parent: + items: + type: string + type: array + properties: + additionalProperties: + type: string + required: + - name ListNamespacesRequest: example: parent: @@ -640,7 +666,23 @@ components: required: - name DropNamespaceResponse: - type: object + example: + parent: + - parent + - parent + name: name + properties: + key: properties + properties: + name: + type: string + parent: + items: + type: string + type: array + properties: + additionalProperties: + type: string NamespaceExistsRequest: example: parent: diff --git a/java/lance-namespace-apache-client/docs/CreateNamespaceResponse.md b/java/lance-namespace-apache-client/docs/CreateNamespaceResponse.md new file mode 100644 index 000000000..d523f108e --- /dev/null +++ b/java/lance-namespace-apache-client/docs/CreateNamespaceResponse.md @@ -0,0 +1,15 @@ + + +# CreateNamespaceResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | | +|**parent** | **List<String>** | | [optional] | +|**properties** | **Map<String, String>** | | [optional] | + + + diff --git a/java/lance-namespace-apache-client/docs/DropNamespaceResponse.md b/java/lance-namespace-apache-client/docs/DropNamespaceResponse.md new file mode 100644 index 000000000..23e1e7dc9 --- /dev/null +++ b/java/lance-namespace-apache-client/docs/DropNamespaceResponse.md @@ -0,0 +1,15 @@ + + +# DropNamespaceResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | +|**parent** | **List<String>** | | [optional] | +|**properties** | **Map<String, String>** | | [optional] | + + + diff --git a/java/lance-namespace-apache-client/docs/NamespaceApi.md b/java/lance-namespace-apache-client/docs/NamespaceApi.md index 8bf704b6f..bd0daf3b8 100644 --- a/java/lance-namespace-apache-client/docs/NamespaceApi.md +++ b/java/lance-namespace-apache-client/docs/NamespaceApi.md @@ -14,7 +14,7 @@ All URIs are relative to *http://localhost:2333* ## createNamespace -> GetNamespaceResponse createNamespace(createNamespaceRequest) +> CreateNamespaceResponse createNamespace(createNamespaceRequest) Create a new namespace @@ -38,7 +38,7 @@ public class Example { NamespaceApi apiInstance = new NamespaceApi(defaultClient); CreateNamespaceRequest createNamespaceRequest = new CreateNamespaceRequest(); // CreateNamespaceRequest | try { - GetNamespaceResponse result = apiInstance.createNamespace(createNamespaceRequest); + CreateNamespaceResponse result = apiInstance.createNamespace(createNamespaceRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling NamespaceApi#createNamespace"); @@ -60,7 +60,7 @@ public class Example { ### Return type -[**GetNamespaceResponse**](GetNamespaceResponse.md) +[**CreateNamespaceResponse**](CreateNamespaceResponse.md) ### Authorization @@ -75,7 +75,7 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Returns a namespace, as well as any properties stored on the namespace if namespace properties are supported by the server. | - | +| **200** | Result of creating a namespace | - | | **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | | **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | | **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | @@ -87,7 +87,7 @@ No authorization required ## dropNamespace -> Object dropNamespace(dropNamespaceRequest) +> DropNamespaceResponse dropNamespace(dropNamespaceRequest) Drop a namespace @@ -111,7 +111,7 @@ public class Example { NamespaceApi apiInstance = new NamespaceApi(defaultClient); DropNamespaceRequest dropNamespaceRequest = new DropNamespaceRequest(); // DropNamespaceRequest | try { - Object result = apiInstance.dropNamespace(dropNamespaceRequest); + DropNamespaceResponse result = apiInstance.dropNamespace(dropNamespaceRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling NamespaceApi#dropNamespace"); @@ -133,7 +133,7 @@ public class Example { ### Return type -**Object** +[**DropNamespaceResponse**](DropNamespaceResponse.md) ### Authorization diff --git a/java/lance-namespace-apache-client/src/main/java/com/lancedb/lance/namespace/client/apache/api/NamespaceApi.java b/java/lance-namespace-apache-client/src/main/java/com/lancedb/lance/namespace/client/apache/api/NamespaceApi.java index fdaae2131..493ccdbe7 100644 --- a/java/lance-namespace-apache-client/src/main/java/com/lancedb/lance/namespace/client/apache/api/NamespaceApi.java +++ b/java/lance-namespace-apache-client/src/main/java/com/lancedb/lance/namespace/client/apache/api/NamespaceApi.java @@ -19,7 +19,9 @@ import com.lancedb.lance.namespace.client.apache.Configuration; import com.lancedb.lance.namespace.client.apache.Pair; import com.lancedb.lance.namespace.model.CreateNamespaceRequest; +import com.lancedb.lance.namespace.model.CreateNamespaceResponse; import com.lancedb.lance.namespace.model.DropNamespaceRequest; +import com.lancedb.lance.namespace.model.DropNamespaceResponse; import com.lancedb.lance.namespace.model.GetNamespaceRequest; import com.lancedb.lance.namespace.model.GetNamespaceResponse; import com.lancedb.lance.namespace.model.ListNamespacesRequest; @@ -58,10 +60,10 @@ public NamespaceApi(ApiClient apiClient) { * with this name is created. * * @param createNamespaceRequest (required) - * @return GetNamespaceResponse + * @return CreateNamespaceResponse * @throws ApiException if fails to make API call */ - public GetNamespaceResponse createNamespace(CreateNamespaceRequest createNamespaceRequest) + public CreateNamespaceResponse createNamespace(CreateNamespaceRequest createNamespaceRequest) throws ApiException { return this.createNamespace(createNamespaceRequest, Collections.emptyMap()); } @@ -76,10 +78,10 @@ public GetNamespaceResponse createNamespace(CreateNamespaceRequest createNamespa * * @param createNamespaceRequest (required) * @param additionalHeaders additionalHeaders for this call - * @return GetNamespaceResponse + * @return CreateNamespaceResponse * @throws ApiException if fails to make API call */ - public GetNamespaceResponse createNamespace( + public CreateNamespaceResponse createNamespace( CreateNamespaceRequest createNamespaceRequest, Map additionalHeaders) throws ApiException { Object localVarPostBody = createNamespaceRequest; @@ -112,8 +114,8 @@ public GetNamespaceResponse createNamespace( String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = - new TypeReference() {}; + TypeReference localVarReturnType = + new TypeReference() {}; return apiClient.invokeAPI( localVarPath, "POST", @@ -134,10 +136,11 @@ public GetNamespaceResponse createNamespace( * Drop a namespace Drop a namespace. The namespace must be empty. * * @param dropNamespaceRequest (required) - * @return Object + * @return DropNamespaceResponse * @throws ApiException if fails to make API call */ - public Object dropNamespace(DropNamespaceRequest dropNamespaceRequest) throws ApiException { + public DropNamespaceResponse dropNamespace(DropNamespaceRequest dropNamespaceRequest) + throws ApiException { return this.dropNamespace(dropNamespaceRequest, Collections.emptyMap()); } @@ -146,10 +149,10 @@ public Object dropNamespace(DropNamespaceRequest dropNamespaceRequest) throws Ap * * @param dropNamespaceRequest (required) * @param additionalHeaders additionalHeaders for this call - * @return Object + * @return DropNamespaceResponse * @throws ApiException if fails to make API call */ - public Object dropNamespace( + public DropNamespaceResponse dropNamespace( DropNamespaceRequest dropNamespaceRequest, Map additionalHeaders) throws ApiException { Object localVarPostBody = dropNamespaceRequest; @@ -181,7 +184,8 @@ public Object dropNamespace( String[] localVarAuthNames = new String[] {}; - TypeReference localVarReturnType = new TypeReference() {}; + TypeReference localVarReturnType = + new TypeReference() {}; return apiClient.invokeAPI( localVarPath, "POST", diff --git a/java/lance-namespace-apache-client/src/main/java/com/lancedb/lance/namespace/model/CreateNamespaceResponse.java b/java/lance-namespace-apache-client/src/main/java/com/lancedb/lance/namespace/model/CreateNamespaceResponse.java new file mode 100644 index 000000000..34b7d3a5e --- /dev/null +++ b/java/lance-namespace-apache-client/src/main/java/com/lancedb/lance/namespace/model/CreateNamespaceResponse.java @@ -0,0 +1,271 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.lancedb.lance.namespace.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** CreateNamespaceResponse */ +@JsonPropertyOrder({ + CreateNamespaceResponse.JSON_PROPERTY_NAME, + CreateNamespaceResponse.JSON_PROPERTY_PARENT, + CreateNamespaceResponse.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CreateNamespaceResponse { + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull private String name; + + public static final String JSON_PROPERTY_PARENT = "parent"; + @javax.annotation.Nullable private List parent = new ArrayList<>(); + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public CreateNamespaceResponse() {} + + public CreateNamespaceResponse name(@javax.annotation.Nonnull String name) { + + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + public CreateNamespaceResponse parent(@javax.annotation.Nullable List parent) { + + this.parent = parent; + return this; + } + + public CreateNamespaceResponse addParentItem(String parentItem) { + if (this.parent == null) { + this.parent = new ArrayList<>(); + } + this.parent.add(parentItem); + return this; + } + + /** + * Get parent + * + * @return parent + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getParent() { + return parent; + } + + @JsonProperty(JSON_PROPERTY_PARENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParent(@javax.annotation.Nullable List parent) { + this.parent = parent; + } + + public CreateNamespaceResponse properties( + @javax.annotation.Nullable Map properties) { + + this.properties = properties; + return this; + } + + public CreateNamespaceResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Get properties + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateNamespaceResponse createNamespaceResponse = (CreateNamespaceResponse) o; + return Objects.equals(this.name, createNamespaceResponse.name) + && Objects.equals(this.parent, createNamespaceResponse.parent) + && Objects.equals(this.properties, createNamespaceResponse.properties); + } + + @Override + public int hashCode() { + return Objects.hash(name, parent, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateNamespaceResponse {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" parent: ").append(toIndentedString(parent)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add( + String.format( + "%sname%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `parent` to the URL query string + if (getParent() != null) { + for (int i = 0; i < getParent().size(); i++) { + try { + joiner.add( + String.format( + "%sparent%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getParent().get(i)), "UTF-8") + .replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + try { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + URLEncoder.encode(String.valueOf(getProperties().get(_key)), "UTF-8") + .replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-apache-client/src/main/java/com/lancedb/lance/namespace/model/DropNamespaceResponse.java b/java/lance-namespace-apache-client/src/main/java/com/lancedb/lance/namespace/model/DropNamespaceResponse.java new file mode 100644 index 000000000..8cdf1fb99 --- /dev/null +++ b/java/lance-namespace-apache-client/src/main/java/com/lancedb/lance/namespace/model/DropNamespaceResponse.java @@ -0,0 +1,271 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.lancedb.lance.namespace.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; + +/** DropNamespaceResponse */ +@JsonPropertyOrder({ + DropNamespaceResponse.JSON_PROPERTY_NAME, + DropNamespaceResponse.JSON_PROPERTY_PARENT, + DropNamespaceResponse.JSON_PROPERTY_PROPERTIES +}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DropNamespaceResponse { + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable private String name; + + public static final String JSON_PROPERTY_PARENT = "parent"; + @javax.annotation.Nullable private List parent = new ArrayList<>(); + + public static final String JSON_PROPERTY_PROPERTIES = "properties"; + @javax.annotation.Nullable private Map properties = new HashMap<>(); + + public DropNamespaceResponse() {} + + public DropNamespaceResponse name(@javax.annotation.Nullable String name) { + + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + public DropNamespaceResponse parent(@javax.annotation.Nullable List parent) { + + this.parent = parent; + return this; + } + + public DropNamespaceResponse addParentItem(String parentItem) { + if (this.parent == null) { + this.parent = new ArrayList<>(); + } + this.parent.add(parentItem); + return this; + } + + /** + * Get parent + * + * @return parent + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getParent() { + return parent; + } + + @JsonProperty(JSON_PROPERTY_PARENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParent(@javax.annotation.Nullable List parent) { + this.parent = parent; + } + + public DropNamespaceResponse properties( + @javax.annotation.Nullable Map properties) { + + this.properties = properties; + return this; + } + + public DropNamespaceResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Get properties + * + * @return properties + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getProperties() { + return properties; + } + + @JsonProperty(JSON_PROPERTY_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperties(@javax.annotation.Nullable Map properties) { + this.properties = properties; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DropNamespaceResponse dropNamespaceResponse = (DropNamespaceResponse) o; + return Objects.equals(this.name, dropNamespaceResponse.name) + && Objects.equals(this.parent, dropNamespaceResponse.parent) + && Objects.equals(this.properties, dropNamespaceResponse.properties); + } + + @Override + public int hashCode() { + return Objects.hash(name, parent, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DropNamespaceResponse {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" parent: ").append(toIndentedString(parent)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + try { + joiner.add( + String.format( + "%sname%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + + // add `parent` to the URL query string + if (getParent() != null) { + for (int i = 0; i < getParent().size(); i++) { + try { + joiner.add( + String.format( + "%sparent%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getParent().get(i)), "UTF-8") + .replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + // add `properties` to the URL query string + if (getProperties() != null) { + for (String _key : getProperties().keySet()) { + try { + joiner.add( + String.format( + "%sproperties%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getProperties().get(_key), + URLEncoder.encode(String.valueOf(getProperties().get(_key)), "UTF-8") + .replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + + return joiner.toString(); + } +} diff --git a/java/lance-namespace-core/src/main/java/com/lancedb/lance/namespace/client/LanceNamespace.java b/java/lance-namespace-core/src/main/java/com/lancedb/lance/namespace/client/LanceNamespace.java index f01e0489a..6eeefb90d 100644 --- a/java/lance-namespace-core/src/main/java/com/lancedb/lance/namespace/client/LanceNamespace.java +++ b/java/lance-namespace-core/src/main/java/com/lancedb/lance/namespace/client/LanceNamespace.java @@ -35,9 +35,9 @@ public interface LanceNamespace { GetNamespaceResponse getNamespace(GetNamespaceRequest request); - GetNamespaceResponse createNamespace(CreateNamespaceRequest request); + CreateNamespaceResponse createNamespace(CreateNamespaceRequest request); - void dropNamespace(DropNamespaceRequest request); + DropNamespaceResponse dropNamespace(DropNamespaceRequest request); NamespaceExistsResponse namespaceExists(NamespaceExistsRequest request); diff --git a/java/lance-namespace-core/src/main/java/com/lancedb/lance/namespace/client/LanceRestNamespace.java b/java/lance-namespace-core/src/main/java/com/lancedb/lance/namespace/client/LanceRestNamespace.java index c6fc6aea3..d4b93391d 100644 --- a/java/lance-namespace-core/src/main/java/com/lancedb/lance/namespace/client/LanceRestNamespace.java +++ b/java/lance-namespace-core/src/main/java/com/lancedb/lance/namespace/client/LanceRestNamespace.java @@ -43,7 +43,7 @@ public LanceRestNamespace(ApiClient client) { } @Override - public GetNamespaceResponse createNamespace(CreateNamespaceRequest request) { + public CreateNamespaceResponse createNamespace(CreateNamespaceRequest request) { try { return namespaceApi.createNamespace(request); } catch (ApiException e) { @@ -71,9 +71,9 @@ public GetNamespaceResponse getNamespace(GetNamespaceRequest request) { } @Override - public void dropNamespace(DropNamespaceRequest request) { + public DropNamespaceResponse dropNamespace(DropNamespaceRequest request) { try { - namespaceApi.dropNamespace(request); + return namespaceApi.dropNamespace(request); } catch (ApiException e) { throw new LanceNamespaceException(e); } diff --git a/java/lance-namespace-springboot-server/.openapi-generator/FILES b/java/lance-namespace-springboot-server/.openapi-generator/FILES index e9d301d7c..92c5026cb 100644 --- a/java/lance-namespace-springboot-server/.openapi-generator/FILES +++ b/java/lance-namespace-springboot-server/.openapi-generator/FILES @@ -5,7 +5,9 @@ src/main/java/com/lancedb/lance/namespace/server/springboot/api/ApiUtil.java src/main/java/com/lancedb/lance/namespace/server/springboot/api/NamespaceApi.java src/main/java/com/lancedb/lance/namespace/server/springboot/api/TableApi.java src/main/java/com/lancedb/lance/namespace/server/springboot/model/CreateNamespaceRequest.java +src/main/java/com/lancedb/lance/namespace/server/springboot/model/CreateNamespaceResponse.java src/main/java/com/lancedb/lance/namespace/server/springboot/model/DropNamespaceRequest.java +src/main/java/com/lancedb/lance/namespace/server/springboot/model/DropNamespaceResponse.java src/main/java/com/lancedb/lance/namespace/server/springboot/model/ErrorResponse.java src/main/java/com/lancedb/lance/namespace/server/springboot/model/GetNamespaceRequest.java src/main/java/com/lancedb/lance/namespace/server/springboot/model/GetNamespaceResponse.java diff --git a/java/lance-namespace-springboot-server/src/main/java/com/lancedb/lance/namespace/server/springboot/api/NamespaceApi.java b/java/lance-namespace-springboot-server/src/main/java/com/lancedb/lance/namespace/server/springboot/api/NamespaceApi.java index e0a50faa7..beb75a9f4 100644 --- a/java/lance-namespace-springboot-server/src/main/java/com/lancedb/lance/namespace/server/springboot/api/NamespaceApi.java +++ b/java/lance-namespace-springboot-server/src/main/java/com/lancedb/lance/namespace/server/springboot/api/NamespaceApi.java @@ -14,7 +14,9 @@ package com.lancedb.lance.namespace.server.springboot.api; import com.lancedb.lance.namespace.server.springboot.model.CreateNamespaceRequest; +import com.lancedb.lance.namespace.server.springboot.model.CreateNamespaceResponse; import com.lancedb.lance.namespace.server.springboot.model.DropNamespaceRequest; +import com.lancedb.lance.namespace.server.springboot.model.DropNamespaceResponse; import com.lancedb.lance.namespace.server.springboot.model.ErrorResponse; import com.lancedb.lance.namespace.server.springboot.model.GetNamespaceRequest; import com.lancedb.lance.namespace.server.springboot.model.GetNamespaceResponse; @@ -62,20 +64,19 @@ default Optional getRequest() { * namespace with this name is created. * * @param createNamespaceRequest (required) - * @return Returns a namespace, as well as any properties stored on the namespace if namespace - * properties are supported by the server. (status code 200) or Indicates a bad request error. - * It could be caused by an unexpected request body format or other forms of request - * validation failure, such as invalid json. Usually serves application/json content, although - * in some cases simple text/plain content might be returned by the server's middleware. - * (status code 400) or Unauthorized. The request lacks valid authentication credentials for - * the operation. (status code 401) or Forbidden. Authenticated user does not have the - * necessary permissions. (status code 403) or Not Acceptable / Unsupported Operation. The - * server does not support this operation. (status code 406) or The request conflicts with the - * current state of the target resource. (status code 409) or The service is not ready to - * handle the request. The client should wait and retry. The service may additionally send a - * Retry-After header to indicate when to retry. (status code 503) or A server-side problem - * that might not be addressable from the client side. Used for server 5xx errors without more - * specific documentation in individual routes. (status code 5XX) + * @return Result of creating a namespace (status code 200) or Indicates a bad request error. It + * could be caused by an unexpected request body format or other forms of request validation + * failure, such as invalid json. Usually serves application/json content, although in some + * cases simple text/plain content might be returned by the server's middleware. (status + * code 400) or Unauthorized. The request lacks valid authentication credentials for the + * operation. (status code 401) or Forbidden. Authenticated user does not have the necessary + * permissions. (status code 403) or Not Acceptable / Unsupported Operation. The server does + * not support this operation. (status code 406) or The request conflicts with the current + * state of the target resource. (status code 409) or The service is not ready to handle the + * request. The client should wait and retry. The service may additionally send a Retry-After + * header to indicate when to retry. (status code 503) or A server-side problem that might not + * be addressable from the client side. Used for server 5xx errors without more specific + * documentation in individual routes. (status code 5XX) */ @Operation( operationId = "createNamespace", @@ -86,12 +87,11 @@ default Optional getRequest() { responses = { @ApiResponse( responseCode = "200", - description = - "Returns a namespace, as well as any properties stored on the namespace if namespace properties are supported by the server.", + description = "Result of creating a namespace", content = { @Content( mediaType = "application/json", - schema = @Schema(implementation = GetNamespaceResponse.class)) + schema = @Schema(implementation = CreateNamespaceResponse.class)) }), @ApiResponse( responseCode = "400", @@ -160,7 +160,7 @@ default Optional getRequest() { value = "/CreateNamespace", produces = {"application/json"}, consumes = {"application/json"}) - default ResponseEntity createNamespace( + default ResponseEntity createNamespace( @Parameter(name = "CreateNamespaceRequest", description = "", required = true) @Valid @RequestBody @@ -171,7 +171,7 @@ default ResponseEntity createNamespace( for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = - "{ \"parent\" : [ \"parent\", \"parent\" ], \"name\" : \"name\", \"properties\" : { \"owner\" : \"Ralph\", \"created_at\" : \"1452120468\" } }"; + "{ \"parent\" : [ \"parent\", \"parent\" ], \"name\" : \"name\", \"properties\" : { \"key\" : \"properties\" } }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -252,7 +252,7 @@ default ResponseEntity createNamespace( content = { @Content( mediaType = "application/json", - schema = @Schema(implementation = Object.class)) + schema = @Schema(implementation = DropNamespaceResponse.class)) }), @ApiResponse( responseCode = "400", @@ -320,7 +320,7 @@ default ResponseEntity createNamespace( value = "/DropNamespace", produces = {"application/json"}, consumes = {"application/json"}) - default ResponseEntity dropNamespace( + default ResponseEntity dropNamespace( @Parameter(name = "DropNamespaceRequest", description = "", required = true) @Valid @RequestBody @@ -329,6 +329,12 @@ default ResponseEntity dropNamespace( .ifPresent( request -> { for (MediaType mediaType : MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = + "{ \"parent\" : [ \"parent\", \"parent\" ], \"name\" : \"name\", \"properties\" : { \"key\" : \"properties\" } }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"instance\" : \"/login/log/abc123\", \"detail\" : \"Authentication failed due to incorrect username or password\", \"type\" : \"/errors/incorrect-user-pass\", \"title\" : \"Incorrect username or password\", \"status\" : 404 }"; diff --git a/java/lance-namespace-springboot-server/src/main/java/com/lancedb/lance/namespace/server/springboot/model/CreateNamespaceResponse.java b/java/lance-namespace-springboot-server/src/main/java/com/lancedb/lance/namespace/server/springboot/model/CreateNamespaceResponse.java new file mode 100644 index 000000000..3d0edfcb5 --- /dev/null +++ b/java/lance-namespace-springboot-server/src/main/java/com/lancedb/lance/namespace/server/springboot/model/CreateNamespaceResponse.java @@ -0,0 +1,167 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.lancedb.lance.namespace.server.springboot.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +import javax.annotation.Generated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** CreateNamespaceResponse */ +@Generated( + value = "org.openapitools.codegen.languages.SpringCodegen", + comments = "Generator version: 7.12.0") +public class CreateNamespaceResponse { + + private String name; + + @Valid private List parent = new ArrayList<>(); + + @Valid private Map properties = new HashMap<>(); + + public CreateNamespaceResponse() { + super(); + } + + /** Constructor with only required parameters */ + public CreateNamespaceResponse(String name) { + this.name = name; + } + + public CreateNamespaceResponse name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @NotNull + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateNamespaceResponse parent(List parent) { + this.parent = parent; + return this; + } + + public CreateNamespaceResponse addParentItem(String parentItem) { + if (this.parent == null) { + this.parent = new ArrayList<>(); + } + this.parent.add(parentItem); + return this; + } + + /** + * Get parent + * + * @return parent + */ + @Schema(name = "parent", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("parent") + public List getParent() { + return parent; + } + + public void setParent(List parent) { + this.parent = parent; + } + + public CreateNamespaceResponse properties(Map properties) { + this.properties = properties; + return this; + } + + public CreateNamespaceResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Get properties + * + * @return properties + */ + @Schema(name = "properties", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("properties") + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateNamespaceResponse createNamespaceResponse = (CreateNamespaceResponse) o; + return Objects.equals(this.name, createNamespaceResponse.name) + && Objects.equals(this.parent, createNamespaceResponse.parent) + && Objects.equals(this.properties, createNamespaceResponse.properties); + } + + @Override + public int hashCode() { + return Objects.hash(name, parent, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateNamespaceResponse {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" parent: ").append(toIndentedString(parent)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } +} diff --git a/java/lance-namespace-springboot-server/src/main/java/com/lancedb/lance/namespace/server/springboot/model/DropNamespaceResponse.java b/java/lance-namespace-springboot-server/src/main/java/com/lancedb/lance/namespace/server/springboot/model/DropNamespaceResponse.java new file mode 100644 index 000000000..820d99dd7 --- /dev/null +++ b/java/lance-namespace-springboot-server/src/main/java/com/lancedb/lance/namespace/server/springboot/model/DropNamespaceResponse.java @@ -0,0 +1,157 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.lancedb.lance.namespace.server.springboot.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +import javax.annotation.Generated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** DropNamespaceResponse */ +@Generated( + value = "org.openapitools.codegen.languages.SpringCodegen", + comments = "Generator version: 7.12.0") +public class DropNamespaceResponse { + + private String name; + + @Valid private List parent = new ArrayList<>(); + + @Valid private Map properties = new HashMap<>(); + + public DropNamespaceResponse name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public DropNamespaceResponse parent(List parent) { + this.parent = parent; + return this; + } + + public DropNamespaceResponse addParentItem(String parentItem) { + if (this.parent == null) { + this.parent = new ArrayList<>(); + } + this.parent.add(parentItem); + return this; + } + + /** + * Get parent + * + * @return parent + */ + @Schema(name = "parent", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("parent") + public List getParent() { + return parent; + } + + public void setParent(List parent) { + this.parent = parent; + } + + public DropNamespaceResponse properties(Map properties) { + this.properties = properties; + return this; + } + + public DropNamespaceResponse putPropertiesItem(String key, String propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Get properties + * + * @return properties + */ + @Schema(name = "properties", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("properties") + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DropNamespaceResponse dropNamespaceResponse = (DropNamespaceResponse) o; + return Objects.equals(this.name, dropNamespaceResponse.name) + && Objects.equals(this.parent, dropNamespaceResponse.parent) + && Objects.equals(this.properties, dropNamespaceResponse.properties); + } + + @Override + public int hashCode() { + return Objects.hash(name, parent, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DropNamespaceResponse {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" parent: ").append(toIndentedString(parent)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).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 "); + } +} diff --git a/python/lance_namespace_urllib3_client/.openapi-generator/FILES b/python/lance_namespace_urllib3_client/.openapi-generator/FILES index c328d3dd3..d7aec3205 100644 --- a/python/lance_namespace_urllib3_client/.openapi-generator/FILES +++ b/python/lance_namespace_urllib3_client/.openapi-generator/FILES @@ -4,7 +4,9 @@ .travis.yml README.md docs/CreateNamespaceRequest.md +docs/CreateNamespaceResponse.md docs/DropNamespaceRequest.md +docs/DropNamespaceResponse.md docs/ErrorResponse.md docs/GetNamespaceRequest.md docs/GetNamespaceResponse.md @@ -31,7 +33,9 @@ lance_namespace_urllib3_client/configuration.py lance_namespace_urllib3_client/exceptions.py lance_namespace_urllib3_client/models/__init__.py lance_namespace_urllib3_client/models/create_namespace_request.py +lance_namespace_urllib3_client/models/create_namespace_response.py lance_namespace_urllib3_client/models/drop_namespace_request.py +lance_namespace_urllib3_client/models/drop_namespace_response.py lance_namespace_urllib3_client/models/error_response.py lance_namespace_urllib3_client/models/get_namespace_request.py lance_namespace_urllib3_client/models/get_namespace_response.py diff --git a/python/lance_namespace_urllib3_client/README.md b/python/lance_namespace_urllib3_client/README.md index e47705d39..377ec5398 100644 --- a/python/lance_namespace_urllib3_client/README.md +++ b/python/lance_namespace_urllib3_client/README.md @@ -101,7 +101,9 @@ Class | Method | HTTP request | Description ## Documentation For Models - [CreateNamespaceRequest](docs/CreateNamespaceRequest.md) + - [CreateNamespaceResponse](docs/CreateNamespaceResponse.md) - [DropNamespaceRequest](docs/DropNamespaceRequest.md) + - [DropNamespaceResponse](docs/DropNamespaceResponse.md) - [ErrorResponse](docs/ErrorResponse.md) - [GetNamespaceRequest](docs/GetNamespaceRequest.md) - [GetNamespaceResponse](docs/GetNamespaceResponse.md) diff --git a/python/lance_namespace_urllib3_client/docs/CreateNamespaceResponse.md b/python/lance_namespace_urllib3_client/docs/CreateNamespaceResponse.md new file mode 100644 index 000000000..fe06a68db --- /dev/null +++ b/python/lance_namespace_urllib3_client/docs/CreateNamespaceResponse.md @@ -0,0 +1,31 @@ +# CreateNamespaceResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**parent** | **List[str]** | | [optional] +**properties** | **Dict[str, str]** | | [optional] + +## Example + +```python +from lance_namespace_urllib3_client.models.create_namespace_response import CreateNamespaceResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateNamespaceResponse from a JSON string +create_namespace_response_instance = CreateNamespaceResponse.from_json(json) +# print the JSON string representation of the object +print(CreateNamespaceResponse.to_json()) + +# convert the object into a dict +create_namespace_response_dict = create_namespace_response_instance.to_dict() +# create an instance of CreateNamespaceResponse from a dict +create_namespace_response_from_dict = CreateNamespaceResponse.from_dict(create_namespace_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python/lance_namespace_urllib3_client/docs/DropNamespaceResponse.md b/python/lance_namespace_urllib3_client/docs/DropNamespaceResponse.md new file mode 100644 index 000000000..de260b208 --- /dev/null +++ b/python/lance_namespace_urllib3_client/docs/DropNamespaceResponse.md @@ -0,0 +1,31 @@ +# DropNamespaceResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**parent** | **List[str]** | | [optional] +**properties** | **Dict[str, str]** | | [optional] + +## Example + +```python +from lance_namespace_urllib3_client.models.drop_namespace_response import DropNamespaceResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DropNamespaceResponse from a JSON string +drop_namespace_response_instance = DropNamespaceResponse.from_json(json) +# print the JSON string representation of the object +print(DropNamespaceResponse.to_json()) + +# convert the object into a dict +drop_namespace_response_dict = drop_namespace_response_instance.to_dict() +# create an instance of DropNamespaceResponse from a dict +drop_namespace_response_from_dict = DropNamespaceResponse.from_dict(drop_namespace_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python/lance_namespace_urllib3_client/docs/NamespaceApi.md b/python/lance_namespace_urllib3_client/docs/NamespaceApi.md index ad3430fac..c6ce6e452 100644 --- a/python/lance_namespace_urllib3_client/docs/NamespaceApi.md +++ b/python/lance_namespace_urllib3_client/docs/NamespaceApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description # **create_namespace** -> GetNamespaceResponse create_namespace(create_namespace_request) +> CreateNamespaceResponse create_namespace(create_namespace_request) Create a new namespace @@ -30,7 +30,7 @@ There are three modes when trying to create a namespace, to differentiate the be ```python import lance_namespace_urllib3_client from lance_namespace_urllib3_client.models.create_namespace_request import CreateNamespaceRequest -from lance_namespace_urllib3_client.models.get_namespace_response import GetNamespaceResponse +from lance_namespace_urllib3_client.models.create_namespace_response import CreateNamespaceResponse from lance_namespace_urllib3_client.rest import ApiException from pprint import pprint @@ -67,7 +67,7 @@ Name | Type | Description | Notes ### Return type -[**GetNamespaceResponse**](GetNamespaceResponse.md) +[**CreateNamespaceResponse**](CreateNamespaceResponse.md) ### Authorization @@ -82,7 +82,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Returns a namespace, as well as any properties stored on the namespace if namespace properties are supported by the server. | - | +**200** | Result of creating a namespace | - | **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - | **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - | **403** | Forbidden. Authenticated user does not have the necessary permissions. | - | @@ -94,7 +94,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **drop_namespace** -> object drop_namespace(drop_namespace_request) +> DropNamespaceResponse drop_namespace(drop_namespace_request) Drop a namespace @@ -107,6 +107,7 @@ Drop a namespace. The namespace must be empty. ```python import lance_namespace_urllib3_client from lance_namespace_urllib3_client.models.drop_namespace_request import DropNamespaceRequest +from lance_namespace_urllib3_client.models.drop_namespace_response import DropNamespaceResponse from lance_namespace_urllib3_client.rest import ApiException from pprint import pprint @@ -143,7 +144,7 @@ Name | Type | Description | Notes ### Return type -**object** +[**DropNamespaceResponse**](DropNamespaceResponse.md) ### Authorization diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/__init__.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/__init__.py index 0c2ed3fc5..f321029fb 100644 --- a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/__init__.py +++ b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/__init__.py @@ -33,7 +33,9 @@ # import models into sdk package from lance_namespace_urllib3_client.models.create_namespace_request import CreateNamespaceRequest +from lance_namespace_urllib3_client.models.create_namespace_response import CreateNamespaceResponse from lance_namespace_urllib3_client.models.drop_namespace_request import DropNamespaceRequest +from lance_namespace_urllib3_client.models.drop_namespace_response import DropNamespaceResponse from lance_namespace_urllib3_client.models.error_response import ErrorResponse from lance_namespace_urllib3_client.models.get_namespace_request import GetNamespaceRequest from lance_namespace_urllib3_client.models.get_namespace_response import GetNamespaceResponse diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/api/namespace_api.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/api/namespace_api.py index 13b06d271..a03fd574d 100644 --- a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/api/namespace_api.py +++ b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/api/namespace_api.py @@ -16,9 +16,10 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from typing import Any, Dict from lance_namespace_urllib3_client.models.create_namespace_request import CreateNamespaceRequest +from lance_namespace_urllib3_client.models.create_namespace_response import CreateNamespaceResponse from lance_namespace_urllib3_client.models.drop_namespace_request import DropNamespaceRequest +from lance_namespace_urllib3_client.models.drop_namespace_response import DropNamespaceResponse from lance_namespace_urllib3_client.models.get_namespace_request import GetNamespaceRequest from lance_namespace_urllib3_client.models.get_namespace_response import GetNamespaceResponse from lance_namespace_urllib3_client.models.list_namespaces_request import ListNamespacesRequest @@ -60,7 +61,7 @@ def create_namespace( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetNamespaceResponse: + ) -> CreateNamespaceResponse: """Create a new namespace Create a new namespace. A namespace can manage either a collection of child namespaces, or a collection of tables. There are three modes when trying to create a namespace, to differentiate the behavior when a namespace of the same name already exists: * CREATE: the operation fails with 400. * EXIST_OK: the operation succeeds and the existing namespace is kept. * OVERWRITE: the existing namespace is dropped and a new empty namespace with this name is created. @@ -98,7 +99,7 @@ def create_namespace( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetNamespaceResponse", + '200': "CreateNamespaceResponse", '400': "ErrorResponse", '401': "ErrorResponse", '403': "ErrorResponse", @@ -134,7 +135,7 @@ def create_namespace_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetNamespaceResponse]: + ) -> ApiResponse[CreateNamespaceResponse]: """Create a new namespace Create a new namespace. A namespace can manage either a collection of child namespaces, or a collection of tables. There are three modes when trying to create a namespace, to differentiate the behavior when a namespace of the same name already exists: * CREATE: the operation fails with 400. * EXIST_OK: the operation succeeds and the existing namespace is kept. * OVERWRITE: the existing namespace is dropped and a new empty namespace with this name is created. @@ -172,7 +173,7 @@ def create_namespace_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetNamespaceResponse", + '200': "CreateNamespaceResponse", '400': "ErrorResponse", '401': "ErrorResponse", '403': "ErrorResponse", @@ -246,7 +247,7 @@ def create_namespace_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetNamespaceResponse", + '200': "CreateNamespaceResponse", '400': "ErrorResponse", '401': "ErrorResponse", '403': "ErrorResponse", @@ -354,7 +355,7 @@ def drop_namespace( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> object: + ) -> DropNamespaceResponse: """Drop a namespace Drop a namespace. The namespace must be empty. @@ -392,7 +393,7 @@ def drop_namespace( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '200': "DropNamespaceResponse", '400': "ErrorResponse", '401': "ErrorResponse", '403': "ErrorResponse", @@ -428,7 +429,7 @@ def drop_namespace_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[object]: + ) -> ApiResponse[DropNamespaceResponse]: """Drop a namespace Drop a namespace. The namespace must be empty. @@ -466,7 +467,7 @@ def drop_namespace_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '200': "DropNamespaceResponse", '400': "ErrorResponse", '401': "ErrorResponse", '403': "ErrorResponse", @@ -540,7 +541,7 @@ def drop_namespace_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '200': "DropNamespaceResponse", '400': "ErrorResponse", '401': "ErrorResponse", '403': "ErrorResponse", diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/__init__.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/__init__.py index 64aff54d7..4dcc87de4 100644 --- a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/__init__.py +++ b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/__init__.py @@ -15,7 +15,9 @@ # import models into model package from lance_namespace_urllib3_client.models.create_namespace_request import CreateNamespaceRequest +from lance_namespace_urllib3_client.models.create_namespace_response import CreateNamespaceResponse from lance_namespace_urllib3_client.models.drop_namespace_request import DropNamespaceRequest +from lance_namespace_urllib3_client.models.drop_namespace_response import DropNamespaceResponse from lance_namespace_urllib3_client.models.error_response import ErrorResponse from lance_namespace_urllib3_client.models.get_namespace_request import GetNamespaceRequest from lance_namespace_urllib3_client.models.get_namespace_response import GetNamespaceResponse diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_namespace_response.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_namespace_response.py new file mode 100644 index 000000000..3ffc8852d --- /dev/null +++ b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/create_namespace_response.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Lance REST Namespace Specification + + **Lance Namespace Specification** is an open specification on top of the storage-based Lance data format to standardize access to a collection of Lance tables (a.k.a. Lance datasets). It describes how a metadata service like Apache Hive MetaStore (HMS), Apache Gravitino, Unity Catalog, etc. should store and use Lance tables, as well as how ML/AI tools and analytics compute engines (will together be called _\"tools\"_ in this document) should integrate with Lance tables. A Lance namespace is a centralized repository for discovering, organizing, and managing Lance tables. It can either contain a collection of tables, or a collection of Lance namespaces recursively. It is designed to encapsulates concepts including namespace, metastore, database, schema, etc. that frequently appear in other similar data systems to allow easy integration with any system of any type of object hierarchy. In an enterprise environment, typically there is a requirement to store tables in a metadata service for more advanced governance features around access control, auditing, lineage tracking, etc. **Lance REST Namespace** is an OpenAPI protocol that enables reading, writing and managing Lance tables by connecting those metadata services or building a custom metadata server in a standardized way. + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CreateNamespaceResponse(BaseModel): + """ + CreateNamespaceResponse + """ # noqa: E501 + name: StrictStr + parent: Optional[List[StrictStr]] = None + properties: Optional[Dict[str, StrictStr]] = None + __properties: ClassVar[List[str]] = ["name", "parent", "properties"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateNamespaceResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateNamespaceResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "parent": obj.get("parent"), + "properties": obj.get("properties") + }) + return _obj + + diff --git a/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/drop_namespace_response.py b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/drop_namespace_response.py new file mode 100644 index 000000000..b2cd4b8bb --- /dev/null +++ b/python/lance_namespace_urllib3_client/lance_namespace_urllib3_client/models/drop_namespace_response.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Lance REST Namespace Specification + + **Lance Namespace Specification** is an open specification on top of the storage-based Lance data format to standardize access to a collection of Lance tables (a.k.a. Lance datasets). It describes how a metadata service like Apache Hive MetaStore (HMS), Apache Gravitino, Unity Catalog, etc. should store and use Lance tables, as well as how ML/AI tools and analytics compute engines (will together be called _\"tools\"_ in this document) should integrate with Lance tables. A Lance namespace is a centralized repository for discovering, organizing, and managing Lance tables. It can either contain a collection of tables, or a collection of Lance namespaces recursively. It is designed to encapsulates concepts including namespace, metastore, database, schema, etc. that frequently appear in other similar data systems to allow easy integration with any system of any type of object hierarchy. In an enterprise environment, typically there is a requirement to store tables in a metadata service for more advanced governance features around access control, auditing, lineage tracking, etc. **Lance REST Namespace** is an OpenAPI protocol that enables reading, writing and managing Lance tables by connecting those metadata services or building a custom metadata server in a standardized way. + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DropNamespaceResponse(BaseModel): + """ + DropNamespaceResponse + """ # noqa: E501 + name: Optional[StrictStr] = None + parent: Optional[List[StrictStr]] = None + properties: Optional[Dict[str, StrictStr]] = None + __properties: ClassVar[List[str]] = ["name", "parent", "properties"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DropNamespaceResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DropNamespaceResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "parent": obj.get("parent"), + "properties": obj.get("properties") + }) + return _obj + + diff --git a/python/lance_namespace_urllib3_client/test/test_create_namespace_response.py b/python/lance_namespace_urllib3_client/test/test_create_namespace_response.py new file mode 100644 index 000000000..36c80273b --- /dev/null +++ b/python/lance_namespace_urllib3_client/test/test_create_namespace_response.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Lance REST Namespace Specification + + **Lance Namespace Specification** is an open specification on top of the storage-based Lance data format to standardize access to a collection of Lance tables (a.k.a. Lance datasets). It describes how a metadata service like Apache Hive MetaStore (HMS), Apache Gravitino, Unity Catalog, etc. should store and use Lance tables, as well as how ML/AI tools and analytics compute engines (will together be called _\"tools\"_ in this document) should integrate with Lance tables. A Lance namespace is a centralized repository for discovering, organizing, and managing Lance tables. It can either contain a collection of tables, or a collection of Lance namespaces recursively. It is designed to encapsulates concepts including namespace, metastore, database, schema, etc. that frequently appear in other similar data systems to allow easy integration with any system of any type of object hierarchy. In an enterprise environment, typically there is a requirement to store tables in a metadata service for more advanced governance features around access control, auditing, lineage tracking, etc. **Lance REST Namespace** is an OpenAPI protocol that enables reading, writing and managing Lance tables by connecting those metadata services or building a custom metadata server in a standardized way. + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from lance_namespace_urllib3_client.models.create_namespace_response import CreateNamespaceResponse + +class TestCreateNamespaceResponse(unittest.TestCase): + """CreateNamespaceResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateNamespaceResponse: + """Test CreateNamespaceResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateNamespaceResponse` + """ + model = CreateNamespaceResponse() + if include_optional: + return CreateNamespaceResponse( + name = '', + parent = [ + '' + ], + properties = { + 'key' : '' + } + ) + else: + return CreateNamespaceResponse( + name = '', + ) + """ + + def testCreateNamespaceResponse(self): + """Test CreateNamespaceResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/lance_namespace_urllib3_client/test/test_drop_namespace_response.py b/python/lance_namespace_urllib3_client/test/test_drop_namespace_response.py new file mode 100644 index 000000000..1e4581abe --- /dev/null +++ b/python/lance_namespace_urllib3_client/test/test_drop_namespace_response.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Lance REST Namespace Specification + + **Lance Namespace Specification** is an open specification on top of the storage-based Lance data format to standardize access to a collection of Lance tables (a.k.a. Lance datasets). It describes how a metadata service like Apache Hive MetaStore (HMS), Apache Gravitino, Unity Catalog, etc. should store and use Lance tables, as well as how ML/AI tools and analytics compute engines (will together be called _\"tools\"_ in this document) should integrate with Lance tables. A Lance namespace is a centralized repository for discovering, organizing, and managing Lance tables. It can either contain a collection of tables, or a collection of Lance namespaces recursively. It is designed to encapsulates concepts including namespace, metastore, database, schema, etc. that frequently appear in other similar data systems to allow easy integration with any system of any type of object hierarchy. In an enterprise environment, typically there is a requirement to store tables in a metadata service for more advanced governance features around access control, auditing, lineage tracking, etc. **Lance REST Namespace** is an OpenAPI protocol that enables reading, writing and managing Lance tables by connecting those metadata services or building a custom metadata server in a standardized way. + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from lance_namespace_urllib3_client.models.drop_namespace_response import DropNamespaceResponse + +class TestDropNamespaceResponse(unittest.TestCase): + """DropNamespaceResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DropNamespaceResponse: + """Test DropNamespaceResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DropNamespaceResponse` + """ + model = DropNamespaceResponse() + if include_optional: + return DropNamespaceResponse( + name = '', + parent = [ + '' + ], + properties = { + 'key' : '' + } + ) + else: + return DropNamespaceResponse( + ) + """ + + def testDropNamespaceResponse(self): + """Test DropNamespaceResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/rust/lance-namespace-reqwest-client/.openapi-generator/FILES b/rust/lance-namespace-reqwest-client/.openapi-generator/FILES index 64d83a371..b67f6735a 100644 --- a/rust/lance-namespace-reqwest-client/.openapi-generator/FILES +++ b/rust/lance-namespace-reqwest-client/.openapi-generator/FILES @@ -3,7 +3,9 @@ Cargo.toml README.md docs/CreateNamespaceRequest.md +docs/CreateNamespaceResponse.md docs/DropNamespaceRequest.md +docs/DropNamespaceResponse.md docs/ErrorResponse.md docs/GetNamespaceRequest.md docs/GetNamespaceResponse.md @@ -26,7 +28,9 @@ src/apis/namespace_api.rs src/apis/table_api.rs src/lib.rs src/models/create_namespace_request.rs +src/models/create_namespace_response.rs src/models/drop_namespace_request.rs +src/models/drop_namespace_response.rs src/models/error_response.rs src/models/get_namespace_request.rs src/models/get_namespace_response.rs diff --git a/rust/lance-namespace-reqwest-client/README.md b/rust/lance-namespace-reqwest-client/README.md index 3b420d89b..7a6c3bc1e 100644 --- a/rust/lance-namespace-reqwest-client/README.md +++ b/rust/lance-namespace-reqwest-client/README.md @@ -42,7 +42,9 @@ Class | Method | HTTP request | Description ## Documentation For Models - [CreateNamespaceRequest](docs/CreateNamespaceRequest.md) + - [CreateNamespaceResponse](docs/CreateNamespaceResponse.md) - [DropNamespaceRequest](docs/DropNamespaceRequest.md) + - [DropNamespaceResponse](docs/DropNamespaceResponse.md) - [ErrorResponse](docs/ErrorResponse.md) - [GetNamespaceRequest](docs/GetNamespaceRequest.md) - [GetNamespaceResponse](docs/GetNamespaceResponse.md) diff --git a/rust/lance-namespace-reqwest-client/docs/CreateNamespaceResponse.md b/rust/lance-namespace-reqwest-client/docs/CreateNamespaceResponse.md new file mode 100644 index 000000000..18f8e1885 --- /dev/null +++ b/rust/lance-namespace-reqwest-client/docs/CreateNamespaceResponse.md @@ -0,0 +1,13 @@ +# CreateNamespaceResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**parent** | Option<**Vec**> | | [optional] +**properties** | Option<**std::collections::HashMap**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rust/lance-namespace-reqwest-client/docs/DropNamespaceResponse.md b/rust/lance-namespace-reqwest-client/docs/DropNamespaceResponse.md new file mode 100644 index 000000000..48641b9c6 --- /dev/null +++ b/rust/lance-namespace-reqwest-client/docs/DropNamespaceResponse.md @@ -0,0 +1,13 @@ +# DropNamespaceResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | | [optional] +**parent** | Option<**Vec**> | | [optional] +**properties** | Option<**std::collections::HashMap**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rust/lance-namespace-reqwest-client/docs/NamespaceApi.md b/rust/lance-namespace-reqwest-client/docs/NamespaceApi.md index 186178561..e657bfdc0 100644 --- a/rust/lance-namespace-reqwest-client/docs/NamespaceApi.md +++ b/rust/lance-namespace-reqwest-client/docs/NamespaceApi.md @@ -14,7 +14,7 @@ Method | HTTP request | Description ## create_namespace -> models::GetNamespaceResponse create_namespace(create_namespace_request) +> models::CreateNamespaceResponse create_namespace(create_namespace_request) Create a new namespace Create a new namespace. A namespace can manage either a collection of child namespaces, or a collection of tables. There are three modes when trying to create a namespace, to differentiate the behavior when a namespace of the same name already exists: * CREATE: the operation fails with 400. * EXIST_OK: the operation succeeds and the existing namespace is kept. * OVERWRITE: the existing namespace is dropped and a new empty namespace with this name is created. @@ -28,7 +28,7 @@ Name | Type | Description | Required | Notes ### Return type -[**models::GetNamespaceResponse**](GetNamespaceResponse.md) +[**models::CreateNamespaceResponse**](CreateNamespaceResponse.md) ### Authorization @@ -44,7 +44,7 @@ No authorization required ## drop_namespace -> serde_json::Value drop_namespace(drop_namespace_request) +> models::DropNamespaceResponse drop_namespace(drop_namespace_request) Drop a namespace Drop a namespace. The namespace must be empty. @@ -58,7 +58,7 @@ Name | Type | Description | Required | Notes ### Return type -[**serde_json::Value**](serde_json::Value.md) +[**models::DropNamespaceResponse**](DropNamespaceResponse.md) ### Authorization diff --git a/rust/lance-namespace-reqwest-client/src/apis/namespace_api.rs b/rust/lance-namespace-reqwest-client/src/apis/namespace_api.rs index 90be558fe..ef00380c4 100644 --- a/rust/lance-namespace-reqwest-client/src/apis/namespace_api.rs +++ b/rust/lance-namespace-reqwest-client/src/apis/namespace_api.rs @@ -84,7 +84,7 @@ pub enum NamespaceExistsError { /// Create a new namespace. A namespace can manage either a collection of child namespaces, or a collection of tables. There are three modes when trying to create a namespace, to differentiate the behavior when a namespace of the same name already exists: * CREATE: the operation fails with 400. * EXIST_OK: the operation succeeds and the existing namespace is kept. * OVERWRITE: the existing namespace is dropped and a new empty namespace with this name is created. -pub async fn create_namespace(configuration: &configuration::Configuration, create_namespace_request: models::CreateNamespaceRequest) -> Result> { +pub async fn create_namespace(configuration: &configuration::Configuration, create_namespace_request: models::CreateNamespaceRequest) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_create_namespace_request = create_namespace_request; @@ -111,8 +111,8 @@ pub async fn create_namespace(configuration: &configuration::Configuration, crea let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetNamespaceResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetNamespaceResponse`")))), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateNamespaceResponse`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateNamespaceResponse`")))), } } else { let content = resp.text().await?; @@ -122,7 +122,7 @@ pub async fn create_namespace(configuration: &configuration::Configuration, crea } /// Drop a namespace. The namespace must be empty. -pub async fn drop_namespace(configuration: &configuration::Configuration, drop_namespace_request: models::DropNamespaceRequest) -> Result> { +pub async fn drop_namespace(configuration: &configuration::Configuration, drop_namespace_request: models::DropNamespaceRequest) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_drop_namespace_request = drop_namespace_request; @@ -149,8 +149,8 @@ pub async fn drop_namespace(configuration: &configuration::Configuration, drop_n let content = resp.text().await?; match content_type { ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DropNamespaceResponse`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DropNamespaceResponse`")))), } } else { let content = resp.text().await?; diff --git a/rust/lance-namespace-reqwest-client/src/models/create_namespace_response.rs b/rust/lance-namespace-reqwest-client/src/models/create_namespace_response.rs new file mode 100644 index 000000000..9ed69cdbe --- /dev/null +++ b/rust/lance-namespace-reqwest-client/src/models/create_namespace_response.rs @@ -0,0 +1,33 @@ +/* + * Lance REST Namespace Specification + * + * **Lance Namespace Specification** is an open specification on top of the storage-based Lance data format to standardize access to a collection of Lance tables (a.k.a. Lance datasets). It describes how a metadata service like Apache Hive MetaStore (HMS), Apache Gravitino, Unity Catalog, etc. should store and use Lance tables, as well as how ML/AI tools and analytics compute engines (will together be called _\"tools\"_ in this document) should integrate with Lance tables. A Lance namespace is a centralized repository for discovering, organizing, and managing Lance tables. It can either contain a collection of tables, or a collection of Lance namespaces recursively. It is designed to encapsulates concepts including namespace, metastore, database, schema, etc. that frequently appear in other similar data systems to allow easy integration with any system of any type of object hierarchy. In an enterprise environment, typically there is a requirement to store tables in a metadata service for more advanced governance features around access control, auditing, lineage tracking, etc. **Lance REST Namespace** is an OpenAPI protocol that enables reading, writing and managing Lance tables by connecting those metadata services or building a custom metadata server in a standardized way. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateNamespaceResponse { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "parent", skip_serializing_if = "Option::is_none")] + pub parent: Option>, + #[serde(rename = "properties", skip_serializing_if = "Option::is_none")] + pub properties: Option>, +} + +impl CreateNamespaceResponse { + pub fn new(name: String) -> CreateNamespaceResponse { + CreateNamespaceResponse { + name, + parent: None, + properties: None, + } + } +} + diff --git a/rust/lance-namespace-reqwest-client/src/models/drop_namespace_response.rs b/rust/lance-namespace-reqwest-client/src/models/drop_namespace_response.rs new file mode 100644 index 000000000..50e29bef2 --- /dev/null +++ b/rust/lance-namespace-reqwest-client/src/models/drop_namespace_response.rs @@ -0,0 +1,33 @@ +/* + * Lance REST Namespace Specification + * + * **Lance Namespace Specification** is an open specification on top of the storage-based Lance data format to standardize access to a collection of Lance tables (a.k.a. Lance datasets). It describes how a metadata service like Apache Hive MetaStore (HMS), Apache Gravitino, Unity Catalog, etc. should store and use Lance tables, as well as how ML/AI tools and analytics compute engines (will together be called _\"tools\"_ in this document) should integrate with Lance tables. A Lance namespace is a centralized repository for discovering, organizing, and managing Lance tables. It can either contain a collection of tables, or a collection of Lance namespaces recursively. It is designed to encapsulates concepts including namespace, metastore, database, schema, etc. that frequently appear in other similar data systems to allow easy integration with any system of any type of object hierarchy. In an enterprise environment, typically there is a requirement to store tables in a metadata service for more advanced governance features around access control, auditing, lineage tracking, etc. **Lance REST Namespace** is an OpenAPI protocol that enables reading, writing and managing Lance tables by connecting those metadata services or building a custom metadata server in a standardized way. + * + * The version of the OpenAPI document: 0.0.1 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DropNamespaceResponse { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "parent", skip_serializing_if = "Option::is_none")] + pub parent: Option>, + #[serde(rename = "properties", skip_serializing_if = "Option::is_none")] + pub properties: Option>, +} + +impl DropNamespaceResponse { + pub fn new() -> DropNamespaceResponse { + DropNamespaceResponse { + name: None, + parent: None, + properties: None, + } + } +} + diff --git a/rust/lance-namespace-reqwest-client/src/models/mod.rs b/rust/lance-namespace-reqwest-client/src/models/mod.rs index 1af93bd17..4252503ff 100644 --- a/rust/lance-namespace-reqwest-client/src/models/mod.rs +++ b/rust/lance-namespace-reqwest-client/src/models/mod.rs @@ -1,7 +1,11 @@ pub mod create_namespace_request; pub use self::create_namespace_request::CreateNamespaceRequest; +pub mod create_namespace_response; +pub use self::create_namespace_response::CreateNamespaceResponse; pub mod drop_namespace_request; pub use self::drop_namespace_request::DropNamespaceRequest; +pub mod drop_namespace_response; +pub use self::drop_namespace_response::DropNamespaceResponse; pub mod error_response; pub use self::error_response::ErrorResponse; pub mod get_namespace_request; diff --git a/spec/rest.yaml b/spec/rest.yaml index 19c5e1723..ea4894807 100644 --- a/spec/rest.yaml +++ b/spec/rest.yaml @@ -84,7 +84,7 @@ paths: $ref: '#/components/schemas/CreateNamespaceRequest' responses: 200: - $ref: '#/components/responses/GetNamespaceResponse' + $ref: '#/components/responses/CreateNamespaceResponse' 400: $ref: '#/components/responses/BadRequestErrorResponse' 401: @@ -363,6 +363,22 @@ components: additionalProperties: type: string + CreateNamespaceResponse: + type: object + required: + - name + properties: + name: + type: string + parent: + type: array + items: + type: string + properties: + type: object + additionalProperties: + type: string + ListNamespacesRequest: type: object properties: @@ -438,6 +454,17 @@ components: DropNamespaceResponse: type: object + properties: + name: + type: string + parent: + type: array + items: + type: string + properties: + type: object + additionalProperties: + type: string NamespaceExistsRequest: type: object @@ -592,6 +619,14 @@ components: schema: $ref: '#/components/schemas/GetNamespaceResponse' + CreateNamespaceResponse: + description: + Result of creating a namespace + content: + application/json: + schema: + $ref: '#/components/schemas/CreateNamespaceResponse' + DropNamespaceResponse: description: Result of dropping a namespace From c4e24276656d042d4d59f4007d475e9790afb97c Mon Sep 17 00:00:00 2001 From: Jack Ye Date: Wed, 21 May 2025 09:18:16 -0700 Subject: [PATCH 2/2] fix rebase --- .../lance/namespace/adapter/ClientToServerResponse.java | 4 ++-- .../com/lancedb/lance/namespace/client/LanceNamespace.java | 2 ++ .../lancedb/lance/namespace/client/LanceRestNamespace.java | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/java/lance-namespace-adapter/src/main/java/com/lancedb/lance/namespace/adapter/ClientToServerResponse.java b/java/lance-namespace-adapter/src/main/java/com/lancedb/lance/namespace/adapter/ClientToServerResponse.java index 688542278..fc6c3395c 100644 --- a/java/lance-namespace-adapter/src/main/java/com/lancedb/lance/namespace/adapter/ClientToServerResponse.java +++ b/java/lance-namespace-adapter/src/main/java/com/lancedb/lance/namespace/adapter/ClientToServerResponse.java @@ -41,7 +41,7 @@ public static ListNamespacesResponse listNamespaces( } public static CreateNamespaceResponse createNamespace( - com.lancedb.lance.namespace.client.apache.model.CreateNamespaceResponse response) { + com.lancedb.lance.namespace.model.CreateNamespaceResponse response) { CreateNamespaceResponse converted = new CreateNamespaceResponse(); converted.setParent(response.getParent()); converted.setProperties(response.getProperties()); @@ -50,7 +50,7 @@ public static CreateNamespaceResponse createNamespace( } public static DropNamespaceResponse dropNamespace( - com.lancedb.lance.namespace.client.apache.model.DropNamespaceResponse response) { + com.lancedb.lance.namespace.model.DropNamespaceResponse response) { DropNamespaceResponse converted = new DropNamespaceResponse(); converted.setParent(response.getParent()); converted.setProperties(response.getProperties()); diff --git a/java/lance-namespace-core/src/main/java/com/lancedb/lance/namespace/client/LanceNamespace.java b/java/lance-namespace-core/src/main/java/com/lancedb/lance/namespace/client/LanceNamespace.java index 6eeefb90d..6ce999d01 100644 --- a/java/lance-namespace-core/src/main/java/com/lancedb/lance/namespace/client/LanceNamespace.java +++ b/java/lance-namespace-core/src/main/java/com/lancedb/lance/namespace/client/LanceNamespace.java @@ -14,7 +14,9 @@ package com.lancedb.lance.namespace.client; import com.lancedb.lance.namespace.model.CreateNamespaceRequest; +import com.lancedb.lance.namespace.model.CreateNamespaceResponse; import com.lancedb.lance.namespace.model.DropNamespaceRequest; +import com.lancedb.lance.namespace.model.DropNamespaceResponse; import com.lancedb.lance.namespace.model.GetNamespaceRequest; import com.lancedb.lance.namespace.model.GetNamespaceResponse; import com.lancedb.lance.namespace.model.GetTableRequest; diff --git a/java/lance-namespace-core/src/main/java/com/lancedb/lance/namespace/client/LanceRestNamespace.java b/java/lance-namespace-core/src/main/java/com/lancedb/lance/namespace/client/LanceRestNamespace.java index d4b93391d..650fae8d5 100644 --- a/java/lance-namespace-core/src/main/java/com/lancedb/lance/namespace/client/LanceRestNamespace.java +++ b/java/lance-namespace-core/src/main/java/com/lancedb/lance/namespace/client/LanceRestNamespace.java @@ -18,7 +18,9 @@ import com.lancedb.lance.namespace.client.apache.api.NamespaceApi; import com.lancedb.lance.namespace.client.apache.api.TableApi; import com.lancedb.lance.namespace.model.CreateNamespaceRequest; +import com.lancedb.lance.namespace.model.CreateNamespaceResponse; import com.lancedb.lance.namespace.model.DropNamespaceRequest; +import com.lancedb.lance.namespace.model.DropNamespaceResponse; import com.lancedb.lance.namespace.model.GetNamespaceRequest; import com.lancedb.lance.namespace.model.GetNamespaceResponse; import com.lancedb.lance.namespace.model.GetTableRequest;