From d3af1dec1fceae419032349ec18b7f69ee3812ab Mon Sep 17 00:00:00 2001 From: "databricks-ci-ghec-1[bot]" <184311507+databricks-ci-ghec-1[bot]@users.noreply.github.com> Date: Mon, 26 Oct 2026 03:18:48 +0000 Subject: [PATCH] Release databricks-sdk-java --- .codegen/_last_sha | 2 +- CHANGELOG.md | 15 + Makefile | 4 +- databricks-sdk-java/lockfile.json | 418 ++++++++++++------ databricks-sdk-java/pom.xml | 8 +- .../com/databricks/sdk/core/UserAgent.java | 2 +- .../sdk/service/agentkit/AgentKitAPI.java | 105 +++++ .../sdk/service/agentkit/AgentKitImpl.java | 147 ++++++ .../sdk/service/agentkit/AgentKitService.java | 54 +++ .../GetMemoryStorePermissionRequest.java | 41 ++ .../GetSessionStorePermissionRequest.java | 41 ++ .../GrantMemoryStorePermissionRequest.java | 78 ++++ .../GrantMemoryStorePermissionResponse.java | 29 ++ .../GrantSessionStorePermissionRequest.java | 78 ++++ .../GrantSessionStorePermissionResponse.java | 29 ++ .../ListMemoryStorePermissionsRequest.java | 76 ++++ .../ListMemoryStorePermissionsResponse.java | 64 +++ .../ListSessionStorePermissionsRequest.java | 76 ++++ .../ListSessionStorePermissionsResponse.java | 64 +++ .../service/agentkit/ManagedMemoryEntry.java | 3 +- .../agentkit/MemoryStorePermission.java | 62 +++ .../sdk/service/agentkit/PermissionLevel.java | 12 + .../sdk/service/agentkit/PrincipalType.java | 12 + .../RevokeMemoryStorePermissionRequest.java | 62 +++ .../RevokeMemoryStorePermissionResponse.java | 29 ++ .../RevokeSessionStorePermissionRequest.java | 62 +++ .../RevokeSessionStorePermissionResponse.java | 29 ++ .../agentkit/SessionStorePermission.java | 62 +++ .../sdk/service/agentkit/StorePrincipal.java | 62 +++ .../UpdateManagedMemoryEntryRequest.java | 3 +- .../catalog/ModelProviderServiceConfig.java | 12 +- .../sdk/service/compute/Environment.java | 7 +- .../dataquality/AnomalyDetectionConfig.java | 31 +- .../dataquality/NotificationDestination.java | 42 +- .../dataquality/NotificationSettings.java | 27 +- .../sdk/service/jobs/SqlOutput.java | 17 +- .../sdk/service/jobs/SqlQueryOutput.java | 2 +- .../service/jobs/SqlStatementQueryResult.java | 75 ++++ .../jobs/SqlStatementQueryResultColumn.java | 42 ++ .../jobs/SqlStatementQueryResultRow.java | 44 ++ .../SqlStatementQueryResultRowRowValue.java | 44 ++ .../service/jobs/SqlTaskSqlFileOutput.java | 90 ++++ .../ml/CreateMaterializationSetOperation.java | 164 +++++++ .../ml/CreateMaterializationSetRequest.java | 72 +++ .../ml/DeleteMaterializationSetOperation.java | 163 +++++++ .../ml/DeleteMaterializationSetRequest.java | 84 ++++ .../sdk/service/ml/FeatureEngineeringAPI.java | 46 ++ .../service/ml/FeatureEngineeringImpl.java | 89 ++++ .../service/ml/FeatureEngineeringService.java | 26 ++ .../ml/GetMaterializationSetRequest.java | 43 ++ .../sdk/service/ml/MaterializationSet.java | 65 +++ .../MaterializationSetDeletionProgress.java | 67 +++ .../MaterializationSetOperationMetadata.java | 135 ++++++ ...erializationSetOperationMetadataState.java | 15 + .../ml/MaterializationSetUpdateProgress.java | 83 ++++ .../sdk/service/ml/MaterializedFeature.java | 19 + .../ml/MaterializedFeatureChangeFailure.java | 75 ++++ .../ml/PurgeFeatureEntitiesMetadata.java | 18 +- .../ml/PurgeFeatureEntitiesRequest.java | 25 +- .../databricks/sdk/service/ml/SdpSource.java | 4 +- .../ml/UpdateMaterializationSetOperation.java | 164 +++++++ .../ml/UpdateMaterializationSetRequest.java | 101 +++++ .../sdk/service/pipelines/StartUpdate.java | 32 ++ .../sdk/service/pipelines/UpdateInfo.java | 32 ++ .../sdk/service/sandbox/Sandbox.java | 17 +- .../sdk/service/sandbox/SandboxMetadata.java | 47 ++ .../sdk/service/sharing/SharedDataObject.java | 16 +- .../sdk/core/GoogleAuthCompatibilityTest.java | 248 +++++++++++ examples/docs/pom.xml | 2 +- examples/spring-boot-oauth-u2m-demo/pom.xml | 2 +- lockfile.json | 8 +- pom.xml | 4 +- shaded/pom.xml | 2 +- 73 files changed, 3853 insertions(+), 177 deletions(-) create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GetMemoryStorePermissionRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GetSessionStorePermissionRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GrantMemoryStorePermissionRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GrantMemoryStorePermissionResponse.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GrantSessionStorePermissionRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GrantSessionStorePermissionResponse.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ListMemoryStorePermissionsRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ListMemoryStorePermissionsResponse.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ListSessionStorePermissionsRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ListSessionStorePermissionsResponse.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/MemoryStorePermission.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/PermissionLevel.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/PrincipalType.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/RevokeMemoryStorePermissionRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/RevokeMemoryStorePermissionResponse.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/RevokeSessionStorePermissionRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/RevokeSessionStorePermissionResponse.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/SessionStorePermission.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/StorePrincipal.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlStatementQueryResult.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlStatementQueryResultColumn.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlStatementQueryResultRow.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlStatementQueryResultRowRowValue.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlTaskSqlFileOutput.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/CreateMaterializationSetOperation.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/CreateMaterializationSetRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DeleteMaterializationSetOperation.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DeleteMaterializationSetRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/GetMaterializationSetRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSet.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetDeletionProgress.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetOperationMetadata.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetOperationMetadataState.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetUpdateProgress.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializedFeatureChangeFailure.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/UpdateMaterializationSetOperation.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/UpdateMaterializationSetRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/sandbox/SandboxMetadata.java create mode 100644 databricks-sdk-java/src/test/java/com/databricks/sdk/core/GoogleAuthCompatibilityTest.java diff --git a/.codegen/_last_sha b/.codegen/_last_sha index da2f25f17..18f970a08 100644 --- a/.codegen/_last_sha +++ b/.codegen/_last_sha @@ -1 +1 @@ -281d8811ec0e9f9b25f10c13651e2290f150a132 \ No newline at end of file +e0b8229e948c8063e05433bce268ff448ad20199 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 79e238dad..98c081c28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Version changelog +## Release v0.171.0 (2026-10-26) + +### API Changes +* Add `getMemoryStorePermission()`, `getSessionStorePermission()`, `grantMemoryStorePermission()`, `grantSessionStorePermission()`, `listMemoryStorePermissions()`, `listSessionStorePermissions()`, `revokeMemoryStorePermission()` and `revokeSessionStorePermission()` methods for `workspaceClient.agentKit()` service. +* Add `createMaterializationSet()`, `deleteMaterializationSet()`, `getMaterializationSet()` and `updateMaterializationSet()` methods for `workspaceClient.featureEngineering()` service. +* Add `notificationSettings` field for `com.databricks.sdk.service.dataquality.AnomalyDetectionConfig`. +* Add `destinationIds` and `destinationUserIds` fields for `com.databricks.sdk.service.dataquality.NotificationDestination`. +* Add `onUnhealthyTable` field for `com.databricks.sdk.service.dataquality.NotificationSettings`. +* Add `fileOutput` field for `com.databricks.sdk.service.jobs.SqlOutput`. +* Add `materializationSetId` field for `com.databricks.sdk.service.ml.MaterializedFeature`. +* Add `deleteRows` field for `com.databricks.sdk.service.ml.PurgeFeatureEntitiesRequest`. +* Add `fullRefreshSelectionByPath` and `refreshSelectionByPath` fields for `com.databricks.sdk.service.pipelines.StartUpdate`. +* Add `fullRefreshSelectionByPath` and `refreshSelectionByPath` fields for `com.databricks.sdk.service.pipelines.UpdateInfo`. +* Add `metadata` field for `com.databricks.sdk.service.sandbox.Sandbox`. + ## Release v0.170.0 (2026-10-22) ### API Changes diff --git a/Makefile b/Makefile index 04b5c9280..7a0ad2097 100644 --- a/Makefile +++ b/Makefile @@ -11,5 +11,7 @@ fix-lockfile: @# Replace JFrog proxy URLs with public Maven Central equivalents in lockfiles. @# Prevents proxy URLs from being accidentally committed. find . -type f -name 'lockfile.json' \ - -exec sed -i 's|databricks\.jfrog\.io/artifactory/db-maven|repo.maven.apache.org/maven2|g' {} + + -exec sed -i \ + -e 's|databricks\.jfrog\.io/artifactory/db-maven|repo.maven.apache.org/maven2|g' \ + -e 's@maven-proxy\.\(cloud\|dev\)\.databricks\.com@repo.maven.apache.org/maven2@g' {} + diff --git a/databricks-sdk-java/lockfile.json b/databricks-sdk-java/lockfile.json index f2764dd06..540cd352c 100644 --- a/databricks-sdk-java/lockfile.json +++ b/databricks-sdk-java/lockfile.json @@ -1,7 +1,7 @@ { "artifactId": "databricks-sdk-java", "groupId": "com.databricks", - "version": "0.170.0", + "version": "0.171.0", "lockFileVersion": 1, "dependencies": [ { @@ -121,7 +121,7 @@ "checksum": "6db0c3a244c397429c2e362ea2837c3622d5b68bb95105d37c21c36e5bc70abf", "scope": "compile", "resolved": "https://repo.maven.apache.org/maven2/com/google/guava/guava/25.1-jre/guava-25.1-jre.jar", - "selectedVersion": "32.0.0-android", + "selectedVersion": "33.6.0-jre", "included": false, "id": "com.google.guava:guava:25.1-jre", "parent": "com.fasterxml.jackson.datatype:jackson-datatype-guava:2.22.3", @@ -230,41 +230,127 @@ { "groupId": "com.google.auth", "artifactId": "google-auth-library-oauth2-http", - "version": "1.20.0", + "version": "1.54.0", "checksumAlgorithm": "SHA-256", - "checksum": "ab3ee74eeccb12fca40f4444af4d45df9e290f2c3f4751e855697dedf52f7a73", + "checksum": "03cb8e07cd40b20307494b640abb08c0a91d455b96681e55bc7cf817634d91d4", "scope": "compile", - "resolved": "https://repo.maven.apache.org/maven2/com/google/auth/google-auth-library-oauth2-http/1.20.0/google-auth-library-oauth2-http-1.20.0.jar", - "selectedVersion": "1.20.0", + "resolved": "https://repo.maven.apache.org/maven2/com/google/auth/google-auth-library-oauth2-http/1.54.0/google-auth-library-oauth2-http-1.54.0.jar", + "selectedVersion": "1.54.0", "included": true, - "id": "com.google.auth:google-auth-library-oauth2-http:1.20.0", + "id": "com.google.auth:google-auth-library-oauth2-http:1.54.0", "children": [ + { + "groupId": "com.google.api", + "artifactId": "api-common", + "version": "2.70.0", + "checksumAlgorithm": "SHA-256", + "checksum": "18477eead80b20e0c3a747f084d8a0b10cd123d6349b7e989ae176c7854efaf5", + "scope": "compile", + "resolved": "https://repo.maven.apache.org/maven2/com/google/api/api-common/2.70.0/api-common-2.70.0.jar", + "selectedVersion": "2.70.0", + "included": true, + "id": "com.google.api:api-common:2.70.0", + "parent": "com.google.auth:google-auth-library-oauth2-http:1.54.0", + "children": [ + { + "groupId": "com.google.auto.value", + "artifactId": "auto-value-annotations", + "version": "1.11.0", + "checksumAlgorithm": "SHA-256", + "checksum": "5a055ce4255333b3346e1a8703da5bf8ff049532286fdcd31712d624abe111dd", + "scope": "compile", + "resolved": "https://repo.maven.apache.org/maven2/com/google/auto/value/auto-value-annotations/1.11.0/auto-value-annotations-1.11.0.jar", + "selectedVersion": "1.11.1", + "included": false, + "id": "com.google.auto.value:auto-value-annotations:1.11.0", + "parent": "com.google.api:api-common:2.70.0", + "children": [] + }, + { + "groupId": "com.google.code.findbugs", + "artifactId": "jsr305", + "version": "3.0.2", + "checksumAlgorithm": "SHA-256", + "checksum": "766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7", + "scope": "compile", + "resolved": "https://repo.maven.apache.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar", + "selectedVersion": "3.0.2", + "included": false, + "id": "com.google.code.findbugs:jsr305:3.0.2", + "parent": "com.google.api:api-common:2.70.0", + "children": [] + }, + { + "groupId": "com.google.errorprone", + "artifactId": "error_prone_annotations", + "version": "2.50.0", + "checksumAlgorithm": "SHA-256", + "checksum": "4667724877f1d37a689202da191e23efa7657c62eef93ccdac406eccfe5cdd0a", + "scope": "compile", + "resolved": "https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.50.0/error_prone_annotations-2.50.0.jar", + "selectedVersion": "2.50.0", + "included": false, + "id": "com.google.errorprone:error_prone_annotations:2.50.0", + "parent": "com.google.api:api-common:2.70.0", + "children": [] + }, + { + "groupId": "com.google.guava", + "artifactId": "guava", + "version": "33.6.0-jre", + "checksumAlgorithm": "SHA-256", + "checksum": "dc573e1fca4fd5454f4a5fd3d7da2df03002876a4175bafc14a95980dd7713b3", + "scope": "compile", + "resolved": "https://repo.maven.apache.org/maven2/com/google/guava/guava/33.6.0-jre/guava-33.6.0-jre.jar", + "selectedVersion": "33.6.0-jre", + "included": false, + "id": "com.google.guava:guava:33.6.0-jre", + "parent": "com.google.api:api-common:2.70.0", + "children": [] + } + ] + }, { "groupId": "com.google.auth", "artifactId": "google-auth-library-credentials", - "version": "1.20.0", + "version": "1.54.0", "checksumAlgorithm": "SHA-256", - "checksum": "b3054d8757807f8af8015b535fb288ed67456444922211f0f929f4c04e69b0b7", + "checksum": "47c36c6201c4c0336e0275aecfbba155a46d63aa07d416176a790774c9ecdca9", "scope": "compile", - "resolved": "https://repo.maven.apache.org/maven2/com/google/auth/google-auth-library-credentials/1.20.0/google-auth-library-credentials-1.20.0.jar", - "selectedVersion": "1.20.0", + "resolved": "https://repo.maven.apache.org/maven2/com/google/auth/google-auth-library-credentials/1.54.0/google-auth-library-credentials-1.54.0.jar", + "selectedVersion": "1.54.0", "included": true, - "id": "com.google.auth:google-auth-library-credentials:1.20.0", - "parent": "com.google.auth:google-auth-library-oauth2-http:1.20.0", - "children": [] + "id": "com.google.auth:google-auth-library-credentials:1.54.0", + "parent": "com.google.auth:google-auth-library-oauth2-http:1.54.0", + "children": [ + { + "groupId": "org.jspecify", + "artifactId": "jspecify", + "version": "1.0.0", + "checksumAlgorithm": "SHA-256", + "checksum": "1fad6e6be7557781e4d33729d49ae1cdc8fdda6fe477bb0cc68ce351eafdfbab", + "scope": "compile", + "resolved": "https://repo.maven.apache.org/maven2/org/jspecify/jspecify/1.0.0/jspecify-1.0.0.jar", + "selectedVersion": "1.0.0", + "included": false, + "id": "org.jspecify:jspecify:1.0.0", + "parent": "com.google.auth:google-auth-library-credentials:1.54.0", + "children": [] + } + ] }, { "groupId": "com.google.auto.value", "artifactId": "auto-value-annotations", - "version": "1.10.4", + "version": "1.11.0", "checksumAlgorithm": "SHA-256", - "checksum": "e1c45e6beadaef9797cb0d9afd5a45621ad061cd8632012f85582853a3887825", + "checksum": "5a055ce4255333b3346e1a8703da5bf8ff049532286fdcd31712d624abe111dd", "scope": "compile", - "resolved": "https://repo.maven.apache.org/maven2/com/google/auto/value/auto-value-annotations/1.10.4/auto-value-annotations-1.10.4.jar", - "selectedVersion": "1.10.4", + "resolved": "https://repo.maven.apache.org/maven2/com/google/auto/value/auto-value-annotations/1.11.0/auto-value-annotations-1.11.0.jar", + "selectedVersion": "1.11.1", "included": false, - "id": "com.google.auto.value:auto-value-annotations:1.10.4", - "parent": "com.google.auth:google-auth-library-oauth2-http:1.20.0", + "id": "com.google.auto.value:auto-value-annotations:1.11.0", + "parent": "com.google.auth:google-auth-library-oauth2-http:1.54.0", "children": [] }, { @@ -278,62 +364,91 @@ "selectedVersion": "3.0.2", "included": true, "id": "com.google.code.findbugs:jsr305:3.0.2", - "parent": "com.google.auth:google-auth-library-oauth2-http:1.20.0", + "parent": "com.google.auth:google-auth-library-oauth2-http:1.54.0", "children": [] }, { - "groupId": "com.google.guava", - "artifactId": "guava", - "version": "32.0.0-android", + "groupId": "com.google.code.gson", + "artifactId": "gson", + "version": "2.14.0", "checksumAlgorithm": "SHA-256", - "checksum": "96952b394133aa20ad3f18f4fb09582b12a8aa95e78c40203c7fb9efedcc2f7c", + "checksum": "2cbd119bf1961c28788310963dc80ba65f58cdeec1dd139c8bdb1240faa2c36f", "scope": "compile", - "resolved": "https://repo.maven.apache.org/maven2/com/google/guava/guava/32.0.0-android/guava-32.0.0-android.jar", - "selectedVersion": "32.0.0-android", + "resolved": "https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.14.0/gson-2.14.0.jar", + "selectedVersion": "2.14.0", "included": true, - "id": "com.google.guava:guava:32.0.0-android", - "parent": "com.google.auth:google-auth-library-oauth2-http:1.20.0", + "id": "com.google.code.gson:gson:2.14.0", + "parent": "com.google.auth:google-auth-library-oauth2-http:1.54.0", "children": [ { - "groupId": "com.google.code.findbugs", - "artifactId": "jsr305", - "version": "3.0.2", + "groupId": "com.google.errorprone", + "artifactId": "error_prone_annotations", + "version": "2.48.0", "checksumAlgorithm": "SHA-256", - "checksum": "766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7", + "checksum": "b49c5c958316ed67a09c699dda9aa749caf434d51d863dea599ef36a49b9c855", "scope": "compile", - "resolved": "https://repo.maven.apache.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar", - "selectedVersion": "3.0.2", + "resolved": "https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.48.0/error_prone_annotations-2.48.0.jar", + "selectedVersion": "2.50.0", "included": false, - "id": "com.google.code.findbugs:jsr305:3.0.2", - "parent": "com.google.guava:guava:32.0.0-android", + "id": "com.google.errorprone:error_prone_annotations:2.48.0", + "parent": "com.google.code.gson:gson:2.14.0", "children": [] - }, + } + ] + }, + { + "groupId": "com.google.errorprone", + "artifactId": "error_prone_annotations", + "version": "2.50.0", + "checksumAlgorithm": "SHA-256", + "checksum": "4667724877f1d37a689202da191e23efa7657c62eef93ccdac406eccfe5cdd0a", + "scope": "compile", + "resolved": "https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.50.0/error_prone_annotations-2.50.0.jar", + "selectedVersion": "2.50.0", + "included": true, + "id": "com.google.errorprone:error_prone_annotations:2.50.0", + "parent": "com.google.auth:google-auth-library-oauth2-http:1.54.0", + "children": [] + }, + { + "groupId": "com.google.guava", + "artifactId": "guava", + "version": "33.6.0-jre", + "checksumAlgorithm": "SHA-256", + "checksum": "dc573e1fca4fd5454f4a5fd3d7da2df03002876a4175bafc14a95980dd7713b3", + "scope": "compile", + "resolved": "https://repo.maven.apache.org/maven2/com/google/guava/guava/33.6.0-jre/guava-33.6.0-jre.jar", + "selectedVersion": "33.6.0-jre", + "included": true, + "id": "com.google.guava:guava:33.6.0-jre", + "parent": "com.google.auth:google-auth-library-oauth2-http:1.54.0", + "children": [ { "groupId": "com.google.errorprone", "artifactId": "error_prone_annotations", - "version": "2.18.0", + "version": "2.47.0", "checksumAlgorithm": "SHA-256", - "checksum": "9e6814cb71816988a4fd1b07a993a8f21bb7058d522c162b1de849e19bea54ae", + "checksum": "5364bc6f22e72e98195e406a58d3ba1c09ffa11dea0729592cb870dc2de4056d", "scope": "compile", - "resolved": "https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.18.0/error_prone_annotations-2.18.0.jar", - "selectedVersion": "2.18.0", + "resolved": "https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.47.0/error_prone_annotations-2.47.0.jar", + "selectedVersion": "2.50.0", "included": false, - "id": "com.google.errorprone:error_prone_annotations:2.18.0", - "parent": "com.google.guava:guava:32.0.0-android", + "id": "com.google.errorprone:error_prone_annotations:2.47.0", + "parent": "com.google.guava:guava:33.6.0-jre", "children": [] }, { "groupId": "com.google.guava", "artifactId": "failureaccess", - "version": "1.0.1", + "version": "1.0.3", "checksumAlgorithm": "SHA-256", - "checksum": "a171ee4c734dd2da837e4b16be9df4661afab72a41adaf31eb84dfdaf936ca26", + "checksum": "cbfc3906b19b8f55dd7cfd6dfe0aa4532e834250d7f080bd8d211a3e246b59cb", "scope": "compile", - "resolved": "https://repo.maven.apache.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar", - "selectedVersion": "1.0.1", + "resolved": "https://repo.maven.apache.org/maven2/com/google/guava/failureaccess/1.0.3/failureaccess-1.0.3.jar", + "selectedVersion": "1.0.3", "included": true, - "id": "com.google.guava:failureaccess:1.0.1", - "parent": "com.google.guava:guava:32.0.0-android", + "id": "com.google.guava:failureaccess:1.0.3", + "parent": "com.google.guava:guava:33.6.0-jre", "children": [] }, { @@ -347,35 +462,35 @@ "selectedVersion": "9999.0-empty-to-avoid-conflict-with-guava", "included": true, "id": "com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava", - "parent": "com.google.guava:guava:32.0.0-android", + "parent": "com.google.guava:guava:33.6.0-jre", "children": [] }, { "groupId": "com.google.j2objc", "artifactId": "j2objc-annotations", - "version": "2.8", + "version": "3.1", "checksumAlgorithm": "SHA-256", - "checksum": "f02a95fa1a5e95edb3ed859fd0fb7df709d121a35290eff8b74dce2ab7f4d6ed", + "checksum": "84d3a150518485f8140ea99b8a985656749629f6433c92b80c75b36aba3b099b", "scope": "compile", - "resolved": "https://repo.maven.apache.org/maven2/com/google/j2objc/j2objc-annotations/2.8/j2objc-annotations-2.8.jar", + "resolved": "https://repo.maven.apache.org/maven2/com/google/j2objc/j2objc-annotations/3.1/j2objc-annotations-3.1.jar", "selectedVersion": "2.8", "included": false, - "id": "com.google.j2objc:j2objc-annotations:2.8", - "parent": "com.google.guava:guava:32.0.0-android", + "id": "com.google.j2objc:j2objc-annotations:3.1", + "parent": "com.google.guava:guava:33.6.0-jre", "children": [] }, { - "groupId": "org.checkerframework", - "artifactId": "checker-qual", - "version": "3.33.0", + "groupId": "org.jspecify", + "artifactId": "jspecify", + "version": "1.0.0", "checksumAlgorithm": "SHA-256", - "checksum": "e316255bbfcd9fe50d165314b85abb2b33cb2a66a93c491db648e498a82c2de1", + "checksum": "1fad6e6be7557781e4d33729d49ae1cdc8fdda6fe477bb0cc68ce351eafdfbab", "scope": "compile", - "resolved": "https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/3.33.0/checker-qual-3.33.0.jar", - "selectedVersion": "3.33.0", - "included": true, - "id": "org.checkerframework:checker-qual:3.33.0", - "parent": "com.google.guava:guava:32.0.0-android", + "resolved": "https://repo.maven.apache.org/maven2/org/jspecify/jspecify/1.0.0/jspecify-1.0.0.jar", + "selectedVersion": "1.0.0", + "included": false, + "id": "org.jspecify:jspecify:1.0.0", + "parent": "com.google.guava:guava:33.6.0-jre", "children": [] } ] @@ -383,15 +498,15 @@ { "groupId": "com.google.http-client", "artifactId": "google-http-client", - "version": "1.43.3", + "version": "2.2.0", "checksumAlgorithm": "SHA-256", - "checksum": "60aca7428c5a1ff3655b70541a98ff3d70dded48ac1324dae1af39f1b61914af", + "checksum": "36cea7079c550aeb12fa7366a1ae65d503eaf15bcfc4f50124fde2a8f784e568", "scope": "compile", - "resolved": "https://repo.maven.apache.org/maven2/com/google/http-client/google-http-client/1.43.3/google-http-client-1.43.3.jar", - "selectedVersion": "1.43.3", + "resolved": "https://repo.maven.apache.org/maven2/com/google/http-client/google-http-client/2.2.0/google-http-client-2.2.0.jar", + "selectedVersion": "2.2.0", "included": true, - "id": "com.google.http-client:google-http-client:1.43.3", - "parent": "com.google.auth:google-auth-library-oauth2-http:1.20.0", + "id": "com.google.http-client:google-http-client:2.2.0", + "parent": "com.google.auth:google-auth-library-oauth2-http:1.54.0", "children": [ { "groupId": "com.google.code.findbugs", @@ -404,51 +519,80 @@ "selectedVersion": "3.0.2", "included": false, "id": "com.google.code.findbugs:jsr305:3.0.2", - "parent": "com.google.http-client:google-http-client:1.43.3", + "parent": "com.google.http-client:google-http-client:2.2.0", "children": [] }, { "groupId": "com.google.errorprone", "artifactId": "error_prone_annotations", - "version": "2.18.0", + "version": "2.36.0", "checksumAlgorithm": "SHA-256", - "checksum": "9e6814cb71816988a4fd1b07a993a8f21bb7058d522c162b1de849e19bea54ae", + "checksum": "77440e270b0bc9a249903c5a076c36a722c4886ca4f42675f2903a1c53ed61a5", "scope": "compile", - "resolved": "https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.18.0/error_prone_annotations-2.18.0.jar", - "selectedVersion": "2.18.0", + "resolved": "https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.36.0/error_prone_annotations-2.36.0.jar", + "selectedVersion": "2.50.0", "included": false, - "id": "com.google.errorprone:error_prone_annotations:2.18.0", - "parent": "com.google.http-client:google-http-client:1.43.3", + "id": "com.google.errorprone:error_prone_annotations:2.36.0", + "parent": "com.google.http-client:google-http-client:2.2.0", "children": [] }, { "groupId": "com.google.guava", "artifactId": "guava", - "version": "30.1.1-android", + "version": "33.4.8-android", "checksumAlgorithm": "SHA-256", - "checksum": "355f79352f8c252f2bdaa06c687c4836a38016caccfc4c28d16ae77ecfdffa2f", + "checksum": "a1f8a4bafe5a77232d333356843e194599b30837574a7f4be1063daaaaab102c", "scope": "compile", - "resolved": "https://repo.maven.apache.org/maven2/com/google/guava/guava/30.1.1-android/guava-30.1.1-android.jar", - "selectedVersion": "32.0.0-android", + "resolved": "https://repo.maven.apache.org/maven2/com/google/guava/guava/33.4.8-android/guava-33.4.8-android.jar", + "selectedVersion": "33.6.0-jre", "included": false, - "id": "com.google.guava:guava:30.1.1-android", - "parent": "com.google.http-client:google-http-client:1.43.3", + "id": "com.google.guava:guava:33.4.8-android", + "parent": "com.google.http-client:google-http-client:2.2.0", "children": [] }, { "groupId": "com.google.j2objc", "artifactId": "j2objc-annotations", - "version": "2.8", + "version": "3.0.0", "checksumAlgorithm": "SHA-256", - "checksum": "f02a95fa1a5e95edb3ed859fd0fb7df709d121a35290eff8b74dce2ab7f4d6ed", + "checksum": "88241573467ddca44ffd4d74aa04c2bbfd11bf7c17e0c342c94c9de7a70a7c64", "scope": "compile", - "resolved": "https://repo.maven.apache.org/maven2/com/google/j2objc/j2objc-annotations/2.8/j2objc-annotations-2.8.jar", + "resolved": "https://repo.maven.apache.org/maven2/com/google/j2objc/j2objc-annotations/3.0.0/j2objc-annotations-3.0.0.jar", "selectedVersion": "2.8", "included": false, - "id": "com.google.j2objc:j2objc-annotations:2.8", - "parent": "com.google.http-client:google-http-client:1.43.3", + "id": "com.google.j2objc:j2objc-annotations:3.0.0", + "parent": "com.google.http-client:google-http-client:2.2.0", "children": [] }, + { + "groupId": "io.grpc", + "artifactId": "grpc-context", + "version": "1.70.0", + "checksumAlgorithm": "SHA-256", + "checksum": "eb2824831c0ac03e741efda86b141aa863a481ebc4aaf5a5c1f13a481dbb40ff", + "scope": "compile", + "resolved": "https://repo.maven.apache.org/maven2/io/grpc/grpc-context/1.70.0/grpc-context-1.70.0.jar", + "selectedVersion": "1.70.0", + "included": true, + "id": "io.grpc:grpc-context:1.70.0", + "parent": "com.google.http-client:google-http-client:2.2.0", + "children": [ + { + "groupId": "io.grpc", + "artifactId": "grpc-api", + "version": "1.70.0", + "checksumAlgorithm": "SHA-256", + "checksum": "45faf2ac1bf2791e8fdabce53684a86b62c99b84cba26fb13a5ba3f4abf80d6c", + "scope": "runtime", + "resolved": "https://repo.maven.apache.org/maven2/io/grpc/grpc-api/1.70.0/grpc-api-1.70.0.jar", + "selectedVersion": "1.70.0", + "included": true, + "id": "io.grpc:grpc-api:1.70.0", + "parent": "io.grpc:grpc-context:1.70.0", + "children": [] + } + ] + }, { "groupId": "io.opencensus", "artifactId": "opencensus-api", @@ -460,7 +604,7 @@ "selectedVersion": "0.31.1", "included": true, "id": "io.opencensus:opencensus-api:0.31.1", - "parent": "com.google.http-client:google-http-client:1.43.3", + "parent": "com.google.http-client:google-http-client:2.2.0", "children": [ { "groupId": "io.grpc", @@ -470,8 +614,8 @@ "checksum": "bcbf9055dff453fd6508bd7cca2a0aa2d5f059a9c94beed1f5fda1dc015607b8", "scope": "compile", "resolved": "https://repo.maven.apache.org/maven2/io/grpc/grpc-context/1.27.2/grpc-context-1.27.2.jar", - "selectedVersion": "1.27.2", - "included": true, + "selectedVersion": "1.70.0", + "included": false, "id": "io.grpc:grpc-context:1.27.2", "parent": "io.opencensus:opencensus-api:0.31.1", "children": [] @@ -489,7 +633,7 @@ "selectedVersion": "0.31.1", "included": true, "id": "io.opencensus:opencensus-contrib-http-util:0.31.1", - "parent": "com.google.http-client:google-http-client:1.43.3", + "parent": "com.google.http-client:google-http-client:2.2.0", "children": [ { "groupId": "com.google.guava", @@ -499,7 +643,7 @@ "checksum": "00ba22cb0e32610db7cf8ab4c20017c85d11788600734ff1d86995345eb5bc3b", "scope": "compile", "resolved": "https://repo.maven.apache.org/maven2/com/google/guava/guava/29.0-android/guava-29.0-android.jar", - "selectedVersion": "32.0.0-android", + "selectedVersion": "33.6.0-jre", "included": false, "id": "com.google.guava:guava:29.0-android", "parent": "io.opencensus:opencensus-contrib-http-util:0.31.1", @@ -532,7 +676,7 @@ "selectedVersion": "4.5.14", "included": false, "id": "org.apache.httpcomponents:httpclient:4.5.14", - "parent": "com.google.http-client:google-http-client:1.43.3", + "parent": "com.google.http-client:google-http-client:2.2.0", "children": [] }, { @@ -546,7 +690,7 @@ "selectedVersion": "4.4.16", "included": false, "id": "org.apache.httpcomponents:httpcore:4.4.16", - "parent": "com.google.http-client:google-http-client:1.43.3", + "parent": "com.google.http-client:google-http-client:2.2.0", "children": [] } ] @@ -554,72 +698,86 @@ { "groupId": "com.google.http-client", "artifactId": "google-http-client-gson", - "version": "1.43.3", + "version": "2.2.0", "checksumAlgorithm": "SHA-256", - "checksum": "e31a4edcb9c83954a2587e14fa2f3f8f4aad56152381b3321a3bd0bcae03fa26", + "checksum": "3242dc7e91d355d118a355c5d586271bedfeb84c3f2f6fa2f3b9b42503a4dc59", "scope": "compile", - "resolved": "https://repo.maven.apache.org/maven2/com/google/http-client/google-http-client-gson/1.43.3/google-http-client-gson-1.43.3.jar", - "selectedVersion": "1.43.3", + "resolved": "https://repo.maven.apache.org/maven2/com/google/http-client/google-http-client-gson/2.2.0/google-http-client-gson-2.2.0.jar", + "selectedVersion": "2.2.0", "included": true, - "id": "com.google.http-client:google-http-client-gson:1.43.3", - "parent": "com.google.auth:google-auth-library-oauth2-http:1.20.0", + "id": "com.google.http-client:google-http-client-gson:2.2.0", + "parent": "com.google.auth:google-auth-library-oauth2-http:1.54.0", "children": [ { "groupId": "com.google.code.gson", "artifactId": "gson", - "version": "2.10.1", + "version": "2.11.0", "checksumAlgorithm": "SHA-256", - "checksum": "4241c14a7727c34feea6507ec801318a3d4a90f070e4525681079fb94ee4c593", + "checksum": "57928d6e5a6edeb2abd3770a8f95ba44dce45f3b23b7a9dc2b309c581552a78b", "scope": "compile", - "resolved": "https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar", - "selectedVersion": "2.8.9", + "resolved": "https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.11.0/gson-2.11.0.jar", + "selectedVersion": "2.14.0", "included": false, - "id": "com.google.code.gson:gson:2.10.1", - "parent": "com.google.http-client:google-http-client-gson:1.43.3", + "id": "com.google.code.gson:gson:2.11.0", + "parent": "com.google.http-client:google-http-client-gson:2.2.0", "children": [] }, { "groupId": "com.google.http-client", "artifactId": "google-http-client", - "version": "1.43.3", + "version": "2.2.0", "checksumAlgorithm": "SHA-256", - "checksum": "60aca7428c5a1ff3655b70541a98ff3d70dded48ac1324dae1af39f1b61914af", + "checksum": "36cea7079c550aeb12fa7366a1ae65d503eaf15bcfc4f50124fde2a8f784e568", "scope": "compile", - "resolved": "https://repo.maven.apache.org/maven2/com/google/http-client/google-http-client/1.43.3/google-http-client-1.43.3.jar", - "selectedVersion": "1.43.3", + "resolved": "https://repo.maven.apache.org/maven2/com/google/http-client/google-http-client/2.2.0/google-http-client-2.2.0.jar", + "selectedVersion": "2.2.0", "included": false, - "id": "com.google.http-client:google-http-client:1.43.3", - "parent": "com.google.http-client:google-http-client-gson:1.43.3", + "id": "com.google.http-client:google-http-client:2.2.0", + "parent": "com.google.http-client:google-http-client-gson:2.2.0", "children": [] } ] + }, + { + "groupId": "org.jspecify", + "artifactId": "jspecify", + "version": "1.0.0", + "checksumAlgorithm": "SHA-256", + "checksum": "1fad6e6be7557781e4d33729d49ae1cdc8fdda6fe477bb0cc68ce351eafdfbab", + "scope": "compile", + "resolved": "https://repo.maven.apache.org/maven2/org/jspecify/jspecify/1.0.0/jspecify-1.0.0.jar", + "selectedVersion": "1.0.0", + "included": true, + "id": "org.jspecify:jspecify:1.0.0", + "parent": "com.google.auth:google-auth-library-oauth2-http:1.54.0", + "children": [] } ] }, { "groupId": "com.google.auto.value", "artifactId": "auto-value", - "version": "1.10.4", + "version": "1.11.1", "checksumAlgorithm": "SHA-256", - "checksum": "f3c438d1f82904bbcb452084d488b660f3c7488e9274c3a58f049e121632d434", + "checksum": "0c556370ca3d072ba7dec6b37751ccad0e4804b6f3390cc9acb800d821dd9c0a", "scope": "provided", - "resolved": "https://repo.maven.apache.org/maven2/com/google/auto/value/auto-value/1.10.4/auto-value-1.10.4.jar", - "selectedVersion": "1.10.4", + "resolved": "https://repo.maven.apache.org/maven2/com/google/auto/value/auto-value/1.11.1/auto-value-1.11.1.jar", + "selectedVersion": "1.11.1", "included": true, - "id": "com.google.auto.value:auto-value:1.10.4", + "id": "com.google.auto.value:auto-value:1.11.1", "children": [] }, { "groupId": "com.google.auto.value", "artifactId": "auto-value-annotations", - "version": "1.10.4", + "version": "1.11.1", "checksumAlgorithm": "SHA-256", - "checksum": "e1c45e6beadaef9797cb0d9afd5a45621ad061cd8632012f85582853a3887825", + "checksum": "6c61a11420a5cddf3313888e9d335d5eedfbeb9a8da26591470fbfe61f5bf859", "scope": "provided", - "resolved": "https://repo.maven.apache.org/maven2/com/google/auto/value/auto-value-annotations/1.10.4/auto-value-annotations-1.10.4.jar", - "selectedVersion": "1.10.4", + "resolved": "https://repo.maven.apache.org/maven2/com/google/auto/value/auto-value-annotations/1.11.1/auto-value-annotations-1.11.1.jar", + "selectedVersion": "1.11.1", "included": true, - "id": "com.google.auto.value:auto-value-annotations:1.10.4", + "id": "com.google.auto.value:auto-value-annotations:1.11.1", "children": [] }, { @@ -669,8 +827,8 @@ "checksum": "d3999291855de495c94c743761b8ab5176cfeabe281a5ab0d8e8d45326fd703e", "scope": "compile", "resolved": "https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.8.9/gson-2.8.9.jar", - "selectedVersion": "2.8.9", - "included": true, + "selectedVersion": "2.14.0", + "included": false, "id": "com.google.code.gson:gson:2.8.9", "parent": "com.google.protobuf:protobuf-java-util:3.25.9", "children": [] @@ -683,8 +841,8 @@ "checksum": "9e6814cb71816988a4fd1b07a993a8f21bb7058d522c162b1de849e19bea54ae", "scope": "compile", "resolved": "https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.18.0/error_prone_annotations-2.18.0.jar", - "selectedVersion": "2.18.0", - "included": true, + "selectedVersion": "2.50.0", + "included": false, "id": "com.google.errorprone:error_prone_annotations:2.18.0", "parent": "com.google.protobuf:protobuf-java-util:3.25.9", "children": [] @@ -697,7 +855,7 @@ "checksum": "bd7fa227591fb8509677d0d1122cf95158f3b8a9f45653f58281d879f6dc48c5", "scope": "compile", "resolved": "https://repo.maven.apache.org/maven2/com/google/guava/guava/32.0.1-jre/guava-32.0.1-jre.jar", - "selectedVersion": "32.0.0-android", + "selectedVersion": "33.6.0-jre", "included": false, "id": "com.google.guava:guava:32.0.1-jre", "parent": "com.google.protobuf:protobuf-java-util:3.25.9", @@ -1315,4 +1473,4 @@ "checksumAlgorithm": "SHA-256" } } -} +} \ No newline at end of file diff --git a/databricks-sdk-java/pom.xml b/databricks-sdk-java/pom.xml index 32d3873fc..2b2438954 100644 --- a/databricks-sdk-java/pom.xml +++ b/databricks-sdk-java/pom.xml @@ -5,7 +5,7 @@ com.databricks databricks-sdk-parent - 0.170.0 + 0.171.0 databricks-sdk-java Databricks SDK for Java @@ -97,7 +97,7 @@ com.google.auth google-auth-library-oauth2-http - 1.20.0 + 1.54.0 @@ -121,13 +121,13 @@ com.google.auto.value auto-value - 1.10.4 + 1.11.1 provided com.google.auto.value auto-value-annotations - 1.10.4 + 1.11.1 provided diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/core/UserAgent.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/core/UserAgent.java index 491105e80..6c81aa24d 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/core/UserAgent.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/core/UserAgent.java @@ -36,7 +36,7 @@ public String getValue() { // TODO: check if reading from // /META-INF/maven/com.databricks/databrics-sdk-java/pom.properties // or getClass().getPackage().getImplementationVersion() is enough. - private static final String version = "0.170.0"; + private static final String version = "0.171.0"; public static void withProduct(String product, String productVersion) { UserAgent.product = product; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitAPI.java index c3506d9ec..68925533a 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitAPI.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitAPI.java @@ -148,6 +148,18 @@ public ManagedMemoryStore getMemoryStore(GetManagedMemoryStoreRequest request) { return impl.getMemoryStore(request); } + public MemoryStorePermission getMemoryStorePermission(String name) { + return getMemoryStorePermission(new GetMemoryStorePermissionRequest().setName(name)); + } + + /** + * Retrieves the current caller's effective memory store permission. Returns + * PERMISSION_LEVEL_UNSPECIFIED when the caller has no access. + */ + public MemoryStorePermission getMemoryStorePermission(GetMemoryStorePermissionRequest request) { + return impl.getMemoryStorePermission(request); + } + public Session getSession(String name) { return getSession(new GetSessionRequest().setName(name)); } @@ -166,6 +178,37 @@ public SessionStore getSessionStore(GetSessionStoreRequest request) { return impl.getSessionStore(request); } + public SessionStorePermission getSessionStorePermission(String name) { + return getSessionStorePermission(new GetSessionStorePermissionRequest().setName(name)); + } + + /** + * Retrieves the current caller's effective session store permission. Returns + * PERMISSION_LEVEL_UNSPECIFIED when the caller has no access. + */ + public SessionStorePermission getSessionStorePermission( + GetSessionStorePermissionRequest request) { + return impl.getSessionStorePermission(request); + } + + /** + * Grants a READ or WRITE permission on a memory store to a principal. Only the owner or a + * workspace admin may grant permissions. + */ + public GrantMemoryStorePermissionResponse grantMemoryStorePermission( + GrantMemoryStorePermissionRequest request) { + return impl.grantMemoryStorePermission(request); + } + + /** + * Grants a READ or WRITE permission on a session store to a principal. Only the owner or a + * workspace admin may grant permissions. + */ + public GrantSessionStorePermissionResponse grantSessionStorePermission( + GrantSessionStorePermissionRequest request) { + return impl.grantSessionStorePermission(request); + } + public Iterable listMemories(String parent, String actorId) { return listMemories( new ListManagedMemoryEntriesRequest().setParent(parent).setActorId(actorId)); @@ -190,6 +233,28 @@ public Iterable listMemories(ListManagedMemoryEntriesRequest }); } + public Iterable listMemoryStorePermissions(String parent) { + return listMemoryStorePermissions(new ListMemoryStorePermissionsRequest().setParent(parent)); + } + + /** + * Lists explicit memory store grants. Only the owner or a workspace admin may list permissions. + */ + public Iterable listMemoryStorePermissions( + ListMemoryStorePermissionsRequest request) { + return Paginator.newTokenPagination( + request, + impl::listMemoryStorePermissions, + ListMemoryStorePermissionsResponse::getMemoryStorePermissions, + response -> { + String token = response.getNextPageToken(); + if (token == null || token.isEmpty()) { + return null; + } + return request.setPageToken(token); + }); + } + /** Lists memory stores in the caller's workspace. */ public Iterable listMemoryStores(ListManagedMemoryStoresRequest request) { return Paginator.newTokenPagination( @@ -224,6 +289,28 @@ public Iterable listSessionItems(ListSessionItemsRequest request) { }); } + public Iterable listSessionStorePermissions(String parent) { + return listSessionStorePermissions(new ListSessionStorePermissionsRequest().setParent(parent)); + } + + /** + * Lists explicit session store grants. Only the owner or a workspace admin may list permissions. + */ + public Iterable listSessionStorePermissions( + ListSessionStorePermissionsRequest request) { + return Paginator.newTokenPagination( + request, + impl::listSessionStorePermissions, + ListSessionStorePermissionsResponse::getSessionStorePermissions, + response -> { + String token = response.getNextPageToken(); + if (token == null || token.isEmpty()) { + return null; + } + return request.setPageToken(token); + }); + } + /** Lists session stores. */ public Iterable listSessionStores(ListSessionStoresRequest request) { return Paginator.newTokenPagination( @@ -263,6 +350,24 @@ public PopSessionItemResponse popSessionItem(PopSessionItemRequest request) { return impl.popSessionItem(request); } + /** + * Removes a principal's explicit READ and WRITE grants on a memory store. Only the owner or a + * workspace admin may revoke permissions. Ownership and inherited access are unaffected. + */ + public RevokeMemoryStorePermissionResponse revokeMemoryStorePermission( + RevokeMemoryStorePermissionRequest request) { + return impl.revokeMemoryStorePermission(request); + } + + /** + * Removes a principal's explicit READ and WRITE grants on a session store. Only the owner or a + * workspace admin may revoke permissions. Ownership and inherited access are unaffected. + */ + public RevokeSessionStorePermissionResponse revokeSessionStorePermission( + RevokeSessionStorePermissionRequest request) { + return impl.revokeSessionStorePermission(request); + } + /** * Searches memory entries by text query for one actor. Returns matching entries and scores ranked * by relevance; `view` controls whether each returned entry includes content. diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitImpl.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitImpl.java index f2989119f..72fca32b1 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitImpl.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitImpl.java @@ -265,6 +265,23 @@ public ManagedMemoryStore getMemoryStore(GetManagedMemoryStoreRequest request) { } } + @Override + public MemoryStorePermission getMemoryStorePermission(GetMemoryStorePermissionRequest request) { + String path = String.format("/api/2.0/agents/%s/permissions/self", request.getName()); + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, MemoryStorePermission.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + @Override public Session getSession(GetSessionRequest request) { String path = String.format("/api/2.0/agents/%s", request.getName()); @@ -299,6 +316,62 @@ public SessionStore getSessionStore(GetSessionStoreRequest request) { } } + @Override + public SessionStorePermission getSessionStorePermission( + GetSessionStorePermissionRequest request) { + String path = String.format("/api/2.0/agents/%s/permissions/self", request.getName()); + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, SessionStorePermission.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public GrantMemoryStorePermissionResponse grantMemoryStorePermission( + GrantMemoryStorePermissionRequest request) { + String path = String.format("/api/2.0/agents/%s/permissions:grant", request.getName()); + try { + Request req = new Request("POST", path, apiClient.serialize(request)); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, GrantMemoryStorePermissionResponse.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public GrantSessionStorePermissionResponse grantSessionStorePermission( + GrantSessionStorePermissionRequest request) { + String path = String.format("/api/2.0/agents/%s/permissions:grant", request.getName()); + try { + Request req = new Request("POST", path, apiClient.serialize(request)); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, GrantSessionStorePermissionResponse.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + @Override public ListManagedMemoryEntriesResponse listMemories(ListManagedMemoryEntriesRequest request) { String path = String.format("/api/2.0/agents/%s/entries", request.getParent()); @@ -316,6 +389,24 @@ public ListManagedMemoryEntriesResponse listMemories(ListManagedMemoryEntriesReq } } + @Override + public ListMemoryStorePermissionsResponse listMemoryStorePermissions( + ListMemoryStorePermissionsRequest request) { + String path = String.format("/api/2.0/agents/%s/permissions", request.getParent()); + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, ListMemoryStorePermissionsResponse.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + @Override public ListManagedMemoryStoresResponse listMemoryStores(ListManagedMemoryStoresRequest request) { String path = "/api/2.0/agents/memory-stores"; @@ -350,6 +441,24 @@ public ListSessionItemsResponse listSessionItems(ListSessionItemsRequest request } } + @Override + public ListSessionStorePermissionsResponse listSessionStorePermissions( + ListSessionStorePermissionsRequest request) { + String path = String.format("/api/2.0/agents/%s/permissions", request.getParent()); + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, ListSessionStorePermissionsResponse.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + @Override public ListSessionStoresResponse listSessionStores(ListSessionStoresRequest request) { String path = "/api/2.0/agents/session-stores"; @@ -402,6 +511,44 @@ public PopSessionItemResponse popSessionItem(PopSessionItemRequest request) { } } + @Override + public RevokeMemoryStorePermissionResponse revokeMemoryStorePermission( + RevokeMemoryStorePermissionRequest request) { + String path = String.format("/api/2.0/agents/%s/permissions:revoke", request.getName()); + try { + Request req = new Request("POST", path, apiClient.serialize(request)); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, RevokeMemoryStorePermissionResponse.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public RevokeSessionStorePermissionResponse revokeSessionStorePermission( + RevokeSessionStorePermissionRequest request) { + String path = String.format("/api/2.0/agents/%s/permissions:revoke", request.getName()); + try { + Request req = new Request("POST", path, apiClient.serialize(request)); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, RevokeSessionStorePermissionResponse.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + @Override public SearchManagedMemoryEntriesResponse searchMemories( SearchManagedMemoryEntriesRequest request) { diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitService.java index 5376ffc07..3219fdb92 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitService.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitService.java @@ -84,12 +84,40 @@ ManagedMemoryStore createMemoryStore( */ ManagedMemoryStore getMemoryStore(GetManagedMemoryStoreRequest getManagedMemoryStoreRequest); + /** + * Retrieves the current caller's effective memory store permission. Returns + * PERMISSION_LEVEL_UNSPECIFIED when the caller has no access. + */ + MemoryStorePermission getMemoryStorePermission( + GetMemoryStorePermissionRequest getMemoryStorePermissionRequest); + /** Gets a session by resource name. */ Session getSession(GetSessionRequest getSessionRequest); /** Gets a session store by resource name. */ SessionStore getSessionStore(GetSessionStoreRequest getSessionStoreRequest); + /** + * Retrieves the current caller's effective session store permission. Returns + * PERMISSION_LEVEL_UNSPECIFIED when the caller has no access. + */ + SessionStorePermission getSessionStorePermission( + GetSessionStorePermissionRequest getSessionStorePermissionRequest); + + /** + * Grants a READ or WRITE permission on a memory store to a principal. Only the owner or a + * workspace admin may grant permissions. + */ + GrantMemoryStorePermissionResponse grantMemoryStorePermission( + GrantMemoryStorePermissionRequest grantMemoryStorePermissionRequest); + + /** + * Grants a READ or WRITE permission on a session store to a principal. Only the owner or a + * workspace admin may grant permissions. + */ + GrantSessionStorePermissionResponse grantSessionStorePermission( + GrantSessionStorePermissionRequest grantSessionStorePermissionRequest); + /** * Lists memory entries for one actor. An exact `path` filters entries across sessions, ignoring * session metadata. Otherwise, `session_id` and `path_prefix` restrict the actor partition. @@ -98,6 +126,12 @@ ManagedMemoryStore createMemoryStore( ListManagedMemoryEntriesResponse listMemories( ListManagedMemoryEntriesRequest listManagedMemoryEntriesRequest); + /** + * Lists explicit memory store grants. Only the owner or a workspace admin may list permissions. + */ + ListMemoryStorePermissionsResponse listMemoryStorePermissions( + ListMemoryStorePermissionsRequest listMemoryStorePermissionsRequest); + /** Lists memory stores in the caller's workspace. */ ListManagedMemoryStoresResponse listMemoryStores( ListManagedMemoryStoresRequest listManagedMemoryStoresRequest); @@ -105,6 +139,12 @@ ListManagedMemoryStoresResponse listMemoryStores( /** Lists items in a session. */ ListSessionItemsResponse listSessionItems(ListSessionItemsRequest listSessionItemsRequest); + /** + * Lists explicit session store grants. Only the owner or a workspace admin may list permissions. + */ + ListSessionStorePermissionsResponse listSessionStorePermissions( + ListSessionStorePermissionsRequest listSessionStorePermissionsRequest); + /** Lists session stores. */ ListSessionStoresResponse listSessionStores(ListSessionStoresRequest listSessionStoresRequest); @@ -114,6 +154,20 @@ ListManagedMemoryStoresResponse listMemoryStores( /** Pops the newest item from a session. */ PopSessionItemResponse popSessionItem(PopSessionItemRequest popSessionItemRequest); + /** + * Removes a principal's explicit READ and WRITE grants on a memory store. Only the owner or a + * workspace admin may revoke permissions. Ownership and inherited access are unaffected. + */ + RevokeMemoryStorePermissionResponse revokeMemoryStorePermission( + RevokeMemoryStorePermissionRequest revokeMemoryStorePermissionRequest); + + /** + * Removes a principal's explicit READ and WRITE grants on a session store. Only the owner or a + * workspace admin may revoke permissions. Ownership and inherited access are unaffected. + */ + RevokeSessionStorePermissionResponse revokeSessionStorePermission( + RevokeSessionStorePermissionRequest revokeSessionStorePermissionRequest); + /** * Searches memory entries by text query for one actor. Returns matching entries and scores ranked * by relevance; `view` controls whether each returned entry includes content. diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GetMemoryStorePermissionRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GetMemoryStorePermissionRequest.java new file mode 100644 index 000000000..fa45cbb66 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GetMemoryStorePermissionRequest.java @@ -0,0 +1,41 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class GetMemoryStorePermissionRequest { + /** Resource name in the form `memory-stores/{managed_memory_store_id}`. */ + @JsonIgnore private String name; + + public GetMemoryStorePermissionRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + GetMemoryStorePermissionRequest that = (GetMemoryStorePermissionRequest) o; + return Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + return new ToStringer(GetMemoryStorePermissionRequest.class).add("name", name).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GetSessionStorePermissionRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GetSessionStorePermissionRequest.java new file mode 100644 index 000000000..9b09776bd --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GetSessionStorePermissionRequest.java @@ -0,0 +1,41 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class GetSessionStorePermissionRequest { + /** Resource name in the form `session-stores/{session_store_id}`. */ + @JsonIgnore private String name; + + public GetSessionStorePermissionRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + GetSessionStorePermissionRequest that = (GetSessionStorePermissionRequest) o; + return Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + return new ToStringer(GetSessionStorePermissionRequest.class).add("name", name).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GrantMemoryStorePermissionRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GrantMemoryStorePermissionRequest.java new file mode 100644 index 000000000..abaa896c0 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GrantMemoryStorePermissionRequest.java @@ -0,0 +1,78 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Request to grant a READ or WRITE permission on a memory store to a principal. Only the store + * owner or a workspace admin may grant permissions. + */ +@Generated +public class GrantMemoryStorePermissionRequest { + /** Resource name in the form `memory-stores/{managed_memory_store_id}`. */ + @JsonIgnore private String name; + + /** Permission level to grant. */ + @JsonProperty("permission") + private PermissionLevel permission; + + /** Principal to grant the permission to. */ + @JsonProperty("principal") + private StorePrincipal principal; + + public GrantMemoryStorePermissionRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public GrantMemoryStorePermissionRequest setPermission(PermissionLevel permission) { + this.permission = permission; + return this; + } + + public PermissionLevel getPermission() { + return permission; + } + + public GrantMemoryStorePermissionRequest setPrincipal(StorePrincipal principal) { + this.principal = principal; + return this; + } + + public StorePrincipal getPrincipal() { + return principal; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + GrantMemoryStorePermissionRequest that = (GrantMemoryStorePermissionRequest) o; + return Objects.equals(name, that.name) + && Objects.equals(permission, that.permission) + && Objects.equals(principal, that.principal); + } + + @Override + public int hashCode() { + return Objects.hash(name, permission, principal); + } + + @Override + public String toString() { + return new ToStringer(GrantMemoryStorePermissionRequest.class) + .add("name", name) + .add("permission", permission) + .add("principal", principal) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GrantMemoryStorePermissionResponse.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GrantMemoryStorePermissionResponse.java new file mode 100644 index 000000000..08c09da19 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GrantMemoryStorePermissionResponse.java @@ -0,0 +1,29 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import java.util.Objects; + +/** Response from granting a permission on a memory store. */ +@Generated +public class GrantMemoryStorePermissionResponse { + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + return new ToStringer(GrantMemoryStorePermissionResponse.class).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GrantSessionStorePermissionRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GrantSessionStorePermissionRequest.java new file mode 100644 index 000000000..e6d8f0d10 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GrantSessionStorePermissionRequest.java @@ -0,0 +1,78 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Request to grant a READ or WRITE permission on a session store to a principal. Only the store + * owner or a workspace admin may grant permissions. + */ +@Generated +public class GrantSessionStorePermissionRequest { + /** Resource name in the form `session-stores/{session_store_id}`. */ + @JsonIgnore private String name; + + /** Permission level to grant. */ + @JsonProperty("permission") + private PermissionLevel permission; + + /** Principal to grant the permission to. */ + @JsonProperty("principal") + private StorePrincipal principal; + + public GrantSessionStorePermissionRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public GrantSessionStorePermissionRequest setPermission(PermissionLevel permission) { + this.permission = permission; + return this; + } + + public PermissionLevel getPermission() { + return permission; + } + + public GrantSessionStorePermissionRequest setPrincipal(StorePrincipal principal) { + this.principal = principal; + return this; + } + + public StorePrincipal getPrincipal() { + return principal; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + GrantSessionStorePermissionRequest that = (GrantSessionStorePermissionRequest) o; + return Objects.equals(name, that.name) + && Objects.equals(permission, that.permission) + && Objects.equals(principal, that.principal); + } + + @Override + public int hashCode() { + return Objects.hash(name, permission, principal); + } + + @Override + public String toString() { + return new ToStringer(GrantSessionStorePermissionRequest.class) + .add("name", name) + .add("permission", permission) + .add("principal", principal) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GrantSessionStorePermissionResponse.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GrantSessionStorePermissionResponse.java new file mode 100644 index 000000000..3f18e174b --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/GrantSessionStorePermissionResponse.java @@ -0,0 +1,29 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import java.util.Objects; + +/** Response from granting a permission on a session store. */ +@Generated +public class GrantSessionStorePermissionResponse { + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + return new ToStringer(GrantSessionStorePermissionResponse.class).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ListMemoryStorePermissionsRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ListMemoryStorePermissionsRequest.java new file mode 100644 index 000000000..3d1441434 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ListMemoryStorePermissionsRequest.java @@ -0,0 +1,76 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.QueryParam; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class ListMemoryStorePermissionsRequest { + /** Maximum number of permissions to return. Defaults to 100; maximum is 1000. */ + @JsonIgnore + @QueryParam("page_size") + private Long pageSize; + + /** Continuation token from a previous response. */ + @JsonIgnore + @QueryParam("page_token") + private String pageToken; + + /** Resource name of the store, in the form `memory-stores/{managed_memory_store_id}`. */ + @JsonIgnore private String parent; + + public ListMemoryStorePermissionsRequest setPageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + public Long getPageSize() { + return pageSize; + } + + public ListMemoryStorePermissionsRequest setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public ListMemoryStorePermissionsRequest setParent(String parent) { + this.parent = parent; + return this; + } + + public String getParent() { + return parent; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ListMemoryStorePermissionsRequest that = (ListMemoryStorePermissionsRequest) o; + return Objects.equals(pageSize, that.pageSize) + && Objects.equals(pageToken, that.pageToken) + && Objects.equals(parent, that.parent); + } + + @Override + public int hashCode() { + return Objects.hash(pageSize, pageToken, parent); + } + + @Override + public String toString() { + return new ToStringer(ListMemoryStorePermissionsRequest.class) + .add("pageSize", pageSize) + .add("pageToken", pageToken) + .add("parent", parent) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ListMemoryStorePermissionsResponse.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ListMemoryStorePermissionsResponse.java new file mode 100644 index 000000000..cd43991cd --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ListMemoryStorePermissionsResponse.java @@ -0,0 +1,64 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Objects; + +/** A page of explicit memory store permissions. */ +@Generated +public class ListMemoryStorePermissionsResponse { + /** + * Explicit READ or WRITE grants. Implicit owner/admin access and inherited grants are excluded. + */ + @JsonProperty("memory_store_permissions") + private Collection memoryStorePermissions; + + /** Token for the next page, omitted when all permissions have been returned. */ + @JsonProperty("next_page_token") + private String nextPageToken; + + public ListMemoryStorePermissionsResponse setMemoryStorePermissions( + Collection memoryStorePermissions) { + this.memoryStorePermissions = memoryStorePermissions; + return this; + } + + public Collection getMemoryStorePermissions() { + return memoryStorePermissions; + } + + public ListMemoryStorePermissionsResponse setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ListMemoryStorePermissionsResponse that = (ListMemoryStorePermissionsResponse) o; + return Objects.equals(memoryStorePermissions, that.memoryStorePermissions) + && Objects.equals(nextPageToken, that.nextPageToken); + } + + @Override + public int hashCode() { + return Objects.hash(memoryStorePermissions, nextPageToken); + } + + @Override + public String toString() { + return new ToStringer(ListMemoryStorePermissionsResponse.class) + .add("memoryStorePermissions", memoryStorePermissions) + .add("nextPageToken", nextPageToken) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ListSessionStorePermissionsRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ListSessionStorePermissionsRequest.java new file mode 100644 index 000000000..41c601570 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ListSessionStorePermissionsRequest.java @@ -0,0 +1,76 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.QueryParam; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class ListSessionStorePermissionsRequest { + /** Maximum number of permissions to return. Defaults to 100; maximum is 1000. */ + @JsonIgnore + @QueryParam("page_size") + private Long pageSize; + + /** Continuation token from a previous response. */ + @JsonIgnore + @QueryParam("page_token") + private String pageToken; + + /** Resource name of the store, in the form `session-stores/{session_store_id}`. */ + @JsonIgnore private String parent; + + public ListSessionStorePermissionsRequest setPageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + public Long getPageSize() { + return pageSize; + } + + public ListSessionStorePermissionsRequest setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public ListSessionStorePermissionsRequest setParent(String parent) { + this.parent = parent; + return this; + } + + public String getParent() { + return parent; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ListSessionStorePermissionsRequest that = (ListSessionStorePermissionsRequest) o; + return Objects.equals(pageSize, that.pageSize) + && Objects.equals(pageToken, that.pageToken) + && Objects.equals(parent, that.parent); + } + + @Override + public int hashCode() { + return Objects.hash(pageSize, pageToken, parent); + } + + @Override + public String toString() { + return new ToStringer(ListSessionStorePermissionsRequest.class) + .add("pageSize", pageSize) + .add("pageToken", pageToken) + .add("parent", parent) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ListSessionStorePermissionsResponse.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ListSessionStorePermissionsResponse.java new file mode 100644 index 000000000..3c2622397 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ListSessionStorePermissionsResponse.java @@ -0,0 +1,64 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Objects; + +/** A page of explicit session store permissions. */ +@Generated +public class ListSessionStorePermissionsResponse { + /** Token for the next page, omitted when all permissions have been returned. */ + @JsonProperty("next_page_token") + private String nextPageToken; + + /** + * Explicit READ or WRITE grants. Implicit owner/admin access and inherited grants are excluded. + */ + @JsonProperty("session_store_permissions") + private Collection sessionStorePermissions; + + public ListSessionStorePermissionsResponse setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public ListSessionStorePermissionsResponse setSessionStorePermissions( + Collection sessionStorePermissions) { + this.sessionStorePermissions = sessionStorePermissions; + return this; + } + + public Collection getSessionStorePermissions() { + return sessionStorePermissions; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ListSessionStorePermissionsResponse that = (ListSessionStorePermissionsResponse) o; + return Objects.equals(nextPageToken, that.nextPageToken) + && Objects.equals(sessionStorePermissions, that.sessionStorePermissions); + } + + @Override + public int hashCode() { + return Objects.hash(nextPageToken, sessionStorePermissions); + } + + @Override + public String toString() { + return new ToStringer(ListSessionStorePermissionsResponse.class) + .add("nextPageToken", nextPageToken) + .add("sessionStorePermissions", sessionStorePermissions) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ManagedMemoryEntry.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ManagedMemoryEntry.java index 557ec805a..67d9e4c82 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ManagedMemoryEntry.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/ManagedMemoryEntry.java @@ -29,7 +29,8 @@ public class ManagedMemoryEntry { /** * Resource name in the form - * `memory-stores/{managed_memory_store_id}/entries/{managed_memory_entry_id}`. + * `memory-stores/{managed_memory_store_id}/entries/{managed_memory_entry_id}`. Required for + * updates; assigned by the service on creation. */ @JsonProperty("name") private String name; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/MemoryStorePermission.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/MemoryStorePermission.java new file mode 100644 index 000000000..468a848c4 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/MemoryStorePermission.java @@ -0,0 +1,62 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** A principal's permission on a memory store. */ +@Generated +public class MemoryStorePermission { + /** + * The permission level. WRITE includes READ; PERMISSION_LEVEL_UNSPECIFIED means neither is + * available. + */ + @JsonProperty("permission") + private PermissionLevel permission; + + /** The principal whose permission is reported. */ + @JsonProperty("principal") + private StorePrincipal principal; + + public MemoryStorePermission setPermission(PermissionLevel permission) { + this.permission = permission; + return this; + } + + public PermissionLevel getPermission() { + return permission; + } + + public MemoryStorePermission setPrincipal(StorePrincipal principal) { + this.principal = principal; + return this; + } + + public StorePrincipal getPrincipal() { + return principal; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + MemoryStorePermission that = (MemoryStorePermission) o; + return Objects.equals(permission, that.permission) && Objects.equals(principal, that.principal); + } + + @Override + public int hashCode() { + return Objects.hash(permission, principal); + } + + @Override + public String toString() { + return new ToStringer(MemoryStorePermission.class) + .add("permission", permission) + .add("principal", principal) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/PermissionLevel.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/PermissionLevel.java new file mode 100644 index 000000000..4939290c9 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/PermissionLevel.java @@ -0,0 +1,12 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; + +/** Permission level granted on a store. WRITE is a superset of READ. */ +@Generated +public enum PermissionLevel { + READ, + WRITE, +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/PrincipalType.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/PrincipalType.java new file mode 100644 index 000000000..b048a534e --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/PrincipalType.java @@ -0,0 +1,12 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; + +/** The kind of Databricks principal a store permission is granted to. */ +@Generated +public enum PrincipalType { + SERVICE_PRINCIPAL, + USER, +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/RevokeMemoryStorePermissionRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/RevokeMemoryStorePermissionRequest.java new file mode 100644 index 000000000..c9eb74a18 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/RevokeMemoryStorePermissionRequest.java @@ -0,0 +1,62 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Request to revoke all explicit access to a memory store. Only the owner or a workspace admin may + * revoke permissions. + */ +@Generated +public class RevokeMemoryStorePermissionRequest { + /** Resource name in the form `memory-stores/{managed_memory_store_id}`. */ + @JsonIgnore private String name; + + /** Principal whose READ and WRITE grants will be removed. */ + @JsonProperty("principal") + private StorePrincipal principal; + + public RevokeMemoryStorePermissionRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public RevokeMemoryStorePermissionRequest setPrincipal(StorePrincipal principal) { + this.principal = principal; + return this; + } + + public StorePrincipal getPrincipal() { + return principal; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + RevokeMemoryStorePermissionRequest that = (RevokeMemoryStorePermissionRequest) o; + return Objects.equals(name, that.name) && Objects.equals(principal, that.principal); + } + + @Override + public int hashCode() { + return Objects.hash(name, principal); + } + + @Override + public String toString() { + return new ToStringer(RevokeMemoryStorePermissionRequest.class) + .add("name", name) + .add("principal", principal) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/RevokeMemoryStorePermissionResponse.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/RevokeMemoryStorePermissionResponse.java new file mode 100644 index 000000000..988c3cba9 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/RevokeMemoryStorePermissionResponse.java @@ -0,0 +1,29 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import java.util.Objects; + +/** Response from revoking a memory store permission. */ +@Generated +public class RevokeMemoryStorePermissionResponse { + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + return new ToStringer(RevokeMemoryStorePermissionResponse.class).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/RevokeSessionStorePermissionRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/RevokeSessionStorePermissionRequest.java new file mode 100644 index 000000000..93d3383a6 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/RevokeSessionStorePermissionRequest.java @@ -0,0 +1,62 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Request to revoke all explicit access to a session store. Only the owner or a workspace admin may + * revoke permissions. + */ +@Generated +public class RevokeSessionStorePermissionRequest { + /** Resource name in the form `session-stores/{session_store_id}`. */ + @JsonIgnore private String name; + + /** Principal whose READ and WRITE grants will be removed. */ + @JsonProperty("principal") + private StorePrincipal principal; + + public RevokeSessionStorePermissionRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public RevokeSessionStorePermissionRequest setPrincipal(StorePrincipal principal) { + this.principal = principal; + return this; + } + + public StorePrincipal getPrincipal() { + return principal; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + RevokeSessionStorePermissionRequest that = (RevokeSessionStorePermissionRequest) o; + return Objects.equals(name, that.name) && Objects.equals(principal, that.principal); + } + + @Override + public int hashCode() { + return Objects.hash(name, principal); + } + + @Override + public String toString() { + return new ToStringer(RevokeSessionStorePermissionRequest.class) + .add("name", name) + .add("principal", principal) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/RevokeSessionStorePermissionResponse.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/RevokeSessionStorePermissionResponse.java new file mode 100644 index 000000000..9f092ab13 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/RevokeSessionStorePermissionResponse.java @@ -0,0 +1,29 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import java.util.Objects; + +/** Response from revoking a session store permission. */ +@Generated +public class RevokeSessionStorePermissionResponse { + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + return new ToStringer(RevokeSessionStorePermissionResponse.class).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/SessionStorePermission.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/SessionStorePermission.java new file mode 100644 index 000000000..301cbd3bb --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/SessionStorePermission.java @@ -0,0 +1,62 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** A principal's permission on a session store. */ +@Generated +public class SessionStorePermission { + /** + * The permission level. WRITE includes READ; PERMISSION_LEVEL_UNSPECIFIED means neither is + * available. + */ + @JsonProperty("permission") + private PermissionLevel permission; + + /** The principal whose permission is reported. */ + @JsonProperty("principal") + private StorePrincipal principal; + + public SessionStorePermission setPermission(PermissionLevel permission) { + this.permission = permission; + return this; + } + + public PermissionLevel getPermission() { + return permission; + } + + public SessionStorePermission setPrincipal(StorePrincipal principal) { + this.principal = principal; + return this; + } + + public StorePrincipal getPrincipal() { + return principal; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SessionStorePermission that = (SessionStorePermission) o; + return Objects.equals(permission, that.permission) && Objects.equals(principal, that.principal); + } + + @Override + public int hashCode() { + return Objects.hash(permission, principal); + } + + @Override + public String toString() { + return new ToStringer(SessionStorePermission.class) + .add("permission", permission) + .add("principal", principal) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/StorePrincipal.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/StorePrincipal.java new file mode 100644 index 000000000..b5c0ac635 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/StorePrincipal.java @@ -0,0 +1,62 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.agentkit; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * A principal a store permission is granted to. `name` is the principal's Lakebase identifier: a + * user's email or a service principal's application (client) id. + */ +@Generated +public class StorePrincipal { + /** */ + @JsonProperty("name") + private String name; + + /** The kind of principal. Required unless the deprecated type alias is supplied. */ + @JsonProperty("principal_type") + private PrincipalType principalType; + + public StorePrincipal setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public StorePrincipal setPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + return this; + } + + public PrincipalType getPrincipalType() { + return principalType; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + StorePrincipal that = (StorePrincipal) o; + return Objects.equals(name, that.name) && Objects.equals(principalType, that.principalType); + } + + @Override + public int hashCode() { + return Objects.hash(name, principalType); + } + + @Override + public String toString() { + return new ToStringer(StorePrincipal.class) + .add("name", name) + .add("principalType", principalType) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/UpdateManagedMemoryEntryRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/UpdateManagedMemoryEntryRequest.java index 94c520e8c..3e5ccace4 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/UpdateManagedMemoryEntryRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/UpdateManagedMemoryEntryRequest.java @@ -18,7 +18,8 @@ public class UpdateManagedMemoryEntryRequest { /** * Resource name in the form - * `memory-stores/{managed_memory_store_id}/entries/{managed_memory_entry_id}`. + * `memory-stores/{managed_memory_store_id}/entries/{managed_memory_entry_id}`. Required for + * updates; assigned by the service on creation. */ @JsonIgnore private String name; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/ModelProviderServiceConfig.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/ModelProviderServiceConfig.java index 1112075ea..2d97a291d 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/ModelProviderServiceConfig.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/ModelProviderServiceConfig.java @@ -17,10 +17,9 @@ @Generated public class ModelProviderServiceConfig { /** - * When true, allows models from the provider's built-in model catalog in addition to explicit - * `targets`. When false, only models listed in `targets` are routable. Defaults to false. CUSTOM - * providers have no built-in model catalog and must leave this false and list their models in - * `targets`. + * When true, accepts any model exposed by the upstream provider; `targets` is not required and + * does not restrict routability. When false, only models listed in `targets` are routable. + * Defaults to false. */ @JsonProperty("allow_all_targets") private Boolean allowAllTargets; @@ -115,9 +114,8 @@ public class ModelProviderServiceConfig { * Models and provider-native API types exposed by this provider service. Each entry must include * at least one `native_api_types` value. When `allow_all_targets` is false, at least one entry is * required and model service destinations can reference only listed models. When - * `allow_all_targets` is true, models from the provider's built-in model catalog are also - * routable. CUSTOM providers must explicitly list their models here and cannot enable - * `allow_all_targets`. + * `allow_all_targets` is true, any upstream model is routable; entries in this list provide + * API-type metadata without restricting other models. */ @JsonProperty("targets") private Collection targets; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/Environment.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/Environment.java index dadb2668c..9c3b6bc3e 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/Environment.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/Environment.java @@ -59,7 +59,12 @@ public class Environment { @JsonProperty("java_dependencies") private Collection javaDependencies; - /** File path of pyproject.toml file that defines the project-scoped environment. */ + /** + * Path to the `pyproject.toml` file that defines the project environment. This field cannot be + * combined with `environment_version`, `base_environment`, dependency fields, or any other + * environment-source fields. Set the environment version and dependencies in `pyproject.toml` + * instead. For more information, see the serverless dependencies documentation. + */ @JsonProperty("project_environment") private String projectEnvironment; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataquality/AnomalyDetectionConfig.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataquality/AnomalyDetectionConfig.java index 3230194c5..0ab5ded78 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataquality/AnomalyDetectionConfig.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataquality/AnomalyDetectionConfig.java @@ -15,6 +15,22 @@ public class AnomalyDetectionConfig { @JsonProperty("excluded_table_full_names") private Collection excludedTableFullNames; + /** + * Who to alert when anomaly detection finds unhealthy tables in this schema. Applicable to + * `schema` monitors only. This is the same schema alert you manage from **Manage alerts** in the + * Data Quality Monitoring UI, so a change made in either place shows in both. + * + *

Set the recipients in `on_unhealthy_table`; `on_failure` is not supported here. Only + * `destination_ids` and `destination_user_ids` are supported. + * + *

On update, an update mask of `*`, `anomaly_detection_config`, or + * `anomaly_detection_config.notification_settings` replaces the alert's recipients with the ones + * in the request; omitting the field, or leaving both recipient lists empty, removes the alert. + * Other masks leave the alert unchanged. + */ + @JsonProperty("notification_settings") + private NotificationSettings notificationSettings; + public AnomalyDetectionConfig setExcludedTableFullNames( Collection excludedTableFullNames) { this.excludedTableFullNames = excludedTableFullNames; @@ -25,23 +41,34 @@ public Collection getExcludedTableFullNames() { return excludedTableFullNames; } + public AnomalyDetectionConfig setNotificationSettings(NotificationSettings notificationSettings) { + this.notificationSettings = notificationSettings; + return this; + } + + public NotificationSettings getNotificationSettings() { + return notificationSettings; + } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AnomalyDetectionConfig that = (AnomalyDetectionConfig) o; - return Objects.equals(excludedTableFullNames, that.excludedTableFullNames); + return Objects.equals(excludedTableFullNames, that.excludedTableFullNames) + && Objects.equals(notificationSettings, that.notificationSettings); } @Override public int hashCode() { - return Objects.hash(excludedTableFullNames); + return Objects.hash(excludedTableFullNames, notificationSettings); } @Override public String toString() { return new ToStringer(AnomalyDetectionConfig.class) .add("excludedTableFullNames", excludedTableFullNames) + .add("notificationSettings", notificationSettings) .toString(); } } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataquality/NotificationDestination.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataquality/NotificationDestination.java index 5a5a920aa..e776a88af 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataquality/NotificationDestination.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataquality/NotificationDestination.java @@ -11,6 +11,22 @@ /** Destination of the data quality monitoring notification. */ @Generated public class NotificationDestination { + /** + * The notification-destination IDs (Slack / Teams / webhook) to send the notification to. The + * destinations must already exist in the workspace; a workspace admin creates them. A maximum of + * 25 destination IDs is supported. Only supported on schema monitors, via + * `anomaly_detection_config`; rejected on table monitors. + */ + @JsonProperty("destination_ids") + private Collection destinationIds; + + /** + * The IDs of the workspace users to notify by email. A maximum of 25 user IDs is supported. Only + * supported on schema monitors, via `anomaly_detection_config`; rejected on table monitors. + */ + @JsonProperty("destination_user_ids") + private Collection destinationUserIds; + /** * The list of email addresses to send the notification to. A maximum of 5 email addresses is * supported. @@ -18,6 +34,24 @@ public class NotificationDestination { @JsonProperty("email_addresses") private Collection emailAddresses; + public NotificationDestination setDestinationIds(Collection destinationIds) { + this.destinationIds = destinationIds; + return this; + } + + public Collection getDestinationIds() { + return destinationIds; + } + + public NotificationDestination setDestinationUserIds(Collection destinationUserIds) { + this.destinationUserIds = destinationUserIds; + return this; + } + + public Collection getDestinationUserIds() { + return destinationUserIds; + } + public NotificationDestination setEmailAddresses(Collection emailAddresses) { this.emailAddresses = emailAddresses; return this; @@ -32,17 +66,21 @@ public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; NotificationDestination that = (NotificationDestination) o; - return Objects.equals(emailAddresses, that.emailAddresses); + return Objects.equals(destinationIds, that.destinationIds) + && Objects.equals(destinationUserIds, that.destinationUserIds) + && Objects.equals(emailAddresses, that.emailAddresses); } @Override public int hashCode() { - return Objects.hash(emailAddresses); + return Objects.hash(destinationIds, destinationUserIds, emailAddresses); } @Override public String toString() { return new ToStringer(NotificationDestination.class) + .add("destinationIds", destinationIds) + .add("destinationUserIds", destinationUserIds) .add("emailAddresses", emailAddresses) .toString(); } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataquality/NotificationSettings.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataquality/NotificationSettings.java index 6f3b950b5..fc28153ef 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataquality/NotificationSettings.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataquality/NotificationSettings.java @@ -14,6 +14,14 @@ public class NotificationSettings { @JsonProperty("on_failure") private NotificationDestination onFailure; + /** + * Recipients to notify when anomaly detection finds unhealthy tables in the schema. Each + * recipient gets one notification per important unhealthy table. Only supported on schema + * monitors, via `anomaly_detection_config`. + */ + @JsonProperty("on_unhealthy_table") + private NotificationDestination onUnhealthyTable; + public NotificationSettings setOnFailure(NotificationDestination onFailure) { this.onFailure = onFailure; return this; @@ -23,21 +31,34 @@ public NotificationDestination getOnFailure() { return onFailure; } + public NotificationSettings setOnUnhealthyTable(NotificationDestination onUnhealthyTable) { + this.onUnhealthyTable = onUnhealthyTable; + return this; + } + + public NotificationDestination getOnUnhealthyTable() { + return onUnhealthyTable; + } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; NotificationSettings that = (NotificationSettings) o; - return Objects.equals(onFailure, that.onFailure); + return Objects.equals(onFailure, that.onFailure) + && Objects.equals(onUnhealthyTable, that.onUnhealthyTable); } @Override public int hashCode() { - return Objects.hash(onFailure); + return Objects.hash(onFailure, onUnhealthyTable); } @Override public String toString() { - return new ToStringer(NotificationSettings.class).add("onFailure", onFailure).toString(); + return new ToStringer(NotificationSettings.class) + .add("onFailure", onFailure) + .add("onUnhealthyTable", onUnhealthyTable) + .toString(); } } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlOutput.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlOutput.java index 0ce85de12..ba1fd2461 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlOutput.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlOutput.java @@ -17,6 +17,10 @@ public class SqlOutput { @JsonProperty("dashboard_output") private SqlDashboardOutput dashboardOutput; + /** The output of a SQL file task, if available. */ + @JsonProperty("file_output") + private SqlTaskSqlFileOutput fileOutput; + /** The output of a SQL query task, if available. */ @JsonProperty("query_output") private SqlQueryOutput queryOutput; @@ -39,6 +43,15 @@ public SqlDashboardOutput getDashboardOutput() { return dashboardOutput; } + public SqlOutput setFileOutput(SqlTaskSqlFileOutput fileOutput) { + this.fileOutput = fileOutput; + return this; + } + + public SqlTaskSqlFileOutput getFileOutput() { + return fileOutput; + } + public SqlOutput setQueryOutput(SqlQueryOutput queryOutput) { this.queryOutput = queryOutput; return this; @@ -55,12 +68,13 @@ public boolean equals(Object o) { SqlOutput that = (SqlOutput) o; return Objects.equals(alertOutput, that.alertOutput) && Objects.equals(dashboardOutput, that.dashboardOutput) + && Objects.equals(fileOutput, that.fileOutput) && Objects.equals(queryOutput, that.queryOutput); } @Override public int hashCode() { - return Objects.hash(alertOutput, dashboardOutput, queryOutput); + return Objects.hash(alertOutput, dashboardOutput, fileOutput, queryOutput); } @Override @@ -68,6 +82,7 @@ public String toString() { return new ToStringer(SqlOutput.class) .add("alertOutput", alertOutput) .add("dashboardOutput", dashboardOutput) + .add("fileOutput", fileOutput) .add("queryOutput", queryOutput) .toString(); } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlQueryOutput.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlQueryOutput.java index d540662e4..7401dfe8d 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlQueryOutput.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlQueryOutput.java @@ -14,7 +14,7 @@ public class SqlQueryOutput { @JsonProperty("endpoint_id") private String endpointId; - /** The link to find the output results. */ + /** Deprecated. The link to find the output results, which are only accessible from the UI. */ @JsonProperty("output_link") private String outputLink; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlStatementQueryResult.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlStatementQueryResult.java new file mode 100644 index 000000000..edf16a0e4 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlStatementQueryResult.java @@ -0,0 +1,75 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.jobs; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Objects; + +@Generated +public class SqlStatementQueryResult { + /** The metadata for each column in the result set. */ + @JsonProperty("columns") + private Collection columns; + + /** The rows returned by the query. */ + @JsonProperty("rows") + private Collection rows; + + /** Whether the result set was truncated. */ + @JsonProperty("truncated") + private Boolean truncated; + + public SqlStatementQueryResult setColumns(Collection columns) { + this.columns = columns; + return this; + } + + public Collection getColumns() { + return columns; + } + + public SqlStatementQueryResult setRows(Collection rows) { + this.rows = rows; + return this; + } + + public Collection getRows() { + return rows; + } + + public SqlStatementQueryResult setTruncated(Boolean truncated) { + this.truncated = truncated; + return this; + } + + public Boolean getTruncated() { + return truncated; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SqlStatementQueryResult that = (SqlStatementQueryResult) o; + return Objects.equals(columns, that.columns) + && Objects.equals(rows, that.rows) + && Objects.equals(truncated, that.truncated); + } + + @Override + public int hashCode() { + return Objects.hash(columns, rows, truncated); + } + + @Override + public String toString() { + return new ToStringer(SqlStatementQueryResult.class) + .add("columns", columns) + .add("rows", rows) + .add("truncated", truncated) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlStatementQueryResultColumn.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlStatementQueryResultColumn.java new file mode 100644 index 000000000..efefc4d44 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlStatementQueryResultColumn.java @@ -0,0 +1,42 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.jobs; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +@Generated +public class SqlStatementQueryResultColumn { + /** The name of the column. */ + @JsonProperty("name") + private String name; + + public SqlStatementQueryResultColumn setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SqlStatementQueryResultColumn that = (SqlStatementQueryResultColumn) o; + return Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + return new ToStringer(SqlStatementQueryResultColumn.class).add("name", name).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlStatementQueryResultRow.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlStatementQueryResultRow.java new file mode 100644 index 000000000..61418d6da --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlStatementQueryResultRow.java @@ -0,0 +1,44 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.jobs; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Objects; + +@Generated +public class SqlStatementQueryResultRow { + /** The values in the row, ordered to match the columns. */ + @JsonProperty("values") + private Collection values; + + public SqlStatementQueryResultRow setValues( + Collection values) { + this.values = values; + return this; + } + + public Collection getValues() { + return values; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SqlStatementQueryResultRow that = (SqlStatementQueryResultRow) o; + return Objects.equals(values, that.values); + } + + @Override + public int hashCode() { + return Objects.hash(values); + } + + @Override + public String toString() { + return new ToStringer(SqlStatementQueryResultRow.class).add("values", values).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlStatementQueryResultRowRowValue.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlStatementQueryResultRowRowValue.java new file mode 100644 index 000000000..ca1154bf6 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlStatementQueryResultRowRowValue.java @@ -0,0 +1,44 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.jobs; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +@Generated +public class SqlStatementQueryResultRowRowValue { + /** The value rendered as a string. */ + @JsonProperty("string_value") + private String stringValue; + + public SqlStatementQueryResultRowRowValue setStringValue(String stringValue) { + this.stringValue = stringValue; + return this; + } + + public String getStringValue() { + return stringValue; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SqlStatementQueryResultRowRowValue that = (SqlStatementQueryResultRowRowValue) o; + return Objects.equals(stringValue, that.stringValue); + } + + @Override + public int hashCode() { + return Objects.hash(stringValue); + } + + @Override + public String toString() { + return new ToStringer(SqlStatementQueryResultRowRowValue.class) + .add("stringValue", stringValue) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlTaskSqlFileOutput.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlTaskSqlFileOutput.java new file mode 100644 index 000000000..c4d03bfdc --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/SqlTaskSqlFileOutput.java @@ -0,0 +1,90 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.jobs; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Objects; + +@Generated +public class SqlTaskSqlFileOutput { + /** The result of the executed SQL statement, if available. */ + @JsonProperty("query_result") + private SqlStatementQueryResult queryResult; + + /** The text of the SQL query. */ + @JsonProperty("query_text") + private String queryText; + + /** Information about SQL statements executed in the run. */ + @JsonProperty("sql_statements") + private Collection sqlStatements; + + /** The canonical identifier of the SQL warehouse. */ + @JsonProperty("warehouse_id") + private String warehouseId; + + public SqlTaskSqlFileOutput setQueryResult(SqlStatementQueryResult queryResult) { + this.queryResult = queryResult; + return this; + } + + public SqlStatementQueryResult getQueryResult() { + return queryResult; + } + + public SqlTaskSqlFileOutput setQueryText(String queryText) { + this.queryText = queryText; + return this; + } + + public String getQueryText() { + return queryText; + } + + public SqlTaskSqlFileOutput setSqlStatements(Collection sqlStatements) { + this.sqlStatements = sqlStatements; + return this; + } + + public Collection getSqlStatements() { + return sqlStatements; + } + + public SqlTaskSqlFileOutput setWarehouseId(String warehouseId) { + this.warehouseId = warehouseId; + return this; + } + + public String getWarehouseId() { + return warehouseId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SqlTaskSqlFileOutput that = (SqlTaskSqlFileOutput) o; + return Objects.equals(queryResult, that.queryResult) + && Objects.equals(queryText, that.queryText) + && Objects.equals(sqlStatements, that.sqlStatements) + && Objects.equals(warehouseId, that.warehouseId); + } + + @Override + public int hashCode() { + return Objects.hash(queryResult, queryText, sqlStatements, warehouseId); + } + + @Override + public String toString() { + return new ToStringer(SqlTaskSqlFileOutput.class) + .add("queryResult", queryResult) + .add("queryText", queryText) + .add("sqlStatements", sqlStatements) + .add("warehouseId", warehouseId) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/CreateMaterializationSetOperation.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/CreateMaterializationSetOperation.java new file mode 100644 index 000000000..bd70d3fa9 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/CreateMaterializationSetOperation.java @@ -0,0 +1,164 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.core.DatabricksException; +import com.databricks.sdk.core.logging.Logger; +import com.databricks.sdk.core.logging.LoggerFactory; +import com.databricks.sdk.core.utils.SerDeUtils; +import com.databricks.sdk.service.common.lro.LroOptions; +import com.databricks.sdk.support.Generated; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.time.Duration; +import java.util.Optional; +import java.util.concurrent.TimeoutException; + +/** + * Wrapper for interacting with a long-running createMaterializationSet operation. Provides methods + * to wait for completion, check status, cancel, and access metadata. + */ +@Generated +public class CreateMaterializationSetOperation { + private static final Logger LOG = + LoggerFactory.getLogger(CreateMaterializationSetOperation.class); + + private final FeatureEngineeringService impl; + private Operation operation; + private final ObjectMapper objectMapper; + + public CreateMaterializationSetOperation(FeatureEngineeringService impl, Operation operation) { + this.impl = impl; + this.operation = operation; + this.objectMapper = SerDeUtils.createMapper(); + } + + /** + * Wait for the operation to complete and return the resulting MaterializationSet. Waits + * indefinitely if no timeout is specified. + * + * @return the created MaterializationSet + * @throws TimeoutException if the operation doesn't complete within the timeout + * @throws DatabricksException if the operation fails + */ + public MaterializationSet waitForCompletion() throws TimeoutException { + return waitForCompletion(Optional.empty()); + } + + /** + * Wait for the operation to complete and return the resulting MaterializationSet. + * + * @param options the options for configuring the wait behavior, can be empty for defaults + * @return the created MaterializationSet + * @throws TimeoutException if the operation doesn't complete within the timeout + * @throws DatabricksException if the operation fails + */ + public MaterializationSet waitForCompletion(Optional options) + throws TimeoutException { + Optional timeout = options.flatMap(LroOptions::getTimeout); + long deadline = + timeout.isPresent() + ? System.currentTimeMillis() + timeout.get().toMillis() + : Long.MAX_VALUE; + String statusMessage = "polling operation..."; + int attempt = 1; + + while (System.currentTimeMillis() < deadline) { + // Refresh the operation state + refreshOperation(); + + if (operation.getDone() != null && operation.getDone()) { + // Operation completed, check for success or failure + if (operation.getError() != null) { + String errorMsg = "unknown error"; + if (operation.getError().getMessage() != null + && !operation.getError().getMessage().isEmpty()) { + errorMsg = operation.getError().getMessage(); + } + + if (operation.getError().getErrorCode() != null) { + errorMsg = String.format("[%s] %s", operation.getError().getErrorCode(), errorMsg); + } + + throw new DatabricksException("Operation failed: " + errorMsg); + } + + // Operation completed successfully, unmarshal response + if (operation.getResponse() == null) { + throw new DatabricksException("Operation completed but no response available"); + } + + try { + JsonNode responseJson = objectMapper.valueToTree(operation.getResponse()); + return objectMapper.treeToValue(responseJson, MaterializationSet.class); + } catch (JsonProcessingException e) { + throw new DatabricksException( + "Failed to unmarshal materializationSet response: " + e.getMessage(), e); + } + } + + // Operation still in progress, wait before polling again + String prefix = String.format("operation=%s", operation.getName()); + int sleep = Math.min(attempt, 10); // sleep 10s max per attempt + LOG.info("{}: operation in progress (sleeping ~{}s)", prefix, sleep); + + try { + Thread.sleep((long) (sleep * 1000L + Math.random() * 1000)); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new DatabricksException("Current thread was interrupted", e); + } + attempt++; + } + + String timeoutMessage = + timeout.isPresent() + ? String.format("Operation timed out after %s: %s", timeout.get(), statusMessage) + : String.format("Operation timed out: %s", statusMessage); + throw new TimeoutException(timeoutMessage); + } + + /** + * Get the operation name. + * + * @return the operation name + */ + public String getName() { + return operation.getName(); + } + + /** + * Get the operation metadata. + * + * @return the operation metadata, or null if not available + * @throws DatabricksException if the metadata cannot be deserialized + */ + public MaterializationSetOperationMetadata getMetadata() { + if (operation.getMetadata() == null) { + return null; + } + + try { + JsonNode metadataJson = objectMapper.valueToTree(operation.getMetadata()); + return objectMapper.treeToValue(metadataJson, MaterializationSetOperationMetadata.class); + } catch (JsonProcessingException e) { + throw new DatabricksException("Failed to unmarshal operation metadata: " + e.getMessage(), e); + } + } + + /** + * Check if the operation is done. This method refreshes the operation state before checking. + * + * @return true if the operation is complete, false otherwise + * @throws DatabricksException if the status check fails + */ + public boolean isDone() { + refreshOperation(); + return operation.getDone() != null && operation.getDone(); + } + + /** Refresh the operation state by polling the server. */ + private void refreshOperation() { + operation = impl.getOperation(new GetOperationRequest().setName(operation.getName())); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/CreateMaterializationSetRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/CreateMaterializationSetRequest.java new file mode 100644 index 000000000..b213b768c --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/CreateMaterializationSetRequest.java @@ -0,0 +1,72 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.QueryParam; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +@Generated +public class CreateMaterializationSetRequest { + /** + * The materialization set to create. Supply materialization_set_id to choose the identifier; + * leave it unset to have one assigned. + */ + @JsonProperty("materialization_set") + private MaterializationSet materializationSet; + + /** + * Idempotency token for the request. A second request carrying a token that has already been used + * returns the operation the first one created, whatever state it reached, and creates no second + * set. The token is not checked against the rest of the request, so reusing one for a different + * set returns the original operation rather than an error. Omit it and each request creates its + * own set. + */ + @JsonIgnore + @QueryParam("request_id") + private String requestId; + + public CreateMaterializationSetRequest setMaterializationSet( + MaterializationSet materializationSet) { + this.materializationSet = materializationSet; + return this; + } + + public MaterializationSet getMaterializationSet() { + return materializationSet; + } + + public CreateMaterializationSetRequest setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getRequestId() { + return requestId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CreateMaterializationSetRequest that = (CreateMaterializationSetRequest) o; + return Objects.equals(materializationSet, that.materializationSet) + && Objects.equals(requestId, that.requestId); + } + + @Override + public int hashCode() { + return Objects.hash(materializationSet, requestId); + } + + @Override + public String toString() { + return new ToStringer(CreateMaterializationSetRequest.class) + .add("materializationSet", materializationSet) + .add("requestId", requestId) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DeleteMaterializationSetOperation.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DeleteMaterializationSetOperation.java new file mode 100644 index 000000000..f02903997 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DeleteMaterializationSetOperation.java @@ -0,0 +1,163 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.core.DatabricksException; +import com.databricks.sdk.core.logging.Logger; +import com.databricks.sdk.core.logging.LoggerFactory; +import com.databricks.sdk.core.utils.SerDeUtils; +import com.databricks.sdk.service.common.lro.LroOptions; +import com.databricks.sdk.support.Generated; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.time.Duration; +import java.util.Optional; +import java.util.concurrent.TimeoutException; + +/** + * Wrapper for interacting with a long-running deleteMaterializationSet operation. Provides methods + * to wait for completion, check status, cancel, and access metadata. + */ +@Generated +public class DeleteMaterializationSetOperation { + private static final Logger LOG = + LoggerFactory.getLogger(DeleteMaterializationSetOperation.class); + + private final FeatureEngineeringService impl; + private Operation operation; + private final ObjectMapper objectMapper; + + public DeleteMaterializationSetOperation(FeatureEngineeringService impl, Operation operation) { + this.impl = impl; + this.operation = operation; + this.objectMapper = SerDeUtils.createMapper(); + } + + /** + * Wait for the operation to complete and return the resulting . Waits indefinitely if no timeout + * is specified. + * + * @return the created + * @throws TimeoutException if the operation doesn't complete within the timeout + * @throws DatabricksException if the operation fails + */ + public void waitForCompletion() throws TimeoutException { + waitForCompletion(Optional.empty()); + } + + /** + * Wait for the operation to complete and return the resulting . + * + * @param options the options for configuring the wait behavior, can be empty for defaults + * @return the created + * @throws TimeoutException if the operation doesn't complete within the timeout + * @throws DatabricksException if the operation fails + */ + public void waitForCompletion(Optional options) throws TimeoutException { + Optional timeout = options.flatMap(LroOptions::getTimeout); + long deadline = + timeout.isPresent() + ? System.currentTimeMillis() + timeout.get().toMillis() + : Long.MAX_VALUE; + String statusMessage = "polling operation..."; + int attempt = 1; + + while (System.currentTimeMillis() < deadline) { + // Refresh the operation state + refreshOperation(); + + if (operation.getDone() != null && operation.getDone()) { + // Operation completed, check for success or failure + if (operation.getError() != null) { + String errorMsg = "unknown error"; + if (operation.getError().getMessage() != null + && !operation.getError().getMessage().isEmpty()) { + errorMsg = operation.getError().getMessage(); + } + + if (operation.getError().getErrorCode() != null) { + errorMsg = String.format("[%s] %s", operation.getError().getErrorCode(), errorMsg); + } + + throw new DatabricksException("Operation failed: " + errorMsg); + } + + // Operation completed successfully, unmarshal response + if (operation.getResponse() == null) { + throw new DatabricksException("Operation completed but no response available"); + } + + try { + JsonNode responseJson = objectMapper.valueToTree(operation.getResponse()); + objectMapper.treeToValue(responseJson, Void.class); + return; + } catch (JsonProcessingException e) { + throw new DatabricksException("Failed to unmarshal response: " + e.getMessage(), e); + } + } + + // Operation still in progress, wait before polling again + String prefix = String.format("operation=%s", operation.getName()); + int sleep = Math.min(attempt, 10); // sleep 10s max per attempt + LOG.info("{}: operation in progress (sleeping ~{}s)", prefix, sleep); + + try { + Thread.sleep((long) (sleep * 1000L + Math.random() * 1000)); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new DatabricksException("Current thread was interrupted", e); + } + attempt++; + } + + String timeoutMessage = + timeout.isPresent() + ? String.format("Operation timed out after %s: %s", timeout.get(), statusMessage) + : String.format("Operation timed out: %s", statusMessage); + throw new TimeoutException(timeoutMessage); + } + + /** + * Get the operation name. + * + * @return the operation name + */ + public String getName() { + return operation.getName(); + } + + /** + * Get the operation metadata. + * + * @return the operation metadata, or null if not available + * @throws DatabricksException if the metadata cannot be deserialized + */ + public MaterializationSetOperationMetadata getMetadata() { + if (operation.getMetadata() == null) { + return null; + } + + try { + JsonNode metadataJson = objectMapper.valueToTree(operation.getMetadata()); + return objectMapper.treeToValue(metadataJson, MaterializationSetOperationMetadata.class); + } catch (JsonProcessingException e) { + throw new DatabricksException("Failed to unmarshal operation metadata: " + e.getMessage(), e); + } + } + + /** + * Check if the operation is done. This method refreshes the operation state before checking. + * + * @return true if the operation is complete, false otherwise + * @throws DatabricksException if the status check fails + */ + public boolean isDone() { + refreshOperation(); + return operation.getDone() != null && operation.getDone(); + } + + /** Refresh the operation state by polling the server. */ + private void refreshOperation() { + operation = impl.getOperation(new GetOperationRequest().setName(operation.getName())); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DeleteMaterializationSetRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DeleteMaterializationSetRequest.java new file mode 100644 index 000000000..f23bac4a5 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DeleteMaterializationSetRequest.java @@ -0,0 +1,84 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.QueryParam; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class DeleteMaterializationSetRequest { + /** + * Return success instead of NOT_FOUND when the set does not exist, so a repeated destroy is + * idempotent. + */ + @JsonIgnore + @QueryParam("allow_missing") + private Boolean allowMissing; + + /** The ID of the materialization set to delete. */ + @JsonIgnore private String materializationSetId; + + /** + * Idempotency token for the request. A second request carrying a token that has already been used + * returns the operation the first one created, whatever state it reached, and deletes nothing + * further. The token is not checked against the rest of the request. Omit it and each request + * deletes independently. + */ + @JsonIgnore + @QueryParam("request_id") + private String requestId; + + public DeleteMaterializationSetRequest setAllowMissing(Boolean allowMissing) { + this.allowMissing = allowMissing; + return this; + } + + public Boolean getAllowMissing() { + return allowMissing; + } + + public DeleteMaterializationSetRequest setMaterializationSetId(String materializationSetId) { + this.materializationSetId = materializationSetId; + return this; + } + + public String getMaterializationSetId() { + return materializationSetId; + } + + public DeleteMaterializationSetRequest setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getRequestId() { + return requestId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + DeleteMaterializationSetRequest that = (DeleteMaterializationSetRequest) o; + return Objects.equals(allowMissing, that.allowMissing) + && Objects.equals(materializationSetId, that.materializationSetId) + && Objects.equals(requestId, that.requestId); + } + + @Override + public int hashCode() { + return Objects.hash(allowMissing, materializationSetId, requestId); + } + + @Override + public String toString() { + return new ToStringer(DeleteMaterializationSetRequest.class) + .add("allowMissing", allowMissing) + .add("materializationSetId", materializationSetId) + .add("requestId", requestId) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringAPI.java index 1f4aec813..85be19eea 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringAPI.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringAPI.java @@ -54,6 +54,13 @@ public KafkaConfig createKafkaConfig(CreateKafkaConfigRequest request) { return impl.createKafkaConfig(request); } + /** Create a materialization set. */ + public CreateMaterializationSetOperation createMaterializationSet( + CreateMaterializationSetRequest request) { + Operation operation = impl.createMaterializationSet(request); + return new CreateMaterializationSetOperation(impl, operation); + } + /** Create a materialized feature. */ public MaterializedFeature createMaterializedFeature(CreateMaterializedFeatureRequest request) { return impl.createMaterializedFeature(request); @@ -85,6 +92,21 @@ public void deleteKafkaConfig(DeleteKafkaConfigRequest request) { impl.deleteKafkaConfig(request); } + public DeleteMaterializationSetOperation deleteMaterializationSet(String materializationSetId) { + return deleteMaterializationSet( + new DeleteMaterializationSetRequest().setMaterializationSetId(materializationSetId)); + } + + /** + * Delete a materialization set and every materialized feature in it. The set is gone afterwards, + * so a later read returns NOT_FOUND and the set id is free to use again. + */ + public DeleteMaterializationSetOperation deleteMaterializationSet( + DeleteMaterializationSetRequest request) { + Operation operation = impl.deleteMaterializationSet(request); + return new DeleteMaterializationSetOperation(impl, operation); + } + public void deleteMaterializedFeature(String materializedFeatureId) { deleteMaterializedFeature( new DeleteMaterializedFeatureRequest().setMaterializedFeatureId(materializedFeatureId)); @@ -125,6 +147,19 @@ public KafkaConfig getKafkaConfig(GetKafkaConfigRequest request) { return impl.getKafkaConfig(request); } + public MaterializationSet getMaterializationSet(String materializationSetId) { + return getMaterializationSet( + new GetMaterializationSetRequest().setMaterializationSetId(materializationSetId)); + } + + /** + * Get a materialization set and the materialized features in it. A set whose materialized feature + * members have all been deleted is returned with an empty member list. + */ + public MaterializationSet getMaterializationSet(GetMaterializationSetRequest request) { + return impl.getMaterializationSet(request); + } + public MaterializedFeature getMaterializedFeature(String materializedFeatureId) { return getMaterializedFeature( new GetMaterializedFeatureRequest().setMaterializedFeatureId(materializedFeatureId)); @@ -241,6 +276,17 @@ public KafkaConfig updateKafkaConfig(UpdateKafkaConfigRequest request) { return impl.updateKafkaConfig(request); } + /** + * Update the materialization set's state to match the supplied materialization set. Changes are + * applied member by member and are not atomic: when one member fails, the error reports which + * members were already changed. + */ + public UpdateMaterializationSetOperation updateMaterializationSet( + UpdateMaterializationSetRequest request) { + Operation operation = impl.updateMaterializationSet(request); + return new UpdateMaterializationSetOperation(impl, operation); + } + /** Update a materialized feature (pause/resume). */ public MaterializedFeature updateMaterializedFeature(UpdateMaterializedFeatureRequest request) { return impl.updateMaterializedFeature(request); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringImpl.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringImpl.java index 6cc228e38..30974318a 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringImpl.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringImpl.java @@ -111,6 +111,27 @@ public KafkaConfig createKafkaConfig(CreateKafkaConfigRequest request) { } } + @Override + public Operation createMaterializationSet(CreateMaterializationSetRequest request) { + String path = "/api/2.0/feature-engineering/materialization-sets"; + try { + Request req = new Request("POST", path, apiClient.serialize(request.getMaterializationSet())); + + if (request.getRequestId() == null || request.getRequestId().isEmpty()) { + request.setRequestId(UUID.randomUUID().toString()); + } + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, Operation.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + @Override public MaterializedFeature createMaterializedFeature(CreateMaterializedFeatureRequest request) { String path = "/api/2.0/feature-engineering/materialized-features"; @@ -183,6 +204,29 @@ public void deleteKafkaConfig(DeleteKafkaConfigRequest request) { } } + @Override + public Operation deleteMaterializationSet(DeleteMaterializationSetRequest request) { + String path = + String.format( + "/api/2.0/feature-engineering/materialization-sets/%s", + request.getMaterializationSetId()); + try { + Request req = new Request("DELETE", path); + + if (request.getRequestId() == null || request.getRequestId().isEmpty()) { + request.setRequestId(UUID.randomUUID().toString()); + } + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, Operation.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + @Override public void deleteMaterializedFeature(DeleteMaterializedFeatureRequest request) { String path = @@ -255,6 +299,26 @@ public KafkaConfig getKafkaConfig(GetKafkaConfigRequest request) { } } + @Override + public MaterializationSet getMaterializationSet(GetMaterializationSetRequest request) { + String path = + String.format( + "/api/2.0/feature-engineering/materialization-sets/%s", + request.getMaterializationSetId()); + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, MaterializationSet.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + @Override public MaterializedFeature getMaterializedFeature(GetMaterializedFeatureRequest request) { String path = @@ -436,6 +500,31 @@ public KafkaConfig updateKafkaConfig(UpdateKafkaConfigRequest request) { } } + @Override + public Operation updateMaterializationSet(UpdateMaterializationSetRequest request) { + String path = + String.format( + "/api/2.0/feature-engineering/materialization-sets/%s", + request.getMaterializationSetId()); + try { + Request req = + new Request("PATCH", path, apiClient.serialize(request.getMaterializationSet())); + + if (request.getRequestId() == null || request.getRequestId().isEmpty()) { + request.setRequestId(UUID.randomUUID().toString()); + } + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, Operation.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + @Override public MaterializedFeature updateMaterializedFeature(UpdateMaterializedFeatureRequest request) { String path = diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringService.java index 4b3af192e..4705e823e 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringService.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringService.java @@ -31,6 +31,10 @@ BatchCreateMaterializedFeaturesResponse batchCreateMaterializedFeatures( */ KafkaConfig createKafkaConfig(CreateKafkaConfigRequest createKafkaConfigRequest); + /** Create a materialization set. */ + Operation createMaterializationSet( + CreateMaterializationSetRequest createMaterializationSetRequest); + /** Create a materialized feature. */ MaterializedFeature createMaterializedFeature( CreateMaterializedFeatureRequest createMaterializedFeatureRequest); @@ -47,6 +51,13 @@ MaterializedFeature createMaterializedFeature( */ void deleteKafkaConfig(DeleteKafkaConfigRequest deleteKafkaConfigRequest); + /** + * Delete a materialization set and every materialized feature in it. The set is gone afterwards, + * so a later read returns NOT_FOUND and the set id is free to use again. + */ + Operation deleteMaterializationSet( + DeleteMaterializationSetRequest deleteMaterializationSetRequest); + /** Delete a materialized feature. */ void deleteMaterializedFeature(DeleteMaterializedFeatureRequest deleteMaterializedFeatureRequest); @@ -62,6 +73,13 @@ MaterializedFeature createMaterializedFeature( */ KafkaConfig getKafkaConfig(GetKafkaConfigRequest getKafkaConfigRequest); + /** + * Get a materialization set and the materialized features in it. A set whose materialized feature + * members have all been deleted is returned with an empty member list. + */ + MaterializationSet getMaterializationSet( + GetMaterializationSetRequest getMaterializationSetRequest); + /** Get a materialized feature. */ MaterializedFeature getMaterializedFeature( GetMaterializedFeatureRequest getMaterializedFeatureRequest); @@ -100,6 +118,14 @@ ListMaterializedFeaturesResponse listMaterializedFeatures( */ KafkaConfig updateKafkaConfig(UpdateKafkaConfigRequest updateKafkaConfigRequest); + /** + * Update the materialization set's state to match the supplied materialization set. Changes are + * applied member by member and are not atomic: when one member fails, the error reports which + * members were already changed. + */ + Operation updateMaterializationSet( + UpdateMaterializationSetRequest updateMaterializationSetRequest); + /** Update a materialized feature (pause/resume). */ MaterializedFeature updateMaterializedFeature( UpdateMaterializedFeatureRequest updateMaterializedFeatureRequest); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/GetMaterializationSetRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/GetMaterializationSetRequest.java new file mode 100644 index 000000000..aea6966b5 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/GetMaterializationSetRequest.java @@ -0,0 +1,43 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class GetMaterializationSetRequest { + /** The ID of the materialization set. */ + @JsonIgnore private String materializationSetId; + + public GetMaterializationSetRequest setMaterializationSetId(String materializationSetId) { + this.materializationSetId = materializationSetId; + return this; + } + + public String getMaterializationSetId() { + return materializationSetId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + GetMaterializationSetRequest that = (GetMaterializationSetRequest) o; + return Objects.equals(materializationSetId, that.materializationSetId); + } + + @Override + public int hashCode() { + return Objects.hash(materializationSetId); + } + + @Override + public String toString() { + return new ToStringer(GetMaterializationSetRequest.class) + .add("materializationSetId", materializationSetId) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSet.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSet.java new file mode 100644 index 000000000..9cafdecd7 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSet.java @@ -0,0 +1,65 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Objects; + +/** A group of materialized features created and managed as a single unit. */ +@Generated +public class MaterializationSet { + /** Server-assigned unique identifier for the materialization set. */ + @JsonProperty("materialization_set_id") + private String materializationSetId; + + /** + * The materialized features in this set. Order is not significant. Updating the set with a + * materialized feature removed from this set will cause it to be deleted. + */ + @JsonProperty("materialized_features") + private Collection materializedFeatures; + + public MaterializationSet setMaterializationSetId(String materializationSetId) { + this.materializationSetId = materializationSetId; + return this; + } + + public String getMaterializationSetId() { + return materializationSetId; + } + + public MaterializationSet setMaterializedFeatures( + Collection materializedFeatures) { + this.materializedFeatures = materializedFeatures; + return this; + } + + public Collection getMaterializedFeatures() { + return materializedFeatures; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + MaterializationSet that = (MaterializationSet) o; + return Objects.equals(materializationSetId, that.materializationSetId) + && Objects.equals(materializedFeatures, that.materializedFeatures); + } + + @Override + public int hashCode() { + return Objects.hash(materializationSetId, materializedFeatures); + } + + @Override + public String toString() { + return new ToStringer(MaterializationSet.class) + .add("materializationSetId", materializationSetId) + .add("materializedFeatures", materializedFeatures) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetDeletionProgress.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetDeletionProgress.java new file mode 100644 index 000000000..2604c9453 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetDeletionProgress.java @@ -0,0 +1,67 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Objects; + +/** + * What a partly failed DeleteMaterializationSet got through, attached to the error so a caller can + * tell which materialized feature members are gone and which ones still need attention. The set + * itself is left in place whenever any member failed, so a retry can still find the members. + */ +@Generated +public class MaterializationSetDeletionProgress { + /** Members that are no longer materialized, including any that were already gone. */ + @JsonProperty("deleted_materialized_feature_ids") + private Collection deletedMaterializedFeatureIds; + + /** Members that could not be deleted, one entry each. */ + @JsonProperty("failed_materialized_features") + private Collection failedMaterializedFeatures; + + public MaterializationSetDeletionProgress setDeletedMaterializedFeatureIds( + Collection deletedMaterializedFeatureIds) { + this.deletedMaterializedFeatureIds = deletedMaterializedFeatureIds; + return this; + } + + public Collection getDeletedMaterializedFeatureIds() { + return deletedMaterializedFeatureIds; + } + + public MaterializationSetDeletionProgress setFailedMaterializedFeatures( + Collection failedMaterializedFeatures) { + this.failedMaterializedFeatures = failedMaterializedFeatures; + return this; + } + + public Collection getFailedMaterializedFeatures() { + return failedMaterializedFeatures; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + MaterializationSetDeletionProgress that = (MaterializationSetDeletionProgress) o; + return Objects.equals(deletedMaterializedFeatureIds, that.deletedMaterializedFeatureIds) + && Objects.equals(failedMaterializedFeatures, that.failedMaterializedFeatures); + } + + @Override + public int hashCode() { + return Objects.hash(deletedMaterializedFeatureIds, failedMaterializedFeatures); + } + + @Override + public String toString() { + return new ToStringer(MaterializationSetDeletionProgress.class) + .add("deletedMaterializedFeatureIds", deletedMaterializedFeatureIds) + .add("failedMaterializedFeatures", failedMaterializedFeatures) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetOperationMetadata.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetOperationMetadata.java new file mode 100644 index 000000000..cc0737ce3 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetOperationMetadata.java @@ -0,0 +1,135 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.Timestamp; +import java.util.Collection; +import java.util.Objects; + +/** + * Progress of a materialization set operation. Shared by create, update and delete, because + * databricks.longrunning freezes a method's metadata type once it ships. + */ +@Generated +public class MaterializationSetOperationMetadata { + /** Time at which the operation was requested. */ + @JsonProperty("create_time") + private Timestamp createTime; + + /** Set by a DeleteMaterializationSet operation. */ + @JsonProperty("deletion_progress") + private MaterializationSetDeletionProgress deletionProgress; + + /** Full names of the features the set materializes, one entry per feature. */ + @JsonProperty("feature_full_names") + private Collection featureFullNames; + + /** ID of the materialization set the operation targets. */ + @JsonProperty("materialization_set_id") + private String materializationSetId; + + /** Current state of the operation. */ + @JsonProperty("state") + private MaterializationSetOperationMetadataState state; + + /** Set by an UpdateMaterializationSet operation. */ + @JsonProperty("update_progress") + private MaterializationSetUpdateProgress updateProgress; + + public MaterializationSetOperationMetadata setCreateTime(Timestamp createTime) { + this.createTime = createTime; + return this; + } + + public Timestamp getCreateTime() { + return createTime; + } + + public MaterializationSetOperationMetadata setDeletionProgress( + MaterializationSetDeletionProgress deletionProgress) { + this.deletionProgress = deletionProgress; + return this; + } + + public MaterializationSetDeletionProgress getDeletionProgress() { + return deletionProgress; + } + + public MaterializationSetOperationMetadata setFeatureFullNames( + Collection featureFullNames) { + this.featureFullNames = featureFullNames; + return this; + } + + public Collection getFeatureFullNames() { + return featureFullNames; + } + + public MaterializationSetOperationMetadata setMaterializationSetId(String materializationSetId) { + this.materializationSetId = materializationSetId; + return this; + } + + public String getMaterializationSetId() { + return materializationSetId; + } + + public MaterializationSetOperationMetadata setState( + MaterializationSetOperationMetadataState state) { + this.state = state; + return this; + } + + public MaterializationSetOperationMetadataState getState() { + return state; + } + + public MaterializationSetOperationMetadata setUpdateProgress( + MaterializationSetUpdateProgress updateProgress) { + this.updateProgress = updateProgress; + return this; + } + + public MaterializationSetUpdateProgress getUpdateProgress() { + return updateProgress; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + MaterializationSetOperationMetadata that = (MaterializationSetOperationMetadata) o; + return Objects.equals(createTime, that.createTime) + && Objects.equals(deletionProgress, that.deletionProgress) + && Objects.equals(featureFullNames, that.featureFullNames) + && Objects.equals(materializationSetId, that.materializationSetId) + && Objects.equals(state, that.state) + && Objects.equals(updateProgress, that.updateProgress); + } + + @Override + public int hashCode() { + return Objects.hash( + createTime, + deletionProgress, + featureFullNames, + materializationSetId, + state, + updateProgress); + } + + @Override + public String toString() { + return new ToStringer(MaterializationSetOperationMetadata.class) + .add("createTime", createTime) + .add("deletionProgress", deletionProgress) + .add("featureFullNames", featureFullNames) + .add("materializationSetId", materializationSetId) + .add("state", state) + .add("updateProgress", updateProgress) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetOperationMetadataState.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetOperationMetadataState.java new file mode 100644 index 000000000..83a6902f5 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetOperationMetadataState.java @@ -0,0 +1,15 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; + +/** Lifecycle state of a materialization set operation. */ +@Generated +public enum MaterializationSetOperationMetadataState { + CANCELLED, + FAILED, + PENDING, + RUNNING, + SUCCEEDED, +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetUpdateProgress.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetUpdateProgress.java new file mode 100644 index 000000000..c46d194f9 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetUpdateProgress.java @@ -0,0 +1,83 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Objects; + +/** + * What a partly failed UpdateMaterializationSet got through, attached to the error so a caller can + * tell which materialized feature members already changed and which ones did not and why it failed. + */ +@Generated +public class MaterializationSetUpdateProgress { + /** Materialized feature members that were deleted from the materialization set. */ + @JsonProperty("deleted_materialized_feature_ids") + private Collection deletedMaterializedFeatureIds; + + /** Materialized feature members that could not be updated, one entry each. */ + @JsonProperty("failed_materialized_features") + private Collection failedMaterializedFeatures; + + /** Materialized feature members whose mutable state was updated. */ + @JsonProperty("updated_materialized_feature_ids") + private Collection updatedMaterializedFeatureIds; + + public MaterializationSetUpdateProgress setDeletedMaterializedFeatureIds( + Collection deletedMaterializedFeatureIds) { + this.deletedMaterializedFeatureIds = deletedMaterializedFeatureIds; + return this; + } + + public Collection getDeletedMaterializedFeatureIds() { + return deletedMaterializedFeatureIds; + } + + public MaterializationSetUpdateProgress setFailedMaterializedFeatures( + Collection failedMaterializedFeatures) { + this.failedMaterializedFeatures = failedMaterializedFeatures; + return this; + } + + public Collection getFailedMaterializedFeatures() { + return failedMaterializedFeatures; + } + + public MaterializationSetUpdateProgress setUpdatedMaterializedFeatureIds( + Collection updatedMaterializedFeatureIds) { + this.updatedMaterializedFeatureIds = updatedMaterializedFeatureIds; + return this; + } + + public Collection getUpdatedMaterializedFeatureIds() { + return updatedMaterializedFeatureIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + MaterializationSetUpdateProgress that = (MaterializationSetUpdateProgress) o; + return Objects.equals(deletedMaterializedFeatureIds, that.deletedMaterializedFeatureIds) + && Objects.equals(failedMaterializedFeatures, that.failedMaterializedFeatures) + && Objects.equals(updatedMaterializedFeatureIds, that.updatedMaterializedFeatureIds); + } + + @Override + public int hashCode() { + return Objects.hash( + deletedMaterializedFeatureIds, failedMaterializedFeatures, updatedMaterializedFeatureIds); + } + + @Override + public String toString() { + return new ToStringer(MaterializationSetUpdateProgress.class) + .add("deletedMaterializedFeatureIds", deletedMaterializedFeatureIds) + .add("failedMaterializedFeatures", failedMaterializedFeatures) + .add("updatedMaterializedFeatureIds", updatedMaterializedFeatureIds) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializedFeature.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializedFeature.java index fbd5d2439..3da02e9e1 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializedFeature.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializedFeature.java @@ -57,6 +57,13 @@ public class MaterializedFeature { @JsonProperty("latest_backfill_operation") private String latestBackfillOperation; + /** + * The materialization set this materialized feature was created for, through DABs or + * direct-engine creation. Unset for a materialized feature that was not created as part of a set. + */ + @JsonProperty("materialization_set_id") + private String materializationSetId; + /** Server-assigned unique identifier for the materialized feature. */ @JsonProperty("materialized_feature_id") private String materializedFeatureId; @@ -200,6 +207,15 @@ public String getLatestBackfillOperation() { return latestBackfillOperation; } + public MaterializedFeature setMaterializationSetId(String materializationSetId) { + this.materializationSetId = materializationSetId; + return this; + } + + public String getMaterializationSetId() { + return materializationSetId; + } + public MaterializedFeature setMaterializedFeatureId(String materializedFeatureId) { this.materializedFeatureId = materializedFeatureId; return this; @@ -304,6 +320,7 @@ public boolean equals(Object o) { && Objects.equals(jobId, that.jobId) && Objects.equals(lastMaterializationTime, that.lastMaterializationTime) && Objects.equals(latestBackfillOperation, that.latestBackfillOperation) + && Objects.equals(materializationSetId, that.materializationSetId) && Objects.equals(materializedFeatureId, that.materializedFeatureId) && Objects.equals(notifications, that.notifications) && Objects.equals(offlineStoreConfig, that.offlineStoreConfig) @@ -327,6 +344,7 @@ public int hashCode() { jobId, lastMaterializationTime, latestBackfillOperation, + materializationSetId, materializedFeatureId, notifications, offlineStoreConfig, @@ -350,6 +368,7 @@ public String toString() { .add("jobId", jobId) .add("lastMaterializationTime", lastMaterializationTime) .add("latestBackfillOperation", latestBackfillOperation) + .add("materializationSetId", materializationSetId) .add("materializedFeatureId", materializedFeatureId) .add("notifications", notifications) .add("offlineStoreConfig", offlineStoreConfig) diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializedFeatureChangeFailure.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializedFeatureChangeFailure.java new file mode 100644 index 000000000..1526ae4b1 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializedFeatureChangeFailure.java @@ -0,0 +1,75 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** Why one materialization set member could not be changed. */ +@Generated +public class MaterializedFeatureChangeFailure { + /** Databricks error code name of the failure, for example "RESOURCE_CONFLICT". */ + @JsonProperty("error_code") + private String errorCode; + + /** The member that could not be changed. */ + @JsonProperty("materialized_feature_id") + private String materializedFeatureId; + + /** The failure's message. */ + @JsonProperty("message") + private String message; + + public MaterializedFeatureChangeFailure setErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + public String getErrorCode() { + return errorCode; + } + + public MaterializedFeatureChangeFailure setMaterializedFeatureId(String materializedFeatureId) { + this.materializedFeatureId = materializedFeatureId; + return this; + } + + public String getMaterializedFeatureId() { + return materializedFeatureId; + } + + public MaterializedFeatureChangeFailure setMessage(String message) { + this.message = message; + return this; + } + + public String getMessage() { + return message; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + MaterializedFeatureChangeFailure that = (MaterializedFeatureChangeFailure) o; + return Objects.equals(errorCode, that.errorCode) + && Objects.equals(materializedFeatureId, that.materializedFeatureId) + && Objects.equals(message, that.message); + } + + @Override + public int hashCode() { + return Objects.hash(errorCode, materializedFeatureId, message); + } + + @Override + public String toString() { + return new ToStringer(MaterializedFeatureChangeFailure.class) + .add("errorCode", errorCode) + .add("materializedFeatureId", materializedFeatureId) + .add("message", message) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/PurgeFeatureEntitiesMetadata.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/PurgeFeatureEntitiesMetadata.java index d92822847..910884049 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/PurgeFeatureEntitiesMetadata.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/PurgeFeatureEntitiesMetadata.java @@ -16,6 +16,10 @@ public class PurgeFeatureEntitiesMetadata { @JsonProperty("create_time") private Timestamp createTime; + /** Whether this purge deletes matching rows instead of setting feature values to null. */ + @JsonProperty("delete_rows") + private Boolean deleteRows; + /** Fully qualified name of the Unity Catalog Delta table containing the entity keys to purge. */ @JsonProperty("entities_table") private String entitiesTable; @@ -45,6 +49,15 @@ public Timestamp getCreateTime() { return createTime; } + public PurgeFeatureEntitiesMetadata setDeleteRows(Boolean deleteRows) { + this.deleteRows = deleteRows; + return this; + } + + public Boolean getDeleteRows() { + return deleteRows; + } + public PurgeFeatureEntitiesMetadata setEntitiesTable(String entitiesTable) { this.entitiesTable = entitiesTable; return this; @@ -96,6 +109,7 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) return false; PurgeFeatureEntitiesMetadata that = (PurgeFeatureEntitiesMetadata) o; return Objects.equals(createTime, that.createTime) + && Objects.equals(deleteRows, that.deleteRows) && Objects.equals(entitiesTable, that.entitiesTable) && Objects.equals(entitiesTableVersion, that.entitiesTableVersion) && Objects.equals(features, that.features) @@ -105,13 +119,15 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(createTime, entitiesTable, entitiesTableVersion, features, jobId, state); + return Objects.hash( + createTime, deleteRows, entitiesTable, entitiesTableVersion, features, jobId, state); } @Override public String toString() { return new ToStringer(PurgeFeatureEntitiesMetadata.class) .add("createTime", createTime) + .add("deleteRows", deleteRows) .add("entitiesTable", entitiesTable) .add("entitiesTableVersion", entitiesTableVersion) .add("features", features) diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/PurgeFeatureEntitiesRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/PurgeFeatureEntitiesRequest.java index 0d2f53743..75c3b24c8 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/PurgeFeatureEntitiesRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/PurgeFeatureEntitiesRequest.java @@ -21,6 +21,16 @@ public class PurgeFeatureEntitiesRequest { @JsonProperty("budget_policy_id") private String budgetPolicyId; + /** + * If false feature values are set to null on purge but rows are not deleted. If true then the + * full rows containing entities are deleted. Defaults to false. When true, the request must + * include every feature which shares the same `table_name` property in their MaterializedFeature. + * Features from multiple tables may be included if all features materialized in each table are + * included. + */ + @JsonProperty("delete_rows") + private Boolean deleteRows; + /** * Fully qualified name of the Unity Catalog Delta table containing the entity keys to purge. The * table may contain a subset of each feature's entity-key columns. A partial key match deletes @@ -32,7 +42,7 @@ public class PurgeFeatureEntitiesRequest { /** * Fully qualified names of the features to purge. At least one nonempty feature name is required. - * A request may contain at most 10000 features; submit additional features in separate requests. + * A request may contain at most 500 features; submit additional features in separate requests. * Duplicate features are rejected. */ @JsonProperty("features") @@ -62,6 +72,15 @@ public String getBudgetPolicyId() { return budgetPolicyId; } + public PurgeFeatureEntitiesRequest setDeleteRows(Boolean deleteRows) { + this.deleteRows = deleteRows; + return this; + } + + public Boolean getDeleteRows() { + return deleteRows; + } + public PurgeFeatureEntitiesRequest setEntitiesTable(String entitiesTable) { this.entitiesTable = entitiesTable; return this; @@ -104,6 +123,7 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) return false; PurgeFeatureEntitiesRequest that = (PurgeFeatureEntitiesRequest) o; return Objects.equals(budgetPolicyId, that.budgetPolicyId) + && Objects.equals(deleteRows, that.deleteRows) && Objects.equals(entitiesTable, that.entitiesTable) && Objects.equals(features, that.features) && Objects.equals(requestId, that.requestId) @@ -112,13 +132,14 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(budgetPolicyId, entitiesTable, features, requestId, tags); + return Objects.hash(budgetPolicyId, deleteRows, entitiesTable, features, requestId, tags); } @Override public String toString() { return new ToStringer(PurgeFeatureEntitiesRequest.class) .add("budgetPolicyId", budgetPolicyId) + .add("deleteRows", deleteRows) .add("entitiesTable", entitiesTable) .add("features", features) .add("requestId", requestId) diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/SdpSource.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/SdpSource.java index 2c61359c1..ac494d69a 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/SdpSource.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/SdpSource.java @@ -29,8 +29,8 @@ public class SdpSource { /** * The full three-part names of the tables the pipeline reads from. Required to materialize this * feature with a TableTrigger, which starts a run when these tables update. Each table must exist - * when the feature is created. After the pipeline runs, Feature Store checks that it reads from - * these tables, and the run fails if it doesn't. At most 100 tables. + * when the feature is created. Feature Store doesn't confirm that the pipeline reads from these + * tables. At most 100 tables. */ @JsonProperty("input_tables") private Collection inputTables; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/UpdateMaterializationSetOperation.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/UpdateMaterializationSetOperation.java new file mode 100644 index 000000000..c15e6b3cf --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/UpdateMaterializationSetOperation.java @@ -0,0 +1,164 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.core.DatabricksException; +import com.databricks.sdk.core.logging.Logger; +import com.databricks.sdk.core.logging.LoggerFactory; +import com.databricks.sdk.core.utils.SerDeUtils; +import com.databricks.sdk.service.common.lro.LroOptions; +import com.databricks.sdk.support.Generated; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.time.Duration; +import java.util.Optional; +import java.util.concurrent.TimeoutException; + +/** + * Wrapper for interacting with a long-running updateMaterializationSet operation. Provides methods + * to wait for completion, check status, cancel, and access metadata. + */ +@Generated +public class UpdateMaterializationSetOperation { + private static final Logger LOG = + LoggerFactory.getLogger(UpdateMaterializationSetOperation.class); + + private final FeatureEngineeringService impl; + private Operation operation; + private final ObjectMapper objectMapper; + + public UpdateMaterializationSetOperation(FeatureEngineeringService impl, Operation operation) { + this.impl = impl; + this.operation = operation; + this.objectMapper = SerDeUtils.createMapper(); + } + + /** + * Wait for the operation to complete and return the resulting MaterializationSet. Waits + * indefinitely if no timeout is specified. + * + * @return the created MaterializationSet + * @throws TimeoutException if the operation doesn't complete within the timeout + * @throws DatabricksException if the operation fails + */ + public MaterializationSet waitForCompletion() throws TimeoutException { + return waitForCompletion(Optional.empty()); + } + + /** + * Wait for the operation to complete and return the resulting MaterializationSet. + * + * @param options the options for configuring the wait behavior, can be empty for defaults + * @return the created MaterializationSet + * @throws TimeoutException if the operation doesn't complete within the timeout + * @throws DatabricksException if the operation fails + */ + public MaterializationSet waitForCompletion(Optional options) + throws TimeoutException { + Optional timeout = options.flatMap(LroOptions::getTimeout); + long deadline = + timeout.isPresent() + ? System.currentTimeMillis() + timeout.get().toMillis() + : Long.MAX_VALUE; + String statusMessage = "polling operation..."; + int attempt = 1; + + while (System.currentTimeMillis() < deadline) { + // Refresh the operation state + refreshOperation(); + + if (operation.getDone() != null && operation.getDone()) { + // Operation completed, check for success or failure + if (operation.getError() != null) { + String errorMsg = "unknown error"; + if (operation.getError().getMessage() != null + && !operation.getError().getMessage().isEmpty()) { + errorMsg = operation.getError().getMessage(); + } + + if (operation.getError().getErrorCode() != null) { + errorMsg = String.format("[%s] %s", operation.getError().getErrorCode(), errorMsg); + } + + throw new DatabricksException("Operation failed: " + errorMsg); + } + + // Operation completed successfully, unmarshal response + if (operation.getResponse() == null) { + throw new DatabricksException("Operation completed but no response available"); + } + + try { + JsonNode responseJson = objectMapper.valueToTree(operation.getResponse()); + return objectMapper.treeToValue(responseJson, MaterializationSet.class); + } catch (JsonProcessingException e) { + throw new DatabricksException( + "Failed to unmarshal materializationSet response: " + e.getMessage(), e); + } + } + + // Operation still in progress, wait before polling again + String prefix = String.format("operation=%s", operation.getName()); + int sleep = Math.min(attempt, 10); // sleep 10s max per attempt + LOG.info("{}: operation in progress (sleeping ~{}s)", prefix, sleep); + + try { + Thread.sleep((long) (sleep * 1000L + Math.random() * 1000)); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new DatabricksException("Current thread was interrupted", e); + } + attempt++; + } + + String timeoutMessage = + timeout.isPresent() + ? String.format("Operation timed out after %s: %s", timeout.get(), statusMessage) + : String.format("Operation timed out: %s", statusMessage); + throw new TimeoutException(timeoutMessage); + } + + /** + * Get the operation name. + * + * @return the operation name + */ + public String getName() { + return operation.getName(); + } + + /** + * Get the operation metadata. + * + * @return the operation metadata, or null if not available + * @throws DatabricksException if the metadata cannot be deserialized + */ + public MaterializationSetOperationMetadata getMetadata() { + if (operation.getMetadata() == null) { + return null; + } + + try { + JsonNode metadataJson = objectMapper.valueToTree(operation.getMetadata()); + return objectMapper.treeToValue(metadataJson, MaterializationSetOperationMetadata.class); + } catch (JsonProcessingException e) { + throw new DatabricksException("Failed to unmarshal operation metadata: " + e.getMessage(), e); + } + } + + /** + * Check if the operation is done. This method refreshes the operation state before checking. + * + * @return true if the operation is complete, false otherwise + * @throws DatabricksException if the status check fails + */ + public boolean isDone() { + refreshOperation(); + return operation.getDone() != null && operation.getDone(); + } + + /** Refresh the operation state by polling the server. */ + private void refreshOperation() { + operation = impl.getOperation(new GetOperationRequest().setName(operation.getName())); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/UpdateMaterializationSetRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/UpdateMaterializationSetRequest.java new file mode 100644 index 000000000..d293f96e6 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/UpdateMaterializationSetRequest.java @@ -0,0 +1,101 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.QueryParam; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.FieldMask; +import java.util.Objects; + +@Generated +public class UpdateMaterializationSetRequest { + /** + * The desired state of the updated materialization set. materialization_set_id selects the set. + */ + @JsonProperty("materialization_set") + private MaterializationSet materializationSet; + + /** Server-assigned unique identifier for the materialization set. */ + @JsonIgnore private String materializationSetId; + + /** + * Idempotency token for the request. A second request carrying a token that has already been used + * returns the operation the first one created, whatever state it reached, and changes nothing + * further. The token is not checked against the rest of the request. Omit it and each request + * updates independently. + */ + @JsonIgnore + @QueryParam("request_id") + private String requestId; + + /** The fields to update. Only 'materialized_features' is supported. */ + @JsonIgnore + @QueryParam("update_mask") + private FieldMask updateMask; + + public UpdateMaterializationSetRequest setMaterializationSet( + MaterializationSet materializationSet) { + this.materializationSet = materializationSet; + return this; + } + + public MaterializationSet getMaterializationSet() { + return materializationSet; + } + + public UpdateMaterializationSetRequest setMaterializationSetId(String materializationSetId) { + this.materializationSetId = materializationSetId; + return this; + } + + public String getMaterializationSetId() { + return materializationSetId; + } + + public UpdateMaterializationSetRequest setRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + public String getRequestId() { + return requestId; + } + + public UpdateMaterializationSetRequest setUpdateMask(FieldMask updateMask) { + this.updateMask = updateMask; + return this; + } + + public FieldMask getUpdateMask() { + return updateMask; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + UpdateMaterializationSetRequest that = (UpdateMaterializationSetRequest) o; + return Objects.equals(materializationSet, that.materializationSet) + && Objects.equals(materializationSetId, that.materializationSetId) + && Objects.equals(requestId, that.requestId) + && Objects.equals(updateMask, that.updateMask); + } + + @Override + public int hashCode() { + return Objects.hash(materializationSet, materializationSetId, requestId, updateMask); + } + + @Override + public String toString() { + return new ToStringer(UpdateMaterializationSetRequest.class) + .add("materializationSet", materializationSet) + .add("materializationSetId", materializationSetId) + .add("requestId", requestId) + .add("updateMask", updateMask) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/pipelines/StartUpdate.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/pipelines/StartUpdate.java index 63ef82f38..ee5c31f9d 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/pipelines/StartUpdate.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/pipelines/StartUpdate.java @@ -36,6 +36,10 @@ public class StartUpdate { @JsonProperty("full_refresh_selection") private Collection fullRefreshSelection; + /** A list of file paths that identify the tables to update with a full refresh. */ + @JsonProperty("full_refresh_selection_by_path") + private Collection fullRefreshSelectionByPath; + /** Key/value map of parameters to pass to the pipeline execution */ @JsonProperty("parameters") private Map parameters; @@ -51,6 +55,10 @@ public class StartUpdate { @JsonProperty("refresh_selection") private Collection refreshSelection; + /** A list of file paths that identify the tables to update. */ + @JsonProperty("refresh_selection_by_path") + private Collection refreshSelectionByPath; + /** * A list of predicate overrides for replace_where flows in this update. Only replace_where flows * may be specified. Flows not listed use their original predicate. @@ -116,6 +124,15 @@ public Collection getFullRefreshSelection() { return fullRefreshSelection; } + public StartUpdate setFullRefreshSelectionByPath(Collection fullRefreshSelectionByPath) { + this.fullRefreshSelectionByPath = fullRefreshSelectionByPath; + return this; + } + + public Collection getFullRefreshSelectionByPath() { + return fullRefreshSelectionByPath; + } + public StartUpdate setParameters(Map parameters) { this.parameters = parameters; return this; @@ -143,6 +160,15 @@ public Collection getRefreshSelection() { return refreshSelection; } + public StartUpdate setRefreshSelectionByPath(Collection refreshSelectionByPath) { + this.refreshSelectionByPath = refreshSelectionByPath; + return this; + } + + public Collection getRefreshSelectionByPath() { + return refreshSelectionByPath; + } + public StartUpdate setReplaceWhereOverrides( Collection replaceWhereOverrides) { this.replaceWhereOverrides = replaceWhereOverrides; @@ -189,9 +215,11 @@ public boolean equals(Object o) { && Objects.equals(development, that.development) && Objects.equals(fullRefresh, that.fullRefresh) && Objects.equals(fullRefreshSelection, that.fullRefreshSelection) + && Objects.equals(fullRefreshSelectionByPath, that.fullRefreshSelectionByPath) && Objects.equals(parameters, that.parameters) && Objects.equals(pipelineId, that.pipelineId) && Objects.equals(refreshSelection, that.refreshSelection) + && Objects.equals(refreshSelectionByPath, that.refreshSelectionByPath) && Objects.equals(replaceWhereOverrides, that.replaceWhereOverrides) && Objects.equals(resetCheckpointSelection, that.resetCheckpointSelection) && Objects.equals(rewindSpec, that.rewindSpec) @@ -205,9 +233,11 @@ public int hashCode() { development, fullRefresh, fullRefreshSelection, + fullRefreshSelectionByPath, parameters, pipelineId, refreshSelection, + refreshSelectionByPath, replaceWhereOverrides, resetCheckpointSelection, rewindSpec, @@ -221,9 +251,11 @@ public String toString() { .add("development", development) .add("fullRefresh", fullRefresh) .add("fullRefreshSelection", fullRefreshSelection) + .add("fullRefreshSelectionByPath", fullRefreshSelectionByPath) .add("parameters", parameters) .add("pipelineId", pipelineId) .add("refreshSelection", refreshSelection) + .add("refreshSelectionByPath", refreshSelectionByPath) .add("replaceWhereOverrides", replaceWhereOverrides) .add("resetCheckpointSelection", resetCheckpointSelection) .add("rewindSpec", rewindSpec) diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/pipelines/UpdateInfo.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/pipelines/UpdateInfo.java index 9f67fdcf1..114442e2a 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/pipelines/UpdateInfo.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/pipelines/UpdateInfo.java @@ -42,6 +42,10 @@ public class UpdateInfo { @JsonProperty("full_refresh_selection") private Collection fullRefreshSelection; + /** A list of file paths that identify the tables to update with a full refresh. */ + @JsonProperty("full_refresh_selection_by_path") + private Collection fullRefreshSelectionByPath; + /** * Indicates whether the update is either part of a continuous job run, or running in legacy * continuous pipeline mode. Returned only for GetUpdate; not populated in ListUpdates responses. @@ -65,6 +69,10 @@ public class UpdateInfo { @JsonProperty("refresh_selection") private Collection refreshSelection; + /** A list of file paths that identify the tables to update. */ + @JsonProperty("refresh_selection_by_path") + private Collection refreshSelectionByPath; + /** The update state. */ @JsonProperty("state") private UpdateInfoState state; @@ -134,6 +142,15 @@ public Collection getFullRefreshSelection() { return fullRefreshSelection; } + public UpdateInfo setFullRefreshSelectionByPath(Collection fullRefreshSelectionByPath) { + this.fullRefreshSelectionByPath = fullRefreshSelectionByPath; + return this; + } + + public Collection getFullRefreshSelectionByPath() { + return fullRefreshSelectionByPath; + } + public UpdateInfo setMode(UpdateMode mode) { this.mode = mode; return this; @@ -170,6 +187,15 @@ public Collection getRefreshSelection() { return refreshSelection; } + public UpdateInfo setRefreshSelectionByPath(Collection refreshSelectionByPath) { + this.refreshSelectionByPath = refreshSelectionByPath; + return this; + } + + public Collection getRefreshSelectionByPath() { + return refreshSelectionByPath; + } + public UpdateInfo setState(UpdateInfoState state) { this.state = state; return this; @@ -208,10 +234,12 @@ public boolean equals(Object o) { && Objects.equals(creationTime, that.creationTime) && Objects.equals(fullRefresh, that.fullRefresh) && Objects.equals(fullRefreshSelection, that.fullRefreshSelection) + && Objects.equals(fullRefreshSelectionByPath, that.fullRefreshSelectionByPath) && Objects.equals(mode, that.mode) && Objects.equals(parameters, that.parameters) && Objects.equals(pipelineId, that.pipelineId) && Objects.equals(refreshSelection, that.refreshSelection) + && Objects.equals(refreshSelectionByPath, that.refreshSelectionByPath) && Objects.equals(state, that.state) && Objects.equals(updateId, that.updateId) && Objects.equals(validateOnly, that.validateOnly); @@ -226,10 +254,12 @@ public int hashCode() { creationTime, fullRefresh, fullRefreshSelection, + fullRefreshSelectionByPath, mode, parameters, pipelineId, refreshSelection, + refreshSelectionByPath, state, updateId, validateOnly); @@ -244,10 +274,12 @@ public String toString() { .add("creationTime", creationTime) .add("fullRefresh", fullRefresh) .add("fullRefreshSelection", fullRefreshSelection) + .add("fullRefreshSelectionByPath", fullRefreshSelectionByPath) .add("mode", mode) .add("parameters", parameters) .add("pipelineId", pipelineId) .add("refreshSelection", refreshSelection) + .add("refreshSelectionByPath", refreshSelectionByPath) .add("state", state) .add("updateId", updateId) .add("validateOnly", validateOnly) diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sandbox/Sandbox.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sandbox/Sandbox.java index 1df20fab0..b02dfce34 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sandbox/Sandbox.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sandbox/Sandbox.java @@ -19,6 +19,10 @@ public class Sandbox { @JsonProperty("display_name") private String displayName; + /** Metadata associated with the sandbox. */ + @JsonProperty("metadata") + private SandboxMetadata metadata; + /** * The sandbox resource name, in the form `sandboxes/{sandbox_id}`. Derived from `sandbox_id`; any * value supplied in a create or update request body is ignored. @@ -56,6 +60,15 @@ public String getDisplayName() { return displayName; } + public Sandbox setMetadata(SandboxMetadata metadata) { + this.metadata = metadata; + return this; + } + + public SandboxMetadata getMetadata() { + return metadata; + } + public Sandbox setName(String name) { this.name = name; return this; @@ -99,6 +112,7 @@ public boolean equals(Object o) { Sandbox that = (Sandbox) o; return Objects.equals(createTime, that.createTime) && Objects.equals(displayName, that.displayName) + && Objects.equals(metadata, that.metadata) && Objects.equals(name, that.name) && Objects.equals(spec, that.spec) && Objects.equals(status, that.status) @@ -107,7 +121,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(createTime, displayName, name, spec, status, updateTime); + return Objects.hash(createTime, displayName, metadata, name, spec, status, updateTime); } @Override @@ -115,6 +129,7 @@ public String toString() { return new ToStringer(Sandbox.class) .add("createTime", createTime) .add("displayName", displayName) + .add("metadata", metadata) .add("name", name) .add("spec", spec) .add("status", status) diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sandbox/SandboxMetadata.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sandbox/SandboxMetadata.java new file mode 100644 index 000000000..866566507 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sandbox/SandboxMetadata.java @@ -0,0 +1,47 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.sandbox; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.Objects; + +/** Metadata associated with a sandbox. */ +@Generated +public class SandboxMetadata { + /** + * Key-value tags associated with the sandbox. Supports up to 54 tags. Keys must be between 1 and + * 512 characters, and values must not exceed 256 characters. + */ + @JsonProperty("custom_tags") + private Map customTags; + + public SandboxMetadata setCustomTags(Map customTags) { + this.customTags = customTags; + return this; + } + + public Map getCustomTags() { + return customTags; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SandboxMetadata that = (SandboxMetadata) o; + return Objects.equals(customTags, that.customTags); + } + + @Override + public int hashCode() { + return Objects.hash(customTags); + } + + @Override + public String toString() { + return new ToStringer(SandboxMetadata.class).add("customTags", customTags).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/SharedDataObject.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/SharedDataObject.java index 071f11697..4d1d1452b 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/SharedDataObject.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/SharedDataObject.java @@ -104,7 +104,8 @@ public class SharedDataObject { * A user-provided alias name for non-table data objects within the share. * *

Use this field for non-table objects (for example: VOLUME, MODEL, NOTEBOOK_FILE, FUNCTION). - * For table-like objects (for example: TABLE, VIEW, MATERIALIZED_VIEW, STREAMING_TABLE, + * + *

For table-like objects (for example: TABLE, VIEW, MATERIALIZED_VIEW, STREAMING_TABLE, * FOREIGN_TABLE), use `shared_as` instead. * *

Important: For table-like objects, this field must be omitted entirely. @@ -113,9 +114,10 @@ public class SharedDataObject { * "data_schema.ml_models") - For FUNCTION: Must be a 2-part name `.` * (e.g., "udf_schema.calculate_tax") - For MODEL: Must be a 2-part name * `.` (e.g., "models.prediction_model") - For NOTEBOOK_FILE: Should be - * the notebook file name (e.g., "analysis_notebook.py") - All names must contain only - * alphanumeric characters and underscores - No periods, spaces, forward slashes, or control - * characters are allowed within each part + * the notebook file name (e.g., "analysis_notebook.py") + * + *

- All names must contain only alphanumeric characters and underscores - No periods, spaces, + * forward slashes, or control characters are allowed within each part * *

Behavior: - If not provided, the service automatically generates the alias from the object's * original name - If you don't want to specify this field, omit it entirely from the request (do @@ -123,8 +125,10 @@ public class SharedDataObject { * type within the share * *

Examples: - Valid for VOLUME: "data_schema.training_data" - Valid for FUNCTION: - * "analytics.calculate_revenue" - Invalid: "catalog.data_schema.training_data" (3 parts not - * allowed for volumes) - Invalid: "data-schema.training-data" (hyphens not allowed) + * "analytics.calculate_revenue" + * + *

- Invalid: "catalog.data_schema.training_data" (3 parts not allowed for volumes) - Invalid: + * "data-schema.training-data" (hyphens not allowed) */ @JsonProperty("string_shared_as") private String stringSharedAs; diff --git a/databricks-sdk-java/src/test/java/com/databricks/sdk/core/GoogleAuthCompatibilityTest.java b/databricks-sdk-java/src/test/java/com/databricks/sdk/core/GoogleAuthCompatibilityTest.java new file mode 100644 index 000000000..740d93c3b --- /dev/null +++ b/databricks-sdk-java/src/test/java/com/databricks/sdk/core/GoogleAuthCompatibilityTest.java @@ -0,0 +1,248 @@ +package com.databricks.sdk.core; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.auth.oauth2.AccessToken; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.auth.oauth2.ServiceAccountCredentials; +import com.google.auth.oauth2.UserCredentials; +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpServer; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.InetSocketAddress; +import java.net.URI; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.Signature; +import java.util.Base64; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class GoogleAuthCompatibilityTest { + private HttpServer tokenServer; + private URI tokenServerUri; + private final AtomicReference requestBody = new AtomicReference<>(); + private volatile int responseCode = 200; + private volatile String responseBody = + "{\"access_token\":\"refreshed-token\",\"expires_in\":3600,\"token_type\":\"Bearer\"," + + "\"issued_token_type\":\"urn:ietf:params:oauth:token-type:access_token\"}"; + + @BeforeEach + void startTokenServer() throws IOException { + tokenServer = HttpServer.create(new InetSocketAddress("127.0.0.1", 0), 0); + tokenServer.createContext("/token", this::respondToTokenRequest); + tokenServer.createContext( + "/subject", + exchange -> { + byte[] subjectToken = "external-subject-token".getBytes(StandardCharsets.UTF_8); + exchange.sendResponseHeaders(200, subjectToken.length); + try { + exchange.getResponseBody().write(subjectToken); + } finally { + exchange.close(); + } + }); + tokenServer.start(); + tokenServerUri = + URI.create("http://127.0.0.1:" + tokenServer.getAddress().getPort() + "/token"); + } + + @AfterEach + void stopTokenServer() { + if (tokenServer != null) { + tokenServer.stop(0); + } + } + + @Test + void addsBearerTokenToRequestMetadata() throws IOException { + GoogleCredentials credentials = + GoogleCredentials.create( + new AccessToken("test-token", new Date(System.currentTimeMillis() + 3600000))); + + assertEquals( + Collections.singletonList("Bearer test-token"), + credentials + .getRequestMetadata(URI.create("https://storage.googleapis.com/")) + .get("Authorization")); + } + + @Test + void parsesUserCredentialsWithPinnedHttpDependencies() throws IOException { + String credentialJson = + "{\"type\":\"authorized_user\",\"client_id\":\"test-client\"," + + "\"client_secret\":\"test-secret\",\"refresh_token\":\"test-refresh\"}"; + + try (ByteArrayInputStream input = + new ByteArrayInputStream(credentialJson.getBytes(StandardCharsets.UTF_8))) { + UserCredentials credentials = UserCredentials.fromStream(input); + + assertEquals("test-client", credentials.getClientId()); + assertEquals("test-secret", credentials.getClientSecret()); + assertEquals("test-refresh", credentials.getRefreshToken()); + } + } + + @Test + void refreshesUserCredentialsWithPinnedHttpDependencies() throws IOException { + UserCredentials credentials = + UserCredentials.newBuilder() + .setClientId("test-client") + .setClientSecret("test-secret") + .setRefreshToken("test-refresh") + .setTokenServerUri(tokenServerUri) + .build(); + + credentials.refresh(); + + assertRefreshedToken(credentials); + Map form = requestForm(); + assertEquals("refresh_token", form.get("grant_type")); + assertEquals("test-client", form.get("client_id")); + assertEquals("test-secret", form.get("client_secret")); + assertEquals("test-refresh", form.get("refresh_token")); + } + + @Test + void refreshesServiceAccountWithPinnedHttpDependencies() throws Exception { + KeyPairGenerator keyGenerator = KeyPairGenerator.getInstance("RSA"); + keyGenerator.initialize(2048); + KeyPair keyPair = keyGenerator.generateKeyPair(); + ServiceAccountCredentials credentials = + ServiceAccountCredentials.newBuilder() + .setClientEmail("test-account@example.com") + .setPrivateKey(keyPair.getPrivate()) + .setPrivateKeyId("test-key") + .setScopes(Collections.singletonList("https://www.googleapis.com/auth/cloud-platform")) + .setTokenServerUri(tokenServerUri) + .build(); + + credentials.refresh(); + + assertRefreshedToken(credentials); + Map form = requestForm(); + assertEquals("urn:ietf:params:oauth:grant-type:jwt-bearer", form.get("grant_type")); + String[] assertion = form.get("assertion").split("\\."); + JsonNode claims = new ObjectMapper().readTree(Base64.getUrlDecoder().decode(assertion[1])); + assertEquals("test-account@example.com", claims.get("iss").asText()); + assertEquals("https://oauth2.googleapis.com/token", claims.get("aud").asText()); + assertEquals("https://www.googleapis.com/auth/cloud-platform", claims.get("scope").asText()); + Signature verifier = Signature.getInstance("SHA256withRSA"); + verifier.initVerify(keyPair.getPublic()); + verifier.update((assertion[0] + "." + assertion[1]).getBytes(StandardCharsets.UTF_8)); + assertTrue(verifier.verify(Base64.getUrlDecoder().decode(assertion[2]))); + } + + @Test + void exchangesExternalAccountTokenWithPinnedHttpDependencies() throws IOException { + String audience = + "//iam.googleapis.com/projects/123/locations/global/workloadIdentityPools/test/providers/test"; + String credentialJson = + "{\"type\":\"external_account\",\"audience\":\"" + + audience + + "\",\"subject_token_type\":\"urn:ietf:params:oauth:token-type:jwt\",\"token_url\":\"" + + "https://sts.googleapis.com/v1/token" + + "\",\"credential_source\":{\"url\":\"" + + tokenServerUri.resolve("/subject") + + "\"}}"; + GoogleCredentials credentials; + try (ByteArrayInputStream input = + new ByteArrayInputStream(credentialJson.getBytes(StandardCharsets.UTF_8))) { + NetHttpTransport transport = + new NetHttpTransport.Builder() + .setConnectionFactory( + url -> { + URI localUri = + url.getHost().equals("sts.googleapis.com") + ? tokenServerUri + : tokenServerUri.resolve("/subject"); + return (HttpURLConnection) localUri.toURL().openConnection(); + }) + .build(); + credentials = + GoogleCredentials.fromStream(input, () -> transport) + .createScoped( + Collections.singletonList("https://www.googleapis.com/auth/cloud-platform")); + } + + credentials.refresh(); + + assertRefreshedToken(credentials); + Map form = requestForm(); + assertEquals("urn:ietf:params:oauth:grant-type:token-exchange", form.get("grant_type")); + assertEquals("external-subject-token", form.get("subject_token")); + assertEquals(audience, form.get("audience")); + assertEquals("urn:ietf:params:oauth:token-type:jwt", form.get("subject_token_type")); + } + + @Test + void propagatesTokenEndpointErrorsWithPinnedHttpDependencies() { + responseCode = 400; + responseBody = "{\"error\":\"invalid_grant\",\"error_description\":\"Refresh token revoked\"}"; + UserCredentials credentials = + UserCredentials.newBuilder() + .setClientId("test-client") + .setClientSecret("test-secret") + .setRefreshToken("revoked-refresh") + .setTokenServerUri(tokenServerUri) + .build(); + + IOException failure = assertThrows(IOException.class, credentials::refresh); + + assertTrue(failure.getMessage().contains("invalid_grant")); + } + + private void assertRefreshedToken(GoogleCredentials credentials) throws IOException { + assertEquals("refreshed-token", credentials.getAccessToken().getTokenValue()); + assertTrue(credentials.getAccessToken().getExpirationTime().after(new Date())); + assertEquals( + Collections.singletonList("Bearer refreshed-token"), + credentials + .getRequestMetadata(URI.create("https://storage.googleapis.com/")) + .get("Authorization")); + } + + private Map requestForm() throws IOException { + Map form = new HashMap<>(); + for (String field : requestBody.get().split("&")) { + String[] pair = field.split("=", 2); + form.put(URLDecoder.decode(pair[0], "UTF-8"), URLDecoder.decode(pair[1], "UTF-8")); + } + return form; + } + + private void respondToTokenRequest(HttpExchange exchange) throws IOException { + try (InputStream input = exchange.getRequestBody(); + ByteArrayOutputStream body = new ByteArrayOutputStream()) { + byte[] buffer = new byte[1024]; + int length; + while ((length = input.read(buffer)) != -1) { + body.write(buffer, 0, length); + } + requestBody.set(new String(body.toByteArray(), StandardCharsets.UTF_8)); + byte[] content = responseBody.getBytes(StandardCharsets.UTF_8); + exchange.getResponseHeaders().set("Content-Type", "application/json"); + exchange.sendResponseHeaders(responseCode, content.length); + exchange.getResponseBody().write(content); + } finally { + exchange.close(); + } + } +} diff --git a/examples/docs/pom.xml b/examples/docs/pom.xml index 780c9e084..fed6fdb4f 100644 --- a/examples/docs/pom.xml +++ b/examples/docs/pom.xml @@ -24,7 +24,7 @@ com.databricks databricks-sdk-java - 0.170.0 + 0.171.0 diff --git a/examples/spring-boot-oauth-u2m-demo/pom.xml b/examples/spring-boot-oauth-u2m-demo/pom.xml index 082d91eea..e05f0662d 100644 --- a/examples/spring-boot-oauth-u2m-demo/pom.xml +++ b/examples/spring-boot-oauth-u2m-demo/pom.xml @@ -40,7 +40,7 @@ com.databricks databricks-sdk-java - 0.170.0 + 0.171.0 diff --git a/lockfile.json b/lockfile.json index 032d01367..3fa5db068 100644 --- a/lockfile.json +++ b/lockfile.json @@ -1,15 +1,15 @@ { "artifactId": "databricks-sdk-parent", "groupId": "com.databricks", - "version": "0.170.0", + "version": "0.171.0", "lockFileVersion": 1, "dependencies": [], "mavenPlugins": [], "metaData": { "environment": { - "osName": "Mac OS X", - "mavenVersion": "3.9.14", - "javaVersion": "11.0.12" + "osName": "Linux", + "mavenVersion": "3.9.9", + "javaVersion": "17.0.3" }, "config": { "includeMavenPlugins": false, diff --git a/pom.xml b/pom.xml index a778682c4..b46b8ed23 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.databricks databricks-sdk-parent - 0.170.0 + 0.171.0 pom Databricks SDK for Java The Databricks SDK for Java includes functionality to accelerate development with Java for @@ -65,7 +65,7 @@ com.google.auto.value auto-value - 1.10.4 + 1.11.1 diff --git a/shaded/pom.xml b/shaded/pom.xml index 7b05b9806..15c21067f 100644 --- a/shaded/pom.xml +++ b/shaded/pom.xml @@ -4,7 +4,7 @@ 4.0.0 - 0.170.0 + 0.171.0 com.databricks