diff --git a/package-lock.json b/package-lock.json index cb326d7a..024d59db 100755 --- a/package-lock.json +++ b/package-lock.json @@ -5513,12 +5513,12 @@ }, "packages/accessmanagement": { "name": "@databricks/sdk-accessmanagement", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5529,12 +5529,12 @@ }, "packages/alerts": { "name": "@databricks/sdk-alerts", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5545,12 +5545,12 @@ }, "packages/apps": { "name": "@databricks/sdk-apps", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5578,10 +5578,10 @@ }, "packages/auth": { "name": "@databricks/sdk-auth", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-core": ">=0.10.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", "zod": "^4.3.6" }, "engines": { @@ -5590,12 +5590,12 @@ }, "packages/authentication": { "name": "@databricks/sdk-authentication", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5623,12 +5623,12 @@ }, "packages/budgetpolicy": { "name": "@databricks/sdk-budgetpolicy", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5639,12 +5639,12 @@ }, "packages/budgets": { "name": "@databricks/sdk-budgets", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5706,12 +5706,12 @@ }, "packages/cleanrooms": { "name": "@databricks/sdk-cleanrooms", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5722,12 +5722,12 @@ }, "packages/clusterlibraries": { "name": "@databricks/sdk-clusterlibraries", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5738,12 +5738,12 @@ }, "packages/clusterpolicies": { "name": "@databricks/sdk-clusterpolicies", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5754,12 +5754,12 @@ }, "packages/clusters": { "name": "@databricks/sdk-clusters", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5770,12 +5770,12 @@ }, "packages/commandexecution": { "name": "@databricks/sdk-commandexecution", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5803,7 +5803,7 @@ }, "packages/core": { "name": "@databricks/sdk-core", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { "json-bigint": "^1.0.0", @@ -5832,12 +5832,12 @@ }, "packages/customllms": { "name": "@databricks/sdk-customllms", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5848,12 +5848,12 @@ }, "packages/database": { "name": "@databricks/sdk-database", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5864,12 +5864,12 @@ }, "packages/dataclassification": { "name": "@databricks/sdk-dataclassification", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5880,12 +5880,12 @@ }, "packages/dataquality": { "name": "@databricks/sdk-dataquality", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5896,12 +5896,12 @@ }, "packages/disasterrecovery": { "name": "@databricks/sdk-disasterrecovery", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5929,12 +5929,12 @@ }, "packages/environments": { "name": "@databricks/sdk-environments", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -5963,12 +5963,12 @@ }, "packages/experiments": { "name": "@databricks/sdk-experiments", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6030,12 +6030,12 @@ }, "packages/features": { "name": "@databricks/sdk-features", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6046,12 +6046,12 @@ }, "packages/featurestore": { "name": "@databricks/sdk-featurestore", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6062,12 +6062,12 @@ }, "packages/files": { "name": "@databricks/sdk-files", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6078,12 +6078,12 @@ }, "packages/forecasting": { "name": "@databricks/sdk-forecasting", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6111,12 +6111,12 @@ }, "packages/genie": { "name": "@databricks/sdk-genie", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6127,12 +6127,12 @@ }, "packages/gitcredentials": { "name": "@databricks/sdk-gitcredentials", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6143,12 +6143,12 @@ }, "packages/globalinitscripts": { "name": "@databricks/sdk-globalinitscripts", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6176,12 +6176,12 @@ }, "packages/instancepools": { "name": "@databricks/sdk-instancepools", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6192,12 +6192,12 @@ }, "packages/instanceprofiles": { "name": "@databricks/sdk-instanceprofiles", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6208,12 +6208,12 @@ }, "packages/jobs": { "name": "@databricks/sdk-jobs", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6224,12 +6224,12 @@ }, "packages/keyconfigurations": { "name": "@databricks/sdk-keyconfigurations", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6240,12 +6240,12 @@ }, "packages/knowledgeassistants": { "name": "@databricks/sdk-knowledgeassistants", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6256,12 +6256,12 @@ }, "packages/lakeview": { "name": "@databricks/sdk-lakeview", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6272,12 +6272,12 @@ }, "packages/logdelivery": { "name": "@databricks/sdk-logdelivery", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6288,12 +6288,12 @@ }, "packages/marketplaces": { "name": "@databricks/sdk-marketplaces", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6321,12 +6321,12 @@ }, "packages/modelregistry": { "name": "@databricks/sdk-modelregistry", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6337,12 +6337,12 @@ }, "packages/modelserving": { "name": "@databricks/sdk-modelserving", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6353,12 +6353,12 @@ }, "packages/modelservingquery": { "name": "@databricks/sdk-modelservingquery", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6369,12 +6369,12 @@ }, "packages/networking": { "name": "@databricks/sdk-networking", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6385,12 +6385,12 @@ }, "packages/notificationdestinations": { "name": "@databricks/sdk-notificationdestinations", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6401,12 +6401,12 @@ }, "packages/oauth": { "name": "@databricks/sdk-oauth", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6434,11 +6434,11 @@ }, "packages/options": { "name": "@databricks/sdk-options", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0" + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0" }, "engines": { "node": ">=22.0.0" @@ -6446,12 +6446,12 @@ }, "packages/pipelines": { "name": "@databricks/sdk-pipelines", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6462,12 +6462,12 @@ }, "packages/policyfamilies": { "name": "@databricks/sdk-policyfamilies", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6478,12 +6478,12 @@ }, "packages/postgres": { "name": "@databricks/sdk-postgres", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6494,12 +6494,12 @@ }, "packages/queries": { "name": "@databricks/sdk-queries", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6510,12 +6510,12 @@ }, "packages/queryhistory": { "name": "@databricks/sdk-queryhistory", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6543,12 +6543,12 @@ }, "packages/repos": { "name": "@databricks/sdk-repos", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6610,12 +6610,12 @@ }, "packages/scim": { "name": "@databricks/sdk-scim", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6643,12 +6643,12 @@ }, "packages/secrets": { "name": "@databricks/sdk-secrets", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6676,12 +6676,12 @@ }, "packages/settings": { "name": "@databricks/sdk-settings", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6692,12 +6692,12 @@ }, "packages/sharing": { "name": "@databricks/sdk-sharing", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6708,12 +6708,12 @@ }, "packages/statementexecution": { "name": "@databricks/sdk-statementexecution", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6724,12 +6724,12 @@ }, "packages/storageconfigurations": { "name": "@databricks/sdk-storageconfigurations", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6740,12 +6740,12 @@ }, "packages/supervisoragents": { "name": "@databricks/sdk-supervisoragents", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6790,12 +6790,12 @@ }, "packages/tagassignments": { "name": "@databricks/sdk-tagassignments", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6806,12 +6806,12 @@ }, "packages/tagpolicies": { "name": "@databricks/sdk-tagpolicies", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6822,12 +6822,12 @@ }, "packages/tokenmanagement": { "name": "@databricks/sdk-tokenmanagement", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6838,12 +6838,12 @@ }, "packages/tokens": { "name": "@databricks/sdk-tokens", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6854,12 +6854,12 @@ }, "packages/uc/abacpolicies": { "name": "@databricks/sdk-uc-abacpolicies", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6870,12 +6870,12 @@ }, "packages/uc/artifactallowlists": { "name": "@databricks/sdk-uc-artifactallowlists", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6886,12 +6886,12 @@ }, "packages/uc/catalogs": { "name": "@databricks/sdk-uc-catalogs", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6902,12 +6902,12 @@ }, "packages/uc/connections": { "name": "@databricks/sdk-uc-connections", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6918,12 +6918,12 @@ }, "packages/uc/credentials": { "name": "@databricks/sdk-uc-credentials", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6934,12 +6934,12 @@ }, "packages/uc/entitytagassignments": { "name": "@databricks/sdk-uc-entitytagassignments", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6950,12 +6950,12 @@ }, "packages/uc/externallineage": { "name": "@databricks/sdk-uc-externallineage", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6966,12 +6966,12 @@ }, "packages/uc/externallocations": { "name": "@databricks/sdk-uc-externallocations", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6982,12 +6982,12 @@ }, "packages/uc/externalmetadata": { "name": "@databricks/sdk-uc-externalmetadata", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -6998,12 +6998,12 @@ }, "packages/uc/functions": { "name": "@databricks/sdk-uc-functions", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -7014,12 +7014,12 @@ }, "packages/uc/grants": { "name": "@databricks/sdk-uc-grants", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -7030,12 +7030,12 @@ }, "packages/uc/metastores": { "name": "@databricks/sdk-uc-metastores", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -7046,12 +7046,12 @@ }, "packages/uc/onlinetables": { "name": "@databricks/sdk-uc-onlinetables", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -7079,12 +7079,12 @@ }, "packages/uc/registeredmodels": { "name": "@databricks/sdk-uc-registeredmodels", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -7095,12 +7095,12 @@ }, "packages/uc/resourcequotas": { "name": "@databricks/sdk-uc-resourcequotas", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -7111,12 +7111,12 @@ }, "packages/uc/rfa": { "name": "@databricks/sdk-uc-rfa", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -7127,12 +7127,12 @@ }, "packages/uc/schemas": { "name": "@databricks/sdk-uc-schemas", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -7143,12 +7143,12 @@ }, "packages/uc/secrets": { "name": "@databricks/sdk-uc-secrets", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -7159,12 +7159,12 @@ }, "packages/uc/systemschemas": { "name": "@databricks/sdk-uc-systemschemas", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -7175,12 +7175,12 @@ }, "packages/uc/tables": { "name": "@databricks/sdk-uc-tables", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -7191,12 +7191,12 @@ }, "packages/uc/volumes": { "name": "@databricks/sdk-uc-volumes", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -7207,12 +7207,12 @@ }, "packages/uc/workspacebindings": { "name": "@databricks/sdk-uc-workspacebindings", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -7223,12 +7223,12 @@ }, "packages/usagedashboards": { "name": "@databricks/sdk-usagedashboards", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -7256,12 +7256,12 @@ }, "packages/vectorsearch": { "name": "@databricks/sdk-vectorsearch", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -7289,12 +7289,12 @@ }, "packages/warehouses": { "name": "@databricks/sdk-warehouses", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" @@ -7339,12 +7339,12 @@ }, "packages/workspaces": { "name": "@databricks/sdk-workspaces", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { - "@databricks/sdk-auth": ">=0.10.0 <1.0.0", - "@databricks/sdk-core": ">=0.10.0 <1.0.0", - "@databricks/sdk-options": ">=0.10.0 <1.0.0", + "@databricks/sdk-auth": ">=0.11.0 <1.0.0", + "@databricks/sdk-core": ">=0.11.0 <1.0.0", + "@databricks/sdk-options": ">=0.11.0 <1.0.0", "@js-temporal/polyfill": "^0.5.0", "json-bigint": "^1.0.0", "zod": "^4.3.6" diff --git a/packages/accessmanagement/src/v1/index.ts b/packages/accessmanagement/src/v1/index.ts index 357c4a0c..ceff1aa5 100755 --- a/packages/accessmanagement/src/v1/index.ts +++ b/packages/accessmanagement/src/v1/index.ts @@ -19,6 +19,11 @@ export type { CheckPolicyRequest, CheckPolicyResponse, ConsistencyToken, + CreateAccessControlRequest, + CreateCreateGrantRule, + CreateCreateRuleSetUpdateRequest, + CreateGrantRule, + CreateRuleSetUpdateRequest, DeleteWorkspacePermissionAssignmentRequest, DeleteWorkspacePermissionAssignmentResponse, GetObjectPermissionsRequest, diff --git a/packages/accessmanagement/src/v1/model.ts b/packages/accessmanagement/src/v1/model.ts index 7357d490..bc73be1e 100755 --- a/packages/accessmanagement/src/v1/model.ts +++ b/packages/accessmanagement/src/v1/model.ts @@ -131,6 +131,87 @@ export interface ConsistencyToken { value?: string | undefined; } +export interface CreateAccessControlRequest { + principalName?: + | { + $case: 'userName'; + /** name of the user */ + userName: string; + } + | { + $case: 'groupName'; + /** name of the group */ + groupName: string; + } + | { + $case: 'servicePrincipalName'; + /** application ID of a service principal */ + servicePrincipalName: string; + } + | undefined; + permissionLevel?: PermissionLevel | undefined; +} + +export interface CreateCreateGrantRule { + /** + * Principals this grant rule applies to. + * A principal can be a user (for end users), a service principal (for applications and + * compute workloads), or an account group. Each principal has its own identifier format: + * * users/ + * * groups/ + * * servicePrincipals/ + */ + principals?: string[] | undefined; + /** Role that is assigned to the list of principals. */ + role: string; +} + +export interface CreateCreateRuleSetUpdateRequest { + /** Name of the rule set. */ + name: string; + /** + * Identifies the version of the rule set returned. + * Etag used for versioning. The response is at least as fresh as the eTag provided. + * Etag is used for optimistic concurrency control as a way to help prevent simultaneous + * updates of a rule set from overwriting each other. It is strongly suggested that systems + * make use of the etag in the read -> modify -> write pattern to perform rule set updates in + * order to avoid race conditions that is get an etag from a GET rule set request, and pass it + * with the PUT update request to identify the rule set version you are updating. + */ + etag: string; + grantRules?: CreateCreateGrantRule[] | undefined; +} + +export interface CreateGrantRule { + /** + * Principals this grant rule applies to. + * A principal can be a user (for end users), a service principal (for applications and + * compute workloads), or an account group. Each principal has its own identifier format: + * * users/ + * * groups/ + * * servicePrincipals/ + */ + principals?: string[] | undefined; + /** Role that is assigned to the list of principals. */ + role: string; +} + +export interface CreateRuleSetUpdateRequest { + /** Name of the rule set. */ + name: string; + /** + * Identifies the version of the rule set returned. + * Etag used for versioning. The response is at least as fresh as the eTag provided. + * Etag is used for optimistic concurrency control as a way to help prevent simultaneous + * updates of a rule set from overwriting each other. It is strongly suggested that systems + * make use of the etag in the read -> modify -> write pattern to perform rule set updates in + * order to avoid race conditions that is get an etag from a GET rule set request, and pass it + * with the PUT update request to identify the rule set version you are updating. + */ + etag: string; + grantRules?: CreateGrantRule[] | undefined; +} + /** Removes all permission assignments for a workspace given a principal. */ export interface DeleteWorkspacePermissionAssignmentRequest { /** The account ID. */ @@ -350,7 +431,7 @@ export interface SetObjectPermissionsRequest { requestObjectType?: string | undefined; /** The id of the request object. */ requestObjectId?: string | undefined; - accessControlList?: AccessControlRequest[] | undefined; + accessControlList?: CreateAccessControlRequest[] | undefined; } export interface UpdateObjectPermissionsRequest { @@ -358,7 +439,7 @@ export interface UpdateObjectPermissionsRequest { requestObjectType?: string | undefined; /** The id of the request object. */ requestObjectId?: string | undefined; - accessControlList?: AccessControlRequest[] | undefined; + accessControlList?: CreateAccessControlRequest[] | undefined; } export interface UpdateRuleSetRequest { @@ -366,7 +447,7 @@ export interface UpdateRuleSetRequest { accountId?: string | undefined; /** Name of the rule set. */ name?: string | undefined; - ruleSet?: RuleSetUpdateRequest | undefined; + ruleSet?: CreateCreateRuleSetUpdateRequest | undefined; } export interface UpdateWorkspacePermissionAssignmentRequest { @@ -610,7 +691,27 @@ export const unmarshalWorkspacePermissionAssignmentOutputSchema: z.ZodType ({ + ...(d.kind?.$case === 'actorId' && {actor_id: d.kind.actorId}), + })); + +export const marshalConsistencyTokenSchema: z.ZodType = z + .object({ + value: z.string().optional(), + }) + .transform(d => ({ + value: d.value, + })); + +export const marshalCreateAccessControlRequestSchema: z.ZodType = z .object({ principalName: z .discriminatedUnion('$case', [ @@ -637,34 +738,28 @@ export const marshalAccessControlRequestSchema: z.ZodType = z permission_level: d.permissionLevel, })); -export const marshalActorSchema: z.ZodType = z - .object({ - kind: z - .discriminatedUnion('$case', [ - z.object({$case: z.literal('actorId'), actorId: z.bigint()}), - ]) - .optional(), - }) - .transform(d => ({ - ...(d.kind?.$case === 'actorId' && {actor_id: d.kind.actorId}), - })); - -export const marshalConsistencyTokenSchema: z.ZodType = z +export const marshalCreateCreateGrantRuleSchema: z.ZodType = z .object({ - value: z.string().optional(), + principals: z.array(z.string()).optional(), + role: z.string(), }) .transform(d => ({ - value: d.value, + principals: d.principals, + role: d.role, })); -export const marshalGrantRuleSchema: z.ZodType = z +export const marshalCreateCreateRuleSetUpdateRequestSchema: z.ZodType = z .object({ - principals: z.array(z.string()).optional(), - role: z.string().optional(), + name: z.string(), + etag: z.string(), + grantRules: z + .array(z.lazy(() => marshalCreateCreateGrantRuleSchema)) + .optional(), }) .transform(d => ({ - principals: d.principals, - role: d.role, + name: d.name, + etag: d.etag, + grant_rules: d.grantRules, })); export const marshalResourceInfoSchema: z.ZodType = z @@ -679,24 +774,12 @@ export const marshalResourceInfoSchema: z.ZodType = z legacy_acl_path: d.legacyAclPath, })); -export const marshalRuleSetUpdateRequestSchema: z.ZodType = z - .object({ - name: z.string().optional(), - etag: z.string().optional(), - grantRules: z.array(z.lazy(() => marshalGrantRuleSchema)).optional(), - }) - .transform(d => ({ - name: d.name, - etag: d.etag, - grant_rules: d.grantRules, - })); - export const marshalSetObjectPermissionsRequestSchema: z.ZodType = z .object({ requestObjectType: z.string().optional(), requestObjectId: z.string().optional(), accessControlList: z - .array(z.lazy(() => marshalAccessControlRequestSchema)) + .array(z.lazy(() => marshalCreateAccessControlRequestSchema)) .optional(), }) .transform(d => ({ @@ -710,7 +793,7 @@ export const marshalUpdateObjectPermissionsRequestSchema: z.ZodType = z requestObjectType: z.string().optional(), requestObjectId: z.string().optional(), accessControlList: z - .array(z.lazy(() => marshalAccessControlRequestSchema)) + .array(z.lazy(() => marshalCreateAccessControlRequestSchema)) .optional(), }) .transform(d => ({ @@ -723,7 +806,9 @@ export const marshalUpdateRuleSetRequestSchema: z.ZodType = z .object({ accountId: z.string().optional(), name: z.string().optional(), - ruleSet: z.lazy(() => marshalRuleSetUpdateRequestSchema).optional(), + ruleSet: z + .lazy(() => marshalCreateCreateRuleSetUpdateRequestSchema) + .optional(), }) .transform(d => ({ account_id: d.accountId, diff --git a/packages/alerts/src/v1/index.ts b/packages/alerts/src/v1/index.ts index a4e7e245..24fbcfbb 100755 --- a/packages/alerts/src/v1/index.ts +++ b/packages/alerts/src/v1/index.ts @@ -14,16 +14,26 @@ export type { AlertOperand, AlertOperandColumn, AlertOperandValue, + CreateAlertCondition, + CreateAlertOperand, + CreateAlertOperandColumn, + CreateAlertOperandValue, CreateAlertRequest, CreateAlertRequestAlert, + CreateCreateAlertRequestAlert, Empty, GetAlertRequest, ListAlertsRequest, ListAlertsResponse, ListAlertsResponseAlert, TrashAlertRequest, + UpdateAlertCondition, + UpdateAlertOperand, + UpdateAlertOperandColumn, + UpdateAlertOperandValue, UpdateAlertRequest, UpdateAlertRequestAlert, + UpdateUpdateAlertRequestAlert, } from './model'; -export {updateAlertRequestAlertFieldMask} from './model'; +export {updateUpdateAlertRequestAlertFieldMask} from './model'; diff --git a/packages/alerts/src/v1/model.ts b/packages/alerts/src/v1/model.ts index 2389f92d..b63bd97f 100644 --- a/packages/alerts/src/v1/model.ts +++ b/packages/alerts/src/v1/model.ts @@ -103,8 +103,40 @@ export interface AlertOperandValue { | undefined; } +export interface CreateAlertCondition { + /** Operator used for comparison in alert evaluation. */ + op?: AlertOperator | undefined; + /** Name of the column from the query result to use for comparison in alert evaluation. */ + operand?: CreateAlertOperand | undefined; + /** Threshold value used for comparison in alert evaluation. */ + threshold?: CreateAlertOperand | undefined; + /** Alert state if result is empty. */ + emptyResultState?: AlertState | undefined; +} + +export interface CreateAlertOperand { + /** Only one of the following fields may be set, depending on the type of operand/threshold. */ + operand?: + | {$case: 'value'; value: CreateAlertOperandValue} + | {$case: 'column'; column: CreateAlertOperandColumn} + | undefined; +} + +export interface CreateAlertOperandColumn { + name?: string | undefined; +} + +export interface CreateAlertOperandValue { + /** Only one of the following fields may be set, depending on the type of threshold value. */ + thresholdValue?: + | {$case: 'stringValue'; stringValue: string} + | {$case: 'doubleValue'; doubleValue: number} + | {$case: 'boolValue'; boolValue: boolean} + | undefined; +} + export interface CreateAlertRequest { - alert?: CreateAlertRequestAlert | undefined; + alert?: CreateCreateAlertRequestAlert | undefined; /** If true, automatically resolve alert display name conflicts. Otherwise, fail the request if the alert's display name conflicts with an existing alert's display name. */ autoResolveDisplayName?: boolean | undefined; } @@ -142,6 +174,39 @@ export interface CreateAlertRequestAlert { notifyOnOk?: boolean | undefined; } +export interface CreateCreateAlertRequestAlert { + /** UUID identifying the alert. */ + id?: string | undefined; + /** The display name of the alert. */ + displayName?: string | undefined; + /** UUID of the query attached to the alert. */ + queryId?: string | undefined; + /** Current state of the alert's trigger status. This field is set to UNKNOWN if the alert has not yet been evaluated or ran into an error during the last evaluation. */ + state?: AlertState | undefined; + /** Number of seconds an alert must wait after being triggered to rearm itself. After rearming, it can be triggered again. If 0 or not specified, the alert will not be triggered again. */ + secondsToRetrigger?: number | undefined; + /** The workspace state of the alert. Used for tracking trashed status. */ + lifecycleState?: LifecycleState | undefined; + /** Timestamp when the alert was last triggered, if the alert has been triggered before. */ + triggerTime?: Temporal.Instant | undefined; + /** Custom body of alert notification, if it exists. See [here](/sql/user/alerts/index.html) for custom templating instructions. */ + customBody?: string | undefined; + /** Custom subject of alert notification, if it exists. This can include email subject entries and Slack notification headers, for example. See [here](/sql/user/alerts/index.html) for custom templating instructions. */ + customSubject?: string | undefined; + /** Trigger conditions of the alert. */ + condition?: CreateAlertCondition | undefined; + /** The owner's username. This field is set to "Unavailable" if the user has been deleted. */ + ownerUserName?: string | undefined; + /** The workspace path of the folder containing the alert. */ + parentPath?: string | undefined; + /** The timestamp indicating when the alert was created. */ + createTime?: Temporal.Instant | undefined; + /** The timestamp indicating when the alert was updated. */ + updateTime?: Temporal.Instant | undefined; + /** Whether to notify alert subscribers when alert returns back to normal. */ + notifyOnOk?: boolean | undefined; +} + /** * Represents an empty message, similar to google.protobuf.Empty, which is not available in the firm * right now. @@ -200,9 +265,41 @@ export interface TrashAlertRequest { id?: string | undefined; } +export interface UpdateAlertCondition { + /** Operator used for comparison in alert evaluation. */ + op?: AlertOperator | undefined; + /** Name of the column from the query result to use for comparison in alert evaluation. */ + operand?: UpdateAlertOperand | undefined; + /** Threshold value used for comparison in alert evaluation. */ + threshold?: UpdateAlertOperand | undefined; + /** Alert state if result is empty. */ + emptyResultState?: AlertState | undefined; +} + +export interface UpdateAlertOperand { + /** Only one of the following fields may be set, depending on the type of operand/threshold. */ + operand?: + | {$case: 'value'; value: UpdateAlertOperandValue} + | {$case: 'column'; column: UpdateAlertOperandColumn} + | undefined; +} + +export interface UpdateAlertOperandColumn { + name?: string | undefined; +} + +export interface UpdateAlertOperandValue { + /** Only one of the following fields may be set, depending on the type of threshold value. */ + thresholdValue?: + | {$case: 'stringValue'; stringValue: string} + | {$case: 'doubleValue'; doubleValue: number} + | {$case: 'boolValue'; boolValue: boolean} + | undefined; +} + export interface UpdateAlertRequest { - alert?: UpdateAlertRequestAlert | undefined; - updateMask?: FieldMask | undefined; + alert?: UpdateUpdateAlertRequestAlert | undefined; + updateMask?: FieldMask | undefined; id?: string | undefined; /** If true, automatically resolve alert display name conflicts. Otherwise, fail the request if the alert's display name conflicts with an existing alert's display name. */ autoResolveDisplayName?: boolean | undefined; @@ -241,6 +338,39 @@ export interface UpdateAlertRequestAlert { notifyOnOk?: boolean | undefined; } +export interface UpdateUpdateAlertRequestAlert { + /** UUID identifying the alert. */ + id?: string | undefined; + /** The display name of the alert. */ + displayName?: string | undefined; + /** UUID of the query attached to the alert. */ + queryId?: string | undefined; + /** Current state of the alert's trigger status. This field is set to UNKNOWN if the alert has not yet been evaluated or ran into an error during the last evaluation. */ + state?: AlertState | undefined; + /** Number of seconds an alert must wait after being triggered to rearm itself. After rearming, it can be triggered again. If 0 or not specified, the alert will not be triggered again. */ + secondsToRetrigger?: number | undefined; + /** The workspace state of the alert. Used for tracking trashed status. */ + lifecycleState?: LifecycleState | undefined; + /** Timestamp when the alert was last triggered, if the alert has been triggered before. */ + triggerTime?: Temporal.Instant | undefined; + /** Custom body of alert notification, if it exists. See [here](/sql/user/alerts/index.html) for custom templating instructions. */ + customBody?: string | undefined; + /** Custom subject of alert notification, if it exists. This can include email subject entries and Slack notification headers, for example. See [here](/sql/user/alerts/index.html) for custom templating instructions. */ + customSubject?: string | undefined; + /** Trigger conditions of the alert. */ + condition?: UpdateAlertCondition | undefined; + /** The owner's username. This field is set to "Unavailable" if the user has been deleted. */ + ownerUserName?: string | undefined; + /** The workspace path of the folder containing the alert. */ + parentPath?: string | undefined; + /** The timestamp indicating when the alert was created. */ + createTime?: Temporal.Instant | undefined; + /** The timestamp indicating when the alert was updated. */ + updateTime?: Temporal.Instant | undefined; + /** Whether to notify alert subscribers when alert returns back to normal. */ + notifyOnOk?: boolean | undefined; +} + export const unmarshalAlertSchema: z.ZodType = z .object({ id: z.string().optional(), @@ -401,11 +531,11 @@ export const unmarshalListAlertsResponseAlertSchema: z.ZodType marshalAlertOperandSchema).optional(), - threshold: z.lazy(() => marshalAlertOperandSchema).optional(), + operand: z.lazy(() => marshalCreateAlertOperandSchema).optional(), + threshold: z.lazy(() => marshalCreateAlertOperandSchema).optional(), emptyResultState: z.string().optional(), }) .transform(d => ({ @@ -415,17 +545,17 @@ export const marshalAlertConditionSchema: z.ZodType = z empty_result_state: d.emptyResultState, })); -export const marshalAlertOperandSchema: z.ZodType = z +export const marshalCreateAlertOperandSchema: z.ZodType = z .object({ operand: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('value'), - value: z.lazy(() => marshalAlertOperandValueSchema), + value: z.lazy(() => marshalCreateAlertOperandValueSchema), }), z.object({ $case: z.literal('column'), - column: z.lazy(() => marshalAlertOperandColumnSchema), + column: z.lazy(() => marshalCreateAlertOperandColumnSchema), }), ]) .optional(), @@ -435,7 +565,7 @@ export const marshalAlertOperandSchema: z.ZodType = z ...(d.operand?.$case === 'column' && {column: d.operand.column}), })); -export const marshalAlertOperandColumnSchema: z.ZodType = z +export const marshalCreateAlertOperandColumnSchema: z.ZodType = z .object({ name: z.string().optional(), }) @@ -443,7 +573,7 @@ export const marshalAlertOperandColumnSchema: z.ZodType = z name: d.name, })); -export const marshalAlertOperandValueSchema: z.ZodType = z +export const marshalCreateAlertOperandValueSchema: z.ZodType = z .object({ thresholdValue: z .discriminatedUnion('$case', [ @@ -467,7 +597,7 @@ export const marshalAlertOperandValueSchema: z.ZodType = z export const marshalCreateAlertRequestSchema: z.ZodType = z .object({ - alert: z.lazy(() => marshalCreateAlertRequestAlertSchema).optional(), + alert: z.lazy(() => marshalCreateCreateAlertRequestAlertSchema).optional(), autoResolveDisplayName: z.boolean().optional(), }) .transform(d => ({ @@ -475,7 +605,7 @@ export const marshalCreateAlertRequestSchema: z.ZodType = z auto_resolve_display_name: d.autoResolveDisplayName, })); -export const marshalCreateAlertRequestAlertSchema: z.ZodType = z +export const marshalCreateCreateAlertRequestAlertSchema: z.ZodType = z .object({ id: z.string().optional(), displayName: z.string().optional(), @@ -489,7 +619,7 @@ export const marshalCreateAlertRequestAlertSchema: z.ZodType = z .optional(), customBody: z.string().optional(), customSubject: z.string().optional(), - condition: z.lazy(() => marshalAlertConditionSchema).optional(), + condition: z.lazy(() => marshalCreateAlertConditionSchema).optional(), ownerUserName: z.string().optional(), parentPath: z.string().optional(), createTime: z @@ -520,9 +650,73 @@ export const marshalCreateAlertRequestAlertSchema: z.ZodType = z notify_on_ok: d.notifyOnOk, })); +export const marshalUpdateAlertConditionSchema: z.ZodType = z + .object({ + op: z.string().optional(), + operand: z.lazy(() => marshalUpdateAlertOperandSchema).optional(), + threshold: z.lazy(() => marshalUpdateAlertOperandSchema).optional(), + emptyResultState: z.string().optional(), + }) + .transform(d => ({ + op: d.op, + operand: d.operand, + threshold: d.threshold, + empty_result_state: d.emptyResultState, + })); + +export const marshalUpdateAlertOperandSchema: z.ZodType = z + .object({ + operand: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('value'), + value: z.lazy(() => marshalUpdateAlertOperandValueSchema), + }), + z.object({ + $case: z.literal('column'), + column: z.lazy(() => marshalUpdateAlertOperandColumnSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.operand?.$case === 'value' && {value: d.operand.value}), + ...(d.operand?.$case === 'column' && {column: d.operand.column}), + })); + +export const marshalUpdateAlertOperandColumnSchema: z.ZodType = z + .object({ + name: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + })); + +export const marshalUpdateAlertOperandValueSchema: z.ZodType = z + .object({ + thresholdValue: z + .discriminatedUnion('$case', [ + z.object({$case: z.literal('stringValue'), stringValue: z.string()}), + z.object({$case: z.literal('doubleValue'), doubleValue: z.number()}), + z.object({$case: z.literal('boolValue'), boolValue: z.boolean()}), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.thresholdValue?.$case === 'stringValue' && { + string_value: d.thresholdValue.stringValue, + }), + ...(d.thresholdValue?.$case === 'doubleValue' && { + double_value: d.thresholdValue.doubleValue, + }), + ...(d.thresholdValue?.$case === 'boolValue' && { + bool_value: d.thresholdValue.boolValue, + }), + })); + export const marshalUpdateAlertRequestSchema: z.ZodType = z .object({ - alert: z.lazy(() => marshalUpdateAlertRequestAlertSchema).optional(), + alert: z.lazy(() => marshalUpdateUpdateAlertRequestAlertSchema).optional(), updateMask: z .any() .transform((m: FieldMask) => m.toString()) @@ -537,7 +731,7 @@ export const marshalUpdateAlertRequestSchema: z.ZodType = z auto_resolve_display_name: d.autoResolveDisplayName, })); -export const marshalUpdateAlertRequestAlertSchema: z.ZodType = z +export const marshalUpdateUpdateAlertRequestAlertSchema: z.ZodType = z .object({ id: z.string().optional(), displayName: z.string().optional(), @@ -551,7 +745,7 @@ export const marshalUpdateAlertRequestAlertSchema: z.ZodType = z .optional(), customBody: z.string().optional(), customSubject: z.string().optional(), - condition: z.lazy(() => marshalAlertConditionSchema).optional(), + condition: z.lazy(() => marshalUpdateAlertConditionSchema).optional(), ownerUserName: z.string().optional(), parentPath: z.string().optional(), createTime: z @@ -582,30 +776,42 @@ export const marshalUpdateAlertRequestAlertSchema: z.ZodType = z notify_on_ok: d.notifyOnOk, })); -const alertConditionFieldMaskSchema: FieldMaskSchema = { +const updateAlertConditionFieldMaskSchema: FieldMaskSchema = { emptyResultState: {wire: 'empty_result_state'}, op: {wire: 'op'}, - operand: {wire: 'operand', children: () => alertOperandFieldMaskSchema}, - threshold: {wire: 'threshold', children: () => alertOperandFieldMaskSchema}, + operand: {wire: 'operand', children: () => updateAlertOperandFieldMaskSchema}, + threshold: { + wire: 'threshold', + children: () => updateAlertOperandFieldMaskSchema, + }, }; -const alertOperandFieldMaskSchema: FieldMaskSchema = { - column: {wire: 'column', children: () => alertOperandColumnFieldMaskSchema}, - value: {wire: 'value', children: () => alertOperandValueFieldMaskSchema}, +const updateAlertOperandFieldMaskSchema: FieldMaskSchema = { + column: { + wire: 'column', + children: () => updateAlertOperandColumnFieldMaskSchema, + }, + value: { + wire: 'value', + children: () => updateAlertOperandValueFieldMaskSchema, + }, }; -const alertOperandColumnFieldMaskSchema: FieldMaskSchema = { +const updateAlertOperandColumnFieldMaskSchema: FieldMaskSchema = { name: {wire: 'name'}, }; -const alertOperandValueFieldMaskSchema: FieldMaskSchema = { +const updateAlertOperandValueFieldMaskSchema: FieldMaskSchema = { boolValue: {wire: 'bool_value'}, doubleValue: {wire: 'double_value'}, stringValue: {wire: 'string_value'}, }; -const updateAlertRequestAlertFieldMaskSchema: FieldMaskSchema = { - condition: {wire: 'condition', children: () => alertConditionFieldMaskSchema}, +const updateUpdateAlertRequestAlertFieldMaskSchema: FieldMaskSchema = { + condition: { + wire: 'condition', + children: () => updateAlertConditionFieldMaskSchema, + }, createTime: {wire: 'create_time'}, customBody: {wire: 'custom_body'}, customSubject: {wire: 'custom_subject'}, @@ -622,11 +828,11 @@ const updateAlertRequestAlertFieldMaskSchema: FieldMaskSchema = { updateTime: {wire: 'update_time'}, }; -export function updateAlertRequestAlertFieldMask( +export function updateUpdateAlertRequestAlertFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - updateAlertRequestAlertFieldMaskSchema + updateUpdateAlertRequestAlertFieldMaskSchema ); } diff --git a/packages/alerts/src/v2/client.ts b/packages/alerts/src/v2/client.ts index 97184e3a..f7972835 100644 --- a/packages/alerts/src/v2/client.ts +++ b/packages/alerts/src/v2/client.ts @@ -27,7 +27,8 @@ import type { UpdateAlertRequest, } from './model'; import { - marshalAlertSchema, + marshalCreateAlertSchema, + marshalUpdateAlertSchema, unmarshalAlertSchema, unmarshalEmptySchema, unmarshalListAlertsResponseSchema, @@ -73,7 +74,7 @@ export class AlertsClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/alerts`; - const body = marshalRequest(req.alert, marshalAlertSchema); + const body = marshalRequest(req.alert, marshalCreateAlertSchema); let resp: Alert | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -225,7 +226,7 @@ export class AlertsClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.alert, marshalAlertSchema); + const body = marshalRequest(req.alert, marshalUpdateAlertSchema); let resp: Alert | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/alerts/src/v2/index.ts b/packages/alerts/src/v2/index.ts index 0f3b9dff..73d7a095 100755 --- a/packages/alerts/src/v2/index.ts +++ b/packages/alerts/src/v2/index.ts @@ -23,14 +23,32 @@ export type { AlertOperandValue, AlertRunAs, AlertSubscription, + CreateAlert, + CreateAlertEvaluation, + CreateAlertNotification, + CreateAlertOperand, + CreateAlertOperandColumn, + CreateAlertOperandValue, CreateAlertRequest, + CreateAlertRunAs, + CreateAlertSubscription, + CreateCronSchedule, CronSchedule, Empty, GetAlertRequest, ListAlertsRequest, ListAlertsResponse, TrashAlertRequest, + UpdateAlert, + UpdateAlertEvaluation, + UpdateAlertNotification, + UpdateAlertOperand, + UpdateAlertOperandColumn, + UpdateAlertOperandValue, UpdateAlertRequest, + UpdateAlertRunAs, + UpdateAlertSubscription, + UpdateCronSchedule, } from './model'; -export {alertFieldMask} from './model'; +export {updateAlertFieldMask} from './model'; diff --git a/packages/alerts/src/v2/model.ts b/packages/alerts/src/v2/model.ts index 62058d18..79946f39 100644 --- a/packages/alerts/src/v2/model.ts +++ b/packages/alerts/src/v2/model.ts @@ -194,8 +194,128 @@ export interface AlertSubscription { | undefined; } +export interface CreateAlert { + /** UUID identifying the alert. */ + id?: string | undefined; + /** The display name of the alert. */ + displayName: string; + /** The workspace path of the folder containing the alert. Can only be set on create, and cannot be updated. */ + parentPath?: string | undefined; + /** Text of the query to be run. */ + queryText: string; + /** ID of the SQL warehouse attached to the alert. */ + warehouseId: string; + /** + * The run as username or application ID of service principal. + * On Create and Update, this field can be set to application ID of an active service principal. Setting this field requires the servicePrincipal/user role. + * Deprecated: Use `run_as` field instead. This field will be removed in a future release. + */ + runAsUserName?: string | undefined; + evaluation: CreateAlertEvaluation; + schedule: CreateCronSchedule; + /** Custom summary for the alert. support mustache template. */ + customSummary?: string | undefined; + /** Custom description for the alert. support mustache template. */ + customDescription?: string | undefined; + /** + * Specifies the identity that will be used to run the alert. + * This field allows you to configure alerts to run as a specific user or service principal. + * - For user identity: Set `user_name` to the email of an active workspace user. Users can only set this to their own email. + * - For service principal: Set `service_principal_name` to the application ID. Requires the `servicePrincipal/user` role. + * If not specified, the alert will run as the request user. + */ + runAs?: CreateAlertRunAs | undefined; +} + +export interface CreateAlertEvaluation { + /** Source column from result to use to evaluate alert */ + source: CreateAlertOperandColumn; + /** Operator used for comparison in alert evaluation. */ + comparisonOperator: ComparisonOperator; + /** Threshold to user for alert evaluation, can be a column or a value. */ + threshold?: CreateAlertOperand | undefined; + /** User or Notification Destination to notify when alert is triggered. */ + notification?: CreateAlertNotification | undefined; + /** Alert state if result is empty. Please avoid setting this field to be `UNKNOWN` because `UNKNOWN` state is planned to be deprecated. */ + emptyResultState?: AlertEvaluationState | undefined; +} + +export interface CreateAlertNotification { + subscriptions?: CreateAlertSubscription[] | undefined; + /** + * Number of seconds an alert waits after being triggered before it is allowed to send another notification. + * If set to 0 or omitted, the alert will not send any further notifications after the first trigger + * Setting this value to 1 allows the alert to send a notification on every evaluation where the condition is met, effectively making it always retrigger for notification purposes. + */ + retriggerSeconds?: number | undefined; + /** Whether to notify alert subscribers when alert returns back to normal. */ + notifyOnOk?: boolean | undefined; +} + +export interface CreateAlertOperand { + /** Only one of the following fields may be set, depending on the type of operand/threshold. */ + operand?: + | {$case: 'column'; column: CreateAlertOperandColumn} + | {$case: 'value'; value: CreateAlertOperandValue} + | undefined; +} + +export interface CreateAlertOperandColumn { + name: string; + display?: string | undefined; + /** If not set, the behavior is equivalent to using `First row` in the UI. */ + aggregation?: Aggregation | undefined; +} + +export interface CreateAlertOperandValue { + /** Only one of the following fields may be set, depending on the type of threshold value. */ + value?: + | {$case: 'stringValue'; stringValue: string} + | {$case: 'doubleValue'; doubleValue: number} + | {$case: 'boolValue'; boolValue: boolean} + | undefined; +} + export interface CreateAlertRequest { - alert?: Alert | undefined; + alert?: CreateAlert | undefined; +} + +export interface CreateAlertRunAs { + identity?: + | { + $case: 'userName'; + /** The email of an active workspace user. Can only set this field to their own email. */ + userName: string; + } + | { + $case: 'servicePrincipalName'; + /** Application ID of an active service principal. Setting this field requires the `servicePrincipal/user` role. */ + servicePrincipalName: string; + } + | undefined; +} + +export interface CreateAlertSubscription { + subscriptionType?: + | {$case: 'userEmail'; userEmail: string} + | {$case: 'destinationId'; destinationId: string} + | undefined; +} + +export interface CreateCronSchedule { + /** + * A cron expression using quartz syntax that specifies the schedule for this pipeline. + * Should use the quartz format described here: http://www.quartz-scheduler.org/documentation/quartz-2.1.7/tutorials/tutorial-lesson-06.html + */ + quartzCronSchedule: string; + /** + * A Java timezone id. The schedule will be resolved using this timezone. + * This will be combined with the quartz_cron_schedule to determine the schedule. + * See https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-timezone.html for details. + */ + timezoneId: string; + /** Indicate whether this schedule is paused or not. */ + pauseStatus?: SchedulePauseStatus | undefined; } export interface CronSchedule { @@ -241,9 +361,129 @@ export interface TrashAlertRequest { purge?: boolean | undefined; } +export interface UpdateAlert { + /** UUID identifying the alert. */ + id?: string | undefined; + /** The display name of the alert. */ + displayName?: string | undefined; + /** The workspace path of the folder containing the alert. Can only be set on create, and cannot be updated. */ + parentPath?: string | undefined; + /** Text of the query to be run. */ + queryText?: string | undefined; + /** ID of the SQL warehouse attached to the alert. */ + warehouseId?: string | undefined; + /** + * The run as username or application ID of service principal. + * On Create and Update, this field can be set to application ID of an active service principal. Setting this field requires the servicePrincipal/user role. + * Deprecated: Use `run_as` field instead. This field will be removed in a future release. + */ + runAsUserName?: string | undefined; + evaluation?: UpdateAlertEvaluation | undefined; + schedule?: UpdateCronSchedule | undefined; + /** Custom summary for the alert. support mustache template. */ + customSummary?: string | undefined; + /** Custom description for the alert. support mustache template. */ + customDescription?: string | undefined; + /** + * Specifies the identity that will be used to run the alert. + * This field allows you to configure alerts to run as a specific user or service principal. + * - For user identity: Set `user_name` to the email of an active workspace user. Users can only set this to their own email. + * - For service principal: Set `service_principal_name` to the application ID. Requires the `servicePrincipal/user` role. + * If not specified, the alert will run as the request user. + */ + runAs?: UpdateAlertRunAs | undefined; +} + +export interface UpdateAlertEvaluation { + /** Source column from result to use to evaluate alert */ + source?: UpdateAlertOperandColumn | undefined; + /** Operator used for comparison in alert evaluation. */ + comparisonOperator?: ComparisonOperator | undefined; + /** Threshold to user for alert evaluation, can be a column or a value. */ + threshold?: UpdateAlertOperand | undefined; + /** User or Notification Destination to notify when alert is triggered. */ + notification?: UpdateAlertNotification | undefined; + /** Alert state if result is empty. Please avoid setting this field to be `UNKNOWN` because `UNKNOWN` state is planned to be deprecated. */ + emptyResultState?: AlertEvaluationState | undefined; +} + +export interface UpdateAlertNotification { + subscriptions?: UpdateAlertSubscription[] | undefined; + /** + * Number of seconds an alert waits after being triggered before it is allowed to send another notification. + * If set to 0 or omitted, the alert will not send any further notifications after the first trigger + * Setting this value to 1 allows the alert to send a notification on every evaluation where the condition is met, effectively making it always retrigger for notification purposes. + */ + retriggerSeconds?: number | undefined; + /** Whether to notify alert subscribers when alert returns back to normal. */ + notifyOnOk?: boolean | undefined; +} + +export interface UpdateAlertOperand { + /** Only one of the following fields may be set, depending on the type of operand/threshold. */ + operand?: + | {$case: 'column'; column: UpdateAlertOperandColumn} + | {$case: 'value'; value: UpdateAlertOperandValue} + | undefined; +} + +export interface UpdateAlertOperandColumn { + name?: string | undefined; + display?: string | undefined; + /** If not set, the behavior is equivalent to using `First row` in the UI. */ + aggregation?: Aggregation | undefined; +} + +export interface UpdateAlertOperandValue { + /** Only one of the following fields may be set, depending on the type of threshold value. */ + value?: + | {$case: 'stringValue'; stringValue: string} + | {$case: 'doubleValue'; doubleValue: number} + | {$case: 'boolValue'; boolValue: boolean} + | undefined; +} + export interface UpdateAlertRequest { - alert?: Alert | undefined; - updateMask?: FieldMask | undefined; + alert?: UpdateAlert | undefined; + updateMask?: FieldMask | undefined; +} + +export interface UpdateAlertRunAs { + identity?: + | { + $case: 'userName'; + /** The email of an active workspace user. Can only set this field to their own email. */ + userName: string; + } + | { + $case: 'servicePrincipalName'; + /** Application ID of an active service principal. Setting this field requires the `servicePrincipal/user` role. */ + servicePrincipalName: string; + } + | undefined; +} + +export interface UpdateAlertSubscription { + subscriptionType?: + | {$case: 'userEmail'; userEmail: string} + | {$case: 'destinationId'; destinationId: string} + | undefined; +} + +export interface UpdateCronSchedule { + /** + * A cron expression using quartz syntax that specifies the schedule for this pipeline. + * Should use the quartz format described here: http://www.quartz-scheduler.org/documentation/quartz-2.1.7/tutorials/tutorial-lesson-06.html + */ + quartzCronSchedule?: string | undefined; + /** + * A Java timezone id. The schedule will be resolved using this timezone. + * This will be combined with the quartz_cron_schedule to determine the schedule. + * See https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-timezone.html for details. + */ + timezoneId?: string | undefined; + /** Indicate whether this schedule is paused or not. */ + pauseStatus?: SchedulePauseStatus | undefined; } export const unmarshalAlertSchema: z.ZodType = z @@ -427,61 +667,202 @@ export const unmarshalListAlertsResponseSchema: z.ZodType = nextPageToken: d.next_page_token, })); -export const marshalAlertSchema: z.ZodType = z +export const marshalCreateAlertSchema: z.ZodType = z .object({ id: z.string().optional(), - displayName: z.string().optional(), - ownerUserName: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + displayName: z.string(), + parentPath: z.string().optional(), + queryText: z.string(), + warehouseId: z.string(), + runAsUserName: z.string().optional(), + evaluation: z.lazy(() => marshalCreateAlertEvaluationSchema), + schedule: z.lazy(() => marshalCreateCronScheduleSchema), + customSummary: z.string().optional(), + customDescription: z.string().optional(), + runAs: z.lazy(() => marshalCreateAlertRunAsSchema).optional(), + }) + .transform(d => ({ + id: d.id, + display_name: d.displayName, + parent_path: d.parentPath, + query_text: d.queryText, + warehouse_id: d.warehouseId, + run_as_user_name: d.runAsUserName, + evaluation: d.evaluation, + schedule: d.schedule, + custom_summary: d.customSummary, + custom_description: d.customDescription, + run_as: d.runAs, + })); + +export const marshalCreateAlertEvaluationSchema: z.ZodType = z + .object({ + source: z.lazy(() => marshalCreateAlertOperandColumnSchema), + comparisonOperator: z.string(), + threshold: z.lazy(() => marshalCreateAlertOperandSchema).optional(), + notification: z.lazy(() => marshalCreateAlertNotificationSchema).optional(), + emptyResultState: z.string().optional(), + }) + .transform(d => ({ + source: d.source, + comparison_operator: d.comparisonOperator, + threshold: d.threshold, + notification: d.notification, + empty_result_state: d.emptyResultState, + })); + +export const marshalCreateAlertNotificationSchema: z.ZodType = z + .object({ + subscriptions: z + .array(z.lazy(() => marshalCreateAlertSubscriptionSchema)) .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + retriggerSeconds: z.number().optional(), + notifyOnOk: z.boolean().optional(), + }) + .transform(d => ({ + subscriptions: d.subscriptions, + retrigger_seconds: d.retriggerSeconds, + notify_on_ok: d.notifyOnOk, + })); + +export const marshalCreateAlertOperandSchema: z.ZodType = z + .object({ + operand: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('column'), + column: z.lazy(() => marshalCreateAlertOperandColumnSchema), + }), + z.object({ + $case: z.literal('value'), + value: z.lazy(() => marshalCreateAlertOperandValueSchema), + }), + ]) .optional(), + }) + .transform(d => ({ + ...(d.operand?.$case === 'column' && {column: d.operand.column}), + ...(d.operand?.$case === 'value' && {value: d.operand.value}), + })); + +export const marshalCreateAlertOperandColumnSchema: z.ZodType = z + .object({ + name: z.string(), + display: z.string().optional(), + aggregation: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + display: d.display, + aggregation: d.aggregation, + })); + +export const marshalCreateAlertOperandValueSchema: z.ZodType = z + .object({ + value: z + .discriminatedUnion('$case', [ + z.object({$case: z.literal('stringValue'), stringValue: z.string()}), + z.object({$case: z.literal('doubleValue'), doubleValue: z.number()}), + z.object({$case: z.literal('boolValue'), boolValue: z.boolean()}), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.value?.$case === 'stringValue' && { + string_value: d.value.stringValue, + }), + ...(d.value?.$case === 'doubleValue' && { + double_value: d.value.doubleValue, + }), + ...(d.value?.$case === 'boolValue' && {bool_value: d.value.boolValue}), + })); + +export const marshalCreateAlertRunAsSchema: z.ZodType = z + .object({ + identity: z + .discriminatedUnion('$case', [ + z.object({$case: z.literal('userName'), userName: z.string()}), + z.object({ + $case: z.literal('servicePrincipalName'), + servicePrincipalName: z.string(), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.identity?.$case === 'userName' && {user_name: d.identity.userName}), + ...(d.identity?.$case === 'servicePrincipalName' && { + service_principal_name: d.identity.servicePrincipalName, + }), + })); + +export const marshalCreateAlertSubscriptionSchema: z.ZodType = z + .object({ + subscriptionType: z + .discriminatedUnion('$case', [ + z.object({$case: z.literal('userEmail'), userEmail: z.string()}), + z.object({ + $case: z.literal('destinationId'), + destinationId: z.string(), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.subscriptionType?.$case === 'userEmail' && { + user_email: d.subscriptionType.userEmail, + }), + ...(d.subscriptionType?.$case === 'destinationId' && { + destination_id: d.subscriptionType.destinationId, + }), + })); + +export const marshalCreateCronScheduleSchema: z.ZodType = z + .object({ + quartzCronSchedule: z.string(), + timezoneId: z.string(), + pauseStatus: z.string().optional(), + }) + .transform(d => ({ + quartz_cron_schedule: d.quartzCronSchedule, + timezone_id: d.timezoneId, + pause_status: d.pauseStatus, + })); + +export const marshalUpdateAlertSchema: z.ZodType = z + .object({ + id: z.string().optional(), + displayName: z.string().optional(), parentPath: z.string().optional(), queryText: z.string().optional(), warehouseId: z.string().optional(), runAsUserName: z.string().optional(), - evaluation: z.lazy(() => marshalAlertEvaluationSchema).optional(), - schedule: z.lazy(() => marshalCronScheduleSchema).optional(), - lifecycleState: z.string().optional(), + evaluation: z.lazy(() => marshalUpdateAlertEvaluationSchema).optional(), + schedule: z.lazy(() => marshalUpdateCronScheduleSchema).optional(), customSummary: z.string().optional(), customDescription: z.string().optional(), - runAs: z.lazy(() => marshalAlertRunAsSchema).optional(), - effectiveRunAs: z.lazy(() => marshalAlertRunAsSchema).optional(), + runAs: z.lazy(() => marshalUpdateAlertRunAsSchema).optional(), }) .transform(d => ({ id: d.id, display_name: d.displayName, - owner_user_name: d.ownerUserName, - create_time: d.createTime, - update_time: d.updateTime, parent_path: d.parentPath, query_text: d.queryText, warehouse_id: d.warehouseId, run_as_user_name: d.runAsUserName, evaluation: d.evaluation, schedule: d.schedule, - lifecycle_state: d.lifecycleState, custom_summary: d.customSummary, custom_description: d.customDescription, run_as: d.runAs, - effective_run_as: d.effectiveRunAs, })); -export const marshalAlertEvaluationSchema: z.ZodType = z +export const marshalUpdateAlertEvaluationSchema: z.ZodType = z .object({ - source: z.lazy(() => marshalAlertOperandColumnSchema).optional(), + source: z.lazy(() => marshalUpdateAlertOperandColumnSchema).optional(), comparisonOperator: z.string().optional(), - threshold: z.lazy(() => marshalAlertOperandSchema).optional(), - notification: z.lazy(() => marshalAlertNotificationSchema).optional(), - state: z.string().optional(), - lastEvaluatedAt: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), + threshold: z.lazy(() => marshalUpdateAlertOperandSchema).optional(), + notification: z.lazy(() => marshalUpdateAlertNotificationSchema).optional(), emptyResultState: z.string().optional(), }) .transform(d => ({ @@ -489,15 +870,13 @@ export const marshalAlertEvaluationSchema: z.ZodType = z comparison_operator: d.comparisonOperator, threshold: d.threshold, notification: d.notification, - state: d.state, - last_evaluated_at: d.lastEvaluatedAt, empty_result_state: d.emptyResultState, })); -export const marshalAlertNotificationSchema: z.ZodType = z +export const marshalUpdateAlertNotificationSchema: z.ZodType = z .object({ subscriptions: z - .array(z.lazy(() => marshalAlertSubscriptionSchema)) + .array(z.lazy(() => marshalUpdateAlertSubscriptionSchema)) .optional(), retriggerSeconds: z.number().optional(), notifyOnOk: z.boolean().optional(), @@ -508,17 +887,17 @@ export const marshalAlertNotificationSchema: z.ZodType = z notify_on_ok: d.notifyOnOk, })); -export const marshalAlertOperandSchema: z.ZodType = z +export const marshalUpdateAlertOperandSchema: z.ZodType = z .object({ operand: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('column'), - column: z.lazy(() => marshalAlertOperandColumnSchema), + column: z.lazy(() => marshalUpdateAlertOperandColumnSchema), }), z.object({ $case: z.literal('value'), - value: z.lazy(() => marshalAlertOperandValueSchema), + value: z.lazy(() => marshalUpdateAlertOperandValueSchema), }), ]) .optional(), @@ -528,7 +907,7 @@ export const marshalAlertOperandSchema: z.ZodType = z ...(d.operand?.$case === 'value' && {value: d.operand.value}), })); -export const marshalAlertOperandColumnSchema: z.ZodType = z +export const marshalUpdateAlertOperandColumnSchema: z.ZodType = z .object({ name: z.string().optional(), display: z.string().optional(), @@ -540,7 +919,7 @@ export const marshalAlertOperandColumnSchema: z.ZodType = z aggregation: d.aggregation, })); -export const marshalAlertOperandValueSchema: z.ZodType = z +export const marshalUpdateAlertOperandValueSchema: z.ZodType = z .object({ value: z .discriminatedUnion('$case', [ @@ -560,7 +939,7 @@ export const marshalAlertOperandValueSchema: z.ZodType = z ...(d.value?.$case === 'boolValue' && {bool_value: d.value.boolValue}), })); -export const marshalAlertRunAsSchema: z.ZodType = z +export const marshalUpdateAlertRunAsSchema: z.ZodType = z .object({ identity: z .discriminatedUnion('$case', [ @@ -579,7 +958,7 @@ export const marshalAlertRunAsSchema: z.ZodType = z }), })); -export const marshalAlertSubscriptionSchema: z.ZodType = z +export const marshalUpdateAlertSubscriptionSchema: z.ZodType = z .object({ subscriptionType: z .discriminatedUnion('$case', [ @@ -600,7 +979,7 @@ export const marshalAlertSubscriptionSchema: z.ZodType = z }), })); -export const marshalCronScheduleSchema: z.ZodType = z +export const marshalUpdateCronScheduleSchema: z.ZodType = z .object({ quartzCronSchedule: z.string().optional(), timezoneId: z.string().optional(), @@ -612,77 +991,84 @@ export const marshalCronScheduleSchema: z.ZodType = z pause_status: d.pauseStatus, })); -const alertFieldMaskSchema: FieldMaskSchema = { - createTime: {wire: 'create_time'}, +const updateAlertFieldMaskSchema: FieldMaskSchema = { customDescription: {wire: 'custom_description'}, customSummary: {wire: 'custom_summary'}, displayName: {wire: 'display_name'}, - effectiveRunAs: { - wire: 'effective_run_as', - children: () => alertRunAsFieldMaskSchema, - }, evaluation: { wire: 'evaluation', - children: () => alertEvaluationFieldMaskSchema, + children: () => updateAlertEvaluationFieldMaskSchema, }, id: {wire: 'id'}, - lifecycleState: {wire: 'lifecycle_state'}, - ownerUserName: {wire: 'owner_user_name'}, parentPath: {wire: 'parent_path'}, queryText: {wire: 'query_text'}, - runAs: {wire: 'run_as', children: () => alertRunAsFieldMaskSchema}, + runAs: {wire: 'run_as', children: () => updateAlertRunAsFieldMaskSchema}, runAsUserName: {wire: 'run_as_user_name'}, - schedule: {wire: 'schedule', children: () => cronScheduleFieldMaskSchema}, - updateTime: {wire: 'update_time'}, + schedule: { + wire: 'schedule', + children: () => updateCronScheduleFieldMaskSchema, + }, warehouseId: {wire: 'warehouse_id'}, }; -export function alertFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, alertFieldMaskSchema); +export function updateAlertFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, updateAlertFieldMaskSchema); } -const alertEvaluationFieldMaskSchema: FieldMaskSchema = { +const updateAlertEvaluationFieldMaskSchema: FieldMaskSchema = { comparisonOperator: {wire: 'comparison_operator'}, emptyResultState: {wire: 'empty_result_state'}, - lastEvaluatedAt: {wire: 'last_evaluated_at'}, notification: { wire: 'notification', - children: () => alertNotificationFieldMaskSchema, + children: () => updateAlertNotificationFieldMaskSchema, + }, + source: { + wire: 'source', + children: () => updateAlertOperandColumnFieldMaskSchema, + }, + threshold: { + wire: 'threshold', + children: () => updateAlertOperandFieldMaskSchema, }, - source: {wire: 'source', children: () => alertOperandColumnFieldMaskSchema}, - state: {wire: 'state'}, - threshold: {wire: 'threshold', children: () => alertOperandFieldMaskSchema}, }; -const alertNotificationFieldMaskSchema: FieldMaskSchema = { +const updateAlertNotificationFieldMaskSchema: FieldMaskSchema = { notifyOnOk: {wire: 'notify_on_ok'}, retriggerSeconds: {wire: 'retrigger_seconds'}, subscriptions: {wire: 'subscriptions'}, }; -const alertOperandFieldMaskSchema: FieldMaskSchema = { - column: {wire: 'column', children: () => alertOperandColumnFieldMaskSchema}, - value: {wire: 'value', children: () => alertOperandValueFieldMaskSchema}, +const updateAlertOperandFieldMaskSchema: FieldMaskSchema = { + column: { + wire: 'column', + children: () => updateAlertOperandColumnFieldMaskSchema, + }, + value: { + wire: 'value', + children: () => updateAlertOperandValueFieldMaskSchema, + }, }; -const alertOperandColumnFieldMaskSchema: FieldMaskSchema = { +const updateAlertOperandColumnFieldMaskSchema: FieldMaskSchema = { aggregation: {wire: 'aggregation'}, display: {wire: 'display'}, name: {wire: 'name'}, }; -const alertOperandValueFieldMaskSchema: FieldMaskSchema = { +const updateAlertOperandValueFieldMaskSchema: FieldMaskSchema = { boolValue: {wire: 'bool_value'}, doubleValue: {wire: 'double_value'}, stringValue: {wire: 'string_value'}, }; -const alertRunAsFieldMaskSchema: FieldMaskSchema = { +const updateAlertRunAsFieldMaskSchema: FieldMaskSchema = { servicePrincipalName: {wire: 'service_principal_name'}, userName: {wire: 'user_name'}, }; -const cronScheduleFieldMaskSchema: FieldMaskSchema = { +const updateCronScheduleFieldMaskSchema: FieldMaskSchema = { pauseStatus: {wire: 'pause_status'}, quartzCronSchedule: {wire: 'quartz_cron_schedule'}, timezoneId: {wire: 'timezone_id'}, diff --git a/packages/apps/src/v1/client.ts b/packages/apps/src/v1/client.ts index 29a8b591..30085149 100644 --- a/packages/apps/src/v1/client.ts +++ b/packages/apps/src/v1/client.ts @@ -63,14 +63,15 @@ import { AppDeployment_State, AppUpdate_UpdateStatus_UpdateState, ComputeStatus_ComputeState, - marshalAppDeploymentSchema, - marshalAppSchema, marshalAsyncUpdateAppRequestSchema, - marshalCustomTemplateSchema, - marshalSpaceSchema, + marshalCreateAppDeploymentSchema, + marshalCreateAppSchema, + marshalCreateCustomTemplateSchema, + marshalCreateSpaceSchema, marshalStartAppRequestSchema, marshalStopAppRequestSchema, marshalUpdateAppThumbnailRequestSchema, + marshalUpdateSpaceSchema, unmarshalAppDeploymentSchema, unmarshalAppSchema, unmarshalAppThumbnailSchema, @@ -173,7 +174,7 @@ export class AppsClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.app, marshalAppSchema); + const body = marshalRequest(req.app, marshalCreateAppSchema); let resp: App | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -221,7 +222,10 @@ export class AppsClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/apps/${req.appName ?? ''}/deployments`; - const body = marshalRequest(req.appDeployment, marshalAppDeploymentSchema); + const body = marshalRequest( + req.appDeployment, + marshalCreateAppDeploymentSchema + ); let resp: AppDeployment | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -268,7 +272,10 @@ export class AppsClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/apps-settings/templates`; - const body = marshalRequest(req.template, marshalCustomTemplateSchema); + const body = marshalRequest( + req.template, + marshalCreateCustomTemplateSchema + ); let resp: CustomTemplate | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -298,7 +305,7 @@ export class AppsClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/app-spaces`; - const body = marshalRequest(req.space, marshalSpaceSchema); + const body = marshalRequest(req.space, marshalCreateSpaceSchema); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -932,7 +939,7 @@ export class AppsClient { async updateApp(req: UpdateAppRequest, options?: CallOptions): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/apps/${req.app?.name ?? ''}`; - const body = marshalRequest(req.app, marshalAppSchema); + const body = marshalRequest(req.app, marshalCreateAppSchema); let resp: App | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -992,7 +999,10 @@ export class AppsClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/apps-settings/templates/${req.template?.name ?? ''}`; - const body = marshalRequest(req.template, marshalCustomTemplateSchema); + const body = marshalRequest( + req.template, + marshalCreateCustomTemplateSchema + ); let resp: CustomTemplate | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -1028,7 +1038,7 @@ export class AppsClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.space, marshalSpaceSchema); + const body = marshalRequest(req.space, marshalUpdateSpaceSchema); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/apps/src/v1/index.ts b/packages/apps/src/v1/index.ts index 50dc7181..6c2bf229 100755 --- a/packages/apps/src/v1/index.ts +++ b/packages/apps/src/v1/index.ts @@ -60,6 +60,13 @@ export type { AppManifest_AppResourceSpec, AppManifest_AppResourceSqlWarehouseSpec, AppManifest_AppResourceUcSecurableSpec, + AppManifest_CreateAppResourceExperimentSpec, + AppManifest_CreateAppResourceJobSpec, + AppManifest_CreateAppResourceSecretSpec, + AppManifest_CreateAppResourceServingEndpointSpec, + AppManifest_CreateAppResourceSpec, + AppManifest_CreateAppResourceSqlWarehouseSpec, + AppManifest_CreateAppResourceUcSecurableSpec, AppResource, AppResourceApp, AppResourceDatabase, @@ -77,10 +84,32 @@ export type { ApplicationStatus, AsyncUpdateAppRequest, ComputeStatus, + CreateApp, + CreateAppDeployment, CreateAppDeploymentRequest, + CreateAppManifest, CreateAppRequest, + CreateAppResource, + CreateAppResourceApp, + CreateAppResourceDatabase, + CreateAppResourceExperiment, + CreateAppResourceGenieSpace, + CreateAppResourceJob, + CreateAppResourcePostgres, + CreateAppResourceSecret, + CreateAppResourceServingEndpoint, + CreateAppResourceSqlWarehouse, + CreateAppResourceUcSecurable, + CreateAppThumbnail, + CreateCustomTemplate, CreateCustomTemplateRequest, + CreateEnvVar, + CreateGitRepository, + CreateGitSource, + CreateSpace, CreateSpaceRequest, + CreateTelemetryExportDestination, + CreateUnityCatalog, CustomTemplate, DeleteAppRequest, DeleteAppThumbnailRequest, @@ -112,10 +141,26 @@ export type { StopAppRequest, TelemetryExportDestination, UnityCatalog, + UpdateApp, UpdateAppRequest, + UpdateAppResource, + UpdateAppResourceApp, + UpdateAppResourceDatabase, + UpdateAppResourceExperiment, + UpdateAppResourceGenieSpace, + UpdateAppResourceJob, + UpdateAppResourcePostgres, + UpdateAppResourceSecret, + UpdateAppResourceServingEndpoint, + UpdateAppResourceSqlWarehouse, + UpdateAppResourceUcSecurable, UpdateAppThumbnailRequest, UpdateCustomTemplateRequest, + UpdateGitRepository, + UpdateSpace, UpdateSpaceRequest, + UpdateTelemetryExportDestination, + UpdateUnityCatalog, } from './model'; -export {appFieldMask, spaceFieldMask} from './model'; +export {updateAppFieldMask, updateSpaceFieldMask} from './model'; diff --git a/packages/apps/src/v1/model.ts b/packages/apps/src/v1/model.ts index c705d9db..9803ab49 100755 --- a/packages/apps/src/v1/model.ts +++ b/packages/apps/src/v1/model.ts @@ -1024,6 +1024,70 @@ export interface AppManifest_AppResourceUcSecurableSpec { | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface AppManifest_CreateAppResourceExperimentSpec { + permission: AppManifest_AppResourceExperimentSpec_ExperimentPermission; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface AppManifest_CreateAppResourceJobSpec { + /** Permissions to grant on the Job. Supported permissions are: "CAN_MANAGE", "IS_OWNER", "CAN_MANAGE_RUN", "CAN_VIEW". */ + permission: AppManifest_AppResourceJobSpec_JobPermission; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface AppManifest_CreateAppResourceSecretSpec { + /** Permission to grant on the secret scope. For secrets, only one permission is allowed. Permission must be one of: "READ", "WRITE", "MANAGE". */ + permission: AppManifest_AppResourceSecretSpec_SecretPermission; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface AppManifest_CreateAppResourceServingEndpointSpec { + /** Permission to grant on the serving endpoint. Supported permissions are: "CAN_MANAGE", "CAN_QUERY", "CAN_VIEW". */ + permission: AppManifest_AppResourceServingEndpointSpec_ServingEndpointPermission; +} + +/** AppResource related fields are copied from app.proto but excludes resource identifiers (e.g. name, id, key, scope, etc.) */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface AppManifest_CreateAppResourceSpec { + /** Name of the App Resource. */ + name: string; + /** Description of the App Resource. */ + description?: string | undefined; + resource?: + | {$case: 'secretSpec'; secretSpec: AppManifest_CreateAppResourceSecretSpec} + | { + $case: 'sqlWarehouseSpec'; + sqlWarehouseSpec: AppManifest_CreateAppResourceSqlWarehouseSpec; + } + | { + $case: 'servingEndpointSpec'; + servingEndpointSpec: AppManifest_CreateAppResourceServingEndpointSpec; + } + | {$case: 'jobSpec'; jobSpec: AppManifest_CreateAppResourceJobSpec} + | { + $case: 'ucSecurableSpec'; + ucSecurableSpec: AppManifest_CreateAppResourceUcSecurableSpec; + } + | { + $case: 'experimentSpec'; + experimentSpec: AppManifest_CreateAppResourceExperimentSpec; + } + | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface AppManifest_CreateAppResourceSqlWarehouseSpec { + /** Permission to grant on the SQL warehouse. Supported permissions are: "CAN_MANAGE", "CAN_USE", "IS_OWNER". */ + permission: AppManifest_AppResourceSqlWarehouseSpec_SqlWarehousePermission; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface AppManifest_CreateAppResourceUcSecurableSpec { + securableType: AppManifest_AppResourceUcSecurableSpec_UcSecurableType; + permission: AppManifest_AppResourceUcSecurableSpec_UcSecurablePermission; +} + export interface AppResource { /** Name of the App Resource. */ name?: string | undefined; @@ -1149,8 +1213,8 @@ export interface ApplicationStatus { } export interface AsyncUpdateAppRequest { - app?: App | undefined; - updateMask?: FieldMask | undefined; + app?: UpdateApp | undefined; + updateMask?: FieldMask | undefined; appName?: string | undefined; } @@ -1167,25 +1231,283 @@ export interface ComputeStatus { activeInstances?: number | undefined; } +export interface CreateApp { + /** + * The name of the app. The name must contain only lowercase alphanumeric characters and hyphens. + * It must be unique within the workspace. + */ + name?: string | undefined; + /** The description of the app. */ + description?: string | undefined; + /** Resources for the app. */ + resources?: CreateAppResource[] | undefined; + budgetPolicyId?: string | undefined; + userApiScopes?: string[] | undefined; + computeSize?: ComputeSize | undefined; + usagePolicyId?: string | undefined; + /** Minimum number of app instances. Must be set together with `compute_max_instances`. */ + computeMinInstances?: number | undefined; + /** Maximum number of app instances. Must be set together with `compute_min_instances`. */ + computeMaxInstances?: number | undefined; + /** + * Git repository configuration for app deployments. When specified, deployments can + * reference code from this repository by providing only the git reference (branch, tag, or commit). + */ + gitRepository?: CreateGitRepository | undefined; + telemetryExportDestinations?: CreateTelemetryExportDestination[] | undefined; + /** Name of the space this app belongs to. */ + space?: string | undefined; +} + +export interface CreateAppDeployment { + /** The unique id of the deployment. */ + deploymentId?: string | undefined; + /** + * The workspace file system path of the source code used to create the app deployment. This is different from + * `deployment_artifacts.source_code_path`, which is the path used by the deployed app. The former refers + * to the original source code location of the app in the workspace during deployment creation, whereas + * the latter provides a system generated stable snapshotted source code path used by the deployment. + */ + sourceCodePath?: string | undefined; + /** Git repository to use as the source for the app deployment. */ + gitSource?: CreateGitSource | undefined; + /** The mode of which the deployment will manage the source code. */ + mode?: AppDeployment_Mode | undefined; + /** The command with which to run the app. This will override the command specified in the app.yaml file. */ + command?: string[] | undefined; + /** The environment variables to set in the app runtime environment. This will override the environment variables specified in the app.yaml file. */ + envVars?: CreateEnvVar[] | undefined; +} + export interface CreateAppDeploymentRequest { /** The name of the app. */ appName?: string | undefined; /** The app deployment configuration. */ - appDeployment?: AppDeployment | undefined; + appDeployment?: CreateAppDeployment | undefined; +} + +/** App manifest definition */ +export interface CreateAppManifest { + /** The manifest schema version, for now only 1 is allowed */ + version: number; + /** Name of the app defined by manifest author / publisher */ + name: string; + /** Description of the app defined by manifest author / publisher */ + description?: string | undefined; + resourceSpecs?: AppManifest_CreateAppResourceSpec[] | undefined; } export interface CreateAppRequest { - app?: App | undefined; + app?: CreateApp | undefined; /** If true, the app will not be started after creation. */ noCompute?: boolean | undefined; } +export interface CreateAppResource { + /** Name of the App Resource. */ + name: string; + /** Description of the App Resource. */ + description?: string | undefined; + resource?: + | {$case: 'secret'; secret: CreateAppResourceSecret} + | {$case: 'sqlWarehouse'; sqlWarehouse: CreateAppResourceSqlWarehouse} + | { + $case: 'servingEndpoint'; + servingEndpoint: CreateAppResourceServingEndpoint; + } + | {$case: 'job'; job: CreateAppResourceJob} + | {$case: 'ucSecurable'; ucSecurable: CreateAppResourceUcSecurable} + | {$case: 'database'; database: CreateAppResourceDatabase} + | {$case: 'genieSpace'; genieSpace: CreateAppResourceGenieSpace} + | {$case: 'experiment'; experiment: CreateAppResourceExperiment} + | {$case: 'app'; app: CreateAppResourceApp} + | {$case: 'postgres'; postgres: CreateAppResourcePostgres} + | undefined; +} + +export interface CreateAppResourceApp { + name?: string | undefined; + permission?: AppResourceApp_AppPermission | undefined; +} + +export interface CreateAppResourceDatabase { + instanceName: string; + databaseName: string; + permission: AppResourceDatabase_DatabasePermission; +} + +export interface CreateAppResourceExperiment { + experimentId: string; + permission: AppResourceExperiment_ExperimentPermission; +} + +export interface CreateAppResourceGenieSpace { + name: string; + spaceId: string; + permission: AppResourceGenieSpace_GenieSpacePermission; +} + +export interface CreateAppResourceJob { + /** Id of the job to grant permission on. */ + id: string; + /** Permissions to grant on the Job. Supported permissions are: "CAN_MANAGE", "IS_OWNER", "CAN_MANAGE_RUN", "CAN_VIEW". */ + permission: AppResourceJob_JobPermission; +} + +export interface CreateAppResourcePostgres { + branch?: string | undefined; + database?: string | undefined; + permission?: AppResourcePostgres_PostgresPermission | undefined; +} + +export interface CreateAppResourceSecret { + /** Scope of the secret to grant permission on. */ + scope: string; + /** Key of the secret to grant permission on. */ + key: string; + /** Permission to grant on the secret scope. For secrets, only one permission is allowed. Permission must be one of: "READ", "WRITE", "MANAGE". */ + permission: AppResourceSecret_SecretPermission; +} + +export interface CreateAppResourceServingEndpoint { + /** Name of the serving endpoint to grant permission on. */ + name: string; + /** Permission to grant on the serving endpoint. Supported permissions are: "CAN_MANAGE", "CAN_QUERY", "CAN_VIEW". */ + permission: AppResourceServingEndpoint_ServingEndpointPermission; +} + +export interface CreateAppResourceSqlWarehouse { + /** Id of the SQL warehouse to grant permission on. */ + id: string; + /** Permission to grant on the SQL warehouse. Supported permissions are: "CAN_MANAGE", "CAN_USE", "IS_OWNER". */ + permission: AppResourceSqlWarehouse_SqlWarehousePermission; +} + +export interface CreateAppResourceUcSecurable { + securableFullName: string; + securableType: AppResourceUcSecurable_UcSecurableType; + permission: AppResourceUcSecurable_UcSecurablePermission; +} + +/** The thumbnail for an app. */ +export interface CreateAppThumbnail { + /** The thumbnail image bytes. */ + thumbnail?: Uint8Array | undefined; +} + +export interface CreateCustomTemplate { + /** + * The name of the template. It must contain only alphanumeric characters, hyphens, underscores, and whitespaces. + * It must be unique within the workspace. + */ + name?: string | undefined; + /** The description of the template. */ + description?: string | undefined; + /** The Git repository URL that the template resides in. */ + gitRepo: string; + /** The path to the template within the Git repository. */ + path: string; + /** The manifest of the template. It defines fields and default values when installing the template. */ + manifest: CreateAppManifest; + /** The Git provider of the template. */ + gitProvider: string; +} + export interface CreateCustomTemplateRequest { - template?: CustomTemplate | undefined; + template?: CreateCustomTemplate | undefined; +} + +export interface CreateEnvVar { + /** The name of the environment variable. */ + name?: string | undefined; + source?: + | { + $case: 'value'; + /** The value for the environment variable. */ + value: string; + } + | { + $case: 'valueFrom'; + /** The name of an external resource that contains the value, such as a secret or a database table. */ + valueFrom: string; + } + | undefined; +} + +/** Git repository configuration specifying the location of the repository. */ +export interface CreateGitRepository { + /** URL of the Git repository. */ + url: string; + /** + * Git provider. Case insensitive. Supported values: gitHub, gitHubEnterprise, bitbucketCloud, + * bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit. + */ + provider: string; +} + +/** Complete git source specification including repository location and reference. */ +export interface CreateGitSource { + /** Git reference to checkout. Mutually exclusive: branch, tag, or commit. */ + reference?: + | { + $case: 'branch'; + /** Git branch to checkout. */ + branch: string; + } + | { + $case: 'tag'; + /** Git tag to checkout. */ + tag: string; + } + | { + $case: 'commit'; + /** Git commit SHA to checkout. */ + commit: string; + } + | undefined; + /** + * Relative path to the app source code within the Git repository. If not specified, the root + * of the repository is used. + */ + sourceCodePath?: string | undefined; +} + +export interface CreateSpace { + /** + * The name of the app space. The name must contain only lowercase alphanumeric characters and hyphens. + * It must be unique within the workspace. + */ + name?: string | undefined; + /** The description of the app space. */ + description?: string | undefined; + /** Resources for the app space. Resources configured at the space level are available to all apps in the space. */ + resources?: CreateAppResource[] | undefined; + /** OAuth scopes for apps in the space. */ + userApiScopes?: string[] | undefined; + /** The usage policy ID for managing cost at the space level. */ + usagePolicyId?: string | undefined; } export interface CreateSpaceRequest { - space?: Space | undefined; + space?: CreateSpace | undefined; +} + +/** A single telemetry export destination with its configuration and status. */ +export interface CreateTelemetryExportDestination { + /** Destination type and configuration (writable). */ + destination?: + | {$case: 'unityCatalog'; unityCatalog: CreateUnityCatalog} + | undefined; +} + +/** Unity Catalog Destinations for OTEL telemetry export. */ +export interface CreateUnityCatalog { + /** Unity Catalog table for OTEL logs. */ + logsTable: string; + /** Unity Catalog table for OTEL metrics. */ + metricsTable: string; + /** Unity Catalog table for OTEL traces (spans). */ + tracesTable: string; } export interface CustomTemplate { @@ -1511,24 +1833,183 @@ export interface UnityCatalog { tracesTable?: string | undefined; } -export interface UpdateAppRequest { - app?: App | undefined; -} - -export interface UpdateAppThumbnailRequest { - /** The name of the app. */ +export interface UpdateApp { + /** + * The name of the app. The name must contain only lowercase alphanumeric characters and hyphens. + * It must be unique within the workspace. + */ name?: string | undefined; - /** The app thumbnail to set. */ - appThumbnail?: AppThumbnail | undefined; + /** The description of the app. */ + description?: string | undefined; + /** Resources for the app. */ + resources?: UpdateAppResource[] | undefined; + budgetPolicyId?: string | undefined; + userApiScopes?: string[] | undefined; + computeSize?: ComputeSize | undefined; + usagePolicyId?: string | undefined; + /** Minimum number of app instances. Must be set together with `compute_max_instances`. */ + computeMinInstances?: number | undefined; + /** Maximum number of app instances. Must be set together with `compute_min_instances`. */ + computeMaxInstances?: number | undefined; + /** + * Git repository configuration for app deployments. When specified, deployments can + * reference code from this repository by providing only the git reference (branch, tag, or commit). + */ + gitRepository?: UpdateGitRepository | undefined; + telemetryExportDestinations?: UpdateTelemetryExportDestination[] | undefined; + /** Name of the space this app belongs to. */ + space?: string | undefined; } -export interface UpdateCustomTemplateRequest { - template?: CustomTemplate | undefined; +export interface UpdateAppRequest { + app?: CreateApp | undefined; +} + +export interface UpdateAppResource { + /** Name of the App Resource. */ + name?: string | undefined; + /** Description of the App Resource. */ + description?: string | undefined; + resource?: + | {$case: 'secret'; secret: UpdateAppResourceSecret} + | {$case: 'sqlWarehouse'; sqlWarehouse: UpdateAppResourceSqlWarehouse} + | { + $case: 'servingEndpoint'; + servingEndpoint: UpdateAppResourceServingEndpoint; + } + | {$case: 'job'; job: UpdateAppResourceJob} + | {$case: 'ucSecurable'; ucSecurable: UpdateAppResourceUcSecurable} + | {$case: 'database'; database: UpdateAppResourceDatabase} + | {$case: 'genieSpace'; genieSpace: UpdateAppResourceGenieSpace} + | {$case: 'experiment'; experiment: UpdateAppResourceExperiment} + | {$case: 'app'; app: UpdateAppResourceApp} + | {$case: 'postgres'; postgres: UpdateAppResourcePostgres} + | undefined; +} + +export interface UpdateAppResourceApp { + name?: string | undefined; + permission?: AppResourceApp_AppPermission | undefined; +} + +export interface UpdateAppResourceDatabase { + instanceName?: string | undefined; + databaseName?: string | undefined; + permission?: AppResourceDatabase_DatabasePermission | undefined; +} + +export interface UpdateAppResourceExperiment { + experimentId?: string | undefined; + permission?: AppResourceExperiment_ExperimentPermission | undefined; +} + +export interface UpdateAppResourceGenieSpace { + name?: string | undefined; + spaceId?: string | undefined; + permission?: AppResourceGenieSpace_GenieSpacePermission | undefined; +} + +export interface UpdateAppResourceJob { + /** Id of the job to grant permission on. */ + id?: string | undefined; + /** Permissions to grant on the Job. Supported permissions are: "CAN_MANAGE", "IS_OWNER", "CAN_MANAGE_RUN", "CAN_VIEW". */ + permission?: AppResourceJob_JobPermission | undefined; +} + +export interface UpdateAppResourcePostgres { + branch?: string | undefined; + database?: string | undefined; + permission?: AppResourcePostgres_PostgresPermission | undefined; +} + +export interface UpdateAppResourceSecret { + /** Scope of the secret to grant permission on. */ + scope?: string | undefined; + /** Key of the secret to grant permission on. */ + key?: string | undefined; + /** Permission to grant on the secret scope. For secrets, only one permission is allowed. Permission must be one of: "READ", "WRITE", "MANAGE". */ + permission?: AppResourceSecret_SecretPermission | undefined; +} + +export interface UpdateAppResourceServingEndpoint { + /** Name of the serving endpoint to grant permission on. */ + name?: string | undefined; + /** Permission to grant on the serving endpoint. Supported permissions are: "CAN_MANAGE", "CAN_QUERY", "CAN_VIEW". */ + permission?: AppResourceServingEndpoint_ServingEndpointPermission | undefined; +} + +export interface UpdateAppResourceSqlWarehouse { + /** Id of the SQL warehouse to grant permission on. */ + id?: string | undefined; + /** Permission to grant on the SQL warehouse. Supported permissions are: "CAN_MANAGE", "CAN_USE", "IS_OWNER". */ + permission?: AppResourceSqlWarehouse_SqlWarehousePermission | undefined; +} + +export interface UpdateAppResourceUcSecurable { + securableFullName?: string | undefined; + securableType?: AppResourceUcSecurable_UcSecurableType | undefined; + permission?: AppResourceUcSecurable_UcSecurablePermission | undefined; +} + +export interface UpdateAppThumbnailRequest { + /** The name of the app. */ + name?: string | undefined; + /** The app thumbnail to set. */ + appThumbnail?: CreateAppThumbnail | undefined; +} + +export interface UpdateCustomTemplateRequest { + template?: CreateCustomTemplate | undefined; +} + +/** Git repository configuration specifying the location of the repository. */ +export interface UpdateGitRepository { + /** URL of the Git repository. */ + url?: string | undefined; + /** + * Git provider. Case insensitive. Supported values: gitHub, gitHubEnterprise, bitbucketCloud, + * bitbucketServer, azureDevOpsServices, gitLab, gitLabEnterpriseEdition, awsCodeCommit. + */ + provider?: string | undefined; +} + +export interface UpdateSpace { + /** + * The name of the app space. The name must contain only lowercase alphanumeric characters and hyphens. + * It must be unique within the workspace. + */ + name?: string | undefined; + /** The description of the app space. */ + description?: string | undefined; + /** Resources for the app space. Resources configured at the space level are available to all apps in the space. */ + resources?: UpdateAppResource[] | undefined; + /** OAuth scopes for apps in the space. */ + userApiScopes?: string[] | undefined; + /** The usage policy ID for managing cost at the space level. */ + usagePolicyId?: string | undefined; } export interface UpdateSpaceRequest { - space?: Space | undefined; - updateMask?: FieldMask | undefined; + space?: UpdateSpace | undefined; + updateMask?: FieldMask | undefined; +} + +/** A single telemetry export destination with its configuration and status. */ +export interface UpdateTelemetryExportDestination { + /** Destination type and configuration (writable). */ + destination?: + | {$case: 'unityCatalog'; unityCatalog: UpdateUnityCatalog} + | undefined; +} + +/** Unity Catalog Destinations for OTEL telemetry export. */ +export interface UpdateUnityCatalog { + /** Unity Catalog table for OTEL logs. */ + logsTable?: string | undefined; + /** Unity Catalog table for OTEL metrics. */ + metricsTable?: string | undefined; + /** Unity Catalog table for OTEL traces (spans). */ + tracesTable?: string | undefined; } export const unmarshalApiErrorSchema: z.ZodType = z @@ -2302,230 +2783,85 @@ export const unmarshalUnityCatalogSchema: z.ZodType = z tracesTable: d.traces_table, })); -export const marshalAppSchema: z.ZodType = z - .object({ - name: z.string().optional(), - description: z.string().optional(), - computeStatus: z.lazy(() => marshalComputeStatusSchema).optional(), - appStatus: z.lazy(() => marshalApplicationStatusSchema).optional(), - url: z.string().optional(), - activeDeployment: z.lazy(() => marshalAppDeploymentSchema).optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - creator: z.string().optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updater: z.string().optional(), - pendingDeployment: z.lazy(() => marshalAppDeploymentSchema).optional(), - resources: z.array(z.lazy(() => marshalAppResourceSchema)).optional(), - servicePrincipalId: z.bigint().optional(), - servicePrincipalName: z.string().optional(), - defaultSourceCodePath: z.string().optional(), - budgetPolicyId: z.string().optional(), - effectiveBudgetPolicyId: z.string().optional(), - servicePrincipalClientId: z.string().optional(), - userApiScopes: z.array(z.string()).optional(), - id: z.string().optional(), - effectiveUserApiScopes: z.array(z.string()).optional(), - oauth2AppIntegrationId: z.string().optional(), - oauth2AppClientId: z.string().optional(), - computeSize: z.string().optional(), - usagePolicyId: z.string().optional(), - effectiveUsagePolicyId: z.string().optional(), - computeMinInstances: z.number().optional(), - computeMaxInstances: z.number().optional(), - gitRepository: z.lazy(() => marshalGitRepositorySchema).optional(), - telemetryExportDestinations: z - .array(z.lazy(() => marshalTelemetryExportDestinationSchema)) - .optional(), - thumbnailUrl: z.string().optional(), - space: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - description: d.description, - compute_status: d.computeStatus, - app_status: d.appStatus, - url: d.url, - active_deployment: d.activeDeployment, - create_time: d.createTime, - creator: d.creator, - update_time: d.updateTime, - updater: d.updater, - pending_deployment: d.pendingDeployment, - resources: d.resources, - service_principal_id: d.servicePrincipalId, - service_principal_name: d.servicePrincipalName, - default_source_code_path: d.defaultSourceCodePath, - budget_policy_id: d.budgetPolicyId, - effective_budget_policy_id: d.effectiveBudgetPolicyId, - service_principal_client_id: d.servicePrincipalClientId, - user_api_scopes: d.userApiScopes, - id: d.id, - effective_user_api_scopes: d.effectiveUserApiScopes, - oauth2_app_integration_id: d.oauth2AppIntegrationId, - oauth2_app_client_id: d.oauth2AppClientId, - compute_size: d.computeSize, - usage_policy_id: d.usagePolicyId, - effective_usage_policy_id: d.effectiveUsagePolicyId, - compute_min_instances: d.computeMinInstances, - compute_max_instances: d.computeMaxInstances, - git_repository: d.gitRepository, - telemetry_export_destinations: d.telemetryExportDestinations, - thumbnail_url: d.thumbnailUrl, - space: d.space, - })); - -export const marshalAppDeploymentSchema: z.ZodType = z - .object({ - deploymentId: z.string().optional(), - sourceCodePath: z.string().optional(), - gitSource: z.lazy(() => marshalGitSourceSchema).optional(), - mode: z.string().optional(), - deploymentArtifacts: z - .lazy(() => marshalAppDeploymentArtifactsSchema) - .optional(), - status: z.lazy(() => marshalAppDeploymentStatusSchema).optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - creator: z.string().optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - command: z.array(z.string()).optional(), - envVars: z.array(z.lazy(() => marshalEnvVarSchema)).optional(), - }) - .transform(d => ({ - deployment_id: d.deploymentId, - source_code_path: d.sourceCodePath, - git_source: d.gitSource, - mode: d.mode, - deployment_artifacts: d.deploymentArtifacts, - status: d.status, - create_time: d.createTime, - creator: d.creator, - update_time: d.updateTime, - command: d.command, - env_vars: d.envVars, - })); - -export const marshalAppDeploymentArtifactsSchema: z.ZodType = z - .object({ - sourceCodePath: z.string().optional(), - }) - .transform(d => ({ - source_code_path: d.sourceCodePath, - })); - -export const marshalAppDeploymentStatusSchema: z.ZodType = z - .object({ - state: z.string().optional(), - message: z.string().optional(), - }) - .transform(d => ({ - state: d.state, - message: d.message, - })); - -export const marshalAppManifestSchema: z.ZodType = z - .object({ - version: z.number().optional(), - name: z.string().optional(), - description: z.string().optional(), - resourceSpecs: z - .array(z.lazy(() => marshalAppManifest_AppResourceSpecSchema)) - .optional(), - }) - .transform(d => ({ - version: d.version, - name: d.name, - description: d.description, - resource_specs: d.resourceSpecs, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalAppManifest_AppResourceExperimentSpecSchema: z.ZodType = z - .object({ - permission: z.string().optional(), - }) - .transform(d => ({ - permission: d.permission, - })); +export const marshalAppManifest_CreateAppResourceExperimentSpecSchema: z.ZodType = + z + .object({ + permission: z.string(), + }) + .transform(d => ({ + permission: d.permission, + })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalAppManifest_AppResourceJobSpecSchema: z.ZodType = z +export const marshalAppManifest_CreateAppResourceJobSpecSchema: z.ZodType = z .object({ - permission: z.string().optional(), + permission: z.string(), }) .transform(d => ({ permission: d.permission, })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalAppManifest_AppResourceSecretSpecSchema: z.ZodType = z +export const marshalAppManifest_CreateAppResourceSecretSpecSchema: z.ZodType = z .object({ - permission: z.string().optional(), + permission: z.string(), }) .transform(d => ({ permission: d.permission, })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalAppManifest_AppResourceServingEndpointSpecSchema: z.ZodType = +export const marshalAppManifest_CreateAppResourceServingEndpointSpecSchema: z.ZodType = z .object({ - permission: z.string().optional(), + permission: z.string(), }) .transform(d => ({ permission: d.permission, })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalAppManifest_AppResourceSpecSchema: z.ZodType = z +export const marshalAppManifest_CreateAppResourceSpecSchema: z.ZodType = z .object({ - name: z.string().optional(), + name: z.string(), description: z.string().optional(), resource: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('secretSpec'), secretSpec: z.lazy( - () => marshalAppManifest_AppResourceSecretSpecSchema + () => marshalAppManifest_CreateAppResourceSecretSpecSchema ), }), z.object({ $case: z.literal('sqlWarehouseSpec'), sqlWarehouseSpec: z.lazy( - () => marshalAppManifest_AppResourceSqlWarehouseSpecSchema + () => marshalAppManifest_CreateAppResourceSqlWarehouseSpecSchema ), }), z.object({ $case: z.literal('servingEndpointSpec'), servingEndpointSpec: z.lazy( - () => marshalAppManifest_AppResourceServingEndpointSpecSchema + () => marshalAppManifest_CreateAppResourceServingEndpointSpecSchema ), }), z.object({ $case: z.literal('jobSpec'), - jobSpec: z.lazy(() => marshalAppManifest_AppResourceJobSpecSchema), + jobSpec: z.lazy( + () => marshalAppManifest_CreateAppResourceJobSpecSchema + ), }), z.object({ $case: z.literal('ucSecurableSpec'), ucSecurableSpec: z.lazy( - () => marshalAppManifest_AppResourceUcSecurableSpecSchema + () => marshalAppManifest_CreateAppResourceUcSecurableSpecSchema ), }), z.object({ $case: z.literal('experimentSpec'), experimentSpec: z.lazy( - () => marshalAppManifest_AppResourceExperimentSpecSchema + () => marshalAppManifest_CreateAppResourceExperimentSpecSchema ), }), ]) @@ -2553,72 +2889,157 @@ export const marshalAppManifest_AppResourceSpecSchema: z.ZodType = z })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalAppManifest_AppResourceSqlWarehouseSpecSchema: z.ZodType = z - .object({ - permission: z.string().optional(), - }) - .transform(d => ({ - permission: d.permission, - })); +export const marshalAppManifest_CreateAppResourceSqlWarehouseSpecSchema: z.ZodType = + z + .object({ + permission: z.string(), + }) + .transform(d => ({ + permission: d.permission, + })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalAppManifest_AppResourceUcSecurableSpecSchema: z.ZodType = z +export const marshalAppManifest_CreateAppResourceUcSecurableSpecSchema: z.ZodType = + z + .object({ + securableType: z.string(), + permission: z.string(), + }) + .transform(d => ({ + securable_type: d.securableType, + permission: d.permission, + })); + +export const marshalAsyncUpdateAppRequestSchema: z.ZodType = z .object({ - securableType: z.string().optional(), - permission: z.string().optional(), + app: z.lazy(() => marshalUpdateAppSchema).optional(), + updateMask: z + .any() + .transform((m: FieldMask) => m.toString()) + .optional(), + appName: z.string().optional(), }) .transform(d => ({ - securable_type: d.securableType, - permission: d.permission, + app: d.app, + update_mask: d.updateMask, + app_name: d.appName, })); -export const marshalAppResourceSchema: z.ZodType = z +export const marshalCreateAppSchema: z.ZodType = z .object({ name: z.string().optional(), description: z.string().optional(), - resource: z - .discriminatedUnion('$case', [ - z.object({ + resources: z.array(z.lazy(() => marshalCreateAppResourceSchema)).optional(), + budgetPolicyId: z.string().optional(), + userApiScopes: z.array(z.string()).optional(), + computeSize: z.string().optional(), + usagePolicyId: z.string().optional(), + computeMinInstances: z.number().optional(), + computeMaxInstances: z.number().optional(), + gitRepository: z.lazy(() => marshalCreateGitRepositorySchema).optional(), + telemetryExportDestinations: z + .array(z.lazy(() => marshalCreateTelemetryExportDestinationSchema)) + .optional(), + space: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + description: d.description, + resources: d.resources, + budget_policy_id: d.budgetPolicyId, + user_api_scopes: d.userApiScopes, + compute_size: d.computeSize, + usage_policy_id: d.usagePolicyId, + compute_min_instances: d.computeMinInstances, + compute_max_instances: d.computeMaxInstances, + git_repository: d.gitRepository, + telemetry_export_destinations: d.telemetryExportDestinations, + space: d.space, + })); + +export const marshalCreateAppDeploymentSchema: z.ZodType = z + .object({ + deploymentId: z.string().optional(), + sourceCodePath: z.string().optional(), + gitSource: z.lazy(() => marshalCreateGitSourceSchema).optional(), + mode: z.string().optional(), + command: z.array(z.string()).optional(), + envVars: z.array(z.lazy(() => marshalCreateEnvVarSchema)).optional(), + }) + .transform(d => ({ + deployment_id: d.deploymentId, + source_code_path: d.sourceCodePath, + git_source: d.gitSource, + mode: d.mode, + command: d.command, + env_vars: d.envVars, + })); + +export const marshalCreateAppManifestSchema: z.ZodType = z + .object({ + version: z.number(), + name: z.string(), + description: z.string().optional(), + resourceSpecs: z + .array(z.lazy(() => marshalAppManifest_CreateAppResourceSpecSchema)) + .optional(), + }) + .transform(d => ({ + version: d.version, + name: d.name, + description: d.description, + resource_specs: d.resourceSpecs, + })); + +export const marshalCreateAppResourceSchema: z.ZodType = z + .object({ + name: z.string(), + description: z.string().optional(), + resource: z + .discriminatedUnion('$case', [ + z.object({ $case: z.literal('secret'), - secret: z.lazy(() => marshalAppResourceSecretSchema), + secret: z.lazy(() => marshalCreateAppResourceSecretSchema), }), z.object({ $case: z.literal('sqlWarehouse'), - sqlWarehouse: z.lazy(() => marshalAppResourceSqlWarehouseSchema), + sqlWarehouse: z.lazy( + () => marshalCreateAppResourceSqlWarehouseSchema + ), }), z.object({ $case: z.literal('servingEndpoint'), servingEndpoint: z.lazy( - () => marshalAppResourceServingEndpointSchema + () => marshalCreateAppResourceServingEndpointSchema ), }), z.object({ $case: z.literal('job'), - job: z.lazy(() => marshalAppResourceJobSchema), + job: z.lazy(() => marshalCreateAppResourceJobSchema), }), z.object({ $case: z.literal('ucSecurable'), - ucSecurable: z.lazy(() => marshalAppResourceUcSecurableSchema), + ucSecurable: z.lazy(() => marshalCreateAppResourceUcSecurableSchema), }), z.object({ $case: z.literal('database'), - database: z.lazy(() => marshalAppResourceDatabaseSchema), + database: z.lazy(() => marshalCreateAppResourceDatabaseSchema), }), z.object({ $case: z.literal('genieSpace'), - genieSpace: z.lazy(() => marshalAppResourceGenieSpaceSchema), + genieSpace: z.lazy(() => marshalCreateAppResourceGenieSpaceSchema), }), z.object({ $case: z.literal('experiment'), - experiment: z.lazy(() => marshalAppResourceExperimentSchema), + experiment: z.lazy(() => marshalCreateAppResourceExperimentSchema), }), z.object({ $case: z.literal('app'), - app: z.lazy(() => marshalAppResourceAppSchema), + app: z.lazy(() => marshalCreateAppResourceAppSchema), }), z.object({ $case: z.literal('postgres'), - postgres: z.lazy(() => marshalAppResourcePostgresSchema), + postgres: z.lazy(() => marshalCreateAppResourcePostgresSchema), }), ]) .optional(), @@ -2648,7 +3069,7 @@ export const marshalAppResourceSchema: z.ZodType = z ...(d.resource?.$case === 'postgres' && {postgres: d.resource.postgres}), })); -export const marshalAppResourceAppSchema: z.ZodType = z +export const marshalCreateAppResourceAppSchema: z.ZodType = z .object({ name: z.string().optional(), permission: z.string().optional(), @@ -2658,11 +3079,11 @@ export const marshalAppResourceAppSchema: z.ZodType = z permission: d.permission, })); -export const marshalAppResourceDatabaseSchema: z.ZodType = z +export const marshalCreateAppResourceDatabaseSchema: z.ZodType = z .object({ - instanceName: z.string().optional(), - databaseName: z.string().optional(), - permission: z.string().optional(), + instanceName: z.string(), + databaseName: z.string(), + permission: z.string(), }) .transform(d => ({ instance_name: d.instanceName, @@ -2670,21 +3091,21 @@ export const marshalAppResourceDatabaseSchema: z.ZodType = z permission: d.permission, })); -export const marshalAppResourceExperimentSchema: z.ZodType = z +export const marshalCreateAppResourceExperimentSchema: z.ZodType = z .object({ - experimentId: z.string().optional(), - permission: z.string().optional(), + experimentId: z.string(), + permission: z.string(), }) .transform(d => ({ experiment_id: d.experimentId, permission: d.permission, })); -export const marshalAppResourceGenieSpaceSchema: z.ZodType = z +export const marshalCreateAppResourceGenieSpaceSchema: z.ZodType = z .object({ - name: z.string().optional(), - spaceId: z.string().optional(), - permission: z.string().optional(), + name: z.string(), + spaceId: z.string(), + permission: z.string(), }) .transform(d => ({ name: d.name, @@ -2692,17 +3113,17 @@ export const marshalAppResourceGenieSpaceSchema: z.ZodType = z permission: d.permission, })); -export const marshalAppResourceJobSchema: z.ZodType = z +export const marshalCreateAppResourceJobSchema: z.ZodType = z .object({ - id: z.string().optional(), - permission: z.string().optional(), + id: z.string(), + permission: z.string(), }) .transform(d => ({ id: d.id, permission: d.permission, })); -export const marshalAppResourcePostgresSchema: z.ZodType = z +export const marshalCreateAppResourcePostgresSchema: z.ZodType = z .object({ branch: z.string().optional(), database: z.string().optional(), @@ -2714,11 +3135,11 @@ export const marshalAppResourcePostgresSchema: z.ZodType = z permission: d.permission, })); -export const marshalAppResourceSecretSchema: z.ZodType = z +export const marshalCreateAppResourceSecretSchema: z.ZodType = z .object({ - scope: z.string().optional(), - key: z.string().optional(), - permission: z.string().optional(), + scope: z.string(), + key: z.string(), + permission: z.string(), }) .transform(d => ({ scope: d.scope, @@ -2726,41 +3147,39 @@ export const marshalAppResourceSecretSchema: z.ZodType = z permission: d.permission, })); -export const marshalAppResourceServingEndpointSchema: z.ZodType = z +export const marshalCreateAppResourceServingEndpointSchema: z.ZodType = z .object({ - name: z.string().optional(), - permission: z.string().optional(), + name: z.string(), + permission: z.string(), }) .transform(d => ({ name: d.name, permission: d.permission, })); -export const marshalAppResourceSqlWarehouseSchema: z.ZodType = z +export const marshalCreateAppResourceSqlWarehouseSchema: z.ZodType = z .object({ - id: z.string().optional(), - permission: z.string().optional(), + id: z.string(), + permission: z.string(), }) .transform(d => ({ id: d.id, permission: d.permission, })); -export const marshalAppResourceUcSecurableSchema: z.ZodType = z +export const marshalCreateAppResourceUcSecurableSchema: z.ZodType = z .object({ - securableFullName: z.string().optional(), - securableType: z.string().optional(), - permission: z.string().optional(), - securableKind: z.string().optional(), + securableFullName: z.string(), + securableType: z.string(), + permission: z.string(), }) .transform(d => ({ securable_full_name: d.securableFullName, securable_type: d.securableType, permission: d.permission, - securable_kind: d.securableKind, })); -export const marshalAppThumbnailSchema: z.ZodType = z +export const marshalCreateAppThumbnailSchema: z.ZodType = z .object({ thumbnail: z .any() @@ -2773,54 +3192,14 @@ export const marshalAppThumbnailSchema: z.ZodType = z thumbnail: d.thumbnail, })); -export const marshalApplicationStatusSchema: z.ZodType = z - .object({ - state: z.string().optional(), - message: z.string().optional(), - runningInstances: z.number().optional(), - }) - .transform(d => ({ - state: d.state, - message: d.message, - running_instances: d.runningInstances, - })); - -export const marshalAsyncUpdateAppRequestSchema: z.ZodType = z - .object({ - app: z.lazy(() => marshalAppSchema).optional(), - updateMask: z - .any() - .transform((m: FieldMask) => m.toString()) - .optional(), - appName: z.string().optional(), - }) - .transform(d => ({ - app: d.app, - update_mask: d.updateMask, - app_name: d.appName, - })); - -export const marshalComputeStatusSchema: z.ZodType = z - .object({ - state: z.string().optional(), - message: z.string().optional(), - activeInstances: z.number().optional(), - }) - .transform(d => ({ - state: d.state, - message: d.message, - active_instances: d.activeInstances, - })); - -export const marshalCustomTemplateSchema: z.ZodType = z +export const marshalCreateCustomTemplateSchema: z.ZodType = z .object({ name: z.string().optional(), description: z.string().optional(), - gitRepo: z.string().optional(), - path: z.string().optional(), - manifest: z.lazy(() => marshalAppManifestSchema).optional(), - gitProvider: z.string().optional(), - creator: z.string().optional(), + gitRepo: z.string(), + path: z.string(), + manifest: z.lazy(() => marshalCreateAppManifestSchema), + gitProvider: z.string(), }) .transform(d => ({ name: d.name, @@ -2829,10 +3208,9 @@ export const marshalCustomTemplateSchema: z.ZodType = z path: d.path, manifest: d.manifest, git_provider: d.gitProvider, - creator: d.creator, })); -export const marshalEnvVarSchema: z.ZodType = z +export const marshalCreateEnvVarSchema: z.ZodType = z .object({ name: z.string().optional(), source: z @@ -2848,19 +3226,18 @@ export const marshalEnvVarSchema: z.ZodType = z ...(d.source?.$case === 'valueFrom' && {value_from: d.source.valueFrom}), })); -export const marshalGitRepositorySchema: z.ZodType = z +export const marshalCreateGitRepositorySchema: z.ZodType = z .object({ - url: z.string().optional(), - provider: z.string().optional(), + url: z.string(), + provider: z.string(), }) .transform(d => ({ url: d.url, provider: d.provider, })); -export const marshalGitSourceSchema: z.ZodType = z +export const marshalCreateGitSourceSchema: z.ZodType = z .object({ - gitRepository: z.lazy(() => marshalGitRepositorySchema).optional(), reference: z .discriminatedUnion('$case', [ z.object({$case: z.literal('branch'), branch: z.string()}), @@ -2869,69 +3246,57 @@ export const marshalGitSourceSchema: z.ZodType = z ]) .optional(), sourceCodePath: z.string().optional(), - resolvedCommit: z.string().optional(), }) .transform(d => ({ - git_repository: d.gitRepository, ...(d.reference?.$case === 'branch' && {branch: d.reference.branch}), ...(d.reference?.$case === 'tag' && {tag: d.reference.tag}), ...(d.reference?.$case === 'commit' && {commit: d.reference.commit}), source_code_path: d.sourceCodePath, - resolved_commit: d.resolvedCommit, })); -export const marshalSpaceSchema: z.ZodType = z +export const marshalCreateSpaceSchema: z.ZodType = z .object({ name: z.string().optional(), description: z.string().optional(), - status: z.lazy(() => marshalSpaceStatusSchema).optional(), - id: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - creator: z.string().optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updater: z.string().optional(), - resources: z.array(z.lazy(() => marshalAppResourceSchema)).optional(), + resources: z.array(z.lazy(() => marshalCreateAppResourceSchema)).optional(), userApiScopes: z.array(z.string()).optional(), - effectiveUserApiScopes: z.array(z.string()).optional(), - servicePrincipalId: z.bigint().optional(), - servicePrincipalName: z.string().optional(), - servicePrincipalClientId: z.string().optional(), usagePolicyId: z.string().optional(), - effectiveUsagePolicyId: z.string().optional(), }) .transform(d => ({ name: d.name, description: d.description, - status: d.status, - id: d.id, - create_time: d.createTime, - creator: d.creator, - update_time: d.updateTime, - updater: d.updater, resources: d.resources, user_api_scopes: d.userApiScopes, - effective_user_api_scopes: d.effectiveUserApiScopes, - service_principal_id: d.servicePrincipalId, - service_principal_name: d.servicePrincipalName, - service_principal_client_id: d.servicePrincipalClientId, usage_policy_id: d.usagePolicyId, - effective_usage_policy_id: d.effectiveUsagePolicyId, })); -export const marshalSpaceStatusSchema: z.ZodType = z +export const marshalCreateTelemetryExportDestinationSchema: z.ZodType = z .object({ - state: z.string().optional(), - message: z.string().optional(), + destination: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('unityCatalog'), + unityCatalog: z.lazy(() => marshalCreateUnityCatalogSchema), + }), + ]) + .optional(), }) .transform(d => ({ - state: d.state, - message: d.message, + ...(d.destination?.$case === 'unityCatalog' && { + unity_catalog: d.destination.unityCatalog, + }), + })); + +export const marshalCreateUnityCatalogSchema: z.ZodType = z + .object({ + logsTable: z.string(), + metricsTable: z.string(), + tracesTable: z.string(), + }) + .transform(d => ({ + logs_table: d.logsTable, + metrics_table: d.metricsTable, + traces_table: d.tracesTable, })); export const marshalStartAppRequestSchema: z.ZodType = z @@ -2950,13 +3315,269 @@ export const marshalStopAppRequestSchema: z.ZodType = z name: d.name, })); -export const marshalTelemetryExportDestinationSchema: z.ZodType = z +export const marshalUpdateAppSchema: z.ZodType = z + .object({ + name: z.string().optional(), + description: z.string().optional(), + resources: z.array(z.lazy(() => marshalUpdateAppResourceSchema)).optional(), + budgetPolicyId: z.string().optional(), + userApiScopes: z.array(z.string()).optional(), + computeSize: z.string().optional(), + usagePolicyId: z.string().optional(), + computeMinInstances: z.number().optional(), + computeMaxInstances: z.number().optional(), + gitRepository: z.lazy(() => marshalUpdateGitRepositorySchema).optional(), + telemetryExportDestinations: z + .array(z.lazy(() => marshalUpdateTelemetryExportDestinationSchema)) + .optional(), + space: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + description: d.description, + resources: d.resources, + budget_policy_id: d.budgetPolicyId, + user_api_scopes: d.userApiScopes, + compute_size: d.computeSize, + usage_policy_id: d.usagePolicyId, + compute_min_instances: d.computeMinInstances, + compute_max_instances: d.computeMaxInstances, + git_repository: d.gitRepository, + telemetry_export_destinations: d.telemetryExportDestinations, + space: d.space, + })); + +export const marshalUpdateAppResourceSchema: z.ZodType = z + .object({ + name: z.string().optional(), + description: z.string().optional(), + resource: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('secret'), + secret: z.lazy(() => marshalUpdateAppResourceSecretSchema), + }), + z.object({ + $case: z.literal('sqlWarehouse'), + sqlWarehouse: z.lazy( + () => marshalUpdateAppResourceSqlWarehouseSchema + ), + }), + z.object({ + $case: z.literal('servingEndpoint'), + servingEndpoint: z.lazy( + () => marshalUpdateAppResourceServingEndpointSchema + ), + }), + z.object({ + $case: z.literal('job'), + job: z.lazy(() => marshalUpdateAppResourceJobSchema), + }), + z.object({ + $case: z.literal('ucSecurable'), + ucSecurable: z.lazy(() => marshalUpdateAppResourceUcSecurableSchema), + }), + z.object({ + $case: z.literal('database'), + database: z.lazy(() => marshalUpdateAppResourceDatabaseSchema), + }), + z.object({ + $case: z.literal('genieSpace'), + genieSpace: z.lazy(() => marshalUpdateAppResourceGenieSpaceSchema), + }), + z.object({ + $case: z.literal('experiment'), + experiment: z.lazy(() => marshalUpdateAppResourceExperimentSchema), + }), + z.object({ + $case: z.literal('app'), + app: z.lazy(() => marshalUpdateAppResourceAppSchema), + }), + z.object({ + $case: z.literal('postgres'), + postgres: z.lazy(() => marshalUpdateAppResourcePostgresSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + name: d.name, + description: d.description, + ...(d.resource?.$case === 'secret' && {secret: d.resource.secret}), + ...(d.resource?.$case === 'sqlWarehouse' && { + sql_warehouse: d.resource.sqlWarehouse, + }), + ...(d.resource?.$case === 'servingEndpoint' && { + serving_endpoint: d.resource.servingEndpoint, + }), + ...(d.resource?.$case === 'job' && {job: d.resource.job}), + ...(d.resource?.$case === 'ucSecurable' && { + uc_securable: d.resource.ucSecurable, + }), + ...(d.resource?.$case === 'database' && {database: d.resource.database}), + ...(d.resource?.$case === 'genieSpace' && { + genie_space: d.resource.genieSpace, + }), + ...(d.resource?.$case === 'experiment' && { + experiment: d.resource.experiment, + }), + ...(d.resource?.$case === 'app' && {app: d.resource.app}), + ...(d.resource?.$case === 'postgres' && {postgres: d.resource.postgres}), + })); + +export const marshalUpdateAppResourceAppSchema: z.ZodType = z + .object({ + name: z.string().optional(), + permission: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + permission: d.permission, + })); + +export const marshalUpdateAppResourceDatabaseSchema: z.ZodType = z + .object({ + instanceName: z.string().optional(), + databaseName: z.string().optional(), + permission: z.string().optional(), + }) + .transform(d => ({ + instance_name: d.instanceName, + database_name: d.databaseName, + permission: d.permission, + })); + +export const marshalUpdateAppResourceExperimentSchema: z.ZodType = z + .object({ + experimentId: z.string().optional(), + permission: z.string().optional(), + }) + .transform(d => ({ + experiment_id: d.experimentId, + permission: d.permission, + })); + +export const marshalUpdateAppResourceGenieSpaceSchema: z.ZodType = z + .object({ + name: z.string().optional(), + spaceId: z.string().optional(), + permission: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + space_id: d.spaceId, + permission: d.permission, + })); + +export const marshalUpdateAppResourceJobSchema: z.ZodType = z + .object({ + id: z.string().optional(), + permission: z.string().optional(), + }) + .transform(d => ({ + id: d.id, + permission: d.permission, + })); + +export const marshalUpdateAppResourcePostgresSchema: z.ZodType = z + .object({ + branch: z.string().optional(), + database: z.string().optional(), + permission: z.string().optional(), + }) + .transform(d => ({ + branch: d.branch, + database: d.database, + permission: d.permission, + })); + +export const marshalUpdateAppResourceSecretSchema: z.ZodType = z + .object({ + scope: z.string().optional(), + key: z.string().optional(), + permission: z.string().optional(), + }) + .transform(d => ({ + scope: d.scope, + key: d.key, + permission: d.permission, + })); + +export const marshalUpdateAppResourceServingEndpointSchema: z.ZodType = z + .object({ + name: z.string().optional(), + permission: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + permission: d.permission, + })); + +export const marshalUpdateAppResourceSqlWarehouseSchema: z.ZodType = z + .object({ + id: z.string().optional(), + permission: z.string().optional(), + }) + .transform(d => ({ + id: d.id, + permission: d.permission, + })); + +export const marshalUpdateAppResourceUcSecurableSchema: z.ZodType = z + .object({ + securableFullName: z.string().optional(), + securableType: z.string().optional(), + permission: z.string().optional(), + }) + .transform(d => ({ + securable_full_name: d.securableFullName, + securable_type: d.securableType, + permission: d.permission, + })); + +export const marshalUpdateAppThumbnailRequestSchema: z.ZodType = z + .object({ + name: z.string().optional(), + appThumbnail: z.lazy(() => marshalCreateAppThumbnailSchema).optional(), + }) + .transform(d => ({ + name: d.name, + app_thumbnail: d.appThumbnail, + })); + +export const marshalUpdateGitRepositorySchema: z.ZodType = z + .object({ + url: z.string().optional(), + provider: z.string().optional(), + }) + .transform(d => ({ + url: d.url, + provider: d.provider, + })); + +export const marshalUpdateSpaceSchema: z.ZodType = z + .object({ + name: z.string().optional(), + description: z.string().optional(), + resources: z.array(z.lazy(() => marshalUpdateAppResourceSchema)).optional(), + userApiScopes: z.array(z.string()).optional(), + usagePolicyId: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + description: d.description, + resources: d.resources, + user_api_scopes: d.userApiScopes, + usage_policy_id: d.usagePolicyId, + })); + +export const marshalUpdateTelemetryExportDestinationSchema: z.ZodType = z .object({ destination: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('unityCatalog'), - unityCatalog: z.lazy(() => marshalUnityCatalogSchema), + unityCatalog: z.lazy(() => marshalUpdateUnityCatalogSchema), }), ]) .optional(), @@ -2967,7 +3588,7 @@ export const marshalTelemetryExportDestinationSchema: z.ZodType = z }), })); -export const marshalUnityCatalogSchema: z.ZodType = z +export const marshalUpdateUnityCatalogSchema: z.ZodType = z .object({ logsTable: z.string().optional(), metricsTable: z.string().optional(), @@ -2979,149 +3600,43 @@ export const marshalUnityCatalogSchema: z.ZodType = z traces_table: d.tracesTable, })); -export const marshalUpdateAppThumbnailRequestSchema: z.ZodType = z - .object({ - name: z.string().optional(), - appThumbnail: z.lazy(() => marshalAppThumbnailSchema).optional(), - }) - .transform(d => ({ - name: d.name, - app_thumbnail: d.appThumbnail, - })); - -const appFieldMaskSchema: FieldMaskSchema = { - activeDeployment: { - wire: 'active_deployment', - children: () => appDeploymentFieldMaskSchema, - }, - appStatus: { - wire: 'app_status', - children: () => applicationStatusFieldMaskSchema, - }, +const updateAppFieldMaskSchema: FieldMaskSchema = { budgetPolicyId: {wire: 'budget_policy_id'}, computeMaxInstances: {wire: 'compute_max_instances'}, computeMinInstances: {wire: 'compute_min_instances'}, computeSize: {wire: 'compute_size'}, - computeStatus: { - wire: 'compute_status', - children: () => computeStatusFieldMaskSchema, - }, - createTime: {wire: 'create_time'}, - creator: {wire: 'creator'}, - defaultSourceCodePath: {wire: 'default_source_code_path'}, description: {wire: 'description'}, - effectiveBudgetPolicyId: {wire: 'effective_budget_policy_id'}, - effectiveUsagePolicyId: {wire: 'effective_usage_policy_id'}, - effectiveUserApiScopes: {wire: 'effective_user_api_scopes'}, gitRepository: { wire: 'git_repository', - children: () => gitRepositoryFieldMaskSchema, + children: () => updateGitRepositoryFieldMaskSchema, }, - id: {wire: 'id'}, name: {wire: 'name'}, - oauth2AppClientId: {wire: 'oauth2_app_client_id'}, - oauth2AppIntegrationId: {wire: 'oauth2_app_integration_id'}, - pendingDeployment: { - wire: 'pending_deployment', - children: () => appDeploymentFieldMaskSchema, - }, resources: {wire: 'resources'}, - servicePrincipalClientId: {wire: 'service_principal_client_id'}, - servicePrincipalId: {wire: 'service_principal_id'}, - servicePrincipalName: {wire: 'service_principal_name'}, space: {wire: 'space'}, telemetryExportDestinations: {wire: 'telemetry_export_destinations'}, - thumbnailUrl: {wire: 'thumbnail_url'}, - updateTime: {wire: 'update_time'}, - updater: {wire: 'updater'}, - url: {wire: 'url'}, usagePolicyId: {wire: 'usage_policy_id'}, userApiScopes: {wire: 'user_api_scopes'}, }; -export function appFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, appFieldMaskSchema); +export function updateAppFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, updateAppFieldMaskSchema); } -const appDeploymentFieldMaskSchema: FieldMaskSchema = { - command: {wire: 'command'}, - createTime: {wire: 'create_time'}, - creator: {wire: 'creator'}, - deploymentArtifacts: { - wire: 'deployment_artifacts', - children: () => appDeploymentArtifactsFieldMaskSchema, - }, - deploymentId: {wire: 'deployment_id'}, - envVars: {wire: 'env_vars'}, - gitSource: {wire: 'git_source', children: () => gitSourceFieldMaskSchema}, - mode: {wire: 'mode'}, - sourceCodePath: {wire: 'source_code_path'}, - status: {wire: 'status', children: () => appDeploymentStatusFieldMaskSchema}, - updateTime: {wire: 'update_time'}, -}; - -const appDeploymentArtifactsFieldMaskSchema: FieldMaskSchema = { - sourceCodePath: {wire: 'source_code_path'}, -}; - -const appDeploymentStatusFieldMaskSchema: FieldMaskSchema = { - message: {wire: 'message'}, - state: {wire: 'state'}, -}; - -const applicationStatusFieldMaskSchema: FieldMaskSchema = { - message: {wire: 'message'}, - runningInstances: {wire: 'running_instances'}, - state: {wire: 'state'}, -}; - -const computeStatusFieldMaskSchema: FieldMaskSchema = { - activeInstances: {wire: 'active_instances'}, - message: {wire: 'message'}, - state: {wire: 'state'}, -}; - -const gitRepositoryFieldMaskSchema: FieldMaskSchema = { +const updateGitRepositoryFieldMaskSchema: FieldMaskSchema = { provider: {wire: 'provider'}, url: {wire: 'url'}, }; -const gitSourceFieldMaskSchema: FieldMaskSchema = { - branch: {wire: 'branch'}, - commit: {wire: 'commit'}, - gitRepository: { - wire: 'git_repository', - children: () => gitRepositoryFieldMaskSchema, - }, - resolvedCommit: {wire: 'resolved_commit'}, - sourceCodePath: {wire: 'source_code_path'}, - tag: {wire: 'tag'}, -}; - -const spaceFieldMaskSchema: FieldMaskSchema = { - createTime: {wire: 'create_time'}, - creator: {wire: 'creator'}, +const updateSpaceFieldMaskSchema: FieldMaskSchema = { description: {wire: 'description'}, - effectiveUsagePolicyId: {wire: 'effective_usage_policy_id'}, - effectiveUserApiScopes: {wire: 'effective_user_api_scopes'}, - id: {wire: 'id'}, name: {wire: 'name'}, resources: {wire: 'resources'}, - servicePrincipalClientId: {wire: 'service_principal_client_id'}, - servicePrincipalId: {wire: 'service_principal_id'}, - servicePrincipalName: {wire: 'service_principal_name'}, - status: {wire: 'status', children: () => spaceStatusFieldMaskSchema}, - updateTime: {wire: 'update_time'}, - updater: {wire: 'updater'}, usagePolicyId: {wire: 'usage_policy_id'}, userApiScopes: {wire: 'user_api_scopes'}, }; -export function spaceFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, spaceFieldMaskSchema); +export function updateSpaceFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, updateSpaceFieldMaskSchema); } - -const spaceStatusFieldMaskSchema: FieldMaskSchema = { - message: {wire: 'message'}, - state: {wire: 'state'}, -}; diff --git a/packages/authentication/src/v1/client.ts b/packages/authentication/src/v1/client.ts index d4b6e162..705352a2 100755 --- a/packages/authentication/src/v1/client.ts +++ b/packages/authentication/src/v1/client.ts @@ -38,8 +38,9 @@ import type { UpdateServicePrincipalFederationPolicyRequest, } from './model'; import { + marshalCreateFederationPolicySchema, marshalCreateServicePrincipalSecretRequestSchema, - marshalFederationPolicySchema, + marshalUpdateFederationPolicySchema, unmarshalCreateServicePrincipalSecretResponseSchema, unmarshalDeleteServicePrincipalSecretResponseSchema, unmarshalFederationPolicySchema, @@ -96,7 +97,10 @@ export class AuthenticationClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.policy, marshalFederationPolicySchema); + const body = marshalRequest( + req.policy, + marshalCreateFederationPolicySchema + ); let resp: FederationPolicy | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -135,7 +139,10 @@ export class AuthenticationClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.policy, marshalFederationPolicySchema); + const body = marshalRequest( + req.policy, + marshalCreateFederationPolicySchema + ); let resp: FederationPolicy | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -397,7 +404,10 @@ export class AuthenticationClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.policy, marshalFederationPolicySchema); + const body = marshalRequest( + req.policy, + marshalUpdateFederationPolicySchema + ); let resp: FederationPolicy | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -436,7 +446,10 @@ export class AuthenticationClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.policy, marshalFederationPolicySchema); + const body = marshalRequest( + req.policy, + marshalUpdateFederationPolicySchema + ); let resp: FederationPolicy | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/authentication/src/v1/index.ts b/packages/authentication/src/v1/index.ts index 63347876..9a742608 100755 --- a/packages/authentication/src/v1/index.ts +++ b/packages/authentication/src/v1/index.ts @@ -8,6 +8,8 @@ export {AuthenticationClient} from './client'; export type { CreateAccountFederationPolicyRequest, + CreateFederationPolicy, + CreateOidcFederationPolicy, CreateServicePrincipalFederationPolicyRequest, CreateServicePrincipalSecretRequest, CreateServicePrincipalSecretResponse, @@ -26,7 +28,9 @@ export type { OidcFederationPolicy, ServicePrincipalSecret, UpdateAccountFederationPolicyRequest, + UpdateFederationPolicy, + UpdateOidcFederationPolicy, UpdateServicePrincipalFederationPolicyRequest, } from './model'; -export {federationPolicyFieldMask} from './model'; +export {updateFederationPolicyFieldMask} from './model'; diff --git a/packages/authentication/src/v1/model.ts b/packages/authentication/src/v1/model.ts index 661d703d..bda00e39 100755 --- a/packages/authentication/src/v1/model.ts +++ b/packages/authentication/src/v1/model.ts @@ -16,7 +16,57 @@ export interface CreateAccountFederationPolicyRequest { * assigned by . */ policyId?: string | undefined; - policy?: FederationPolicy | undefined; + policy?: CreateFederationPolicy | undefined; +} + +export interface CreateFederationPolicy { + /** Description of the federation policy. */ + description?: string | undefined; + policy?: + | {$case: 'oidcPolicy'; oidcPolicy: CreateOidcFederationPolicy} + | undefined; +} + +/** Specifies the policy to use for validating OIDC claims in your federated tokens. */ +export interface CreateOidcFederationPolicy { + /** The required token issuer, as specified in the 'iss' claim of federated tokens. */ + issuer?: string | undefined; + /** + * The required token subject, as specified in the subject claim of federated tokens. + * Must be specified for service principal federation policies. Must not be specified + * for account federation policies. + */ + subject?: string | undefined; + /** + * The allowed token audiences, as specified in the 'aud' claim of federated tokens. + * The audience identifier is intended to represent the recipient of the token. + * Can be any non-empty string value. As long as the audience in the token matches + * at least one audience in the policy, the token is considered a match. If audiences + * is unspecified, defaults to your account id. + */ + audiences?: string[] | undefined; + /** + * The claim that contains the subject of the token. If unspecified, the default value + * is 'sub'. + */ + subjectClaim?: string | undefined; + /** + * URL of the public keys used to validate the signature of federated tokens, in + * JWKS format. Most use cases should not need to specify this field. If jwks_uri + * and jwks_json are both unspecified (recommended), automatically + * fetches the public keys from your issuer’s well known endpoint. Databricks + * strongly recommends relying on your issuer’s well known endpoint for discovering + * public keys. + */ + jwksUri?: string | undefined; + /** + * The public keys used to validate the signature of federated tokens, in JWKS format. + * Most use cases should not need to specify this field. If jwks_uri and jwks_json + * are both unspecified (recommended), automatically fetches the public + * keys from your issuer’s well known endpoint. Databricks strongly recommends + * relying on your issuer’s well known endpoint for discovering public keys. + */ + jwksJson?: string | undefined; } export interface CreateServicePrincipalFederationPolicyRequest { @@ -30,7 +80,7 @@ export interface CreateServicePrincipalFederationPolicyRequest { * assigned by . */ policyId?: string | undefined; - policy?: FederationPolicy | undefined; + policy?: CreateFederationPolicy | undefined; } export interface CreateServicePrincipalSecretRequest { @@ -242,7 +292,7 @@ export interface UpdateAccountFederationPolicyRequest { servicePrincipalId?: bigint | undefined; /** The identifier for the federation policy. */ policyId?: string | undefined; - policy?: FederationPolicy | undefined; + policy?: UpdateFederationPolicy | undefined; /** * The field mask specifies which fields of the policy to update. To specify multiple fields * in the field mask, use comma as the separator (no space). The special value '*' indicates @@ -250,7 +300,57 @@ export interface UpdateAccountFederationPolicyRequest { * set in the policy provided in the update request will overwrite the corresponding fields * in the existing policy. Example value: 'description,oidc_policy.audiences'. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; +} + +export interface UpdateFederationPolicy { + /** Description of the federation policy. */ + description?: string | undefined; + policy?: + | {$case: 'oidcPolicy'; oidcPolicy: UpdateOidcFederationPolicy} + | undefined; +} + +/** Specifies the policy to use for validating OIDC claims in your federated tokens. */ +export interface UpdateOidcFederationPolicy { + /** The required token issuer, as specified in the 'iss' claim of federated tokens. */ + issuer?: string | undefined; + /** + * The required token subject, as specified in the subject claim of federated tokens. + * Must be specified for service principal federation policies. Must not be specified + * for account federation policies. + */ + subject?: string | undefined; + /** + * The allowed token audiences, as specified in the 'aud' claim of federated tokens. + * The audience identifier is intended to represent the recipient of the token. + * Can be any non-empty string value. As long as the audience in the token matches + * at least one audience in the policy, the token is considered a match. If audiences + * is unspecified, defaults to your account id. + */ + audiences?: string[] | undefined; + /** + * The claim that contains the subject of the token. If unspecified, the default value + * is 'sub'. + */ + subjectClaim?: string | undefined; + /** + * URL of the public keys used to validate the signature of federated tokens, in + * JWKS format. Most use cases should not need to specify this field. If jwks_uri + * and jwks_json are both unspecified (recommended), automatically + * fetches the public keys from your issuer’s well known endpoint. Databricks + * strongly recommends relying on your issuer’s well known endpoint for discovering + * public keys. + */ + jwksUri?: string | undefined; + /** + * The public keys used to validate the signature of federated tokens, in JWKS format. + * Most use cases should not need to specify this field. If jwks_uri and jwks_json + * are both unspecified (recommended), automatically fetches the public + * keys from your issuer’s well known endpoint. Databricks strongly recommends + * relying on your issuer’s well known endpoint for discovering public keys. + */ + jwksJson?: string | undefined; } export interface UpdateServicePrincipalFederationPolicyRequest { @@ -260,7 +360,7 @@ export interface UpdateServicePrincipalFederationPolicyRequest { servicePrincipalId?: bigint | undefined; /** The identifier for the federation policy. */ policyId?: string | undefined; - policy?: FederationPolicy | undefined; + policy?: UpdateFederationPolicy | undefined; /** * The field mask specifies which fields of the policy to update. To specify multiple fields * in the field mask, use comma as the separator (no space). The special value '*' indicates @@ -268,7 +368,7 @@ export interface UpdateServicePrincipalFederationPolicyRequest { * set in the policy provided in the update request will overwrite the corresponding fields * in the existing policy. Example value: 'description,oidc_policy.audiences'. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalCreateServicePrincipalSecretResponseSchema: z.ZodType = @@ -401,6 +501,41 @@ export const unmarshalServicePrincipalSecretSchema: z.ZodType marshalCreateOidcFederationPolicySchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + description: d.description, + ...(d.policy?.$case === 'oidcPolicy' && {oidc_policy: d.policy.oidcPolicy}), + })); + +export const marshalCreateOidcFederationPolicySchema: z.ZodType = z + .object({ + issuer: z.string().optional(), + subject: z.string().optional(), + audiences: z.array(z.string()).optional(), + subjectClaim: z.string().optional(), + jwksUri: z.string().optional(), + jwksJson: z.string().optional(), + }) + .transform(d => ({ + issuer: d.issuer, + subject: d.subject, + audiences: d.audiences, + subject_claim: d.subjectClaim, + jwks_uri: d.jwksUri, + jwks_json: d.jwksJson, + })); + export const marshalCreateServicePrincipalSecretRequestSchema: z.ZodType = z .object({ accountId: z.string().optional(), @@ -416,42 +551,24 @@ export const marshalCreateServicePrincipalSecretRequestSchema: z.ZodType = z lifetime: d.lifetime, })); -export const marshalFederationPolicySchema: z.ZodType = z +export const marshalUpdateFederationPolicySchema: z.ZodType = z .object({ - name: z.string().optional(), description: z.string().optional(), policy: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('oidcPolicy'), - oidcPolicy: z.lazy(() => marshalOidcFederationPolicySchema), + oidcPolicy: z.lazy(() => marshalUpdateOidcFederationPolicySchema), }), ]) .optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - uid: z.string().optional(), - servicePrincipalId: z.bigint().optional(), - policyId: z.string().optional(), }) .transform(d => ({ - name: d.name, description: d.description, ...(d.policy?.$case === 'oidcPolicy' && {oidc_policy: d.policy.oidcPolicy}), - create_time: d.createTime, - update_time: d.updateTime, - uid: d.uid, - service_principal_id: d.servicePrincipalId, - policy_id: d.policyId, })); -export const marshalOidcFederationPolicySchema: z.ZodType = z +export const marshalUpdateOidcFederationPolicySchema: z.ZodType = z .object({ issuer: z.string().optional(), subject: z.string().optional(), @@ -469,30 +586,24 @@ export const marshalOidcFederationPolicySchema: z.ZodType = z jwks_json: d.jwksJson, })); -const federationPolicyFieldMaskSchema: FieldMaskSchema = { - createTime: {wire: 'create_time'}, +const updateFederationPolicyFieldMaskSchema: FieldMaskSchema = { description: {wire: 'description'}, - name: {wire: 'name'}, oidcPolicy: { wire: 'oidc_policy', - children: () => oidcFederationPolicyFieldMaskSchema, + children: () => updateOidcFederationPolicyFieldMaskSchema, }, - policyId: {wire: 'policy_id'}, - servicePrincipalId: {wire: 'service_principal_id'}, - uid: {wire: 'uid'}, - updateTime: {wire: 'update_time'}, }; -export function federationPolicyFieldMask( +export function updateFederationPolicyFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - federationPolicyFieldMaskSchema + updateFederationPolicyFieldMaskSchema ); } -const oidcFederationPolicyFieldMaskSchema: FieldMaskSchema = { +const updateOidcFederationPolicyFieldMaskSchema: FieldMaskSchema = { audiences: {wire: 'audiences'}, issuer: {wire: 'issuer'}, jwksJson: {wire: 'jwks_json'}, diff --git a/packages/budgetpolicy/src/v1/client.ts b/packages/budgetpolicy/src/v1/client.ts index c0e83023..2ac32bf6 100755 --- a/packages/budgetpolicy/src/v1/client.ts +++ b/packages/budgetpolicy/src/v1/client.ts @@ -27,8 +27,8 @@ import type { UpdateBudgetPolicyRequest, } from './model'; import { - marshalBudgetPolicySchema, marshalCreateBudgetPolicyRequestSchema, + marshalCreateBudgetPolicySchema, marshalFilterSchema, marshalLimitConfigSchema, marshalSortSpecSchema, @@ -225,7 +225,7 @@ export class BudgetPolicyClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.policy, marshalBudgetPolicySchema); + const body = marshalRequest(req.policy, marshalCreateBudgetPolicySchema); let resp: BudgetPolicy | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/budgetpolicy/src/v1/index.ts b/packages/budgetpolicy/src/v1/index.ts index 55e5c221..651d4e71 100755 --- a/packages/budgetpolicy/src/v1/index.ts +++ b/packages/budgetpolicy/src/v1/index.ts @@ -10,7 +10,9 @@ export {SortSpec_Field} from './model'; export type { BudgetPolicy, + CreateBudgetPolicy, CreateBudgetPolicyRequest, + CreateCustomPolicyTag, CustomPolicyTag, DeleteBudgetPolicyRequest, Filter, diff --git a/packages/budgetpolicy/src/v1/model.ts b/packages/budgetpolicy/src/v1/model.ts index 9ce4408a..a961a35e 100644 --- a/packages/budgetpolicy/src/v1/model.ts +++ b/packages/budgetpolicy/src/v1/model.ts @@ -34,6 +34,26 @@ export interface BudgetPolicy { bindingWorkspaceIds?: bigint[] | undefined; } +/** Contains the BudgetPolicy details. */ +export interface CreateBudgetPolicy { + /** The Id of the policy. This field is generated by and globally unique. */ + policyId?: string | undefined; + /** + * The name of the policy. + * - Must be unique among active policies. + * - Can contain only characters from the ISO 8859-1 (latin1) set. + * - Can't start with reserved keywords such as `databricks:default-policy`. + */ + policyName?: string | undefined; + /** A list of tags defined by the customer. At most 20 entries are allowed per policy. */ + customTags?: CreateCustomPolicyTag[] | undefined; + /** + * List of workspaces that this budget policy will be exclusively bound to. + * An empty binding implies that this budget policy is open to any workspace in the account. + */ + bindingWorkspaceIds?: bigint[] | undefined; +} + /** A request to create a BudgetPolicy. */ export interface CreateBudgetPolicyRequest { /** @@ -49,7 +69,19 @@ export interface CreateBudgetPolicyRequest { * `policy_name` must be provided, custom_tags may need to be provided * depending on the cloud provider. All other fields are optional. */ - policy?: BudgetPolicy | undefined; + policy?: CreateBudgetPolicy | undefined; +} + +export interface CreateCustomPolicyTag { + /** + * The key of the tag. + * - Must be unique among all custom tags of the same policy + * - Cannot be “budget-policy-name”, “budget-policy-id” or "budget-policy-resolution-result" - + * these tags are preserved. + */ + key: string; + /** The value of the tag. */ + value?: string | undefined; } export interface CustomPolicyTag { @@ -162,7 +194,7 @@ export interface UpdateBudgetPolicyRequest { * must be specified even if not changed. The `policy_id` is used to identify the policy to * update. */ - policy?: BudgetPolicy | undefined; + policy?: CreateBudgetPolicy | undefined; /** The account Id of the customer */ accountId?: string | undefined; /** DEPRECATED. This is redundant field as LimitConfig is part of the BudgetPolicy */ @@ -210,11 +242,13 @@ export const unmarshalListBudgetPoliciesResponseSchema: z.ZodType marshalCustomPolicyTagSchema)).optional(), + customTags: z + .array(z.lazy(() => marshalCreateCustomPolicyTagSchema)) + .optional(), bindingWorkspaceIds: z.array(z.bigint()).optional(), }) .transform(d => ({ @@ -228,7 +262,7 @@ export const marshalCreateBudgetPolicyRequestSchema: z.ZodType = z .object({ requestId: z.string().optional(), accountId: z.string().optional(), - policy: z.lazy(() => marshalBudgetPolicySchema).optional(), + policy: z.lazy(() => marshalCreateBudgetPolicySchema).optional(), }) .transform(d => ({ request_id: d.requestId, @@ -236,9 +270,9 @@ export const marshalCreateBudgetPolicyRequestSchema: z.ZodType = z policy: d.policy, })); -export const marshalCustomPolicyTagSchema: z.ZodType = z +export const marshalCreateCustomPolicyTagSchema: z.ZodType = z .object({ - key: z.string().optional(), + key: z.string(), value: z.string().optional(), }) .transform(d => ({ diff --git a/packages/budgets/src/v1/index.ts b/packages/budgets/src/v1/index.ts index 70850203..bae9abd5 100755 --- a/packages/budgets/src/v1/index.ts +++ b/packages/budgets/src/v1/index.ts @@ -20,11 +20,19 @@ export type { BudgetConfiguration, BudgetConfigurationFilter, BudgetConfigurationFilter_Clause, + BudgetConfigurationFilter_CreateClause, + BudgetConfigurationFilter_CreateTagClause, + BudgetConfigurationFilter_CreateWorkspaceIdClause, BudgetConfigurationFilter_TagClause, BudgetConfigurationFilter_WorkspaceIdClause, + CreateActionConfiguration, + CreateAlertConfiguration, CreateBudgetConfigurationBudget, + CreateBudgetConfigurationFilter, CreateBudgetConfigurationRequest, CreateBudgetConfigurationResponse, + CreateCreateBudgetConfigurationBudget, + CreateUpdateBudgetConfigurationBudget, DeleteBudgetConfigurationRequest, DeleteBudgetConfigurationResponse, GetBudgetConfigurationRequest, diff --git a/packages/budgets/src/v1/model.ts b/packages/budgets/src/v1/model.ts index 9eabaf1d..c023ae0a 100755 --- a/packages/budgets/src/v1/model.ts +++ b/packages/budgets/src/v1/model.ts @@ -104,6 +104,24 @@ export interface BudgetConfigurationFilter_Clause { values?: string[] | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface BudgetConfigurationFilter_CreateClause { + operator?: BudgetConfigurationFilter_Operator | undefined; + values?: string[] | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface BudgetConfigurationFilter_CreateTagClause { + key?: string | undefined; + value?: BudgetConfigurationFilter_CreateClause | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface BudgetConfigurationFilter_CreateWorkspaceIdClause { + operator?: BudgetConfigurationFilter_Operator | undefined; + values?: bigint[] | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface BudgetConfigurationFilter_TagClause { key?: string | undefined; @@ -116,6 +134,30 @@ export interface BudgetConfigurationFilter_WorkspaceIdClause { values?: bigint[] | undefined; } +export interface CreateActionConfiguration { + /** action configuration ID. */ + actionConfigurationId?: string | undefined; + /** The type of the action. */ + actionType?: ActionConfigurationType | undefined; + /** Target for the action. For example, an email address. */ + target?: string | undefined; +} + +export interface CreateAlertConfiguration { + /** alert configuration ID. */ + alertConfigurationId?: string | undefined; + /** The time window of usage data for the budget. */ + timePeriod?: AlertConfigurationTimePeriod | undefined; + /** The evaluation method to determine when this budget alert is in a triggered state. */ + triggerType?: AlertConfigurationTriggerType | undefined; + /** The way to calculate cost for this budget alert. This is what `quantity_threshold` is measured in. */ + quantityType?: AlertConfigurationQuantityType | undefined; + /** The threshold for the budget alert to determine if it is in a triggered state. The number is evaluated based on `quantity_type`. */ + quantityThreshold?: string | undefined; + /** Configured actions for this alert. These define what happens when an alert enters a triggered state. */ + actionConfigurations?: CreateActionConfiguration[] | undefined; +} + export interface CreateBudgetConfigurationBudget { /** budget configuration ID. */ budgetConfigurationId?: string | undefined; @@ -136,9 +178,19 @@ export interface CreateBudgetConfigurationBudget { displayName?: string | undefined; } +export interface CreateBudgetConfigurationFilter { + /** If provided, usage must match with the provided workspace IDs. */ + workspaceId?: BudgetConfigurationFilter_CreateWorkspaceIdClause | undefined; + /** + * A list of tag keys and values that will limit the budget to usage that includes those specific custom tags. + * Tags are case-sensitive and should be entered exactly as they appear in your usage data. + */ + tags?: BudgetConfigurationFilter_CreateTagClause[] | undefined; +} + export interface CreateBudgetConfigurationRequest { /** Properties of the new budget configuration. */ - budget?: CreateBudgetConfigurationBudget | undefined; + budget?: CreateCreateBudgetConfigurationBudget | undefined; } export interface CreateBudgetConfigurationResponse { @@ -146,6 +198,46 @@ export interface CreateBudgetConfigurationResponse { budget?: BudgetConfiguration | undefined; } +export interface CreateCreateBudgetConfigurationBudget { + /** budget configuration ID. */ + budgetConfigurationId?: string | undefined; + /** account ID. */ + accountId?: string | undefined; + /** Creation time of this budget configuration. */ + createTime?: bigint | undefined; + /** Update time of this budget configuration. */ + updateTime?: bigint | undefined; + /** Alerts to configure when this budget is in a triggered state. Budgets must have exactly one alert configuration. */ + alertConfigurations?: CreateAlertConfiguration[] | undefined; + /** + * Configured filters for this budget. These are applied to your account's usage to limit the scope of what is considered for this budget. + * Leave empty to include all usage for this account. All provided filters must be matched for usage to be included. + */ + filter?: CreateBudgetConfigurationFilter | undefined; + /** Human-readable name of budget configuration. Max Length: 128 */ + displayName?: string | undefined; +} + +export interface CreateUpdateBudgetConfigurationBudget { + /** budget configuration ID. */ + budgetConfigurationId?: string | undefined; + /** account ID. */ + accountId?: string | undefined; + /** Creation time of this budget configuration. */ + createTime?: bigint | undefined; + /** Update time of this budget configuration. */ + updateTime?: bigint | undefined; + /** Alerts to configure when this budget is in a triggered state. Budgets must have exactly one alert configuration. */ + alertConfigurations?: CreateAlertConfiguration[] | undefined; + /** + * Configured filters for this budget. These are applied to your account's usage to limit the scope of what is considered for this budget. + * Leave empty to include all usage for this account. All provided filters must be matched for usage to be included. + */ + filter?: CreateBudgetConfigurationFilter | undefined; + /** Human-readable name of budget configuration. Max Length: 128 */ + displayName?: string | undefined; +} + /** * * * Delete budget @@ -214,7 +306,7 @@ export interface UpdateBudgetConfigurationRequest { /** The budget configuration ID. */ budgetId?: string | undefined; /** The updated budget. This will overwrite the budget specified by the budget ID. */ - budget?: UpdateBudgetConfigurationBudget | undefined; + budget?: CreateUpdateBudgetConfigurationBudget | undefined; } export interface UpdateBudgetConfigurationResponse { @@ -383,7 +475,44 @@ export const unmarshalUpdateBudgetConfigurationResponseSchema: z.ZodType ({ + operator: d.operator, + values: d.values, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalBudgetConfigurationFilter_CreateTagClauseSchema: z.ZodType = + z + .object({ + key: z.string().optional(), + value: z + .lazy(() => marshalBudgetConfigurationFilter_CreateClauseSchema) + .optional(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalBudgetConfigurationFilter_CreateWorkspaceIdClauseSchema: z.ZodType = + z + .object({ + operator: z.string().optional(), + values: z.array(z.bigint()).optional(), + }) + .transform(d => ({ + operator: d.operator, + values: d.values, + })); + +export const marshalCreateActionConfigurationSchema: z.ZodType = z .object({ actionConfigurationId: z.string().optional(), actionType: z.string().optional(), @@ -395,7 +524,7 @@ export const marshalActionConfigurationSchema: z.ZodType = z target: d.target, })); -export const marshalAlertConfigurationSchema: z.ZodType = z +export const marshalCreateAlertConfigurationSchema: z.ZodType = z .object({ alertConfigurationId: z.string().optional(), timePeriod: z.string().optional(), @@ -403,7 +532,7 @@ export const marshalAlertConfigurationSchema: z.ZodType = z quantityType: z.string().optional(), quantityThreshold: z.string().optional(), actionConfigurations: z - .array(z.lazy(() => marshalActionConfigurationSchema)) + .array(z.lazy(() => marshalCreateActionConfigurationSchema)) .optional(), }) .transform(d => ({ @@ -415,13 +544,17 @@ export const marshalAlertConfigurationSchema: z.ZodType = z action_configurations: d.actionConfigurations, })); -export const marshalBudgetConfigurationFilterSchema: z.ZodType = z +export const marshalCreateBudgetConfigurationFilterSchema: z.ZodType = z .object({ workspaceId: z - .lazy(() => marshalBudgetConfigurationFilter_WorkspaceIdClauseSchema) + .lazy( + () => marshalBudgetConfigurationFilter_CreateWorkspaceIdClauseSchema + ) .optional(), tags: z - .array(z.lazy(() => marshalBudgetConfigurationFilter_TagClauseSchema)) + .array( + z.lazy(() => marshalBudgetConfigurationFilter_CreateTagClauseSchema) + ) .optional(), }) .transform(d => ({ @@ -429,52 +562,28 @@ export const marshalBudgetConfigurationFilterSchema: z.ZodType = z tags: d.tags, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalBudgetConfigurationFilter_ClauseSchema: z.ZodType = z - .object({ - operator: z.string().optional(), - values: z.array(z.string()).optional(), - }) - .transform(d => ({ - operator: d.operator, - values: d.values, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalBudgetConfigurationFilter_TagClauseSchema: z.ZodType = z +export const marshalCreateBudgetConfigurationRequestSchema: z.ZodType = z .object({ - key: z.string().optional(), - value: z - .lazy(() => marshalBudgetConfigurationFilter_ClauseSchema) + budget: z + .lazy(() => marshalCreateCreateBudgetConfigurationBudgetSchema) .optional(), }) .transform(d => ({ - key: d.key, - value: d.value, + budget: d.budget, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalBudgetConfigurationFilter_WorkspaceIdClauseSchema: z.ZodType = - z - .object({ - operator: z.string().optional(), - values: z.array(z.bigint()).optional(), - }) - .transform(d => ({ - operator: d.operator, - values: d.values, - })); - -export const marshalCreateBudgetConfigurationBudgetSchema: z.ZodType = z +export const marshalCreateCreateBudgetConfigurationBudgetSchema: z.ZodType = z .object({ budgetConfigurationId: z.string().optional(), accountId: z.string().optional(), createTime: z.bigint().optional(), updateTime: z.bigint().optional(), alertConfigurations: z - .array(z.lazy(() => marshalAlertConfigurationSchema)) + .array(z.lazy(() => marshalCreateAlertConfigurationSchema)) + .optional(), + filter: z + .lazy(() => marshalCreateBudgetConfigurationFilterSchema) .optional(), - filter: z.lazy(() => marshalBudgetConfigurationFilterSchema).optional(), displayName: z.string().optional(), }) .transform(d => ({ @@ -487,26 +596,18 @@ export const marshalCreateBudgetConfigurationBudgetSchema: z.ZodType = z display_name: d.displayName, })); -export const marshalCreateBudgetConfigurationRequestSchema: z.ZodType = z - .object({ - budget: z - .lazy(() => marshalCreateBudgetConfigurationBudgetSchema) - .optional(), - }) - .transform(d => ({ - budget: d.budget, - })); - -export const marshalUpdateBudgetConfigurationBudgetSchema: z.ZodType = z +export const marshalCreateUpdateBudgetConfigurationBudgetSchema: z.ZodType = z .object({ budgetConfigurationId: z.string().optional(), accountId: z.string().optional(), createTime: z.bigint().optional(), updateTime: z.bigint().optional(), alertConfigurations: z - .array(z.lazy(() => marshalAlertConfigurationSchema)) + .array(z.lazy(() => marshalCreateAlertConfigurationSchema)) + .optional(), + filter: z + .lazy(() => marshalCreateBudgetConfigurationFilterSchema) .optional(), - filter: z.lazy(() => marshalBudgetConfigurationFilterSchema).optional(), displayName: z.string().optional(), }) .transform(d => ({ @@ -523,7 +624,7 @@ export const marshalUpdateBudgetConfigurationRequestSchema: z.ZodType = z .object({ budgetId: z.string().optional(), budget: z - .lazy(() => marshalUpdateBudgetConfigurationBudgetSchema) + .lazy(() => marshalCreateUpdateBudgetConfigurationBudgetSchema) .optional(), }) .transform(d => ({ diff --git a/packages/cleanrooms/src/v1/client.ts b/packages/cleanrooms/src/v1/client.ts index 0eeacc08..b225e0ac 100755 --- a/packages/cleanrooms/src/v1/client.ts +++ b/packages/cleanrooms/src/v1/client.ts @@ -55,12 +55,12 @@ import type { } from './model'; import { CleanRoom_Status_Enum, - marshalCleanRoomAssetSchema, - marshalCleanRoomAutoApprovalRuleSchema, - marshalCleanRoomOutputCatalogSchema, - marshalCleanRoomSchema, marshalCreateCleanRoomAssetReviewRequestSchema, + marshalCreateCleanRoomAssetSchema, marshalCreateCleanRoomAutoApprovalRuleRequestSchema, + marshalCreateCleanRoomAutoApprovalRuleSchema, + marshalCreateCleanRoomOutputCatalogSchema, + marshalCreateCleanRoomSchema, marshalUpdateCleanRoomRequestSchema, unmarshalCleanRoomAssetSchema, unmarshalCleanRoomAutoApprovalRuleSchema, @@ -124,7 +124,7 @@ export class CleanRoomsClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/clean-rooms`; - const body = marshalRequest(req.cleanRoom, marshalCleanRoomSchema); + const body = marshalRequest(req.cleanRoom, marshalCreateCleanRoomSchema); let resp: CleanRoom | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -181,7 +181,7 @@ export class CleanRoomsClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/clean-rooms/${req.asset?.cleanRoomName ?? ''}/assets`; - const body = marshalRequest(req.asset, marshalCleanRoomAssetSchema); + const body = marshalRequest(req.asset, marshalCreateCleanRoomAssetSchema); let resp: CleanRoomAsset | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -282,7 +282,7 @@ export class CleanRoomsClient { const url = `${host}/api/2.0/clean-rooms/${req.cleanRoomName ?? ''}/output-catalogs`; const body = marshalRequest( req.outputCatalog, - marshalCleanRoomOutputCatalogSchema + marshalCreateCleanRoomOutputCatalogSchema ); let resp: CreateCleanRoomOutputCatalogResponse | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -844,7 +844,7 @@ export class CleanRoomsClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/clean-rooms/${req.cleanRoomName ?? ''}/assets/${req.asset?.assetType ?? ''}/${req.asset?.name ?? ''}`; - const body = marshalRequest(req.asset, marshalCleanRoomAssetSchema); + const body = marshalRequest(req.asset, marshalCreateCleanRoomAssetSchema); let resp: CleanRoomAsset | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -876,7 +876,7 @@ export class CleanRoomsClient { const url = `${host}/api/2.0/clean-rooms/${req.autoApprovalRule?.cleanRoomName ?? ''}/auto-approval-rules/${req.autoApprovalRule?.ruleId ?? ''}`; const body = marshalRequest( req.autoApprovalRule, - marshalCleanRoomAutoApprovalRuleSchema + marshalCreateCleanRoomAutoApprovalRuleSchema ); let resp: CleanRoomAutoApprovalRule | undefined; const call = async (callSignal?: AbortSignal): Promise => { diff --git a/packages/cleanrooms/src/v1/index.ts b/packages/cleanrooms/src/v1/index.ts index d632ea81..5aa24131 100755 --- a/packages/cleanrooms/src/v1/index.ts +++ b/packages/cleanrooms/src/v1/index.ts @@ -32,6 +32,14 @@ export type { CleanRoom, CleanRoom_Status, CleanRoomAsset, + CleanRoomAsset_CreateForeignTable, + CleanRoomAsset_CreateForeignTableLocalDetails, + CleanRoomAsset_CreateNotebook, + CleanRoomAsset_CreateTable, + CleanRoomAsset_CreateTableLocalDetails, + CleanRoomAsset_CreateView, + CleanRoomAsset_CreateViewLocalDetails, + CleanRoomAsset_CreateVolumeLocalDetails, CleanRoomAsset_ForeignTable, CleanRoomAsset_ForeignTableLocalDetails, CleanRoomAsset_Notebook, @@ -52,19 +60,31 @@ export type { ColumnInfo, ColumnMask, ComplianceSecurityProfile, + CreateCleanRoom, + CreateCleanRoomAsset, CreateCleanRoomAssetRequest, CreateCleanRoomAssetReviewRequest, CreateCleanRoomAssetReviewResponse, + CreateCleanRoomAutoApprovalRule, CreateCleanRoomAutoApprovalRuleRequest, + CreateCleanRoomCollaborator, + CreateCleanRoomOutputCatalog, CreateCleanRoomOutputCatalogRequest, CreateCleanRoomOutputCatalogResponse, + CreateCleanRoomRemoteDetail, CreateCleanRoomRequest, + CreateEgressNetworkPolicy, + CreateNotebookVersionReview, DeleteCleanRoomAssetRequest, DeleteCleanRoomAssetResponse, DeleteCleanRoomAutoApprovalRuleRequest, DeleteCleanRoomRequest, EgressNetworkPolicy, + EgressNetworkPolicy_CreateInternetAccessPolicy, EgressNetworkPolicy_InternetAccessPolicy, + EgressNetworkPolicy_InternetAccessPolicy_CreateInternetDestination, + EgressNetworkPolicy_InternetAccessPolicy_CreateLogOnlyMode, + EgressNetworkPolicy_InternetAccessPolicy_CreateStorageDestination, EgressNetworkPolicy_InternetAccessPolicy_InternetDestination, EgressNetworkPolicy_InternetAccessPolicy_LogOnlyMode, EgressNetworkPolicy_InternetAccessPolicy_StorageDestination, @@ -84,7 +104,9 @@ export type { ListCleanRoomsResponse, NotebookVersionReview, PartitionSpecification, + PartitionSpecification_CreatePartition, PartitionSpecification_Partition, + PartitionSpecification_Partition_CreatePartitionValue, PartitionSpecification_Partition_PartitionValue, PolicyFunctionArgument, UpdateCleanRoomAssetRequest, diff --git a/packages/cleanrooms/src/v1/model.ts b/packages/cleanrooms/src/v1/model.ts index 4dcb9225..39602bd0 100755 --- a/packages/cleanrooms/src/v1/model.ts +++ b/packages/cleanrooms/src/v1/model.ts @@ -462,6 +462,64 @@ export interface CleanRoomAsset { | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name. +export interface CleanRoomAsset_CreateForeignTable {} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface CleanRoomAsset_CreateForeignTableLocalDetails { + /** + * The fully qualified name of the foreign table in its owner's local metastore, + * in the format of *catalog*.*schema*.*foreign_table_name* + */ + localName: string; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface CleanRoomAsset_CreateNotebook { + /** + * Base 64 representation of the notebook contents. + * This is the same format as returned by [workspace/export](https://docs.databricks.com/api/workspace/workspace/export) with the format of **HTML**. + */ + notebookContent: string; + /** Aliases of collaborators that can run the notebook. */ + runnerCollaboratorAliases?: string[] | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name. +export interface CleanRoomAsset_CreateTable {} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface CleanRoomAsset_CreateTableLocalDetails { + /** + * The fully qualified name of the table in its owner's local metastore, + * in the format of *catalog*.*schema*.*table_name* + */ + localName: string; + /** Partition filtering specification for a shared table. */ + partitions?: PartitionSpecification_CreatePartition[] | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name. +export interface CleanRoomAsset_CreateView {} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface CleanRoomAsset_CreateViewLocalDetails { + /** + * The fully qualified name of the view in its owner's local metastore, + * in the format of *catalog*.*schema*.*view_name* + */ + localName: string; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface CleanRoomAsset_CreateVolumeLocalDetails { + /** + * The fully qualified name of the volume in its owner's local metastore, + * in the format of *catalog*.*schema*.*volume_name* + */ + localName: string; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface CleanRoomAsset_ForeignTable { /** The metadata information of the columns in the foreign table */ @@ -585,12 +643,6 @@ export interface CleanRoomCollaborator { * configured in the metastore */ organizationName?: string | undefined; - /** - * Workspace ID of the user who is receiving the clean room "invitation". Must be specified if - * invite_recipient_email is specified. - * It should be empty when the collaborator is the creator of the clean room. - */ - inviteRecipientWorkspaceId?: bigint | undefined; /** * Email of the user who is receiving the clean room "invitation". It should be empty * for the creator of the clean room, and non-empty for the invitees of the clean room. @@ -756,8 +808,116 @@ export interface ComplianceSecurityProfile { complianceStandards?: ComplianceStandard[] | undefined; } +export interface CreateCleanRoom { + /** + * The name of the clean room. + * It should follow [UC securable naming requirements](https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements). + */ + name?: string | undefined; + /** + * Central clean room details. During creation, users need to specify + * cloud_vendor, region, and collaborators.global_metastore_id. + * This field will not be filled in the ListCleanRooms call. + */ + remoteDetailedInfo?: CreateCleanRoomRemoteDetail | undefined; + /** This is the username of the owner of the local clean room securable for permission management. */ + owner?: string | undefined; + comment?: string | undefined; +} + +/** Metadata of the clean room asset */ +export interface CreateCleanRoomAsset { + /** + * The name of the clean room this asset belongs to. + * This field is required for create operations and populated by the server for responses. + */ + cleanRoomName?: string | undefined; + /** + * A fully qualified name that uniquely identifies the asset within the clean room. + * This is also the name displayed in the clean room UI. + * + * For UC securable assets (tables, volumes, etc.), the format is *shared_catalog*.*shared_schema*.*asset_name* + * + * For notebooks, the name is the notebook file name. + * For jar analyses, the name is the jar analysis name. + */ + name?: string | undefined; + /** The type of the asset. */ + assetType?: CleanRoomAsset_AssetType | undefined; + /** asset-type specific local information of the asset */ + localDetails?: + | { + $case: 'tableLocalDetails'; + /** + * Local details for a table that are only available to its owner. + * Present if and only if **asset_type** is **TABLE** + */ + tableLocalDetails: CleanRoomAsset_CreateTableLocalDetails; + } + | { + $case: 'volumeLocalDetails'; + /** + * Local details for a volume that are only available to its owner. + * Present if and only if **asset_type** is **VOLUME** + */ + volumeLocalDetails: CleanRoomAsset_CreateVolumeLocalDetails; + } + | { + $case: 'viewLocalDetails'; + /** + * Local details for a view that are only available to its owner. + * Present if and only if **asset_type** is **VIEW** + */ + viewLocalDetails: CleanRoomAsset_CreateViewLocalDetails; + } + | { + $case: 'foreignTableLocalDetails'; + /** + * Local details for a foreign that are only available to its owner. + * Present if and only if **asset_type** is **FOREIGN_TABLE** + */ + foreignTableLocalDetails: CleanRoomAsset_CreateForeignTableLocalDetails; + } + | undefined; + /** the asset-type specific information. Will not be returned by list */ + details?: + | { + $case: 'table'; + /** + * Table details available to all collaborators of the clean room. + * Present if and only if **asset_type** is **TABLE** + */ + table: CleanRoomAsset_CreateTable; + } + | { + $case: 'notebook'; + /** + * Notebook details available to all collaborators of the clean room. + * Present if and only if **asset_type** is **NOTEBOOK_FILE** + */ + notebook: CleanRoomAsset_CreateNotebook; + } + | { + $case: 'view'; + /** + * View details available to all collaborators of the clean room. + * Present if and only if **asset_type** is **VIEW** + */ + view: CleanRoomAsset_CreateView; + } + | { + $case: 'foreignTable'; + /** + * Foreign table details available to all collaborators of the clean room. + * Present if and only if **asset_type** is **FOREIGN_TABLE** + */ + foreignTable: CleanRoomAsset_CreateForeignTable; + } + | undefined; +} + export interface CreateCleanRoomAssetRequest { - asset?: CleanRoomAsset | undefined; + asset?: CreateCleanRoomAsset | undefined; } export interface CreateCleanRoomAssetReviewRequest { @@ -768,7 +928,7 @@ export interface CreateCleanRoomAssetReviewRequest { /** Asset type. Can either be NOTEBOOK_FILE or JAR_ANALYSIS. */ assetType?: CleanRoomAsset_AssetType | undefined; review?: - | {$case: 'notebookReview'; notebookReview: NotebookVersionReview} + | {$case: 'notebookReview'; notebookReview: CreateNotebookVersionReview} | undefined; } @@ -784,22 +944,128 @@ export interface CreateCleanRoomAssetReviewResponse { | undefined; } +export interface CreateCleanRoomAutoApprovalRule { + /** The name of the clean room this auto-approval rule belongs to. */ + cleanRoomName?: string | undefined; + /** A generated UUID identifying the rule. */ + ruleId?: string | undefined; + /** The auto-approved notebook authors. For 2P, this can only be the other collaborator. */ + authors?: + | { + $case: 'authorCollaboratorAlias'; + /** + * Collaborator alias of the author covered by the rule. + * Only one of `author_collaborator_alias` and `author_scope` can be set. + */ + authorCollaboratorAlias: string; + } + | { + $case: 'authorScope'; + /** + * Scope of authors covered by the rule. + * Only one of `author_collaborator_alias` and `author_scope` can be set. + */ + authorScope: CleanRoomAutoApprovalRule_AuthorScope; + } + | undefined; + /** The auto-approved notebook runners. Initially, this can only be one specific runner. */ + runners?: + | { + $case: 'runnerCollaboratorAlias'; + /** Collaborator alias of the runner covered by the rule. */ + runnerCollaboratorAlias: string; + } + | undefined; +} + export interface CreateCleanRoomAutoApprovalRuleRequest { - autoApprovalRule?: CleanRoomAutoApprovalRule | undefined; + autoApprovalRule?: CreateCleanRoomAutoApprovalRule | undefined; +} + +/** Publicly visible clean room collaborator. */ +export interface CreateCleanRoomCollaborator { + /** The global Unity Catalog metastore ID of the collaborator. The identifier is of format cloud:region:metastore-uuid. */ + globalMetastoreId?: string | undefined; + /** + * Workspace ID of the user who is receiving the clean room "invitation". Must be specified if + * invite_recipient_email is specified. + * It should be empty when the collaborator is the creator of the clean room. + */ + inviteRecipientWorkspaceId?: bigint | undefined; + /** + * Email of the user who is receiving the clean room "invitation". It should be empty + * for the creator of the clean room, and non-empty for the invitees of the clean room. + * It is only returned in the output when clean room creator calls GET + */ + inviteRecipientEmail?: string | undefined; + /** + * Collaborator alias specified by the clean room creator. It is unique across all collaborators of this clean room, and used to derive + * multiple values internally such as catalog alias and clean room name for single metastore clean rooms. + * It should follow [UC securable naming requirements](https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements). + */ + collaboratorAlias: string; +} + +export interface CreateCleanRoomOutputCatalog { + /** + * The name of the output catalog in UC. + * It should follow [UC securable naming requirements](https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements). + * The field will always exist if status is CREATED. + */ + catalogName?: string | undefined; } export interface CreateCleanRoomOutputCatalogRequest { /** Name of the clean room. */ cleanRoomName?: string | undefined; - outputCatalog?: CleanRoomOutputCatalog | undefined; + outputCatalog?: CreateCleanRoomOutputCatalog | undefined; } export interface CreateCleanRoomOutputCatalogResponse { outputCatalog?: CleanRoomOutputCatalog | undefined; } +/** Publicly visible central clean room details. */ +export interface CreateCleanRoomRemoteDetail { + /** Cloud vendor (aws,azure,gcp) of the central clean room. */ + cloudVendor?: string | undefined; + /** Region of the central clean room. */ + region?: string | undefined; + /** + * Collaborators in the central clean room. There should one and only one collaborator + * in the list that satisfies the owner condition: + * + * 1. It has the creator's global_metastore_id (determined by caller of CreateCleanRoom). + * + * 2. Its invite_recipient_email is empty. + */ + collaborators?: CreateCleanRoomCollaborator[] | undefined; + /** Egress network policy to apply to the central clean room workspace. */ + egressNetworkPolicy?: CreateEgressNetworkPolicy | undefined; +} + export interface CreateCleanRoomRequest { - cleanRoom?: CleanRoom | undefined; + cleanRoom?: CreateCleanRoom | undefined; +} + +/** + * The network policies applying for egress traffic. + * This message is used by the UI/REST API. We translate this message to the format expected by the + * dataplane in Lakehouse Network Manager (for the format expected by the dataplane, + * see networkconfig.textproto). + */ +export interface CreateEgressNetworkPolicy { + /** The access policy enforced for egress traffic to the internet. */ + internetAccess?: EgressNetworkPolicy_CreateInternetAccessPolicy | undefined; +} + +export interface CreateNotebookVersionReview { + /** Etag identifying the notebook version */ + etag: string; + /** Review outcome */ + reviewState: CleanRoomNotebookReview_NotebookReviewState; + /** Review comment */ + comment?: string | undefined; } export interface DeleteCleanRoomAssetRequest { @@ -839,6 +1105,23 @@ export interface EgressNetworkPolicy { internetAccess?: EgressNetworkPolicy_InternetAccessPolicy | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface EgressNetworkPolicy_CreateInternetAccessPolicy { + restrictionMode?: + | EgressNetworkPolicy_InternetAccessPolicy_RestrictionMode + | undefined; + allowedInternetDestinations?: + | EgressNetworkPolicy_InternetAccessPolicy_CreateInternetDestination[] + | undefined; + allowedStorageDestinations?: + | EgressNetworkPolicy_InternetAccessPolicy_CreateStorageDestination[] + | undefined; + /** Optional. If not specified, assume the policy is enforced for all workloads. */ + logOnlyMode?: + | EgressNetworkPolicy_InternetAccessPolicy_CreateLogOnlyMode + | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface EgressNetworkPolicy_InternetAccessPolicy { restrictionMode?: @@ -856,6 +1139,47 @@ export interface EgressNetworkPolicy_InternetAccessPolicy { | undefined; } +/** + * Users can specify accessible internet destinations when outbound access is restricted. + * We only support domain name (FQDN) destinations for the time being, + * though going forwards we want to support host names and IP addresses. + */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface EgressNetworkPolicy_InternetAccessPolicy_CreateInternetDestination { + destination?: string | undefined; + type?: + | EgressNetworkPolicy_InternetAccessPolicy_InternetDestination_InternetDestinationType + | undefined; + protocol?: + | EgressNetworkPolicy_InternetAccessPolicy_InternetDestination_InternetDestinationFilteringProtocol + | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface EgressNetworkPolicy_InternetAccessPolicy_CreateLogOnlyMode { + logOnlyModeType?: + | EgressNetworkPolicy_InternetAccessPolicy_LogOnlyMode_LogOnlyModeType + | undefined; + workloads?: + | EgressNetworkPolicy_InternetAccessPolicy_LogOnlyMode_WorkloadType[] + | undefined; +} + +/** Users can specify accessible storage destinations. */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface EgressNetworkPolicy_InternetAccessPolicy_CreateStorageDestination { + bucketName?: string | undefined; + region?: string | undefined; + type?: + | EgressNetworkPolicy_InternetAccessPolicy_StorageDestination_StorageDestinationType + | undefined; + azureStorageAccount?: string | undefined; + allowedPaths?: string[] | undefined; + azureStorageService?: string | undefined; + azureDnsZone?: string | undefined; + azureContainer?: string | undefined; +} + /** * Users can specify accessible internet destinations when outbound access is restricted. * We only support domain name (FQDN) destinations for the time being, @@ -1034,12 +1358,38 @@ export interface NotebookVersionReview { // eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface PartitionSpecification {} +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface PartitionSpecification_CreatePartition { + /** An array of partition values. */ + values?: PartitionSpecification_Partition_CreatePartitionValue[] | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface PartitionSpecification_Partition { /** An array of partition values. */ values?: PartitionSpecification_Partition_PartitionValue[] | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface PartitionSpecification_Partition_CreatePartitionValue { + /** The name of the partition column. */ + name?: string | undefined; + /** + * The value of the partition column. When this value is not set, it means `null` value. + * When this field is set, field `recipient_property_key` can not be set. + */ + value?: string | undefined; + /** + * The key of a Delta Sharing recipient's property. For example "databricks-account-id". + * When this field is set, field `value` can not be set. + */ + recipientPropertyKey?: string | undefined; + /** The operator to apply for the value. */ + op?: + | PartitionSpecification_Partition_PartitionValue_PartitionValueOp + | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface PartitionSpecification_Partition_PartitionValue { /** The name of the partition column. */ @@ -1086,18 +1436,18 @@ export interface UpdateCleanRoomAssetRequest { * The asset to update. * The asset's `name` and `asset_type` fields are used to identify the asset to update. */ - asset?: CleanRoomAsset | undefined; + asset?: CreateCleanRoomAsset | undefined; } export interface UpdateCleanRoomAutoApprovalRuleRequest { /** The auto-approval rule to update. The rule_id field is used to identify the rule to update. */ - autoApprovalRule?: CleanRoomAutoApprovalRule | undefined; + autoApprovalRule?: CreateCleanRoomAutoApprovalRule | undefined; } export interface UpdateCleanRoomRequest { /** Name of the clean room. */ name?: string | undefined; - cleanRoom?: CleanRoom | undefined; + cleanRoom?: CreateCleanRoom | undefined; } export const unmarshalCleanRoomSchema: z.ZodType = z @@ -1343,10 +1693,6 @@ export const unmarshalCleanRoomCollaboratorSchema: z.ZodType BigInt(v)) - .optional(), invite_recipient_email: z.string().optional(), collaborator_alias: z.string().optional(), display_name: z.string().optional(), @@ -1354,7 +1700,6 @@ export const unmarshalCleanRoomCollaboratorSchema: z.ZodType ({ globalMetastoreId: d.global_metastore_id, organizationName: d.organization_name, - inviteRecipientWorkspaceId: d.invite_recipient_workspace_id, inviteRecipientEmail: d.invite_recipient_email, collaboratorAlias: d.collaborator_alias, displayName: d.display_name, @@ -1791,66 +2136,113 @@ export const unmarshalPolicyFunctionArgumentSchema: z.ZodType ({ + local_name: d.localName, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalCleanRoomAsset_CreateNotebookSchema: z.ZodType = z + .object({ + notebookContent: z.string(), + runnerCollaboratorAliases: z.array(z.string()).optional(), + }) + .transform(d => ({ + notebook_content: d.notebookContent, + runner_collaborator_aliases: d.runnerCollaboratorAliases, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalCleanRoomAsset_CreateTableSchema: z.ZodType = z.object({}); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalCleanRoomAsset_CreateTableLocalDetailsSchema: z.ZodType = z + .object({ + localName: z.string(), + partitions: z + .array(z.lazy(() => marshalPartitionSpecification_CreatePartitionSchema)) + .optional(), + }) + .transform(d => ({ + local_name: d.localName, + partitions: d.partitions, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalCleanRoomAsset_CreateViewSchema: z.ZodType = z.object({}); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalCleanRoomAsset_CreateViewLocalDetailsSchema: z.ZodType = z + .object({ + localName: z.string(), + }) + .transform(d => ({ + local_name: d.localName, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalCleanRoomAsset_CreateVolumeLocalDetailsSchema: z.ZodType = z + .object({ + localName: z.string(), + }) + .transform(d => ({ + local_name: d.localName, + })); + +export const marshalCreateCleanRoomSchema: z.ZodType = z .object({ name: z.string().optional(), remoteDetailedInfo: z - .lazy(() => marshalCleanRoomRemoteDetailSchema) + .lazy(() => marshalCreateCleanRoomRemoteDetailSchema) .optional(), owner: z.string().optional(), comment: z.string().optional(), - createdAt: z.bigint().optional(), - updatedAt: z.bigint().optional(), - status: z.string().optional(), - localCollaboratorAlias: z.string().optional(), - outputCatalog: z.lazy(() => marshalCleanRoomOutputCatalogSchema).optional(), - accessRestricted: z.string().optional(), }) .transform(d => ({ name: d.name, remote_detailed_info: d.remoteDetailedInfo, owner: d.owner, comment: d.comment, - created_at: d.createdAt, - updated_at: d.updatedAt, - status: d.status, - local_collaborator_alias: d.localCollaboratorAlias, - output_catalog: d.outputCatalog, - access_restricted: d.accessRestricted, })); -export const marshalCleanRoomAssetSchema: z.ZodType = z +export const marshalCreateCleanRoomAssetSchema: z.ZodType = z .object({ cleanRoomName: z.string().optional(), name: z.string().optional(), assetType: z.string().optional(), - addedAt: z.bigint().optional(), - status: z.string().optional(), - ownerCollaboratorAlias: z.string().optional(), localDetails: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('tableLocalDetails'), tableLocalDetails: z.lazy( - () => marshalCleanRoomAsset_TableLocalDetailsSchema + () => marshalCleanRoomAsset_CreateTableLocalDetailsSchema ), }), z.object({ $case: z.literal('volumeLocalDetails'), volumeLocalDetails: z.lazy( - () => marshalCleanRoomAsset_VolumeLocalDetailsSchema + () => marshalCleanRoomAsset_CreateVolumeLocalDetailsSchema ), }), z.object({ $case: z.literal('viewLocalDetails'), viewLocalDetails: z.lazy( - () => marshalCleanRoomAsset_ViewLocalDetailsSchema + () => marshalCleanRoomAsset_CreateViewLocalDetailsSchema ), }), z.object({ $case: z.literal('foreignTableLocalDetails'), foreignTableLocalDetails: z.lazy( - () => marshalCleanRoomAsset_ForeignTableLocalDetailsSchema + () => marshalCleanRoomAsset_CreateForeignTableLocalDetailsSchema ), }), ]) @@ -1859,19 +2251,21 @@ export const marshalCleanRoomAssetSchema: z.ZodType = z .discriminatedUnion('$case', [ z.object({ $case: z.literal('table'), - table: z.lazy(() => marshalCleanRoomAsset_TableSchema), + table: z.lazy(() => marshalCleanRoomAsset_CreateTableSchema), }), z.object({ $case: z.literal('notebook'), - notebook: z.lazy(() => marshalCleanRoomAsset_NotebookSchema), + notebook: z.lazy(() => marshalCleanRoomAsset_CreateNotebookSchema), }), z.object({ $case: z.literal('view'), - view: z.lazy(() => marshalCleanRoomAsset_ViewSchema), + view: z.lazy(() => marshalCleanRoomAsset_CreateViewSchema), }), z.object({ $case: z.literal('foreignTable'), - foreignTable: z.lazy(() => marshalCleanRoomAsset_ForeignTableSchema), + foreignTable: z.lazy( + () => marshalCleanRoomAsset_CreateForeignTableSchema + ), }), ]) .optional(), @@ -1880,9 +2274,6 @@ export const marshalCleanRoomAssetSchema: z.ZodType = z clean_room_name: d.cleanRoomName, name: d.name, asset_type: d.assetType, - added_at: d.addedAt, - status: d.status, - owner_collaborator_alias: d.ownerCollaboratorAlias, ...(d.localDetails?.$case === 'tableLocalDetails' && { table_local_details: d.localDetails.tableLocalDetails, }), @@ -1903,97 +2294,35 @@ export const marshalCleanRoomAssetSchema: z.ZodType = z }), })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCleanRoomAsset_ForeignTableSchema: z.ZodType = z - .object({ - columns: z.array(z.lazy(() => marshalColumnInfoSchema)).optional(), - }) - .transform(d => ({ - columns: d.columns, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCleanRoomAsset_ForeignTableLocalDetailsSchema: z.ZodType = z - .object({ - localName: z.string().optional(), - }) - .transform(d => ({ - local_name: d.localName, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCleanRoomAsset_NotebookSchema: z.ZodType = z - .object({ - notebookContent: z.string().optional(), - etag: z.string().optional(), - runnerCollaboratorAliases: z.array(z.string()).optional(), - reviews: z - .array(z.lazy(() => marshalCleanRoomNotebookReviewSchema)) - .optional(), - reviewState: z.string().optional(), - }) - .transform(d => ({ - notebook_content: d.notebookContent, - etag: d.etag, - runner_collaborator_aliases: d.runnerCollaboratorAliases, - reviews: d.reviews, - review_state: d.reviewState, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCleanRoomAsset_TableSchema: z.ZodType = z - .object({ - columns: z.array(z.lazy(() => marshalColumnInfoSchema)).optional(), - }) - .transform(d => ({ - columns: d.columns, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCleanRoomAsset_TableLocalDetailsSchema: z.ZodType = z +export const marshalCreateCleanRoomAssetReviewRequestSchema: z.ZodType = z .object({ - localName: z.string().optional(), - partitions: z - .array(z.lazy(() => marshalPartitionSpecification_PartitionSchema)) + cleanRoomName: z.string().optional(), + name: z.string().optional(), + assetType: z.string().optional(), + review: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('notebookReview'), + notebookReview: z.lazy( + () => marshalCreateNotebookVersionReviewSchema + ), + }), + ]) .optional(), }) .transform(d => ({ - local_name: d.localName, - partitions: d.partitions, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCleanRoomAsset_ViewSchema: z.ZodType = z - .object({ - columns: z.array(z.lazy(() => marshalColumnInfoSchema)).optional(), - }) - .transform(d => ({ - columns: d.columns, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCleanRoomAsset_ViewLocalDetailsSchema: z.ZodType = z - .object({ - localName: z.string().optional(), - }) - .transform(d => ({ - local_name: d.localName, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCleanRoomAsset_VolumeLocalDetailsSchema: z.ZodType = z - .object({ - localName: z.string().optional(), - }) - .transform(d => ({ - local_name: d.localName, + clean_room_name: d.cleanRoomName, + name: d.name, + asset_type: d.assetType, + ...(d.review?.$case === 'notebookReview' && { + notebook_review: d.review.notebookReview, + }), })); -export const marshalCleanRoomAutoApprovalRuleSchema: z.ZodType = z +export const marshalCreateCleanRoomAutoApprovalRuleSchema: z.ZodType = z .object({ cleanRoomName: z.string().optional(), ruleId: z.string().optional(), - ruleOwnerCollaboratorAlias: z.string().optional(), authors: z .discriminatedUnion('$case', [ z.object({ @@ -2011,12 +2340,10 @@ export const marshalCleanRoomAutoApprovalRuleSchema: z.ZodType = z }), ]) .optional(), - createdAt: z.bigint().optional(), }) .transform(d => ({ clean_room_name: d.cleanRoomName, rule_id: d.ruleId, - rule_owner_collaborator_alias: d.ruleOwnerCollaboratorAlias, ...(d.authors?.$case === 'authorCollaboratorAlias' && { author_collaborator_alias: d.authors.authorCollaboratorAlias, }), @@ -2026,178 +2353,82 @@ export const marshalCleanRoomAutoApprovalRuleSchema: z.ZodType = z ...(d.runners?.$case === 'runnerCollaboratorAlias' && { runner_collaborator_alias: d.runners.runnerCollaboratorAlias, }), - created_at: d.createdAt, })); -export const marshalCleanRoomCollaboratorSchema: z.ZodType = z +export const marshalCreateCleanRoomAutoApprovalRuleRequestSchema: z.ZodType = z + .object({ + autoApprovalRule: z + .lazy(() => marshalCreateCleanRoomAutoApprovalRuleSchema) + .optional(), + }) + .transform(d => ({ + auto_approval_rule: d.autoApprovalRule, + })); + +export const marshalCreateCleanRoomCollaboratorSchema: z.ZodType = z .object({ globalMetastoreId: z.string().optional(), - organizationName: z.string().optional(), inviteRecipientWorkspaceId: z.bigint().optional(), inviteRecipientEmail: z.string().optional(), - collaboratorAlias: z.string().optional(), - displayName: z.string().optional(), + collaboratorAlias: z.string(), }) .transform(d => ({ global_metastore_id: d.globalMetastoreId, - organization_name: d.organizationName, invite_recipient_workspace_id: d.inviteRecipientWorkspaceId, invite_recipient_email: d.inviteRecipientEmail, collaborator_alias: d.collaboratorAlias, - display_name: d.displayName, - })); - -export const marshalCleanRoomNotebookReviewSchema: z.ZodType = z - .object({ - reviewerCollaboratorAlias: z.string().optional(), - createdAtMillis: z.bigint().optional(), - reviewState: z.string().optional(), - comment: z.string().optional(), - reviewSubReason: z.string().optional(), - }) - .transform(d => ({ - reviewer_collaborator_alias: d.reviewerCollaboratorAlias, - created_at_millis: d.createdAtMillis, - review_state: d.reviewState, - comment: d.comment, - review_sub_reason: d.reviewSubReason, })); -export const marshalCleanRoomOutputCatalogSchema: z.ZodType = z +export const marshalCreateCleanRoomOutputCatalogSchema: z.ZodType = z .object({ - status: z.string().optional(), catalogName: z.string().optional(), }) .transform(d => ({ - status: d.status, catalog_name: d.catalogName, })); -export const marshalCleanRoomRemoteDetailSchema: z.ZodType = z +export const marshalCreateCleanRoomRemoteDetailSchema: z.ZodType = z .object({ - centralCleanRoomId: z.string().optional(), cloudVendor: z.string().optional(), region: z.string().optional(), collaborators: z - .array(z.lazy(() => marshalCleanRoomCollaboratorSchema)) + .array(z.lazy(() => marshalCreateCleanRoomCollaboratorSchema)) .optional(), - creator: z.lazy(() => marshalCleanRoomCollaboratorSchema).optional(), egressNetworkPolicy: z - .lazy(() => marshalEgressNetworkPolicySchema) - .optional(), - complianceSecurityProfile: z - .lazy(() => marshalComplianceSecurityProfileSchema) + .lazy(() => marshalCreateEgressNetworkPolicySchema) .optional(), }) .transform(d => ({ - central_clean_room_id: d.centralCleanRoomId, cloud_vendor: d.cloudVendor, region: d.region, collaborators: d.collaborators, - creator: d.creator, egress_network_policy: d.egressNetworkPolicy, - compliance_security_profile: d.complianceSecurityProfile, - })); - -export const marshalColumnInfoSchema: z.ZodType = z - .object({ - name: z.string().optional(), - typeText: z.string().optional(), - typeName: z.string().optional(), - position: z.number().optional(), - typePrecision: z.number().optional(), - typeScale: z.number().optional(), - typeIntervalType: z.string().optional(), - typeJson: z.string().optional(), - comment: z.string().optional(), - nullable: z.boolean().optional(), - partitionIndex: z.number().optional(), - mask: z.lazy(() => marshalColumnMaskSchema).optional(), - }) - .transform(d => ({ - name: d.name, - type_text: d.typeText, - type_name: d.typeName, - position: d.position, - type_precision: d.typePrecision, - type_scale: d.typeScale, - type_interval_type: d.typeIntervalType, - type_json: d.typeJson, - comment: d.comment, - nullable: d.nullable, - partition_index: d.partitionIndex, - mask: d.mask, - })); - -export const marshalColumnMaskSchema: z.ZodType = z - .object({ - functionName: z.string().optional(), - usingColumnNames: z.array(z.string()).optional(), - usingArguments: z - .array(z.lazy(() => marshalPolicyFunctionArgumentSchema)) - .optional(), - }) - .transform(d => ({ - function_name: d.functionName, - using_column_names: d.usingColumnNames, - using_arguments: d.usingArguments, - })); - -export const marshalComplianceSecurityProfileSchema: z.ZodType = z - .object({ - isEnabled: z.boolean().optional(), - complianceStandards: z.array(z.string()).optional(), - }) - .transform(d => ({ - is_enabled: d.isEnabled, - compliance_standards: d.complianceStandards, - })); - -export const marshalCreateCleanRoomAssetReviewRequestSchema: z.ZodType = z - .object({ - cleanRoomName: z.string().optional(), - name: z.string().optional(), - assetType: z.string().optional(), - review: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('notebookReview'), - notebookReview: z.lazy(() => marshalNotebookVersionReviewSchema), - }), - ]) - .optional(), - }) - .transform(d => ({ - clean_room_name: d.cleanRoomName, - name: d.name, - asset_type: d.assetType, - ...(d.review?.$case === 'notebookReview' && { - notebook_review: d.review.notebookReview, - }), })); -export const marshalCreateCleanRoomAutoApprovalRuleRequestSchema: z.ZodType = z +export const marshalCreateEgressNetworkPolicySchema: z.ZodType = z .object({ - autoApprovalRule: z - .lazy(() => marshalCleanRoomAutoApprovalRuleSchema) + internetAccess: z + .lazy(() => marshalEgressNetworkPolicy_CreateInternetAccessPolicySchema) .optional(), }) .transform(d => ({ - auto_approval_rule: d.autoApprovalRule, + internet_access: d.internetAccess, })); -export const marshalEgressNetworkPolicySchema: z.ZodType = z +export const marshalCreateNotebookVersionReviewSchema: z.ZodType = z .object({ - internetAccess: z - .lazy(() => marshalEgressNetworkPolicy_InternetAccessPolicySchema) - .optional(), + etag: z.string(), + reviewState: z.string(), + comment: z.string().optional(), }) .transform(d => ({ - internet_access: d.internetAccess, + etag: d.etag, + review_state: d.reviewState, + comment: d.comment, })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalEgressNetworkPolicy_InternetAccessPolicySchema: z.ZodType = +export const marshalEgressNetworkPolicy_CreateInternetAccessPolicySchema: z.ZodType = z .object({ restrictionMode: z.string().optional(), @@ -2205,7 +2436,7 @@ export const marshalEgressNetworkPolicy_InternetAccessPolicySchema: z.ZodType = .array( z.lazy( () => - marshalEgressNetworkPolicy_InternetAccessPolicy_InternetDestinationSchema + marshalEgressNetworkPolicy_InternetAccessPolicy_CreateInternetDestinationSchema ) ) .optional(), @@ -2213,14 +2444,14 @@ export const marshalEgressNetworkPolicy_InternetAccessPolicySchema: z.ZodType = .array( z.lazy( () => - marshalEgressNetworkPolicy_InternetAccessPolicy_StorageDestinationSchema + marshalEgressNetworkPolicy_InternetAccessPolicy_CreateStorageDestinationSchema ) ) .optional(), logOnlyMode: z .lazy( () => - marshalEgressNetworkPolicy_InternetAccessPolicy_LogOnlyModeSchema + marshalEgressNetworkPolicy_InternetAccessPolicy_CreateLogOnlyModeSchema ) .optional(), }) @@ -2232,7 +2463,7 @@ export const marshalEgressNetworkPolicy_InternetAccessPolicySchema: z.ZodType = })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalEgressNetworkPolicy_InternetAccessPolicy_InternetDestinationSchema: z.ZodType = +export const marshalEgressNetworkPolicy_InternetAccessPolicy_CreateInternetDestinationSchema: z.ZodType = z .object({ destination: z.string().optional(), @@ -2246,7 +2477,7 @@ export const marshalEgressNetworkPolicy_InternetAccessPolicy_InternetDestination })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalEgressNetworkPolicy_InternetAccessPolicy_LogOnlyModeSchema: z.ZodType = +export const marshalEgressNetworkPolicy_InternetAccessPolicy_CreateLogOnlyModeSchema: z.ZodType = z .object({ logOnlyModeType: z.string().optional(), @@ -2258,7 +2489,7 @@ export const marshalEgressNetworkPolicy_InternetAccessPolicy_LogOnlyModeSchema: })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalEgressNetworkPolicy_InternetAccessPolicy_StorageDestinationSchema: z.ZodType = +export const marshalEgressNetworkPolicy_InternetAccessPolicy_CreateStorageDestinationSchema: z.ZodType = z .object({ bucketName: z.string().optional(), @@ -2281,25 +2512,14 @@ export const marshalEgressNetworkPolicy_InternetAccessPolicy_StorageDestinationS azure_container: d.azureContainer, })); -export const marshalNotebookVersionReviewSchema: z.ZodType = z - .object({ - etag: z.string().optional(), - reviewState: z.string().optional(), - comment: z.string().optional(), - }) - .transform(d => ({ - etag: d.etag, - review_state: d.reviewState, - comment: d.comment, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalPartitionSpecification_PartitionSchema: z.ZodType = z +export const marshalPartitionSpecification_CreatePartitionSchema: z.ZodType = z .object({ values: z .array( z.lazy( - () => marshalPartitionSpecification_Partition_PartitionValueSchema + () => + marshalPartitionSpecification_Partition_CreatePartitionValueSchema ) ) .optional(), @@ -2309,7 +2529,7 @@ export const marshalPartitionSpecification_PartitionSchema: z.ZodType = z })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalPartitionSpecification_Partition_PartitionValueSchema: z.ZodType = +export const marshalPartitionSpecification_Partition_CreatePartitionValueSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -2324,24 +2544,10 @@ export const marshalPartitionSpecification_Partition_PartitionValueSchema: z.Zod op: d.op, })); -export const marshalPolicyFunctionArgumentSchema: z.ZodType = z - .object({ - arg: z - .discriminatedUnion('$case', [ - z.object({$case: z.literal('column'), column: z.string()}), - z.object({$case: z.literal('constant'), constant: z.string()}), - ]) - .optional(), - }) - .transform(d => ({ - ...(d.arg?.$case === 'column' && {column: d.arg.column}), - ...(d.arg?.$case === 'constant' && {constant: d.arg.constant}), - })); - export const marshalUpdateCleanRoomRequestSchema: z.ZodType = z .object({ name: z.string().optional(), - cleanRoom: z.lazy(() => marshalCleanRoomSchema).optional(), + cleanRoom: z.lazy(() => marshalCreateCleanRoomSchema).optional(), }) .transform(d => ({ name: d.name, diff --git a/packages/clusterlibraries/src/v2/index.ts b/packages/clusterlibraries/src/v2/index.ts index 46a37782..6698f762 100755 --- a/packages/clusterlibraries/src/v2/index.ts +++ b/packages/clusterlibraries/src/v2/index.ts @@ -11,6 +11,10 @@ export {LibraryInstallStatus} from './model'; export type { ClusterLibraryStatuses, ClusterStatusRequest, + CreateLibrary, + CreateMavenLibrary, + CreatePythonPyPiLibrary, + CreateRCranLibrary, InstallLibrariesRequest, InstallLibrariesResponse, Library, diff --git a/packages/clusterlibraries/src/v2/model.ts b/packages/clusterlibraries/src/v2/model.ts index be0e5a8c..f59de3fc 100755 --- a/packages/clusterlibraries/src/v2/model.ts +++ b/packages/clusterlibraries/src/v2/model.ts @@ -51,11 +51,109 @@ export interface ClusterStatusRequest { clusterId?: string | undefined; } +export interface CreateLibrary { + lib?: + | { + $case: 'jar'; + /** + * URI of the JAR library to install. Supported URIs include Workspace paths, Unity Catalog Volumes paths, and S3 URIs. + * For example: `{ "jar": "/Workspace/path/to/library.jar" }`, `{ "jar" : "/Volumes/path/to/library.jar" }` or + * `{ "jar": "s3://my-bucket/library.jar" }`. + * If S3 is used, please make sure the cluster has read access on the library. You may need to + * launch the cluster with an IAM role to access the S3 URI. + */ + jar: string; + } + | { + $case: 'egg'; + /** Deprecated. URI of the egg library to install. Installing Python egg files is deprecated and is not supported in Databricks Runtime 14.0 and above. */ + egg: string; + } + | { + $case: 'pypi'; + /** + * Specification of a PyPi library to be installed. For example: + * `{ "package": "simplejson" }` + */ + pypi: CreatePythonPyPiLibrary; + } + | { + $case: 'maven'; + /** + * Specification of a maven library to be installed. For example: + * `{ "coordinates": "org.jsoup:jsoup:1.7.2" }` + */ + maven: CreateMavenLibrary; + } + | { + $case: 'cran'; + /** Specification of a CRAN library to be installed as part of the library */ + cran: CreateRCranLibrary; + } + | { + $case: 'whl'; + /** + * URI of the wheel library to install. Supported URIs include Workspace paths, Unity Catalog Volumes paths, and S3 URIs. + * For example: `{ "whl": "/Workspace/path/to/library.whl" }`, `{ "whl" : "/Volumes/path/to/library.whl" }` or + * `{ "whl": "s3://my-bucket/library.whl" }`. + * If S3 is used, please make sure the cluster has read access on the library. You may need to + * launch the cluster with an IAM role to access the S3 URI. + */ + whl: string; + } + | { + $case: 'requirements'; + /** + * URI of the requirements.txt file to install. Only Workspace paths and Unity Catalog Volumes paths are supported. + * For example: `{ "requirements": "/Workspace/path/to/requirements.txt" }` or `{ "requirements" : "/Volumes/path/to/requirements.txt" }` + */ + requirements: string; + } + | undefined; +} + +export interface CreateMavenLibrary { + /** Gradle-style maven coordinates. For example: "org.jsoup:jsoup:1.7.2". */ + coordinates: string; + /** + * Maven repo to install the Maven package from. If omitted, both Maven Central Repository + * and Spark Packages are searched. + */ + repo?: string | undefined; + /** + * List of dependences to exclude. For example: `["slf4j:slf4j", "*:hadoop-client"]`. + * + * Maven dependency exclusions: + * https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html. + */ + exclusions?: string[] | undefined; +} + +export interface CreatePythonPyPiLibrary { + /** + * The name of the pypi package to install. An optional exact version specification is also + * supported. Examples: "simplejson" and "simplejson==3.8.0". + */ + package: string; + /** + * The repository where the package can be found. If not specified, the default pip index is + * used. + */ + repo?: string | undefined; +} + +export interface CreateRCranLibrary { + /** The name of the CRAN package to install. */ + package: string; + /** The repository where the package can be found. If not specified, the default CRAN repo is used. */ + repo?: string | undefined; +} + export interface InstallLibrariesRequest { /** Unique identifier for the cluster on which to install these libraries. */ clusterId?: string | undefined; /** The libraries to install. */ - libraries?: Library[] | undefined; + libraries?: CreateLibrary[] | undefined; } // eslint-disable-next-line @typescript-eslint/no-empty-object-type @@ -183,7 +281,7 @@ export interface UninstallLibrariesRequest { /** Unique identifier for the cluster on which to uninstall these libraries. */ clusterId?: string | undefined; /** The libraries to uninstall. */ - libraries?: Library[] | undefined; + libraries?: CreateLibrary[] | undefined; } // eslint-disable-next-line @typescript-eslint/no-empty-object-type @@ -297,17 +395,7 @@ export const unmarshalRCranLibrarySchema: z.ZodType = z export const unmarshalUninstallLibrariesResponseSchema: z.ZodType = z.object({}); -export const marshalInstallLibrariesRequestSchema: z.ZodType = z - .object({ - clusterId: z.string().optional(), - libraries: z.array(z.lazy(() => marshalLibrarySchema)).optional(), - }) - .transform(d => ({ - cluster_id: d.clusterId, - libraries: d.libraries, - })); - -export const marshalLibrarySchema: z.ZodType = z +export const marshalCreateLibrarySchema: z.ZodType = z .object({ lib: z .discriminatedUnion('$case', [ @@ -315,15 +403,15 @@ export const marshalLibrarySchema: z.ZodType = z z.object({$case: z.literal('egg'), egg: z.string()}), z.object({ $case: z.literal('pypi'), - pypi: z.lazy(() => marshalPythonPyPiLibrarySchema), + pypi: z.lazy(() => marshalCreatePythonPyPiLibrarySchema), }), z.object({ $case: z.literal('maven'), - maven: z.lazy(() => marshalMavenLibrarySchema), + maven: z.lazy(() => marshalCreateMavenLibrarySchema), }), z.object({ $case: z.literal('cran'), - cran: z.lazy(() => marshalRCranLibrarySchema), + cran: z.lazy(() => marshalCreateRCranLibrarySchema), }), z.object({$case: z.literal('whl'), whl: z.string()}), z.object({$case: z.literal('requirements'), requirements: z.string()}), @@ -340,9 +428,9 @@ export const marshalLibrarySchema: z.ZodType = z ...(d.lib?.$case === 'requirements' && {requirements: d.lib.requirements}), })); -export const marshalMavenLibrarySchema: z.ZodType = z +export const marshalCreateMavenLibrarySchema: z.ZodType = z .object({ - coordinates: z.string().optional(), + coordinates: z.string(), repo: z.string().optional(), exclusions: z.array(z.string()).optional(), }) @@ -352,9 +440,9 @@ export const marshalMavenLibrarySchema: z.ZodType = z exclusions: d.exclusions, })); -export const marshalPythonPyPiLibrarySchema: z.ZodType = z +export const marshalCreatePythonPyPiLibrarySchema: z.ZodType = z .object({ - package: z.string().optional(), + package: z.string(), repo: z.string().optional(), }) .transform(d => ({ @@ -362,9 +450,9 @@ export const marshalPythonPyPiLibrarySchema: z.ZodType = z repo: d.repo, })); -export const marshalRCranLibrarySchema: z.ZodType = z +export const marshalCreateRCranLibrarySchema: z.ZodType = z .object({ - package: z.string().optional(), + package: z.string(), repo: z.string().optional(), }) .transform(d => ({ @@ -372,10 +460,20 @@ export const marshalRCranLibrarySchema: z.ZodType = z repo: d.repo, })); +export const marshalInstallLibrariesRequestSchema: z.ZodType = z + .object({ + clusterId: z.string().optional(), + libraries: z.array(z.lazy(() => marshalCreateLibrarySchema)).optional(), + }) + .transform(d => ({ + cluster_id: d.clusterId, + libraries: d.libraries, + })); + export const marshalUninstallLibrariesRequestSchema: z.ZodType = z .object({ clusterId: z.string().optional(), - libraries: z.array(z.lazy(() => marshalLibrarySchema)).optional(), + libraries: z.array(z.lazy(() => marshalCreateLibrarySchema)).optional(), }) .transform(d => ({ cluster_id: d.clusterId, diff --git a/packages/clusterpolicies/src/v2/index.ts b/packages/clusterpolicies/src/v2/index.ts index 79176d71..e1f3a3b1 100755 --- a/packages/clusterpolicies/src/v2/index.ts +++ b/packages/clusterpolicies/src/v2/index.ts @@ -9,8 +9,12 @@ export {ClusterPoliciesClient} from './client'; export {ListOrder, PolicySortColumn} from './model'; export type { + CreateLibrary, + CreateMavenLibrary, CreatePolicyRequest, CreatePolicyResponse, + CreatePythonPyPiLibrary, + CreateRCranLibrary, DeletePolicyRequest, DeletePolicyResponse, EditPolicyRequest, diff --git a/packages/clusterpolicies/src/v2/model.ts b/packages/clusterpolicies/src/v2/model.ts index 24c4aff8..f58d8ecf 100755 --- a/packages/clusterpolicies/src/v2/model.ts +++ b/packages/clusterpolicies/src/v2/model.ts @@ -22,6 +22,84 @@ export type PolicySortColumn = | (typeof PolicySortColumn)[keyof typeof PolicySortColumn] | (string & {}); +export interface CreateLibrary { + lib?: + | { + $case: 'jar'; + /** + * URI of the JAR library to install. Supported URIs include Workspace paths, Unity Catalog Volumes paths, and S3 URIs. + * For example: `{ "jar": "/Workspace/path/to/library.jar" }`, `{ "jar" : "/Volumes/path/to/library.jar" }` or + * `{ "jar": "s3://my-bucket/library.jar" }`. + * If S3 is used, please make sure the cluster has read access on the library. You may need to + * launch the cluster with an IAM role to access the S3 URI. + */ + jar: string; + } + | { + $case: 'egg'; + /** Deprecated. URI of the egg library to install. Installing Python egg files is deprecated and is not supported in Databricks Runtime 14.0 and above. */ + egg: string; + } + | { + $case: 'pypi'; + /** + * Specification of a PyPi library to be installed. For example: + * `{ "package": "simplejson" }` + */ + pypi: CreatePythonPyPiLibrary; + } + | { + $case: 'maven'; + /** + * Specification of a maven library to be installed. For example: + * `{ "coordinates": "org.jsoup:jsoup:1.7.2" }` + */ + maven: CreateMavenLibrary; + } + | { + $case: 'cran'; + /** Specification of a CRAN library to be installed as part of the library */ + cran: CreateRCranLibrary; + } + | { + $case: 'whl'; + /** + * URI of the wheel library to install. Supported URIs include Workspace paths, Unity Catalog Volumes paths, and S3 URIs. + * For example: `{ "whl": "/Workspace/path/to/library.whl" }`, `{ "whl" : "/Volumes/path/to/library.whl" }` or + * `{ "whl": "s3://my-bucket/library.whl" }`. + * If S3 is used, please make sure the cluster has read access on the library. You may need to + * launch the cluster with an IAM role to access the S3 URI. + */ + whl: string; + } + | { + $case: 'requirements'; + /** + * URI of the requirements.txt file to install. Only Workspace paths and Unity Catalog Volumes paths are supported. + * For example: `{ "requirements": "/Workspace/path/to/requirements.txt" }` or `{ "requirements" : "/Volumes/path/to/requirements.txt" }` + */ + requirements: string; + } + | undefined; +} + +export interface CreateMavenLibrary { + /** Gradle-style maven coordinates. For example: "org.jsoup:jsoup:1.7.2". */ + coordinates: string; + /** + * Maven repo to install the Maven package from. If omitted, both Maven Central Repository + * and Spark Packages are searched. + */ + repo?: string | undefined; + /** + * List of dependences to exclude. For example: `["slf4j:slf4j", "*:hadoop-client"]`. + * + * Maven dependency exclusions: + * https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html. + */ + exclusions?: string[] | undefined; +} + export interface CreatePolicyRequest { /** * Cluster Policy name requested by the user. This has to be unique. Length must be between 1 and 100 @@ -51,7 +129,7 @@ export interface CreatePolicyRequest { /** Max number of clusters per user that can be active using this policy. If not present, there is no max limit. */ maxClustersPerUser?: bigint | undefined; /** A list of libraries to be installed on the next cluster restart that uses this policy. The maximum number of libraries is 500. */ - libraries?: Library[] | undefined; + libraries?: CreateLibrary[] | undefined; } export interface CreatePolicyResponse { @@ -59,6 +137,26 @@ export interface CreatePolicyResponse { policyId?: string | undefined; } +export interface CreatePythonPyPiLibrary { + /** + * The name of the pypi package to install. An optional exact version specification is also + * supported. Examples: "simplejson" and "simplejson==3.8.0". + */ + package: string; + /** + * The repository where the package can be found. If not specified, the default pip index is + * used. + */ + repo?: string | undefined; +} + +export interface CreateRCranLibrary { + /** The name of the CRAN package to install. */ + package: string; + /** The repository where the package can be found. If not specified, the default CRAN repo is used. */ + repo?: string | undefined; +} + export interface DeletePolicyRequest { /** The ID of the policy to delete. */ policyId?: string | undefined; @@ -98,7 +196,7 @@ export interface EditPolicyRequest { /** Max number of clusters per user that can be active using this policy. If not present, there is no max limit. */ maxClustersPerUser?: bigint | undefined; /** A list of libraries to be installed on the next cluster restart that uses this policy. The maximum number of libraries is 500. */ - libraries?: Library[] | undefined; + libraries?: CreateLibrary[] | undefined; } // eslint-disable-next-line @typescript-eslint/no-empty-object-type @@ -396,57 +494,7 @@ export const unmarshalRCranLibrarySchema: z.ZodType = z repo: d.repo, })); -export const marshalCreatePolicyRequestSchema: z.ZodType = z - .object({ - name: z.string().optional(), - definition: z.string().optional(), - description: z.string().optional(), - policyFamilyId: z.string().optional(), - policyFamilyDefinitionOverrides: z.string().optional(), - maxClustersPerUser: z.bigint().optional(), - libraries: z.array(z.lazy(() => marshalLibrarySchema)).optional(), - }) - .transform(d => ({ - name: d.name, - definition: d.definition, - description: d.description, - policy_family_id: d.policyFamilyId, - policy_family_definition_overrides: d.policyFamilyDefinitionOverrides, - max_clusters_per_user: d.maxClustersPerUser, - libraries: d.libraries, - })); - -export const marshalDeletePolicyRequestSchema: z.ZodType = z - .object({ - policyId: z.string().optional(), - }) - .transform(d => ({ - policy_id: d.policyId, - })); - -export const marshalEditPolicyRequestSchema: z.ZodType = z - .object({ - policyId: z.string().optional(), - name: z.string().optional(), - definition: z.string().optional(), - description: z.string().optional(), - policyFamilyId: z.string().optional(), - policyFamilyDefinitionOverrides: z.string().optional(), - maxClustersPerUser: z.bigint().optional(), - libraries: z.array(z.lazy(() => marshalLibrarySchema)).optional(), - }) - .transform(d => ({ - policy_id: d.policyId, - name: d.name, - definition: d.definition, - description: d.description, - policy_family_id: d.policyFamilyId, - policy_family_definition_overrides: d.policyFamilyDefinitionOverrides, - max_clusters_per_user: d.maxClustersPerUser, - libraries: d.libraries, - })); - -export const marshalLibrarySchema: z.ZodType = z +export const marshalCreateLibrarySchema: z.ZodType = z .object({ lib: z .discriminatedUnion('$case', [ @@ -454,15 +502,15 @@ export const marshalLibrarySchema: z.ZodType = z z.object({$case: z.literal('egg'), egg: z.string()}), z.object({ $case: z.literal('pypi'), - pypi: z.lazy(() => marshalPythonPyPiLibrarySchema), + pypi: z.lazy(() => marshalCreatePythonPyPiLibrarySchema), }), z.object({ $case: z.literal('maven'), - maven: z.lazy(() => marshalMavenLibrarySchema), + maven: z.lazy(() => marshalCreateMavenLibrarySchema), }), z.object({ $case: z.literal('cran'), - cran: z.lazy(() => marshalRCranLibrarySchema), + cran: z.lazy(() => marshalCreateRCranLibrarySchema), }), z.object({$case: z.literal('whl'), whl: z.string()}), z.object({$case: z.literal('requirements'), requirements: z.string()}), @@ -479,9 +527,9 @@ export const marshalLibrarySchema: z.ZodType = z ...(d.lib?.$case === 'requirements' && {requirements: d.lib.requirements}), })); -export const marshalMavenLibrarySchema: z.ZodType = z +export const marshalCreateMavenLibrarySchema: z.ZodType = z .object({ - coordinates: z.string().optional(), + coordinates: z.string(), repo: z.string().optional(), exclusions: z.array(z.string()).optional(), }) @@ -491,9 +539,29 @@ export const marshalMavenLibrarySchema: z.ZodType = z exclusions: d.exclusions, })); -export const marshalPythonPyPiLibrarySchema: z.ZodType = z +export const marshalCreatePolicyRequestSchema: z.ZodType = z .object({ - package: z.string().optional(), + name: z.string().optional(), + definition: z.string().optional(), + description: z.string().optional(), + policyFamilyId: z.string().optional(), + policyFamilyDefinitionOverrides: z.string().optional(), + maxClustersPerUser: z.bigint().optional(), + libraries: z.array(z.lazy(() => marshalCreateLibrarySchema)).optional(), + }) + .transform(d => ({ + name: d.name, + definition: d.definition, + description: d.description, + policy_family_id: d.policyFamilyId, + policy_family_definition_overrides: d.policyFamilyDefinitionOverrides, + max_clusters_per_user: d.maxClustersPerUser, + libraries: d.libraries, + })); + +export const marshalCreatePythonPyPiLibrarySchema: z.ZodType = z + .object({ + package: z.string(), repo: z.string().optional(), }) .transform(d => ({ @@ -501,12 +569,42 @@ export const marshalPythonPyPiLibrarySchema: z.ZodType = z repo: d.repo, })); -export const marshalRCranLibrarySchema: z.ZodType = z +export const marshalCreateRCranLibrarySchema: z.ZodType = z .object({ - package: z.string().optional(), + package: z.string(), repo: z.string().optional(), }) .transform(d => ({ package: d.package, repo: d.repo, })); + +export const marshalDeletePolicyRequestSchema: z.ZodType = z + .object({ + policyId: z.string().optional(), + }) + .transform(d => ({ + policy_id: d.policyId, + })); + +export const marshalEditPolicyRequestSchema: z.ZodType = z + .object({ + policyId: z.string().optional(), + name: z.string().optional(), + definition: z.string().optional(), + description: z.string().optional(), + policyFamilyId: z.string().optional(), + policyFamilyDefinitionOverrides: z.string().optional(), + maxClustersPerUser: z.bigint().optional(), + libraries: z.array(z.lazy(() => marshalCreateLibrarySchema)).optional(), + }) + .transform(d => ({ + policy_id: d.policyId, + name: d.name, + definition: d.definition, + description: d.description, + policy_family_id: d.policyFamilyId, + policy_family_definition_overrides: d.policyFamilyDefinitionOverrides, + max_clusters_per_user: d.maxClustersPerUser, + libraries: d.libraries, + })); diff --git a/packages/clusters/src/v2/index.ts b/packages/clusters/src/v2/index.ts index 0c781707..726dd575 100755 --- a/packages/clusters/src/v2/index.ts +++ b/packages/clusters/src/v2/index.ts @@ -58,8 +58,27 @@ export type { ClusterLogConf, ClusterSize, ClusterState, + CreateAdlsgen2Info, + CreateAutoScale, + CreateAwsAttributes, + CreateAzureAttributes, + CreateCloneCluster, + CreateClusterLogConf, CreateClusterRequest, CreateClusterResponse, + CreateDbfsStorageInfo, + CreateDockerBasicAuth, + CreateDockerImage, + CreateGcpAttributes, + CreateGcsStorageInfo, + CreateInitScriptInfo, + CreateLocalFileInfo, + CreateLogAnalyticsInfo, + CreateNodeTypeFlexibility, + CreateS3StorageInfo, + CreateVolumesStorageInfo, + CreateWorkloadType, + CreateWorkspaceStorageInfo, DataPlaneEventDetails, DbfsStorageInfo, DeleteClusterRequest, @@ -120,13 +139,34 @@ export type { TerminationReason, UnpinClusterRequest, UnpinClusterResponse, + UpdateAdlsgen2Info, + UpdateAutoScale, + UpdateAwsAttributes, + UpdateAzureAttributes, + UpdateClusterLogConf, UpdateClusterRequest, UpdateClusterRequest_UpdateClusterResource, + UpdateClusterRequest_UpdateUpdateClusterResource, UpdateClusterResponse, + UpdateDbfsStorageInfo, + UpdateDockerBasicAuth, + UpdateDockerImage, + UpdateGcpAttributes, + UpdateGcsStorageInfo, + UpdateInitScriptInfo, + UpdateLocalFileInfo, + UpdateLogAnalyticsInfo, + UpdateNodeTypeFlexibility, + UpdateS3StorageInfo, + UpdateVolumesStorageInfo, + UpdateWorkloadType, + UpdateWorkspaceStorageInfo, VolumesStorageInfo, WorkloadType, WorkloadType_ClientsTypes, + WorkloadType_CreateClientsTypes, + WorkloadType_UpdateClientsTypes, WorkspaceStorageInfo, } from './model'; -export {updateClusterRequest_UpdateClusterResourceFieldMask} from './model'; +export {updateClusterRequest_UpdateUpdateClusterResourceFieldMask} from './model'; diff --git a/packages/clusters/src/v2/model.ts b/packages/clusters/src/v2/model.ts index a53ff1e8..f7930ef9 100755 --- a/packages/clusters/src/v2/model.ts +++ b/packages/clusters/src/v2/model.ts @@ -1962,6 +1962,185 @@ export interface ClusterSize { // eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface ClusterState {} +/** A storage location in Adls Gen2 */ +export interface CreateAdlsgen2Info { + /** abfss destination, e.g. `abfss://@.dfs.core.windows.net/`. */ + destination: string; +} + +export interface CreateAutoScale { + /** + * The minimum number of workers to which the cluster can scale down when underutilized. + * It is also the initial number of workers the cluster will have after creation. + */ + minWorkers?: number | undefined; + /** + * The maximum number of workers to which the cluster can scale up when overloaded. + * Note that `max_workers` must be strictly greater than `min_workers`. + */ + maxWorkers?: number | undefined; +} + +/** Attributes set during cluster creation which are related to Amazon Web Services. */ +export interface CreateAwsAttributes { + /** + * The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. + * If this value is greater than 0, the cluster driver node in particular will be placed on an + * on-demand instance. If this value is greater than or equal to the current cluster size, all + * nodes will be placed on on-demand instances. If this value is less than the current cluster + * size, `first_on_demand` nodes will be placed on on-demand instances and the remainder will + * be placed on `availability` instances. Note that this value does not affect + * cluster size and cannot currently be mutated over the lifetime of a cluster. + */ + firstOnDemand?: number | undefined; + availability?: AwsAvailability | undefined; + /** + * Identifier for the availability zone/datacenter in which the cluster resides. + * This string will be of a form like "us-west-2a". The provided availability + * zone must be in the same region as the deployment. For example, "us-west-2a" + * is not a valid zone id if the deployment resides in the "us-east-1" region. + * This is an optional field at cluster creation, and if not specified, the zone "auto" will be used. + * If the zone specified is "auto", will try to place cluster in a zone with high availability, + * and will retry placement in a different AZ if there is not enough capacity. + * + * The list of available zones as well as the default value can be found by using the + * `List Zones` method. + */ + zoneId?: string | undefined; + /** + * Nodes for this cluster will only be placed on AWS instances with this instance profile. If + * ommitted, nodes will be placed on instances without an IAM instance profile. The instance + * profile must have previously been added to the environment by an account + * administrator. + * + * This feature may only be available to certain customer plans. + */ + instanceProfileArn?: string | undefined; + /** + * The bid price for AWS spot instances, as a percentage of the corresponding instance type's + * on-demand price. + * For example, if this field is set to 50, and the cluster needs a new `r3.xlarge` spot + * instance, then the bid price is half of the price of + * on-demand `r3.xlarge` instances. Similarly, if this field is set to 200, the bid price is twice + * the price of on-demand `r3.xlarge` instances. If not specified, the default value is 100. + * When spot instances are requested for this cluster, only spot instances whose bid price + * percentage matches this field will be considered. + * Note that, for safety, we enforce this field to be no more than 10000. + */ + spotBidPricePercent?: number | undefined; + /** The type of EBS volumes that will be launched with this cluster. */ + ebsVolumeType?: EbsVolumeType | undefined; + /** + * The number of volumes launched for each instance. Users can choose up to 10 volumes. + * This feature is only enabled for supported node types. Legacy node types cannot specify + * custom EBS volumes. + * For node types with no instance store, at least one EBS volume needs to be specified; + * otherwise, cluster creation will fail. + * + * These EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc. + * Instance store volumes will be mounted at `/local_disk0`, `/local_disk1`, and etc. + * + * If EBS volumes are attached, will configure Spark to use only the EBS volumes for + * scratch storage because heterogenously sized scratch devices can lead to inefficient disk + * utilization. If no EBS volumes are attached, will configure Spark to use instance + * store volumes. + * + * Please note that if EBS volumes are specified, then the Spark configuration `spark.local.dir` + * will be overridden. + */ + ebsVolumeCount?: number | undefined; + /** + * The size of each EBS volume (in GiB) launched for each instance. For general purpose + * SSD, this value must be within the range 100 - 4096. For throughput optimized HDD, + * this value must be within the range 500 - 4096. + */ + ebsVolumeSize?: number | undefined; + /** If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used. */ + ebsVolumeIops?: number | undefined; + /** If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used. */ + ebsVolumeThroughput?: number | undefined; +} + +/** Attributes set during cluster creation which are related to Microsoft Azure. */ +export interface CreateAzureAttributes { + /** Defines values necessary to configure and run Azure Log Analytics agent */ + logAnalyticsInfo?: CreateLogAnalyticsInfo | undefined; + /** + * The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. + * This value should be greater than 0, to make sure the cluster driver node is placed on an + * on-demand instance. If this value is greater than or equal to the current cluster size, all + * nodes will be placed on on-demand instances. If this value is less than the current cluster + * size, `first_on_demand` nodes will be placed on on-demand instances and the remainder will + * be placed on `availability` instances. Note that this value does not affect + * cluster size and cannot currently be mutated over the lifetime of a cluster. + */ + firstOnDemand?: number | undefined; + /** + * Availability type used for all subsequent nodes past the `first_on_demand` ones. + * Note: If `first_on_demand` is zero, this availability + * type will be used for the entire cluster. + */ + availability?: AzureAvailability | undefined; + /** + * The max bid price to be used for Azure spot instances. + * The Max price for the bid cannot be higher than the on-demand price of the instance. + * If not specified, the default value is -1, which specifies that the instance cannot be evicted + * on the basis of price, and only on the basis of availability. Further, the value should > 0 or -1. + */ + spotBidMaxPrice?: number | undefined; + /** + * The Azure capacity reservation group resource ID to use for launching VMs. + * When specified, VMs will be launched using the provided capacity reservation. + * + * Capacity reservations can only be specified when the workspace uses injected vnet (i.e. customer defined vnet not + * managed by databricks). Ensure the databricks-login-prod Enterprise Application is granted the following four permissions: + * 1. Microsoft.Compute/capacityReservationGroups/read + * 2. Microsoft.Compute/capacityReservationGroups/deploy/action + * 3. Microsoft.Compute/capacityReservationGroups/capacityReservations/read + * 4. Microsoft.Compute/capacityReservationGroups/capacityReservations/deploy/action + * + * Format: `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}` + */ + capacityReservationGroup?: string | undefined; +} + +export interface CreateCloneCluster { + /** The cluster that is being cloned. */ + sourceClusterId: string; +} + +/** Cluster log delivery config */ +export interface CreateClusterLogConf { + storageInfo?: + | { + $case: 'dbfs'; + /** + * destination needs to be provided. e.g. + * `{ "dbfs" : { "destination" : "dbfs:/home/cluster_log" } }` + */ + dbfs: CreateDbfsStorageInfo; + } + | { + $case: 's3'; + /** + * destination and either the region or endpoint need to be provided. e.g. + * `{ "s3": { "destination" : "s3://cluster_log_bucket/prefix", "region" : "us-west-2" } }` + * Cluster iam role is used to access s3, please make sure the cluster iam role in + * `instance_profile_arn` has permission to write data to the s3 destination. + */ + s3: CreateS3StorageInfo; + } + | { + $case: 'volumes'; + /** + * destination needs to be provided, e.g. + * `{ "volumes": { "destination": "/Volumes/catalog/schema/volume/cluster_log" } }` + */ + volumes: CreateVolumesStorageInfo; + } + | undefined; +} + export interface CreateClusterRequest { /** * When set to true, fixed and default values from the policy will be used for fields that are omitted. @@ -1969,7 +2148,7 @@ export interface CreateClusterRequest { */ applyPolicyDefaultValues?: boolean | undefined; /** When specified, this clones libraries from a source cluster during the creation of a new cluster. */ - cloneFrom?: CloneCluster | undefined; + cloneFrom?: CreateCloneCluster | undefined; size?: | { $case: 'numWorkers'; @@ -1991,7 +2170,7 @@ export interface CreateClusterRequest { * Parameters needed in order to automatically scale clusters up and down based on load. * Note: autoscaling works best with DB runtime versions 3.0 or later. */ - autoscale: AutoScale; + autoscale: CreateAutoScale; } | undefined; /** @@ -2016,17 +2195,17 @@ export interface CreateClusterRequest { * Attributes related to clusters running on Amazon Web Services. * If not specified at cluster creation, a set of default values will be used. */ - awsAttributes?: AwsAttributes | undefined; + awsAttributes?: CreateAwsAttributes | undefined; /** * Attributes related to clusters running on Microsoft Azure. * If not specified at cluster creation, a set of default values will be used. */ - azureAttributes?: AzureAttributes | undefined; + azureAttributes?: CreateAzureAttributes | undefined; /** * Attributes related to clusters running on Google Cloud Platform. * If not specified at cluster creation, a set of default values will be used. */ - gcpAttributes?: GcpAttributes | undefined; + gcpAttributes?: CreateGcpAttributes | undefined; /** * This field encodes, through a single value, the resources available to each of * the Spark nodes in this cluster. For example, the Spark nodes can be provisioned @@ -2044,9 +2223,9 @@ export interface CreateClusterRequest { */ driverNodeTypeId?: string | undefined; /** Flexible node type configuration for worker nodes. */ - workerNodeTypeFlexibility?: NodeTypeFlexibility | undefined; + workerNodeTypeFlexibility?: CreateNodeTypeFlexibility | undefined; /** Flexible node type configuration for the driver node. */ - driverNodeTypeFlexibility?: NodeTypeFlexibility | undefined; + driverNodeTypeFlexibility?: CreateNodeTypeFlexibility | undefined; /** * SSH public key contents that will be added to each Spark node in this cluster. The * corresponding private keys can be used to login with the user name `ubuntu` on port `2200`. @@ -2069,7 +2248,7 @@ export interface CreateClusterRequest { * `5 mins`. The destination of driver logs is `$destination/$clusterId/driver`, while * the destination of executor logs is `$destination/$clusterId/executor`. */ - clusterLogConf?: ClusterLogConf | undefined; + clusterLogConf?: CreateClusterLogConf | undefined; /** * An object containing a set of optional, user-specified environment variable key-value pairs. * Please note that key-value pair of the form (X,Y) will be exported as is (i.e., @@ -2101,9 +2280,9 @@ export interface CreateClusterRequest { * The scripts are executed sequentially in the order provided. * If `cluster_log_conf` is specified, init script logs are sent to `//init_scripts`. */ - initScripts?: InitScriptInfo[] | undefined; + initScripts?: CreateInitScriptInfo[] | undefined; /** Custom docker image BYOC */ - dockerImage?: DockerImage | undefined; + dockerImage?: CreateDockerImage | undefined; /** The optional ID of the instance pool to which the cluster belongs. */ instancePoolId?: string | undefined; /** Single user name if data_security_mode is `SINGLE_USER` */ @@ -2118,7 +2297,7 @@ export interface CreateClusterRequest { * assigned. */ driverInstancePoolId?: string | undefined; - workloadType?: WorkloadType | undefined; + workloadType?: CreateWorkloadType | undefined; dataSecurityMode?: DataSecurityMode | undefined; /** * Determines the cluster's runtime engine, either standard or Photon. @@ -2153,108 +2332,336 @@ export interface CreateClusterResponse { clusterId?: string | undefined; } -export interface DataPlaneEventDetails { - eventType?: DataPlaneClusterEventType | undefined; - timestamp?: bigint | undefined; - hostId?: string | undefined; - executorFailures?: number | undefined; -} - /** A storage location in DBFS */ -export interface DbfsStorageInfo { +export interface CreateDbfsStorageInfo { /** dbfs destination, e.g. `dbfs:/my/path` */ - destination?: string | undefined; -} - -export interface DeleteClusterRequest { - /** The cluster to be terminated. */ - clusterId?: string | undefined; + destination: string; } -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface DeleteClusterResponse {} - -export interface DockerBasicAuth { +export interface CreateDockerBasicAuth { /** Name of the user */ username?: string | undefined; /** Password of the user */ password?: string | undefined; } -export interface DockerImage { +export interface CreateDockerImage { /** URL of the docker image. */ url?: string | undefined; credsOneof?: | { $case: 'basicAuth'; /** Basic auth with username and password */ - basicAuth: DockerBasicAuth; + basicAuth: CreateDockerBasicAuth; } | undefined; } -export interface EditClusterRequest { - /** ID of the cluster */ - clusterId?: string | undefined; - /** When set to true, fixed and default values from the policy will be used for fields that are omitted. When set to false, only fixed values from the policy will be applied. */ - applyPolicyDefaultValues?: boolean | undefined; - size?: - | { - $case: 'numWorkers'; - /** - * Number of worker nodes that this cluster should have. A cluster has one Spark Driver - * and `num_workers` Executors for a total of `num_workers` + 1 Spark nodes. - * - * Note: When reading the properties of a cluster, this field reflects the desired number - * of workers rather than the actual current number of workers. For instance, if a cluster - * is resized from 5 to 10 workers, this field will immediately be updated to reflect - * the target size of 10 workers, whereas the workers listed in `spark_info` will gradually - * increase from 5 to 10 as the new nodes are provisioned. - */ - numWorkers: number; - } - | { - $case: 'autoscale'; - /** - * Parameters needed in order to automatically scale clusters up and down based on load. - * Note: autoscaling works best with DB runtime versions 3.0 or later. - */ - autoscale: AutoScale; - } - | undefined; +/** Attributes set during cluster creation which are related to GCP. */ +export interface CreateGcpAttributes { /** - * Cluster name requested by the user. This doesn't have to be unique. - * If not specified at creation, the cluster name will be an empty string. - * For job clusters, the cluster name is automatically set based on the job and job run IDs. + * This field determines whether the spark executors will be scheduled to run on preemptible + * VMs (when set to true) versus standard compute engine VMs (when set to false; default). + * Note: Soon to be deprecated, use the 'availability' field instead. */ - clusterName?: string | undefined; + usePreemptibleExecutors?: boolean | undefined; /** - * The Spark version of the cluster, e.g. `3.3.x-scala2.11`. - * A list of available Spark versions can be retrieved by using - * the [clusters/sparkVersions](https://docs.databricks.com/api/workspace/clusters/sparkversions) API call. + * If provided, the cluster will impersonate the google service account when accessing + * gcloud services (like GCS). The google service account + * must have previously been added to the environment by an account + * administrator. */ - sparkVersion?: string | undefined; + googleServiceAccount?: string | undefined; + /** Boot disk size in GB */ + bootDiskSize?: number | undefined; /** - * An object containing a set of optional, user-specified Spark configuration key-value pairs. - * Users can also pass in a string of extra JVM options to the driver and the executors via - * `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` respectively. + * This field determines whether the spark executors will be scheduled to run on preemptible + * VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable. */ - sparkConf?: Record | undefined; + availability?: GcpAvailability | undefined; /** - * Attributes related to clusters running on Amazon Web Services. - * If not specified at cluster creation, a set of default values will be used. - */ - awsAttributes?: AwsAttributes | undefined; + * Identifier for the availability zone in which the cluster resides. + * This can be one of the following: + * - "HA" => High availability, spread nodes across availability zones for a + * deployment region [default]. + * - "AUTO" => picks an availability zone to schedule the cluster on. + * - A GCP availability zone => Pick One of the available zones for (machine type + region) from + * https://cloud.google.com/compute/docs/regions-zones. + */ + zoneId?: string | undefined; + /** + * If provided, each node (workers and driver) in the cluster will have this number of local SSDs attached. + * Each local SSD is 375GB in size. + * Refer to [GCP documentation](https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds) + * for the supported number of local SSDs for each instance type. + */ + localSsdCount?: number | undefined; + /** + * The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. + * This value should be greater than 0, to make sure the cluster driver node is placed on an + * on-demand instance. If this value is greater than or equal to the current cluster size, all + * nodes will be placed on on-demand instances. If this value is less than the current cluster + * size, `first_on_demand` nodes will be placed on on-demand instances and the remainder will + * be placed on `availability` instances. Note that this value does not affect + * cluster size and cannot currently be mutated over the lifetime of a cluster. + */ + firstOnDemand?: number | undefined; + /** + * The confidential computing technology for this cluster's instances. + * Currently only SEV_SNP is supported, and only on N2D instance types. + * When not set, no confidential computing is applied. + */ + confidentialComputeType?: ConfidentialComputeType | undefined; +} + +/** A storage location in Google Cloud Platform's GCS */ +export interface CreateGcsStorageInfo { + /** GCS destination/URI, e.g. `gs://my-bucket/some-prefix` */ + destination: string; +} + +/** Config for an individual init script */ +export interface CreateInitScriptInfo { + storageInfo?: + | { + $case: 'dbfs'; + /** + * destination needs to be provided. e.g. + * `{ "dbfs": { "destination" : "dbfs:/home/cluster_log" } }` + */ + dbfs: CreateDbfsStorageInfo; + } + | { + $case: 's3'; + /** + * destination and either the region or endpoint need to be provided. e.g. + * `{ \"s3\": { \"destination\": \"s3://cluster_log_bucket/prefix\", \"region\": \"us-west-2\" } }` + * Cluster iam role is used to access s3, please make sure the cluster iam role in + * `instance_profile_arn` has permission to write data to the s3 destination. + */ + s3: CreateS3StorageInfo; + } + | { + $case: 'file'; + /** + * destination needs to be provided, e.g. + * `{ "file": { "destination": "file:/my/local/file.sh" } }` + */ + file: CreateLocalFileInfo; + } + | { + $case: 'gcs'; + /** + * destination needs to be provided, e.g. + * `{ "gcs": { "destination": "gs://my-bucket/file.sh" } }` + */ + gcs: CreateGcsStorageInfo; + } + | { + $case: 'abfss'; + /** + * destination needs to be provided, e.g. + * `abfss://@.dfs.core.windows.net/` + */ + abfss: CreateAdlsgen2Info; + } + | { + $case: 'workspace'; + /** + * destination needs to be provided, e.g. + * `{ "workspace": { "destination": "/cluster-init-scripts/setup-datadog.sh" } }` + */ + workspace: CreateWorkspaceStorageInfo; + } + | { + $case: 'volumes'; + /** + * destination needs to be provided. e.g. + * `{ \"volumes\" : { \"destination\" : \"/Volumes/my-init.sh\" } }` + */ + volumes: CreateVolumesStorageInfo; + } + | undefined; +} + +export interface CreateLocalFileInfo { + /** local file destination, e.g. `file:/my/local/file.sh` */ + destination: string; +} + +export interface CreateLogAnalyticsInfo { + logAnalyticsWorkspaceId?: string | undefined; + logAnalyticsPrimaryKey?: string | undefined; +} + +/** Configuration for flexible node types, allowing fallback to alternate node types during cluster launch and upscale. */ +export interface CreateNodeTypeFlexibility { + /** A list of node type IDs to use as fallbacks when the primary node type is unavailable. */ + alternateNodeTypeIds?: string[] | undefined; +} + +/** A storage location in Amazon S3 */ +export interface CreateS3StorageInfo { + /** + * S3 destination, e.g. `s3://my-bucket/some-prefix` Note that logs will be delivered using + * cluster iam role, please make sure you set cluster iam role and the role has write access to the + * destination. Please also note that you cannot use AWS keys to deliver logs. + */ + destination: string; + /** + * S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. If both are set, + * endpoint will be used. + */ + region?: string | undefined; + /** + * S3 endpoint, e.g. `https://s3-us-west-2.amazonaws.com`. Either region or endpoint needs to be set. + * If both are set, endpoint will be used. + */ + endpoint?: string | undefined; + /** (Optional) Flag to enable server side encryption, `false` by default. */ + enableEncryption?: boolean | undefined; + /** + * (Optional) The encryption type, it could be `sse-s3` or `sse-kms`. It will be used only when + * encryption is enabled and the default type is `sse-s3`. + */ + encryptionType?: string | undefined; + /** (Optional) Kms key which will be used if encryption is enabled and encryption type is set to `sse-kms`. */ + kmsKey?: string | undefined; + /** + * (Optional) Set canned access control list for the logs, e.g. `bucket-owner-full-control`. + * If `canned_cal` is set, please make sure the cluster iam role has `s3:PutObjectAcl` permission on + * the destination bucket and prefix. The full list of possible canned acl can be found at + * http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl. + * Please also note that by default only the object owner gets full controls. If you are using cross account + * role for writing data, you may want to set `bucket-owner-full-control` to make bucket owner able to + * read the logs. + */ + cannedAcl?: string | undefined; +} + +/** A storage location back by UC Volumes. */ +export interface CreateVolumesStorageInfo { + /** + * UC Volumes destination, e.g. `/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` + * or `dbfs:/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` + */ + destination: string; +} + +/** Cluster Attributes showing for clusters workload types. */ +export interface CreateWorkloadType { + /** defined what type of clients can use the cluster. E.g. Notebooks, Jobs */ + clients: WorkloadType_CreateClientsTypes; +} + +/** A storage location in Workspace Filesystem (WSFS) */ +export interface CreateWorkspaceStorageInfo { + /** wsfs destination, e.g. `workspace:/cluster-init-scripts/setup-datadog.sh` */ + destination: string; +} + +export interface DataPlaneEventDetails { + eventType?: DataPlaneClusterEventType | undefined; + timestamp?: bigint | undefined; + hostId?: string | undefined; + executorFailures?: number | undefined; +} + +/** A storage location in DBFS */ +export interface DbfsStorageInfo { + /** dbfs destination, e.g. `dbfs:/my/path` */ + destination?: string | undefined; +} + +export interface DeleteClusterRequest { + /** The cluster to be terminated. */ + clusterId?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface DeleteClusterResponse {} + +export interface DockerBasicAuth { + /** Name of the user */ + username?: string | undefined; + /** Password of the user */ + password?: string | undefined; +} + +export interface DockerImage { + /** URL of the docker image. */ + url?: string | undefined; + credsOneof?: + | { + $case: 'basicAuth'; + /** Basic auth with username and password */ + basicAuth: DockerBasicAuth; + } + | undefined; +} + +export interface EditClusterRequest { + /** ID of the cluster */ + clusterId?: string | undefined; + /** When set to true, fixed and default values from the policy will be used for fields that are omitted. When set to false, only fixed values from the policy will be applied. */ + applyPolicyDefaultValues?: boolean | undefined; + size?: + | { + $case: 'numWorkers'; + /** + * Number of worker nodes that this cluster should have. A cluster has one Spark Driver + * and `num_workers` Executors for a total of `num_workers` + 1 Spark nodes. + * + * Note: When reading the properties of a cluster, this field reflects the desired number + * of workers rather than the actual current number of workers. For instance, if a cluster + * is resized from 5 to 10 workers, this field will immediately be updated to reflect + * the target size of 10 workers, whereas the workers listed in `spark_info` will gradually + * increase from 5 to 10 as the new nodes are provisioned. + */ + numWorkers: number; + } + | { + $case: 'autoscale'; + /** + * Parameters needed in order to automatically scale clusters up and down based on load. + * Note: autoscaling works best with DB runtime versions 3.0 or later. + */ + autoscale: CreateAutoScale; + } + | undefined; + /** + * Cluster name requested by the user. This doesn't have to be unique. + * If not specified at creation, the cluster name will be an empty string. + * For job clusters, the cluster name is automatically set based on the job and job run IDs. + */ + clusterName?: string | undefined; + /** + * The Spark version of the cluster, e.g. `3.3.x-scala2.11`. + * A list of available Spark versions can be retrieved by using + * the [clusters/sparkVersions](https://docs.databricks.com/api/workspace/clusters/sparkversions) API call. + */ + sparkVersion?: string | undefined; + /** + * An object containing a set of optional, user-specified Spark configuration key-value pairs. + * Users can also pass in a string of extra JVM options to the driver and the executors via + * `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` respectively. + */ + sparkConf?: Record | undefined; + /** + * Attributes related to clusters running on Amazon Web Services. + * If not specified at cluster creation, a set of default values will be used. + */ + awsAttributes?: CreateAwsAttributes | undefined; /** * Attributes related to clusters running on Microsoft Azure. * If not specified at cluster creation, a set of default values will be used. */ - azureAttributes?: AzureAttributes | undefined; + azureAttributes?: CreateAzureAttributes | undefined; /** * Attributes related to clusters running on Google Cloud Platform. * If not specified at cluster creation, a set of default values will be used. */ - gcpAttributes?: GcpAttributes | undefined; + gcpAttributes?: CreateGcpAttributes | undefined; /** * This field encodes, through a single value, the resources available to each of * the Spark nodes in this cluster. For example, the Spark nodes can be provisioned @@ -2272,9 +2679,9 @@ export interface EditClusterRequest { */ driverNodeTypeId?: string | undefined; /** Flexible node type configuration for worker nodes. */ - workerNodeTypeFlexibility?: NodeTypeFlexibility | undefined; + workerNodeTypeFlexibility?: CreateNodeTypeFlexibility | undefined; /** Flexible node type configuration for the driver node. */ - driverNodeTypeFlexibility?: NodeTypeFlexibility | undefined; + driverNodeTypeFlexibility?: CreateNodeTypeFlexibility | undefined; /** * SSH public key contents that will be added to each Spark node in this cluster. The * corresponding private keys can be used to login with the user name `ubuntu` on port `2200`. @@ -2297,7 +2704,7 @@ export interface EditClusterRequest { * `5 mins`. The destination of driver logs is `$destination/$clusterId/driver`, while * the destination of executor logs is `$destination/$clusterId/executor`. */ - clusterLogConf?: ClusterLogConf | undefined; + clusterLogConf?: CreateClusterLogConf | undefined; /** * An object containing a set of optional, user-specified environment variable key-value pairs. * Please note that key-value pair of the form (X,Y) will be exported as is (i.e., @@ -2329,9 +2736,9 @@ export interface EditClusterRequest { * The scripts are executed sequentially in the order provided. * If `cluster_log_conf` is specified, init script logs are sent to `//init_scripts`. */ - initScripts?: InitScriptInfo[] | undefined; + initScripts?: CreateInitScriptInfo[] | undefined; /** Custom docker image BYOC */ - dockerImage?: DockerImage | undefined; + dockerImage?: CreateDockerImage | undefined; /** The optional ID of the instance pool to which the cluster belongs. */ instancePoolId?: string | undefined; /** Single user name if data_security_mode is `SINGLE_USER` */ @@ -2346,7 +2753,7 @@ export interface EditClusterRequest { * assigned. */ driverInstancePoolId?: string | undefined; - workloadType?: WorkloadType | undefined; + workloadType?: CreateWorkloadType | undefined; dataSecurityMode?: DataSecurityMode | undefined; /** * Determines the cluster's runtime engine, either standard or Photon. @@ -3271,7 +3678,7 @@ export interface ResizeClusterRequest { * Parameters needed in order to automatically scale clusters up and down based on load. * Note: autoscaling works best with DB runtime versions 3.0 or later. */ - autoscale: AutoScale; + autoscale: CreateAutoScale; } | undefined; } @@ -3375,48 +3782,403 @@ export interface SparkVersion { * Note that the exact Spark version may change over time for a "wildcard" version * (i.e., "2.1.x-scala2.11" is a "wildcard" version) with minor bug fixes. */ - key?: string | undefined; - /** A descriptive name for this Spark version, for example "Spark 2.1". */ - name?: string | undefined; -} - -export interface StartClusterRequest { - /** The cluster to be started. */ - clusterId?: string | undefined; -} - -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface StartClusterResponse {} - -export interface TerminationReason { - /** status code indicating why the cluster was terminated */ - code?: TerminationCode | undefined; - /** type of the termination */ - type?: TerminationType | undefined; - /** list of parameters that provide additional information about why the cluster was terminated */ - parameters?: Record | undefined; -} - -export interface UnpinClusterRequest { - clusterId?: string | undefined; -} - -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface UnpinClusterResponse {} - -export interface UpdateClusterRequest { - /** ID of the cluster. */ - clusterId?: string | undefined; - /** The cluster to be updated. */ - cluster?: UpdateClusterRequest_UpdateClusterResource | undefined; - /** Used to specify which cluster attributes and size fields to update. See https://google.aip.dev/161 for more details. */ - updateMask?: - | FieldMask - | undefined; + key?: string | undefined; + /** A descriptive name for this Spark version, for example "Spark 2.1". */ + name?: string | undefined; +} + +export interface StartClusterRequest { + /** The cluster to be started. */ + clusterId?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface StartClusterResponse {} + +export interface TerminationReason { + /** status code indicating why the cluster was terminated */ + code?: TerminationCode | undefined; + /** type of the termination */ + type?: TerminationType | undefined; + /** list of parameters that provide additional information about why the cluster was terminated */ + parameters?: Record | undefined; +} + +export interface UnpinClusterRequest { + clusterId?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface UnpinClusterResponse {} + +/** A storage location in Adls Gen2 */ +export interface UpdateAdlsgen2Info { + /** abfss destination, e.g. `abfss://@.dfs.core.windows.net/`. */ + destination?: string | undefined; +} + +export interface UpdateAutoScale { + /** + * The minimum number of workers to which the cluster can scale down when underutilized. + * It is also the initial number of workers the cluster will have after creation. + */ + minWorkers?: number | undefined; + /** + * The maximum number of workers to which the cluster can scale up when overloaded. + * Note that `max_workers` must be strictly greater than `min_workers`. + */ + maxWorkers?: number | undefined; +} + +/** Attributes set during cluster creation which are related to Amazon Web Services. */ +export interface UpdateAwsAttributes { + /** + * The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. + * If this value is greater than 0, the cluster driver node in particular will be placed on an + * on-demand instance. If this value is greater than or equal to the current cluster size, all + * nodes will be placed on on-demand instances. If this value is less than the current cluster + * size, `first_on_demand` nodes will be placed on on-demand instances and the remainder will + * be placed on `availability` instances. Note that this value does not affect + * cluster size and cannot currently be mutated over the lifetime of a cluster. + */ + firstOnDemand?: number | undefined; + availability?: AwsAvailability | undefined; + /** + * Identifier for the availability zone/datacenter in which the cluster resides. + * This string will be of a form like "us-west-2a". The provided availability + * zone must be in the same region as the deployment. For example, "us-west-2a" + * is not a valid zone id if the deployment resides in the "us-east-1" region. + * This is an optional field at cluster creation, and if not specified, the zone "auto" will be used. + * If the zone specified is "auto", will try to place cluster in a zone with high availability, + * and will retry placement in a different AZ if there is not enough capacity. + * + * The list of available zones as well as the default value can be found by using the + * `List Zones` method. + */ + zoneId?: string | undefined; + /** + * Nodes for this cluster will only be placed on AWS instances with this instance profile. If + * ommitted, nodes will be placed on instances without an IAM instance profile. The instance + * profile must have previously been added to the environment by an account + * administrator. + * + * This feature may only be available to certain customer plans. + */ + instanceProfileArn?: string | undefined; + /** + * The bid price for AWS spot instances, as a percentage of the corresponding instance type's + * on-demand price. + * For example, if this field is set to 50, and the cluster needs a new `r3.xlarge` spot + * instance, then the bid price is half of the price of + * on-demand `r3.xlarge` instances. Similarly, if this field is set to 200, the bid price is twice + * the price of on-demand `r3.xlarge` instances. If not specified, the default value is 100. + * When spot instances are requested for this cluster, only spot instances whose bid price + * percentage matches this field will be considered. + * Note that, for safety, we enforce this field to be no more than 10000. + */ + spotBidPricePercent?: number | undefined; + /** The type of EBS volumes that will be launched with this cluster. */ + ebsVolumeType?: EbsVolumeType | undefined; + /** + * The number of volumes launched for each instance. Users can choose up to 10 volumes. + * This feature is only enabled for supported node types. Legacy node types cannot specify + * custom EBS volumes. + * For node types with no instance store, at least one EBS volume needs to be specified; + * otherwise, cluster creation will fail. + * + * These EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc. + * Instance store volumes will be mounted at `/local_disk0`, `/local_disk1`, and etc. + * + * If EBS volumes are attached, will configure Spark to use only the EBS volumes for + * scratch storage because heterogenously sized scratch devices can lead to inefficient disk + * utilization. If no EBS volumes are attached, will configure Spark to use instance + * store volumes. + * + * Please note that if EBS volumes are specified, then the Spark configuration `spark.local.dir` + * will be overridden. + */ + ebsVolumeCount?: number | undefined; + /** + * The size of each EBS volume (in GiB) launched for each instance. For general purpose + * SSD, this value must be within the range 100 - 4096. For throughput optimized HDD, + * this value must be within the range 500 - 4096. + */ + ebsVolumeSize?: number | undefined; + /** If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used. */ + ebsVolumeIops?: number | undefined; + /** If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used. */ + ebsVolumeThroughput?: number | undefined; +} + +/** Attributes set during cluster creation which are related to Microsoft Azure. */ +export interface UpdateAzureAttributes { + /** Defines values necessary to configure and run Azure Log Analytics agent */ + logAnalyticsInfo?: UpdateLogAnalyticsInfo | undefined; + /** + * The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. + * This value should be greater than 0, to make sure the cluster driver node is placed on an + * on-demand instance. If this value is greater than or equal to the current cluster size, all + * nodes will be placed on on-demand instances. If this value is less than the current cluster + * size, `first_on_demand` nodes will be placed on on-demand instances and the remainder will + * be placed on `availability` instances. Note that this value does not affect + * cluster size and cannot currently be mutated over the lifetime of a cluster. + */ + firstOnDemand?: number | undefined; + /** + * Availability type used for all subsequent nodes past the `first_on_demand` ones. + * Note: If `first_on_demand` is zero, this availability + * type will be used for the entire cluster. + */ + availability?: AzureAvailability | undefined; + /** + * The max bid price to be used for Azure spot instances. + * The Max price for the bid cannot be higher than the on-demand price of the instance. + * If not specified, the default value is -1, which specifies that the instance cannot be evicted + * on the basis of price, and only on the basis of availability. Further, the value should > 0 or -1. + */ + spotBidMaxPrice?: number | undefined; + /** + * The Azure capacity reservation group resource ID to use for launching VMs. + * When specified, VMs will be launched using the provided capacity reservation. + * + * Capacity reservations can only be specified when the workspace uses injected vnet (i.e. customer defined vnet not + * managed by databricks). Ensure the databricks-login-prod Enterprise Application is granted the following four permissions: + * 1. Microsoft.Compute/capacityReservationGroups/read + * 2. Microsoft.Compute/capacityReservationGroups/deploy/action + * 3. Microsoft.Compute/capacityReservationGroups/capacityReservations/read + * 4. Microsoft.Compute/capacityReservationGroups/capacityReservations/deploy/action + * + * Format: `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}` + */ + capacityReservationGroup?: string | undefined; +} + +/** Cluster log delivery config */ +export interface UpdateClusterLogConf { + storageInfo?: + | { + $case: 'dbfs'; + /** + * destination needs to be provided. e.g. + * `{ "dbfs" : { "destination" : "dbfs:/home/cluster_log" } }` + */ + dbfs: UpdateDbfsStorageInfo; + } + | { + $case: 's3'; + /** + * destination and either the region or endpoint need to be provided. e.g. + * `{ "s3": { "destination" : "s3://cluster_log_bucket/prefix", "region" : "us-west-2" } }` + * Cluster iam role is used to access s3, please make sure the cluster iam role in + * `instance_profile_arn` has permission to write data to the s3 destination. + */ + s3: UpdateS3StorageInfo; + } + | { + $case: 'volumes'; + /** + * destination needs to be provided, e.g. + * `{ "volumes": { "destination": "/Volumes/catalog/schema/volume/cluster_log" } }` + */ + volumes: UpdateVolumesStorageInfo; + } + | undefined; +} + +export interface UpdateClusterRequest { + /** ID of the cluster. */ + clusterId?: string | undefined; + /** The cluster to be updated. */ + cluster?: UpdateClusterRequest_UpdateUpdateClusterResource | undefined; + /** Used to specify which cluster attributes and size fields to update. See https://google.aip.dev/161 for more details. */ + updateMask?: + | FieldMask + | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface UpdateClusterRequest_UpdateClusterResource { + size?: + | { + $case: 'numWorkers'; + /** + * Number of worker nodes that this cluster should have. A cluster has one Spark Driver + * and `num_workers` Executors for a total of `num_workers` + 1 Spark nodes. + * + * Note: When reading the properties of a cluster, this field reflects the desired number + * of workers rather than the actual current number of workers. For instance, if a cluster + * is resized from 5 to 10 workers, this field will immediately be updated to reflect + * the target size of 10 workers, whereas the workers listed in `spark_info` will gradually + * increase from 5 to 10 as the new nodes are provisioned. + */ + numWorkers: number; + } + | { + $case: 'autoscale'; + /** + * Parameters needed in order to automatically scale clusters up and down based on load. + * Note: autoscaling works best with DB runtime versions 3.0 or later. + */ + autoscale: AutoScale; + } + | undefined; + /** + * Cluster name requested by the user. This doesn't have to be unique. + * If not specified at creation, the cluster name will be an empty string. + * For job clusters, the cluster name is automatically set based on the job and job run IDs. + */ + clusterName?: string | undefined; + /** + * The Spark version of the cluster, e.g. `3.3.x-scala2.11`. + * A list of available Spark versions can be retrieved by using + * the [clusters/sparkVersions](https://docs.databricks.com/api/workspace/clusters/sparkversions) API call. + */ + sparkVersion?: string | undefined; + /** + * An object containing a set of optional, user-specified Spark configuration key-value pairs. + * Users can also pass in a string of extra JVM options to the driver and the executors via + * `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` respectively. + */ + sparkConf?: Record | undefined; + /** + * Attributes related to clusters running on Amazon Web Services. + * If not specified at cluster creation, a set of default values will be used. + */ + awsAttributes?: AwsAttributes | undefined; + /** + * Attributes related to clusters running on Microsoft Azure. + * If not specified at cluster creation, a set of default values will be used. + */ + azureAttributes?: AzureAttributes | undefined; + /** + * Attributes related to clusters running on Google Cloud Platform. + * If not specified at cluster creation, a set of default values will be used. + */ + gcpAttributes?: GcpAttributes | undefined; + /** + * This field encodes, through a single value, the resources available to each of + * the Spark nodes in this cluster. For example, the Spark nodes can be provisioned + * and optimized for memory or compute intensive workloads. A list of available node + * types can be retrieved by using the [clusters/listNodeTypes](https://docs.databricks.com/api/workspace/clusters/listnodetypes) API call. + */ + nodeTypeId?: string | undefined; + /** + * The node type of the Spark driver. + * Note that this field is optional; if unset, the driver node type will be set as the same value + * as `node_type_id` defined above. + * + * This field, along with node_type_id, should not be set if virtual_cluster_size is set. + * If both driver_node_type_id, node_type_id, and virtual_cluster_size are specified, driver_node_type_id and node_type_id take precedence. + */ + driverNodeTypeId?: string | undefined; + /** Flexible node type configuration for worker nodes. */ + workerNodeTypeFlexibility?: NodeTypeFlexibility | undefined; + /** Flexible node type configuration for the driver node. */ + driverNodeTypeFlexibility?: NodeTypeFlexibility | undefined; + /** + * SSH public key contents that will be added to each Spark node in this cluster. The + * corresponding private keys can be used to login with the user name `ubuntu` on port `2200`. + * Up to 10 keys can be specified. + */ + sshPublicKeys?: string[] | undefined; + /** + * Additional tags for cluster resources. will tag all cluster resources (e.g., AWS + * instances and EBS volumes) with these tags in addition to `default_tags`. Notes: + * + * - Currently, allows at most 45 custom tags + * + * - Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster tags + */ + customTags?: Record | undefined; + /** + * The configuration for delivering spark logs to a long-term storage destination. + * Three kinds of destinations (DBFS, S3 and Unity Catalog volumes) are supported. Only one destination can be specified + * for one cluster. If the conf is given, the logs will be delivered to the destination every + * `5 mins`. The destination of driver logs is `$destination/$clusterId/driver`, while + * the destination of executor logs is `$destination/$clusterId/executor`. + */ + clusterLogConf?: ClusterLogConf | undefined; + /** + * An object containing a set of optional, user-specified environment variable key-value pairs. + * Please note that key-value pair of the form (X,Y) will be exported as is (i.e., + * `export X='Y'`) while launching the driver and workers. + * + * In order to specify an additional set of `SPARK_DAEMON_JAVA_OPTS`, we recommend appending + * them to `$SPARK_DAEMON_JAVA_OPTS` as shown in the example below. This ensures that all + * default databricks managed environmental variables are included as well. + * + * Example Spark environment variables: + * `{"SPARK_WORKER_MEMORY": "28000m", "SPARK_LOCAL_DIRS": "/local_disk0"}` or + * `{"SPARK_DAEMON_JAVA_OPTS": "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` + */ + sparkEnvVars?: Record | undefined; + /** + * Automatically terminates the cluster after it is inactive for this time in minutes. If not set, + * this cluster will not be automatically terminated. If specified, the threshold must be between + * 10 and 10000 minutes. + * Users can also set this value to 0 to explicitly disable automatic termination. + */ + autoterminationMinutes?: number | undefined; + /** + * Autoscaling Local Storage: when enabled, this cluster will dynamically acquire additional disk + * space when its Spark workers are running low on disk space. + */ + enableElasticDisk?: boolean | undefined; + /** + * The configuration for storing init scripts. Any number of destinations can be specified. + * The scripts are executed sequentially in the order provided. + * If `cluster_log_conf` is specified, init script logs are sent to `//init_scripts`. + */ + initScripts?: InitScriptInfo[] | undefined; + /** Custom docker image BYOC */ + dockerImage?: DockerImage | undefined; + /** The optional ID of the instance pool to which the cluster belongs. */ + instancePoolId?: string | undefined; + /** Single user name if data_security_mode is `SINGLE_USER` */ + singleUserName?: string | undefined; + /** The ID of the cluster policy used to create the cluster if applicable. */ + policyId?: string | undefined; + /** Whether to enable LUKS on cluster VMs' local disks */ + enableLocalDiskEncryption?: boolean | undefined; + /** + * The optional ID of the instance pool for the driver of the cluster belongs. + * The pool cluster uses the instance pool with id (instance_pool_id) if the driver pool is not + * assigned. + */ + driverInstancePoolId?: string | undefined; + workloadType?: WorkloadType | undefined; + dataSecurityMode?: DataSecurityMode | undefined; + /** + * Determines the cluster's runtime engine, either standard or Photon. + * + * This field is not compatible with legacy `spark_version` values that contain `-photon-`. + * Remove `-photon-` from the `spark_version` and set `runtime_engine` to `PHOTON`. + * + * If left unspecified, the runtime engine defaults to standard unless the spark_version + * contains -photon-, in which case Photon will be used. + */ + runtimeEngine?: RuntimeEngine | undefined; + kind?: ComputeKind | undefined; + /** + * This field can only be used when `kind = CLASSIC_PREVIEW`. + * + * `effective_spark_version` is determined by `spark_version` (DBR release), this field `use_ml_runtime`, and whether `node_type_id` is gpu node or not. + */ + useMlRuntime?: boolean | undefined; + /** + * This field can only be used when `kind = CLASSIC_PREVIEW`. + * + * When set to true, will automatically set single node related `custom_tags`, `spark_conf`, and `num_workers` + */ + isSingleNode?: boolean | undefined; + /** If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED disks. */ + remoteDiskThroughput?: number | undefined; + /** If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED disks. */ + totalInitialRemoteDiskSize?: number | undefined; } // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export interface UpdateClusterRequest_UpdateClusterResource { +export interface UpdateClusterRequest_UpdateUpdateClusterResource { size?: | { $case: 'numWorkers'; @@ -3438,7 +4200,7 @@ export interface UpdateClusterRequest_UpdateClusterResource { * Parameters needed in order to automatically scale clusters up and down based on load. * Note: autoscaling works best with DB runtime versions 3.0 or later. */ - autoscale: AutoScale; + autoscale: UpdateAutoScale; } | undefined; /** @@ -3463,17 +4225,17 @@ export interface UpdateClusterRequest_UpdateClusterResource { * Attributes related to clusters running on Amazon Web Services. * If not specified at cluster creation, a set of default values will be used. */ - awsAttributes?: AwsAttributes | undefined; + awsAttributes?: UpdateAwsAttributes | undefined; /** * Attributes related to clusters running on Microsoft Azure. * If not specified at cluster creation, a set of default values will be used. */ - azureAttributes?: AzureAttributes | undefined; + azureAttributes?: UpdateAzureAttributes | undefined; /** * Attributes related to clusters running on Google Cloud Platform. * If not specified at cluster creation, a set of default values will be used. */ - gcpAttributes?: GcpAttributes | undefined; + gcpAttributes?: UpdateGcpAttributes | undefined; /** * This field encodes, through a single value, the resources available to each of * the Spark nodes in this cluster. For example, the Spark nodes can be provisioned @@ -3491,9 +4253,9 @@ export interface UpdateClusterRequest_UpdateClusterResource { */ driverNodeTypeId?: string | undefined; /** Flexible node type configuration for worker nodes. */ - workerNodeTypeFlexibility?: NodeTypeFlexibility | undefined; + workerNodeTypeFlexibility?: UpdateNodeTypeFlexibility | undefined; /** Flexible node type configuration for the driver node. */ - driverNodeTypeFlexibility?: NodeTypeFlexibility | undefined; + driverNodeTypeFlexibility?: UpdateNodeTypeFlexibility | undefined; /** * SSH public key contents that will be added to each Spark node in this cluster. The * corresponding private keys can be used to login with the user name `ubuntu` on port `2200`. @@ -3516,7 +4278,7 @@ export interface UpdateClusterRequest_UpdateClusterResource { * `5 mins`. The destination of driver logs is `$destination/$clusterId/driver`, while * the destination of executor logs is `$destination/$clusterId/executor`. */ - clusterLogConf?: ClusterLogConf | undefined; + clusterLogConf?: UpdateClusterLogConf | undefined; /** * An object containing a set of optional, user-specified environment variable key-value pairs. * Please note that key-value pair of the form (X,Y) will be exported as is (i.e., @@ -3548,9 +4310,9 @@ export interface UpdateClusterRequest_UpdateClusterResource { * The scripts are executed sequentially in the order provided. * If `cluster_log_conf` is specified, init script logs are sent to `//init_scripts`. */ - initScripts?: InitScriptInfo[] | undefined; + initScripts?: UpdateInitScriptInfo[] | undefined; /** Custom docker image BYOC */ - dockerImage?: DockerImage | undefined; + dockerImage?: UpdateDockerImage | undefined; /** The optional ID of the instance pool to which the cluster belongs. */ instancePoolId?: string | undefined; /** Single user name if data_security_mode is `SINGLE_USER` */ @@ -3565,39 +4327,267 @@ export interface UpdateClusterRequest_UpdateClusterResource { * assigned. */ driverInstancePoolId?: string | undefined; - workloadType?: WorkloadType | undefined; + workloadType?: UpdateWorkloadType | undefined; dataSecurityMode?: DataSecurityMode | undefined; /** - * Determines the cluster's runtime engine, either standard or Photon. - * - * This field is not compatible with legacy `spark_version` values that contain `-photon-`. - * Remove `-photon-` from the `spark_version` and set `runtime_engine` to `PHOTON`. - * - * If left unspecified, the runtime engine defaults to standard unless the spark_version - * contains -photon-, in which case Photon will be used. + * Determines the cluster's runtime engine, either standard or Photon. + * + * This field is not compatible with legacy `spark_version` values that contain `-photon-`. + * Remove `-photon-` from the `spark_version` and set `runtime_engine` to `PHOTON`. + * + * If left unspecified, the runtime engine defaults to standard unless the spark_version + * contains -photon-, in which case Photon will be used. + */ + runtimeEngine?: RuntimeEngine | undefined; + kind?: ComputeKind | undefined; + /** + * This field can only be used when `kind = CLASSIC_PREVIEW`. + * + * `effective_spark_version` is determined by `spark_version` (DBR release), this field `use_ml_runtime`, and whether `node_type_id` is gpu node or not. + */ + useMlRuntime?: boolean | undefined; + /** + * This field can only be used when `kind = CLASSIC_PREVIEW`. + * + * When set to true, will automatically set single node related `custom_tags`, `spark_conf`, and `num_workers` + */ + isSingleNode?: boolean | undefined; + /** If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED disks. */ + remoteDiskThroughput?: number | undefined; + /** If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED disks. */ + totalInitialRemoteDiskSize?: number | undefined; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface UpdateClusterResponse {} + +/** A storage location in DBFS */ +export interface UpdateDbfsStorageInfo { + /** dbfs destination, e.g. `dbfs:/my/path` */ + destination?: string | undefined; +} + +export interface UpdateDockerBasicAuth { + /** Name of the user */ + username?: string | undefined; + /** Password of the user */ + password?: string | undefined; +} + +export interface UpdateDockerImage { + /** URL of the docker image. */ + url?: string | undefined; + credsOneof?: + | { + $case: 'basicAuth'; + /** Basic auth with username and password */ + basicAuth: UpdateDockerBasicAuth; + } + | undefined; +} + +/** Attributes set during cluster creation which are related to GCP. */ +export interface UpdateGcpAttributes { + /** + * This field determines whether the spark executors will be scheduled to run on preemptible + * VMs (when set to true) versus standard compute engine VMs (when set to false; default). + * Note: Soon to be deprecated, use the 'availability' field instead. + */ + usePreemptibleExecutors?: boolean | undefined; + /** + * If provided, the cluster will impersonate the google service account when accessing + * gcloud services (like GCS). The google service account + * must have previously been added to the environment by an account + * administrator. + */ + googleServiceAccount?: string | undefined; + /** Boot disk size in GB */ + bootDiskSize?: number | undefined; + /** + * This field determines whether the spark executors will be scheduled to run on preemptible + * VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable. + */ + availability?: GcpAvailability | undefined; + /** + * Identifier for the availability zone in which the cluster resides. + * This can be one of the following: + * - "HA" => High availability, spread nodes across availability zones for a + * deployment region [default]. + * - "AUTO" => picks an availability zone to schedule the cluster on. + * - A GCP availability zone => Pick One of the available zones for (machine type + region) from + * https://cloud.google.com/compute/docs/regions-zones. + */ + zoneId?: string | undefined; + /** + * If provided, each node (workers and driver) in the cluster will have this number of local SSDs attached. + * Each local SSD is 375GB in size. + * Refer to [GCP documentation](https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds) + * for the supported number of local SSDs for each instance type. + */ + localSsdCount?: number | undefined; + /** + * The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. + * This value should be greater than 0, to make sure the cluster driver node is placed on an + * on-demand instance. If this value is greater than or equal to the current cluster size, all + * nodes will be placed on on-demand instances. If this value is less than the current cluster + * size, `first_on_demand` nodes will be placed on on-demand instances and the remainder will + * be placed on `availability` instances. Note that this value does not affect + * cluster size and cannot currently be mutated over the lifetime of a cluster. + */ + firstOnDemand?: number | undefined; + /** + * The confidential computing technology for this cluster's instances. + * Currently only SEV_SNP is supported, and only on N2D instance types. + * When not set, no confidential computing is applied. + */ + confidentialComputeType?: ConfidentialComputeType | undefined; +} + +/** A storage location in Google Cloud Platform's GCS */ +export interface UpdateGcsStorageInfo { + /** GCS destination/URI, e.g. `gs://my-bucket/some-prefix` */ + destination?: string | undefined; +} + +/** Config for an individual init script */ +export interface UpdateInitScriptInfo { + storageInfo?: + | { + $case: 'dbfs'; + /** + * destination needs to be provided. e.g. + * `{ "dbfs": { "destination" : "dbfs:/home/cluster_log" } }` + */ + dbfs: UpdateDbfsStorageInfo; + } + | { + $case: 's3'; + /** + * destination and either the region or endpoint need to be provided. e.g. + * `{ \"s3\": { \"destination\": \"s3://cluster_log_bucket/prefix\", \"region\": \"us-west-2\" } }` + * Cluster iam role is used to access s3, please make sure the cluster iam role in + * `instance_profile_arn` has permission to write data to the s3 destination. + */ + s3: UpdateS3StorageInfo; + } + | { + $case: 'file'; + /** + * destination needs to be provided, e.g. + * `{ "file": { "destination": "file:/my/local/file.sh" } }` + */ + file: UpdateLocalFileInfo; + } + | { + $case: 'gcs'; + /** + * destination needs to be provided, e.g. + * `{ "gcs": { "destination": "gs://my-bucket/file.sh" } }` + */ + gcs: UpdateGcsStorageInfo; + } + | { + $case: 'abfss'; + /** + * destination needs to be provided, e.g. + * `abfss://@.dfs.core.windows.net/` + */ + abfss: UpdateAdlsgen2Info; + } + | { + $case: 'workspace'; + /** + * destination needs to be provided, e.g. + * `{ "workspace": { "destination": "/cluster-init-scripts/setup-datadog.sh" } }` + */ + workspace: UpdateWorkspaceStorageInfo; + } + | { + $case: 'volumes'; + /** + * destination needs to be provided. e.g. + * `{ \"volumes\" : { \"destination\" : \"/Volumes/my-init.sh\" } }` + */ + volumes: UpdateVolumesStorageInfo; + } + | undefined; +} + +export interface UpdateLocalFileInfo { + /** local file destination, e.g. `file:/my/local/file.sh` */ + destination?: string | undefined; +} + +export interface UpdateLogAnalyticsInfo { + logAnalyticsWorkspaceId?: string | undefined; + logAnalyticsPrimaryKey?: string | undefined; +} + +/** Configuration for flexible node types, allowing fallback to alternate node types during cluster launch and upscale. */ +export interface UpdateNodeTypeFlexibility { + /** A list of node type IDs to use as fallbacks when the primary node type is unavailable. */ + alternateNodeTypeIds?: string[] | undefined; +} + +/** A storage location in Amazon S3 */ +export interface UpdateS3StorageInfo { + /** + * S3 destination, e.g. `s3://my-bucket/some-prefix` Note that logs will be delivered using + * cluster iam role, please make sure you set cluster iam role and the role has write access to the + * destination. Please also note that you cannot use AWS keys to deliver logs. + */ + destination?: string | undefined; + /** + * S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. If both are set, + * endpoint will be used. + */ + region?: string | undefined; + /** + * S3 endpoint, e.g. `https://s3-us-west-2.amazonaws.com`. Either region or endpoint needs to be set. + * If both are set, endpoint will be used. + */ + endpoint?: string | undefined; + /** (Optional) Flag to enable server side encryption, `false` by default. */ + enableEncryption?: boolean | undefined; + /** + * (Optional) The encryption type, it could be `sse-s3` or `sse-kms`. It will be used only when + * encryption is enabled and the default type is `sse-s3`. */ - runtimeEngine?: RuntimeEngine | undefined; - kind?: ComputeKind | undefined; + encryptionType?: string | undefined; + /** (Optional) Kms key which will be used if encryption is enabled and encryption type is set to `sse-kms`. */ + kmsKey?: string | undefined; /** - * This field can only be used when `kind = CLASSIC_PREVIEW`. - * - * `effective_spark_version` is determined by `spark_version` (DBR release), this field `use_ml_runtime`, and whether `node_type_id` is gpu node or not. + * (Optional) Set canned access control list for the logs, e.g. `bucket-owner-full-control`. + * If `canned_cal` is set, please make sure the cluster iam role has `s3:PutObjectAcl` permission on + * the destination bucket and prefix. The full list of possible canned acl can be found at + * http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl. + * Please also note that by default only the object owner gets full controls. If you are using cross account + * role for writing data, you may want to set `bucket-owner-full-control` to make bucket owner able to + * read the logs. */ - useMlRuntime?: boolean | undefined; + cannedAcl?: string | undefined; +} + +/** A storage location back by UC Volumes. */ +export interface UpdateVolumesStorageInfo { /** - * This field can only be used when `kind = CLASSIC_PREVIEW`. - * - * When set to true, will automatically set single node related `custom_tags`, `spark_conf`, and `num_workers` + * UC Volumes destination, e.g. `/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` + * or `dbfs:/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` */ - isSingleNode?: boolean | undefined; - /** If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED disks. */ - remoteDiskThroughput?: number | undefined; - /** If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED disks. */ - totalInitialRemoteDiskSize?: number | undefined; + destination?: string | undefined; } -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface UpdateClusterResponse {} +/** Cluster Attributes showing for clusters workload types. */ +export interface UpdateWorkloadType { + /** defined what type of clients can use the cluster. E.g. Notebooks, Jobs */ + clients?: WorkloadType_UpdateClientsTypes | undefined; +} + +/** A storage location in Workspace Filesystem (WSFS) */ +export interface UpdateWorkspaceStorageInfo { + /** wsfs destination, e.g. `workspace:/cluster-init-scripts/setup-datadog.sh` */ + destination?: string | undefined; +} /** A storage location back by UC Volumes. */ export interface VolumesStorageInfo { @@ -3622,6 +4612,22 @@ export interface WorkloadType_ClientsTypes { jobs?: boolean | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface WorkloadType_CreateClientsTypes { + /** With notebooks set, this cluster can be used for notebooks */ + notebooks?: boolean | undefined; + /** With jobs set, the cluster can be used for jobs */ + jobs?: boolean | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface WorkloadType_UpdateClientsTypes { + /** With notebooks set, this cluster can be used for notebooks */ + notebooks?: boolean | undefined; + /** With jobs set, the cluster can be used for jobs */ + jobs?: boolean | undefined; +} + /** A storage location in Workspace Filesystem (WSFS) */ export interface WorkspaceStorageInfo { /** wsfs destination, e.g. `workspace:/cluster-init-scripts/setup-datadog.sh` */ @@ -4841,15 +5847,35 @@ export const unmarshalWorkspaceStorageInfoSchema: z.ZodType ({ + cluster_id: d.clusterId, + allow_missing: d.allowMissing, + })); + +export const marshalChangeClusterOwnerRequestSchema: z.ZodType = z + .object({ + clusterId: z.string().optional(), + ownerUsername: z.string().optional(), + }) + .transform(d => ({ + cluster_id: d.clusterId, + owner_username: d.ownerUsername, + })); + +export const marshalCreateAdlsgen2InfoSchema: z.ZodType = z + .object({ + destination: z.string(), }) .transform(d => ({ destination: d.destination, })); -export const marshalAutoScaleSchema: z.ZodType = z +export const marshalCreateAutoScaleSchema: z.ZodType = z .object({ minWorkers: z.number().optional(), maxWorkers: z.number().optional(), @@ -4859,7 +5885,7 @@ export const marshalAutoScaleSchema: z.ZodType = z max_workers: d.maxWorkers, })); -export const marshalAwsAttributesSchema: z.ZodType = z +export const marshalCreateAwsAttributesSchema: z.ZodType = z .object({ firstOnDemand: z.number().optional(), availability: z.string().optional(), @@ -4885,9 +5911,11 @@ export const marshalAwsAttributesSchema: z.ZodType = z ebs_volume_throughput: d.ebsVolumeThroughput, })); -export const marshalAzureAttributesSchema: z.ZodType = z +export const marshalCreateAzureAttributesSchema: z.ZodType = z .object({ - logAnalyticsInfo: z.lazy(() => marshalLogAnalyticsInfoSchema).optional(), + logAnalyticsInfo: z + .lazy(() => marshalCreateLogAnalyticsInfoSchema) + .optional(), firstOnDemand: z.number().optional(), availability: z.string().optional(), spotBidMaxPrice: z.number().optional(), @@ -4901,49 +5929,29 @@ export const marshalAzureAttributesSchema: z.ZodType = z capacity_reservation_group: d.capacityReservationGroup, })); -export const marshalCancelPendingClusterEnforcementRequestSchema: z.ZodType = z - .object({ - clusterId: z.string().optional(), - allowMissing: z.boolean().optional(), - }) - .transform(d => ({ - cluster_id: d.clusterId, - allow_missing: d.allowMissing, - })); - -export const marshalChangeClusterOwnerRequestSchema: z.ZodType = z - .object({ - clusterId: z.string().optional(), - ownerUsername: z.string().optional(), - }) - .transform(d => ({ - cluster_id: d.clusterId, - owner_username: d.ownerUsername, - })); - -export const marshalCloneClusterSchema: z.ZodType = z +export const marshalCreateCloneClusterSchema: z.ZodType = z .object({ - sourceClusterId: z.string().optional(), + sourceClusterId: z.string(), }) .transform(d => ({ source_cluster_id: d.sourceClusterId, })); -export const marshalClusterLogConfSchema: z.ZodType = z +export const marshalCreateClusterLogConfSchema: z.ZodType = z .object({ storageInfo: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('dbfs'), - dbfs: z.lazy(() => marshalDbfsStorageInfoSchema), + dbfs: z.lazy(() => marshalCreateDbfsStorageInfoSchema), }), z.object({ $case: z.literal('s3'), - s3: z.lazy(() => marshalS3StorageInfoSchema), + s3: z.lazy(() => marshalCreateS3StorageInfoSchema), }), z.object({ $case: z.literal('volumes'), - volumes: z.lazy(() => marshalVolumesStorageInfoSchema), + volumes: z.lazy(() => marshalCreateVolumesStorageInfoSchema), }), ]) .optional(), @@ -4957,44 +5965,48 @@ export const marshalClusterLogConfSchema: z.ZodType = z export const marshalCreateClusterRequestSchema: z.ZodType = z .object({ applyPolicyDefaultValues: z.boolean().optional(), - cloneFrom: z.lazy(() => marshalCloneClusterSchema).optional(), + cloneFrom: z.lazy(() => marshalCreateCloneClusterSchema).optional(), size: z .discriminatedUnion('$case', [ z.object({$case: z.literal('numWorkers'), numWorkers: z.number()}), z.object({ $case: z.literal('autoscale'), - autoscale: z.lazy(() => marshalAutoScaleSchema), + autoscale: z.lazy(() => marshalCreateAutoScaleSchema), }), ]) .optional(), clusterName: z.string().optional(), sparkVersion: z.string().optional(), sparkConf: z.record(z.string(), z.string()).optional(), - awsAttributes: z.lazy(() => marshalAwsAttributesSchema).optional(), - azureAttributes: z.lazy(() => marshalAzureAttributesSchema).optional(), - gcpAttributes: z.lazy(() => marshalGcpAttributesSchema).optional(), + awsAttributes: z.lazy(() => marshalCreateAwsAttributesSchema).optional(), + azureAttributes: z + .lazy(() => marshalCreateAzureAttributesSchema) + .optional(), + gcpAttributes: z.lazy(() => marshalCreateGcpAttributesSchema).optional(), nodeTypeId: z.string().optional(), driverNodeTypeId: z.string().optional(), workerNodeTypeFlexibility: z - .lazy(() => marshalNodeTypeFlexibilitySchema) + .lazy(() => marshalCreateNodeTypeFlexibilitySchema) .optional(), driverNodeTypeFlexibility: z - .lazy(() => marshalNodeTypeFlexibilitySchema) + .lazy(() => marshalCreateNodeTypeFlexibilitySchema) .optional(), sshPublicKeys: z.array(z.string()).optional(), customTags: z.record(z.string(), z.string()).optional(), - clusterLogConf: z.lazy(() => marshalClusterLogConfSchema).optional(), + clusterLogConf: z.lazy(() => marshalCreateClusterLogConfSchema).optional(), sparkEnvVars: z.record(z.string(), z.string()).optional(), autoterminationMinutes: z.number().optional(), enableElasticDisk: z.boolean().optional(), - initScripts: z.array(z.lazy(() => marshalInitScriptInfoSchema)).optional(), - dockerImage: z.lazy(() => marshalDockerImageSchema).optional(), + initScripts: z + .array(z.lazy(() => marshalCreateInitScriptInfoSchema)) + .optional(), + dockerImage: z.lazy(() => marshalCreateDockerImageSchema).optional(), instancePoolId: z.string().optional(), singleUserName: z.string().optional(), policyId: z.string().optional(), enableLocalDiskEncryption: z.boolean().optional(), driverInstancePoolId: z.string().optional(), - workloadType: z.lazy(() => marshalWorkloadTypeSchema).optional(), + workloadType: z.lazy(() => marshalCreateWorkloadTypeSchema).optional(), dataSecurityMode: z.string().optional(), runtimeEngine: z.string().optional(), kind: z.string().optional(), @@ -5004,86 +6016,233 @@ export const marshalCreateClusterRequestSchema: z.ZodType = z totalInitialRemoteDiskSize: z.number().optional(), }) .transform(d => ({ - apply_policy_default_values: d.applyPolicyDefaultValues, - clone_from: d.cloneFrom, - ...(d.size?.$case === 'numWorkers' && {num_workers: d.size.numWorkers}), - ...(d.size?.$case === 'autoscale' && {autoscale: d.size.autoscale}), - cluster_name: d.clusterName, - spark_version: d.sparkVersion, - spark_conf: d.sparkConf, - aws_attributes: d.awsAttributes, - azure_attributes: d.azureAttributes, - gcp_attributes: d.gcpAttributes, - node_type_id: d.nodeTypeId, - driver_node_type_id: d.driverNodeTypeId, - worker_node_type_flexibility: d.workerNodeTypeFlexibility, - driver_node_type_flexibility: d.driverNodeTypeFlexibility, - ssh_public_keys: d.sshPublicKeys, - custom_tags: d.customTags, - cluster_log_conf: d.clusterLogConf, - spark_env_vars: d.sparkEnvVars, - autotermination_minutes: d.autoterminationMinutes, - enable_elastic_disk: d.enableElasticDisk, - init_scripts: d.initScripts, - docker_image: d.dockerImage, - instance_pool_id: d.instancePoolId, - single_user_name: d.singleUserName, - policy_id: d.policyId, - enable_local_disk_encryption: d.enableLocalDiskEncryption, - driver_instance_pool_id: d.driverInstancePoolId, - workload_type: d.workloadType, - data_security_mode: d.dataSecurityMode, - runtime_engine: d.runtimeEngine, - kind: d.kind, - use_ml_runtime: d.useMlRuntime, - is_single_node: d.isSingleNode, - remote_disk_throughput: d.remoteDiskThroughput, - total_initial_remote_disk_size: d.totalInitialRemoteDiskSize, + apply_policy_default_values: d.applyPolicyDefaultValues, + clone_from: d.cloneFrom, + ...(d.size?.$case === 'numWorkers' && {num_workers: d.size.numWorkers}), + ...(d.size?.$case === 'autoscale' && {autoscale: d.size.autoscale}), + cluster_name: d.clusterName, + spark_version: d.sparkVersion, + spark_conf: d.sparkConf, + aws_attributes: d.awsAttributes, + azure_attributes: d.azureAttributes, + gcp_attributes: d.gcpAttributes, + node_type_id: d.nodeTypeId, + driver_node_type_id: d.driverNodeTypeId, + worker_node_type_flexibility: d.workerNodeTypeFlexibility, + driver_node_type_flexibility: d.driverNodeTypeFlexibility, + ssh_public_keys: d.sshPublicKeys, + custom_tags: d.customTags, + cluster_log_conf: d.clusterLogConf, + spark_env_vars: d.sparkEnvVars, + autotermination_minutes: d.autoterminationMinutes, + enable_elastic_disk: d.enableElasticDisk, + init_scripts: d.initScripts, + docker_image: d.dockerImage, + instance_pool_id: d.instancePoolId, + single_user_name: d.singleUserName, + policy_id: d.policyId, + enable_local_disk_encryption: d.enableLocalDiskEncryption, + driver_instance_pool_id: d.driverInstancePoolId, + workload_type: d.workloadType, + data_security_mode: d.dataSecurityMode, + runtime_engine: d.runtimeEngine, + kind: d.kind, + use_ml_runtime: d.useMlRuntime, + is_single_node: d.isSingleNode, + remote_disk_throughput: d.remoteDiskThroughput, + total_initial_remote_disk_size: d.totalInitialRemoteDiskSize, + })); + +export const marshalCreateDbfsStorageInfoSchema: z.ZodType = z + .object({ + destination: z.string(), + }) + .transform(d => ({ + destination: d.destination, + })); + +export const marshalCreateDockerBasicAuthSchema: z.ZodType = z + .object({ + username: z.string().optional(), + password: z.string().optional(), + }) + .transform(d => ({ + username: d.username, + password: d.password, + })); + +export const marshalCreateDockerImageSchema: z.ZodType = z + .object({ + url: z.string().optional(), + credsOneof: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('basicAuth'), + basicAuth: z.lazy(() => marshalCreateDockerBasicAuthSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + url: d.url, + ...(d.credsOneof?.$case === 'basicAuth' && { + basic_auth: d.credsOneof.basicAuth, + }), + })); + +export const marshalCreateGcpAttributesSchema: z.ZodType = z + .object({ + usePreemptibleExecutors: z.boolean().optional(), + googleServiceAccount: z.string().optional(), + bootDiskSize: z.number().optional(), + availability: z.string().optional(), + zoneId: z.string().optional(), + localSsdCount: z.number().optional(), + firstOnDemand: z.number().optional(), + confidentialComputeType: z.string().optional(), + }) + .transform(d => ({ + use_preemptible_executors: d.usePreemptibleExecutors, + google_service_account: d.googleServiceAccount, + boot_disk_size: d.bootDiskSize, + availability: d.availability, + zone_id: d.zoneId, + local_ssd_count: d.localSsdCount, + first_on_demand: d.firstOnDemand, + confidential_compute_type: d.confidentialComputeType, + })); + +export const marshalCreateGcsStorageInfoSchema: z.ZodType = z + .object({ + destination: z.string(), + }) + .transform(d => ({ + destination: d.destination, + })); + +export const marshalCreateInitScriptInfoSchema: z.ZodType = z + .object({ + storageInfo: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('dbfs'), + dbfs: z.lazy(() => marshalCreateDbfsStorageInfoSchema), + }), + z.object({ + $case: z.literal('s3'), + s3: z.lazy(() => marshalCreateS3StorageInfoSchema), + }), + z.object({ + $case: z.literal('file'), + file: z.lazy(() => marshalCreateLocalFileInfoSchema), + }), + z.object({ + $case: z.literal('gcs'), + gcs: z.lazy(() => marshalCreateGcsStorageInfoSchema), + }), + z.object({ + $case: z.literal('abfss'), + abfss: z.lazy(() => marshalCreateAdlsgen2InfoSchema), + }), + z.object({ + $case: z.literal('workspace'), + workspace: z.lazy(() => marshalCreateWorkspaceStorageInfoSchema), + }), + z.object({ + $case: z.literal('volumes'), + volumes: z.lazy(() => marshalCreateVolumesStorageInfoSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.storageInfo?.$case === 'dbfs' && {dbfs: d.storageInfo.dbfs}), + ...(d.storageInfo?.$case === 's3' && {s3: d.storageInfo.s3}), + ...(d.storageInfo?.$case === 'file' && {file: d.storageInfo.file}), + ...(d.storageInfo?.$case === 'gcs' && {gcs: d.storageInfo.gcs}), + ...(d.storageInfo?.$case === 'abfss' && {abfss: d.storageInfo.abfss}), + ...(d.storageInfo?.$case === 'workspace' && { + workspace: d.storageInfo.workspace, + }), + ...(d.storageInfo?.$case === 'volumes' && {volumes: d.storageInfo.volumes}), + })); + +export const marshalCreateLocalFileInfoSchema: z.ZodType = z + .object({ + destination: z.string(), + }) + .transform(d => ({ + destination: d.destination, + })); + +export const marshalCreateLogAnalyticsInfoSchema: z.ZodType = z + .object({ + logAnalyticsWorkspaceId: z.string().optional(), + logAnalyticsPrimaryKey: z.string().optional(), + }) + .transform(d => ({ + log_analytics_workspace_id: d.logAnalyticsWorkspaceId, + log_analytics_primary_key: d.logAnalyticsPrimaryKey, })); -export const marshalDbfsStorageInfoSchema: z.ZodType = z +export const marshalCreateNodeTypeFlexibilitySchema: z.ZodType = z .object({ - destination: z.string().optional(), + alternateNodeTypeIds: z.array(z.string()).optional(), + }) + .transform(d => ({ + alternate_node_type_ids: d.alternateNodeTypeIds, + })); + +export const marshalCreateS3StorageInfoSchema: z.ZodType = z + .object({ + destination: z.string(), + region: z.string().optional(), + endpoint: z.string().optional(), + enableEncryption: z.boolean().optional(), + encryptionType: z.string().optional(), + kmsKey: z.string().optional(), + cannedAcl: z.string().optional(), }) .transform(d => ({ destination: d.destination, + region: d.region, + endpoint: d.endpoint, + enable_encryption: d.enableEncryption, + encryption_type: d.encryptionType, + kms_key: d.kmsKey, + canned_acl: d.cannedAcl, })); -export const marshalDeleteClusterRequestSchema: z.ZodType = z +export const marshalCreateVolumesStorageInfoSchema: z.ZodType = z .object({ - clusterId: z.string().optional(), + destination: z.string(), }) .transform(d => ({ - cluster_id: d.clusterId, + destination: d.destination, })); -export const marshalDockerBasicAuthSchema: z.ZodType = z +export const marshalCreateWorkloadTypeSchema: z.ZodType = z .object({ - username: z.string().optional(), - password: z.string().optional(), + clients: z.lazy(() => marshalWorkloadType_CreateClientsTypesSchema), }) .transform(d => ({ - username: d.username, - password: d.password, + clients: d.clients, })); -export const marshalDockerImageSchema: z.ZodType = z +export const marshalCreateWorkspaceStorageInfoSchema: z.ZodType = z .object({ - url: z.string().optional(), - credsOneof: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('basicAuth'), - basicAuth: z.lazy(() => marshalDockerBasicAuthSchema), - }), - ]) - .optional(), + destination: z.string(), }) .transform(d => ({ - url: d.url, - ...(d.credsOneof?.$case === 'basicAuth' && { - basic_auth: d.credsOneof.basicAuth, - }), + destination: d.destination, + })); + +export const marshalDeleteClusterRequestSchema: z.ZodType = z + .object({ + clusterId: z.string().optional(), + }) + .transform(d => ({ + cluster_id: d.clusterId, })); export const marshalEditClusterRequestSchema: z.ZodType = z @@ -5095,38 +6254,42 @@ export const marshalEditClusterRequestSchema: z.ZodType = z z.object({$case: z.literal('numWorkers'), numWorkers: z.number()}), z.object({ $case: z.literal('autoscale'), - autoscale: z.lazy(() => marshalAutoScaleSchema), + autoscale: z.lazy(() => marshalCreateAutoScaleSchema), }), ]) .optional(), clusterName: z.string().optional(), sparkVersion: z.string().optional(), sparkConf: z.record(z.string(), z.string()).optional(), - awsAttributes: z.lazy(() => marshalAwsAttributesSchema).optional(), - azureAttributes: z.lazy(() => marshalAzureAttributesSchema).optional(), - gcpAttributes: z.lazy(() => marshalGcpAttributesSchema).optional(), + awsAttributes: z.lazy(() => marshalCreateAwsAttributesSchema).optional(), + azureAttributes: z + .lazy(() => marshalCreateAzureAttributesSchema) + .optional(), + gcpAttributes: z.lazy(() => marshalCreateGcpAttributesSchema).optional(), nodeTypeId: z.string().optional(), driverNodeTypeId: z.string().optional(), workerNodeTypeFlexibility: z - .lazy(() => marshalNodeTypeFlexibilitySchema) + .lazy(() => marshalCreateNodeTypeFlexibilitySchema) .optional(), driverNodeTypeFlexibility: z - .lazy(() => marshalNodeTypeFlexibilitySchema) + .lazy(() => marshalCreateNodeTypeFlexibilitySchema) .optional(), sshPublicKeys: z.array(z.string()).optional(), customTags: z.record(z.string(), z.string()).optional(), - clusterLogConf: z.lazy(() => marshalClusterLogConfSchema).optional(), + clusterLogConf: z.lazy(() => marshalCreateClusterLogConfSchema).optional(), sparkEnvVars: z.record(z.string(), z.string()).optional(), autoterminationMinutes: z.number().optional(), enableElasticDisk: z.boolean().optional(), - initScripts: z.array(z.lazy(() => marshalInitScriptInfoSchema)).optional(), - dockerImage: z.lazy(() => marshalDockerImageSchema).optional(), + initScripts: z + .array(z.lazy(() => marshalCreateInitScriptInfoSchema)) + .optional(), + dockerImage: z.lazy(() => marshalCreateDockerImageSchema).optional(), instancePoolId: z.string().optional(), singleUserName: z.string().optional(), policyId: z.string().optional(), enableLocalDiskEncryption: z.boolean().optional(), driverInstancePoolId: z.string().optional(), - workloadType: z.lazy(() => marshalWorkloadTypeSchema).optional(), + workloadType: z.lazy(() => marshalCreateWorkloadTypeSchema).optional(), dataSecurityMode: z.string().optional(), runtimeEngine: z.string().optional(), kind: z.string().optional(), @@ -5186,83 +6349,6 @@ export const marshalEnforcePolicyComplianceForClusterRequestSchema: z.ZodType = enforce_mode: d.enforceMode, })); -export const marshalGcpAttributesSchema: z.ZodType = z - .object({ - usePreemptibleExecutors: z.boolean().optional(), - googleServiceAccount: z.string().optional(), - bootDiskSize: z.number().optional(), - availability: z.string().optional(), - zoneId: z.string().optional(), - localSsdCount: z.number().optional(), - firstOnDemand: z.number().optional(), - confidentialComputeType: z.string().optional(), - }) - .transform(d => ({ - use_preemptible_executors: d.usePreemptibleExecutors, - google_service_account: d.googleServiceAccount, - boot_disk_size: d.bootDiskSize, - availability: d.availability, - zone_id: d.zoneId, - local_ssd_count: d.localSsdCount, - first_on_demand: d.firstOnDemand, - confidential_compute_type: d.confidentialComputeType, - })); - -export const marshalGcsStorageInfoSchema: z.ZodType = z - .object({ - destination: z.string().optional(), - }) - .transform(d => ({ - destination: d.destination, - })); - -export const marshalInitScriptInfoSchema: z.ZodType = z - .object({ - storageInfo: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('dbfs'), - dbfs: z.lazy(() => marshalDbfsStorageInfoSchema), - }), - z.object({ - $case: z.literal('s3'), - s3: z.lazy(() => marshalS3StorageInfoSchema), - }), - z.object({ - $case: z.literal('file'), - file: z.lazy(() => marshalLocalFileInfoSchema), - }), - z.object({ - $case: z.literal('gcs'), - gcs: z.lazy(() => marshalGcsStorageInfoSchema), - }), - z.object({ - $case: z.literal('abfss'), - abfss: z.lazy(() => marshalAdlsgen2InfoSchema), - }), - z.object({ - $case: z.literal('workspace'), - workspace: z.lazy(() => marshalWorkspaceStorageInfoSchema), - }), - z.object({ - $case: z.literal('volumes'), - volumes: z.lazy(() => marshalVolumesStorageInfoSchema), - }), - ]) - .optional(), - }) - .transform(d => ({ - ...(d.storageInfo?.$case === 'dbfs' && {dbfs: d.storageInfo.dbfs}), - ...(d.storageInfo?.$case === 's3' && {s3: d.storageInfo.s3}), - ...(d.storageInfo?.$case === 'file' && {file: d.storageInfo.file}), - ...(d.storageInfo?.$case === 'gcs' && {gcs: d.storageInfo.gcs}), - ...(d.storageInfo?.$case === 'abfss' && {abfss: d.storageInfo.abfss}), - ...(d.storageInfo?.$case === 'workspace' && { - workspace: d.storageInfo.workspace, - }), - ...(d.storageInfo?.$case === 'volumes' && {volumes: d.storageInfo.volumes}), - })); - export const marshalListEventsRequestSchema: z.ZodType = z .object({ clusterId: z.string().optional(), @@ -5287,32 +6373,6 @@ export const marshalListEventsRequestSchema: z.ZodType = z page_size: d.pageSize, })); -export const marshalLocalFileInfoSchema: z.ZodType = z - .object({ - destination: z.string().optional(), - }) - .transform(d => ({ - destination: d.destination, - })); - -export const marshalLogAnalyticsInfoSchema: z.ZodType = z - .object({ - logAnalyticsWorkspaceId: z.string().optional(), - logAnalyticsPrimaryKey: z.string().optional(), - }) - .transform(d => ({ - log_analytics_workspace_id: d.logAnalyticsWorkspaceId, - log_analytics_primary_key: d.logAnalyticsPrimaryKey, - })); - -export const marshalNodeTypeFlexibilitySchema: z.ZodType = z - .object({ - alternateNodeTypeIds: z.array(z.string()).optional(), - }) - .transform(d => ({ - alternate_node_type_ids: d.alternateNodeTypeIds, - })); - export const marshalPermanentDeleteClusterRequestSchema: z.ZodType = z .object({ clusterId: z.string().optional(), @@ -5337,7 +6397,7 @@ export const marshalResizeClusterRequestSchema: z.ZodType = z z.object({$case: z.literal('numWorkers'), numWorkers: z.number()}), z.object({ $case: z.literal('autoscale'), - autoscale: z.lazy(() => marshalAutoScaleSchema), + autoscale: z.lazy(() => marshalCreateAutoScaleSchema), }), ]) .optional(), @@ -5358,27 +6418,15 @@ export const marshalRestartClusterRequestSchema: z.ZodType = z restart_user: d.restartUser, })); -export const marshalS3StorageInfoSchema: z.ZodType = z +export const marshalStartClusterRequestSchema: z.ZodType = z .object({ - destination: z.string().optional(), - region: z.string().optional(), - endpoint: z.string().optional(), - enableEncryption: z.boolean().optional(), - encryptionType: z.string().optional(), - kmsKey: z.string().optional(), - cannedAcl: z.string().optional(), + clusterId: z.string().optional(), }) .transform(d => ({ - destination: d.destination, - region: d.region, - endpoint: d.endpoint, - enable_encryption: d.enableEncryption, - encryption_type: d.encryptionType, - kms_key: d.kmsKey, - canned_acl: d.cannedAcl, + cluster_id: d.clusterId, })); -export const marshalStartClusterRequestSchema: z.ZodType = z +export const marshalUnpinClusterRequestSchema: z.ZodType = z .object({ clusterId: z.string().optional(), }) @@ -5386,19 +6434,98 @@ export const marshalStartClusterRequestSchema: z.ZodType = z cluster_id: d.clusterId, })); -export const marshalUnpinClusterRequestSchema: z.ZodType = z +export const marshalUpdateAdlsgen2InfoSchema: z.ZodType = z + .object({ + destination: z.string().optional(), + }) + .transform(d => ({ + destination: d.destination, + })); + +export const marshalUpdateAutoScaleSchema: z.ZodType = z + .object({ + minWorkers: z.number().optional(), + maxWorkers: z.number().optional(), + }) + .transform(d => ({ + min_workers: d.minWorkers, + max_workers: d.maxWorkers, + })); + +export const marshalUpdateAwsAttributesSchema: z.ZodType = z + .object({ + firstOnDemand: z.number().optional(), + availability: z.string().optional(), + zoneId: z.string().optional(), + instanceProfileArn: z.string().optional(), + spotBidPricePercent: z.number().optional(), + ebsVolumeType: z.string().optional(), + ebsVolumeCount: z.number().optional(), + ebsVolumeSize: z.number().optional(), + ebsVolumeIops: z.number().optional(), + ebsVolumeThroughput: z.number().optional(), + }) + .transform(d => ({ + first_on_demand: d.firstOnDemand, + availability: d.availability, + zone_id: d.zoneId, + instance_profile_arn: d.instanceProfileArn, + spot_bid_price_percent: d.spotBidPricePercent, + ebs_volume_type: d.ebsVolumeType, + ebs_volume_count: d.ebsVolumeCount, + ebs_volume_size: d.ebsVolumeSize, + ebs_volume_iops: d.ebsVolumeIops, + ebs_volume_throughput: d.ebsVolumeThroughput, + })); + +export const marshalUpdateAzureAttributesSchema: z.ZodType = z + .object({ + logAnalyticsInfo: z + .lazy(() => marshalUpdateLogAnalyticsInfoSchema) + .optional(), + firstOnDemand: z.number().optional(), + availability: z.string().optional(), + spotBidMaxPrice: z.number().optional(), + capacityReservationGroup: z.string().optional(), + }) + .transform(d => ({ + log_analytics_info: d.logAnalyticsInfo, + first_on_demand: d.firstOnDemand, + availability: d.availability, + spot_bid_max_price: d.spotBidMaxPrice, + capacity_reservation_group: d.capacityReservationGroup, + })); + +export const marshalUpdateClusterLogConfSchema: z.ZodType = z .object({ - clusterId: z.string().optional(), + storageInfo: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('dbfs'), + dbfs: z.lazy(() => marshalUpdateDbfsStorageInfoSchema), + }), + z.object({ + $case: z.literal('s3'), + s3: z.lazy(() => marshalUpdateS3StorageInfoSchema), + }), + z.object({ + $case: z.literal('volumes'), + volumes: z.lazy(() => marshalUpdateVolumesStorageInfoSchema), + }), + ]) + .optional(), }) .transform(d => ({ - cluster_id: d.clusterId, + ...(d.storageInfo?.$case === 'dbfs' && {dbfs: d.storageInfo.dbfs}), + ...(d.storageInfo?.$case === 's3' && {s3: d.storageInfo.s3}), + ...(d.storageInfo?.$case === 'volumes' && {volumes: d.storageInfo.volumes}), })); export const marshalUpdateClusterRequestSchema: z.ZodType = z .object({ clusterId: z.string().optional(), cluster: z - .lazy(() => marshalUpdateClusterRequest_UpdateClusterResourceSchema) + .lazy(() => marshalUpdateClusterRequest_UpdateUpdateClusterResourceSchema) .optional(), updateMask: z .any() @@ -5412,7 +6539,7 @@ export const marshalUpdateClusterRequestSchema: z.ZodType = z })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalUpdateClusterRequest_UpdateClusterResourceSchema: z.ZodType = +export const marshalUpdateClusterRequest_UpdateUpdateClusterResourceSchema: z.ZodType = z .object({ size: z @@ -5420,40 +6547,44 @@ export const marshalUpdateClusterRequest_UpdateClusterResourceSchema: z.ZodType z.object({$case: z.literal('numWorkers'), numWorkers: z.number()}), z.object({ $case: z.literal('autoscale'), - autoscale: z.lazy(() => marshalAutoScaleSchema), + autoscale: z.lazy(() => marshalUpdateAutoScaleSchema), }), ]) .optional(), clusterName: z.string().optional(), sparkVersion: z.string().optional(), sparkConf: z.record(z.string(), z.string()).optional(), - awsAttributes: z.lazy(() => marshalAwsAttributesSchema).optional(), - azureAttributes: z.lazy(() => marshalAzureAttributesSchema).optional(), - gcpAttributes: z.lazy(() => marshalGcpAttributesSchema).optional(), + awsAttributes: z.lazy(() => marshalUpdateAwsAttributesSchema).optional(), + azureAttributes: z + .lazy(() => marshalUpdateAzureAttributesSchema) + .optional(), + gcpAttributes: z.lazy(() => marshalUpdateGcpAttributesSchema).optional(), nodeTypeId: z.string().optional(), driverNodeTypeId: z.string().optional(), workerNodeTypeFlexibility: z - .lazy(() => marshalNodeTypeFlexibilitySchema) + .lazy(() => marshalUpdateNodeTypeFlexibilitySchema) .optional(), driverNodeTypeFlexibility: z - .lazy(() => marshalNodeTypeFlexibilitySchema) + .lazy(() => marshalUpdateNodeTypeFlexibilitySchema) .optional(), sshPublicKeys: z.array(z.string()).optional(), customTags: z.record(z.string(), z.string()).optional(), - clusterLogConf: z.lazy(() => marshalClusterLogConfSchema).optional(), + clusterLogConf: z + .lazy(() => marshalUpdateClusterLogConfSchema) + .optional(), sparkEnvVars: z.record(z.string(), z.string()).optional(), autoterminationMinutes: z.number().optional(), enableElasticDisk: z.boolean().optional(), initScripts: z - .array(z.lazy(() => marshalInitScriptInfoSchema)) + .array(z.lazy(() => marshalUpdateInitScriptInfoSchema)) .optional(), - dockerImage: z.lazy(() => marshalDockerImageSchema).optional(), + dockerImage: z.lazy(() => marshalUpdateDockerImageSchema).optional(), instancePoolId: z.string().optional(), singleUserName: z.string().optional(), policyId: z.string().optional(), enableLocalDiskEncryption: z.boolean().optional(), driverInstancePoolId: z.string().optional(), - workloadType: z.lazy(() => marshalWorkloadTypeSchema).optional(), + workloadType: z.lazy(() => marshalUpdateWorkloadTypeSchema).optional(), dataSecurityMode: z.string().optional(), runtimeEngine: z.string().optional(), kind: z.string().optional(), @@ -5498,7 +6629,167 @@ export const marshalUpdateClusterRequest_UpdateClusterResourceSchema: z.ZodType total_initial_remote_disk_size: d.totalInitialRemoteDiskSize, })); -export const marshalVolumesStorageInfoSchema: z.ZodType = z +export const marshalUpdateDbfsStorageInfoSchema: z.ZodType = z + .object({ + destination: z.string().optional(), + }) + .transform(d => ({ + destination: d.destination, + })); + +export const marshalUpdateDockerBasicAuthSchema: z.ZodType = z + .object({ + username: z.string().optional(), + password: z.string().optional(), + }) + .transform(d => ({ + username: d.username, + password: d.password, + })); + +export const marshalUpdateDockerImageSchema: z.ZodType = z + .object({ + url: z.string().optional(), + credsOneof: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('basicAuth'), + basicAuth: z.lazy(() => marshalUpdateDockerBasicAuthSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + url: d.url, + ...(d.credsOneof?.$case === 'basicAuth' && { + basic_auth: d.credsOneof.basicAuth, + }), + })); + +export const marshalUpdateGcpAttributesSchema: z.ZodType = z + .object({ + usePreemptibleExecutors: z.boolean().optional(), + googleServiceAccount: z.string().optional(), + bootDiskSize: z.number().optional(), + availability: z.string().optional(), + zoneId: z.string().optional(), + localSsdCount: z.number().optional(), + firstOnDemand: z.number().optional(), + confidentialComputeType: z.string().optional(), + }) + .transform(d => ({ + use_preemptible_executors: d.usePreemptibleExecutors, + google_service_account: d.googleServiceAccount, + boot_disk_size: d.bootDiskSize, + availability: d.availability, + zone_id: d.zoneId, + local_ssd_count: d.localSsdCount, + first_on_demand: d.firstOnDemand, + confidential_compute_type: d.confidentialComputeType, + })); + +export const marshalUpdateGcsStorageInfoSchema: z.ZodType = z + .object({ + destination: z.string().optional(), + }) + .transform(d => ({ + destination: d.destination, + })); + +export const marshalUpdateInitScriptInfoSchema: z.ZodType = z + .object({ + storageInfo: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('dbfs'), + dbfs: z.lazy(() => marshalUpdateDbfsStorageInfoSchema), + }), + z.object({ + $case: z.literal('s3'), + s3: z.lazy(() => marshalUpdateS3StorageInfoSchema), + }), + z.object({ + $case: z.literal('file'), + file: z.lazy(() => marshalUpdateLocalFileInfoSchema), + }), + z.object({ + $case: z.literal('gcs'), + gcs: z.lazy(() => marshalUpdateGcsStorageInfoSchema), + }), + z.object({ + $case: z.literal('abfss'), + abfss: z.lazy(() => marshalUpdateAdlsgen2InfoSchema), + }), + z.object({ + $case: z.literal('workspace'), + workspace: z.lazy(() => marshalUpdateWorkspaceStorageInfoSchema), + }), + z.object({ + $case: z.literal('volumes'), + volumes: z.lazy(() => marshalUpdateVolumesStorageInfoSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.storageInfo?.$case === 'dbfs' && {dbfs: d.storageInfo.dbfs}), + ...(d.storageInfo?.$case === 's3' && {s3: d.storageInfo.s3}), + ...(d.storageInfo?.$case === 'file' && {file: d.storageInfo.file}), + ...(d.storageInfo?.$case === 'gcs' && {gcs: d.storageInfo.gcs}), + ...(d.storageInfo?.$case === 'abfss' && {abfss: d.storageInfo.abfss}), + ...(d.storageInfo?.$case === 'workspace' && { + workspace: d.storageInfo.workspace, + }), + ...(d.storageInfo?.$case === 'volumes' && {volumes: d.storageInfo.volumes}), + })); + +export const marshalUpdateLocalFileInfoSchema: z.ZodType = z + .object({ + destination: z.string().optional(), + }) + .transform(d => ({ + destination: d.destination, + })); + +export const marshalUpdateLogAnalyticsInfoSchema: z.ZodType = z + .object({ + logAnalyticsWorkspaceId: z.string().optional(), + logAnalyticsPrimaryKey: z.string().optional(), + }) + .transform(d => ({ + log_analytics_workspace_id: d.logAnalyticsWorkspaceId, + log_analytics_primary_key: d.logAnalyticsPrimaryKey, + })); + +export const marshalUpdateNodeTypeFlexibilitySchema: z.ZodType = z + .object({ + alternateNodeTypeIds: z.array(z.string()).optional(), + }) + .transform(d => ({ + alternate_node_type_ids: d.alternateNodeTypeIds, + })); + +export const marshalUpdateS3StorageInfoSchema: z.ZodType = z + .object({ + destination: z.string().optional(), + region: z.string().optional(), + endpoint: z.string().optional(), + enableEncryption: z.boolean().optional(), + encryptionType: z.string().optional(), + kmsKey: z.string().optional(), + cannedAcl: z.string().optional(), + }) + .transform(d => ({ + destination: d.destination, + region: d.region, + endpoint: d.endpoint, + enable_encryption: d.enableEncryption, + encryption_type: d.encryptionType, + kms_key: d.kmsKey, + canned_acl: d.cannedAcl, + })); + +export const marshalUpdateVolumesStorageInfoSchema: z.ZodType = z .object({ destination: z.string().optional(), }) @@ -5506,16 +6797,26 @@ export const marshalVolumesStorageInfoSchema: z.ZodType = z destination: d.destination, })); -export const marshalWorkloadTypeSchema: z.ZodType = z +export const marshalUpdateWorkloadTypeSchema: z.ZodType = z .object({ - clients: z.lazy(() => marshalWorkloadType_ClientsTypesSchema).optional(), + clients: z + .lazy(() => marshalWorkloadType_UpdateClientsTypesSchema) + .optional(), }) .transform(d => ({ clients: d.clients, })); +export const marshalUpdateWorkspaceStorageInfoSchema: z.ZodType = z + .object({ + destination: z.string().optional(), + }) + .transform(d => ({ + destination: d.destination, + })); + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalWorkloadType_ClientsTypesSchema: z.ZodType = z +export const marshalWorkloadType_CreateClientsTypesSchema: z.ZodType = z .object({ notebooks: z.boolean().optional(), jobs: z.boolean().optional(), @@ -5525,20 +6826,23 @@ export const marshalWorkloadType_ClientsTypesSchema: z.ZodType = z jobs: d.jobs, })); -export const marshalWorkspaceStorageInfoSchema: z.ZodType = z +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalWorkloadType_UpdateClientsTypesSchema: z.ZodType = z .object({ - destination: z.string().optional(), + notebooks: z.boolean().optional(), + jobs: z.boolean().optional(), }) .transform(d => ({ - destination: d.destination, + notebooks: d.notebooks, + jobs: d.jobs, })); -const autoScaleFieldMaskSchema: FieldMaskSchema = { +const updateAutoScaleFieldMaskSchema: FieldMaskSchema = { maxWorkers: {wire: 'max_workers'}, minWorkers: {wire: 'min_workers'}, }; -const awsAttributesFieldMaskSchema: FieldMaskSchema = { +const updateAwsAttributesFieldMaskSchema: FieldMaskSchema = { availability: {wire: 'availability'}, ebsVolumeCount: {wire: 'ebs_volume_count'}, ebsVolumeIops: {wire: 'ebs_volume_iops'}, @@ -5551,105 +6855,64 @@ const awsAttributesFieldMaskSchema: FieldMaskSchema = { zoneId: {wire: 'zone_id'}, }; -const azureAttributesFieldMaskSchema: FieldMaskSchema = { +const updateAzureAttributesFieldMaskSchema: FieldMaskSchema = { availability: {wire: 'availability'}, capacityReservationGroup: {wire: 'capacity_reservation_group'}, firstOnDemand: {wire: 'first_on_demand'}, logAnalyticsInfo: { wire: 'log_analytics_info', - children: () => logAnalyticsInfoFieldMaskSchema, + children: () => updateLogAnalyticsInfoFieldMaskSchema, }, spotBidMaxPrice: {wire: 'spot_bid_max_price'}, }; -const clusterLogConfFieldMaskSchema: FieldMaskSchema = { - dbfs: {wire: 'dbfs', children: () => dbfsStorageInfoFieldMaskSchema}, - s3: {wire: 's3', children: () => s3StorageInfoFieldMaskSchema}, - volumes: {wire: 'volumes', children: () => volumesStorageInfoFieldMaskSchema}, -}; - -const dbfsStorageInfoFieldMaskSchema: FieldMaskSchema = { - destination: {wire: 'destination'}, -}; - -const dockerBasicAuthFieldMaskSchema: FieldMaskSchema = { - password: {wire: 'password'}, - username: {wire: 'username'}, -}; - -const dockerImageFieldMaskSchema: FieldMaskSchema = { - basicAuth: { - wire: 'basic_auth', - children: () => dockerBasicAuthFieldMaskSchema, +const updateClusterLogConfFieldMaskSchema: FieldMaskSchema = { + dbfs: {wire: 'dbfs', children: () => updateDbfsStorageInfoFieldMaskSchema}, + s3: {wire: 's3', children: () => updateS3StorageInfoFieldMaskSchema}, + volumes: { + wire: 'volumes', + children: () => updateVolumesStorageInfoFieldMaskSchema, }, - url: {wire: 'url'}, -}; - -const gcpAttributesFieldMaskSchema: FieldMaskSchema = { - availability: {wire: 'availability'}, - bootDiskSize: {wire: 'boot_disk_size'}, - confidentialComputeType: {wire: 'confidential_compute_type'}, - firstOnDemand: {wire: 'first_on_demand'}, - googleServiceAccount: {wire: 'google_service_account'}, - localSsdCount: {wire: 'local_ssd_count'}, - usePreemptibleExecutors: {wire: 'use_preemptible_executors'}, - zoneId: {wire: 'zone_id'}, -}; - -const logAnalyticsInfoFieldMaskSchema: FieldMaskSchema = { - logAnalyticsPrimaryKey: {wire: 'log_analytics_primary_key'}, - logAnalyticsWorkspaceId: {wire: 'log_analytics_workspace_id'}, -}; - -const nodeTypeFlexibilityFieldMaskSchema: FieldMaskSchema = { - alternateNodeTypeIds: {wire: 'alternate_node_type_ids'}, -}; - -const s3StorageInfoFieldMaskSchema: FieldMaskSchema = { - cannedAcl: {wire: 'canned_acl'}, - destination: {wire: 'destination'}, - enableEncryption: {wire: 'enable_encryption'}, - encryptionType: {wire: 'encryption_type'}, - endpoint: {wire: 'endpoint'}, - kmsKey: {wire: 'kms_key'}, - region: {wire: 'region'}, }; // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -const updateClusterRequest_UpdateClusterResourceFieldMaskSchema: FieldMaskSchema = +const updateClusterRequest_UpdateUpdateClusterResourceFieldMaskSchema: FieldMaskSchema = { - autoscale: {wire: 'autoscale', children: () => autoScaleFieldMaskSchema}, + autoscale: { + wire: 'autoscale', + children: () => updateAutoScaleFieldMaskSchema, + }, autoterminationMinutes: {wire: 'autotermination_minutes'}, awsAttributes: { wire: 'aws_attributes', - children: () => awsAttributesFieldMaskSchema, + children: () => updateAwsAttributesFieldMaskSchema, }, azureAttributes: { wire: 'azure_attributes', - children: () => azureAttributesFieldMaskSchema, + children: () => updateAzureAttributesFieldMaskSchema, }, clusterLogConf: { wire: 'cluster_log_conf', - children: () => clusterLogConfFieldMaskSchema, + children: () => updateClusterLogConfFieldMaskSchema, }, clusterName: {wire: 'cluster_name'}, customTags: {wire: 'custom_tags'}, dataSecurityMode: {wire: 'data_security_mode'}, dockerImage: { wire: 'docker_image', - children: () => dockerImageFieldMaskSchema, + children: () => updateDockerImageFieldMaskSchema, }, driverInstancePoolId: {wire: 'driver_instance_pool_id'}, driverNodeTypeFlexibility: { wire: 'driver_node_type_flexibility', - children: () => nodeTypeFlexibilityFieldMaskSchema, + children: () => updateNodeTypeFlexibilityFieldMaskSchema, }, driverNodeTypeId: {wire: 'driver_node_type_id'}, enableElasticDisk: {wire: 'enable_elastic_disk'}, enableLocalDiskEncryption: {wire: 'enable_local_disk_encryption'}, gcpAttributes: { wire: 'gcp_attributes', - children: () => gcpAttributesFieldMaskSchema, + children: () => updateGcpAttributesFieldMaskSchema, }, initScripts: {wire: 'init_scripts'}, instancePoolId: {wire: 'instance_pool_id'}, @@ -5669,37 +6932,84 @@ const updateClusterRequest_UpdateClusterResourceFieldMaskSchema: FieldMaskSchema useMlRuntime: {wire: 'use_ml_runtime'}, workerNodeTypeFlexibility: { wire: 'worker_node_type_flexibility', - children: () => nodeTypeFlexibilityFieldMaskSchema, + children: () => updateNodeTypeFlexibilityFieldMaskSchema, }, workloadType: { wire: 'workload_type', - children: () => workloadTypeFieldMaskSchema, + children: () => updateWorkloadTypeFieldMaskSchema, }, }; // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export function updateClusterRequest_UpdateClusterResourceFieldMask( +export function updateClusterRequest_UpdateUpdateClusterResourceFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - updateClusterRequest_UpdateClusterResourceFieldMaskSchema + updateClusterRequest_UpdateUpdateClusterResourceFieldMaskSchema ); } -const volumesStorageInfoFieldMaskSchema: FieldMaskSchema = { +const updateDbfsStorageInfoFieldMaskSchema: FieldMaskSchema = { + destination: {wire: 'destination'}, +}; + +const updateDockerBasicAuthFieldMaskSchema: FieldMaskSchema = { + password: {wire: 'password'}, + username: {wire: 'username'}, +}; + +const updateDockerImageFieldMaskSchema: FieldMaskSchema = { + basicAuth: { + wire: 'basic_auth', + children: () => updateDockerBasicAuthFieldMaskSchema, + }, + url: {wire: 'url'}, +}; + +const updateGcpAttributesFieldMaskSchema: FieldMaskSchema = { + availability: {wire: 'availability'}, + bootDiskSize: {wire: 'boot_disk_size'}, + confidentialComputeType: {wire: 'confidential_compute_type'}, + firstOnDemand: {wire: 'first_on_demand'}, + googleServiceAccount: {wire: 'google_service_account'}, + localSsdCount: {wire: 'local_ssd_count'}, + usePreemptibleExecutors: {wire: 'use_preemptible_executors'}, + zoneId: {wire: 'zone_id'}, +}; + +const updateLogAnalyticsInfoFieldMaskSchema: FieldMaskSchema = { + logAnalyticsPrimaryKey: {wire: 'log_analytics_primary_key'}, + logAnalyticsWorkspaceId: {wire: 'log_analytics_workspace_id'}, +}; + +const updateNodeTypeFlexibilityFieldMaskSchema: FieldMaskSchema = { + alternateNodeTypeIds: {wire: 'alternate_node_type_ids'}, +}; + +const updateS3StorageInfoFieldMaskSchema: FieldMaskSchema = { + cannedAcl: {wire: 'canned_acl'}, + destination: {wire: 'destination'}, + enableEncryption: {wire: 'enable_encryption'}, + encryptionType: {wire: 'encryption_type'}, + endpoint: {wire: 'endpoint'}, + kmsKey: {wire: 'kms_key'}, + region: {wire: 'region'}, +}; + +const updateVolumesStorageInfoFieldMaskSchema: FieldMaskSchema = { destination: {wire: 'destination'}, }; -const workloadTypeFieldMaskSchema: FieldMaskSchema = { +const updateWorkloadTypeFieldMaskSchema: FieldMaskSchema = { clients: { wire: 'clients', - children: () => workloadType_ClientsTypesFieldMaskSchema, + children: () => workloadType_UpdateClientsTypesFieldMaskSchema, }, }; // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -const workloadType_ClientsTypesFieldMaskSchema: FieldMaskSchema = { +const workloadType_UpdateClientsTypesFieldMaskSchema: FieldMaskSchema = { jobs: {wire: 'jobs'}, notebooks: {wire: 'notebooks'}, }; diff --git a/packages/customllms/src/v1/index.ts b/packages/customllms/src/v1/index.ts index d1e6d83d..47db5488 100755 --- a/packages/customllms/src/v1/index.ts +++ b/packages/customllms/src/v1/index.ts @@ -11,13 +11,18 @@ export {State} from './model'; export type { CancelCustomLlmOptimizationRunRequest, CreateCustomLlmRequest, + CreateDataset, + CreateTable, CustomLlm, Dataset, DeleteCustomLlmRequest, GetCustomLlmRequest, StartCustomLlmOptimizationRunRequest, Table, + UpdateCustomLlm, UpdateCustomLlmRequest, + UpdateDataset, + UpdateTable, } from './model'; -export {customLlmFieldMask} from './model'; +export {updateCustomLlmFieldMask} from './model'; diff --git a/packages/customllms/src/v1/model.ts b/packages/customllms/src/v1/model.ts index ffac99e1..3ee74579 100644 --- a/packages/customllms/src/v1/model.ts +++ b/packages/customllms/src/v1/model.ts @@ -31,7 +31,7 @@ export interface CreateCustomLlmRequest { * Datasets used for training and evaluating the model, not for inference. * Currently, only 1 dataset is accepted. */ - datasets?: Dataset[] | undefined; + datasets?: CreateDataset[] | undefined; /** Guidelines for the custom LLM to adhere to */ guidelines?: string[] | undefined; /** @@ -42,6 +42,19 @@ export interface CreateCustomLlmRequest { agentArtifactPath?: string | undefined; } +export interface CreateDataset { + table: CreateTable; +} + +export interface CreateTable { + /** Full UC table path in catalog.schema.table_name format */ + tablePath: string; + /** Name of the request column */ + requestCol: string; + /** Optional: Name of the response column if the data is labeled */ + responseCol?: string | undefined; +} + export interface CustomLlm { id?: string | undefined; /** Name of the custom LLM */ @@ -91,13 +104,43 @@ export interface Table { responseCol?: string | undefined; } +export interface UpdateCustomLlm { + id?: string | undefined; + /** Name of the custom LLM */ + name?: string | undefined; + /** Instructions for the custom LLM to follow */ + instructions?: string | undefined; + /** Datasets used for training and evaluating the model, not for inference */ + datasets?: UpdateDataset[] | undefined; + /** Guidelines for the custom LLM to adhere to */ + guidelines?: string[] | undefined; + /** Creator of the custom LLM */ + creator?: string | undefined; + /** Creation timestamp of the custom LLM */ + creationTime?: Temporal.Instant | undefined; + agentArtifactPath?: string | undefined; +} + export interface UpdateCustomLlmRequest { /** The id of the custom llm */ id?: string | undefined; /** The CustomLlm containing the fields which should be updated. */ - customLlm?: CustomLlm | undefined; + customLlm?: UpdateCustomLlm | undefined; /** The list of the CustomLlm fields to update. These should correspond to the values (or lack thereof) present in `custom_llm`. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; +} + +export interface UpdateDataset { + table?: UpdateTable | undefined; +} + +export interface UpdateTable { + /** Full UC table path in catalog.schema.table_name format */ + tablePath?: string | undefined; + /** Name of the request column */ + requestCol?: string | undefined; + /** Optional: Name of the response column if the data is labeled */ + responseCol?: string | undefined; } export const unmarshalCustomLlmSchema: z.ZodType = z @@ -161,7 +204,7 @@ export const marshalCreateCustomLlmRequestSchema: z.ZodType = z .object({ name: z.string().optional(), instructions: z.string().optional(), - datasets: z.array(z.lazy(() => marshalDatasetSchema)).optional(), + datasets: z.array(z.lazy(() => marshalCreateDatasetSchema)).optional(), guidelines: z.array(z.string()).optional(), agentArtifactPath: z.string().optional(), }) @@ -173,15 +216,41 @@ export const marshalCreateCustomLlmRequestSchema: z.ZodType = z agent_artifact_path: d.agentArtifactPath, })); -export const marshalCustomLlmSchema: z.ZodType = z +export const marshalCreateDatasetSchema: z.ZodType = z + .object({ + table: z.lazy(() => marshalCreateTableSchema), + }) + .transform(d => ({ + table: d.table, + })); + +export const marshalCreateTableSchema: z.ZodType = z + .object({ + tablePath: z.string(), + requestCol: z.string(), + responseCol: z.string().optional(), + }) + .transform(d => ({ + table_path: d.tablePath, + request_col: d.requestCol, + response_col: d.responseCol, + })); + +export const marshalStartCustomLlmOptimizationRunRequestSchema: z.ZodType = z + .object({ + id: z.string().optional(), + }) + .transform(d => ({ + id: d.id, + })); + +export const marshalUpdateCustomLlmSchema: z.ZodType = z .object({ id: z.string().optional(), name: z.string().optional(), - endpointName: z.string().optional(), instructions: z.string().optional(), - datasets: z.array(z.lazy(() => marshalDatasetSchema)).optional(), + datasets: z.array(z.lazy(() => marshalUpdateDatasetSchema)).optional(), guidelines: z.array(z.string()).optional(), - optimizationState: z.string().optional(), creator: z.string().optional(), creationTime: z .any() @@ -192,33 +261,38 @@ export const marshalCustomLlmSchema: z.ZodType = z .transform(d => ({ id: d.id, name: d.name, - endpoint_name: d.endpointName, instructions: d.instructions, datasets: d.datasets, guidelines: d.guidelines, - optimization_state: d.optimizationState, creator: d.creator, creation_time: d.creationTime, agent_artifact_path: d.agentArtifactPath, })); -export const marshalDatasetSchema: z.ZodType = z +export const marshalUpdateCustomLlmRequestSchema: z.ZodType = z .object({ - table: z.lazy(() => marshalTableSchema).optional(), + id: z.string().optional(), + customLlm: z.lazy(() => marshalUpdateCustomLlmSchema).optional(), + updateMask: z + .any() + .transform((m: FieldMask) => m.toString()) + .optional(), }) .transform(d => ({ - table: d.table, + id: d.id, + custom_llm: d.customLlm, + update_mask: d.updateMask, })); -export const marshalStartCustomLlmOptimizationRunRequestSchema: z.ZodType = z +export const marshalUpdateDatasetSchema: z.ZodType = z .object({ - id: z.string().optional(), + table: z.lazy(() => marshalUpdateTableSchema).optional(), }) .transform(d => ({ - id: d.id, + table: d.table, })); -export const marshalTableSchema: z.ZodType = z +export const marshalUpdateTableSchema: z.ZodType = z .object({ tablePath: z.string().optional(), requestCol: z.string().optional(), @@ -230,34 +304,22 @@ export const marshalTableSchema: z.ZodType = z response_col: d.responseCol, })); -export const marshalUpdateCustomLlmRequestSchema: z.ZodType = z - .object({ - id: z.string().optional(), - customLlm: z.lazy(() => marshalCustomLlmSchema).optional(), - updateMask: z - .any() - .transform((m: FieldMask) => m.toString()) - .optional(), - }) - .transform(d => ({ - id: d.id, - custom_llm: d.customLlm, - update_mask: d.updateMask, - })); - -const customLlmFieldMaskSchema: FieldMaskSchema = { +const updateCustomLlmFieldMaskSchema: FieldMaskSchema = { agentArtifactPath: {wire: 'agent_artifact_path'}, creationTime: {wire: 'creation_time'}, creator: {wire: 'creator'}, datasets: {wire: 'datasets'}, - endpointName: {wire: 'endpoint_name'}, guidelines: {wire: 'guidelines'}, id: {wire: 'id'}, instructions: {wire: 'instructions'}, name: {wire: 'name'}, - optimizationState: {wire: 'optimization_state'}, }; -export function customLlmFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, customLlmFieldMaskSchema); +export function updateCustomLlmFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + updateCustomLlmFieldMaskSchema + ); } diff --git a/packages/database/src/v1/client.ts b/packages/database/src/v1/client.ts index 8a558bbb..d341bdaf 100644 --- a/packages/database/src/v1/client.ts +++ b/packages/database/src/v1/client.ts @@ -57,12 +57,15 @@ import type { } from './model'; import { DatabaseInstance_State, - marshalDatabaseCatalogSchema, - marshalDatabaseInstanceRoleSchema, - marshalDatabaseInstanceSchema, - marshalDatabaseTableSchema, + marshalCreateDatabaseCatalogSchema, + marshalCreateDatabaseInstanceRoleSchema, + marshalCreateDatabaseInstanceSchema, + marshalCreateDatabaseTableSchema, + marshalCreateSyncedDatabaseTableSchema, marshalGenerateDatabaseCredentialRequestSchema, - marshalSyncedDatabaseTableSchema, + marshalUpdateDatabaseCatalogSchema, + marshalUpdateDatabaseInstanceSchema, + marshalUpdateSyncedDatabaseTableSchema, unmarshalDatabaseCatalogSchema, unmarshalDatabaseCredentialSchema, unmarshalDatabaseInstanceRoleSchema, @@ -115,7 +118,10 @@ export class DatabaseClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/database/catalogs`; - const body = marshalRequest(req.catalog, marshalDatabaseCatalogSchema); + const body = marshalRequest( + req.catalog, + marshalCreateDatabaseCatalogSchema + ); let resp: DatabaseCatalog | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -147,7 +153,7 @@ export class DatabaseClient { const url = `${host}/api/2.0/database/instances`; const body = marshalRequest( req.databaseInstance, - marshalDatabaseInstanceSchema + marshalCreateDatabaseInstanceSchema ); let resp: DatabaseInstance | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -198,7 +204,7 @@ export class DatabaseClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.databaseInstanceRole, - marshalDatabaseInstanceRoleSchema + marshalCreateDatabaseInstanceRoleSchema ); let resp: DatabaseInstanceRole | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -238,7 +244,7 @@ export class DatabaseClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/database/tables`; - const body = marshalRequest(req.table, marshalDatabaseTableSchema); + const body = marshalRequest(req.table, marshalCreateDatabaseTableSchema); let resp: DatabaseTable | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -270,7 +276,7 @@ export class DatabaseClient { const url = `${host}/api/2.0/database/synced_tables`; const body = marshalRequest( req.syncedTable, - marshalSyncedDatabaseTableSchema + marshalCreateSyncedDatabaseTableSchema ); let resp: SyncedDatabaseTable | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -898,7 +904,7 @@ export class DatabaseClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.databaseCatalog, - marshalDatabaseCatalogSchema + marshalUpdateDatabaseCatalogSchema ); let resp: DatabaseCatalog | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -943,7 +949,7 @@ export class DatabaseClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.databaseInstance, - marshalDatabaseInstanceSchema + marshalUpdateDatabaseInstanceSchema ); let resp: DatabaseInstance | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -988,7 +994,7 @@ export class DatabaseClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.syncedTable, - marshalSyncedDatabaseTableSchema + marshalUpdateSyncedDatabaseTableSchema ); let resp: SyncedDatabaseTable | undefined; const call = async (callSignal?: AbortSignal): Promise => { diff --git a/packages/database/src/v1/index.ts b/packages/database/src/v1/index.ts index 01d14b28..1cbcfa2d 100755 --- a/packages/database/src/v1/index.ts +++ b/packages/database/src/v1/index.ts @@ -19,11 +19,22 @@ export { } from './model'; export type { + CreateCustomTag, + CreateDatabaseCatalog, CreateDatabaseCatalogRequest, + CreateDatabaseInstance, + CreateDatabaseInstanceRef, CreateDatabaseInstanceRequest, + CreateDatabaseInstanceRole, CreateDatabaseInstanceRoleRequest, + CreateDatabaseTable, CreateDatabaseTableRequest, + CreateNewPipelineSpec, + CreateRequestedClaims, + CreateRequestedResource, + CreateSyncedDatabaseTable, CreateSyncedDatabaseTableRequest, + CreateSyncedTableSpec, CustomTag, DatabaseCatalog, DatabaseCredential, @@ -31,6 +42,7 @@ export type { DatabaseInstanceRef, DatabaseInstanceRole, DatabaseInstanceRole_Attributes, + DatabaseInstanceRole_CreateAttributes, DatabaseTable, DeleteDatabaseCatalogRequest, DeleteDatabaseInstanceRequest, @@ -64,16 +76,25 @@ export type { SyncedTablePosition, SyncedTableProvisioningStatus, SyncedTableSpec, + SyncedTableSpec_CreateTypeOverride, SyncedTableSpec_TypeOverride, + SyncedTableSpec_UpdateTypeOverride, SyncedTableStatus, SyncedTableTriggeredUpdateStatus, + UpdateCustomTag, + UpdateDatabaseCatalog, UpdateDatabaseCatalogRequest, + UpdateDatabaseInstance, + UpdateDatabaseInstanceRef, UpdateDatabaseInstanceRequest, + UpdateNewPipelineSpec, + UpdateSyncedDatabaseTable, UpdateSyncedDatabaseTableRequest, + UpdateSyncedTableSpec, } from './model'; export { - databaseCatalogFieldMask, - databaseInstanceFieldMask, - syncedDatabaseTableFieldMask, + updateDatabaseCatalogFieldMask, + updateDatabaseInstanceFieldMask, + updateSyncedDatabaseTableFieldMask, } from './model'; diff --git a/packages/database/src/v1/model.ts b/packages/database/src/v1/model.ts index 7acbb119..c0d5434e 100755 --- a/packages/database/src/v1/model.ts +++ b/packages/database/src/v1/model.ts @@ -196,27 +196,253 @@ export type SyncedTableSpec_PgSpecificType = | (typeof SyncedTableSpec_PgSpecificType)[keyof typeof SyncedTableSpec_PgSpecificType] | (string & {}); +export interface CreateCustomTag { + /** The key of the custom tag. */ + key?: string | undefined; + /** The value of the custom tag. */ + value?: string | undefined; +} + +export interface CreateDatabaseCatalog { + /** The name of the catalog in UC. */ + name?: string | undefined; + /** The name of the DatabaseInstance housing the database. */ + databaseInstanceName: string; + /** The name of the database (in an instance) associated with the catalog. */ + databaseName: string; + createDatabaseIfNotExists?: boolean | undefined; +} + export interface CreateDatabaseCatalogRequest { - catalog?: DatabaseCatalog | undefined; + catalog?: CreateDatabaseCatalog | undefined; +} + +/** A DatabaseInstance represents a logical Postgres instance, comprised of both compute and storage. */ +export interface CreateDatabaseInstance { + /** The name of the instance. This is the unique identifier for the instance. */ + name?: string | undefined; + /** The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8". */ + capacity?: string | undefined; + /** Whether to stop the instance. An input only param, see effective_stopped for the output. */ + stopped?: boolean | undefined; + /** + * The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to + * 1 primary and 0 secondaries. This field is input only, see effective_node_count for the output. + */ + nodeCount?: number | undefined; + /** Whether to enable secondaries to serve read-only traffic. Defaults to false. */ + enableReadableSecondaries?: boolean | undefined; + /** + * The retention window for the instance. This is the time window in days + * for which the historical data is retained. The default value is 7 days. + * Valid values are 2 to 35 days. + */ + retentionWindowInDays?: number | undefined; + /** + * The ref of the parent instance. This is only available if the instance is + * child instance. + * Input: For specifying the parent instance to create a child instance. Optional. + * Output: Only populated if provided as input to create a child instance. + */ + parentInstanceRef?: CreateDatabaseInstanceRef | undefined; + /** Whether to enable PG native password login on the instance. Defaults to false. */ + enablePgNativeLogin?: boolean | undefined; + /** The desired usage policy to associate with the instance. */ + usagePolicyId?: string | undefined; + /** Custom tags associated with the instance. This field is only included on create and update responses. */ + customTags?: CreateCustomTag[] | undefined; +} + +/** + * DatabaseInstanceRef is a reference to a database instance. It is used in the + * DatabaseInstance object to refer to the parent instance of an instance and + * to refer the child instances of an instance. + * To specify as a parent instance during creation of an instance, + * the lsn and branch_time fields are optional. If not specified, the child + * instance will be created from the latest lsn of the parent. + * If both lsn and branch_time are specified, the lsn will be used to create + * the child instance. + */ +export interface CreateDatabaseInstanceRef { + /** Name of the ref database instance. */ + name?: string | undefined; + /** + * User-specified WAL LSN of the ref database instance. + * + * Input: For specifying the WAL LSN to create a child instance. Optional. + * Output: Only populated if provided as input to create a child instance. + */ + lsn?: string | undefined; + /** + * Branch time of the ref database instance. + * For a parent ref instance, this is the point in time on the parent instance from which the + * instance was created. + * For a child ref instance, this is the point in time on the instance from which the child + * instance was created. + * Input: For specifying the point in time to create a child instance. Optional. + * Output: Only populated if provided as input to create a child instance. + */ + branchTime?: Temporal.Instant | undefined; } export interface CreateDatabaseInstanceRequest { /** Instance to create. */ - databaseInstance?: DatabaseInstance | undefined; + databaseInstance?: CreateDatabaseInstance | undefined; +} + +/** A DatabaseInstanceRole represents a Postgres role in a database instance. */ +export interface CreateDatabaseInstanceRole { + /** The name of the role. This is the unique identifier for the role in an instance. */ + name: string; + /** The type of the role. */ + identityType?: DatabaseInstanceRole_IdentityType | undefined; + /** An enum value for a standard role that this role is a member of. */ + membershipRole?: DatabaseInstanceRole_MembershipRole | undefined; + /** The desired API-exposed Postgres role attribute to associate with the role. Optional. */ + attributes?: DatabaseInstanceRole_CreateAttributes | undefined; + instanceName?: string | undefined; } export interface CreateDatabaseInstanceRoleRequest { instanceName?: string | undefined; - databaseInstanceRole?: DatabaseInstanceRole | undefined; + databaseInstanceRole?: CreateDatabaseInstanceRole | undefined; + databaseInstanceName?: string | undefined; +} + +export interface CreateDatabaseTable { + /** Full three-part (catalog, schema, table) name of the table. */ + name: string; + /** + * Name of the target database instance. This is required when creating database tables in standard catalogs. + * This is optional when creating database tables in registered catalogs. If this field is specified + * when creating database tables in registered catalogs, the database instance name MUST + * match that of the registered catalog (or the request will be rejected). + */ databaseInstanceName?: string | undefined; + /** + * Target Postgres database object (logical database) name for this table. + * + * When creating a table in a standard catalog, this field is required. + * In this scenario, specifying this field will allow targeting an arbitrary postgres database. + * + * Registration of database tables via /database/tables is currently only supported in standard catalogs. + */ + logicalDatabaseName?: string | undefined; } export interface CreateDatabaseTableRequest { - table?: DatabaseTable | undefined; + table?: CreateDatabaseTable | undefined; +} + +/** + * Custom fields that user can set for pipeline while creating SyncedDatabaseTable. + * Note that other fields of pipeline are still inferred by table def internally + */ +export interface CreateNewPipelineSpec { + /** + * This field needs to be specified if the destination catalog is a managed postgres catalog. + * + * UC catalog for the pipeline to store intermediate files (checkpoints, event logs etc). + * This needs to be a standard catalog where the user has permissions to create Delta tables. + */ + storageCatalog?: string | undefined; + /** + * This field needs to be specified if the destination catalog is a managed postgres catalog. + * + * UC schema for the pipeline to store intermediate files (checkpoints, event logs etc). + * This needs to be in the standard catalog where the user has permissions to create Delta tables. + */ + storageSchema?: string | undefined; + /** Budget policy to set on the newly created pipeline. */ + budgetPolicyId?: string | undefined; +} + +export interface CreateRequestedClaims { + permissionSet?: RequestedClaims_PermissionSet | undefined; + resources?: CreateRequestedResource[] | undefined; +} + +export interface CreateRequestedResource { + /** Might add UC_SCHEMA & UC_CATALOG later */ + resourceName?: + | {$case: 'unspecifiedResourceName'; unspecifiedResourceName: string} + | {$case: 'tableName'; tableName: string} + | undefined; +} + +export interface CreateSyncedDatabaseTable { + /** Full three-part (catalog, schema, table) name of the table. */ + name?: string | undefined; + /** + * Name of the target database instance. This is required when creating synced database tables in standard catalogs. + * This is optional when creating synced database tables in registered catalogs. If this field is specified + * when creating synced database tables in registered catalogs, the database instance name MUST + * match that of the registered catalog (or the request will be rejected). + */ + databaseInstanceName?: string | undefined; + /** + * Target Postgres database object (logical database) name for this table. + * + * When creating a synced table in a registered Postgres catalog, the + * target Postgres database name is inferred to be that of the registered catalog. + * If this field is specified in this scenario, the Postgres database name MUST + * match that of the registered catalog (or the request will be rejected). + * + * When creating a synced table in a standard catalog, this field is required. + * In this scenario, specifying this field will allow targeting an arbitrary postgres database. + * Note that this has implications for the `create_database_objects_is_missing` field in `spec`. + */ + logicalDatabaseName?: string | undefined; + spec?: CreateSyncedTableSpec | undefined; } export interface CreateSyncedDatabaseTableRequest { - syncedTable?: SyncedDatabaseTable | undefined; + syncedTable?: CreateSyncedDatabaseTable | undefined; +} + +/** Specification of a synced database table. */ +export interface CreateSyncedTableSpec { + /** Scheduling policy of the underlying pipeline. */ + schedulingPolicy?: SyncedTableSchedulingPolicy | undefined; + /** Three-part (catalog, schema, table) name of the source Delta table. */ + sourceTableFullName?: string | undefined; + /** Primary Key columns to be used for data insert/update in the destination. */ + primaryKeyColumns?: string[] | undefined; + /** Time series key to deduplicate (tie-break) rows with the same primary key. */ + timeseriesKey?: string | undefined; + /** + * At most one of existing_pipeline_id and new_pipeline_spec should be defined. + * + * If existing_pipeline_id is defined, the synced table will be bin packed into the existing pipeline + * referenced. This avoids creating a new pipeline and allows sharing existing compute. + * In this case, the scheduling_policy of this synced table must match the scheduling policy of the existing pipeline. + */ + existingPipelineId?: string | undefined; + /** + * If true, the synced table's logical database and schema resources in PG + * will be created if they do not already exist. + */ + createDatabaseObjectsIfMissing?: boolean | undefined; + /** + * At most one of existing_pipeline_id and new_pipeline_spec should be defined. + * + * If new_pipeline_spec is defined, a new pipeline is created for this synced table. The location pointed to is used + * to store intermediate files (checkpoints, event logs etc). The caller must have write permissions to create Delta + * tables in the specified catalog and schema. Again, note this requires write permissions, whereas the source table + * only requires read permissions. + */ + newPipelineSpec?: CreateNewPipelineSpec | undefined; + /** + * When true, enables accelerated sync mode for the initial data load. + * This significantly improves performance for large tables. + * Requires workspace-level enablement. + */ + acceleratedSync?: boolean | undefined; + /** + * Override the default Delta->PG type mapping for specific columns. + * A TypeOverride with PG_SPECIFIC_TYPE_UNSPECIFIED is rejected; a valid pg_type must be set. + */ + typeOverrides?: SyncedTableSpec_CreateTypeOverride[] | undefined; } export interface CustomTag { @@ -234,7 +460,6 @@ export interface DatabaseCatalog { /** The name of the database (in an instance) associated with the catalog. */ databaseName?: string | undefined; uid?: string | undefined; - createDatabaseIfNotExists?: boolean | undefined; } export interface DatabaseCredential { @@ -266,19 +491,12 @@ export interface DatabaseInstance { * server side defaults. Use the field without the effective_ prefix to set the value. */ effectiveCapacity?: string | undefined; - /** Whether to stop the instance. An input only param, see effective_stopped for the output. */ - stopped?: boolean | undefined; /** * Whether the instance is stopped. * This is an output only field that contains the value computed from the input field combined with * server side defaults. Use the field without the effective_ prefix to set the value. */ effectiveStopped?: boolean | undefined; - /** - * The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to - * 1 primary and 0 secondaries. This field is input only, see effective_node_count for the output. - */ - nodeCount?: number | undefined; /** * The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to * 1 primary and 0 secondaries. @@ -286,8 +504,6 @@ export interface DatabaseInstance { * server side defaults. Use the field without the effective_ prefix to set the value. */ effectiveNodeCount?: number | undefined; - /** Whether to enable secondaries to serve read-only traffic. Defaults to false. */ - enableReadableSecondaries?: boolean | undefined; /** * Whether secondaries serving read-only traffic are enabled. Defaults to false. * This is an output only field that contains the value computed from the input field combined with @@ -299,12 +515,6 @@ export interface DatabaseInstance { * enable_readable_secondaries is true. */ readOnlyDns?: string | undefined; - /** - * The retention window for the instance. This is the time window in days - * for which the historical data is retained. The default value is 7 days. - * Valid values are 2 to 35 days. - */ - retentionWindowInDays?: number | undefined; /** * The retention window for the instance. This is the time window in days * for which the historical data is retained. @@ -324,24 +534,18 @@ export interface DatabaseInstance { * parent instance. */ childInstanceRefs?: DatabaseInstanceRef[] | undefined; - /** Whether to enable PG native password login on the instance. Defaults to false. */ - enablePgNativeLogin?: boolean | undefined; /** * Whether the instance has PG native password login enabled. * This is an output only field that contains the value computed from the input field combined with * server side defaults. Use the field without the effective_ prefix to set the value. */ effectiveEnablePgNativeLogin?: boolean | undefined; - /** The desired usage policy to associate with the instance. */ - usagePolicyId?: string | undefined; /** * The policy that is applied to the instance. * This is an output only field that contains the value computed from the input field combined with * server side defaults. Use the field without the effective_ prefix to set the value. */ effectiveUsagePolicyId?: string | undefined; - /** Custom tags associated with the instance. This field is only included on create and update responses. */ - customTags?: CustomTag[] | undefined; /** * The recorded custom tags associated with the instance. * This is an output only field that contains the value computed from the input field combined with @@ -365,13 +569,6 @@ export interface DatabaseInstanceRef { uid?: string | undefined; /** Name of the ref database instance. */ name?: string | undefined; - /** - * User-specified WAL LSN of the ref database instance. - * - * Input: For specifying the WAL LSN to create a child instance. Optional. - * Output: Only populated if provided as input to create a child instance. - */ - lsn?: string | undefined; /** * For a parent ref instance, this is the LSN on the parent instance from which the * instance was created. @@ -426,6 +623,20 @@ export interface DatabaseInstanceRole_Attributes { bypassrls?: boolean | undefined; } +/** + * Attributes that can be granted to a Postgres role. We are only implementing a subset for now, see xref: + * https://www.postgresql.org/docs/16/sql-createrole.html + * The values follow Postgres keyword naming e.g. CREATEDB, BYPASSRLS, etc. which is why they don't include typical + * underscores between words. We were requested to make this a nested object/struct representation since these are + * knobs from an external spec. + */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface DatabaseInstanceRole_CreateAttributes { + createdb?: boolean | undefined; + createrole?: boolean | undefined; + bypassrls?: boolean | undefined; +} + export interface DatabaseTable { /** Full three-part (catalog, schema, table) name of the table. */ name?: string | undefined; @@ -511,7 +722,7 @@ export interface GenerateDatabaseCredentialRequest { * The UC resources need to be something that have a Postgres counterpart. For example, a synced table or * a table in a UC database catalog. */ - claims?: RequestedClaims[] | undefined; + claims?: CreateRequestedClaims[] | undefined; } export interface GetDatabaseCatalogRequest { @@ -641,13 +852,6 @@ export interface RequestedResource { export interface SyncedDatabaseTable { /** Full three-part (catalog, schema, table) name of the table. */ name?: string | undefined; - /** - * Name of the target database instance. This is required when creating synced database tables in standard catalogs. - * This is optional when creating synced database tables in registered catalogs. If this field is specified - * when creating synced database tables in registered catalogs, the database instance name MUST - * match that of the registered catalog (or the request will be rejected). - */ - databaseInstanceName?: string | undefined; /** * The name of the database instance that this table is registered to. This field is always returned, and for * tables inside database catalogs is inferred database instance associated with the catalog. @@ -655,19 +859,6 @@ export interface SyncedDatabaseTable { * server side defaults. Use the field without the effective_ prefix to set the value. */ effectiveDatabaseInstanceName?: string | undefined; - /** - * Target Postgres database object (logical database) name for this table. - * - * When creating a synced table in a registered Postgres catalog, the - * target Postgres database name is inferred to be that of the registered catalog. - * If this field is specified in this scenario, the Postgres database name MUST - * match that of the registered catalog (or the request will be rejected). - * - * When creating a synced table in a standard catalog, this field is required. - * In this scenario, specifying this field will allow targeting an arbitrary postgres database. - * Note that this has implications for the `create_database_objects_is_missing` field in `spec`. - */ - logicalDatabaseName?: string | undefined; /** * The name of the logical database that this table is registered to. * This is an output only field that contains the value computed from the input field combined with @@ -780,34 +971,6 @@ export interface SyncedTableSpec { primaryKeyColumns?: string[] | undefined; /** Time series key to deduplicate (tie-break) rows with the same primary key. */ timeseriesKey?: string | undefined; - /** - * At most one of existing_pipeline_id and new_pipeline_spec should be defined. - * - * If existing_pipeline_id is defined, the synced table will be bin packed into the existing pipeline - * referenced. This avoids creating a new pipeline and allows sharing existing compute. - * In this case, the scheduling_policy of this synced table must match the scheduling policy of the existing pipeline. - */ - existingPipelineId?: string | undefined; - /** - * If true, the synced table's logical database and schema resources in PG - * will be created if they do not already exist. - */ - createDatabaseObjectsIfMissing?: boolean | undefined; - /** - * At most one of existing_pipeline_id and new_pipeline_spec should be defined. - * - * If new_pipeline_spec is defined, a new pipeline is created for this synced table. The location pointed to is used - * to store intermediate files (checkpoints, event logs etc). The caller must have write permissions to create Delta - * tables in the specified catalog and schema. Again, note this requires write permissions, whereas the source table - * only requires read permissions. - */ - newPipelineSpec?: NewPipelineSpec | undefined; - /** - * When true, enables accelerated sync mode for the initial data load. - * This significantly improves performance for large tables. - * Requires workspace-level enablement. - */ - acceleratedSync?: boolean | undefined; /** * Override the default Delta->PG type mapping for specific columns. * A TypeOverride with PG_SPECIFIC_TYPE_UNSPECIFIED is rejected; a valid pg_type must be set. @@ -815,6 +978,20 @@ export interface SyncedTableSpec { typeOverrides?: SyncedTableSpec_TypeOverride[] | undefined; } +/** Overrides the default Delta-to-PostgreSQL type mapping for a single column. */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface SyncedTableSpec_CreateTypeOverride { + /** Name of the source column whose target PostgreSQL type should be overridden. */ + columnName: string; + /** PostgreSQL-specific target type to use for the column. */ + pgType: SyncedTableSpec_PgSpecificType; + /** + * Size parameter for the target type. Required when pg_type is PG_SPECIFIC_TYPE_VECTOR + * (specifies the vector dimension, e.g., 1024). + */ + size?: number | undefined; +} + /** Overrides the default Delta-to-PostgreSQL type mapping for a single column. */ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface SyncedTableSpec_TypeOverride { @@ -829,6 +1006,20 @@ export interface SyncedTableSpec_TypeOverride { size?: number | undefined; } +/** Overrides the default Delta-to-PostgreSQL type mapping for a single column. */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface SyncedTableSpec_UpdateTypeOverride { + /** Name of the source column whose target PostgreSQL type should be overridden. */ + columnName?: string | undefined; + /** PostgreSQL-specific target type to use for the column. */ + pgType?: SyncedTableSpec_PgSpecificType | undefined; + /** + * Size parameter for the target type. Required when pg_type is PG_SPECIFIC_TYPE_VECTOR + * (specifies the vector dimension, e.g., 1024). + */ + size?: number | undefined; +} + /** Status of a synced table. */ export interface SyncedTableStatus { /** The state of the synced table. */ @@ -887,27 +1078,206 @@ export interface SyncedTableTriggeredUpdateStatus { triggeredUpdateProgress?: SyncedTablePipelineProgress | undefined; } +export interface UpdateCustomTag { + /** The key of the custom tag. */ + key?: string | undefined; + /** The value of the custom tag. */ + value?: string | undefined; +} + +export interface UpdateDatabaseCatalog { + /** The name of the catalog in UC. */ + name?: string | undefined; + /** The name of the DatabaseInstance housing the database. */ + databaseInstanceName?: string | undefined; + /** The name of the database (in an instance) associated with the catalog. */ + databaseName?: string | undefined; + createDatabaseIfNotExists?: boolean | undefined; +} + export interface UpdateDatabaseCatalogRequest { /** Note that updating a database catalog is not yet supported. */ - databaseCatalog?: DatabaseCatalog | undefined; + databaseCatalog?: UpdateDatabaseCatalog | undefined; /** The list of fields to update. Setting this field is not yet supported. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; +} + +/** A DatabaseInstance represents a logical Postgres instance, comprised of both compute and storage. */ +export interface UpdateDatabaseInstance { + /** The name of the instance. This is the unique identifier for the instance. */ + name?: string | undefined; + /** The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8". */ + capacity?: string | undefined; + /** Whether to stop the instance. An input only param, see effective_stopped for the output. */ + stopped?: boolean | undefined; + /** + * The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to + * 1 primary and 0 secondaries. This field is input only, see effective_node_count for the output. + */ + nodeCount?: number | undefined; + /** Whether to enable secondaries to serve read-only traffic. Defaults to false. */ + enableReadableSecondaries?: boolean | undefined; + /** + * The retention window for the instance. This is the time window in days + * for which the historical data is retained. The default value is 7 days. + * Valid values are 2 to 35 days. + */ + retentionWindowInDays?: number | undefined; + /** + * The ref of the parent instance. This is only available if the instance is + * child instance. + * Input: For specifying the parent instance to create a child instance. Optional. + * Output: Only populated if provided as input to create a child instance. + */ + parentInstanceRef?: UpdateDatabaseInstanceRef | undefined; + /** Whether to enable PG native password login on the instance. Defaults to false. */ + enablePgNativeLogin?: boolean | undefined; + /** The desired usage policy to associate with the instance. */ + usagePolicyId?: string | undefined; + /** Custom tags associated with the instance. This field is only included on create and update responses. */ + customTags?: UpdateCustomTag[] | undefined; +} + +/** + * DatabaseInstanceRef is a reference to a database instance. It is used in the + * DatabaseInstance object to refer to the parent instance of an instance and + * to refer the child instances of an instance. + * To specify as a parent instance during creation of an instance, + * the lsn and branch_time fields are optional. If not specified, the child + * instance will be created from the latest lsn of the parent. + * If both lsn and branch_time are specified, the lsn will be used to create + * the child instance. + */ +export interface UpdateDatabaseInstanceRef { + /** Name of the ref database instance. */ + name?: string | undefined; + /** + * User-specified WAL LSN of the ref database instance. + * + * Input: For specifying the WAL LSN to create a child instance. Optional. + * Output: Only populated if provided as input to create a child instance. + */ + lsn?: string | undefined; + /** + * Branch time of the ref database instance. + * For a parent ref instance, this is the point in time on the parent instance from which the + * instance was created. + * For a child ref instance, this is the point in time on the instance from which the child + * instance was created. + * Input: For specifying the point in time to create a child instance. Optional. + * Output: Only populated if provided as input to create a child instance. + */ + branchTime?: Temporal.Instant | undefined; } export interface UpdateDatabaseInstanceRequest { - databaseInstance?: DatabaseInstance | undefined; + databaseInstance?: UpdateDatabaseInstance | undefined; /** * The list of fields to update. If unspecified, all fields will be updated when possible. To wipe out custom_tags, * specify custom_tags in the update_mask with an empty custom_tags map. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; +} + +/** + * Custom fields that user can set for pipeline while creating SyncedDatabaseTable. + * Note that other fields of pipeline are still inferred by table def internally + */ +export interface UpdateNewPipelineSpec { + /** + * This field needs to be specified if the destination catalog is a managed postgres catalog. + * + * UC catalog for the pipeline to store intermediate files (checkpoints, event logs etc). + * This needs to be a standard catalog where the user has permissions to create Delta tables. + */ + storageCatalog?: string | undefined; + /** + * This field needs to be specified if the destination catalog is a managed postgres catalog. + * + * UC schema for the pipeline to store intermediate files (checkpoints, event logs etc). + * This needs to be in the standard catalog where the user has permissions to create Delta tables. + */ + storageSchema?: string | undefined; + /** Budget policy to set on the newly created pipeline. */ + budgetPolicyId?: string | undefined; +} + +export interface UpdateSyncedDatabaseTable { + /** Full three-part (catalog, schema, table) name of the table. */ + name?: string | undefined; + /** + * Name of the target database instance. This is required when creating synced database tables in standard catalogs. + * This is optional when creating synced database tables in registered catalogs. If this field is specified + * when creating synced database tables in registered catalogs, the database instance name MUST + * match that of the registered catalog (or the request will be rejected). + */ + databaseInstanceName?: string | undefined; + /** + * Target Postgres database object (logical database) name for this table. + * + * When creating a synced table in a registered Postgres catalog, the + * target Postgres database name is inferred to be that of the registered catalog. + * If this field is specified in this scenario, the Postgres database name MUST + * match that of the registered catalog (or the request will be rejected). + * + * When creating a synced table in a standard catalog, this field is required. + * In this scenario, specifying this field will allow targeting an arbitrary postgres database. + * Note that this has implications for the `create_database_objects_is_missing` field in `spec`. + */ + logicalDatabaseName?: string | undefined; + spec?: UpdateSyncedTableSpec | undefined; } export interface UpdateSyncedDatabaseTableRequest { /** Note that updating a synced database table is not yet supported. */ - syncedTable?: SyncedDatabaseTable | undefined; + syncedTable?: UpdateSyncedDatabaseTable | undefined; /** The list of fields to update. Setting this field is not yet supported. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; +} + +/** Specification of a synced database table. */ +export interface UpdateSyncedTableSpec { + /** Scheduling policy of the underlying pipeline. */ + schedulingPolicy?: SyncedTableSchedulingPolicy | undefined; + /** Three-part (catalog, schema, table) name of the source Delta table. */ + sourceTableFullName?: string | undefined; + /** Primary Key columns to be used for data insert/update in the destination. */ + primaryKeyColumns?: string[] | undefined; + /** Time series key to deduplicate (tie-break) rows with the same primary key. */ + timeseriesKey?: string | undefined; + /** + * At most one of existing_pipeline_id and new_pipeline_spec should be defined. + * + * If existing_pipeline_id is defined, the synced table will be bin packed into the existing pipeline + * referenced. This avoids creating a new pipeline and allows sharing existing compute. + * In this case, the scheduling_policy of this synced table must match the scheduling policy of the existing pipeline. + */ + existingPipelineId?: string | undefined; + /** + * If true, the synced table's logical database and schema resources in PG + * will be created if they do not already exist. + */ + createDatabaseObjectsIfMissing?: boolean | undefined; + /** + * At most one of existing_pipeline_id and new_pipeline_spec should be defined. + * + * If new_pipeline_spec is defined, a new pipeline is created for this synced table. The location pointed to is used + * to store intermediate files (checkpoints, event logs etc). The caller must have write permissions to create Delta + * tables in the specified catalog and schema. Again, note this requires write permissions, whereas the source table + * only requires read permissions. + */ + newPipelineSpec?: UpdateNewPipelineSpec | undefined; + /** + * When true, enables accelerated sync mode for the initial data load. + * This significantly improves performance for large tables. + * Requires workspace-level enablement. + */ + acceleratedSync?: boolean | undefined; + /** + * Override the default Delta->PG type mapping for specific columns. + * A TypeOverride with PG_SPECIFIC_TYPE_UNSPECIFIED is rejected; a valid pg_type must be set. + */ + typeOverrides?: SyncedTableSpec_UpdateTypeOverride[] | undefined; } export const unmarshalCustomTagSchema: z.ZodType = z @@ -926,14 +1296,12 @@ export const unmarshalDatabaseCatalogSchema: z.ZodType = z database_instance_name: z.string().optional(), database_name: z.string().optional(), uid: z.string().optional(), - create_database_if_not_exists: z.boolean().optional(), }) .transform(d => ({ name: d.name, databaseInstanceName: d.database_instance_name, databaseName: d.database_name, uid: d.uid, - createDatabaseIfNotExists: d.create_database_if_not_exists, })); export const unmarshalDatabaseCredentialSchema: z.ZodType = @@ -964,14 +1332,10 @@ export const unmarshalDatabaseInstanceSchema: z.ZodType = z pg_version: z.string().optional(), capacity: z.string().optional(), effective_capacity: z.string().optional(), - stopped: z.boolean().optional(), effective_stopped: z.boolean().optional(), - node_count: z.number().optional(), effective_node_count: z.number().optional(), - enable_readable_secondaries: z.boolean().optional(), effective_enable_readable_secondaries: z.boolean().optional(), read_only_dns: z.string().optional(), - retention_window_in_days: z.number().optional(), effective_retention_window_in_days: z.number().optional(), parent_instance_ref: z .lazy(() => unmarshalDatabaseInstanceRefSchema) @@ -979,11 +1343,8 @@ export const unmarshalDatabaseInstanceSchema: z.ZodType = z child_instance_refs: z .array(z.lazy(() => unmarshalDatabaseInstanceRefSchema)) .optional(), - enable_pg_native_login: z.boolean().optional(), effective_enable_pg_native_login: z.boolean().optional(), - usage_policy_id: z.string().optional(), effective_usage_policy_id: z.string().optional(), - custom_tags: z.array(z.lazy(() => unmarshalCustomTagSchema)).optional(), effective_custom_tags: z .array(z.lazy(() => unmarshalCustomTagSchema)) .optional(), @@ -998,22 +1359,15 @@ export const unmarshalDatabaseInstanceSchema: z.ZodType = z pgVersion: d.pg_version, capacity: d.capacity, effectiveCapacity: d.effective_capacity, - stopped: d.stopped, effectiveStopped: d.effective_stopped, - nodeCount: d.node_count, effectiveNodeCount: d.effective_node_count, - enableReadableSecondaries: d.enable_readable_secondaries, effectiveEnableReadableSecondaries: d.effective_enable_readable_secondaries, readOnlyDns: d.read_only_dns, - retentionWindowInDays: d.retention_window_in_days, effectiveRetentionWindowInDays: d.effective_retention_window_in_days, parentInstanceRef: d.parent_instance_ref, childInstanceRefs: d.child_instance_refs, - enablePgNativeLogin: d.enable_pg_native_login, effectiveEnablePgNativeLogin: d.effective_enable_pg_native_login, - usagePolicyId: d.usage_policy_id, effectiveUsagePolicyId: d.effective_usage_policy_id, - customTags: d.custom_tags, effectiveCustomTags: d.effective_custom_tags, })); @@ -1022,7 +1376,6 @@ export const unmarshalDatabaseInstanceRefSchema: z.ZodType .object({ uid: z.string().optional(), name: z.string().optional(), - lsn: z.string().optional(), effective_lsn: z.string().optional(), branch_time: z .string() @@ -1032,7 +1385,6 @@ export const unmarshalDatabaseInstanceRefSchema: z.ZodType .transform(d => ({ uid: d.uid, name: d.name, - lsn: d.lsn, effectiveLsn: d.effective_lsn, branchTime: d.branch_time, })); @@ -1155,25 +1507,11 @@ export const unmarshalListSyncedDatabaseTablesResponseSchema: z.ZodType = z - .object({ - storage_catalog: z.string().optional(), - storage_schema: z.string().optional(), - budget_policy_id: z.string().optional(), - }) - .transform(d => ({ - storageCatalog: d.storage_catalog, - storageSchema: d.storage_schema, - budgetPolicyId: d.budget_policy_id, - })); - export const unmarshalSyncedDatabaseTableSchema: z.ZodType = z .object({ name: z.string().optional(), - database_instance_name: z.string().optional(), effective_database_instance_name: z.string().optional(), - logical_database_name: z.string().optional(), effective_logical_database_name: z.string().optional(), spec: z.lazy(() => unmarshalSyncedTableSpecSchema).optional(), unity_catalog_provisioning_state: z.string().optional(), @@ -1183,9 +1521,7 @@ export const unmarshalSyncedDatabaseTableSchema: z.ZodType }) .transform(d => ({ name: d.name, - databaseInstanceName: d.database_instance_name, effectiveDatabaseInstanceName: d.effective_database_instance_name, - logicalDatabaseName: d.logical_database_name, effectiveLogicalDatabaseName: d.effective_logical_database_name, spec: d.spec, unityCatalogProvisioningState: d.unity_catalog_provisioning_state, @@ -1302,10 +1638,6 @@ export const unmarshalSyncedTableSpecSchema: z.ZodType = z source_table_full_name: z.string().optional(), primary_key_columns: z.array(z.string()).optional(), timeseries_key: z.string().optional(), - existing_pipeline_id: z.string().optional(), - create_database_objects_if_missing: z.boolean().optional(), - new_pipeline_spec: z.lazy(() => unmarshalNewPipelineSpecSchema).optional(), - accelerated_sync: z.boolean().optional(), type_overrides: z .array(z.lazy(() => unmarshalSyncedTableSpec_TypeOverrideSchema)) .optional(), @@ -1315,10 +1647,6 @@ export const unmarshalSyncedTableSpecSchema: z.ZodType = z sourceTableFullName: d.source_table_full_name, primaryKeyColumns: d.primary_key_columns, timeseriesKey: d.timeseries_key, - existingPipelineId: d.existing_pipeline_id, - createDatabaseObjectsIfMissing: d.create_database_objects_if_missing, - newPipelineSpec: d.new_pipeline_spec, - acceleratedSync: d.accelerated_sync, typeOverrides: d.type_overrides, })); @@ -1402,7 +1730,7 @@ export const unmarshalSyncedTableTriggeredUpdateStatusSchema: z.ZodType ({ name: d.name, database_instance_name: d.databaseInstanceName, database_name: d.databaseName, - uid: d.uid, create_database_if_not_exists: d.createDatabaseIfNotExists, })); -export const marshalDatabaseInstanceSchema: z.ZodType = z +export const marshalCreateDatabaseInstanceSchema: z.ZodType = z .object({ - uid: z.string().optional(), name: z.string().optional(), - creator: z.string().optional(), - readWriteDns: z.string().optional(), - creationTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - state: z.string().optional(), - pgVersion: z.string().optional(), capacity: z.string().optional(), - effectiveCapacity: z.string().optional(), stopped: z.boolean().optional(), - effectiveStopped: z.boolean().optional(), nodeCount: z.number().optional(), - effectiveNodeCount: z.number().optional(), enableReadableSecondaries: z.boolean().optional(), - effectiveEnableReadableSecondaries: z.boolean().optional(), - readOnlyDns: z.string().optional(), retentionWindowInDays: z.number().optional(), - effectiveRetentionWindowInDays: z.number().optional(), parentInstanceRef: z - .lazy(() => marshalDatabaseInstanceRefSchema) - .optional(), - childInstanceRefs: z - .array(z.lazy(() => marshalDatabaseInstanceRefSchema)) + .lazy(() => marshalCreateDatabaseInstanceRefSchema) .optional(), enablePgNativeLogin: z.boolean().optional(), - effectiveEnablePgNativeLogin: z.boolean().optional(), usagePolicyId: z.string().optional(), - effectiveUsagePolicyId: z.string().optional(), - customTags: z.array(z.lazy(() => marshalCustomTagSchema)).optional(), - effectiveCustomTags: z - .array(z.lazy(() => marshalCustomTagSchema)) - .optional(), + customTags: z.array(z.lazy(() => marshalCreateCustomTagSchema)).optional(), }) .transform(d => ({ - uid: d.uid, name: d.name, - creator: d.creator, - read_write_dns: d.readWriteDns, - creation_time: d.creationTime, - state: d.state, - pg_version: d.pgVersion, capacity: d.capacity, - effective_capacity: d.effectiveCapacity, stopped: d.stopped, - effective_stopped: d.effectiveStopped, node_count: d.nodeCount, - effective_node_count: d.effectiveNodeCount, enable_readable_secondaries: d.enableReadableSecondaries, - effective_enable_readable_secondaries: d.effectiveEnableReadableSecondaries, - read_only_dns: d.readOnlyDns, retention_window_in_days: d.retentionWindowInDays, - effective_retention_window_in_days: d.effectiveRetentionWindowInDays, parent_instance_ref: d.parentInstanceRef, - child_instance_refs: d.childInstanceRefs, enable_pg_native_login: d.enablePgNativeLogin, - effective_enable_pg_native_login: d.effectiveEnablePgNativeLogin, usage_policy_id: d.usagePolicyId, - effective_usage_policy_id: d.effectiveUsagePolicyId, custom_tags: d.customTags, - effective_custom_tags: d.effectiveCustomTags, })); -export const marshalDatabaseInstanceRefSchema: z.ZodType = z +export const marshalCreateDatabaseInstanceRefSchema: z.ZodType = z .object({ - uid: z.string().optional(), name: z.string().optional(), lsn: z.string().optional(), - effectiveLsn: z.string().optional(), branchTime: z .any() .transform((d: Temporal.Instant) => d.toString()) .optional(), }) .transform(d => ({ - uid: d.uid, name: d.name, lsn: d.lsn, - effective_lsn: d.effectiveLsn, branch_time: d.branchTime, })); -export const marshalDatabaseInstanceRoleSchema: z.ZodType = z +export const marshalCreateDatabaseInstanceRoleSchema: z.ZodType = z .object({ - name: z.string().optional(), + name: z.string(), identityType: z.string().optional(), membershipRole: z.string().optional(), attributes: z - .lazy(() => marshalDatabaseInstanceRole_AttributesSchema) - .optional(), - effectiveAttributes: z - .lazy(() => marshalDatabaseInstanceRole_AttributesSchema) + .lazy(() => marshalDatabaseInstanceRole_CreateAttributesSchema) .optional(), instanceName: z.string().optional(), }) @@ -1532,26 +1812,12 @@ export const marshalDatabaseInstanceRoleSchema: z.ZodType = z identity_type: d.identityType, membership_role: d.membershipRole, attributes: d.attributes, - effective_attributes: d.effectiveAttributes, instance_name: d.instanceName, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDatabaseInstanceRole_AttributesSchema: z.ZodType = z +export const marshalCreateDatabaseTableSchema: z.ZodType = z .object({ - createdb: z.boolean().optional(), - createrole: z.boolean().optional(), - bypassrls: z.boolean().optional(), - }) - .transform(d => ({ - createdb: d.createdb, - createrole: d.createrole, - bypassrls: d.bypassrls, - })); - -export const marshalDatabaseTableSchema: z.ZodType = z - .object({ - name: z.string().optional(), + name: z.string(), databaseInstanceName: z.string().optional(), logicalDatabaseName: z.string().optional(), }) @@ -1561,32 +1827,7 @@ export const marshalDatabaseTableSchema: z.ZodType = z logical_database_name: d.logicalDatabaseName, })); -export const marshalDeltaTableSyncInfoSchema: z.ZodType = z - .object({ - deltaCommitVersion: z.bigint().optional(), - deltaCommitTimestamp: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - }) - .transform(d => ({ - delta_commit_version: d.deltaCommitVersion, - delta_commit_timestamp: d.deltaCommitTimestamp, - })); - -export const marshalGenerateDatabaseCredentialRequestSchema: z.ZodType = z - .object({ - requestId: z.string().optional(), - instanceNames: z.array(z.string()).optional(), - claims: z.array(z.lazy(() => marshalRequestedClaimsSchema)).optional(), - }) - .transform(d => ({ - request_id: d.requestId, - instance_names: d.instanceNames, - claims: d.claims, - })); - -export const marshalNewPipelineSpecSchema: z.ZodType = z +export const marshalCreateNewPipelineSpecSchema: z.ZodType = z .object({ storageCatalog: z.string().optional(), storageSchema: z.string().optional(), @@ -1598,17 +1839,19 @@ export const marshalNewPipelineSpecSchema: z.ZodType = z budget_policy_id: d.budgetPolicyId, })); -export const marshalRequestedClaimsSchema: z.ZodType = z +export const marshalCreateRequestedClaimsSchema: z.ZodType = z .object({ permissionSet: z.string().optional(), - resources: z.array(z.lazy(() => marshalRequestedResourceSchema)).optional(), + resources: z + .array(z.lazy(() => marshalCreateRequestedResourceSchema)) + .optional(), }) .transform(d => ({ permission_set: d.permissionSet, resources: d.resources, })); -export const marshalRequestedResourceSchema: z.ZodType = z +export const marshalCreateRequestedResourceSchema: z.ZodType = z .object({ resourceName: z .discriminatedUnion('$case', [ @@ -1629,116 +1872,195 @@ export const marshalRequestedResourceSchema: z.ZodType = z }), })); -export const marshalSyncedDatabaseTableSchema: z.ZodType = z +export const marshalCreateSyncedDatabaseTableSchema: z.ZodType = z .object({ name: z.string().optional(), databaseInstanceName: z.string().optional(), - effectiveDatabaseInstanceName: z.string().optional(), logicalDatabaseName: z.string().optional(), - effectiveLogicalDatabaseName: z.string().optional(), - spec: z.lazy(() => marshalSyncedTableSpecSchema).optional(), - unityCatalogProvisioningState: z.string().optional(), - dataSynchronizationStatus: z - .lazy(() => marshalSyncedTableStatusSchema) - .optional(), + spec: z.lazy(() => marshalCreateSyncedTableSpecSchema).optional(), }) .transform(d => ({ name: d.name, database_instance_name: d.databaseInstanceName, - effective_database_instance_name: d.effectiveDatabaseInstanceName, logical_database_name: d.logicalDatabaseName, - effective_logical_database_name: d.effectiveLogicalDatabaseName, spec: d.spec, - unity_catalog_provisioning_state: d.unityCatalogProvisioningState, - data_synchronization_status: d.dataSynchronizationStatus, })); -export const marshalSyncedTableContinuousUpdateStatusSchema: z.ZodType = z +export const marshalCreateSyncedTableSpecSchema: z.ZodType = z .object({ - lastProcessedCommitVersion: z.bigint().optional(), - timestamp: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + schedulingPolicy: z.string().optional(), + sourceTableFullName: z.string().optional(), + primaryKeyColumns: z.array(z.string()).optional(), + timeseriesKey: z.string().optional(), + existingPipelineId: z.string().optional(), + createDatabaseObjectsIfMissing: z.boolean().optional(), + newPipelineSpec: z + .lazy(() => marshalCreateNewPipelineSpecSchema) .optional(), - initialPipelineSyncProgress: z - .lazy(() => marshalSyncedTablePipelineProgressSchema) + acceleratedSync: z.boolean().optional(), + typeOverrides: z + .array(z.lazy(() => marshalSyncedTableSpec_CreateTypeOverrideSchema)) .optional(), }) .transform(d => ({ - last_processed_commit_version: d.lastProcessedCommitVersion, - timestamp: d.timestamp, - initial_pipeline_sync_progress: d.initialPipelineSyncProgress, + scheduling_policy: d.schedulingPolicy, + source_table_full_name: d.sourceTableFullName, + primary_key_columns: d.primaryKeyColumns, + timeseries_key: d.timeseriesKey, + existing_pipeline_id: d.existingPipelineId, + create_database_objects_if_missing: d.createDatabaseObjectsIfMissing, + new_pipeline_spec: d.newPipelineSpec, + accelerated_sync: d.acceleratedSync, + type_overrides: d.typeOverrides, })); -export const marshalSyncedTableFailedStatusSchema: z.ZodType = z +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalDatabaseInstanceRole_CreateAttributesSchema: z.ZodType = z .object({ - lastProcessedCommitVersion: z.bigint().optional(), - timestamp: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + createdb: z.boolean().optional(), + createrole: z.boolean().optional(), + bypassrls: z.boolean().optional(), + }) + .transform(d => ({ + createdb: d.createdb, + createrole: d.createrole, + bypassrls: d.bypassrls, + })); + +export const marshalGenerateDatabaseCredentialRequestSchema: z.ZodType = z + .object({ + requestId: z.string().optional(), + instanceNames: z.array(z.string()).optional(), + claims: z + .array(z.lazy(() => marshalCreateRequestedClaimsSchema)) .optional(), }) .transform(d => ({ - last_processed_commit_version: d.lastProcessedCommitVersion, - timestamp: d.timestamp, + request_id: d.requestId, + instance_names: d.instanceNames, + claims: d.claims, })); -export const marshalSyncedTablePipelineProgressSchema: z.ZodType = z +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalSyncedTableSpec_CreateTypeOverrideSchema: z.ZodType = z .object({ - latestVersionCurrentlyProcessing: z.bigint().optional(), - syncedRowCount: z.bigint().optional(), - totalRowCount: z.bigint().optional(), - syncProgressCompletion: z.number().optional(), - estimatedCompletionTimeSeconds: z.number().optional(), - provisioningPhase: z.string().optional(), + columnName: z.string(), + pgType: z.string(), + size: z.number().optional(), }) .transform(d => ({ - latest_version_currently_processing: d.latestVersionCurrentlyProcessing, - synced_row_count: d.syncedRowCount, - total_row_count: d.totalRowCount, - sync_progress_completion: d.syncProgressCompletion, - estimated_completion_time_seconds: d.estimatedCompletionTimeSeconds, - provisioning_phase: d.provisioningPhase, + column_name: d.columnName, + pg_type: d.pgType, + size: d.size, })); -export const marshalSyncedTablePositionSchema: z.ZodType = z +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalSyncedTableSpec_UpdateTypeOverrideSchema: z.ZodType = z .object({ - syncStartTimestamp: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + columnName: z.string().optional(), + pgType: z.string().optional(), + size: z.number().optional(), + }) + .transform(d => ({ + column_name: d.columnName, + pg_type: d.pgType, + size: d.size, + })); + +export const marshalUpdateCustomTagSchema: z.ZodType = z + .object({ + key: z.string().optional(), + value: z.string().optional(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); + +export const marshalUpdateDatabaseCatalogSchema: z.ZodType = z + .object({ + name: z.string().optional(), + databaseInstanceName: z.string().optional(), + databaseName: z.string().optional(), + createDatabaseIfNotExists: z.boolean().optional(), + }) + .transform(d => ({ + name: d.name, + database_instance_name: d.databaseInstanceName, + database_name: d.databaseName, + create_database_if_not_exists: d.createDatabaseIfNotExists, + })); + +export const marshalUpdateDatabaseInstanceSchema: z.ZodType = z + .object({ + name: z.string().optional(), + capacity: z.string().optional(), + stopped: z.boolean().optional(), + nodeCount: z.number().optional(), + enableReadableSecondaries: z.boolean().optional(), + retentionWindowInDays: z.number().optional(), + parentInstanceRef: z + .lazy(() => marshalUpdateDatabaseInstanceRefSchema) .optional(), - syncEndTimestamp: z + enablePgNativeLogin: z.boolean().optional(), + usagePolicyId: z.string().optional(), + customTags: z.array(z.lazy(() => marshalUpdateCustomTagSchema)).optional(), + }) + .transform(d => ({ + name: d.name, + capacity: d.capacity, + stopped: d.stopped, + node_count: d.nodeCount, + enable_readable_secondaries: d.enableReadableSecondaries, + retention_window_in_days: d.retentionWindowInDays, + parent_instance_ref: d.parentInstanceRef, + enable_pg_native_login: d.enablePgNativeLogin, + usage_policy_id: d.usagePolicyId, + custom_tags: d.customTags, + })); + +export const marshalUpdateDatabaseInstanceRefSchema: z.ZodType = z + .object({ + name: z.string().optional(), + lsn: z.string().optional(), + branchTime: z .any() .transform((d: Temporal.Instant) => d.toString()) .optional(), - sourceSyncInfo: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('deltaTableSyncInfo'), - deltaTableSyncInfo: z.lazy(() => marshalDeltaTableSyncInfoSchema), - }), - ]) - .optional(), }) .transform(d => ({ - sync_start_timestamp: d.syncStartTimestamp, - sync_end_timestamp: d.syncEndTimestamp, - ...(d.sourceSyncInfo?.$case === 'deltaTableSyncInfo' && { - delta_table_sync_info: d.sourceSyncInfo.deltaTableSyncInfo, - }), + name: d.name, + lsn: d.lsn, + branch_time: d.branchTime, })); -export const marshalSyncedTableProvisioningStatusSchema: z.ZodType = z +export const marshalUpdateNewPipelineSpecSchema: z.ZodType = z .object({ - initialPipelineSyncProgress: z - .lazy(() => marshalSyncedTablePipelineProgressSchema) - .optional(), + storageCatalog: z.string().optional(), + storageSchema: z.string().optional(), + budgetPolicyId: z.string().optional(), }) .transform(d => ({ - initial_pipeline_sync_progress: d.initialPipelineSyncProgress, + storage_catalog: d.storageCatalog, + storage_schema: d.storageSchema, + budget_policy_id: d.budgetPolicyId, })); -export const marshalSyncedTableSpecSchema: z.ZodType = z +export const marshalUpdateSyncedDatabaseTableSchema: z.ZodType = z + .object({ + name: z.string().optional(), + databaseInstanceName: z.string().optional(), + logicalDatabaseName: z.string().optional(), + spec: z.lazy(() => marshalUpdateSyncedTableSpecSchema).optional(), + }) + .transform(d => ({ + name: d.name, + database_instance_name: d.databaseInstanceName, + logical_database_name: d.logicalDatabaseName, + spec: d.spec, + })); + +export const marshalUpdateSyncedTableSpecSchema: z.ZodType = z .object({ schedulingPolicy: z.string().optional(), sourceTableFullName: z.string().optional(), @@ -1746,10 +2068,12 @@ export const marshalSyncedTableSpecSchema: z.ZodType = z timeseriesKey: z.string().optional(), existingPipelineId: z.string().optional(), createDatabaseObjectsIfMissing: z.boolean().optional(), - newPipelineSpec: z.lazy(() => marshalNewPipelineSpecSchema).optional(), + newPipelineSpec: z + .lazy(() => marshalUpdateNewPipelineSpecSchema) + .optional(), acceleratedSync: z.boolean().optional(), typeOverrides: z - .array(z.lazy(() => marshalSyncedTableSpec_TypeOverrideSchema)) + .array(z.lazy(() => marshalSyncedTableSpec_UpdateTypeOverrideSchema)) .optional(), }) .transform(d => ({ @@ -1764,238 +2088,82 @@ export const marshalSyncedTableSpecSchema: z.ZodType = z type_overrides: d.typeOverrides, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalSyncedTableSpec_TypeOverrideSchema: z.ZodType = z - .object({ - columnName: z.string().optional(), - pgType: z.string().optional(), - size: z.number().optional(), - }) - .transform(d => ({ - column_name: d.columnName, - pg_type: d.pgType, - size: d.size, - })); - -export const marshalSyncedTableStatusSchema: z.ZodType = z - .object({ - detailedState: z.string().optional(), - message: z.string().optional(), - detailedStatus: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('provisioningStatus'), - provisioningStatus: z.lazy( - () => marshalSyncedTableProvisioningStatusSchema - ), - }), - z.object({ - $case: z.literal('continuousUpdateStatus'), - continuousUpdateStatus: z.lazy( - () => marshalSyncedTableContinuousUpdateStatusSchema - ), - }), - z.object({ - $case: z.literal('triggeredUpdateStatus'), - triggeredUpdateStatus: z.lazy( - () => marshalSyncedTableTriggeredUpdateStatusSchema - ), - }), - z.object({ - $case: z.literal('failedStatus'), - failedStatus: z.lazy(() => marshalSyncedTableFailedStatusSchema), - }), - ]) - .optional(), - pipelineId: z.string().optional(), - lastSync: z.lazy(() => marshalSyncedTablePositionSchema).optional(), - }) - .transform(d => ({ - detailed_state: d.detailedState, - message: d.message, - ...(d.detailedStatus?.$case === 'provisioningStatus' && { - provisioning_status: d.detailedStatus.provisioningStatus, - }), - ...(d.detailedStatus?.$case === 'continuousUpdateStatus' && { - continuous_update_status: d.detailedStatus.continuousUpdateStatus, - }), - ...(d.detailedStatus?.$case === 'triggeredUpdateStatus' && { - triggered_update_status: d.detailedStatus.triggeredUpdateStatus, - }), - ...(d.detailedStatus?.$case === 'failedStatus' && { - failed_status: d.detailedStatus.failedStatus, - }), - pipeline_id: d.pipelineId, - last_sync: d.lastSync, - })); - -export const marshalSyncedTableTriggeredUpdateStatusSchema: z.ZodType = z - .object({ - lastProcessedCommitVersion: z.bigint().optional(), - timestamp: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - triggeredUpdateProgress: z - .lazy(() => marshalSyncedTablePipelineProgressSchema) - .optional(), - }) - .transform(d => ({ - last_processed_commit_version: d.lastProcessedCommitVersion, - timestamp: d.timestamp, - triggered_update_progress: d.triggeredUpdateProgress, - })); - -const databaseCatalogFieldMaskSchema: FieldMaskSchema = { +const updateDatabaseCatalogFieldMaskSchema: FieldMaskSchema = { createDatabaseIfNotExists: {wire: 'create_database_if_not_exists'}, databaseInstanceName: {wire: 'database_instance_name'}, databaseName: {wire: 'database_name'}, name: {wire: 'name'}, - uid: {wire: 'uid'}, }; -export function databaseCatalogFieldMask( +export function updateDatabaseCatalogFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - databaseCatalogFieldMaskSchema + updateDatabaseCatalogFieldMaskSchema ); } -const databaseInstanceFieldMaskSchema: FieldMaskSchema = { +const updateDatabaseInstanceFieldMaskSchema: FieldMaskSchema = { capacity: {wire: 'capacity'}, - childInstanceRefs: {wire: 'child_instance_refs'}, - creationTime: {wire: 'creation_time'}, - creator: {wire: 'creator'}, customTags: {wire: 'custom_tags'}, - effectiveCapacity: {wire: 'effective_capacity'}, - effectiveCustomTags: {wire: 'effective_custom_tags'}, - effectiveEnablePgNativeLogin: {wire: 'effective_enable_pg_native_login'}, - effectiveEnableReadableSecondaries: { - wire: 'effective_enable_readable_secondaries', - }, - effectiveNodeCount: {wire: 'effective_node_count'}, - effectiveRetentionWindowInDays: {wire: 'effective_retention_window_in_days'}, - effectiveStopped: {wire: 'effective_stopped'}, - effectiveUsagePolicyId: {wire: 'effective_usage_policy_id'}, enablePgNativeLogin: {wire: 'enable_pg_native_login'}, enableReadableSecondaries: {wire: 'enable_readable_secondaries'}, name: {wire: 'name'}, nodeCount: {wire: 'node_count'}, parentInstanceRef: { wire: 'parent_instance_ref', - children: () => databaseInstanceRefFieldMaskSchema, + children: () => updateDatabaseInstanceRefFieldMaskSchema, }, - pgVersion: {wire: 'pg_version'}, - readOnlyDns: {wire: 'read_only_dns'}, - readWriteDns: {wire: 'read_write_dns'}, retentionWindowInDays: {wire: 'retention_window_in_days'}, - state: {wire: 'state'}, stopped: {wire: 'stopped'}, - uid: {wire: 'uid'}, usagePolicyId: {wire: 'usage_policy_id'}, }; -export function databaseInstanceFieldMask( +export function updateDatabaseInstanceFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - databaseInstanceFieldMaskSchema + updateDatabaseInstanceFieldMaskSchema ); } -const databaseInstanceRefFieldMaskSchema: FieldMaskSchema = { +const updateDatabaseInstanceRefFieldMaskSchema: FieldMaskSchema = { branchTime: {wire: 'branch_time'}, - effectiveLsn: {wire: 'effective_lsn'}, lsn: {wire: 'lsn'}, name: {wire: 'name'}, - uid: {wire: 'uid'}, -}; - -const deltaTableSyncInfoFieldMaskSchema: FieldMaskSchema = { - deltaCommitTimestamp: {wire: 'delta_commit_timestamp'}, - deltaCommitVersion: {wire: 'delta_commit_version'}, }; -const newPipelineSpecFieldMaskSchema: FieldMaskSchema = { +const updateNewPipelineSpecFieldMaskSchema: FieldMaskSchema = { budgetPolicyId: {wire: 'budget_policy_id'}, storageCatalog: {wire: 'storage_catalog'}, storageSchema: {wire: 'storage_schema'}, }; -const syncedDatabaseTableFieldMaskSchema: FieldMaskSchema = { - dataSynchronizationStatus: { - wire: 'data_synchronization_status', - children: () => syncedTableStatusFieldMaskSchema, - }, +const updateSyncedDatabaseTableFieldMaskSchema: FieldMaskSchema = { databaseInstanceName: {wire: 'database_instance_name'}, - effectiveDatabaseInstanceName: {wire: 'effective_database_instance_name'}, - effectiveLogicalDatabaseName: {wire: 'effective_logical_database_name'}, logicalDatabaseName: {wire: 'logical_database_name'}, name: {wire: 'name'}, - spec: {wire: 'spec', children: () => syncedTableSpecFieldMaskSchema}, - unityCatalogProvisioningState: {wire: 'unity_catalog_provisioning_state'}, + spec: {wire: 'spec', children: () => updateSyncedTableSpecFieldMaskSchema}, }; -export function syncedDatabaseTableFieldMask( +export function updateSyncedDatabaseTableFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - syncedDatabaseTableFieldMaskSchema + updateSyncedDatabaseTableFieldMaskSchema ); } -const syncedTableContinuousUpdateStatusFieldMaskSchema: FieldMaskSchema = { - initialPipelineSyncProgress: { - wire: 'initial_pipeline_sync_progress', - children: () => syncedTablePipelineProgressFieldMaskSchema, - }, - lastProcessedCommitVersion: {wire: 'last_processed_commit_version'}, - timestamp: {wire: 'timestamp'}, -}; - -const syncedTableFailedStatusFieldMaskSchema: FieldMaskSchema = { - lastProcessedCommitVersion: {wire: 'last_processed_commit_version'}, - timestamp: {wire: 'timestamp'}, -}; - -const syncedTablePipelineProgressFieldMaskSchema: FieldMaskSchema = { - estimatedCompletionTimeSeconds: {wire: 'estimated_completion_time_seconds'}, - latestVersionCurrentlyProcessing: { - wire: 'latest_version_currently_processing', - }, - provisioningPhase: {wire: 'provisioning_phase'}, - syncProgressCompletion: {wire: 'sync_progress_completion'}, - syncedRowCount: {wire: 'synced_row_count'}, - totalRowCount: {wire: 'total_row_count'}, -}; - -const syncedTablePositionFieldMaskSchema: FieldMaskSchema = { - deltaTableSyncInfo: { - wire: 'delta_table_sync_info', - children: () => deltaTableSyncInfoFieldMaskSchema, - }, - syncEndTimestamp: {wire: 'sync_end_timestamp'}, - syncStartTimestamp: {wire: 'sync_start_timestamp'}, -}; - -const syncedTableProvisioningStatusFieldMaskSchema: FieldMaskSchema = { - initialPipelineSyncProgress: { - wire: 'initial_pipeline_sync_progress', - children: () => syncedTablePipelineProgressFieldMaskSchema, - }, -}; - -const syncedTableSpecFieldMaskSchema: FieldMaskSchema = { +const updateSyncedTableSpecFieldMaskSchema: FieldMaskSchema = { acceleratedSync: {wire: 'accelerated_sync'}, createDatabaseObjectsIfMissing: {wire: 'create_database_objects_if_missing'}, existingPipelineId: {wire: 'existing_pipeline_id'}, newPipelineSpec: { wire: 'new_pipeline_spec', - children: () => newPipelineSpecFieldMaskSchema, + children: () => updateNewPipelineSpecFieldMaskSchema, }, primaryKeyColumns: {wire: 'primary_key_columns'}, schedulingPolicy: {wire: 'scheduling_policy'}, @@ -2003,38 +2171,3 @@ const syncedTableSpecFieldMaskSchema: FieldMaskSchema = { timeseriesKey: {wire: 'timeseries_key'}, typeOverrides: {wire: 'type_overrides'}, }; - -const syncedTableStatusFieldMaskSchema: FieldMaskSchema = { - continuousUpdateStatus: { - wire: 'continuous_update_status', - children: () => syncedTableContinuousUpdateStatusFieldMaskSchema, - }, - detailedState: {wire: 'detailed_state'}, - failedStatus: { - wire: 'failed_status', - children: () => syncedTableFailedStatusFieldMaskSchema, - }, - lastSync: { - wire: 'last_sync', - children: () => syncedTablePositionFieldMaskSchema, - }, - message: {wire: 'message'}, - pipelineId: {wire: 'pipeline_id'}, - provisioningStatus: { - wire: 'provisioning_status', - children: () => syncedTableProvisioningStatusFieldMaskSchema, - }, - triggeredUpdateStatus: { - wire: 'triggered_update_status', - children: () => syncedTableTriggeredUpdateStatusFieldMaskSchema, - }, -}; - -const syncedTableTriggeredUpdateStatusFieldMaskSchema: FieldMaskSchema = { - lastProcessedCommitVersion: {wire: 'last_processed_commit_version'}, - timestamp: {wire: 'timestamp'}, - triggeredUpdateProgress: { - wire: 'triggered_update_progress', - children: () => syncedTablePipelineProgressFieldMaskSchema, - }, -}; diff --git a/packages/dataclassification/src/v1/client.ts b/packages/dataclassification/src/v1/client.ts index d7040342..c9520f6c 100644 --- a/packages/dataclassification/src/v1/client.ts +++ b/packages/dataclassification/src/v1/client.ts @@ -24,7 +24,8 @@ import type { UpdateCatalogConfigRequest, } from './model'; import { - marshalCatalogConfigSchema, + marshalCreateCatalogConfigSchema, + marshalUpdateCatalogConfigSchema, unmarshalCatalogConfigSchema, } from './model'; @@ -74,7 +75,10 @@ export class DataClassificationClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/data-classification/v1/${req.parent ?? ''}/config`; - const body = marshalRequest(req.catalogConfig, marshalCatalogConfigSchema); + const body = marshalRequest( + req.catalogConfig, + marshalCreateCatalogConfigSchema + ); let resp: CatalogConfig | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -166,7 +170,10 @@ export class DataClassificationClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.catalogConfig, marshalCatalogConfigSchema); + const body = marshalRequest( + req.catalogConfig, + marshalUpdateCatalogConfigSchema + ); let resp: CatalogConfig | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/dataclassification/src/v1/index.ts b/packages/dataclassification/src/v1/index.ts index db46d1af..b87e817e 100755 --- a/packages/dataclassification/src/v1/index.ts +++ b/packages/dataclassification/src/v1/index.ts @@ -11,11 +11,17 @@ export {AutoTaggingConfig_AutoTaggingMode} from './model'; export type { AutoTaggingConfig, CatalogConfig, + CatalogConfig_CreateSchemaNames, CatalogConfig_SchemaNames, + CatalogConfig_UpdateSchemaNames, + CreateAutoTaggingConfig, + CreateCatalogConfig, CreateCatalogConfigRequest, DeleteCatalogConfigRequest, GetCatalogConfigRequest, + UpdateAutoTaggingConfig, + UpdateCatalogConfig, UpdateCatalogConfigRequest, } from './model'; -export {catalogConfigFieldMask} from './model'; +export {updateCatalogConfigFieldMask} from './model'; diff --git a/packages/dataclassification/src/v1/model.ts b/packages/dataclassification/src/v1/model.ts index 135b34d7..8940d33e 100755 --- a/packages/dataclassification/src/v1/model.ts +++ b/packages/dataclassification/src/v1/model.ts @@ -58,6 +58,13 @@ export interface CatalogConfig { autoTagConfigs?: AutoTaggingConfig[] | undefined; } +/** Wrapper message for a list of schema names. */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface CatalogConfig_CreateSchemaNames { + /** Schema names, each relative to the parent catalog. Must not be empty. */ + names: string[]; +} + /** Wrapper message for a list of schema names. */ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface CatalogConfig_SchemaNames { @@ -65,6 +72,55 @@ export interface CatalogConfig_SchemaNames { names?: string[] | undefined; } +/** Wrapper message for a list of schema names. */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface CatalogConfig_UpdateSchemaNames { + /** Schema names, each relative to the parent catalog. Must not be empty. */ + names?: string[] | undefined; +} + +/** + * Auto-tagging configuration for a classification tag. + * When enabled, detected columns are automatically tagged with Unity Catalog + * tags. + */ +export interface CreateAutoTaggingConfig { + /** + * The Classification Tag. For built-in classes this is a system tag (e.g., "class.name", + * "class.location"); for custom classes it is a user-defined governance tag key. + */ + classificationTag: string; + /** Whether auto-tagging is enabled or disabled for this classification tag. */ + autoTaggingMode: AutoTaggingConfig_AutoTaggingMode; +} + +/** + * Data Classification configuration for a Unity Catalog catalog. This message follows the "At Most One Resource" pattern: at most one CatalogConfig exists per catalog. + * - Full CRUD operations are supported: Create enables Data Classification, Delete disables it + * - It has no unique identifier of its own and uses its parent catalog's identifier (catalog_name) + */ +export interface CreateCatalogConfig { + /** Resource name in the format: catalogs/{catalog_name}/config. */ + name?: string | undefined; + selectedSchemas?: + | { + $case: 'includedSchemas'; + /** + * Schemas to include in the scan, each named relative to the parent catalog. + * If specified, only listed schemas will be scanned. + * Mutually exclusive with `excluded_schemas`: only one may be set per request. + * If neither `included_schemas` nor `excluded_schemas` is set, all schemas are scanned. + */ + includedSchemas: CatalogConfig_CreateSchemaNames; + } + | undefined; + /** + * List of auto-tagging configurations for this catalog. + * Empty list means no auto-tagging is enabled. + */ + autoTagConfigs?: CreateAutoTaggingConfig[] | undefined; +} + /** * Create Data Classification configuration for a catalog. * Creating a config enables Data Classification for the catalog. @@ -73,7 +129,7 @@ export interface CreateCatalogConfigRequest { /** Parent resource in the format: catalogs/{catalog_name} */ parent?: string | undefined; /** The configuration to create. */ - catalogConfig?: CatalogConfig | undefined; + catalogConfig?: CreateCatalogConfig | undefined; } /** @@ -91,6 +147,48 @@ export interface GetCatalogConfigRequest { name?: string | undefined; } +/** + * Auto-tagging configuration for a classification tag. + * When enabled, detected columns are automatically tagged with Unity Catalog + * tags. + */ +export interface UpdateAutoTaggingConfig { + /** + * The Classification Tag. For built-in classes this is a system tag (e.g., "class.name", + * "class.location"); for custom classes it is a user-defined governance tag key. + */ + classificationTag?: string | undefined; + /** Whether auto-tagging is enabled or disabled for this classification tag. */ + autoTaggingMode?: AutoTaggingConfig_AutoTaggingMode | undefined; +} + +/** + * Data Classification configuration for a Unity Catalog catalog. This message follows the "At Most One Resource" pattern: at most one CatalogConfig exists per catalog. + * - Full CRUD operations are supported: Create enables Data Classification, Delete disables it + * - It has no unique identifier of its own and uses its parent catalog's identifier (catalog_name) + */ +export interface UpdateCatalogConfig { + /** Resource name in the format: catalogs/{catalog_name}/config. */ + name?: string | undefined; + selectedSchemas?: + | { + $case: 'includedSchemas'; + /** + * Schemas to include in the scan, each named relative to the parent catalog. + * If specified, only listed schemas will be scanned. + * Mutually exclusive with `excluded_schemas`: only one may be set per request. + * If neither `included_schemas` nor `excluded_schemas` is set, all schemas are scanned. + */ + includedSchemas: CatalogConfig_UpdateSchemaNames; + } + | undefined; + /** + * List of auto-tagging configurations for this catalog. + * Empty list means no auto-tagging is enabled. + */ + autoTagConfigs?: UpdateAutoTaggingConfig[] | undefined; +} + /** * Request to update the Data Classification configuration for a catalog. * @@ -102,9 +200,9 @@ export interface UpdateCatalogConfigRequest { * The configuration to apply to the catalog. * The name field in catalog_config identifies which resource to update. */ - catalogConfig?: CatalogConfig | undefined; + catalogConfig?: UpdateCatalogConfig | undefined; /** Field mask specifying which fields to update. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalAutoTaggingConfigSchema: z.ZodType = z @@ -149,29 +247,49 @@ export const unmarshalCatalogConfig_SchemaNamesSchema: z.ZodType ({ + names: d.names, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalCatalogConfig_UpdateSchemaNamesSchema: z.ZodType = z .object({ - classificationTag: z.string().optional(), - autoTaggingMode: z.string().optional(), + names: z.array(z.string()).optional(), + }) + .transform(d => ({ + names: d.names, + })); + +export const marshalCreateAutoTaggingConfigSchema: z.ZodType = z + .object({ + classificationTag: z.string(), + autoTaggingMode: z.string(), }) .transform(d => ({ classification_tag: d.classificationTag, auto_tagging_mode: d.autoTaggingMode, })); -export const marshalCatalogConfigSchema: z.ZodType = z +export const marshalCreateCatalogConfigSchema: z.ZodType = z .object({ name: z.string().optional(), selectedSchemas: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('includedSchemas'), - includedSchemas: z.lazy(() => marshalCatalogConfig_SchemaNamesSchema), + includedSchemas: z.lazy( + () => marshalCatalogConfig_CreateSchemaNamesSchema + ), }), ]) .optional(), autoTagConfigs: z - .array(z.lazy(() => marshalAutoTaggingConfigSchema)) + .array(z.lazy(() => marshalCreateAutoTaggingConfigSchema)) .optional(), }) .transform(d => ({ @@ -182,31 +300,60 @@ export const marshalCatalogConfigSchema: z.ZodType = z auto_tag_configs: d.autoTagConfigs, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCatalogConfig_SchemaNamesSchema: z.ZodType = z +export const marshalUpdateAutoTaggingConfigSchema: z.ZodType = z .object({ - names: z.array(z.string()).optional(), + classificationTag: z.string().optional(), + autoTaggingMode: z.string().optional(), }) .transform(d => ({ - names: d.names, + classification_tag: d.classificationTag, + auto_tagging_mode: d.autoTaggingMode, + })); + +export const marshalUpdateCatalogConfigSchema: z.ZodType = z + .object({ + name: z.string().optional(), + selectedSchemas: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('includedSchemas'), + includedSchemas: z.lazy( + () => marshalCatalogConfig_UpdateSchemaNamesSchema + ), + }), + ]) + .optional(), + autoTagConfigs: z + .array(z.lazy(() => marshalUpdateAutoTaggingConfigSchema)) + .optional(), + }) + .transform(d => ({ + name: d.name, + ...(d.selectedSchemas?.$case === 'includedSchemas' && { + included_schemas: d.selectedSchemas.includedSchemas, + }), + auto_tag_configs: d.autoTagConfigs, })); -const catalogConfigFieldMaskSchema: FieldMaskSchema = { +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +const catalogConfig_UpdateSchemaNamesFieldMaskSchema: FieldMaskSchema = { + names: {wire: 'names'}, +}; + +const updateCatalogConfigFieldMaskSchema: FieldMaskSchema = { autoTagConfigs: {wire: 'auto_tag_configs'}, includedSchemas: { wire: 'included_schemas', - children: () => catalogConfig_SchemaNamesFieldMaskSchema, + children: () => catalogConfig_UpdateSchemaNamesFieldMaskSchema, }, name: {wire: 'name'}, }; -export function catalogConfigFieldMask( +export function updateCatalogConfigFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build(paths, catalogConfigFieldMaskSchema); +): FieldMask { + return FieldMask.build( + paths, + updateCatalogConfigFieldMaskSchema + ); } - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -const catalogConfig_SchemaNamesFieldMaskSchema: FieldMaskSchema = { - names: {wire: 'names'}, -}; diff --git a/packages/dataquality/src/v1/client.ts b/packages/dataquality/src/v1/client.ts index ac806ce7..1d651b16 100644 --- a/packages/dataquality/src/v1/client.ts +++ b/packages/dataquality/src/v1/client.ts @@ -36,8 +36,10 @@ import type { } from './model'; import { marshalCancelRefreshRequestSchema, - marshalMonitorSchema, - marshalRefreshSchema, + marshalCreateMonitorSchema, + marshalCreateRefreshSchema, + marshalUpdateMonitorSchema, + marshalUpdateRefreshSchema, unmarshalCancelRefreshResponseSchema, unmarshalListMonitorResponseSchema, unmarshalListRefreshResponseSchema, @@ -136,7 +138,7 @@ export class DataQualityClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/data-quality/v1/monitors`; - const body = marshalRequest(req.monitor, marshalMonitorSchema); + const body = marshalRequest(req.monitor, marshalCreateMonitorSchema); let resp: Monitor | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -174,7 +176,7 @@ export class DataQualityClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/data-quality/v1/monitors/${req.refresh?.objectType ?? ''}/${req.refresh?.objectId ?? ''}/refreshes`; - const body = marshalRequest(req.refresh, marshalRefreshSchema); + const body = marshalRequest(req.refresh, marshalCreateRefreshSchema); let resp: Refresh | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -486,7 +488,7 @@ export class DataQualityClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.monitor, marshalMonitorSchema); + const body = marshalRequest(req.monitor, marshalUpdateMonitorSchema); let resp: Monitor | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -528,7 +530,7 @@ export class DataQualityClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.refresh, marshalRefreshSchema); + const body = marshalRequest(req.refresh, marshalUpdateRefreshSchema); let resp: Refresh | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/dataquality/src/v1/index.ts b/packages/dataquality/src/v1/index.ts index d23cdecd..a1029837 100755 --- a/packages/dataquality/src/v1/index.ts +++ b/packages/dataquality/src/v1/index.ts @@ -20,8 +20,19 @@ export type { AnomalyDetectionConfig, CancelRefreshRequest, CancelRefreshResponse, + CreateAnomalyDetectionConfig, + CreateCronSchedule, + CreateDataProfilingConfig, + CreateDataProfilingCustomMetric, + CreateInferenceLogConfig, + CreateMonitor, CreateMonitorRequest, + CreateNotificationDestination, + CreateNotificationSettings, + CreateRefresh, CreateRefreshRequest, + CreateSnapshotConfig, + CreateTimeSeriesConfig, CronSchedule, DataProfilingConfig, DataProfilingCustomMetric, @@ -40,8 +51,19 @@ export type { Refresh, SnapshotConfig, TimeSeriesConfig, + UpdateAnomalyDetectionConfig, + UpdateCronSchedule, + UpdateDataProfilingConfig, + UpdateDataProfilingCustomMetric, + UpdateInferenceLogConfig, + UpdateMonitor, UpdateMonitorRequest, + UpdateNotificationDestination, + UpdateNotificationSettings, + UpdateRefresh, UpdateRefreshRequest, + UpdateSnapshotConfig, + UpdateTimeSeriesConfig, } from './model'; -export {monitorFieldMask, refreshFieldMask} from './model'; +export {updateMonitorFieldMask, updateRefreshFieldMask} from './model'; diff --git a/packages/dataquality/src/v1/model.ts b/packages/dataquality/src/v1/model.ts index 0b3f2712..98436420 100755 --- a/packages/dataquality/src/v1/model.ts +++ b/packages/dataquality/src/v1/model.ts @@ -160,16 +160,191 @@ export interface CancelRefreshResponse { refresh?: Refresh | undefined; } +/** Anomaly Detection Configurations. */ +export interface CreateAnomalyDetectionConfig { + /** List of fully qualified table names to exclude from anomaly detection. */ + excludedTableFullNames?: string[] | undefined; +} + +/** The data quality monitoring workflow cron schedule. */ +export interface CreateCronSchedule { + /** The expression that determines when to run the monitor. See [examples](https://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html). */ + quartzCronExpression: string; + /** + * A Java timezone id. The schedule for a job will be resolved with respect to this timezone. + * See `Java TimeZone `_ for details. + * The timezone id (e.g., ``America/Los_Angeles``) in which to evaluate the quartz expression. + */ + timezoneId: string; +} + +/** Data Profiling Configurations. */ +export interface CreateDataProfilingConfig { + /** ID of the schema where output tables are created. */ + outputSchemaId: string; + /** + * Field for specifying the absolute path to a custom directory to store data-monitoring + * assets. Normally prepopulated to a default user location via UI and Python APIs. + */ + assetsDir?: string | undefined; + /** (--[Create:REQ Update:REQ]--) Analysis config which is used to determine analysis logic. */ + analysisConfig?: + | { + $case: 'inferenceLog'; + /** `Analysis Configuration` for monitoring inference log tables. */ + inferenceLog: CreateInferenceLogConfig; + } + | { + $case: 'timeSeries'; + /** `Analysis Configuration` for monitoring time series tables. */ + timeSeries: CreateTimeSeriesConfig; + } + | { + $case: 'snapshot'; + /** `Analysis Configuration` for monitoring snapshot tables. */ + snapshot: CreateSnapshotConfig; + } + | undefined; + /** + * List of column expressions to slice data with for targeted analysis. The data is grouped by + * each expression independently, resulting in a separate slice for each predicate and its + * complements. For example `slicing_exprs=[“col_1”, “col_2 > 10”]` will generate the following + * slices: two slices for `col_2 > 10` (True and False), and one slice per unique value in + * `col1`. For high-cardinality columns, only the top 100 unique values by frequency will + * generate slices. + */ + slicingExprs?: string[] | undefined; + /** Custom metrics. */ + customMetrics?: CreateDataProfilingCustomMetric[] | undefined; + /** + * Baseline table name. + * Baseline data is used to compute drift from the data in the monitored `table_name`. + * The baseline table and the monitored table shall have the same schema. + */ + baselineTableName?: string | undefined; + /** The cron schedule. */ + schedule?: CreateCronSchedule | undefined; + /** Field for specifying notification settings. */ + notificationSettings?: CreateNotificationSettings | undefined; + /** Whether to skip creating a default dashboard summarizing data quality metrics. */ + skipBuiltinDashboard?: boolean | undefined; + /** + * Optional argument to specify the warehouse for dashboard creation. If not specified, the first running + * warehouse will be used. + */ + warehouseId?: string | undefined; +} + +/** Custom metric definition. */ +export interface CreateDataProfilingCustomMetric { + /** Name of the metric in the output tables. */ + name: string; + /** Jinja template for a SQL expression that specifies how to compute the metric. See [create metric definition](https://docs.databricks.com/en/lakehouse-monitoring/custom-metrics.html#create-definition). */ + definition: string; + /** + * A list of column names in the input table the metric should be computed for. + * Can use ``":table"`` to indicate that the metric needs information from multiple columns. + */ + inputColumns: string[]; + /** The output type of the custom metric. */ + outputDataType: string; + /** The type of the custom metric. */ + type: DataProfilingCustomMetricType; +} + +/** Inference log configuration. */ +export interface CreateInferenceLogConfig { + /** Problem type the model aims to solve. */ + problemType: InferenceProblemType; + /** Column for the timestamp. */ + timestampColumn: string; + /** List of granularities to use when aggregating data into time windows based on their timestamp. */ + granularities: AggregationGranularity[]; + /** Column for the prediction. */ + predictionColumn: string; + /** Column for the label. */ + labelColumn?: string | undefined; + /** Column for the model identifier. */ + modelIdColumn: string; +} + +/** Monitor for the data quality of unity catalog entities such as schema or table. */ +export interface CreateMonitor { + /** The type of the monitored object. Can be one of the following: `schema` or `table`. */ + objectType: string; + /** + * The UUID of the request object. It is `schema_id` for `schema`, and `table_id` for `table`. + * + * Find the `schema_id` from either: + * 1. The [schema_id](https://docs.databricks.com/api/workspace/schemas/get#schema_id) of the `Schemas` resource. + * 2. In [Catalog Explorer](https://docs.databricks.com/aws/en/catalog-explorer/) > select the `schema` > go to the `Details` tab > the `Schema ID` field. + * + * Find the `table_id` from either: + * 1. The [table_id](https://docs.databricks.com/api/workspace/tables/get#table_id) of the `Tables` resource. + * 2. In [Catalog Explorer](https://docs.databricks.com/aws/en/catalog-explorer/) > select the `table` > go to the `Details` tab > the `Table ID` field. + */ + objectId: string; + /** Anomaly Detection Configuration, applicable to `schema` object types. */ + anomalyDetectionConfig?: CreateAnomalyDetectionConfig | undefined; + /** + * Data Profiling Configuration, applicable to `table` object types. Exactly one `Analysis Configuration` + * must be present. + */ + dataProfilingConfig?: CreateDataProfilingConfig | undefined; +} + /** Request to create a Monitor. */ export interface CreateMonitorRequest { /** The monitor to create. */ - monitor?: Monitor | undefined; + monitor?: CreateMonitor | undefined; +} + +/** Destination of the data quality monitoring notification. */ +export interface CreateNotificationDestination { + /** The list of email addresses to send the notification to. A maximum of 5 email addresses is supported. */ + emailAddresses?: string[] | undefined; +} + +/** Settings for sending notifications on the data quality monitoring. */ +export interface CreateNotificationSettings { + /** Destinations to send notifications on failure/timeout. */ + onFailure?: CreateNotificationDestination | undefined; +} + +/** The Refresh object gives information on a refresh of the data quality monitoring pipeline. */ +export interface CreateRefresh { + /** The type of the monitored object. Can be one of the following: `schema` or `table`. */ + objectType?: string | undefined; + /** + * The UUID of the request object. It is `schema_id` for `schema`, and `table_id` for `table`. + * + * Find the `schema_id` from either: + * 1. The [schema_id](https://docs.databricks.com/api/workspace/schemas/get#schema_id) of the `Schemas` resource. + * 2. In [Catalog Explorer](https://docs.databricks.com/aws/en/catalog-explorer/) > select the `schema` > go to the `Details` tab > the `Schema ID` field. + * + * Find the `table_id` from either: + * 1. The [table_id](https://docs.databricks.com/api/workspace/tables/get#table_id) of the `Tables` resource. + * 2. In [Catalog Explorer](https://docs.databricks.com/aws/en/catalog-explorer/) > select the `table` > go to the `Details` tab > the `Table ID` field. + */ + objectId?: string | undefined; } /** Request to create a refresh. */ export interface CreateRefreshRequest { /** The refresh to create */ - refresh?: Refresh | undefined; + refresh?: CreateRefresh | undefined; +} + +/** Snapshot analysis configuration. */ +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface CreateSnapshotConfig {} + +/** Time series analysis configuration. */ +export interface CreateTimeSeriesConfig { + /** Column for the timestamp. */ + timestampColumn: string; + /** List of granularities to use when aggregating data into time windows based on their timestamp. */ + granularities: AggregationGranularity[]; } /** The data quality monitoring workflow cron schedule. */ @@ -492,6 +667,139 @@ export interface TimeSeriesConfig { granularities?: AggregationGranularity[] | undefined; } +/** Anomaly Detection Configurations. */ +export interface UpdateAnomalyDetectionConfig { + /** List of fully qualified table names to exclude from anomaly detection. */ + excludedTableFullNames?: string[] | undefined; +} + +/** The data quality monitoring workflow cron schedule. */ +export interface UpdateCronSchedule { + /** The expression that determines when to run the monitor. See [examples](https://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html). */ + quartzCronExpression?: string | undefined; + /** + * A Java timezone id. The schedule for a job will be resolved with respect to this timezone. + * See `Java TimeZone `_ for details. + * The timezone id (e.g., ``America/Los_Angeles``) in which to evaluate the quartz expression. + */ + timezoneId?: string | undefined; +} + +/** Data Profiling Configurations. */ +export interface UpdateDataProfilingConfig { + /** ID of the schema where output tables are created. */ + outputSchemaId?: string | undefined; + /** + * Field for specifying the absolute path to a custom directory to store data-monitoring + * assets. Normally prepopulated to a default user location via UI and Python APIs. + */ + assetsDir?: string | undefined; + /** (--[Create:REQ Update:REQ]--) Analysis config which is used to determine analysis logic. */ + analysisConfig?: + | { + $case: 'inferenceLog'; + /** `Analysis Configuration` for monitoring inference log tables. */ + inferenceLog: UpdateInferenceLogConfig; + } + | { + $case: 'timeSeries'; + /** `Analysis Configuration` for monitoring time series tables. */ + timeSeries: UpdateTimeSeriesConfig; + } + | { + $case: 'snapshot'; + /** `Analysis Configuration` for monitoring snapshot tables. */ + snapshot: UpdateSnapshotConfig; + } + | undefined; + /** + * List of column expressions to slice data with for targeted analysis. The data is grouped by + * each expression independently, resulting in a separate slice for each predicate and its + * complements. For example `slicing_exprs=[“col_1”, “col_2 > 10”]` will generate the following + * slices: two slices for `col_2 > 10` (True and False), and one slice per unique value in + * `col1`. For high-cardinality columns, only the top 100 unique values by frequency will + * generate slices. + */ + slicingExprs?: string[] | undefined; + /** Custom metrics. */ + customMetrics?: UpdateDataProfilingCustomMetric[] | undefined; + /** + * Baseline table name. + * Baseline data is used to compute drift from the data in the monitored `table_name`. + * The baseline table and the monitored table shall have the same schema. + */ + baselineTableName?: string | undefined; + /** The cron schedule. */ + schedule?: UpdateCronSchedule | undefined; + /** Field for specifying notification settings. */ + notificationSettings?: UpdateNotificationSettings | undefined; + /** Whether to skip creating a default dashboard summarizing data quality metrics. */ + skipBuiltinDashboard?: boolean | undefined; + /** + * Optional argument to specify the warehouse for dashboard creation. If not specified, the first running + * warehouse will be used. + */ + warehouseId?: string | undefined; +} + +/** Custom metric definition. */ +export interface UpdateDataProfilingCustomMetric { + /** Name of the metric in the output tables. */ + name?: string | undefined; + /** Jinja template for a SQL expression that specifies how to compute the metric. See [create metric definition](https://docs.databricks.com/en/lakehouse-monitoring/custom-metrics.html#create-definition). */ + definition?: string | undefined; + /** + * A list of column names in the input table the metric should be computed for. + * Can use ``":table"`` to indicate that the metric needs information from multiple columns. + */ + inputColumns?: string[] | undefined; + /** The output type of the custom metric. */ + outputDataType?: string | undefined; + /** The type of the custom metric. */ + type?: DataProfilingCustomMetricType | undefined; +} + +/** Inference log configuration. */ +export interface UpdateInferenceLogConfig { + /** Problem type the model aims to solve. */ + problemType?: InferenceProblemType | undefined; + /** Column for the timestamp. */ + timestampColumn?: string | undefined; + /** List of granularities to use when aggregating data into time windows based on their timestamp. */ + granularities?: AggregationGranularity[] | undefined; + /** Column for the prediction. */ + predictionColumn?: string | undefined; + /** Column for the label. */ + labelColumn?: string | undefined; + /** Column for the model identifier. */ + modelIdColumn?: string | undefined; +} + +/** Monitor for the data quality of unity catalog entities such as schema or table. */ +export interface UpdateMonitor { + /** The type of the monitored object. Can be one of the following: `schema` or `table`. */ + objectType?: string | undefined; + /** + * The UUID of the request object. It is `schema_id` for `schema`, and `table_id` for `table`. + * + * Find the `schema_id` from either: + * 1. The [schema_id](https://docs.databricks.com/api/workspace/schemas/get#schema_id) of the `Schemas` resource. + * 2. In [Catalog Explorer](https://docs.databricks.com/aws/en/catalog-explorer/) > select the `schema` > go to the `Details` tab > the `Schema ID` field. + * + * Find the `table_id` from either: + * 1. The [table_id](https://docs.databricks.com/api/workspace/tables/get#table_id) of the `Tables` resource. + * 2. In [Catalog Explorer](https://docs.databricks.com/aws/en/catalog-explorer/) > select the `table` > go to the `Details` tab > the `Table ID` field. + */ + objectId?: string | undefined; + /** Anomaly Detection Configuration, applicable to `schema` object types. */ + anomalyDetectionConfig?: UpdateAnomalyDetectionConfig | undefined; + /** + * Data Profiling Configuration, applicable to `table` object types. Exactly one `Analysis Configuration` + * must be present. + */ + dataProfilingConfig?: UpdateDataProfilingConfig | undefined; +} + /** Request to update a Monitor. */ export interface UpdateMonitorRequest { /** The type of the monitored object. Can be one of the following: `schema` or `table`. */ @@ -509,12 +817,42 @@ export interface UpdateMonitorRequest { */ objectId?: string | undefined; /** The monitor to update. */ - monitor?: Monitor | undefined; + monitor?: UpdateMonitor | undefined; /** * The field mask to specify which fields to update as a comma-separated list. * Example value: `data_profiling_config.custom_metrics,data_profiling_config.schedule.quartz_cron_expression` */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; +} + +/** Destination of the data quality monitoring notification. */ +export interface UpdateNotificationDestination { + /** The list of email addresses to send the notification to. A maximum of 5 email addresses is supported. */ + emailAddresses?: string[] | undefined; +} + +/** Settings for sending notifications on the data quality monitoring. */ +export interface UpdateNotificationSettings { + /** Destinations to send notifications on failure/timeout. */ + onFailure?: UpdateNotificationDestination | undefined; +} + +/** The Refresh object gives information on a refresh of the data quality monitoring pipeline. */ +export interface UpdateRefresh { + /** The type of the monitored object. Can be one of the following: `schema` or `table`. */ + objectType?: string | undefined; + /** + * The UUID of the request object. It is `schema_id` for `schema`, and `table_id` for `table`. + * + * Find the `schema_id` from either: + * 1. The [schema_id](https://docs.databricks.com/api/workspace/schemas/get#schema_id) of the `Schemas` resource. + * 2. In [Catalog Explorer](https://docs.databricks.com/aws/en/catalog-explorer/) > select the `schema` > go to the `Details` tab > the `Schema ID` field. + * + * Find the `table_id` from either: + * 1. The [table_id](https://docs.databricks.com/api/workspace/tables/get#table_id) of the `Tables` resource. + * 2. In [Catalog Explorer](https://docs.databricks.com/aws/en/catalog-explorer/) > select the `table` > go to the `Details` tab > the `Table ID` field. + */ + objectId?: string | undefined; } /** Request to update a refresh. */ @@ -536,9 +874,21 @@ export interface UpdateRefreshRequest { /** Unique id of the refresh operation. */ refreshId?: bigint | undefined; /** The refresh to update. */ - refresh?: Refresh | undefined; + refresh?: UpdateRefresh | undefined; /** The field mask to specify which fields to update. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; +} + +/** Snapshot analysis configuration. */ +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface UpdateSnapshotConfig {} + +/** Time series analysis configuration. */ +export interface UpdateTimeSeriesConfig { + /** Column for the timestamp. */ + timestampColumn?: string | undefined; + /** List of granularities to use when aggregating data into time windows based on their timestamp. */ + granularities?: AggregationGranularity[] | undefined; } export const unmarshalAnomalyDetectionConfigSchema: z.ZodType = @@ -770,7 +1120,19 @@ export const unmarshalTimeSeriesConfigSchema: z.ZodType = z granularities: d.granularities, })); -export const marshalAnomalyDetectionConfigSchema: z.ZodType = z +export const marshalCancelRefreshRequestSchema: z.ZodType = z + .object({ + objectType: z.string().optional(), + objectId: z.string().optional(), + refreshId: z.bigint().optional(), + }) + .transform(d => ({ + object_type: d.objectType, + object_id: d.objectId, + refresh_id: d.refreshId, + })); + +export const marshalCreateAnomalyDetectionConfigSchema: z.ZodType = z .object({ excludedTableFullNames: z.array(z.string()).optional(), }) @@ -778,31 +1140,180 @@ export const marshalAnomalyDetectionConfigSchema: z.ZodType = z excluded_table_full_names: d.excludedTableFullNames, })); -export const marshalCancelRefreshRequestSchema: z.ZodType = z +export const marshalCreateCronScheduleSchema: z.ZodType = z + .object({ + quartzCronExpression: z.string(), + timezoneId: z.string(), + }) + .transform(d => ({ + quartz_cron_expression: d.quartzCronExpression, + timezone_id: d.timezoneId, + })); + +export const marshalCreateDataProfilingConfigSchema: z.ZodType = z + .object({ + outputSchemaId: z.string(), + assetsDir: z.string().optional(), + analysisConfig: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('inferenceLog'), + inferenceLog: z.lazy(() => marshalCreateInferenceLogConfigSchema), + }), + z.object({ + $case: z.literal('timeSeries'), + timeSeries: z.lazy(() => marshalCreateTimeSeriesConfigSchema), + }), + z.object({ + $case: z.literal('snapshot'), + snapshot: z.lazy(() => marshalCreateSnapshotConfigSchema), + }), + ]) + .optional(), + slicingExprs: z.array(z.string()).optional(), + customMetrics: z + .array(z.lazy(() => marshalCreateDataProfilingCustomMetricSchema)) + .optional(), + baselineTableName: z.string().optional(), + schedule: z.lazy(() => marshalCreateCronScheduleSchema).optional(), + notificationSettings: z + .lazy(() => marshalCreateNotificationSettingsSchema) + .optional(), + skipBuiltinDashboard: z.boolean().optional(), + warehouseId: z.string().optional(), + }) + .transform(d => ({ + output_schema_id: d.outputSchemaId, + assets_dir: d.assetsDir, + ...(d.analysisConfig?.$case === 'inferenceLog' && { + inference_log: d.analysisConfig.inferenceLog, + }), + ...(d.analysisConfig?.$case === 'timeSeries' && { + time_series: d.analysisConfig.timeSeries, + }), + ...(d.analysisConfig?.$case === 'snapshot' && { + snapshot: d.analysisConfig.snapshot, + }), + slicing_exprs: d.slicingExprs, + custom_metrics: d.customMetrics, + baseline_table_name: d.baselineTableName, + schedule: d.schedule, + notification_settings: d.notificationSettings, + skip_builtin_dashboard: d.skipBuiltinDashboard, + warehouse_id: d.warehouseId, + })); + +export const marshalCreateDataProfilingCustomMetricSchema: z.ZodType = z + .object({ + name: z.string(), + definition: z.string(), + inputColumns: z.array(z.string()), + outputDataType: z.string(), + type: z.string(), + }) + .transform(d => ({ + name: d.name, + definition: d.definition, + input_columns: d.inputColumns, + output_data_type: d.outputDataType, + type: d.type, + })); + +export const marshalCreateInferenceLogConfigSchema: z.ZodType = z + .object({ + problemType: z.string(), + timestampColumn: z.string(), + granularities: z.array(z.string()), + predictionColumn: z.string(), + labelColumn: z.string().optional(), + modelIdColumn: z.string(), + }) + .transform(d => ({ + problem_type: d.problemType, + timestamp_column: d.timestampColumn, + granularities: d.granularities, + prediction_column: d.predictionColumn, + label_column: d.labelColumn, + model_id_column: d.modelIdColumn, + })); + +export const marshalCreateMonitorSchema: z.ZodType = z + .object({ + objectType: z.string(), + objectId: z.string(), + anomalyDetectionConfig: z + .lazy(() => marshalCreateAnomalyDetectionConfigSchema) + .optional(), + dataProfilingConfig: z + .lazy(() => marshalCreateDataProfilingConfigSchema) + .optional(), + }) + .transform(d => ({ + object_type: d.objectType, + object_id: d.objectId, + anomaly_detection_config: d.anomalyDetectionConfig, + data_profiling_config: d.dataProfilingConfig, + })); + +export const marshalCreateNotificationDestinationSchema: z.ZodType = z + .object({ + emailAddresses: z.array(z.string()).optional(), + }) + .transform(d => ({ + email_addresses: d.emailAddresses, + })); + +export const marshalCreateNotificationSettingsSchema: z.ZodType = z + .object({ + onFailure: z + .lazy(() => marshalCreateNotificationDestinationSchema) + .optional(), + }) + .transform(d => ({ + on_failure: d.onFailure, + })); + +export const marshalCreateRefreshSchema: z.ZodType = z .object({ objectType: z.string().optional(), objectId: z.string().optional(), - refreshId: z.bigint().optional(), }) .transform(d => ({ object_type: d.objectType, object_id: d.objectId, - refresh_id: d.refreshId, })); -export const marshalCronScheduleSchema: z.ZodType = z +export const marshalCreateSnapshotConfigSchema: z.ZodType = z.object({}); + +export const marshalCreateTimeSeriesConfigSchema: z.ZodType = z + .object({ + timestampColumn: z.string(), + granularities: z.array(z.string()), + }) + .transform(d => ({ + timestamp_column: d.timestampColumn, + granularities: d.granularities, + })); + +export const marshalUpdateAnomalyDetectionConfigSchema: z.ZodType = z + .object({ + excludedTableFullNames: z.array(z.string()).optional(), + }) + .transform(d => ({ + excluded_table_full_names: d.excludedTableFullNames, + })); + +export const marshalUpdateCronScheduleSchema: z.ZodType = z .object({ quartzCronExpression: z.string().optional(), timezoneId: z.string().optional(), - pauseStatus: z.string().optional(), }) .transform(d => ({ quartz_cron_expression: d.quartzCronExpression, timezone_id: d.timezoneId, - pause_status: d.pauseStatus, })); -export const marshalDataProfilingConfigSchema: z.ZodType = z +export const marshalUpdateDataProfilingConfigSchema: z.ZodType = z .object({ outputSchemaId: z.string().optional(), assetsDir: z.string().optional(), @@ -810,37 +1321,29 @@ export const marshalDataProfilingConfigSchema: z.ZodType = z .discriminatedUnion('$case', [ z.object({ $case: z.literal('inferenceLog'), - inferenceLog: z.lazy(() => marshalInferenceLogConfigSchema), + inferenceLog: z.lazy(() => marshalUpdateInferenceLogConfigSchema), }), z.object({ $case: z.literal('timeSeries'), - timeSeries: z.lazy(() => marshalTimeSeriesConfigSchema), + timeSeries: z.lazy(() => marshalUpdateTimeSeriesConfigSchema), }), z.object({ $case: z.literal('snapshot'), - snapshot: z.lazy(() => marshalSnapshotConfigSchema), + snapshot: z.lazy(() => marshalUpdateSnapshotConfigSchema), }), ]) .optional(), slicingExprs: z.array(z.string()).optional(), customMetrics: z - .array(z.lazy(() => marshalDataProfilingCustomMetricSchema)) + .array(z.lazy(() => marshalUpdateDataProfilingCustomMetricSchema)) .optional(), baselineTableName: z.string().optional(), - schedule: z.lazy(() => marshalCronScheduleSchema).optional(), + schedule: z.lazy(() => marshalUpdateCronScheduleSchema).optional(), notificationSettings: z - .lazy(() => marshalNotificationSettingsSchema) + .lazy(() => marshalUpdateNotificationSettingsSchema) .optional(), skipBuiltinDashboard: z.boolean().optional(), warehouseId: z.string().optional(), - monitoredTableName: z.string().optional(), - status: z.string().optional(), - latestMonitorFailureMessage: z.string().optional(), - profileMetricsTableName: z.string().optional(), - driftMetricsTableName: z.string().optional(), - dashboardId: z.string().optional(), - monitorVersion: z.bigint().optional(), - effectiveWarehouseId: z.string().optional(), }) .transform(d => ({ output_schema_id: d.outputSchemaId, @@ -861,17 +1364,9 @@ export const marshalDataProfilingConfigSchema: z.ZodType = z notification_settings: d.notificationSettings, skip_builtin_dashboard: d.skipBuiltinDashboard, warehouse_id: d.warehouseId, - monitored_table_name: d.monitoredTableName, - status: d.status, - latest_monitor_failure_message: d.latestMonitorFailureMessage, - profile_metrics_table_name: d.profileMetricsTableName, - drift_metrics_table_name: d.driftMetricsTableName, - dashboard_id: d.dashboardId, - monitor_version: d.monitorVersion, - effective_warehouse_id: d.effectiveWarehouseId, })); -export const marshalDataProfilingCustomMetricSchema: z.ZodType = z +export const marshalUpdateDataProfilingCustomMetricSchema: z.ZodType = z .object({ name: z.string().optional(), definition: z.string().optional(), @@ -887,7 +1382,7 @@ export const marshalDataProfilingCustomMetricSchema: z.ZodType = z type: d.type, })); -export const marshalInferenceLogConfigSchema: z.ZodType = z +export const marshalUpdateInferenceLogConfigSchema: z.ZodType = z .object({ problemType: z.string().optional(), timestampColumn: z.string().optional(), @@ -905,15 +1400,15 @@ export const marshalInferenceLogConfigSchema: z.ZodType = z model_id_column: d.modelIdColumn, })); -export const marshalMonitorSchema: z.ZodType = z +export const marshalUpdateMonitorSchema: z.ZodType = z .object({ objectType: z.string().optional(), objectId: z.string().optional(), anomalyDetectionConfig: z - .lazy(() => marshalAnomalyDetectionConfigSchema) + .lazy(() => marshalUpdateAnomalyDetectionConfigSchema) .optional(), dataProfilingConfig: z - .lazy(() => marshalDataProfilingConfigSchema) + .lazy(() => marshalUpdateDataProfilingConfigSchema) .optional(), }) .transform(d => ({ @@ -923,7 +1418,7 @@ export const marshalMonitorSchema: z.ZodType = z data_profiling_config: d.dataProfilingConfig, })); -export const marshalNotificationDestinationSchema: z.ZodType = z +export const marshalUpdateNotificationDestinationSchema: z.ZodType = z .object({ emailAddresses: z.array(z.string()).optional(), }) @@ -931,39 +1426,29 @@ export const marshalNotificationDestinationSchema: z.ZodType = z email_addresses: d.emailAddresses, })); -export const marshalNotificationSettingsSchema: z.ZodType = z +export const marshalUpdateNotificationSettingsSchema: z.ZodType = z .object({ - onFailure: z.lazy(() => marshalNotificationDestinationSchema).optional(), + onFailure: z + .lazy(() => marshalUpdateNotificationDestinationSchema) + .optional(), }) .transform(d => ({ on_failure: d.onFailure, })); -export const marshalRefreshSchema: z.ZodType = z +export const marshalUpdateRefreshSchema: z.ZodType = z .object({ objectType: z.string().optional(), objectId: z.string().optional(), - refreshId: z.bigint().optional(), - state: z.string().optional(), - message: z.string().optional(), - startTimeMs: z.bigint().optional(), - endTimeMs: z.bigint().optional(), - trigger: z.string().optional(), }) .transform(d => ({ object_type: d.objectType, object_id: d.objectId, - refresh_id: d.refreshId, - state: d.state, - message: d.message, - start_time_ms: d.startTimeMs, - end_time_ms: d.endTimeMs, - trigger: d.trigger, })); -export const marshalSnapshotConfigSchema: z.ZodType = z.object({}); +export const marshalUpdateSnapshotConfigSchema: z.ZodType = z.object({}); -export const marshalTimeSeriesConfigSchema: z.ZodType = z +export const marshalUpdateTimeSeriesConfigSchema: z.ZodType = z .object({ timestampColumn: z.string().optional(), granularities: z.array(z.string()).optional(), @@ -973,49 +1458,46 @@ export const marshalTimeSeriesConfigSchema: z.ZodType = z granularities: d.granularities, })); -const anomalyDetectionConfigFieldMaskSchema: FieldMaskSchema = { +const updateAnomalyDetectionConfigFieldMaskSchema: FieldMaskSchema = { excludedTableFullNames: {wire: 'excluded_table_full_names'}, }; -const cronScheduleFieldMaskSchema: FieldMaskSchema = { - pauseStatus: {wire: 'pause_status'}, +const updateCronScheduleFieldMaskSchema: FieldMaskSchema = { quartzCronExpression: {wire: 'quartz_cron_expression'}, timezoneId: {wire: 'timezone_id'}, }; -const dataProfilingConfigFieldMaskSchema: FieldMaskSchema = { +const updateDataProfilingConfigFieldMaskSchema: FieldMaskSchema = { assetsDir: {wire: 'assets_dir'}, baselineTableName: {wire: 'baseline_table_name'}, customMetrics: {wire: 'custom_metrics'}, - dashboardId: {wire: 'dashboard_id'}, - driftMetricsTableName: {wire: 'drift_metrics_table_name'}, - effectiveWarehouseId: {wire: 'effective_warehouse_id'}, inferenceLog: { wire: 'inference_log', - children: () => inferenceLogConfigFieldMaskSchema, + children: () => updateInferenceLogConfigFieldMaskSchema, }, - latestMonitorFailureMessage: {wire: 'latest_monitor_failure_message'}, - monitorVersion: {wire: 'monitor_version'}, - monitoredTableName: {wire: 'monitored_table_name'}, notificationSettings: { wire: 'notification_settings', - children: () => notificationSettingsFieldMaskSchema, + children: () => updateNotificationSettingsFieldMaskSchema, }, outputSchemaId: {wire: 'output_schema_id'}, - profileMetricsTableName: {wire: 'profile_metrics_table_name'}, - schedule: {wire: 'schedule', children: () => cronScheduleFieldMaskSchema}, + schedule: { + wire: 'schedule', + children: () => updateCronScheduleFieldMaskSchema, + }, skipBuiltinDashboard: {wire: 'skip_builtin_dashboard'}, slicingExprs: {wire: 'slicing_exprs'}, - snapshot: {wire: 'snapshot', children: () => snapshotConfigFieldMaskSchema}, - status: {wire: 'status'}, + snapshot: { + wire: 'snapshot', + children: () => updateSnapshotConfigFieldMaskSchema, + }, timeSeries: { wire: 'time_series', - children: () => timeSeriesConfigFieldMaskSchema, + children: () => updateTimeSeriesConfigFieldMaskSchema, }, warehouseId: {wire: 'warehouse_id'}, }; -const inferenceLogConfigFieldMaskSchema: FieldMaskSchema = { +const updateInferenceLogConfigFieldMaskSchema: FieldMaskSchema = { granularities: {wire: 'granularities'}, labelColumn: {wire: 'label_column'}, modelIdColumn: {wire: 'model_id_column'}, @@ -1024,52 +1506,50 @@ const inferenceLogConfigFieldMaskSchema: FieldMaskSchema = { timestampColumn: {wire: 'timestamp_column'}, }; -const monitorFieldMaskSchema: FieldMaskSchema = { +const updateMonitorFieldMaskSchema: FieldMaskSchema = { anomalyDetectionConfig: { wire: 'anomaly_detection_config', - children: () => anomalyDetectionConfigFieldMaskSchema, + children: () => updateAnomalyDetectionConfigFieldMaskSchema, }, dataProfilingConfig: { wire: 'data_profiling_config', - children: () => dataProfilingConfigFieldMaskSchema, + children: () => updateDataProfilingConfigFieldMaskSchema, }, objectId: {wire: 'object_id'}, objectType: {wire: 'object_type'}, }; -export function monitorFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, monitorFieldMaskSchema); +export function updateMonitorFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, updateMonitorFieldMaskSchema); } -const notificationDestinationFieldMaskSchema: FieldMaskSchema = { +const updateNotificationDestinationFieldMaskSchema: FieldMaskSchema = { emailAddresses: {wire: 'email_addresses'}, }; -const notificationSettingsFieldMaskSchema: FieldMaskSchema = { +const updateNotificationSettingsFieldMaskSchema: FieldMaskSchema = { onFailure: { wire: 'on_failure', - children: () => notificationDestinationFieldMaskSchema, + children: () => updateNotificationDestinationFieldMaskSchema, }, }; -const refreshFieldMaskSchema: FieldMaskSchema = { - endTimeMs: {wire: 'end_time_ms'}, - message: {wire: 'message'}, +const updateRefreshFieldMaskSchema: FieldMaskSchema = { objectId: {wire: 'object_id'}, objectType: {wire: 'object_type'}, - refreshId: {wire: 'refresh_id'}, - startTimeMs: {wire: 'start_time_ms'}, - state: {wire: 'state'}, - trigger: {wire: 'trigger'}, }; -export function refreshFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, refreshFieldMaskSchema); +export function updateRefreshFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, updateRefreshFieldMaskSchema); } -const snapshotConfigFieldMaskSchema: FieldMaskSchema = {}; +const updateSnapshotConfigFieldMaskSchema: FieldMaskSchema = {}; -const timeSeriesConfigFieldMaskSchema: FieldMaskSchema = { +const updateTimeSeriesConfigFieldMaskSchema: FieldMaskSchema = { granularities: {wire: 'granularities'}, timestampColumn: {wire: 'timestamp_column'}, }; diff --git a/packages/disasterrecovery/src/v1/client.ts b/packages/disasterrecovery/src/v1/client.ts index ab8458cd..bf1be939 100755 --- a/packages/disasterrecovery/src/v1/client.ts +++ b/packages/disasterrecovery/src/v1/client.ts @@ -33,9 +33,10 @@ import type { UpdateFailoverGroupRequest, } from './model'; import { + marshalCreateFailoverGroupSchema, + marshalCreateStableUrlSchema, marshalFailoverFailoverGroupRequestSchema, - marshalFailoverGroupSchema, - marshalStableUrlSchema, + marshalUpdateFailoverGroupSchema, unmarshalFailoverGroupSchema, unmarshalListFailoverGroupsResponseSchema, unmarshalListStableUrlsResponseSchema, @@ -91,7 +92,10 @@ export class DisasterRecoveryClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.failoverGroup, marshalFailoverGroupSchema); + const body = marshalRequest( + req.failoverGroup, + marshalCreateFailoverGroupSchema + ); let resp: FailoverGroup | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -136,7 +140,7 @@ export class DisasterRecoveryClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.stableUrl, marshalStableUrlSchema); + const body = marshalRequest(req.stableUrl, marshalCreateStableUrlSchema); let resp: StableUrl | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -436,7 +440,10 @@ export class DisasterRecoveryClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.failoverGroup, marshalFailoverGroupSchema); + const body = marshalRequest( + req.failoverGroup, + marshalUpdateFailoverGroupSchema + ); let resp: FailoverGroup | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/disasterrecovery/src/v1/index.ts b/packages/disasterrecovery/src/v1/index.ts index 484477cb..648286ad 100755 --- a/packages/disasterrecovery/src/v1/index.ts +++ b/packages/disasterrecovery/src/v1/index.ts @@ -12,8 +12,15 @@ export { } from './model'; export type { + CreateFailoverGroup, CreateFailoverGroupRequest, + CreateLocationMapping, + CreateLocationMappingEntry, + CreateStableUrl, CreateStableUrlRequest, + CreateUcCatalog, + CreateUcReplicationConfig, + CreateWorkspaceSet, DeleteFailoverGroupRequest, DeleteStableUrlRequest, FailoverFailoverGroupRequest, @@ -29,8 +36,14 @@ export type { StableUrl, UcCatalog, UcReplicationConfig, + UpdateFailoverGroup, UpdateFailoverGroupRequest, + UpdateLocationMapping, + UpdateLocationMappingEntry, + UpdateUcCatalog, + UpdateUcReplicationConfig, + UpdateWorkspaceSet, WorkspaceSet, } from './model'; -export {failoverGroupFieldMask} from './model'; +export {updateFailoverGroupFieldMask} from './model'; diff --git a/packages/disasterrecovery/src/v1/model.ts b/packages/disasterrecovery/src/v1/model.ts index d93f85dd..4225672b 100755 --- a/packages/disasterrecovery/src/v1/model.ts +++ b/packages/disasterrecovery/src/v1/model.ts @@ -42,12 +42,35 @@ export type FailoverGroup_State = | (typeof FailoverGroup_State)[keyof typeof FailoverGroup_State] | (string & {}); +/** + * A failover group manages disaster recovery across workspace sets, + * coordinating Unity Catalog and workspace assets replication. + */ +export interface CreateFailoverGroup { + /** + * Fully qualified resource name in the format + * accounts/{account_id}/failover-groups/{failover_group_id}. + */ + name?: string | undefined; + /** List of all regions participating in this failover group. */ + regions: string[]; + /** Workspace sets, each containing workspaces that replicate to each other. */ + workspaceSets: CreateWorkspaceSet[]; + /** Unity Catalog replication configuration. */ + unityCatalogAssets?: CreateUcReplicationConfig | undefined; + /** + * Initial primary region. Used only in Create requests to set the starting + * primary region. Not returned in responses. + */ + initialPrimaryRegion: string; +} + /** Request to create a new failover group. */ export interface CreateFailoverGroupRequest { /** The parent resource. Format: accounts/{account_id}. */ parent?: string | undefined; /** The failover group to create. */ - failoverGroup?: FailoverGroup | undefined; + failoverGroup?: CreateFailoverGroup | undefined; /** When true, validates the request without creating the failover group. */ validateOnly?: boolean | undefined; /** @@ -57,12 +80,52 @@ export interface CreateFailoverGroupRequest { failoverGroupId?: string | undefined; } +/** + * A location mapping identified by a name, with URIs per region. + * The system derives replication direction from effective_primary_region. + */ +export interface CreateLocationMapping { + /** Resource name for this location. */ + name: string; + /** URI for each region. Each entry maps a region name to a storage URI. */ + uriByRegion: CreateLocationMappingEntry[]; +} + +/** + * A single entry in a location mapping, mapping a region to a storage URI. + * Used instead of map for proto2 compatibility. + */ +export interface CreateLocationMappingEntry { + /** The region name. */ + region: string; + /** The storage URI for this region. */ + uri: string; +} + +/** + * A stable URL provides a failover-aware endpoint for accessing a workspace. + * Its lifecycle is independent of any failover group. + */ +export interface CreateStableUrl { + /** + * Fully qualified resource name. + * Format: accounts/{account_id}/stable-urls/{stable_url_id}. + */ + name?: string | undefined; + /** + * The workspace this stable URL is initially bound to. Used only in Create + * requests to associate the stable URL with a workspace. Not returned in + * responses. + */ + initialWorkspaceId: string; +} + /** Request to create a new stable URL for failover-aware workspace access. */ export interface CreateStableUrlRequest { /** The parent resource. Format: accounts/{account_id}. */ parent?: string | undefined; /** The stable URL to create. */ - stableUrl?: StableUrl | undefined; + stableUrl?: CreateStableUrl | undefined; /** When true, validates the request without creating the stable URL. */ validateOnly?: boolean | undefined; /** @@ -72,6 +135,47 @@ export interface CreateStableUrlRequest { stableUrlId?: string | undefined; } +/** A Unity Catalog catalog to replicate. */ +export interface CreateUcCatalog { + /** The name of the UC catalog to replicate. */ + name: string; +} + +/** Unity Catalog replication configuration (top-level, not per-set). */ +export interface CreateUcReplicationConfig { + /** Location mappings - storage URI per region for each location. */ + locationMappings?: CreateLocationMapping[] | undefined; + /** UC catalogs to replicate. */ + catalogs: CreateUcCatalog[]; + /** + * The workspace set whose workspaces will be used for data replication + * of all UC catalogs' underlying storage. + */ + dataReplicationWorkspaceSet: string; +} + +/** A set of workspaces that replicate to each other across regions. */ +export interface CreateWorkspaceSet { + /** Resource name for this workspace set. */ + name: string; + /** + * Workspace IDs in this set. The system derives and validates regions. + * All workspaces must be in the Mission Critical tier. + */ + workspaceIds: string[]; + /** + * Whether to enable control plane DR (notebooks, jobs, clusters, etc.) for this set. + * Defaults to false. + */ + replicateWorkspaceAssets?: boolean | undefined; + /** + * Resource names of stable URLs associated with this workspace set. + * Format: accounts/{account_id}/stable-urls/{stable_url_id}. + * The referenced stable URLs must already exist (via CreateStableUrl). + */ + stableUrlNames?: string[] | undefined; +} + /** Request to delete a failover group. */ export interface DeleteFailoverGroupRequest { /** @@ -147,11 +251,6 @@ export interface FailoverGroup { updateTime?: Temporal.Instant | undefined; /** The latest point in time to which data has been replicated. */ replicationPoint?: Temporal.Instant | undefined; - /** - * Initial primary region. Used only in Create requests to set the starting - * primary region. Not returned in responses. - */ - initialPrimaryRegion?: string | undefined; } /** Request to get a failover group. */ @@ -273,12 +372,6 @@ export interface StableUrl { * this is the per-connection hostname. */ url?: string | undefined; - /** - * The workspace this stable URL is initially bound to. Used only in Create - * requests to associate the stable URL with a workspace. Not returned in - * responses. - */ - initialWorkspaceId?: string | undefined; /** * Fully qualified resource name of the FailoverGroup this stable URL is * currently linked to, in the format @@ -307,15 +400,38 @@ export interface UcReplicationConfig { dataReplicationWorkspaceSet?: string | undefined; } +/** + * A failover group manages disaster recovery across workspace sets, + * coordinating Unity Catalog and workspace assets replication. + */ +export interface UpdateFailoverGroup { + /** + * Fully qualified resource name in the format + * accounts/{account_id}/failover-groups/{failover_group_id}. + */ + name?: string | undefined; + /** List of all regions participating in this failover group. */ + regions?: string[] | undefined; + /** Workspace sets, each containing workspaces that replicate to each other. */ + workspaceSets?: UpdateWorkspaceSet[] | undefined; + /** Unity Catalog replication configuration. */ + unityCatalogAssets?: UpdateUcReplicationConfig | undefined; + /** + * Initial primary region. Used only in Create requests to set the starting + * primary region. Not returned in responses. + */ + initialPrimaryRegion?: string | undefined; +} + /** Request to update a failover group. */ export interface UpdateFailoverGroupRequest { /** * The failover group with updated fields. The name field identifies the resource * and is populated from the URL path. */ - failoverGroup?: FailoverGroup | undefined; + failoverGroup?: UpdateFailoverGroup | undefined; /** Comma-separated list of fields to update. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; /** * Optional opaque version string for optimistic locking, obtained from a prior read of * the failover group. If provided, the update is rejected unless it matches the failover @@ -324,6 +440,69 @@ export interface UpdateFailoverGroupRequest { etag?: string | undefined; } +/** + * A location mapping identified by a name, with URIs per region. + * The system derives replication direction from effective_primary_region. + */ +export interface UpdateLocationMapping { + /** Resource name for this location. */ + name?: string | undefined; + /** URI for each region. Each entry maps a region name to a storage URI. */ + uriByRegion?: UpdateLocationMappingEntry[] | undefined; +} + +/** + * A single entry in a location mapping, mapping a region to a storage URI. + * Used instead of map for proto2 compatibility. + */ +export interface UpdateLocationMappingEntry { + /** The region name. */ + region?: string | undefined; + /** The storage URI for this region. */ + uri?: string | undefined; +} + +/** A Unity Catalog catalog to replicate. */ +export interface UpdateUcCatalog { + /** The name of the UC catalog to replicate. */ + name?: string | undefined; +} + +/** Unity Catalog replication configuration (top-level, not per-set). */ +export interface UpdateUcReplicationConfig { + /** Location mappings - storage URI per region for each location. */ + locationMappings?: UpdateLocationMapping[] | undefined; + /** UC catalogs to replicate. */ + catalogs?: UpdateUcCatalog[] | undefined; + /** + * The workspace set whose workspaces will be used for data replication + * of all UC catalogs' underlying storage. + */ + dataReplicationWorkspaceSet?: string | undefined; +} + +/** A set of workspaces that replicate to each other across regions. */ +export interface UpdateWorkspaceSet { + /** Resource name for this workspace set. */ + name?: string | undefined; + /** + * Workspace IDs in this set. The system derives and validates regions. + * All workspaces must be in the Mission Critical tier. + */ + workspaceIds?: string[] | undefined; + /** + * Whether to enable control plane DR (notebooks, jobs, clusters, etc.) for this set. + * Defaults to false. + */ + replicateWorkspaceAssets?: boolean | undefined; + /** + * Resource names of stable URLs associated with this workspace set. + * Format: accounts/{account_id}/stable-urls/{stable_url_id}. + * The referenced stable URLs must already exist (via CreateStableUrl). + */ + stableUrlNames?: string[] | undefined; +} + /** A set of workspaces that replicate to each other across regions. */ export interface WorkspaceSet { /** Resource name for this workspace set. */ @@ -371,7 +550,6 @@ export const unmarshalFailoverGroupSchema: z.ZodType = z .string() .transform(s => Temporal.Instant.from(s)) .optional(), - initial_primary_region: z.string().optional(), }) .transform(d => ({ name: d.name, @@ -384,7 +562,6 @@ export const unmarshalFailoverGroupSchema: z.ZodType = z createTime: d.create_time, updateTime: d.update_time, replicationPoint: d.replication_point, - initialPrimaryRegion: d.initial_primary_region, })); export const unmarshalListFailoverGroupsResponseSchema: z.ZodType = @@ -438,13 +615,11 @@ export const unmarshalStableUrlSchema: z.ZodType = z .object({ name: z.string().optional(), url: z.string().optional(), - initial_workspace_id: z.string().optional(), failover_group_name: z.string().optional(), }) .transform(d => ({ name: d.name, url: d.url, - initialWorkspaceId: d.initial_workspace_id, failoverGroupName: d.failover_group_name, })); @@ -485,6 +660,90 @@ export const unmarshalWorkspaceSetSchema: z.ZodType = z stableUrlNames: d.stable_url_names, })); +export const marshalCreateFailoverGroupSchema: z.ZodType = z + .object({ + name: z.string().optional(), + regions: z.array(z.string()), + workspaceSets: z.array(z.lazy(() => marshalCreateWorkspaceSetSchema)), + unityCatalogAssets: z + .lazy(() => marshalCreateUcReplicationConfigSchema) + .optional(), + initialPrimaryRegion: z.string(), + }) + .transform(d => ({ + name: d.name, + regions: d.regions, + workspace_sets: d.workspaceSets, + unity_catalog_assets: d.unityCatalogAssets, + initial_primary_region: d.initialPrimaryRegion, + })); + +export const marshalCreateLocationMappingSchema: z.ZodType = z + .object({ + name: z.string(), + uriByRegion: z.array(z.lazy(() => marshalCreateLocationMappingEntrySchema)), + }) + .transform(d => ({ + name: d.name, + uri_by_region: d.uriByRegion, + })); + +export const marshalCreateLocationMappingEntrySchema: z.ZodType = z + .object({ + region: z.string(), + uri: z.string(), + }) + .transform(d => ({ + region: d.region, + uri: d.uri, + })); + +export const marshalCreateStableUrlSchema: z.ZodType = z + .object({ + name: z.string().optional(), + initialWorkspaceId: z.string(), + }) + .transform(d => ({ + name: d.name, + initial_workspace_id: d.initialWorkspaceId, + })); + +export const marshalCreateUcCatalogSchema: z.ZodType = z + .object({ + name: z.string(), + }) + .transform(d => ({ + name: d.name, + })); + +export const marshalCreateUcReplicationConfigSchema: z.ZodType = z + .object({ + locationMappings: z + .array(z.lazy(() => marshalCreateLocationMappingSchema)) + .optional(), + catalogs: z.array(z.lazy(() => marshalCreateUcCatalogSchema)), + dataReplicationWorkspaceSet: z.string(), + }) + .transform(d => ({ + location_mappings: d.locationMappings, + catalogs: d.catalogs, + data_replication_workspace_set: d.dataReplicationWorkspaceSet, + })); + +export const marshalCreateWorkspaceSetSchema: z.ZodType = z + .object({ + name: z.string(), + workspaceIds: z.array(z.string()), + replicateWorkspaceAssets: z.boolean().optional(), + stableUrlNames: z.array(z.string()).optional(), + }) + .transform(d => ({ + name: d.name, + workspace_ids: d.workspaceIds, + replicate_workspace_assets: d.replicateWorkspaceAssets, + stable_url_names: d.stableUrlNames, + })); + export const marshalFailoverFailoverGroupRequestSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -499,50 +758,31 @@ export const marshalFailoverFailoverGroupRequestSchema: z.ZodType = z failover_type: d.failoverType, })); -export const marshalFailoverGroupSchema: z.ZodType = z +export const marshalUpdateFailoverGroupSchema: z.ZodType = z .object({ name: z.string().optional(), - effectivePrimaryRegion: z.string().optional(), regions: z.array(z.string()).optional(), - workspaceSets: z.array(z.lazy(() => marshalWorkspaceSetSchema)).optional(), - unityCatalogAssets: z - .lazy(() => marshalUcReplicationConfigSchema) - .optional(), - state: z.string().optional(), - etag: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + workspaceSets: z + .array(z.lazy(() => marshalUpdateWorkspaceSetSchema)) .optional(), - replicationPoint: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + unityCatalogAssets: z + .lazy(() => marshalUpdateUcReplicationConfigSchema) .optional(), initialPrimaryRegion: z.string().optional(), }) .transform(d => ({ name: d.name, - effective_primary_region: d.effectivePrimaryRegion, regions: d.regions, workspace_sets: d.workspaceSets, unity_catalog_assets: d.unityCatalogAssets, - state: d.state, - etag: d.etag, - create_time: d.createTime, - update_time: d.updateTime, - replication_point: d.replicationPoint, initial_primary_region: d.initialPrimaryRegion, })); -export const marshalLocationMappingSchema: z.ZodType = z +export const marshalUpdateLocationMappingSchema: z.ZodType = z .object({ name: z.string().optional(), uriByRegion: z - .array(z.lazy(() => marshalLocationMappingEntrySchema)) + .array(z.lazy(() => marshalUpdateLocationMappingEntrySchema)) .optional(), }) .transform(d => ({ @@ -550,7 +790,7 @@ export const marshalLocationMappingSchema: z.ZodType = z uri_by_region: d.uriByRegion, })); -export const marshalLocationMappingEntrySchema: z.ZodType = z +export const marshalUpdateLocationMappingEntrySchema: z.ZodType = z .object({ region: z.string().optional(), uri: z.string().optional(), @@ -560,21 +800,7 @@ export const marshalLocationMappingEntrySchema: z.ZodType = z uri: d.uri, })); -export const marshalStableUrlSchema: z.ZodType = z - .object({ - name: z.string().optional(), - url: z.string().optional(), - initialWorkspaceId: z.string().optional(), - failoverGroupName: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - url: d.url, - initial_workspace_id: d.initialWorkspaceId, - failover_group_name: d.failoverGroupName, - })); - -export const marshalUcCatalogSchema: z.ZodType = z +export const marshalUpdateUcCatalogSchema: z.ZodType = z .object({ name: z.string().optional(), }) @@ -582,12 +808,12 @@ export const marshalUcCatalogSchema: z.ZodType = z name: d.name, })); -export const marshalUcReplicationConfigSchema: z.ZodType = z +export const marshalUpdateUcReplicationConfigSchema: z.ZodType = z .object({ locationMappings: z - .array(z.lazy(() => marshalLocationMappingSchema)) + .array(z.lazy(() => marshalUpdateLocationMappingSchema)) .optional(), - catalogs: z.array(z.lazy(() => marshalUcCatalogSchema)).optional(), + catalogs: z.array(z.lazy(() => marshalUpdateUcCatalogSchema)).optional(), dataReplicationWorkspaceSet: z.string().optional(), }) .transform(d => ({ @@ -596,7 +822,7 @@ export const marshalUcReplicationConfigSchema: z.ZodType = z data_replication_workspace_set: d.dataReplicationWorkspaceSet, })); -export const marshalWorkspaceSetSchema: z.ZodType = z +export const marshalUpdateWorkspaceSetSchema: z.ZodType = z .object({ name: z.string().optional(), workspaceIds: z.array(z.string()).optional(), @@ -610,30 +836,27 @@ export const marshalWorkspaceSetSchema: z.ZodType = z stable_url_names: d.stableUrlNames, })); -const failoverGroupFieldMaskSchema: FieldMaskSchema = { - createTime: {wire: 'create_time'}, - effectivePrimaryRegion: {wire: 'effective_primary_region'}, - etag: {wire: 'etag'}, +const updateFailoverGroupFieldMaskSchema: FieldMaskSchema = { initialPrimaryRegion: {wire: 'initial_primary_region'}, name: {wire: 'name'}, regions: {wire: 'regions'}, - replicationPoint: {wire: 'replication_point'}, - state: {wire: 'state'}, unityCatalogAssets: { wire: 'unity_catalog_assets', - children: () => ucReplicationConfigFieldMaskSchema, + children: () => updateUcReplicationConfigFieldMaskSchema, }, - updateTime: {wire: 'update_time'}, workspaceSets: {wire: 'workspace_sets'}, }; -export function failoverGroupFieldMask( +export function updateFailoverGroupFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build(paths, failoverGroupFieldMaskSchema); +): FieldMask { + return FieldMask.build( + paths, + updateFailoverGroupFieldMaskSchema + ); } -const ucReplicationConfigFieldMaskSchema: FieldMaskSchema = { +const updateUcReplicationConfigFieldMaskSchema: FieldMaskSchema = { catalogs: {wire: 'catalogs'}, dataReplicationWorkspaceSet: {wire: 'data_replication_workspace_set'}, locationMappings: {wire: 'location_mappings'}, diff --git a/packages/environments/src/v1/client.ts b/packages/environments/src/v1/client.ts index dd0cf476..6ba2f6da 100644 --- a/packages/environments/src/v1/client.ts +++ b/packages/environments/src/v1/client.ts @@ -37,9 +37,9 @@ import type { WorkspaceBaseEnvironmentOperationMetadata, } from './model'; import { - marshalDefaultWorkspaceBaseEnvironmentSchema, + marshalCreateWorkspaceBaseEnvironmentSchema, marshalRefreshWorkspaceBaseEnvironmentRequestSchema, - marshalWorkspaceBaseEnvironmentSchema, + marshalUpdateDefaultWorkspaceBaseEnvironmentSchema, unmarshalDefaultWorkspaceBaseEnvironmentSchema, unmarshalListWorkspaceBaseEnvironmentsResponseSchema, unmarshalOperationSchema, @@ -106,7 +106,7 @@ export class EnvironmentsClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.workspaceBaseEnvironment, - marshalWorkspaceBaseEnvironmentSchema + marshalCreateWorkspaceBaseEnvironmentSchema ); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -420,7 +420,7 @@ export class EnvironmentsClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.defaultWorkspaceBaseEnvironment, - marshalDefaultWorkspaceBaseEnvironmentSchema + marshalUpdateDefaultWorkspaceBaseEnvironmentSchema ); let resp: DefaultWorkspaceBaseEnvironment | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -467,7 +467,7 @@ export class EnvironmentsClient { const url = `${host}/api/environments/v1/${req.name ?? ''}`; const body = marshalRequest( req.workspaceBaseEnvironment, - marshalWorkspaceBaseEnvironmentSchema + marshalCreateWorkspaceBaseEnvironmentSchema ); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { diff --git a/packages/environments/src/v1/index.ts b/packages/environments/src/v1/index.ts index 11ed1768..d9539439 100755 --- a/packages/environments/src/v1/index.ts +++ b/packages/environments/src/v1/index.ts @@ -19,6 +19,7 @@ export { export type { ApiError, + CreateWorkspaceBaseEnvironment, CreateWorkspaceBaseEnvironmentRequest, DefaultWorkspaceBaseEnvironment, DeleteWorkspaceBaseEnvironmentRequest, @@ -30,6 +31,7 @@ export type { ListWorkspaceBaseEnvironmentsResponse, Operation, RefreshWorkspaceBaseEnvironmentRequest, + UpdateDefaultWorkspaceBaseEnvironment, UpdateDefaultWorkspaceBaseEnvironmentRequest, UpdateWorkspaceBaseEnvironmentRequest, WorkspaceBaseEnvironment, @@ -37,4 +39,4 @@ export type { WorkspaceBaseEnvironmentOperationMetadata, } from './model'; -export {defaultWorkspaceBaseEnvironmentFieldMask} from './model'; +export {updateDefaultWorkspaceBaseEnvironmentFieldMask} from './model'; diff --git a/packages/environments/src/v1/model.ts b/packages/environments/src/v1/model.ts index 0a9b14c6..5e1a9cdc 100755 --- a/packages/environments/src/v1/model.ts +++ b/packages/environments/src/v1/model.ts @@ -552,10 +552,28 @@ export interface ApiError { details?: Record[] | undefined; } +/** + * A WorkspaceBaseEnvironment defines a workspace-level environment configuration + * consisting of an environment version and a list of dependencies. + */ +export interface CreateWorkspaceBaseEnvironment { + /** + * The resource name of the workspace base environment. + * Format: workspace-base-environments/{workspace-base-environment} + */ + name?: string | undefined; + /** Human-readable display name for the workspace base environment. */ + displayName: string; + /** The WSFS or UC Volumes path to the environment YAML file. */ + filepath?: string | undefined; + /** The type of base environment (CPU or GPU). */ + baseEnvironmentType?: BaseEnvironmentType | undefined; +} + /** Request message for CreateWorkspaceBaseEnvironment. */ export interface CreateWorkspaceBaseEnvironmentRequest { /** Required. The workspace base environment to create. */ - workspaceBaseEnvironment?: WorkspaceBaseEnvironment | undefined; + workspaceBaseEnvironment?: CreateWorkspaceBaseEnvironment | undefined; /** * The ID to use for the workspace base environment, which will become the final component of * the resource name. @@ -718,10 +736,35 @@ export interface RefreshWorkspaceBaseEnvironmentRequest { name?: string | undefined; } +/** + * A singleton resource representing the default workspace base environment configuration. + * This resource contains the workspace base environments that are used as defaults + * for serverless notebooks and jobs in the workspace, for both CPU and GPU compute types. + */ +export interface UpdateDefaultWorkspaceBaseEnvironment { + /** + * The resource name of this singleton resource. + * Format: default-workspace-base-environment + */ + name?: string | undefined; + /** + * The default workspace base environment for CPU compute. + * Format: workspace-base-environments/{workspace_base_environment} + */ + cpuWorkspaceBaseEnvironment?: string | undefined; + /** + * The default workspace base environment for GPU compute. + * Format: workspace-base-environments/{workspace_base_environment} + */ + gpuWorkspaceBaseEnvironment?: string | undefined; +} + /** Request message for UpdateDefaultWorkspaceBaseEnvironment. */ export interface UpdateDefaultWorkspaceBaseEnvironmentRequest { /** Required. The default workspace base environment configuration to update. */ - defaultWorkspaceBaseEnvironment?: DefaultWorkspaceBaseEnvironment | undefined; + defaultWorkspaceBaseEnvironment?: + | UpdateDefaultWorkspaceBaseEnvironment + | undefined; /** * Field mask specifying which fields to update. Use comma as the separator for multiple fields (no space). * The special value '*' indicates that all fields should be updated (full replacement). @@ -730,7 +773,7 @@ export interface UpdateDefaultWorkspaceBaseEnvironmentRequest { * To unset one or both defaults, include the field path(s) in the mask and omit them from the request body. * To unset both, you must list both paths explicitly — the wildcard '*' cannot be used to unset fields. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; } /** Request message for UpdateWorkspaceBaseEnvironment. */ @@ -740,7 +783,7 @@ export interface UpdateWorkspaceBaseEnvironmentRequest { * Required. The workspace base environment with updated fields. * The name field is used to identify the environment to update. */ - workspaceBaseEnvironment?: WorkspaceBaseEnvironment | undefined; + workspaceBaseEnvironment?: CreateWorkspaceBaseEnvironment | undefined; } /** @@ -898,26 +941,18 @@ export const unmarshalWorkspaceBaseEnvironmentSchema: z.ZodType = z.object({}); -export const marshalDefaultWorkspaceBaseEnvironmentSchema: z.ZodType = z +export const marshalCreateWorkspaceBaseEnvironmentSchema: z.ZodType = z .object({ name: z.string().optional(), - cpuWorkspaceBaseEnvironment: z.string().optional(), - gpuWorkspaceBaseEnvironment: z.string().optional(), + displayName: z.string(), + filepath: z.string().optional(), + baseEnvironmentType: z.string().optional(), }) .transform(d => ({ name: d.name, - cpu_workspace_base_environment: d.cpuWorkspaceBaseEnvironment, - gpu_workspace_base_environment: d.gpuWorkspaceBaseEnvironment, - })); - -export const marshalEnvironmentSpecSchema: z.ZodType = z - .object({ - dependencies: z.array(z.string()).optional(), - environmentVersion: z.string().optional(), - }) - .transform(d => ({ - dependencies: d.dependencies, - environment_version: d.environmentVersion, + display_name: d.displayName, + filepath: d.filepath, + base_environment_type: d.baseEnvironmentType, })); export const marshalRefreshWorkspaceBaseEnvironmentRequestSchema: z.ZodType = z @@ -928,53 +963,29 @@ export const marshalRefreshWorkspaceBaseEnvironmentRequestSchema: z.ZodType = z name: d.name, })); -export const marshalWorkspaceBaseEnvironmentSchema: z.ZodType = z +export const marshalUpdateDefaultWorkspaceBaseEnvironmentSchema: z.ZodType = z .object({ name: z.string().optional(), - displayName: z.string().optional(), - filepath: z.string().optional(), - creatorUserId: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - lastUpdatedUserId: z.string().optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - status: z.string().optional(), - message: z.string().optional(), - isDefault: z.boolean().optional(), - baseEnvironmentType: z.string().optional(), - spec: z.lazy(() => marshalEnvironmentSpecSchema).optional(), + cpuWorkspaceBaseEnvironment: z.string().optional(), + gpuWorkspaceBaseEnvironment: z.string().optional(), }) .transform(d => ({ name: d.name, - display_name: d.displayName, - filepath: d.filepath, - creator_user_id: d.creatorUserId, - create_time: d.createTime, - last_updated_user_id: d.lastUpdatedUserId, - update_time: d.updateTime, - status: d.status, - message: d.message, - is_default: d.isDefault, - base_environment_type: d.baseEnvironmentType, - spec: d.spec, + cpu_workspace_base_environment: d.cpuWorkspaceBaseEnvironment, + gpu_workspace_base_environment: d.gpuWorkspaceBaseEnvironment, })); -const defaultWorkspaceBaseEnvironmentFieldMaskSchema: FieldMaskSchema = { +const updateDefaultWorkspaceBaseEnvironmentFieldMaskSchema: FieldMaskSchema = { cpuWorkspaceBaseEnvironment: {wire: 'cpu_workspace_base_environment'}, gpuWorkspaceBaseEnvironment: {wire: 'gpu_workspace_base_environment'}, name: {wire: 'name'}, }; -export function defaultWorkspaceBaseEnvironmentFieldMask( +export function updateDefaultWorkspaceBaseEnvironmentFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - defaultWorkspaceBaseEnvironmentFieldMaskSchema + updateDefaultWorkspaceBaseEnvironmentFieldMaskSchema ); } diff --git a/packages/experiments/src/v1/index.ts b/packages/experiments/src/v1/index.ts index a2de4801..fd41b3d1 100755 --- a/packages/experiments/src/v1/index.ts +++ b/packages/experiments/src/v1/index.ts @@ -9,12 +9,23 @@ export {ExperimentsClient} from './client'; export {LoggedModelStatus, RunStatus, ViewType} from './model'; export type { + CreateDataset, + CreateDatasetInput, CreateExperimentRequest, CreateExperimentResponse, + CreateExperimentTag, + CreateInputTag, + CreateLoggedModelParameter, CreateLoggedModelRequest, CreateLoggedModelResponse, + CreateLoggedModelTag, + CreateMetric, + CreateModelInput, + CreateModelOutput, + CreateParam, CreateRunRequest, CreateRunResponse, + CreateRunTag, Dataset, DatasetInput, DeleteExperimentRequest, @@ -86,6 +97,8 @@ export type { SearchExperimentsRequest, SearchExperimentsResponse, SearchLoggedModelsRequest, + SearchLoggedModelsRequest_CreateDataset, + SearchLoggedModelsRequest_CreateOrderBy, SearchLoggedModelsRequest_Dataset, SearchLoggedModelsRequest_OrderBy, SearchLoggedModelsResponse, diff --git a/packages/experiments/src/v1/model.ts b/packages/experiments/src/v1/model.ts index 2f309f9c..fd7b80e7 100755 --- a/packages/experiments/src/v1/model.ts +++ b/packages/experiments/src/v1/model.ts @@ -56,6 +56,43 @@ export const ViewType = { } as const; export type ViewType = (typeof ViewType)[keyof typeof ViewType] | (string & {}); +/** + * Dataset. Represents a reference to data used for training, testing, or evaluation during + * the model development process. + */ +export interface CreateDataset { + /** The name of the dataset. E.g. “my.uc.table@2” “nyc-taxi-dataset”, “fantastic-elk-3” */ + name: string; + /** Dataset digest, e.g. an md5 hash of the dataset that uniquely identifies it within datasets of the same name. */ + digest: string; + /** The type of the dataset source, e.g. ‘databricks-uc-table’, ‘DBFS’, ‘S3’, ... */ + sourceType: string; + /** + * Source information for the dataset. Note that the source may not exactly reproduce the + * dataset if it was transformed / modified before use with MLflow. + */ + source: string; + /** + * The schema of the dataset. E.g., MLflow ColSpec JSON for a dataframe, MLflow TensorSpec JSON + * for an ndarray, or another schema format. + */ + schema?: string | undefined; + /** + * The profile of the dataset. Summary statistics for the dataset, such as the number of rows + * in a table, the mean / std / mode of each column in a table, or the number of elements + * in an array. + */ + profile?: string | undefined; +} + +/** DatasetInput. Represents a dataset and input tags. */ +export interface CreateDatasetInput { + /** A list of tags for the dataset input, e.g. a “context” tag with value “training” */ + tags?: CreateInputTag[] | undefined; + /** The dataset being used as a Run input. */ + dataset: CreateDataset; +} + export interface CreateExperimentRequest { /** Experiment name. */ name?: string | undefined; @@ -70,7 +107,7 @@ export interface CreateExperimentRequest { * to 250 bytes in size and tag values up to 5000 bytes in size. All storage backends are also * guaranteed to support up to 20 tags per request. */ - tags?: ExperimentTag[] | undefined; + tags?: CreateExperimentTag[] | undefined; } export interface CreateExperimentResponse { @@ -78,6 +115,30 @@ export interface CreateExperimentResponse { experimentId?: string | undefined; } +/** A tag for an experiment. */ +export interface CreateExperimentTag { + /** The tag key. */ + key?: string | undefined; + /** The tag value. */ + value?: string | undefined; +} + +/** Tag for a dataset input. */ +export interface CreateInputTag { + /** The tag key. */ + key: string; + /** The tag value. */ + value: string; +} + +/** Parameter associated with a LoggedModel. */ +export interface CreateLoggedModelParameter { + /** The key identifying this param. */ + key?: string | undefined; + /** The value of this param. */ + value?: string | undefined; +} + export interface CreateLoggedModelRequest { /** The ID of the experiment that owns the model. */ experimentId?: string | undefined; @@ -88,9 +149,9 @@ export interface CreateLoggedModelRequest { /** The ID of the run that created the model. */ sourceRunId?: string | undefined; /** Parameters attached to the model. */ - params?: LoggedModelParameter[] | undefined; + params?: CreateLoggedModelParameter[] | undefined; /** Tags attached to the model. */ - tags?: LoggedModelTag[] | undefined; + tags?: CreateLoggedModelTag[] | undefined; } export interface CreateLoggedModelResponse { @@ -98,6 +159,66 @@ export interface CreateLoggedModelResponse { model?: LoggedModel | undefined; } +/** Tag for a LoggedModel. */ +export interface CreateLoggedModelTag { + /** The tag key. */ + key?: string | undefined; + /** The tag value. */ + value?: string | undefined; +} + +/** Metric associated with a run, represented as a key-value pair. */ +export interface CreateMetric { + /** The key identifying the metric. */ + key?: string | undefined; + /** The value of the metric. */ + value?: number | undefined; + /** The timestamp at which the metric was recorded. */ + timestamp?: bigint | undefined; + /** The step at which the metric was logged. */ + step?: bigint | undefined; + /** + * The name of the dataset associated with the metric. + * E.g. “my.uc.table@2” “nyc-taxi-dataset”, “fantastic-elk-3” + */ + datasetName?: string | undefined; + /** + * The dataset digest of the dataset associated with the metric, + * e.g. an md5 hash of the dataset that uniquely identifies it + * within datasets of the same name. + */ + datasetDigest?: string | undefined; + /** + * The ID of the logged model or registered model version associated with + * the metric, if applicable. + */ + modelId?: string | undefined; + /** The ID of the run containing the metric. */ + runId?: string | undefined; +} + +/** Represents a LoggedModel or Registered Model Version input to a Run. */ +export interface CreateModelInput { + /** The unique identifier of the model. */ + modelId: string; +} + +/** Represents a LoggedModel output of a Run. */ +export interface CreateModelOutput { + /** The unique identifier of the model. */ + modelId: string; + /** The step at which the model was produced. */ + step: bigint; +} + +/** Param associated with a run. */ +export interface CreateParam { + /** Key identifying this param. */ + key?: string | undefined; + /** Value associated with this param. */ + value?: string | undefined; +} + export interface CreateRunRequest { /** ID of the associated experiment. */ experimentId?: string | undefined; @@ -112,7 +233,7 @@ export interface CreateRunRequest { /** Unix timestamp in milliseconds of when the run started. */ startTime?: bigint | undefined; /** Additional metadata for run. */ - tags?: RunTag[] | undefined; + tags?: CreateRunTag[] | undefined; } export interface CreateRunResponse { @@ -120,6 +241,14 @@ export interface CreateRunResponse { run?: Run | undefined; } +/** Tag for a run. */ +export interface CreateRunTag { + /** The tag key. */ + key?: string | undefined; + /** The tag value. */ + value?: string | undefined; +} + /** * Dataset. Represents a reference to data used for training, testing, or evaluation during * the model development process. @@ -431,17 +560,17 @@ export interface LogBatchRequest { * Metrics to log. A single request can contain up to 1000 metrics, and up to 1000 * metrics, params, and tags in total. */ - metrics?: Metric[] | undefined; + metrics?: CreateMetric[] | undefined; /** * Params to log. A single request can contain up to 100 params, and up to 1000 * metrics, params, and tags in total. */ - params?: Param[] | undefined; + params?: CreateParam[] | undefined; /** * Tags to log. A single request can contain up to 100 tags, and up to 1000 * metrics, params, and tags in total. */ - tags?: RunTag[] | undefined; + tags?: CreateRunTag[] | undefined; } // eslint-disable-next-line @typescript-eslint/no-empty-object-type @@ -451,9 +580,9 @@ export interface LogInputsRequest { /** ID of the run to log under */ runId?: string | undefined; /** Dataset inputs */ - datasets?: DatasetInput[] | undefined; + datasets?: CreateDatasetInput[] | undefined; /** Model inputs */ - models?: ModelInput[] | undefined; + models?: CreateModelInput[] | undefined; } // eslint-disable-next-line @typescript-eslint/no-empty-object-type @@ -463,7 +592,7 @@ export interface LogLoggedModelParamsRequest { /** The ID of the logged model to log params for. */ modelId?: string | undefined; /** Parameters to attach to the model. */ - params?: LoggedModelParameter[] | undefined; + params?: CreateLoggedModelParameter[] | undefined; } // eslint-disable-next-line @typescript-eslint/no-empty-object-type @@ -517,7 +646,7 @@ export interface LogOutputsRequest { /** The ID of the Run from which to log outputs. */ runId?: string | undefined; /** The model outputs from the Run. */ - models?: ModelOutput[] | undefined; + models?: CreateModelOutput[] | undefined; } // eslint-disable-next-line @typescript-eslint/no-empty-object-type @@ -813,15 +942,44 @@ export interface SearchLoggedModelsRequest { * Metric values from ANY dataset matching the criteria are considered. * If no datasets are specified, then metrics across all datasets are considered in the filter. */ - datasets?: SearchLoggedModelsRequest_Dataset[] | undefined; + datasets?: SearchLoggedModelsRequest_CreateDataset[] | undefined; /** The maximum number of Logged Models to return. The maximum limit is 50. */ maxResults?: number | undefined; /** The list of columns for ordering the results, with additional fields for sorting criteria. */ - orderBy?: SearchLoggedModelsRequest_OrderBy[] | undefined; + orderBy?: SearchLoggedModelsRequest_CreateOrderBy[] | undefined; /** The token indicating the page of logged models to fetch. */ pageToken?: string | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface SearchLoggedModelsRequest_CreateDataset { + /** The name of the dataset. */ + datasetName: string; + /** The digest of the dataset. */ + datasetDigest?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface SearchLoggedModelsRequest_CreateOrderBy { + /** The name of the field to order by, e.g. "metrics.accuracy". */ + fieldName: string; + /** Whether the search results order is ascending or not. */ + ascending?: boolean | undefined; + /** + * If ``field_name`` refers to a metric, this field specifies the name of the dataset + * associated with the metric. Only metrics associated with the specified dataset name will be + * considered for ordering. This field may only be set if ``field_name`` refers to a metric. + */ + datasetName?: string | undefined; + /** + * If ``field_name`` refers to a metric, this field specifies the digest of the dataset + * associated with the metric. Only metrics associated with the specified dataset name + * and digest will be considered for ordering. This field may only be set if ``dataset_name`` + * is also set. + */ + datasetDigest?: string | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface SearchLoggedModelsRequest_Dataset { /** The name of the dataset. */ @@ -916,7 +1074,7 @@ export interface SetLoggedModelTagsRequest { /** The ID of the logged model to set the tags on. */ modelId?: string | undefined; /** The tags to set on the logged model. */ - tags?: LoggedModelTag[] | undefined; + tags?: CreateLoggedModelTag[] | undefined; } // eslint-disable-next-line @typescript-eslint/no-empty-object-type @@ -1485,11 +1643,39 @@ export const unmarshalUpdateRunResponseSchema: z.ZodType = z runInfo: d.run_info, })); +export const marshalCreateDatasetSchema: z.ZodType = z + .object({ + name: z.string(), + digest: z.string(), + sourceType: z.string(), + source: z.string(), + schema: z.string().optional(), + profile: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + digest: d.digest, + source_type: d.sourceType, + source: d.source, + schema: d.schema, + profile: d.profile, + })); + +export const marshalCreateDatasetInputSchema: z.ZodType = z + .object({ + tags: z.array(z.lazy(() => marshalCreateInputTagSchema)).optional(), + dataset: z.lazy(() => marshalCreateDatasetSchema), + }) + .transform(d => ({ + tags: d.tags, + dataset: d.dataset, + })); + export const marshalCreateExperimentRequestSchema: z.ZodType = z .object({ name: z.string().optional(), artifactLocation: z.string().optional(), - tags: z.array(z.lazy(() => marshalExperimentTagSchema)).optional(), + tags: z.array(z.lazy(() => marshalCreateExperimentTagSchema)).optional(), }) .transform(d => ({ name: d.name, @@ -1497,14 +1683,46 @@ export const marshalCreateExperimentRequestSchema: z.ZodType = z tags: d.tags, })); +export const marshalCreateExperimentTagSchema: z.ZodType = z + .object({ + key: z.string().optional(), + value: z.string().optional(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); + +export const marshalCreateInputTagSchema: z.ZodType = z + .object({ + key: z.string(), + value: z.string(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); + +export const marshalCreateLoggedModelParameterSchema: z.ZodType = z + .object({ + key: z.string().optional(), + value: z.string().optional(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); + export const marshalCreateLoggedModelRequestSchema: z.ZodType = z .object({ experimentId: z.string().optional(), name: z.string().optional(), modelType: z.string().optional(), sourceRunId: z.string().optional(), - params: z.array(z.lazy(() => marshalLoggedModelParameterSchema)).optional(), - tags: z.array(z.lazy(() => marshalLoggedModelTagSchema)).optional(), + params: z + .array(z.lazy(() => marshalCreateLoggedModelParameterSchema)) + .optional(), + tags: z.array(z.lazy(() => marshalCreateLoggedModelTagSchema)).optional(), }) .transform(d => ({ experiment_id: d.experimentId, @@ -1515,13 +1733,73 @@ export const marshalCreateLoggedModelRequestSchema: z.ZodType = z tags: d.tags, })); +export const marshalCreateLoggedModelTagSchema: z.ZodType = z + .object({ + key: z.string().optional(), + value: z.string().optional(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); + +export const marshalCreateMetricSchema: z.ZodType = z + .object({ + key: z.string().optional(), + value: z.number().optional(), + timestamp: z.bigint().optional(), + step: z.bigint().optional(), + datasetName: z.string().optional(), + datasetDigest: z.string().optional(), + modelId: z.string().optional(), + runId: z.string().optional(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + timestamp: d.timestamp, + step: d.step, + dataset_name: d.datasetName, + dataset_digest: d.datasetDigest, + model_id: d.modelId, + run_id: d.runId, + })); + +export const marshalCreateModelInputSchema: z.ZodType = z + .object({ + modelId: z.string(), + }) + .transform(d => ({ + model_id: d.modelId, + })); + +export const marshalCreateModelOutputSchema: z.ZodType = z + .object({ + modelId: z.string(), + step: z.bigint(), + }) + .transform(d => ({ + model_id: d.modelId, + step: d.step, + })); + +export const marshalCreateParamSchema: z.ZodType = z + .object({ + key: z.string().optional(), + value: z.string().optional(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); + export const marshalCreateRunRequestSchema: z.ZodType = z .object({ experimentId: z.string().optional(), userId: z.string().optional(), runName: z.string().optional(), startTime: z.bigint().optional(), - tags: z.array(z.lazy(() => marshalRunTagSchema)).optional(), + tags: z.array(z.lazy(() => marshalCreateRunTagSchema)).optional(), }) .transform(d => ({ experiment_id: d.experimentId, @@ -1531,32 +1809,14 @@ export const marshalCreateRunRequestSchema: z.ZodType = z tags: d.tags, })); -export const marshalDatasetSchema: z.ZodType = z - .object({ - name: z.string().optional(), - digest: z.string().optional(), - sourceType: z.string().optional(), - source: z.string().optional(), - schema: z.string().optional(), - profile: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - digest: d.digest, - source_type: d.sourceType, - source: d.source, - schema: d.schema, - profile: d.profile, - })); - -export const marshalDatasetInputSchema: z.ZodType = z +export const marshalCreateRunTagSchema: z.ZodType = z .object({ - tags: z.array(z.lazy(() => marshalInputTagSchema)).optional(), - dataset: z.lazy(() => marshalDatasetSchema).optional(), + key: z.string().optional(), + value: z.string().optional(), }) .transform(d => ({ - tags: d.tags, - dataset: d.dataset, + key: d.key, + value: d.value, })); export const marshalDeleteExperimentRequestSchema: z.ZodType = z @@ -1597,16 +1857,6 @@ export const marshalDeleteTagRequestSchema: z.ZodType = z key: d.key, })); -export const marshalExperimentTagSchema: z.ZodType = z - .object({ - key: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - export const marshalFinalizeLoggedModelRequestSchema: z.ZodType = z .object({ modelId: z.string().optional(), @@ -1617,22 +1867,12 @@ export const marshalFinalizeLoggedModelRequestSchema: z.ZodType = z status: d.status, })); -export const marshalInputTagSchema: z.ZodType = z - .object({ - key: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - export const marshalLogBatchRequestSchema: z.ZodType = z .object({ runId: z.string().optional(), - metrics: z.array(z.lazy(() => marshalMetricSchema)).optional(), - params: z.array(z.lazy(() => marshalParamSchema)).optional(), - tags: z.array(z.lazy(() => marshalRunTagSchema)).optional(), + metrics: z.array(z.lazy(() => marshalCreateMetricSchema)).optional(), + params: z.array(z.lazy(() => marshalCreateParamSchema)).optional(), + tags: z.array(z.lazy(() => marshalCreateRunTagSchema)).optional(), }) .transform(d => ({ run_id: d.runId, @@ -1644,8 +1884,8 @@ export const marshalLogBatchRequestSchema: z.ZodType = z export const marshalLogInputsRequestSchema: z.ZodType = z .object({ runId: z.string().optional(), - datasets: z.array(z.lazy(() => marshalDatasetInputSchema)).optional(), - models: z.array(z.lazy(() => marshalModelInputSchema)).optional(), + datasets: z.array(z.lazy(() => marshalCreateDatasetInputSchema)).optional(), + models: z.array(z.lazy(() => marshalCreateModelInputSchema)).optional(), }) .transform(d => ({ run_id: d.runId, @@ -1656,7 +1896,9 @@ export const marshalLogInputsRequestSchema: z.ZodType = z export const marshalLogLoggedModelParamsRequestSchema: z.ZodType = z .object({ modelId: z.string().optional(), - params: z.array(z.lazy(() => marshalLoggedModelParameterSchema)).optional(), + params: z + .array(z.lazy(() => marshalCreateLoggedModelParameterSchema)) + .optional(), }) .transform(d => ({ model_id: d.modelId, @@ -1700,7 +1942,7 @@ export const marshalLogModelRequestSchema: z.ZodType = z export const marshalLogOutputsRequestSchema: z.ZodType = z .object({ runId: z.string().optional(), - models: z.array(z.lazy(() => marshalModelOutputSchema)).optional(), + models: z.array(z.lazy(() => marshalCreateModelOutputSchema)).optional(), }) .transform(d => ({ run_id: d.runId, @@ -1721,76 +1963,6 @@ export const marshalLogParamRequestSchema: z.ZodType = z value: d.value, })); -export const marshalLoggedModelParameterSchema: z.ZodType = z - .object({ - key: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - -export const marshalLoggedModelTagSchema: z.ZodType = z - .object({ - key: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - -export const marshalMetricSchema: z.ZodType = z - .object({ - key: z.string().optional(), - value: z.number().optional(), - timestamp: z.bigint().optional(), - step: z.bigint().optional(), - datasetName: z.string().optional(), - datasetDigest: z.string().optional(), - modelId: z.string().optional(), - runId: z.string().optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - timestamp: d.timestamp, - step: d.step, - dataset_name: d.datasetName, - dataset_digest: d.datasetDigest, - model_id: d.modelId, - run_id: d.runId, - })); - -export const marshalModelInputSchema: z.ZodType = z - .object({ - modelId: z.string().optional(), - }) - .transform(d => ({ - model_id: d.modelId, - })); - -export const marshalModelOutputSchema: z.ZodType = z - .object({ - modelId: z.string().optional(), - step: z.bigint().optional(), - }) - .transform(d => ({ - model_id: d.modelId, - step: d.step, - })); - -export const marshalParamSchema: z.ZodType = z - .object({ - key: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - export const marshalRestoreExperimentRequestSchema: z.ZodType = z .object({ experimentId: z.string().optional(), @@ -1819,16 +1991,6 @@ export const marshalRestoreRunsRequestSchema: z.ZodType = z max_runs: d.maxRuns, })); -export const marshalRunTagSchema: z.ZodType = z - .object({ - key: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - export const marshalSearchExperimentsRequestSchema: z.ZodType = z .object({ maxResults: z.bigint().optional(), @@ -1850,11 +2012,11 @@ export const marshalSearchLoggedModelsRequestSchema: z.ZodType = z experimentIds: z.array(z.string()).optional(), filter: z.string().optional(), datasets: z - .array(z.lazy(() => marshalSearchLoggedModelsRequest_DatasetSchema)) + .array(z.lazy(() => marshalSearchLoggedModelsRequest_CreateDatasetSchema)) .optional(), maxResults: z.number().optional(), orderBy: z - .array(z.lazy(() => marshalSearchLoggedModelsRequest_OrderBySchema)) + .array(z.lazy(() => marshalSearchLoggedModelsRequest_CreateOrderBySchema)) .optional(), pageToken: z.string().optional(), }) @@ -1868,9 +2030,9 @@ export const marshalSearchLoggedModelsRequestSchema: z.ZodType = z })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalSearchLoggedModelsRequest_DatasetSchema: z.ZodType = z +export const marshalSearchLoggedModelsRequest_CreateDatasetSchema: z.ZodType = z .object({ - datasetName: z.string().optional(), + datasetName: z.string(), datasetDigest: z.string().optional(), }) .transform(d => ({ @@ -1879,9 +2041,9 @@ export const marshalSearchLoggedModelsRequest_DatasetSchema: z.ZodType = z })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalSearchLoggedModelsRequest_OrderBySchema: z.ZodType = z +export const marshalSearchLoggedModelsRequest_CreateOrderBySchema: z.ZodType = z .object({ - fieldName: z.string().optional(), + fieldName: z.string(), ascending: z.boolean().optional(), datasetName: z.string().optional(), datasetDigest: z.string().optional(), @@ -1926,7 +2088,7 @@ export const marshalSetExperimentTagRequestSchema: z.ZodType = z export const marshalSetLoggedModelTagsRequestSchema: z.ZodType = z .object({ modelId: z.string().optional(), - tags: z.array(z.lazy(() => marshalLoggedModelTagSchema)).optional(), + tags: z.array(z.lazy(() => marshalCreateLoggedModelTagSchema)).optional(), }) .transform(d => ({ model_id: d.modelId, diff --git a/packages/features/src/v1/client.ts b/packages/features/src/v1/client.ts index 4cee9f73..74d6c83b 100644 --- a/packages/features/src/v1/client.ts +++ b/packages/features/src/v1/client.ts @@ -50,10 +50,14 @@ import type { } from './model'; import { marshalBatchCreateMaterializedFeaturesRequestSchema, - marshalFeatureSchema, - marshalKafkaConfigSchema, - marshalMaterializedFeatureSchema, - marshalStreamSchema, + marshalCreateFeatureSchema, + marshalCreateKafkaConfigSchema, + marshalCreateMaterializedFeatureSchema, + marshalCreateStreamSchema, + marshalUpdateFeatureSchema, + marshalUpdateKafkaConfigSchema, + marshalUpdateMaterializedFeatureSchema, + marshalUpdateStreamSchema, unmarshalBatchCreateMaterializedFeaturesResponseSchema, unmarshalFeatureSchema, unmarshalKafkaConfigSchema, @@ -141,7 +145,7 @@ export class FeaturesClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/feature-engineering/features`; - const body = marshalRequest(req.feature, marshalFeatureSchema); + const body = marshalRequest(req.feature, marshalCreateFeatureSchema); let resp: Feature | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -175,7 +179,10 @@ export class FeaturesClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/feature-engineering/features/kafka-configs`; - const body = marshalRequest(req.kafkaConfig, marshalKafkaConfigSchema); + const body = marshalRequest( + req.kafkaConfig, + marshalCreateKafkaConfigSchema + ); let resp: KafkaConfig | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -207,7 +214,7 @@ export class FeaturesClient { const url = `${host}/api/2.0/feature-engineering/materialized-features`; const body = marshalRequest( req.materializedFeature, - marshalMaterializedFeatureSchema + marshalCreateMaterializedFeatureSchema ); let resp: MaterializedFeature | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -238,7 +245,7 @@ export class FeaturesClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/feature-engineering/streams`; - const body = marshalRequest(req.stream, marshalStreamSchema); + const body = marshalRequest(req.stream, marshalCreateStreamSchema); let resp: Stream | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -729,7 +736,7 @@ export class FeaturesClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.feature, marshalFeatureSchema); + const body = marshalRequest(req.feature, marshalUpdateFeatureSchema); let resp: Feature | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -775,7 +782,10 @@ export class FeaturesClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.kafkaConfig, marshalKafkaConfigSchema); + const body = marshalRequest( + req.kafkaConfig, + marshalUpdateKafkaConfigSchema + ); let resp: KafkaConfig | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -819,7 +829,7 @@ export class FeaturesClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.materializedFeature, - marshalMaterializedFeatureSchema + marshalUpdateMaterializedFeatureSchema ); let resp: MaterializedFeature | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -862,7 +872,7 @@ export class FeaturesClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.stream, marshalStreamSchema); + const body = marshalRequest(req.stream, marshalUpdateStreamSchema); let resp: Stream | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/features/src/v1/index.ts b/packages/features/src/v1/index.ts index 21a09c0f..605093dc 100755 --- a/packages/features/src/v1/index.ts +++ b/packages/features/src/v1/index.ts @@ -26,10 +26,72 @@ export type { ColumnSelection, ContinuousWindow, CountFunction, + CreateAggregationFunction, + CreateApproxCountDistinctFunction, + CreateApproxPercentileFunction, + CreateAuthConfig, + CreateAvgFunction, + CreateBackfillSource, + CreateColumnIdentifier, + CreateColumnSelection, + CreateContinuousWindow, + CreateCountFunction, + CreateCreateMaterializedFeatureRequest, + CreateCronSchedule, + CreateDataSource, + CreateDeltaTableSource, + CreateDirectMtlsConfig, + CreateDirectSchemas, + CreateEntityColumn, + CreateFeature, CreateFeatureRequest, + CreateFieldDefinition, + CreateFirstDistinctNFunction, + CreateFirstFunction, + CreateFirstNFunction, + CreateFlatSchema, + CreateFunction, + CreateIngestionConfig, + CreateIngestionDestination, + CreateJobContext, + CreateKafkaConfig, CreateKafkaConfigRequest, + CreateKafkaSource, + CreateKafkaStreamConfig, + CreateKafkaSubscriptionMode, + CreateLastDistinctNFunction, + CreateLastFunction, + CreateLastNFunction, + CreateLineageContext, + CreateMaterializedFeature, CreateMaterializedFeatureRequest, + CreateMaxFunction, + CreateMinFunction, + CreateMtlsConfig, + CreateOfflineStoreConfig, + CreateOnlineStoreConfig, + CreateRequestSource, + CreateRollingWindow, + CreateSchemaConfig, + CreateSecretScopeReference, + CreateSlidingWindow, + CreateStddevPopFunction, + CreateStddevSampFunction, + CreateStream, + CreateStreamConnectionConfig, CreateStreamRequest, + CreateStreamSchemaConfig, + CreateStreamSource, + CreateStreamSourceConfig, + CreateStreamingMode, + CreateSubscriptionMode, + CreateSumFunction, + CreateTableTrigger, + CreateTimeWindow, + CreateTimeseriesColumn, + CreateTumblingWindow, + CreateVarPopFunction, + CreateVarSampFunction, CronSchedule, DataSource, DeleteFeatureRequest, @@ -47,7 +109,9 @@ export type { FirstNFunction, FlatSchema, Function, + Function_CreateExtraParameter, Function_ExtraParameter, + Function_UpdateExtraParameter, GetFeatureRequest, GetKafkaConfigRequest, GetMaterializedFeatureRequest, @@ -96,17 +160,78 @@ export type { TimeWindow, TimeseriesColumn, TumblingWindow, + UpdateAggregationFunction, + UpdateApproxCountDistinctFunction, + UpdateApproxPercentileFunction, + UpdateAuthConfig, + UpdateAvgFunction, + UpdateBackfillSource, + UpdateColumnIdentifier, + UpdateColumnSelection, + UpdateContinuousWindow, + UpdateCountFunction, + UpdateCronSchedule, + UpdateDataSource, + UpdateDeltaTableSource, + UpdateDirectMtlsConfig, + UpdateDirectSchemas, + UpdateEntityColumn, + UpdateFeature, UpdateFeatureRequest, + UpdateFieldDefinition, + UpdateFirstDistinctNFunction, + UpdateFirstFunction, + UpdateFirstNFunction, + UpdateFlatSchema, + UpdateFunction, + UpdateIngestionConfig, + UpdateIngestionDestination, + UpdateJobContext, + UpdateKafkaConfig, UpdateKafkaConfigRequest, + UpdateKafkaSource, + UpdateKafkaStreamConfig, + UpdateKafkaSubscriptionMode, + UpdateLastDistinctNFunction, + UpdateLastFunction, + UpdateLastNFunction, + UpdateLineageContext, + UpdateMaterializedFeature, UpdateMaterializedFeatureRequest, + UpdateMaxFunction, + UpdateMinFunction, + UpdateMtlsConfig, + UpdateOfflineStoreConfig, + UpdateOnlineStoreConfig, + UpdateRequestSource, + UpdateRollingWindow, + UpdateSchemaConfig, + UpdateSecretScopeReference, + UpdateSlidingWindow, + UpdateStddevPopFunction, + UpdateStddevSampFunction, + UpdateStream, + UpdateStreamConnectionConfig, UpdateStreamRequest, + UpdateStreamSchemaConfig, + UpdateStreamSource, + UpdateStreamSourceConfig, + UpdateStreamingMode, + UpdateSubscriptionMode, + UpdateSumFunction, + UpdateTableTrigger, + UpdateTimeWindow, + UpdateTimeseriesColumn, + UpdateTumblingWindow, + UpdateVarPopFunction, + UpdateVarSampFunction, VarPopFunction, VarSampFunction, } from './model'; export { - featureFieldMask, - kafkaConfigFieldMask, - materializedFeatureFieldMask, - streamFieldMask, + updateFeatureFieldMask, + updateKafkaConfigFieldMask, + updateMaterializedFeatureFieldMask, + updateStreamFieldMask, } from './model'; diff --git a/packages/features/src/v1/model.ts b/packages/features/src/v1/model.ts index ad383f47..ad411c6c 100755 --- a/packages/features/src/v1/model.ts +++ b/packages/features/src/v1/model.ts @@ -182,7 +182,7 @@ export interface BackfillSource { export interface BatchCreateMaterializedFeaturesRequest { /** The requests to create materialized features. */ - requests?: CreateMaterializedFeatureRequest[] | undefined; + requests?: CreateCreateMaterializedFeatureRequest[] | undefined; } export interface BatchCreateMaterializedFeaturesResponse { @@ -223,82 +223,174 @@ export interface CountFunction { input?: string | undefined; } -export interface CreateFeatureRequest { - /** Feature to create. */ - feature?: Feature | undefined; +/** An aggregation function applied over a time window. */ +export interface CreateAggregationFunction { + /** The type of the aggregation function. */ + operation?: + | {$case: 'avg'; avg: CreateAvgFunction} + | {$case: 'countFunction'; countFunction: CreateCountFunction} + | {$case: 'sum'; sum: CreateSumFunction} + | {$case: 'min'; min: CreateMinFunction} + | {$case: 'max'; max: CreateMaxFunction} + | {$case: 'first'; first: CreateFirstFunction} + | {$case: 'last'; last: CreateLastFunction} + | { + $case: 'approxCountDistinct'; + approxCountDistinct: CreateApproxCountDistinctFunction; + } + | { + $case: 'approxPercentile'; + approxPercentile: CreateApproxPercentileFunction; + } + | {$case: 'stddevPop'; stddevPop: CreateStddevPopFunction} + | {$case: 'stddevSamp'; stddevSamp: CreateStddevSampFunction} + | {$case: 'varPop'; varPop: CreateVarPopFunction} + | {$case: 'varSamp'; varSamp: CreateVarSampFunction} + | {$case: 'firstN'; firstN: CreateFirstNFunction} + | {$case: 'lastN'; lastN: CreateLastNFunction} + | {$case: 'firstDistinctN'; firstDistinctN: CreateFirstDistinctNFunction} + | {$case: 'lastDistinctN'; lastDistinctN: CreateLastDistinctNFunction} + | undefined; + /** The time window over which the aggregation is computed. */ + timeWindow?: CreateTimeWindow | undefined; } -export interface CreateKafkaConfigRequest { - kafkaConfig?: KafkaConfig | undefined; +/** Computes the approximate count of distinct values. */ +export interface CreateApproxCountDistinctFunction { + /** The input column from which the approximate count of distinct values is computed. */ + input: string; + /** The maximum relative standard deviation allowed (default defined by Spark). */ + relativeSd?: number | undefined; } -export interface CreateMaterializedFeatureRequest { - /** The materialized feature to create. */ - materializedFeature?: MaterializedFeature | undefined; +/** Computes the approximate percentile of values. */ +export interface CreateApproxPercentileFunction { + /** The input column from which the approximate percentile is computed. */ + input: string; + /** The percentile value to compute (between 0 and 1). */ + percentile: number; + /** The accuracy parameter (higher is more accurate but slower). */ + accuracy?: bigint | undefined; } -/** Create a Stream, a governed UC entity representing an external streaming data source. */ -export interface CreateStreamRequest { - /** The Stream to create. */ - stream?: Stream | undefined; +export interface CreateAuthConfig { + authConfig?: + | { + $case: 'ucServiceCredentialName'; + /** Name of the Unity Catalog service credential. This value will be set under the option databricks.serviceCredential */ + ucServiceCredentialName: string; + } + | { + $case: 'mtlsConfig'; + /** Mutual-TLS authentication. See MtlsConfig. */ + mtlsConfig: CreateMtlsConfig; + } + | undefined; +} + +/** Computes the average of values. */ +export interface CreateAvgFunction { + /** + * The input column from which the average is computed. For Kafka sources, use dot-prefixed path + * notation (e.g., "value.amount"). For nested fields, the leaf node name is used. + * Colon-prefixed notation (e.g., "value:amount") is supported for backwards + * compatibility but is deprecated; migrate to dot notation. + */ + input: string; +} + +export interface CreateBackfillSource { + backfillSource?: + | { + $case: 'deltaTableSource'; + /** + * Deprecated: Use delta_table_name instead. Kept for backwards compatibility. + * The Delta table source containing the historical data to backfill. + * Only the delta table name is used for backfill, other fields are ignored. + */ + deltaTableSource: CreateDeltaTableSource; + } + | { + $case: 'deltaTableName'; + /** The full three-part name (catalog, schema, name) of the Delta table containing the historical data to backfill. */ + deltaTableName: string; + } + | undefined; +} + +export interface CreateColumnIdentifier { + /** + * String representation of the column name using dot-prefixed path notation. For nested fields, the leaf value is what will be present in materialized tables + * and expected to match at query time. For example, the leaf node of value.trip_details.location_details.pickup_zip is pickup_zip. + */ + variantExprPath: string; +} + +/** A ColumnSelection function, equivalent to the LAST() record of an entity over a lifetime ContinuousWindow */ +export interface CreateColumnSelection { + /** Column name from source to select as the feature value. */ + column: string; +} + +/** Deprecated: use RollingWindow with `delay` instead. */ +export interface CreateContinuousWindow { + /** The duration of the continuous window (must be positive). */ + windowDuration: Temporal.Duration; + /** The offset of the continuous window (must be non-positive). */ + offset?: Temporal.Duration | undefined; +} + +/** Computes the count of values. */ +export interface CreateCountFunction { + /** + * The input column from which the count is computed. For Kafka sources, use dot-prefixed path + * notation (e.g., "value.amount"). For nested fields, the leaf node name is used. + * Colon-prefixed notation (e.g., "value:amount") is supported for backwards + * compatibility but is deprecated; migrate to dot notation. + */ + input: string; +} + +export interface CreateCreateMaterializedFeatureRequest { + /** The materialized feature to create. */ + materializedFeature: CreateMaterializedFeature; } /** A cron-based schedule trigger for the materialization pipeline. */ -export interface CronSchedule { +export interface CreateCronSchedule { /** The cron expression defining the schedule (e.g., "0 0 * * *" for daily at midnight). */ cronExpression?: string | undefined; } /** Specifies the data source backing a feature. Exactly one source type must be set. */ -export interface DataSource { +export interface CreateDataSource { dataSource?: | { $case: 'deltaTableSource'; /** A Delta table data source. */ - deltaTableSource: DeltaTableSource; + deltaTableSource: CreateDeltaTableSource; } | { $case: 'kafkaSource'; /** A Kafka stream data source. */ - kafkaSource: KafkaSource; + kafkaSource: CreateKafkaSource; } | { $case: 'requestSource'; /** A request-time data source. */ - requestSource: RequestSource; + requestSource: CreateRequestSource; } | { $case: 'streamSource'; /** A Stream data source. */ - streamSource: StreamSource; + streamSource: CreateStreamSource; } | undefined; } -export interface DeleteFeatureRequest { - /** Name of the feature to delete. */ - fullName?: string | undefined; -} - -export interface DeleteKafkaConfigRequest { - /** Name of the Kafka config to delete. */ - name?: string | undefined; -} - -export interface DeleteMaterializedFeatureRequest { - /** The ID of the materialized feature to delete. */ - materializedFeatureId?: string | undefined; -} - -/** Delete a Stream by its full three-part name (catalog.schema.stream). */ -export interface DeleteStreamRequest { - /** Full three-part name (catalog.schema.stream) of the Stream to delete. */ - name?: string | undefined; -} - -export interface DeltaTableSource { +export interface CreateDeltaTableSource { /** The full three-part (catalog, schema, table) name of the Delta table. */ - fullName?: string | undefined; + fullName: string; /** * Deprecated: Use Feature.entity instead. Kept for backwards compatibility. * The entity columns of the Delta table. @@ -329,31 +421,31 @@ export interface DeltaTableSource { * Direct connection configs for mTLS, as Kafka Connections do not support mTLS yet . * Temporarily used until UC Kafka Connections gain mTLS support. */ -export interface DirectMtlsConfig { +export interface CreateDirectMtlsConfig { /** A comma-separated list of host:port pairs for the Kafka bootstrap servers. */ - bootstrapServers?: string | undefined; + bootstrapServers: string; /** Mutual-TLS authentication configuration. */ - mtlsConfig?: MtlsConfig | undefined; + mtlsConfig: CreateMtlsConfig; } /** * Schema definitions provided directly on the Stream, as opposed to referencing a schema registry. * In a future milestone, we will support schema registries through a UC Connection. */ -export interface DirectSchemas { +export interface CreateDirectSchemas { /** * Schema for the message payload. For Kafka, this is the value schema. * Unless the platform supports another schema (e.g. keys for Kafka), this must be specified. */ - payloadSchema?: SchemaConfig | undefined; + payloadSchema?: CreateSchemaConfig | undefined; /** * Schema for the message key. This is only used for Kafka streams. * For Kafka, at least one of payload_schema or key_schema must be specified. */ - keySchema?: SchemaConfig | undefined; + keySchema?: CreateSchemaConfig | undefined; } -export interface EntityColumn { +export interface CreateEntityColumn { /** * The name of the entity column. For Kafka sources, use dot-prefixed path notation to reference * fields within the key or value schema (e.g., "value.user_id", "key.partition_key"). For nested @@ -362,10 +454,10 @@ export interface EntityColumn { * Colon-prefixed notation (e.g., "value:user_id") is supported for backwards * compatibility but is deprecated; migrate to dot notation. */ - name?: string | undefined; + name: string; } -export interface Feature { +export interface CreateFeature { /** * The full three-part name (catalog, schema, name) of the feature. This is the * feature's resource identifier; the catalog_name, schema_name, and name fields @@ -373,19 +465,19 @@ export interface Feature { */ fullName?: string | undefined; /** The data source of the feature. */ - source?: DataSource | undefined; + source: CreateDataSource; /** * Deprecated: Use AggregationFunction.inputs instead. Kept for backwards compatibility. * The input columns from which the feature is computed. */ inputs?: string[] | undefined; /** The function by which the feature is computed. */ - function?: Function | undefined; + function: CreateFunction; /** * Deprecated: Use Function.aggregation_function.time_window instead. Kept for backwards compatibility. * The time window in which the feature is computed. */ - timeWindow?: TimeWindow | undefined; + timeWindow?: CreateTimeWindow | undefined; /** The description of the feature. */ description?: string | undefined; /** @@ -400,66 +492,61 @@ export interface Feature { * Users should not manually set this field as incorrect values may lead to inaccurate lineage tracking or unexpected behavior. * This field will be set by feature-engineering client and should be left unset by SDK and terraform users. */ - lineageContext?: LineageContext | undefined; + lineageContext?: CreateLineageContext | undefined; /** The entity columns for the feature, used as aggregation keys and for query-time lookup. */ - entities?: EntityColumn[] | undefined; + entities?: CreateEntityColumn[] | undefined; /** Column recording time, used for point-in-time joins, backfills, and aggregations. */ - timeseriesColumn?: TimeseriesColumn | undefined; - /** Name of parent catalog. */ - catalogName?: string | undefined; - /** Name of parent schema relative to its parent catalog. */ - schemaName?: string | undefined; - /** Name of the feature, extracted from the full three-part name (catalog.schema.name). */ - name?: string | undefined; - /** Time at which this feature was created. */ - createdAt?: Temporal.Instant | undefined; - /** Username of the feature creator. */ - createdBy?: string | undefined; + timeseriesColumn?: CreateTimeseriesColumn | undefined; +} + +export interface CreateFeatureRequest { + /** Feature to create. */ + feature?: CreateFeature | undefined; } /** * A single field definition within a FlatSchema, specifying the field name and its scalar data type. * Does not support nested or complex types (arrays, maps, structs). */ -export interface FieldDefinition { +export interface CreateFieldDefinition { /** The name of the field. */ - name?: string | undefined; + name: string; /** The scalar data type of the field. */ - dataType?: ScalarDataType | undefined; + dataType: ScalarDataType; } /** Returns the first N distinct values, ordered by the feature's timeseries column. */ -export interface FirstDistinctNFunction { +export interface CreateFirstDistinctNFunction { /** The input column from which the first N distinct values are returned. */ - input?: string | undefined; + input: string; /** The number of distinct values to return. */ - n?: bigint | undefined; + n: bigint; } /** Returns the first value. */ -export interface FirstFunction { +export interface CreateFirstFunction { /** The input column from which the first value is returned. */ - input?: string | undefined; + input: string; } /** Returns the first N values, ordered by the feature's timeseries column. */ -export interface FirstNFunction { +export interface CreateFirstNFunction { /** The input column from which the first N values are returned. */ - input?: string | undefined; + input: string; /** The number of values to return. */ - n?: bigint | undefined; + n: bigint; } /** * A flat (non-nested) schema for request-time fields, defined as an ordered list of field definitions. * This schema only supports scalar types. */ -export interface FlatSchema { +export interface CreateFlatSchema { /** The list of fields in this schema. */ - fields?: FieldDefinition[] | undefined; + fields: CreateFieldDefinition[]; } -export interface Function { +export interface CreateFunction { /** * Deprecated: Use the function oneof with AggregationFunction instead. Kept for backwards compatibility. * The type of the function. @@ -469,90 +556,48 @@ export interface Function { * Deprecated: Use the function oneof with AggregationFunction instead. Kept for backwards compatibility. * Extra parameters for parameterized functions. */ - extraParameters?: Function_ExtraParameter[] | undefined; + extraParameters?: Function_CreateExtraParameter[] | undefined; function?: | { $case: 'aggregationFunction'; /** An aggregation function applied over a time window. */ - aggregationFunction: AggregationFunction; + aggregationFunction: CreateAggregationFunction; } | { $case: 'columnSelection'; /** Selects the latest value of a single column in a data source */ - columnSelection: ColumnSelection; + columnSelection: CreateColumnSelection; } | undefined; } -/** - * Deprecated: Use typed fields on function-specific messages (e.g. ApproxPercentileFunction.percentile) - * or AggregationFunction.ExtraParameter instead. Kept for backwards compatibility. - */ -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export interface Function_ExtraParameter { - /** The name of the parameter. */ - key?: string | undefined; - /** The value of the parameter. */ - value?: string | undefined; -} - -export interface GetFeatureRequest { - /** Name of the feature to get. */ - fullName?: string | undefined; -} - -export interface GetKafkaConfigRequest { - /** Name of the Kafka config to get. */ - name?: string | undefined; -} - -export interface GetMaterializedFeatureRequest { - /** The ID of the materialized feature. */ - materializedFeatureId?: string | undefined; -} - -/** Get a Stream by its full three-part name (catalog.schema.stream). */ -export interface GetStreamRequest { - /** Full three-part name (catalog.schema.stream) of the Stream to get. */ - name?: string | undefined; -} - /** * Configuration for the -managed ingestion pipeline. * Groups the ingestion destination (required) and optional backfill source. */ -export interface IngestionConfig { +export interface CreateIngestionConfig { /** * Destination for the -managed Delta table that holds an offline copy of the streaming data for querying and training. * This table contains both 1) forward-filled data from the Stream and 2) backfilled data from the BackfillSource (if provided). * This table is created and managed by and is deleted when the Stream is deleted. */ - ingestionDestination?: IngestionDestination | undefined; + ingestionDestination: CreateIngestionDestination; /** * A user-provided source for backfilling data. Historical data is used when creating a training set from streaming features linked to this Stream. * The backfill data stored in this location will be copied into the ingestion table for offline querying and training. * The schema for this source must match exactly that of the key and payload schemas specified for this Stream. */ - backfillSource?: BackfillSource | undefined; + backfillSource?: CreateBackfillSource | undefined; /** * Column paths used to identify duplicate rows during ingestion; only one row per * distinct combination of these values is kept. Use dot notation for nested fields * (e.g. `value.user_id`). Empty list means every column is compared. */ deduplicationColumns?: string[] | undefined; - /** - * The ID of the SDP pipeline that continuously copies new events from the streaming source - * into the ingestion Delta table. - */ - ingestionPipelineId?: string | undefined; - /** The ID of the Databricks Job that performs the forward-fill ingestion. */ - ingestionJobId?: bigint | undefined; - /** The ID of the Databricks Job that performs the historical backfill of the ingestion Delta table. */ - backfillJobId?: bigint | undefined; } /** Destination for the -managed Delta table that holds an offline copy of the streaming data for querying and training. */ -export interface IngestionDestination { +export interface CreateIngestionDestination { ingestionDestination?: | { $case: 'deltaTableName'; @@ -562,29 +607,29 @@ export interface IngestionDestination { | undefined; } -export interface JobContext { +export interface CreateJobContext { /** The job ID where this API invoked. */ jobId?: bigint | undefined; /** The job run ID where this API was invoked. */ jobRunId?: bigint | undefined; } -export interface KafkaConfig { +export interface CreateKafkaConfig { /** * Name that uniquely identifies this Kafka config within the metastore. This will be the identifier used from the Feature object to reference these configs for a feature. * Can be distinct from topic name. */ name?: string | undefined; /** A comma-separated list of host/port pairs pointing to Kafka cluster. */ - bootstrapServers?: string | undefined; + bootstrapServers: string; /** Options to configure which Kafka topics to pull data from. */ - subscriptionMode?: SubscriptionMode | undefined; + subscriptionMode: CreateSubscriptionMode; /** Authentication configuration for connection to topics. */ - authConfig?: AuthConfig | undefined; + authConfig: CreateAuthConfig; /** Schema configuration for extracting message keys from topics. At least one of key_schema and value_schema must be provided. */ - keySchema?: SchemaConfig | undefined; + keySchema?: CreateSchemaConfig | undefined; /** Schema configuration for extracting message values from topics. At least one of key_schema and value_schema must be provided. */ - valueSchema?: SchemaConfig | undefined; + valueSchema?: CreateSchemaConfig | undefined; /** Catch-all for miscellaneous options. Keys should be source options or Kafka consumer options (kafka.*) */ extraOptions?: Record | undefined; /** @@ -592,35 +637,39 @@ export interface KafkaConfig { * In the future, a separate table will be maintained by for forward filling data. * The schema for this source must match exactly that of the key and value schemas specified for this Kafka config. */ - backfillSource?: BackfillSource | undefined; + backfillSource?: CreateBackfillSource | undefined; /** * Configuration for ingesting Kafka data into a -managed * Delta table. */ - ingestionConfig?: IngestionConfig | undefined; + ingestionConfig?: CreateIngestionConfig | undefined; } -export interface KafkaSource { +export interface CreateKafkaConfigRequest { + kafkaConfig?: CreateKafkaConfig | undefined; +} + +export interface CreateKafkaSource { /** Name of the Kafka source, used to identify it. This is used to look up the corresponding KafkaConfig object. Can be distinct from topic name. */ - name?: string | undefined; + name: string; /** * Deprecated: Use Feature.entity instead. Kept for backwards compatibility. * The entity column identifiers of the Kafka source. */ - entityColumnIdentifiers?: ColumnIdentifier[] | undefined; + entityColumnIdentifiers?: CreateColumnIdentifier[] | undefined; /** * Deprecated: Use Feature.timeseries_column instead. Kept for backwards compatibility. * The timeseries column identifier of the Kafka source. */ - timeseriesColumnIdentifier?: ColumnIdentifier | undefined; + timeseriesColumnIdentifier?: CreateColumnIdentifier | undefined; /** The filter condition applied to the source data before aggregation. */ filterCondition?: string | undefined; } /** Kafka-specific configuration for a Stream. */ -export interface KafkaStreamConfig { +export interface CreateKafkaStreamConfig { /** Options to configure which Kafka topics to pull data from. */ - subscriptionMode?: KafkaSubscriptionMode | undefined; + subscriptionMode: CreateKafkaSubscriptionMode; /** * Optional Kafka source or consumer options, validated against a server-side * allowlist at request time. Allowed keys: @@ -639,7 +688,7 @@ export interface KafkaStreamConfig { } /** Subscription mode for Kafka topic selection, matching standard Spark Structured Streaming options. */ -export interface KafkaSubscriptionMode { +export interface CreateKafkaSubscriptionMode { /** These match the settings from https://spark.apache.org/docs/latest/streaming/structured-streaming-kafka-integration.html */ subscriptionMode?: | { @@ -664,173 +713,74 @@ export interface KafkaSubscriptionMode { } /** Returns the last N distinct values, ordered by the feature's timeseries column. */ -export interface LastDistinctNFunction { +export interface CreateLastDistinctNFunction { /** The input column from which the last N distinct values are returned. */ - input?: string | undefined; + input: string; /** The number of distinct values to return. */ - n?: bigint | undefined; + n: bigint; } /** Returns the last value. */ -export interface LastFunction { +export interface CreateLastFunction { /** The input column from which the last value is returned. */ - input?: string | undefined; + input: string; } /** Returns the last N values, ordered by the feature's timeseries column. */ -export interface LastNFunction { +export interface CreateLastNFunction { /** The input column from which the last N values are returned. */ - input?: string | undefined; + input: string; /** The number of values to return. */ - n?: bigint | undefined; + n: bigint; } /** Lineage context information for tracking where an API was invoked. This will allow us to track lineage, which currently uses caller entity information for use across the Lineage Client and Observability in Lumberjack. */ -export interface LineageContext { +export interface CreateLineageContext { /** The notebook ID where this API was invoked. */ notebookId?: bigint | undefined; /** Job context information including job ID and run ID. */ - jobContext?: JobContext | undefined; -} - -/** - * Request to list features. Listing is always scoped to a single catalog and schema; - * catalog_name and schema_name are required. - */ -export interface ListFeaturesRequest { - /** Pagination token to go to the next page based on a previous query. */ - pageToken?: string | undefined; - /** The maximum number of results to return. */ - pageSize?: number | undefined; - /** Name of parent catalog for features of interest. */ - catalogName?: string | undefined; - /** Name of parent schema relative to its parent catalog. */ - schemaName?: string | undefined; -} - -export interface ListFeaturesResponse { - /** List of features. */ - features?: Feature[] | undefined; - /** Pagination token to request the next page of results for this query. */ - nextPageToken?: string | undefined; -} - -export interface ListKafkaConfigsRequest { - /** Pagination token to go to the next page based on a previous query. */ - pageToken?: string | undefined; - /** The maximum number of results to return. */ - pageSize?: number | undefined; -} - -export interface ListKafkaConfigsResponse { - /** List of Kafka configs. Schemas are not included in the response. */ - kafkaConfigs?: KafkaConfig[] | undefined; - /** Pagination token to request the next page of results for this query. */ - nextPageToken?: string | undefined; -} - -export interface ListMaterializedFeaturesRequest { - /** Filter by feature name. If specified, only materialized features materialized from this feature will be returned. */ - featureName?: string | undefined; - /** Pagination token to go to the next page based on a previous query. */ - pageToken?: string | undefined; - /** The maximum number of results to return. Defaults to 100 if not specified. Cannot be greater than 1000. */ - pageSize?: number | undefined; -} - -export interface ListMaterializedFeaturesResponse { - /** List of materialized features. */ - materializedFeatures?: MaterializedFeature[] | undefined; - /** Pagination token to request the next page of results for this query. */ - nextPageToken?: string | undefined; -} - -/** - * List Streams under a given parent. - * - * NOTE: Results are post-filtered by access permission on each stream's ingestion - * table. This means: - * - Returned results may be fewer than page_size (including zero) - * - Page token points to next unfiltered batch, not next filtered batch, and may - * point to an item that will be filtered out - * - Callers should paginate until next_page_token is empty to retrieve all - * accessible streams - */ -export interface ListStreamsRequest { - /** Two-part name (catalog.schema) of the parent under which to list Streams. */ - parent?: string | undefined; - /** The maximum number of results to return. */ - pageSize?: number | undefined; - /** Pagination token to go to the next page based on a previous query. */ - pageToken?: string | undefined; -} - -/** - * Response to a ListStreamsRequest. - * - * NOTE: Results are post-filtered by access permission on each stream's ingestion - * table. This means: - * - Returned results may be fewer than page_size (including zero) - * - Page token points to next unfiltered batch, not next filtered batch, and may - * point to an item that will be filtered out - * Callers should paginate until next_page_token is empty to retrieve all - * accessible streams. - */ -export interface ListStreamsResponse { - /** List of Streams. */ - streams?: Stream[] | undefined; - /** Pagination token to request the next page of results for this query. */ - nextPageToken?: string | undefined; + jobContext?: CreateJobContext | undefined; } /** A materialized feature represents a feature that is continuously computed and stored. */ -export interface MaterializedFeature { +export interface CreateMaterializedFeature { /** Server-assigned unique identifier for the materialized feature. */ materializedFeatureId?: string | undefined; /** The full name of the feature in Unity Catalog. */ - featureName?: string | undefined; + featureName: string; destination?: | { $case: 'offlineStoreConfig'; /** Destination for writing feature values to an offline Delta table. */ - offlineStoreConfig: OfflineStoreConfig; + offlineStoreConfig: CreateOfflineStoreConfig; } | { $case: 'onlineStoreConfig'; /** Destination for writing feature values to an online Lakebase table. */ - onlineStoreConfig: OnlineStoreConfig; + onlineStoreConfig: CreateOnlineStoreConfig; } | undefined; - /** The fully qualified Unity Catalog path to the table containing the materialized feature (Delta table or Lakebase table). Output only. */ - tableName?: string | undefined; /** * The schedule state of the materialization pipeline. * Hidden from GraphQL: being deprecated, so not exposed to Catalog Explorer. */ pipelineScheduleState?: MaterializedFeature_PipelineScheduleState | undefined; - /** - * The timestamp when the pipeline last ran and updated the materialized feature values. - * If the pipeline has not run yet, this field will be null. - */ - lastMaterializationTime?: Temporal.Instant | undefined; /** * The quartz cron expression that defines the schedule of the materialization pipeline. The schedule is evaluated in the UTC timezone. * Hidden from GraphQL: superseded by the `trigger` oneof (cron_schedule_trigger), so not exposed to Catalog Explorer. */ cronSchedule?: string | undefined; - /** True if this is an online materialized feature. False if it is an offline materialized feature. */ - isOnline?: boolean | undefined; /** The trigger configuration for the materialization pipeline. */ trigger?: | { $case: 'cronScheduleTrigger'; /** A cron-based schedule trigger for the materialization pipeline. */ - cronScheduleTrigger: CronSchedule; + cronScheduleTrigger: CreateCronSchedule; } | { $case: 'tableTrigger'; /** A trigger that fires when the upstream source table changes. */ - tableTrigger: TableTrigger; + tableTrigger: CreateTableTrigger; } | { $case: 'streamingMode'; @@ -839,21 +789,26 @@ export interface MaterializedFeature { * sub-second latency for operational workloads; micro-batch mode (MBM) favors cost efficiency * for ETL and analytics workloads. */ - streamingMode: StreamingMode; + streamingMode: CreateStreamingMode; } | undefined; } +export interface CreateMaterializedFeatureRequest { + /** The materialized feature to create. */ + materializedFeature?: CreateMaterializedFeature | undefined; +} + /** Computes the maximum value. */ -export interface MaxFunction { +export interface CreateMaxFunction { /** The input column from which the maximum is computed. */ - input?: string | undefined; + input: string; } /** Computes the minimum value. */ -export interface MinFunction { +export interface CreateMinFunction { /** The input column from which the minimum is computed. */ - input?: string | undefined; + input: string; } /** @@ -869,29 +824,29 @@ export interface MinFunction { * kafka.ssl.truststore.password). Passwords are resolved on the Spark cluster via * dbutils.secrets.get; this message stores only references, never password values. */ -export interface MtlsConfig { +export interface CreateMtlsConfig { /** * Unity Catalog volume path to the JKS keystore file containing the client certificate * and private key. e.g. "/Volumes////client.jks". The * materialization compute must have read permission on this volume. */ - keystoreLocation?: string | undefined; + keystoreLocation: string; /** Secret-scope reference for the JKS keystore password. */ - keystorePasswordRef?: SecretScopeReference | undefined; + keystorePasswordRef: CreateSecretScopeReference; /** * Secret-scope reference for the private key password. Often the same value as the * keystore password (keytool's default), but provided as a separate field because * Apache Kafka requires it as a distinct option (kafka.ssl.key.password). */ - keyPasswordRef?: SecretScopeReference | undefined; + keyPasswordRef: CreateSecretScopeReference; /** * Unity Catalog volume path to the JKS truststore file containing the CA certificate(s) * trusted to verify the Kafka broker's server certificate. * e.g. "/Volumes////truststore.jks". */ - truststoreLocation?: string | undefined; + truststoreLocation: string; /** Secret-scope reference for the JKS truststore password. */ - truststorePasswordRef?: SecretScopeReference | undefined; + truststorePasswordRef: CreateSecretScopeReference; /** * Set to true only when the broker certificate's SAN intentionally does not match * the connection endpoint — for example when reaching the cluster through a @@ -906,47 +861,47 @@ export interface MtlsConfig { } /** Configuration for offline store destination. */ -export interface OfflineStoreConfig { +export interface CreateOfflineStoreConfig { /** The Unity Catalog catalog name. */ - catalogName?: string | undefined; + catalogName: string; /** The Unity Catalog schema name. */ - schemaName?: string | undefined; + schemaName: string; /** * Prefix for Unity Catalog table name. * The materialized feature will be stored in a table with this prefix and a generated postfix. */ - tableNamePrefix?: string | undefined; + tableNamePrefix: string; } /** Configuration for online store destination. */ -export interface OnlineStoreConfig { +export interface CreateOnlineStoreConfig { /** * The Unity Catalog catalog name. This name is also used as the Lakebase logical database name. * Quoting is handled by the backend where needed, do not pre-quote it. */ - catalogName?: string | undefined; + catalogName: string; /** * The Unity Catalog schema name. This name is also used as the Lakebase schema name under the database. * Quoting is handled by the backend where needed, do not pre-quote it. */ - schemaName?: string | undefined; + schemaName: string; /** * Prefix for Unity Catalog table name. * The materialized feature will be stored in a Lakebase table with this prefix and a generated postfix. */ - tableNamePrefix?: string | undefined; + tableNamePrefix: string; /** The name of the target online store. */ - onlineStoreName?: string | undefined; + onlineStoreName: string; } /** A request-time data source whose value is provided at inference time: offline batch scoring or online serving endpoint */ -export interface RequestSource { +export interface CreateRequestSource { /** The schema describing the request-time fields. Currently only flat schemas are supported. */ schema?: | { $case: 'flatSchema'; /** A flat schema with scalar-typed fields only. */ - flatSchema: FlatSchema; + flatSchema: CreateFlatSchema; } | undefined; } @@ -956,9 +911,9 @@ export interface RequestSource { * replacement for ContinuousWindow: `delay` is the non-negative counterpart * of the legacy non-positive `ContinuousWindow.offset`. */ -export interface RollingWindow { +export interface CreateRollingWindow { /** The duration of the rolling window (must be positive). */ - windowDuration?: Temporal.Duration | undefined; + windowDuration: Temporal.Duration; /** * The delay applied to the end of the rolling window (must be non-negative). * For example, delay=1d shifts the window end 1 day before the evaluation time. @@ -966,7 +921,7 @@ export interface RollingWindow { delay?: Temporal.Duration | undefined; } -export interface SchemaConfig { +export interface CreateSchemaConfig { schema?: | { $case: 'jsonSchema'; @@ -980,74 +935,61 @@ export interface SchemaConfig { * Reference to an entry in a secret scope. The referenced value is fetched * on the Spark cluster at materialization time via dbutils.secrets.get(scope, key). */ -export interface SecretScopeReference { +export interface CreateSecretScopeReference { /** The secret scope name. */ - scope?: string | undefined; + scope: string; /** The key within the scope. */ - key?: string | undefined; + key: string; } -export interface SlidingWindow { +export interface CreateSlidingWindow { /** The duration of the sliding window. */ - windowDuration?: Temporal.Duration | undefined; + windowDuration: Temporal.Duration; /** The slide duration (interval by which windows advance, must be positive and less than duration). */ - slideDuration?: Temporal.Duration | undefined; + slideDuration: Temporal.Duration; } /** Computes the population standard deviation. */ -export interface StddevPopFunction { +export interface CreateStddevPopFunction { /** * The input column from which the population standard deviation is computed. For Kafka sources, * use dot-prefixed path notation (e.g., "value.amount"). For nested fields, the leaf node name is used. * Colon-prefixed notation (e.g., "value:amount") is supported for backwards * compatibility but is deprecated; migrate to dot notation. */ - input?: string | undefined; + input: string; } /** Computes the sample standard deviation. */ -export interface StddevSampFunction { +export interface CreateStddevSampFunction { /** The input column from which the sample standard deviation is computed. */ - input?: string | undefined; + input: string; } /** * A Stream is a governed UC entity representing an external streaming data source. * The source_config oneof determines the streaming platform source (e.g. Kafka, Kinesis, etc.). */ -export interface Stream { +export interface CreateStream { /** Full three-part (catalog.schema.stream) name of the stream. */ name?: string | undefined; /** User-provided description. */ description?: string | undefined; /** Source-specific configuration. Determines the streaming platform source. */ - sourceConfig?: StreamSourceConfig | undefined; + sourceConfig: CreateStreamSourceConfig; /** Specifies how to connect and authenticate to the stream platform. */ - connectionConfig?: StreamConnectionConfig | undefined; + connectionConfig: CreateStreamConnectionConfig; /** * Schema definitions for the stream. Currently only direct schemas are supported. * In a future milestone, we will support schema registries through a UC Connection. */ - schemaConfig?: StreamSchemaConfig | undefined; + schemaConfig: CreateStreamSchemaConfig; /** Configuration for streaming data ingestion: the managed table storing an offline copy of forward fill data and optional historical backfill. */ - ingestionConfig?: IngestionConfig | undefined; - /** Time at which this Stream was created. */ - createTime?: Temporal.Instant | undefined; - /** Username of the Stream creator. */ - createdBy?: string | undefined; - /** Time at which this Stream was last modified. */ - updateTime?: Temporal.Instant | undefined; - /** Username of user who last modified the Stream. */ - updatedBy?: string | undefined; - /** - * Indicates whether the principal is limited to retrieving metadata for the - * associated object through the BROWSE privilege when include_browse is enabled in the request. - */ - browseOnly?: boolean | undefined; + ingestionConfig: CreateIngestionConfig; } /** Specifies how to connect and authenticate to the stream platform. */ -export interface StreamConnectionConfig { +export interface CreateStreamConnectionConfig { connectionConfig?: | { $case: 'ucConnectionName'; @@ -1063,52 +1005,58 @@ export interface StreamConnectionConfig { * Direct mTLS configuration for stream platform access. This is only used in the short term until UC Kafka Connections support mTLS . * Once UC Kafka Connections support mTLS, this will be deprecated. */ - directMtlsConfig: DirectMtlsConfig; + directMtlsConfig: CreateDirectMtlsConfig; } | undefined; } +/** Create a Stream, a governed UC entity representing an external streaming data source. */ +export interface CreateStreamRequest { + /** The Stream to create. */ + stream?: CreateStream | undefined; +} + /** * Schema definitions for the stream. Currently only direct schemas are supported. * In a future milestone, we will support schema registries through a UC Connection. */ -export interface StreamSchemaConfig { +export interface CreateStreamSchemaConfig { schemaConfig?: | { $case: 'directSchemas'; /** Schema definitions provided directly on the Stream. */ - directSchemas: DirectSchemas; + directSchemas: CreateDirectSchemas; } | undefined; } /** A Stream entity used as a data source for a feature. */ -export interface StreamSource { +export interface CreateStreamSource { /** Three-part full name of the Stream (catalog.schema.stream). */ - fullName?: string | undefined; + fullName: string; /** The filter condition applied to the source data before aggregation. */ filterCondition?: string | undefined; } /** Source-specific configuration. Determines the streaming platform source. */ -export interface StreamSourceConfig { +export interface CreateStreamSourceConfig { sourceConfig?: | { $case: 'kafkaStreamConfig'; /** Configuration for Apache Kafka streams. */ - kafkaStreamConfig: KafkaStreamConfig; + kafkaStreamConfig: CreateKafkaStreamConfig; } | undefined; } /** The streaming mode configuration for a streaming materialization pipeline. */ -export interface StreamingMode { +export interface CreateStreamingMode { /** The type of streaming mode used by the materialization pipeline. */ mode?: StreamingMode_StreamingModeType | undefined; } /** Deprecated: Use KafkaSubscriptionMode instead. */ -export interface SubscriptionMode { +export interface CreateSubscriptionMode { /** These match the settings from https://spark.apache.org/docs/latest/streaming/structured-streaming-kafka-integration.html */ subscriptionMode?: | { @@ -1133,30 +1081,30 @@ export interface SubscriptionMode { } /** Computes the sum of values. */ -export interface SumFunction { +export interface CreateSumFunction { /** * The input column from which the sum is computed. For Kafka sources, use dot-prefixed path * notation (e.g., "value.amount"). For nested fields, the leaf node name is used. * Colon-prefixed notation (e.g., "value:amount") is supported for backwards * compatibility but is deprecated; migrate to dot notation. */ - input?: string | undefined; + input: string; } /** A trigger that fires when the upstream source table changes. */ // eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface TableTrigger {} +export interface CreateTableTrigger {} -export interface TimeWindow { +export interface CreateTimeWindow { windowType?: - | {$case: 'continuous'; continuous: ContinuousWindow} - | {$case: 'tumbling'; tumbling: TumblingWindow} - | {$case: 'sliding'; sliding: SlidingWindow} - | {$case: 'rolling'; rolling: RollingWindow} + | {$case: 'continuous'; continuous: CreateContinuousWindow} + | {$case: 'tumbling'; tumbling: CreateTumblingWindow} + | {$case: 'sliding'; sliding: CreateSlidingWindow} + | {$case: 'rolling'; rolling: CreateRollingWindow} | undefined; } -export interface TimeseriesColumn { +export interface CreateTimeseriesColumn { /** * The name of the timeseries column. For Kafka sources, use dot-prefixed path notation to * reference fields within the key or value schema (e.g., "value.event_timestamp"). For nested @@ -1165,200 +1113,2966 @@ export interface TimeseriesColumn { * Colon-prefixed notation (e.g., "value:event_timestamp") is supported for * backwards compatibility but is deprecated; migrate to dot notation. */ - name?: string | undefined; + name: string; } -export interface TumblingWindow { +export interface CreateTumblingWindow { /** The duration of each tumbling window (non-overlapping, fixed-duration windows). */ - windowDuration?: Temporal.Duration | undefined; + windowDuration: Temporal.Duration; } -export interface UpdateFeatureRequest { - /** Feature to update. */ - feature?: Feature | undefined; - /** The list of fields to update. */ - updateMask?: FieldMask | undefined; +/** Computes the population variance. */ +export interface CreateVarPopFunction { + /** The input column from which the population variance is computed. */ + input: string; } -export interface UpdateKafkaConfigRequest { - /** The Kafka config to update. */ - kafkaConfig?: KafkaConfig | undefined; - /** The list of fields to update. */ - updateMask?: FieldMask | undefined; +/** Computes the sample variance. */ +export interface CreateVarSampFunction { + /** The input column from which the sample variance is computed. */ + input: string; } -export interface UpdateMaterializedFeatureRequest { - /** The materialized feature to update. */ - materializedFeature?: MaterializedFeature | undefined; - /** - * Provide the materialization feature fields which should be updated. - * Currently, only the pipeline_state field can be updated. - */ - updateMask?: FieldMask | undefined; +/** A cron-based schedule trigger for the materialization pipeline. */ +export interface CronSchedule { + /** The cron expression defining the schedule (e.g., "0 0 * * *" for daily at midnight). */ + cronExpression?: string | undefined; } -/** Update a Stream. Only fields listed in `update_mask` are mutated. */ -export interface UpdateStreamRequest { - /** The Stream to update. */ - stream?: Stream | undefined; - /** The list of fields to update. */ - updateMask?: FieldMask | undefined; +/** Specifies the data source backing a feature. Exactly one source type must be set. */ +export interface DataSource { + dataSource?: + | { + $case: 'deltaTableSource'; + /** A Delta table data source. */ + deltaTableSource: DeltaTableSource; + } + | { + $case: 'kafkaSource'; + /** A Kafka stream data source. */ + kafkaSource: KafkaSource; + } + | { + $case: 'requestSource'; + /** A request-time data source. */ + requestSource: RequestSource; + } + | { + $case: 'streamSource'; + /** A Stream data source. */ + streamSource: StreamSource; + } + | undefined; } -/** Computes the population variance. */ -export interface VarPopFunction { - /** The input column from which the population variance is computed. */ - input?: string | undefined; +export interface DeleteFeatureRequest { + /** Name of the feature to delete. */ + fullName?: string | undefined; } -/** Computes the sample variance. */ -export interface VarSampFunction { - /** The input column from which the sample variance is computed. */ - input?: string | undefined; +export interface DeleteKafkaConfigRequest { + /** Name of the Kafka config to delete. */ + name?: string | undefined; } -export const unmarshalAggregationFunctionSchema: z.ZodType = - z - .object({ - avg: z.lazy(() => unmarshalAvgFunctionSchema).optional(), - count_function: z.lazy(() => unmarshalCountFunctionSchema).optional(), - sum: z.lazy(() => unmarshalSumFunctionSchema).optional(), - min: z.lazy(() => unmarshalMinFunctionSchema).optional(), - max: z.lazy(() => unmarshalMaxFunctionSchema).optional(), - first: z.lazy(() => unmarshalFirstFunctionSchema).optional(), - last: z.lazy(() => unmarshalLastFunctionSchema).optional(), - approx_count_distinct: z - .lazy(() => unmarshalApproxCountDistinctFunctionSchema) - .optional(), - approx_percentile: z - .lazy(() => unmarshalApproxPercentileFunctionSchema) - .optional(), - stddev_pop: z.lazy(() => unmarshalStddevPopFunctionSchema).optional(), - stddev_samp: z.lazy(() => unmarshalStddevSampFunctionSchema).optional(), - var_pop: z.lazy(() => unmarshalVarPopFunctionSchema).optional(), +export interface DeleteMaterializedFeatureRequest { + /** The ID of the materialized feature to delete. */ + materializedFeatureId?: string | undefined; +} + +/** Delete a Stream by its full three-part name (catalog.schema.stream). */ +export interface DeleteStreamRequest { + /** Full three-part name (catalog.schema.stream) of the Stream to delete. */ + name?: string | undefined; +} + +export interface DeltaTableSource { + /** The full three-part (catalog, schema, table) name of the Delta table. */ + fullName?: string | undefined; + /** + * Deprecated: Use Feature.entity instead. Kept for backwards compatibility. + * The entity columns of the Delta table. + */ + entityColumns?: string[] | undefined; + /** + * Deprecated: Use Feature.timeseries_column instead. Kept for backwards compatibility. + * The timeseries column of the Delta table. + */ + timeseriesColumn?: string | undefined; + /** Single WHERE clause to filter delta table before applying transformations. Will be row-wise evaluated, so should only include conditionals and projections. */ + filterCondition?: string | undefined; + /** + * A single SQL SELECT expression applied after filter_condition. + * Should contains all the columns needed (eg. "SELECT *, col_a + col_b AS col_c FROM x.y.z WHERE col_a > 0" would have `transformation_sql` "*, col_a + col_b AS col_c") + * If transformation_sql is not provided, all columns of the delta table are present in the DataSource dataframe. + */ + transformationSql?: string | undefined; + /** + * Schema of the resulting dataframe after transformations, in Spark StructType JSON format (from df.schema.json()). + * Required if transformation_sql is specified. + * Example: {"type":"struct","fields":[{"name":"col_a","type":"integer","nullable":true,"metadata":{}},{"name":"col_c","type":"integer","nullable":true,"metadata":{}}]} + */ + dataframeSchema?: string | undefined; +} + +/** + * Direct connection configs for mTLS, as Kafka Connections do not support mTLS yet . + * Temporarily used until UC Kafka Connections gain mTLS support. + */ +export interface DirectMtlsConfig { + /** A comma-separated list of host:port pairs for the Kafka bootstrap servers. */ + bootstrapServers?: string | undefined; + /** Mutual-TLS authentication configuration. */ + mtlsConfig?: MtlsConfig | undefined; +} + +/** + * Schema definitions provided directly on the Stream, as opposed to referencing a schema registry. + * In a future milestone, we will support schema registries through a UC Connection. + */ +export interface DirectSchemas { + /** + * Schema for the message payload. For Kafka, this is the value schema. + * Unless the platform supports another schema (e.g. keys for Kafka), this must be specified. + */ + payloadSchema?: SchemaConfig | undefined; + /** + * Schema for the message key. This is only used for Kafka streams. + * For Kafka, at least one of payload_schema or key_schema must be specified. + */ + keySchema?: SchemaConfig | undefined; +} + +export interface EntityColumn { + /** + * The name of the entity column. For Kafka sources, use dot-prefixed path notation to reference + * fields within the key or value schema (e.g., "value.user_id", "key.partition_key"). For nested + * fields, the leaf node name (e.g., "user_id" from "value.trip_details.user_id") is what will + * be present in materialized tables and expected to match at query time. + * Colon-prefixed notation (e.g., "value:user_id") is supported for backwards + * compatibility but is deprecated; migrate to dot notation. + */ + name?: string | undefined; +} + +export interface Feature { + /** + * The full three-part name (catalog, schema, name) of the feature. This is the + * feature's resource identifier; the catalog_name, schema_name, and name fields + * below are OUTPUT_ONLY decomposed views of this value. + */ + fullName?: string | undefined; + /** The data source of the feature. */ + source?: DataSource | undefined; + /** + * Deprecated: Use AggregationFunction.inputs instead. Kept for backwards compatibility. + * The input columns from which the feature is computed. + */ + inputs?: string[] | undefined; + /** The function by which the feature is computed. */ + function?: Function | undefined; + /** + * Deprecated: Use Function.aggregation_function.time_window instead. Kept for backwards compatibility. + * The time window in which the feature is computed. + */ + timeWindow?: TimeWindow | undefined; + /** The description of the feature. */ + description?: string | undefined; + /** + * Deprecated: Use DeltaTableSource.filter_condition or KafkaSource.filter_condition instead. Kept for backwards compatibility. + * The filter condition applied to the source data before aggregation. + */ + filterCondition?: string | undefined; + /** + * Lineage context information for this feature. + * WARNING: This field is primarily intended for internal use by systems and + * is automatically populated when features are created through notebooks or jobs. + * Users should not manually set this field as incorrect values may lead to inaccurate lineage tracking or unexpected behavior. + * This field will be set by feature-engineering client and should be left unset by SDK and terraform users. + */ + lineageContext?: LineageContext | undefined; + /** The entity columns for the feature, used as aggregation keys and for query-time lookup. */ + entities?: EntityColumn[] | undefined; + /** Column recording time, used for point-in-time joins, backfills, and aggregations. */ + timeseriesColumn?: TimeseriesColumn | undefined; + /** Name of parent catalog. */ + catalogName?: string | undefined; + /** Name of parent schema relative to its parent catalog. */ + schemaName?: string | undefined; + /** Name of the feature, extracted from the full three-part name (catalog.schema.name). */ + name?: string | undefined; + /** Time at which this feature was created. */ + createdAt?: Temporal.Instant | undefined; + /** Username of the feature creator. */ + createdBy?: string | undefined; +} + +/** + * A single field definition within a FlatSchema, specifying the field name and its scalar data type. + * Does not support nested or complex types (arrays, maps, structs). + */ +export interface FieldDefinition { + /** The name of the field. */ + name?: string | undefined; + /** The scalar data type of the field. */ + dataType?: ScalarDataType | undefined; +} + +/** Returns the first N distinct values, ordered by the feature's timeseries column. */ +export interface FirstDistinctNFunction { + /** The input column from which the first N distinct values are returned. */ + input?: string | undefined; + /** The number of distinct values to return. */ + n?: bigint | undefined; +} + +/** Returns the first value. */ +export interface FirstFunction { + /** The input column from which the first value is returned. */ + input?: string | undefined; +} + +/** Returns the first N values, ordered by the feature's timeseries column. */ +export interface FirstNFunction { + /** The input column from which the first N values are returned. */ + input?: string | undefined; + /** The number of values to return. */ + n?: bigint | undefined; +} + +/** + * A flat (non-nested) schema for request-time fields, defined as an ordered list of field definitions. + * This schema only supports scalar types. + */ +export interface FlatSchema { + /** The list of fields in this schema. */ + fields?: FieldDefinition[] | undefined; +} + +export interface Function { + /** + * Deprecated: Use the function oneof with AggregationFunction instead. Kept for backwards compatibility. + * The type of the function. + */ + functionType?: Function_FunctionType | undefined; + /** + * Deprecated: Use the function oneof with AggregationFunction instead. Kept for backwards compatibility. + * Extra parameters for parameterized functions. + */ + extraParameters?: Function_ExtraParameter[] | undefined; + function?: + | { + $case: 'aggregationFunction'; + /** An aggregation function applied over a time window. */ + aggregationFunction: AggregationFunction; + } + | { + $case: 'columnSelection'; + /** Selects the latest value of a single column in a data source */ + columnSelection: ColumnSelection; + } + | undefined; +} + +/** + * Deprecated: Use typed fields on function-specific messages (e.g. ApproxPercentileFunction.percentile) + * or AggregationFunction.ExtraParameter instead. Kept for backwards compatibility. + */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface Function_CreateExtraParameter { + /** The name of the parameter. */ + key: string; + /** The value of the parameter. */ + value: string; +} + +/** + * Deprecated: Use typed fields on function-specific messages (e.g. ApproxPercentileFunction.percentile) + * or AggregationFunction.ExtraParameter instead. Kept for backwards compatibility. + */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface Function_ExtraParameter { + /** The name of the parameter. */ + key?: string | undefined; + /** The value of the parameter. */ + value?: string | undefined; +} + +/** + * Deprecated: Use typed fields on function-specific messages (e.g. ApproxPercentileFunction.percentile) + * or AggregationFunction.ExtraParameter instead. Kept for backwards compatibility. + */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface Function_UpdateExtraParameter { + /** The name of the parameter. */ + key?: string | undefined; + /** The value of the parameter. */ + value?: string | undefined; +} + +export interface GetFeatureRequest { + /** Name of the feature to get. */ + fullName?: string | undefined; +} + +export interface GetKafkaConfigRequest { + /** Name of the Kafka config to get. */ + name?: string | undefined; +} + +export interface GetMaterializedFeatureRequest { + /** The ID of the materialized feature. */ + materializedFeatureId?: string | undefined; +} + +/** Get a Stream by its full three-part name (catalog.schema.stream). */ +export interface GetStreamRequest { + /** Full three-part name (catalog.schema.stream) of the Stream to get. */ + name?: string | undefined; +} + +/** + * Configuration for the -managed ingestion pipeline. + * Groups the ingestion destination (required) and optional backfill source. + */ +export interface IngestionConfig { + /** + * Destination for the -managed Delta table that holds an offline copy of the streaming data for querying and training. + * This table contains both 1) forward-filled data from the Stream and 2) backfilled data from the BackfillSource (if provided). + * This table is created and managed by and is deleted when the Stream is deleted. + */ + ingestionDestination?: IngestionDestination | undefined; + /** + * A user-provided source for backfilling data. Historical data is used when creating a training set from streaming features linked to this Stream. + * The backfill data stored in this location will be copied into the ingestion table for offline querying and training. + * The schema for this source must match exactly that of the key and payload schemas specified for this Stream. + */ + backfillSource?: BackfillSource | undefined; + /** + * Column paths used to identify duplicate rows during ingestion; only one row per + * distinct combination of these values is kept. Use dot notation for nested fields + * (e.g. `value.user_id`). Empty list means every column is compared. + */ + deduplicationColumns?: string[] | undefined; + /** + * The ID of the SDP pipeline that continuously copies new events from the streaming source + * into the ingestion Delta table. + */ + ingestionPipelineId?: string | undefined; + /** The ID of the Databricks Job that performs the forward-fill ingestion. */ + ingestionJobId?: bigint | undefined; + /** The ID of the Databricks Job that performs the historical backfill of the ingestion Delta table. */ + backfillJobId?: bigint | undefined; +} + +/** Destination for the -managed Delta table that holds an offline copy of the streaming data for querying and training. */ +export interface IngestionDestination { + ingestionDestination?: + | { + $case: 'deltaTableName'; + /** The full three-part name (catalog, schema, name) of the Delta table to be created for ingestion. */ + deltaTableName: string; + } + | undefined; +} + +export interface JobContext { + /** The job ID where this API invoked. */ + jobId?: bigint | undefined; + /** The job run ID where this API was invoked. */ + jobRunId?: bigint | undefined; +} + +export interface KafkaConfig { + /** + * Name that uniquely identifies this Kafka config within the metastore. This will be the identifier used from the Feature object to reference these configs for a feature. + * Can be distinct from topic name. + */ + name?: string | undefined; + /** A comma-separated list of host/port pairs pointing to Kafka cluster. */ + bootstrapServers?: string | undefined; + /** Options to configure which Kafka topics to pull data from. */ + subscriptionMode?: SubscriptionMode | undefined; + /** Authentication configuration for connection to topics. */ + authConfig?: AuthConfig | undefined; + /** Schema configuration for extracting message keys from topics. At least one of key_schema and value_schema must be provided. */ + keySchema?: SchemaConfig | undefined; + /** Schema configuration for extracting message values from topics. At least one of key_schema and value_schema must be provided. */ + valueSchema?: SchemaConfig | undefined; + /** Catch-all for miscellaneous options. Keys should be source options or Kafka consumer options (kafka.*) */ + extraOptions?: Record | undefined; + /** + * A user-provided and managed source for backfilling data. Historical data is used when creating a training set from streaming features linked to this Kafka config. + * In the future, a separate table will be maintained by for forward filling data. + * The schema for this source must match exactly that of the key and value schemas specified for this Kafka config. + */ + backfillSource?: BackfillSource | undefined; + /** + * Configuration for ingesting Kafka data into a -managed + * Delta table. + */ + ingestionConfig?: IngestionConfig | undefined; +} + +export interface KafkaSource { + /** Name of the Kafka source, used to identify it. This is used to look up the corresponding KafkaConfig object. Can be distinct from topic name. */ + name?: string | undefined; + /** + * Deprecated: Use Feature.entity instead. Kept for backwards compatibility. + * The entity column identifiers of the Kafka source. + */ + entityColumnIdentifiers?: ColumnIdentifier[] | undefined; + /** + * Deprecated: Use Feature.timeseries_column instead. Kept for backwards compatibility. + * The timeseries column identifier of the Kafka source. + */ + timeseriesColumnIdentifier?: ColumnIdentifier | undefined; + /** The filter condition applied to the source data before aggregation. */ + filterCondition?: string | undefined; +} + +/** Kafka-specific configuration for a Stream. */ +export interface KafkaStreamConfig { + /** Options to configure which Kafka topics to pull data from. */ + subscriptionMode?: KafkaSubscriptionMode | undefined; + /** + * Optional Kafka source or consumer options, validated against a server-side + * allowlist at request time. Allowed keys: + * - `maxOffsetsPerTrigger` + * - `startingOffsets` + * - `includeHeaders` + * - `kafka.request.timeout.ms` + * - `kafka.session.timeout.ms` + * - `kafka.max.partition.fetch.bytes` + * The following keys are ingestion-only and are stripped before being forwarded to the materialization pipeline: + * - `maxOffsetsPerTrigger` + * - `startingOffsets` + * Auth and connection details belong on the parent Stream's `connection_config`, not here. + */ + extraOptions?: Record | undefined; +} + +/** Subscription mode for Kafka topic selection, matching standard Spark Structured Streaming options. */ +export interface KafkaSubscriptionMode { + /** These match the settings from https://spark.apache.org/docs/latest/streaming/structured-streaming-kafka-integration.html */ + subscriptionMode?: + | { + $case: 'assign'; + /** + * A JSON string that contains the specific topic-partitions to consume from. + * For example, for '{"topicA":[0,1],"topicB":[2,4]}', topicA's 0'th and 1st partitions will be consumed from. + */ + assign: string; + } + | { + $case: 'subscribe'; + /** A comma-separated list of Kafka topics to read from. For example, 'topicA,topicB,topicC'. */ + subscribe: string; + } + | { + $case: 'subscribePattern'; + /** A regular expression matching topics to subscribe to. For example, 'topic.*' will subscribe to all topics starting with 'topic'. */ + subscribePattern: string; + } + | undefined; +} + +/** Returns the last N distinct values, ordered by the feature's timeseries column. */ +export interface LastDistinctNFunction { + /** The input column from which the last N distinct values are returned. */ + input?: string | undefined; + /** The number of distinct values to return. */ + n?: bigint | undefined; +} + +/** Returns the last value. */ +export interface LastFunction { + /** The input column from which the last value is returned. */ + input?: string | undefined; +} + +/** Returns the last N values, ordered by the feature's timeseries column. */ +export interface LastNFunction { + /** The input column from which the last N values are returned. */ + input?: string | undefined; + /** The number of values to return. */ + n?: bigint | undefined; +} + +/** Lineage context information for tracking where an API was invoked. This will allow us to track lineage, which currently uses caller entity information for use across the Lineage Client and Observability in Lumberjack. */ +export interface LineageContext { + /** The notebook ID where this API was invoked. */ + notebookId?: bigint | undefined; + /** Job context information including job ID and run ID. */ + jobContext?: JobContext | undefined; +} + +/** + * Request to list features. Listing is always scoped to a single catalog and schema; + * catalog_name and schema_name are required. + */ +export interface ListFeaturesRequest { + /** Pagination token to go to the next page based on a previous query. */ + pageToken?: string | undefined; + /** The maximum number of results to return. */ + pageSize?: number | undefined; + /** Name of parent catalog for features of interest. */ + catalogName?: string | undefined; + /** Name of parent schema relative to its parent catalog. */ + schemaName?: string | undefined; +} + +export interface ListFeaturesResponse { + /** List of features. */ + features?: Feature[] | undefined; + /** Pagination token to request the next page of results for this query. */ + nextPageToken?: string | undefined; +} + +export interface ListKafkaConfigsRequest { + /** Pagination token to go to the next page based on a previous query. */ + pageToken?: string | undefined; + /** The maximum number of results to return. */ + pageSize?: number | undefined; +} + +export interface ListKafkaConfigsResponse { + /** List of Kafka configs. Schemas are not included in the response. */ + kafkaConfigs?: KafkaConfig[] | undefined; + /** Pagination token to request the next page of results for this query. */ + nextPageToken?: string | undefined; +} + +export interface ListMaterializedFeaturesRequest { + /** Filter by feature name. If specified, only materialized features materialized from this feature will be returned. */ + featureName?: string | undefined; + /** Pagination token to go to the next page based on a previous query. */ + pageToken?: string | undefined; + /** The maximum number of results to return. Defaults to 100 if not specified. Cannot be greater than 1000. */ + pageSize?: number | undefined; +} + +export interface ListMaterializedFeaturesResponse { + /** List of materialized features. */ + materializedFeatures?: MaterializedFeature[] | undefined; + /** Pagination token to request the next page of results for this query. */ + nextPageToken?: string | undefined; +} + +/** + * List Streams under a given parent. + * + * NOTE: Results are post-filtered by access permission on each stream's ingestion + * table. This means: + * - Returned results may be fewer than page_size (including zero) + * - Page token points to next unfiltered batch, not next filtered batch, and may + * point to an item that will be filtered out + * - Callers should paginate until next_page_token is empty to retrieve all + * accessible streams + */ +export interface ListStreamsRequest { + /** Two-part name (catalog.schema) of the parent under which to list Streams. */ + parent?: string | undefined; + /** The maximum number of results to return. */ + pageSize?: number | undefined; + /** Pagination token to go to the next page based on a previous query. */ + pageToken?: string | undefined; +} + +/** + * Response to a ListStreamsRequest. + * + * NOTE: Results are post-filtered by access permission on each stream's ingestion + * table. This means: + * - Returned results may be fewer than page_size (including zero) + * - Page token points to next unfiltered batch, not next filtered batch, and may + * point to an item that will be filtered out + * Callers should paginate until next_page_token is empty to retrieve all + * accessible streams. + */ +export interface ListStreamsResponse { + /** List of Streams. */ + streams?: Stream[] | undefined; + /** Pagination token to request the next page of results for this query. */ + nextPageToken?: string | undefined; +} + +/** A materialized feature represents a feature that is continuously computed and stored. */ +export interface MaterializedFeature { + /** Server-assigned unique identifier for the materialized feature. */ + materializedFeatureId?: string | undefined; + /** The full name of the feature in Unity Catalog. */ + featureName?: string | undefined; + destination?: + | { + $case: 'offlineStoreConfig'; + /** Destination for writing feature values to an offline Delta table. */ + offlineStoreConfig: OfflineStoreConfig; + } + | { + $case: 'onlineStoreConfig'; + /** Destination for writing feature values to an online Lakebase table. */ + onlineStoreConfig: OnlineStoreConfig; + } + | undefined; + /** The fully qualified Unity Catalog path to the table containing the materialized feature (Delta table or Lakebase table). Output only. */ + tableName?: string | undefined; + /** + * The schedule state of the materialization pipeline. + * Hidden from GraphQL: being deprecated, so not exposed to Catalog Explorer. + */ + pipelineScheduleState?: MaterializedFeature_PipelineScheduleState | undefined; + /** + * The timestamp when the pipeline last ran and updated the materialized feature values. + * If the pipeline has not run yet, this field will be null. + */ + lastMaterializationTime?: Temporal.Instant | undefined; + /** + * The quartz cron expression that defines the schedule of the materialization pipeline. The schedule is evaluated in the UTC timezone. + * Hidden from GraphQL: superseded by the `trigger` oneof (cron_schedule_trigger), so not exposed to Catalog Explorer. + */ + cronSchedule?: string | undefined; + /** True if this is an online materialized feature. False if it is an offline materialized feature. */ + isOnline?: boolean | undefined; + /** The trigger configuration for the materialization pipeline. */ + trigger?: + | { + $case: 'cronScheduleTrigger'; + /** A cron-based schedule trigger for the materialization pipeline. */ + cronScheduleTrigger: CronSchedule; + } + | { + $case: 'tableTrigger'; + /** A trigger that fires when the upstream source table changes. */ + tableTrigger: TableTrigger; + } + | { + $case: 'streamingMode'; + /** + * The Structured Streaming trigger mode used for materialization. Real-time mode (RTM) targets + * sub-second latency for operational workloads; micro-batch mode (MBM) favors cost efficiency + * for ETL and analytics workloads. + */ + streamingMode: StreamingMode; + } + | undefined; +} + +/** Computes the maximum value. */ +export interface MaxFunction { + /** The input column from which the maximum is computed. */ + input?: string | undefined; +} + +/** Computes the minimum value. */ +export interface MinFunction { + /** The input column from which the minimum is computed. */ + input?: string | undefined; +} + +/** + * Mutual-TLS (mTLS) authentication configuration. The keystore (client certificate + + * private key) and truststore (CAs trusted to verify the broker) live as JKS files on + * Unity Catalog volumes, with their passwords stored in secret scopes. This + * matches the SSL setup pattern documented at + * https://docs.databricks.com/en/connect/streaming/kafka/authentication#use-ssl-to-connect-databricks-to-kafka. + * + * At materialization time, the generated PySpark code passes the JKS file paths and + * resolved passwords through to the Kafka SSL options (kafka.ssl.keystore.location, + * kafka.ssl.keystore.password, kafka.ssl.key.password, kafka.ssl.truststore.location, + * kafka.ssl.truststore.password). Passwords are resolved on the Spark cluster via + * dbutils.secrets.get; this message stores only references, never password values. + */ +export interface MtlsConfig { + /** + * Unity Catalog volume path to the JKS keystore file containing the client certificate + * and private key. e.g. "/Volumes////client.jks". The + * materialization compute must have read permission on this volume. + */ + keystoreLocation?: string | undefined; + /** Secret-scope reference for the JKS keystore password. */ + keystorePasswordRef?: SecretScopeReference | undefined; + /** + * Secret-scope reference for the private key password. Often the same value as the + * keystore password (keytool's default), but provided as a separate field because + * Apache Kafka requires it as a distinct option (kafka.ssl.key.password). + */ + keyPasswordRef?: SecretScopeReference | undefined; + /** + * Unity Catalog volume path to the JKS truststore file containing the CA certificate(s) + * trusted to verify the Kafka broker's server certificate. + * e.g. "/Volumes////truststore.jks". + */ + truststoreLocation?: string | undefined; + /** Secret-scope reference for the JKS truststore password. */ + truststorePasswordRef?: SecretScopeReference | undefined; + /** + * Set to true only when the broker certificate's SAN intentionally does not match + * the connection endpoint — for example when reaching the cluster through a + * PrivateLink endpoint whose DNS name is not in the broker certificate. Skipping + * the hostname check removes a defense against man-in-the-middle attacks; do not + * enable casually. mTLS client authentication is unaffected by this option. + * + * See the Apache Kafka SSL security guide for background on this check: + * https://kafka.apache.org/42/security/encryption-and-authentication-using-ssl/#host-name-verification + */ + disableHostnameVerification?: boolean | undefined; +} + +/** Configuration for offline store destination. */ +export interface OfflineStoreConfig { + /** The Unity Catalog catalog name. */ + catalogName?: string | undefined; + /** The Unity Catalog schema name. */ + schemaName?: string | undefined; + /** + * Prefix for Unity Catalog table name. + * The materialized feature will be stored in a table with this prefix and a generated postfix. + */ + tableNamePrefix?: string | undefined; +} + +/** Configuration for online store destination. */ +export interface OnlineStoreConfig { + /** + * The Unity Catalog catalog name. This name is also used as the Lakebase logical database name. + * Quoting is handled by the backend where needed, do not pre-quote it. + */ + catalogName?: string | undefined; + /** + * The Unity Catalog schema name. This name is also used as the Lakebase schema name under the database. + * Quoting is handled by the backend where needed, do not pre-quote it. + */ + schemaName?: string | undefined; + /** + * Prefix for Unity Catalog table name. + * The materialized feature will be stored in a Lakebase table with this prefix and a generated postfix. + */ + tableNamePrefix?: string | undefined; + /** The name of the target online store. */ + onlineStoreName?: string | undefined; +} + +/** A request-time data source whose value is provided at inference time: offline batch scoring or online serving endpoint */ +export interface RequestSource { + /** The schema describing the request-time fields. Currently only flat schemas are supported. */ + schema?: + | { + $case: 'flatSchema'; + /** A flat schema with scalar-typed fields only. */ + flatSchema: FlatSchema; + } + | undefined; +} + +/** + * A rolling time window with an optional delay. This is the SQL-spec-aligned + * replacement for ContinuousWindow: `delay` is the non-negative counterpart + * of the legacy non-positive `ContinuousWindow.offset`. + */ +export interface RollingWindow { + /** The duration of the rolling window (must be positive). */ + windowDuration?: Temporal.Duration | undefined; + /** + * The delay applied to the end of the rolling window (must be non-negative). + * For example, delay=1d shifts the window end 1 day before the evaluation time. + */ + delay?: Temporal.Duration | undefined; +} + +export interface SchemaConfig { + schema?: + | { + $case: 'jsonSchema'; + /** Schema of the JSON object in standard IETF JSON schema format (https://json-schema.org/). */ + jsonSchema: string; + } + | undefined; +} + +/** + * Reference to an entry in a secret scope. The referenced value is fetched + * on the Spark cluster at materialization time via dbutils.secrets.get(scope, key). + */ +export interface SecretScopeReference { + /** The secret scope name. */ + scope?: string | undefined; + /** The key within the scope. */ + key?: string | undefined; +} + +export interface SlidingWindow { + /** The duration of the sliding window. */ + windowDuration?: Temporal.Duration | undefined; + /** The slide duration (interval by which windows advance, must be positive and less than duration). */ + slideDuration?: Temporal.Duration | undefined; +} + +/** Computes the population standard deviation. */ +export interface StddevPopFunction { + /** + * The input column from which the population standard deviation is computed. For Kafka sources, + * use dot-prefixed path notation (e.g., "value.amount"). For nested fields, the leaf node name is used. + * Colon-prefixed notation (e.g., "value:amount") is supported for backwards + * compatibility but is deprecated; migrate to dot notation. + */ + input?: string | undefined; +} + +/** Computes the sample standard deviation. */ +export interface StddevSampFunction { + /** The input column from which the sample standard deviation is computed. */ + input?: string | undefined; +} + +/** + * A Stream is a governed UC entity representing an external streaming data source. + * The source_config oneof determines the streaming platform source (e.g. Kafka, Kinesis, etc.). + */ +export interface Stream { + /** Full three-part (catalog.schema.stream) name of the stream. */ + name?: string | undefined; + /** User-provided description. */ + description?: string | undefined; + /** Source-specific configuration. Determines the streaming platform source. */ + sourceConfig?: StreamSourceConfig | undefined; + /** Specifies how to connect and authenticate to the stream platform. */ + connectionConfig?: StreamConnectionConfig | undefined; + /** + * Schema definitions for the stream. Currently only direct schemas are supported. + * In a future milestone, we will support schema registries through a UC Connection. + */ + schemaConfig?: StreamSchemaConfig | undefined; + /** Configuration for streaming data ingestion: the managed table storing an offline copy of forward fill data and optional historical backfill. */ + ingestionConfig?: IngestionConfig | undefined; + /** Time at which this Stream was created. */ + createTime?: Temporal.Instant | undefined; + /** Username of the Stream creator. */ + createdBy?: string | undefined; + /** Time at which this Stream was last modified. */ + updateTime?: Temporal.Instant | undefined; + /** Username of user who last modified the Stream. */ + updatedBy?: string | undefined; + /** + * Indicates whether the principal is limited to retrieving metadata for the + * associated object through the BROWSE privilege when include_browse is enabled in the request. + */ + browseOnly?: boolean | undefined; +} + +/** Specifies how to connect and authenticate to the stream platform. */ +export interface StreamConnectionConfig { + connectionConfig?: + | { + $case: 'ucConnectionName'; + /** + * Name of an existing UC Connection for stream platform access. + * Must be the correct type for the streaming platform (e.g. a Kafka Connection for a Kafka Stream). + */ + ucConnectionName: string; + } + | { + $case: 'directMtlsConfig'; + /** + * Direct mTLS configuration for stream platform access. This is only used in the short term until UC Kafka Connections support mTLS . + * Once UC Kafka Connections support mTLS, this will be deprecated. + */ + directMtlsConfig: DirectMtlsConfig; + } + | undefined; +} + +/** + * Schema definitions for the stream. Currently only direct schemas are supported. + * In a future milestone, we will support schema registries through a UC Connection. + */ +export interface StreamSchemaConfig { + schemaConfig?: + | { + $case: 'directSchemas'; + /** Schema definitions provided directly on the Stream. */ + directSchemas: DirectSchemas; + } + | undefined; +} + +/** A Stream entity used as a data source for a feature. */ +export interface StreamSource { + /** Three-part full name of the Stream (catalog.schema.stream). */ + fullName?: string | undefined; + /** The filter condition applied to the source data before aggregation. */ + filterCondition?: string | undefined; +} + +/** Source-specific configuration. Determines the streaming platform source. */ +export interface StreamSourceConfig { + sourceConfig?: + | { + $case: 'kafkaStreamConfig'; + /** Configuration for Apache Kafka streams. */ + kafkaStreamConfig: KafkaStreamConfig; + } + | undefined; +} + +/** The streaming mode configuration for a streaming materialization pipeline. */ +export interface StreamingMode { + /** The type of streaming mode used by the materialization pipeline. */ + mode?: StreamingMode_StreamingModeType | undefined; +} + +/** Deprecated: Use KafkaSubscriptionMode instead. */ +export interface SubscriptionMode { + /** These match the settings from https://spark.apache.org/docs/latest/streaming/structured-streaming-kafka-integration.html */ + subscriptionMode?: + | { + $case: 'assign'; + /** + * A JSON string that contains the specific topic-partitions to consume from. + * For example, for '{"topicA":[0,1],"topicB":[2,4]}', topicA's 0'th and 1st partitions will be consumed from. + */ + assign: string; + } + | { + $case: 'subscribe'; + /** A comma-separated list of Kafka topics to read from. For example, 'topicA,topicB,topicC'. */ + subscribe: string; + } + | { + $case: 'subscribePattern'; + /** A regular expression matching topics to subscribe to. For example, 'topic.*' will subscribe to all topics starting with 'topic'. */ + subscribePattern: string; + } + | undefined; +} + +/** Computes the sum of values. */ +export interface SumFunction { + /** + * The input column from which the sum is computed. For Kafka sources, use dot-prefixed path + * notation (e.g., "value.amount"). For nested fields, the leaf node name is used. + * Colon-prefixed notation (e.g., "value:amount") is supported for backwards + * compatibility but is deprecated; migrate to dot notation. + */ + input?: string | undefined; +} + +/** A trigger that fires when the upstream source table changes. */ +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface TableTrigger {} + +export interface TimeWindow { + windowType?: + | {$case: 'continuous'; continuous: ContinuousWindow} + | {$case: 'tumbling'; tumbling: TumblingWindow} + | {$case: 'sliding'; sliding: SlidingWindow} + | {$case: 'rolling'; rolling: RollingWindow} + | undefined; +} + +export interface TimeseriesColumn { + /** + * The name of the timeseries column. For Kafka sources, use dot-prefixed path notation to + * reference fields within the key or value schema (e.g., "value.event_timestamp"). For nested + * fields, the leaf node name (e.g., "event_timestamp" from "value.event_details.event_timestamp") + * is what will be present in materialized tables and expected to match at query time. + * Colon-prefixed notation (e.g., "value:event_timestamp") is supported for + * backwards compatibility but is deprecated; migrate to dot notation. + */ + name?: string | undefined; +} + +export interface TumblingWindow { + /** The duration of each tumbling window (non-overlapping, fixed-duration windows). */ + windowDuration?: Temporal.Duration | undefined; +} + +/** An aggregation function applied over a time window. */ +export interface UpdateAggregationFunction { + /** The type of the aggregation function. */ + operation?: + | {$case: 'avg'; avg: UpdateAvgFunction} + | {$case: 'countFunction'; countFunction: UpdateCountFunction} + | {$case: 'sum'; sum: UpdateSumFunction} + | {$case: 'min'; min: UpdateMinFunction} + | {$case: 'max'; max: UpdateMaxFunction} + | {$case: 'first'; first: UpdateFirstFunction} + | {$case: 'last'; last: UpdateLastFunction} + | { + $case: 'approxCountDistinct'; + approxCountDistinct: UpdateApproxCountDistinctFunction; + } + | { + $case: 'approxPercentile'; + approxPercentile: UpdateApproxPercentileFunction; + } + | {$case: 'stddevPop'; stddevPop: UpdateStddevPopFunction} + | {$case: 'stddevSamp'; stddevSamp: UpdateStddevSampFunction} + | {$case: 'varPop'; varPop: UpdateVarPopFunction} + | {$case: 'varSamp'; varSamp: UpdateVarSampFunction} + | {$case: 'firstN'; firstN: UpdateFirstNFunction} + | {$case: 'lastN'; lastN: UpdateLastNFunction} + | {$case: 'firstDistinctN'; firstDistinctN: UpdateFirstDistinctNFunction} + | {$case: 'lastDistinctN'; lastDistinctN: UpdateLastDistinctNFunction} + | undefined; + /** The time window over which the aggregation is computed. */ + timeWindow?: UpdateTimeWindow | undefined; +} + +/** Computes the approximate count of distinct values. */ +export interface UpdateApproxCountDistinctFunction { + /** The input column from which the approximate count of distinct values is computed. */ + input?: string | undefined; + /** The maximum relative standard deviation allowed (default defined by Spark). */ + relativeSd?: number | undefined; +} + +/** Computes the approximate percentile of values. */ +export interface UpdateApproxPercentileFunction { + /** The input column from which the approximate percentile is computed. */ + input?: string | undefined; + /** The percentile value to compute (between 0 and 1). */ + percentile?: number | undefined; + /** The accuracy parameter (higher is more accurate but slower). */ + accuracy?: bigint | undefined; +} + +export interface UpdateAuthConfig { + authConfig?: + | { + $case: 'ucServiceCredentialName'; + /** Name of the Unity Catalog service credential. This value will be set under the option databricks.serviceCredential */ + ucServiceCredentialName: string; + } + | { + $case: 'mtlsConfig'; + /** Mutual-TLS authentication. See MtlsConfig. */ + mtlsConfig: UpdateMtlsConfig; + } + | undefined; +} + +/** Computes the average of values. */ +export interface UpdateAvgFunction { + /** + * The input column from which the average is computed. For Kafka sources, use dot-prefixed path + * notation (e.g., "value.amount"). For nested fields, the leaf node name is used. + * Colon-prefixed notation (e.g., "value:amount") is supported for backwards + * compatibility but is deprecated; migrate to dot notation. + */ + input?: string | undefined; +} + +export interface UpdateBackfillSource { + backfillSource?: + | { + $case: 'deltaTableSource'; + /** + * Deprecated: Use delta_table_name instead. Kept for backwards compatibility. + * The Delta table source containing the historical data to backfill. + * Only the delta table name is used for backfill, other fields are ignored. + */ + deltaTableSource: UpdateDeltaTableSource; + } + | { + $case: 'deltaTableName'; + /** The full three-part name (catalog, schema, name) of the Delta table containing the historical data to backfill. */ + deltaTableName: string; + } + | undefined; +} + +export interface UpdateColumnIdentifier { + /** + * String representation of the column name using dot-prefixed path notation. For nested fields, the leaf value is what will be present in materialized tables + * and expected to match at query time. For example, the leaf node of value.trip_details.location_details.pickup_zip is pickup_zip. + */ + variantExprPath?: string | undefined; +} + +/** A ColumnSelection function, equivalent to the LAST() record of an entity over a lifetime ContinuousWindow */ +export interface UpdateColumnSelection { + /** Column name from source to select as the feature value. */ + column?: string | undefined; +} + +/** Deprecated: use RollingWindow with `delay` instead. */ +export interface UpdateContinuousWindow { + /** The duration of the continuous window (must be positive). */ + windowDuration?: Temporal.Duration | undefined; + /** The offset of the continuous window (must be non-positive). */ + offset?: Temporal.Duration | undefined; +} + +/** Computes the count of values. */ +export interface UpdateCountFunction { + /** + * The input column from which the count is computed. For Kafka sources, use dot-prefixed path + * notation (e.g., "value.amount"). For nested fields, the leaf node name is used. + * Colon-prefixed notation (e.g., "value:amount") is supported for backwards + * compatibility but is deprecated; migrate to dot notation. + */ + input?: string | undefined; +} + +/** A cron-based schedule trigger for the materialization pipeline. */ +export interface UpdateCronSchedule { + /** The cron expression defining the schedule (e.g., "0 0 * * *" for daily at midnight). */ + cronExpression?: string | undefined; +} + +/** Specifies the data source backing a feature. Exactly one source type must be set. */ +export interface UpdateDataSource { + dataSource?: + | { + $case: 'deltaTableSource'; + /** A Delta table data source. */ + deltaTableSource: UpdateDeltaTableSource; + } + | { + $case: 'kafkaSource'; + /** A Kafka stream data source. */ + kafkaSource: UpdateKafkaSource; + } + | { + $case: 'requestSource'; + /** A request-time data source. */ + requestSource: UpdateRequestSource; + } + | { + $case: 'streamSource'; + /** A Stream data source. */ + streamSource: UpdateStreamSource; + } + | undefined; +} + +export interface UpdateDeltaTableSource { + /** The full three-part (catalog, schema, table) name of the Delta table. */ + fullName?: string | undefined; + /** + * Deprecated: Use Feature.entity instead. Kept for backwards compatibility. + * The entity columns of the Delta table. + */ + entityColumns?: string[] | undefined; + /** + * Deprecated: Use Feature.timeseries_column instead. Kept for backwards compatibility. + * The timeseries column of the Delta table. + */ + timeseriesColumn?: string | undefined; + /** Single WHERE clause to filter delta table before applying transformations. Will be row-wise evaluated, so should only include conditionals and projections. */ + filterCondition?: string | undefined; + /** + * A single SQL SELECT expression applied after filter_condition. + * Should contains all the columns needed (eg. "SELECT *, col_a + col_b AS col_c FROM x.y.z WHERE col_a > 0" would have `transformation_sql` "*, col_a + col_b AS col_c") + * If transformation_sql is not provided, all columns of the delta table are present in the DataSource dataframe. + */ + transformationSql?: string | undefined; + /** + * Schema of the resulting dataframe after transformations, in Spark StructType JSON format (from df.schema.json()). + * Required if transformation_sql is specified. + * Example: {"type":"struct","fields":[{"name":"col_a","type":"integer","nullable":true,"metadata":{}},{"name":"col_c","type":"integer","nullable":true,"metadata":{}}]} + */ + dataframeSchema?: string | undefined; +} + +/** + * Direct connection configs for mTLS, as Kafka Connections do not support mTLS yet . + * Temporarily used until UC Kafka Connections gain mTLS support. + */ +export interface UpdateDirectMtlsConfig { + /** A comma-separated list of host:port pairs for the Kafka bootstrap servers. */ + bootstrapServers?: string | undefined; + /** Mutual-TLS authentication configuration. */ + mtlsConfig?: UpdateMtlsConfig | undefined; +} + +/** + * Schema definitions provided directly on the Stream, as opposed to referencing a schema registry. + * In a future milestone, we will support schema registries through a UC Connection. + */ +export interface UpdateDirectSchemas { + /** + * Schema for the message payload. For Kafka, this is the value schema. + * Unless the platform supports another schema (e.g. keys for Kafka), this must be specified. + */ + payloadSchema?: UpdateSchemaConfig | undefined; + /** + * Schema for the message key. This is only used for Kafka streams. + * For Kafka, at least one of payload_schema or key_schema must be specified. + */ + keySchema?: UpdateSchemaConfig | undefined; +} + +export interface UpdateEntityColumn { + /** + * The name of the entity column. For Kafka sources, use dot-prefixed path notation to reference + * fields within the key or value schema (e.g., "value.user_id", "key.partition_key"). For nested + * fields, the leaf node name (e.g., "user_id" from "value.trip_details.user_id") is what will + * be present in materialized tables and expected to match at query time. + * Colon-prefixed notation (e.g., "value:user_id") is supported for backwards + * compatibility but is deprecated; migrate to dot notation. + */ + name?: string | undefined; +} + +export interface UpdateFeature { + /** + * The full three-part name (catalog, schema, name) of the feature. This is the + * feature's resource identifier; the catalog_name, schema_name, and name fields + * below are OUTPUT_ONLY decomposed views of this value. + */ + fullName?: string | undefined; + /** The data source of the feature. */ + source?: UpdateDataSource | undefined; + /** + * Deprecated: Use AggregationFunction.inputs instead. Kept for backwards compatibility. + * The input columns from which the feature is computed. + */ + inputs?: string[] | undefined; + /** The function by which the feature is computed. */ + function?: UpdateFunction | undefined; + /** + * Deprecated: Use Function.aggregation_function.time_window instead. Kept for backwards compatibility. + * The time window in which the feature is computed. + */ + timeWindow?: UpdateTimeWindow | undefined; + /** The description of the feature. */ + description?: string | undefined; + /** + * Deprecated: Use DeltaTableSource.filter_condition or KafkaSource.filter_condition instead. Kept for backwards compatibility. + * The filter condition applied to the source data before aggregation. + */ + filterCondition?: string | undefined; + /** + * Lineage context information for this feature. + * WARNING: This field is primarily intended for internal use by systems and + * is automatically populated when features are created through notebooks or jobs. + * Users should not manually set this field as incorrect values may lead to inaccurate lineage tracking or unexpected behavior. + * This field will be set by feature-engineering client and should be left unset by SDK and terraform users. + */ + lineageContext?: UpdateLineageContext | undefined; + /** The entity columns for the feature, used as aggregation keys and for query-time lookup. */ + entities?: UpdateEntityColumn[] | undefined; + /** Column recording time, used for point-in-time joins, backfills, and aggregations. */ + timeseriesColumn?: UpdateTimeseriesColumn | undefined; +} + +export interface UpdateFeatureRequest { + /** Feature to update. */ + feature?: UpdateFeature | undefined; + /** The list of fields to update. */ + updateMask?: FieldMask | undefined; +} + +/** + * A single field definition within a FlatSchema, specifying the field name and its scalar data type. + * Does not support nested or complex types (arrays, maps, structs). + */ +export interface UpdateFieldDefinition { + /** The name of the field. */ + name?: string | undefined; + /** The scalar data type of the field. */ + dataType?: ScalarDataType | undefined; +} + +/** Returns the first N distinct values, ordered by the feature's timeseries column. */ +export interface UpdateFirstDistinctNFunction { + /** The input column from which the first N distinct values are returned. */ + input?: string | undefined; + /** The number of distinct values to return. */ + n?: bigint | undefined; +} + +/** Returns the first value. */ +export interface UpdateFirstFunction { + /** The input column from which the first value is returned. */ + input?: string | undefined; +} + +/** Returns the first N values, ordered by the feature's timeseries column. */ +export interface UpdateFirstNFunction { + /** The input column from which the first N values are returned. */ + input?: string | undefined; + /** The number of values to return. */ + n?: bigint | undefined; +} + +/** + * A flat (non-nested) schema for request-time fields, defined as an ordered list of field definitions. + * This schema only supports scalar types. + */ +export interface UpdateFlatSchema { + /** The list of fields in this schema. */ + fields?: UpdateFieldDefinition[] | undefined; +} + +export interface UpdateFunction { + /** + * Deprecated: Use the function oneof with AggregationFunction instead. Kept for backwards compatibility. + * The type of the function. + */ + functionType?: Function_FunctionType | undefined; + /** + * Deprecated: Use the function oneof with AggregationFunction instead. Kept for backwards compatibility. + * Extra parameters for parameterized functions. + */ + extraParameters?: Function_UpdateExtraParameter[] | undefined; + function?: + | { + $case: 'aggregationFunction'; + /** An aggregation function applied over a time window. */ + aggregationFunction: UpdateAggregationFunction; + } + | { + $case: 'columnSelection'; + /** Selects the latest value of a single column in a data source */ + columnSelection: UpdateColumnSelection; + } + | undefined; +} + +/** + * Configuration for the -managed ingestion pipeline. + * Groups the ingestion destination (required) and optional backfill source. + */ +export interface UpdateIngestionConfig { + /** + * Destination for the -managed Delta table that holds an offline copy of the streaming data for querying and training. + * This table contains both 1) forward-filled data from the Stream and 2) backfilled data from the BackfillSource (if provided). + * This table is created and managed by and is deleted when the Stream is deleted. + */ + ingestionDestination?: UpdateIngestionDestination | undefined; + /** + * A user-provided source for backfilling data. Historical data is used when creating a training set from streaming features linked to this Stream. + * The backfill data stored in this location will be copied into the ingestion table for offline querying and training. + * The schema for this source must match exactly that of the key and payload schemas specified for this Stream. + */ + backfillSource?: UpdateBackfillSource | undefined; + /** + * Column paths used to identify duplicate rows during ingestion; only one row per + * distinct combination of these values is kept. Use dot notation for nested fields + * (e.g. `value.user_id`). Empty list means every column is compared. + */ + deduplicationColumns?: string[] | undefined; +} + +/** Destination for the -managed Delta table that holds an offline copy of the streaming data for querying and training. */ +export interface UpdateIngestionDestination { + ingestionDestination?: + | { + $case: 'deltaTableName'; + /** The full three-part name (catalog, schema, name) of the Delta table to be created for ingestion. */ + deltaTableName: string; + } + | undefined; +} + +export interface UpdateJobContext { + /** The job ID where this API invoked. */ + jobId?: bigint | undefined; + /** The job run ID where this API was invoked. */ + jobRunId?: bigint | undefined; +} + +export interface UpdateKafkaConfig { + /** + * Name that uniquely identifies this Kafka config within the metastore. This will be the identifier used from the Feature object to reference these configs for a feature. + * Can be distinct from topic name. + */ + name?: string | undefined; + /** A comma-separated list of host/port pairs pointing to Kafka cluster. */ + bootstrapServers?: string | undefined; + /** Options to configure which Kafka topics to pull data from. */ + subscriptionMode?: UpdateSubscriptionMode | undefined; + /** Authentication configuration for connection to topics. */ + authConfig?: UpdateAuthConfig | undefined; + /** Schema configuration for extracting message keys from topics. At least one of key_schema and value_schema must be provided. */ + keySchema?: UpdateSchemaConfig | undefined; + /** Schema configuration for extracting message values from topics. At least one of key_schema and value_schema must be provided. */ + valueSchema?: UpdateSchemaConfig | undefined; + /** Catch-all for miscellaneous options. Keys should be source options or Kafka consumer options (kafka.*) */ + extraOptions?: Record | undefined; + /** + * A user-provided and managed source for backfilling data. Historical data is used when creating a training set from streaming features linked to this Kafka config. + * In the future, a separate table will be maintained by for forward filling data. + * The schema for this source must match exactly that of the key and value schemas specified for this Kafka config. + */ + backfillSource?: UpdateBackfillSource | undefined; + /** + * Configuration for ingesting Kafka data into a -managed + * Delta table. + */ + ingestionConfig?: UpdateIngestionConfig | undefined; +} + +export interface UpdateKafkaConfigRequest { + /** The Kafka config to update. */ + kafkaConfig?: UpdateKafkaConfig | undefined; + /** The list of fields to update. */ + updateMask?: FieldMask | undefined; +} + +export interface UpdateKafkaSource { + /** Name of the Kafka source, used to identify it. This is used to look up the corresponding KafkaConfig object. Can be distinct from topic name. */ + name?: string | undefined; + /** + * Deprecated: Use Feature.entity instead. Kept for backwards compatibility. + * The entity column identifiers of the Kafka source. + */ + entityColumnIdentifiers?: UpdateColumnIdentifier[] | undefined; + /** + * Deprecated: Use Feature.timeseries_column instead. Kept for backwards compatibility. + * The timeseries column identifier of the Kafka source. + */ + timeseriesColumnIdentifier?: UpdateColumnIdentifier | undefined; + /** The filter condition applied to the source data before aggregation. */ + filterCondition?: string | undefined; +} + +/** Kafka-specific configuration for a Stream. */ +export interface UpdateKafkaStreamConfig { + /** Options to configure which Kafka topics to pull data from. */ + subscriptionMode?: UpdateKafkaSubscriptionMode | undefined; + /** + * Optional Kafka source or consumer options, validated against a server-side + * allowlist at request time. Allowed keys: + * - `maxOffsetsPerTrigger` + * - `startingOffsets` + * - `includeHeaders` + * - `kafka.request.timeout.ms` + * - `kafka.session.timeout.ms` + * - `kafka.max.partition.fetch.bytes` + * The following keys are ingestion-only and are stripped before being forwarded to the materialization pipeline: + * - `maxOffsetsPerTrigger` + * - `startingOffsets` + * Auth and connection details belong on the parent Stream's `connection_config`, not here. + */ + extraOptions?: Record | undefined; +} + +/** Subscription mode for Kafka topic selection, matching standard Spark Structured Streaming options. */ +export interface UpdateKafkaSubscriptionMode { + /** These match the settings from https://spark.apache.org/docs/latest/streaming/structured-streaming-kafka-integration.html */ + subscriptionMode?: + | { + $case: 'assign'; + /** + * A JSON string that contains the specific topic-partitions to consume from. + * For example, for '{"topicA":[0,1],"topicB":[2,4]}', topicA's 0'th and 1st partitions will be consumed from. + */ + assign: string; + } + | { + $case: 'subscribe'; + /** A comma-separated list of Kafka topics to read from. For example, 'topicA,topicB,topicC'. */ + subscribe: string; + } + | { + $case: 'subscribePattern'; + /** A regular expression matching topics to subscribe to. For example, 'topic.*' will subscribe to all topics starting with 'topic'. */ + subscribePattern: string; + } + | undefined; +} + +/** Returns the last N distinct values, ordered by the feature's timeseries column. */ +export interface UpdateLastDistinctNFunction { + /** The input column from which the last N distinct values are returned. */ + input?: string | undefined; + /** The number of distinct values to return. */ + n?: bigint | undefined; +} + +/** Returns the last value. */ +export interface UpdateLastFunction { + /** The input column from which the last value is returned. */ + input?: string | undefined; +} + +/** Returns the last N values, ordered by the feature's timeseries column. */ +export interface UpdateLastNFunction { + /** The input column from which the last N values are returned. */ + input?: string | undefined; + /** The number of values to return. */ + n?: bigint | undefined; +} + +/** Lineage context information for tracking where an API was invoked. This will allow us to track lineage, which currently uses caller entity information for use across the Lineage Client and Observability in Lumberjack. */ +export interface UpdateLineageContext { + /** The notebook ID where this API was invoked. */ + notebookId?: bigint | undefined; + /** Job context information including job ID and run ID. */ + jobContext?: UpdateJobContext | undefined; +} + +/** A materialized feature represents a feature that is continuously computed and stored. */ +export interface UpdateMaterializedFeature { + /** Server-assigned unique identifier for the materialized feature. */ + materializedFeatureId?: string | undefined; + /** The full name of the feature in Unity Catalog. */ + featureName?: string | undefined; + destination?: + | { + $case: 'offlineStoreConfig'; + /** Destination for writing feature values to an offline Delta table. */ + offlineStoreConfig: UpdateOfflineStoreConfig; + } + | { + $case: 'onlineStoreConfig'; + /** Destination for writing feature values to an online Lakebase table. */ + onlineStoreConfig: UpdateOnlineStoreConfig; + } + | undefined; + /** + * The schedule state of the materialization pipeline. + * Hidden from GraphQL: being deprecated, so not exposed to Catalog Explorer. + */ + pipelineScheduleState?: MaterializedFeature_PipelineScheduleState | undefined; + /** + * The quartz cron expression that defines the schedule of the materialization pipeline. The schedule is evaluated in the UTC timezone. + * Hidden from GraphQL: superseded by the `trigger` oneof (cron_schedule_trigger), so not exposed to Catalog Explorer. + */ + cronSchedule?: string | undefined; + /** The trigger configuration for the materialization pipeline. */ + trigger?: + | { + $case: 'cronScheduleTrigger'; + /** A cron-based schedule trigger for the materialization pipeline. */ + cronScheduleTrigger: UpdateCronSchedule; + } + | { + $case: 'tableTrigger'; + /** A trigger that fires when the upstream source table changes. */ + tableTrigger: UpdateTableTrigger; + } + | { + $case: 'streamingMode'; + /** + * The Structured Streaming trigger mode used for materialization. Real-time mode (RTM) targets + * sub-second latency for operational workloads; micro-batch mode (MBM) favors cost efficiency + * for ETL and analytics workloads. + */ + streamingMode: UpdateStreamingMode; + } + | undefined; +} + +export interface UpdateMaterializedFeatureRequest { + /** The materialized feature to update. */ + materializedFeature?: UpdateMaterializedFeature | undefined; + /** + * Provide the materialization feature fields which should be updated. + * Currently, only the pipeline_state field can be updated. + */ + updateMask?: FieldMask | undefined; +} + +/** Computes the maximum value. */ +export interface UpdateMaxFunction { + /** The input column from which the maximum is computed. */ + input?: string | undefined; +} + +/** Computes the minimum value. */ +export interface UpdateMinFunction { + /** The input column from which the minimum is computed. */ + input?: string | undefined; +} + +/** + * Mutual-TLS (mTLS) authentication configuration. The keystore (client certificate + + * private key) and truststore (CAs trusted to verify the broker) live as JKS files on + * Unity Catalog volumes, with their passwords stored in secret scopes. This + * matches the SSL setup pattern documented at + * https://docs.databricks.com/en/connect/streaming/kafka/authentication#use-ssl-to-connect-databricks-to-kafka. + * + * At materialization time, the generated PySpark code passes the JKS file paths and + * resolved passwords through to the Kafka SSL options (kafka.ssl.keystore.location, + * kafka.ssl.keystore.password, kafka.ssl.key.password, kafka.ssl.truststore.location, + * kafka.ssl.truststore.password). Passwords are resolved on the Spark cluster via + * dbutils.secrets.get; this message stores only references, never password values. + */ +export interface UpdateMtlsConfig { + /** + * Unity Catalog volume path to the JKS keystore file containing the client certificate + * and private key. e.g. "/Volumes////client.jks". The + * materialization compute must have read permission on this volume. + */ + keystoreLocation?: string | undefined; + /** Secret-scope reference for the JKS keystore password. */ + keystorePasswordRef?: UpdateSecretScopeReference | undefined; + /** + * Secret-scope reference for the private key password. Often the same value as the + * keystore password (keytool's default), but provided as a separate field because + * Apache Kafka requires it as a distinct option (kafka.ssl.key.password). + */ + keyPasswordRef?: UpdateSecretScopeReference | undefined; + /** + * Unity Catalog volume path to the JKS truststore file containing the CA certificate(s) + * trusted to verify the Kafka broker's server certificate. + * e.g. "/Volumes////truststore.jks". + */ + truststoreLocation?: string | undefined; + /** Secret-scope reference for the JKS truststore password. */ + truststorePasswordRef?: UpdateSecretScopeReference | undefined; + /** + * Set to true only when the broker certificate's SAN intentionally does not match + * the connection endpoint — for example when reaching the cluster through a + * PrivateLink endpoint whose DNS name is not in the broker certificate. Skipping + * the hostname check removes a defense against man-in-the-middle attacks; do not + * enable casually. mTLS client authentication is unaffected by this option. + * + * See the Apache Kafka SSL security guide for background on this check: + * https://kafka.apache.org/42/security/encryption-and-authentication-using-ssl/#host-name-verification + */ + disableHostnameVerification?: boolean | undefined; +} + +/** Configuration for offline store destination. */ +export interface UpdateOfflineStoreConfig { + /** The Unity Catalog catalog name. */ + catalogName?: string | undefined; + /** The Unity Catalog schema name. */ + schemaName?: string | undefined; + /** + * Prefix for Unity Catalog table name. + * The materialized feature will be stored in a table with this prefix and a generated postfix. + */ + tableNamePrefix?: string | undefined; +} + +/** Configuration for online store destination. */ +export interface UpdateOnlineStoreConfig { + /** + * The Unity Catalog catalog name. This name is also used as the Lakebase logical database name. + * Quoting is handled by the backend where needed, do not pre-quote it. + */ + catalogName?: string | undefined; + /** + * The Unity Catalog schema name. This name is also used as the Lakebase schema name under the database. + * Quoting is handled by the backend where needed, do not pre-quote it. + */ + schemaName?: string | undefined; + /** + * Prefix for Unity Catalog table name. + * The materialized feature will be stored in a Lakebase table with this prefix and a generated postfix. + */ + tableNamePrefix?: string | undefined; + /** The name of the target online store. */ + onlineStoreName?: string | undefined; +} + +/** A request-time data source whose value is provided at inference time: offline batch scoring or online serving endpoint */ +export interface UpdateRequestSource { + /** The schema describing the request-time fields. Currently only flat schemas are supported. */ + schema?: + | { + $case: 'flatSchema'; + /** A flat schema with scalar-typed fields only. */ + flatSchema: UpdateFlatSchema; + } + | undefined; +} + +/** + * A rolling time window with an optional delay. This is the SQL-spec-aligned + * replacement for ContinuousWindow: `delay` is the non-negative counterpart + * of the legacy non-positive `ContinuousWindow.offset`. + */ +export interface UpdateRollingWindow { + /** The duration of the rolling window (must be positive). */ + windowDuration?: Temporal.Duration | undefined; + /** + * The delay applied to the end of the rolling window (must be non-negative). + * For example, delay=1d shifts the window end 1 day before the evaluation time. + */ + delay?: Temporal.Duration | undefined; +} + +export interface UpdateSchemaConfig { + schema?: + | { + $case: 'jsonSchema'; + /** Schema of the JSON object in standard IETF JSON schema format (https://json-schema.org/). */ + jsonSchema: string; + } + | undefined; +} + +/** + * Reference to an entry in a secret scope. The referenced value is fetched + * on the Spark cluster at materialization time via dbutils.secrets.get(scope, key). + */ +export interface UpdateSecretScopeReference { + /** The secret scope name. */ + scope?: string | undefined; + /** The key within the scope. */ + key?: string | undefined; +} + +export interface UpdateSlidingWindow { + /** The duration of the sliding window. */ + windowDuration?: Temporal.Duration | undefined; + /** The slide duration (interval by which windows advance, must be positive and less than duration). */ + slideDuration?: Temporal.Duration | undefined; +} + +/** Computes the population standard deviation. */ +export interface UpdateStddevPopFunction { + /** + * The input column from which the population standard deviation is computed. For Kafka sources, + * use dot-prefixed path notation (e.g., "value.amount"). For nested fields, the leaf node name is used. + * Colon-prefixed notation (e.g., "value:amount") is supported for backwards + * compatibility but is deprecated; migrate to dot notation. + */ + input?: string | undefined; +} + +/** Computes the sample standard deviation. */ +export interface UpdateStddevSampFunction { + /** The input column from which the sample standard deviation is computed. */ + input?: string | undefined; +} + +/** + * A Stream is a governed UC entity representing an external streaming data source. + * The source_config oneof determines the streaming platform source (e.g. Kafka, Kinesis, etc.). + */ +export interface UpdateStream { + /** Full three-part (catalog.schema.stream) name of the stream. */ + name?: string | undefined; + /** User-provided description. */ + description?: string | undefined; + /** Source-specific configuration. Determines the streaming platform source. */ + sourceConfig?: UpdateStreamSourceConfig | undefined; + /** Specifies how to connect and authenticate to the stream platform. */ + connectionConfig?: UpdateStreamConnectionConfig | undefined; + /** + * Schema definitions for the stream. Currently only direct schemas are supported. + * In a future milestone, we will support schema registries through a UC Connection. + */ + schemaConfig?: UpdateStreamSchemaConfig | undefined; + /** Configuration for streaming data ingestion: the managed table storing an offline copy of forward fill data and optional historical backfill. */ + ingestionConfig?: UpdateIngestionConfig | undefined; +} + +/** Specifies how to connect and authenticate to the stream platform. */ +export interface UpdateStreamConnectionConfig { + connectionConfig?: + | { + $case: 'ucConnectionName'; + /** + * Name of an existing UC Connection for stream platform access. + * Must be the correct type for the streaming platform (e.g. a Kafka Connection for a Kafka Stream). + */ + ucConnectionName: string; + } + | { + $case: 'directMtlsConfig'; + /** + * Direct mTLS configuration for stream platform access. This is only used in the short term until UC Kafka Connections support mTLS . + * Once UC Kafka Connections support mTLS, this will be deprecated. + */ + directMtlsConfig: UpdateDirectMtlsConfig; + } + | undefined; +} + +/** Update a Stream. Only fields listed in `update_mask` are mutated. */ +export interface UpdateStreamRequest { + /** The Stream to update. */ + stream?: UpdateStream | undefined; + /** The list of fields to update. */ + updateMask?: FieldMask | undefined; +} + +/** + * Schema definitions for the stream. Currently only direct schemas are supported. + * In a future milestone, we will support schema registries through a UC Connection. + */ +export interface UpdateStreamSchemaConfig { + schemaConfig?: + | { + $case: 'directSchemas'; + /** Schema definitions provided directly on the Stream. */ + directSchemas: UpdateDirectSchemas; + } + | undefined; +} + +/** A Stream entity used as a data source for a feature. */ +export interface UpdateStreamSource { + /** Three-part full name of the Stream (catalog.schema.stream). */ + fullName?: string | undefined; + /** The filter condition applied to the source data before aggregation. */ + filterCondition?: string | undefined; +} + +/** Source-specific configuration. Determines the streaming platform source. */ +export interface UpdateStreamSourceConfig { + sourceConfig?: + | { + $case: 'kafkaStreamConfig'; + /** Configuration for Apache Kafka streams. */ + kafkaStreamConfig: UpdateKafkaStreamConfig; + } + | undefined; +} + +/** The streaming mode configuration for a streaming materialization pipeline. */ +export interface UpdateStreamingMode { + /** The type of streaming mode used by the materialization pipeline. */ + mode?: StreamingMode_StreamingModeType | undefined; +} + +/** Deprecated: Use KafkaSubscriptionMode instead. */ +export interface UpdateSubscriptionMode { + /** These match the settings from https://spark.apache.org/docs/latest/streaming/structured-streaming-kafka-integration.html */ + subscriptionMode?: + | { + $case: 'assign'; + /** + * A JSON string that contains the specific topic-partitions to consume from. + * For example, for '{"topicA":[0,1],"topicB":[2,4]}', topicA's 0'th and 1st partitions will be consumed from. + */ + assign: string; + } + | { + $case: 'subscribe'; + /** A comma-separated list of Kafka topics to read from. For example, 'topicA,topicB,topicC'. */ + subscribe: string; + } + | { + $case: 'subscribePattern'; + /** A regular expression matching topics to subscribe to. For example, 'topic.*' will subscribe to all topics starting with 'topic'. */ + subscribePattern: string; + } + | undefined; +} + +/** Computes the sum of values. */ +export interface UpdateSumFunction { + /** + * The input column from which the sum is computed. For Kafka sources, use dot-prefixed path + * notation (e.g., "value.amount"). For nested fields, the leaf node name is used. + * Colon-prefixed notation (e.g., "value:amount") is supported for backwards + * compatibility but is deprecated; migrate to dot notation. + */ + input?: string | undefined; +} + +/** A trigger that fires when the upstream source table changes. */ +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface UpdateTableTrigger {} + +export interface UpdateTimeWindow { + windowType?: + | {$case: 'continuous'; continuous: UpdateContinuousWindow} + | {$case: 'tumbling'; tumbling: UpdateTumblingWindow} + | {$case: 'sliding'; sliding: UpdateSlidingWindow} + | {$case: 'rolling'; rolling: UpdateRollingWindow} + | undefined; +} + +export interface UpdateTimeseriesColumn { + /** + * The name of the timeseries column. For Kafka sources, use dot-prefixed path notation to + * reference fields within the key or value schema (e.g., "value.event_timestamp"). For nested + * fields, the leaf node name (e.g., "event_timestamp" from "value.event_details.event_timestamp") + * is what will be present in materialized tables and expected to match at query time. + * Colon-prefixed notation (e.g., "value:event_timestamp") is supported for + * backwards compatibility but is deprecated; migrate to dot notation. + */ + name?: string | undefined; +} + +export interface UpdateTumblingWindow { + /** The duration of each tumbling window (non-overlapping, fixed-duration windows). */ + windowDuration?: Temporal.Duration | undefined; +} + +/** Computes the population variance. */ +export interface UpdateVarPopFunction { + /** The input column from which the population variance is computed. */ + input?: string | undefined; +} + +/** Computes the sample variance. */ +export interface UpdateVarSampFunction { + /** The input column from which the sample variance is computed. */ + input?: string | undefined; +} + +/** Computes the population variance. */ +export interface VarPopFunction { + /** The input column from which the population variance is computed. */ + input?: string | undefined; +} + +/** Computes the sample variance. */ +export interface VarSampFunction { + /** The input column from which the sample variance is computed. */ + input?: string | undefined; +} + +export const unmarshalAggregationFunctionSchema: z.ZodType = + z + .object({ + avg: z.lazy(() => unmarshalAvgFunctionSchema).optional(), + count_function: z.lazy(() => unmarshalCountFunctionSchema).optional(), + sum: z.lazy(() => unmarshalSumFunctionSchema).optional(), + min: z.lazy(() => unmarshalMinFunctionSchema).optional(), + max: z.lazy(() => unmarshalMaxFunctionSchema).optional(), + first: z.lazy(() => unmarshalFirstFunctionSchema).optional(), + last: z.lazy(() => unmarshalLastFunctionSchema).optional(), + approx_count_distinct: z + .lazy(() => unmarshalApproxCountDistinctFunctionSchema) + .optional(), + approx_percentile: z + .lazy(() => unmarshalApproxPercentileFunctionSchema) + .optional(), + stddev_pop: z.lazy(() => unmarshalStddevPopFunctionSchema).optional(), + stddev_samp: z.lazy(() => unmarshalStddevSampFunctionSchema).optional(), + var_pop: z.lazy(() => unmarshalVarPopFunctionSchema).optional(), var_samp: z.lazy(() => unmarshalVarSampFunctionSchema).optional(), first_n: z.lazy(() => unmarshalFirstNFunctionSchema).optional(), last_n: z.lazy(() => unmarshalLastNFunctionSchema).optional(), first_distinct_n: z .lazy(() => unmarshalFirstDistinctNFunctionSchema) .optional(), - last_distinct_n: z - .lazy(() => unmarshalLastDistinctNFunctionSchema) + last_distinct_n: z + .lazy(() => unmarshalLastDistinctNFunctionSchema) + .optional(), + time_window: z.lazy(() => unmarshalTimeWindowSchema).optional(), + }) + .transform(d => ({ + operation: + d.avg !== undefined + ? {$case: 'avg' as const, avg: d.avg} + : d.count_function !== undefined + ? {$case: 'countFunction' as const, countFunction: d.count_function} + : d.sum !== undefined + ? {$case: 'sum' as const, sum: d.sum} + : d.min !== undefined + ? {$case: 'min' as const, min: d.min} + : d.max !== undefined + ? {$case: 'max' as const, max: d.max} + : d.first !== undefined + ? {$case: 'first' as const, first: d.first} + : d.last !== undefined + ? {$case: 'last' as const, last: d.last} + : d.approx_count_distinct !== undefined + ? { + $case: 'approxCountDistinct' as const, + approxCountDistinct: d.approx_count_distinct, + } + : d.approx_percentile !== undefined + ? { + $case: 'approxPercentile' as const, + approxPercentile: d.approx_percentile, + } + : d.stddev_pop !== undefined + ? { + $case: 'stddevPop' as const, + stddevPop: d.stddev_pop, + } + : d.stddev_samp !== undefined + ? { + $case: 'stddevSamp' as const, + stddevSamp: d.stddev_samp, + } + : d.var_pop !== undefined + ? {$case: 'varPop' as const, varPop: d.var_pop} + : d.var_samp !== undefined + ? { + $case: 'varSamp' as const, + varSamp: d.var_samp, + } + : d.first_n !== undefined + ? { + $case: 'firstN' as const, + firstN: d.first_n, + } + : d.last_n !== undefined + ? { + $case: 'lastN' as const, + lastN: d.last_n, + } + : d.first_distinct_n !== undefined + ? { + $case: 'firstDistinctN' as const, + firstDistinctN: d.first_distinct_n, + } + : d.last_distinct_n !== undefined + ? { + $case: 'lastDistinctN' as const, + lastDistinctN: d.last_distinct_n, + } + : undefined, + timeWindow: d.time_window, + })); + +export const unmarshalApproxCountDistinctFunctionSchema: z.ZodType = + z + .object({ + input: z.string().optional(), + relative_sd: z.number().optional(), + }) + .transform(d => ({ + input: d.input, + relativeSd: d.relative_sd, + })); + +export const unmarshalApproxPercentileFunctionSchema: z.ZodType = + z + .object({ + input: z.string().optional(), + percentile: z.number().optional(), + accuracy: z + .union([z.number(), z.bigint()]) + .transform(v => BigInt(v)) + .optional(), + }) + .transform(d => ({ + input: d.input, + percentile: d.percentile, + accuracy: d.accuracy, + })); + +export const unmarshalAuthConfigSchema: z.ZodType = z + .object({ + uc_service_credential_name: z.string().optional(), + mtls_config: z.lazy(() => unmarshalMtlsConfigSchema).optional(), + }) + .transform(d => ({ + authConfig: + d.uc_service_credential_name !== undefined + ? { + $case: 'ucServiceCredentialName' as const, + ucServiceCredentialName: d.uc_service_credential_name, + } + : d.mtls_config !== undefined + ? {$case: 'mtlsConfig' as const, mtlsConfig: d.mtls_config} + : undefined, + })); + +export const unmarshalAvgFunctionSchema: z.ZodType = z + .object({ + input: z.string().optional(), + }) + .transform(d => ({ + input: d.input, + })); + +export const unmarshalBackfillSourceSchema: z.ZodType = z + .object({ + delta_table_source: z + .lazy(() => unmarshalDeltaTableSourceSchema) + .optional(), + delta_table_name: z.string().optional(), + }) + .transform(d => ({ + backfillSource: + d.delta_table_source !== undefined + ? { + $case: 'deltaTableSource' as const, + deltaTableSource: d.delta_table_source, + } + : d.delta_table_name !== undefined + ? { + $case: 'deltaTableName' as const, + deltaTableName: d.delta_table_name, + } + : undefined, + })); + +export const unmarshalBatchCreateMaterializedFeaturesResponseSchema: z.ZodType = + z + .object({ + materialized_features: z + .array(z.lazy(() => unmarshalMaterializedFeatureSchema)) + .optional(), + }) + .transform(d => ({ + materializedFeatures: d.materialized_features, + })); + +export const unmarshalColumnIdentifierSchema: z.ZodType = z + .object({ + variant_expr_path: z.string().optional(), + }) + .transform(d => ({ + variantExprPath: d.variant_expr_path, + })); + +export const unmarshalColumnSelectionSchema: z.ZodType = z + .object({ + column: z.string().optional(), + }) + .transform(d => ({ + column: d.column, + })); + +export const unmarshalContinuousWindowSchema: z.ZodType = z + .object({ + window_duration: z + .string() + .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) + .optional(), + offset: z + .string() + .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) + .optional(), + }) + .transform(d => ({ + windowDuration: d.window_duration, + offset: d.offset, + })); + +export const unmarshalCountFunctionSchema: z.ZodType = z + .object({ + input: z.string().optional(), + }) + .transform(d => ({ + input: d.input, + })); + +export const unmarshalCronScheduleSchema: z.ZodType = z + .object({ + cron_expression: z.string().optional(), + }) + .transform(d => ({ + cronExpression: d.cron_expression, + })); + +export const unmarshalDataSourceSchema: z.ZodType = z + .object({ + delta_table_source: z + .lazy(() => unmarshalDeltaTableSourceSchema) + .optional(), + kafka_source: z.lazy(() => unmarshalKafkaSourceSchema).optional(), + request_source: z.lazy(() => unmarshalRequestSourceSchema).optional(), + stream_source: z.lazy(() => unmarshalStreamSourceSchema).optional(), + }) + .transform(d => ({ + dataSource: + d.delta_table_source !== undefined + ? { + $case: 'deltaTableSource' as const, + deltaTableSource: d.delta_table_source, + } + : d.kafka_source !== undefined + ? {$case: 'kafkaSource' as const, kafkaSource: d.kafka_source} + : d.request_source !== undefined + ? {$case: 'requestSource' as const, requestSource: d.request_source} + : d.stream_source !== undefined + ? {$case: 'streamSource' as const, streamSource: d.stream_source} + : undefined, + })); + +export const unmarshalDeltaTableSourceSchema: z.ZodType = z + .object({ + full_name: z.string().optional(), + entity_columns: z.array(z.string()).optional(), + timeseries_column: z.string().optional(), + filter_condition: z.string().optional(), + transformation_sql: z.string().optional(), + dataframe_schema: z.string().optional(), + }) + .transform(d => ({ + fullName: d.full_name, + entityColumns: d.entity_columns, + timeseriesColumn: d.timeseries_column, + filterCondition: d.filter_condition, + transformationSql: d.transformation_sql, + dataframeSchema: d.dataframe_schema, + })); + +export const unmarshalDirectMtlsConfigSchema: z.ZodType = z + .object({ + bootstrap_servers: z.string().optional(), + mtls_config: z.lazy(() => unmarshalMtlsConfigSchema).optional(), + }) + .transform(d => ({ + bootstrapServers: d.bootstrap_servers, + mtlsConfig: d.mtls_config, + })); + +export const unmarshalDirectSchemasSchema: z.ZodType = z + .object({ + payload_schema: z.lazy(() => unmarshalSchemaConfigSchema).optional(), + key_schema: z.lazy(() => unmarshalSchemaConfigSchema).optional(), + }) + .transform(d => ({ + payloadSchema: d.payload_schema, + keySchema: d.key_schema, + })); + +export const unmarshalEntityColumnSchema: z.ZodType = z + .object({ + name: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + })); + +export const unmarshalFeatureSchema: z.ZodType = z + .object({ + full_name: z.string().optional(), + source: z.lazy(() => unmarshalDataSourceSchema).optional(), + inputs: z.array(z.string()).optional(), + function: z.lazy(() => unmarshalFunctionSchema).optional(), + time_window: z.lazy(() => unmarshalTimeWindowSchema).optional(), + description: z.string().optional(), + filter_condition: z.string().optional(), + lineage_context: z.lazy(() => unmarshalLineageContextSchema).optional(), + entities: z.array(z.lazy(() => unmarshalEntityColumnSchema)).optional(), + timeseries_column: z.lazy(() => unmarshalTimeseriesColumnSchema).optional(), + catalog_name: z.string().optional(), + schema_name: z.string().optional(), + name: z.string().optional(), + created_at: z + .string() + .transform(s => Temporal.Instant.from(s)) + .optional(), + created_by: z.string().optional(), + }) + .transform(d => ({ + fullName: d.full_name, + source: d.source, + inputs: d.inputs, + function: d.function, + timeWindow: d.time_window, + description: d.description, + filterCondition: d.filter_condition, + lineageContext: d.lineage_context, + entities: d.entities, + timeseriesColumn: d.timeseries_column, + catalogName: d.catalog_name, + schemaName: d.schema_name, + name: d.name, + createdAt: d.created_at, + createdBy: d.created_by, + })); + +export const unmarshalFieldDefinitionSchema: z.ZodType = z + .object({ + name: z.string().optional(), + data_type: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + dataType: d.data_type, + })); + +export const unmarshalFirstDistinctNFunctionSchema: z.ZodType = + z + .object({ + input: z.string().optional(), + n: z + .union([z.number(), z.bigint()]) + .transform(v => BigInt(v)) + .optional(), + }) + .transform(d => ({ + input: d.input, + n: d.n, + })); + +export const unmarshalFirstFunctionSchema: z.ZodType = z + .object({ + input: z.string().optional(), + }) + .transform(d => ({ + input: d.input, + })); + +export const unmarshalFirstNFunctionSchema: z.ZodType = z + .object({ + input: z.string().optional(), + n: z + .union([z.number(), z.bigint()]) + .transform(v => BigInt(v)) + .optional(), + }) + .transform(d => ({ + input: d.input, + n: d.n, + })); + +export const unmarshalFlatSchemaSchema: z.ZodType = z + .object({ + fields: z.array(z.lazy(() => unmarshalFieldDefinitionSchema)).optional(), + }) + .transform(d => ({ + fields: d.fields, + })); + +export const unmarshalFunctionSchema: z.ZodType = z + .object({ + function_type: z.string().optional(), + extra_parameters: z + .array(z.lazy(() => unmarshalFunction_ExtraParameterSchema)) + .optional(), + aggregation_function: z + .lazy(() => unmarshalAggregationFunctionSchema) + .optional(), + column_selection: z.lazy(() => unmarshalColumnSelectionSchema).optional(), + }) + .transform(d => ({ + functionType: d.function_type, + extraParameters: d.extra_parameters, + function: + d.aggregation_function !== undefined + ? { + $case: 'aggregationFunction' as const, + aggregationFunction: d.aggregation_function, + } + : d.column_selection !== undefined + ? { + $case: 'columnSelection' as const, + columnSelection: d.column_selection, + } + : undefined, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const unmarshalFunction_ExtraParameterSchema: z.ZodType = + z + .object({ + key: z.string().optional(), + value: z.string().optional(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); + +export const unmarshalIngestionConfigSchema: z.ZodType = z + .object({ + ingestion_destination: z + .lazy(() => unmarshalIngestionDestinationSchema) + .optional(), + backfill_source: z.lazy(() => unmarshalBackfillSourceSchema).optional(), + deduplication_columns: z.array(z.string()).optional(), + ingestion_pipeline_id: z.string().optional(), + ingestion_job_id: z + .union([z.number(), z.bigint()]) + .transform(v => BigInt(v)) + .optional(), + backfill_job_id: z + .union([z.number(), z.bigint()]) + .transform(v => BigInt(v)) + .optional(), + }) + .transform(d => ({ + ingestionDestination: d.ingestion_destination, + backfillSource: d.backfill_source, + deduplicationColumns: d.deduplication_columns, + ingestionPipelineId: d.ingestion_pipeline_id, + ingestionJobId: d.ingestion_job_id, + backfillJobId: d.backfill_job_id, + })); + +export const unmarshalIngestionDestinationSchema: z.ZodType = + z + .object({ + delta_table_name: z.string().optional(), + }) + .transform(d => ({ + ingestionDestination: + d.delta_table_name !== undefined + ? { + $case: 'deltaTableName' as const, + deltaTableName: d.delta_table_name, + } + : undefined, + })); + +export const unmarshalJobContextSchema: z.ZodType = z + .object({ + job_id: z + .union([z.number(), z.bigint()]) + .transform(v => BigInt(v)) + .optional(), + job_run_id: z + .union([z.number(), z.bigint()]) + .transform(v => BigInt(v)) + .optional(), + }) + .transform(d => ({ + jobId: d.job_id, + jobRunId: d.job_run_id, + })); + +export const unmarshalKafkaConfigSchema: z.ZodType = z + .object({ + name: z.string().optional(), + bootstrap_servers: z.string().optional(), + subscription_mode: z.lazy(() => unmarshalSubscriptionModeSchema).optional(), + auth_config: z.lazy(() => unmarshalAuthConfigSchema).optional(), + key_schema: z.lazy(() => unmarshalSchemaConfigSchema).optional(), + value_schema: z.lazy(() => unmarshalSchemaConfigSchema).optional(), + extra_options: z.record(z.string(), z.string()).optional(), + backfill_source: z.lazy(() => unmarshalBackfillSourceSchema).optional(), + ingestion_config: z.lazy(() => unmarshalIngestionConfigSchema).optional(), + }) + .transform(d => ({ + name: d.name, + bootstrapServers: d.bootstrap_servers, + subscriptionMode: d.subscription_mode, + authConfig: d.auth_config, + keySchema: d.key_schema, + valueSchema: d.value_schema, + extraOptions: d.extra_options, + backfillSource: d.backfill_source, + ingestionConfig: d.ingestion_config, + })); + +export const unmarshalKafkaSourceSchema: z.ZodType = z + .object({ + name: z.string().optional(), + entity_column_identifiers: z + .array(z.lazy(() => unmarshalColumnIdentifierSchema)) + .optional(), + timeseries_column_identifier: z + .lazy(() => unmarshalColumnIdentifierSchema) + .optional(), + filter_condition: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + entityColumnIdentifiers: d.entity_column_identifiers, + timeseriesColumnIdentifier: d.timeseries_column_identifier, + filterCondition: d.filter_condition, + })); + +export const unmarshalKafkaStreamConfigSchema: z.ZodType = z + .object({ + subscription_mode: z + .lazy(() => unmarshalKafkaSubscriptionModeSchema) + .optional(), + extra_options: z.record(z.string(), z.string()).optional(), + }) + .transform(d => ({ + subscriptionMode: d.subscription_mode, + extraOptions: d.extra_options, + })); + +export const unmarshalKafkaSubscriptionModeSchema: z.ZodType = + z + .object({ + assign: z.string().optional(), + subscribe: z.string().optional(), + subscribe_pattern: z.string().optional(), + }) + .transform(d => ({ + subscriptionMode: + d.assign !== undefined + ? {$case: 'assign' as const, assign: d.assign} + : d.subscribe !== undefined + ? {$case: 'subscribe' as const, subscribe: d.subscribe} + : d.subscribe_pattern !== undefined + ? { + $case: 'subscribePattern' as const, + subscribePattern: d.subscribe_pattern, + } + : undefined, + })); + +export const unmarshalLastDistinctNFunctionSchema: z.ZodType = + z + .object({ + input: z.string().optional(), + n: z + .union([z.number(), z.bigint()]) + .transform(v => BigInt(v)) + .optional(), + }) + .transform(d => ({ + input: d.input, + n: d.n, + })); + +export const unmarshalLastFunctionSchema: z.ZodType = z + .object({ + input: z.string().optional(), + }) + .transform(d => ({ + input: d.input, + })); + +export const unmarshalLastNFunctionSchema: z.ZodType = z + .object({ + input: z.string().optional(), + n: z + .union([z.number(), z.bigint()]) + .transform(v => BigInt(v)) + .optional(), + }) + .transform(d => ({ + input: d.input, + n: d.n, + })); + +export const unmarshalLineageContextSchema: z.ZodType = z + .object({ + notebook_id: z + .union([z.number(), z.bigint()]) + .transform(v => BigInt(v)) + .optional(), + job_context: z.lazy(() => unmarshalJobContextSchema).optional(), + }) + .transform(d => ({ + notebookId: d.notebook_id, + jobContext: d.job_context, + })); + +export const unmarshalListFeaturesResponseSchema: z.ZodType = + z + .object({ + features: z.array(z.lazy(() => unmarshalFeatureSchema)).optional(), + next_page_token: z.string().optional(), + }) + .transform(d => ({ + features: d.features, + nextPageToken: d.next_page_token, + })); + +export const unmarshalListKafkaConfigsResponseSchema: z.ZodType = + z + .object({ + kafka_configs: z + .array(z.lazy(() => unmarshalKafkaConfigSchema)) + .optional(), + next_page_token: z.string().optional(), + }) + .transform(d => ({ + kafkaConfigs: d.kafka_configs, + nextPageToken: d.next_page_token, + })); + +export const unmarshalListMaterializedFeaturesResponseSchema: z.ZodType = + z + .object({ + materialized_features: z + .array(z.lazy(() => unmarshalMaterializedFeatureSchema)) + .optional(), + next_page_token: z.string().optional(), + }) + .transform(d => ({ + materializedFeatures: d.materialized_features, + nextPageToken: d.next_page_token, + })); + +export const unmarshalListStreamsResponseSchema: z.ZodType = + z + .object({ + streams: z.array(z.lazy(() => unmarshalStreamSchema)).optional(), + next_page_token: z.string().optional(), + }) + .transform(d => ({ + streams: d.streams, + nextPageToken: d.next_page_token, + })); + +export const unmarshalMaterializedFeatureSchema: z.ZodType = + z + .object({ + materialized_feature_id: z.string().optional(), + feature_name: z.string().optional(), + offline_store_config: z + .lazy(() => unmarshalOfflineStoreConfigSchema) + .optional(), + online_store_config: z + .lazy(() => unmarshalOnlineStoreConfigSchema) + .optional(), + table_name: z.string().optional(), + pipeline_schedule_state: z.string().optional(), + last_materialization_time: z + .string() + .transform(s => Temporal.Instant.from(s)) + .optional(), + cron_schedule: z.string().optional(), + is_online: z.boolean().optional(), + cron_schedule_trigger: z + .lazy(() => unmarshalCronScheduleSchema) + .optional(), + table_trigger: z.lazy(() => unmarshalTableTriggerSchema).optional(), + streaming_mode: z.lazy(() => unmarshalStreamingModeSchema).optional(), + }) + .transform(d => ({ + materializedFeatureId: d.materialized_feature_id, + featureName: d.feature_name, + destination: + d.offline_store_config !== undefined + ? { + $case: 'offlineStoreConfig' as const, + offlineStoreConfig: d.offline_store_config, + } + : d.online_store_config !== undefined + ? { + $case: 'onlineStoreConfig' as const, + onlineStoreConfig: d.online_store_config, + } + : undefined, + tableName: d.table_name, + pipelineScheduleState: d.pipeline_schedule_state, + lastMaterializationTime: d.last_materialization_time, + cronSchedule: d.cron_schedule, + isOnline: d.is_online, + trigger: + d.cron_schedule_trigger !== undefined + ? { + $case: 'cronScheduleTrigger' as const, + cronScheduleTrigger: d.cron_schedule_trigger, + } + : d.table_trigger !== undefined + ? {$case: 'tableTrigger' as const, tableTrigger: d.table_trigger} + : d.streaming_mode !== undefined + ? { + $case: 'streamingMode' as const, + streamingMode: d.streaming_mode, + } + : undefined, + })); + +export const unmarshalMaxFunctionSchema: z.ZodType = z + .object({ + input: z.string().optional(), + }) + .transform(d => ({ + input: d.input, + })); + +export const unmarshalMinFunctionSchema: z.ZodType = z + .object({ + input: z.string().optional(), + }) + .transform(d => ({ + input: d.input, + })); + +export const unmarshalMtlsConfigSchema: z.ZodType = z + .object({ + keystore_location: z.string().optional(), + keystore_password_ref: z + .lazy(() => unmarshalSecretScopeReferenceSchema) + .optional(), + key_password_ref: z + .lazy(() => unmarshalSecretScopeReferenceSchema) + .optional(), + truststore_location: z.string().optional(), + truststore_password_ref: z + .lazy(() => unmarshalSecretScopeReferenceSchema) + .optional(), + disable_hostname_verification: z.boolean().optional(), + }) + .transform(d => ({ + keystoreLocation: d.keystore_location, + keystorePasswordRef: d.keystore_password_ref, + keyPasswordRef: d.key_password_ref, + truststoreLocation: d.truststore_location, + truststorePasswordRef: d.truststore_password_ref, + disableHostnameVerification: d.disable_hostname_verification, + })); + +export const unmarshalOfflineStoreConfigSchema: z.ZodType = + z + .object({ + catalog_name: z.string().optional(), + schema_name: z.string().optional(), + table_name_prefix: z.string().optional(), + }) + .transform(d => ({ + catalogName: d.catalog_name, + schemaName: d.schema_name, + tableNamePrefix: d.table_name_prefix, + })); + +export const unmarshalOnlineStoreConfigSchema: z.ZodType = z + .object({ + catalog_name: z.string().optional(), + schema_name: z.string().optional(), + table_name_prefix: z.string().optional(), + online_store_name: z.string().optional(), + }) + .transform(d => ({ + catalogName: d.catalog_name, + schemaName: d.schema_name, + tableNamePrefix: d.table_name_prefix, + onlineStoreName: d.online_store_name, + })); + +export const unmarshalRequestSourceSchema: z.ZodType = z + .object({ + flat_schema: z.lazy(() => unmarshalFlatSchemaSchema).optional(), + }) + .transform(d => ({ + schema: + d.flat_schema !== undefined + ? {$case: 'flatSchema' as const, flatSchema: d.flat_schema} + : undefined, + })); + +export const unmarshalRollingWindowSchema: z.ZodType = z + .object({ + window_duration: z + .string() + .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) + .optional(), + delay: z + .string() + .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) + .optional(), + }) + .transform(d => ({ + windowDuration: d.window_duration, + delay: d.delay, + })); + +export const unmarshalSchemaConfigSchema: z.ZodType = z + .object({ + json_schema: z.string().optional(), + }) + .transform(d => ({ + schema: + d.json_schema !== undefined + ? {$case: 'jsonSchema' as const, jsonSchema: d.json_schema} + : undefined, + })); + +export const unmarshalSecretScopeReferenceSchema: z.ZodType = + z + .object({ + scope: z.string().optional(), + key: z.string().optional(), + }) + .transform(d => ({ + scope: d.scope, + key: d.key, + })); + +export const unmarshalSlidingWindowSchema: z.ZodType = z + .object({ + window_duration: z + .string() + .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) + .optional(), + slide_duration: z + .string() + .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) + .optional(), + }) + .transform(d => ({ + windowDuration: d.window_duration, + slideDuration: d.slide_duration, + })); + +export const unmarshalStddevPopFunctionSchema: z.ZodType = z + .object({ + input: z.string().optional(), + }) + .transform(d => ({ + input: d.input, + })); + +export const unmarshalStddevSampFunctionSchema: z.ZodType = + z + .object({ + input: z.string().optional(), + }) + .transform(d => ({ + input: d.input, + })); + +export const unmarshalStreamSchema: z.ZodType = z + .object({ + name: z.string().optional(), + description: z.string().optional(), + source_config: z.lazy(() => unmarshalStreamSourceConfigSchema).optional(), + connection_config: z + .lazy(() => unmarshalStreamConnectionConfigSchema) + .optional(), + schema_config: z.lazy(() => unmarshalStreamSchemaConfigSchema).optional(), + ingestion_config: z.lazy(() => unmarshalIngestionConfigSchema).optional(), + create_time: z + .string() + .transform(s => Temporal.Instant.from(s)) + .optional(), + created_by: z.string().optional(), + update_time: z + .string() + .transform(s => Temporal.Instant.from(s)) + .optional(), + updated_by: z.string().optional(), + browse_only: z.boolean().optional(), + }) + .transform(d => ({ + name: d.name, + description: d.description, + sourceConfig: d.source_config, + connectionConfig: d.connection_config, + schemaConfig: d.schema_config, + ingestionConfig: d.ingestion_config, + createTime: d.create_time, + createdBy: d.created_by, + updateTime: d.update_time, + updatedBy: d.updated_by, + browseOnly: d.browse_only, + })); + +export const unmarshalStreamConnectionConfigSchema: z.ZodType = + z + .object({ + uc_connection_name: z.string().optional(), + direct_mtls_config: z + .lazy(() => unmarshalDirectMtlsConfigSchema) .optional(), - time_window: z.lazy(() => unmarshalTimeWindowSchema).optional(), }) .transform(d => ({ - operation: - d.avg !== undefined - ? {$case: 'avg' as const, avg: d.avg} - : d.count_function !== undefined - ? {$case: 'countFunction' as const, countFunction: d.count_function} - : d.sum !== undefined - ? {$case: 'sum' as const, sum: d.sum} - : d.min !== undefined - ? {$case: 'min' as const, min: d.min} - : d.max !== undefined - ? {$case: 'max' as const, max: d.max} - : d.first !== undefined - ? {$case: 'first' as const, first: d.first} - : d.last !== undefined - ? {$case: 'last' as const, last: d.last} - : d.approx_count_distinct !== undefined - ? { - $case: 'approxCountDistinct' as const, - approxCountDistinct: d.approx_count_distinct, - } - : d.approx_percentile !== undefined - ? { - $case: 'approxPercentile' as const, - approxPercentile: d.approx_percentile, - } - : d.stddev_pop !== undefined - ? { - $case: 'stddevPop' as const, - stddevPop: d.stddev_pop, - } - : d.stddev_samp !== undefined - ? { - $case: 'stddevSamp' as const, - stddevSamp: d.stddev_samp, - } - : d.var_pop !== undefined - ? {$case: 'varPop' as const, varPop: d.var_pop} - : d.var_samp !== undefined - ? { - $case: 'varSamp' as const, - varSamp: d.var_samp, - } - : d.first_n !== undefined - ? { - $case: 'firstN' as const, - firstN: d.first_n, - } - : d.last_n !== undefined - ? { - $case: 'lastN' as const, - lastN: d.last_n, - } - : d.first_distinct_n !== undefined - ? { - $case: 'firstDistinctN' as const, - firstDistinctN: d.first_distinct_n, - } - : d.last_distinct_n !== undefined - ? { - $case: 'lastDistinctN' as const, - lastDistinctN: d.last_distinct_n, - } - : undefined, - timeWindow: d.time_window, + connectionConfig: + d.uc_connection_name !== undefined + ? { + $case: 'ucConnectionName' as const, + ucConnectionName: d.uc_connection_name, + } + : d.direct_mtls_config !== undefined + ? { + $case: 'directMtlsConfig' as const, + directMtlsConfig: d.direct_mtls_config, + } + : undefined, })); -export const unmarshalApproxCountDistinctFunctionSchema: z.ZodType = +export const unmarshalStreamSchemaConfigSchema: z.ZodType = z .object({ - input: z.string().optional(), - relative_sd: z.number().optional(), + direct_schemas: z.lazy(() => unmarshalDirectSchemasSchema).optional(), }) .transform(d => ({ - input: d.input, - relativeSd: d.relative_sd, + schemaConfig: + d.direct_schemas !== undefined + ? {$case: 'directSchemas' as const, directSchemas: d.direct_schemas} + : undefined, })); -export const unmarshalApproxPercentileFunctionSchema: z.ZodType = +export const unmarshalStreamSourceSchema: z.ZodType = z + .object({ + full_name: z.string().optional(), + filter_condition: z.string().optional(), + }) + .transform(d => ({ + fullName: d.full_name, + filterCondition: d.filter_condition, + })); + +export const unmarshalStreamSourceConfigSchema: z.ZodType = z .object({ - input: z.string().optional(), - percentile: z.number().optional(), - accuracy: z - .union([z.number(), z.bigint()]) - .transform(v => BigInt(v)) + kafka_stream_config: z + .lazy(() => unmarshalKafkaStreamConfigSchema) .optional(), }) .transform(d => ({ - input: d.input, - percentile: d.percentile, - accuracy: d.accuracy, + sourceConfig: + d.kafka_stream_config !== undefined + ? { + $case: 'kafkaStreamConfig' as const, + kafkaStreamConfig: d.kafka_stream_config, + } + : undefined, })); -export const unmarshalAuthConfigSchema: z.ZodType = z +export const unmarshalStreamingModeSchema: z.ZodType = z + .object({ + mode: z.string().optional(), + }) + .transform(d => ({ + mode: d.mode, + })); + +export const unmarshalSubscriptionModeSchema: z.ZodType = z + .object({ + assign: z.string().optional(), + subscribe: z.string().optional(), + subscribe_pattern: z.string().optional(), + }) + .transform(d => ({ + subscriptionMode: + d.assign !== undefined + ? {$case: 'assign' as const, assign: d.assign} + : d.subscribe !== undefined + ? {$case: 'subscribe' as const, subscribe: d.subscribe} + : d.subscribe_pattern !== undefined + ? { + $case: 'subscribePattern' as const, + subscribePattern: d.subscribe_pattern, + } + : undefined, + })); + +export const unmarshalSumFunctionSchema: z.ZodType = z + .object({ + input: z.string().optional(), + }) + .transform(d => ({ + input: d.input, + })); + +export const unmarshalTableTriggerSchema: z.ZodType = z.object( + {} +); + +export const unmarshalTimeWindowSchema: z.ZodType = z + .object({ + continuous: z.lazy(() => unmarshalContinuousWindowSchema).optional(), + tumbling: z.lazy(() => unmarshalTumblingWindowSchema).optional(), + sliding: z.lazy(() => unmarshalSlidingWindowSchema).optional(), + rolling: z.lazy(() => unmarshalRollingWindowSchema).optional(), + }) + .transform(d => ({ + windowType: + d.continuous !== undefined + ? {$case: 'continuous' as const, continuous: d.continuous} + : d.tumbling !== undefined + ? {$case: 'tumbling' as const, tumbling: d.tumbling} + : d.sliding !== undefined + ? {$case: 'sliding' as const, sliding: d.sliding} + : d.rolling !== undefined + ? {$case: 'rolling' as const, rolling: d.rolling} + : undefined, + })); + +export const unmarshalTimeseriesColumnSchema: z.ZodType = z + .object({ + name: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + })); + +export const unmarshalTumblingWindowSchema: z.ZodType = z + .object({ + window_duration: z + .string() + .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) + .optional(), + }) + .transform(d => ({ + windowDuration: d.window_duration, + })); + +export const unmarshalVarPopFunctionSchema: z.ZodType = z .object({ - uc_service_credential_name: z.string().optional(), - mtls_config: z.lazy(() => unmarshalMtlsConfigSchema).optional(), + input: z.string().optional(), }) .transform(d => ({ - authConfig: - d.uc_service_credential_name !== undefined - ? { - $case: 'ucServiceCredentialName' as const, - ucServiceCredentialName: d.uc_service_credential_name, - } - : d.mtls_config !== undefined - ? {$case: 'mtlsConfig' as const, mtlsConfig: d.mtls_config} - : undefined, + input: d.input, })); -export const unmarshalAvgFunctionSchema: z.ZodType = z +export const unmarshalVarSampFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), }) @@ -1366,827 +4080,902 @@ export const unmarshalAvgFunctionSchema: z.ZodType = z input: d.input, })); -export const unmarshalBackfillSourceSchema: z.ZodType = z +export const marshalBatchCreateMaterializedFeaturesRequestSchema: z.ZodType = z .object({ - delta_table_source: z - .lazy(() => unmarshalDeltaTableSourceSchema) + requests: z + .array(z.lazy(() => marshalCreateCreateMaterializedFeatureRequestSchema)) .optional(), - delta_table_name: z.string().optional(), }) .transform(d => ({ - backfillSource: - d.delta_table_source !== undefined - ? { - $case: 'deltaTableSource' as const, - deltaTableSource: d.delta_table_source, - } - : d.delta_table_name !== undefined - ? { - $case: 'deltaTableName' as const, - deltaTableName: d.delta_table_name, - } - : undefined, + requests: d.requests, })); -export const unmarshalBatchCreateMaterializedFeaturesResponseSchema: z.ZodType = - z - .object({ - materialized_features: z - .array(z.lazy(() => unmarshalMaterializedFeatureSchema)) - .optional(), - }) - .transform(d => ({ - materializedFeatures: d.materialized_features, - })); +export const marshalCreateAggregationFunctionSchema: z.ZodType = z + .object({ + operation: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('avg'), + avg: z.lazy(() => marshalCreateAvgFunctionSchema), + }), + z.object({ + $case: z.literal('countFunction'), + countFunction: z.lazy(() => marshalCreateCountFunctionSchema), + }), + z.object({ + $case: z.literal('sum'), + sum: z.lazy(() => marshalCreateSumFunctionSchema), + }), + z.object({ + $case: z.literal('min'), + min: z.lazy(() => marshalCreateMinFunctionSchema), + }), + z.object({ + $case: z.literal('max'), + max: z.lazy(() => marshalCreateMaxFunctionSchema), + }), + z.object({ + $case: z.literal('first'), + first: z.lazy(() => marshalCreateFirstFunctionSchema), + }), + z.object({ + $case: z.literal('last'), + last: z.lazy(() => marshalCreateLastFunctionSchema), + }), + z.object({ + $case: z.literal('approxCountDistinct'), + approxCountDistinct: z.lazy( + () => marshalCreateApproxCountDistinctFunctionSchema + ), + }), + z.object({ + $case: z.literal('approxPercentile'), + approxPercentile: z.lazy( + () => marshalCreateApproxPercentileFunctionSchema + ), + }), + z.object({ + $case: z.literal('stddevPop'), + stddevPop: z.lazy(() => marshalCreateStddevPopFunctionSchema), + }), + z.object({ + $case: z.literal('stddevSamp'), + stddevSamp: z.lazy(() => marshalCreateStddevSampFunctionSchema), + }), + z.object({ + $case: z.literal('varPop'), + varPop: z.lazy(() => marshalCreateVarPopFunctionSchema), + }), + z.object({ + $case: z.literal('varSamp'), + varSamp: z.lazy(() => marshalCreateVarSampFunctionSchema), + }), + z.object({ + $case: z.literal('firstN'), + firstN: z.lazy(() => marshalCreateFirstNFunctionSchema), + }), + z.object({ + $case: z.literal('lastN'), + lastN: z.lazy(() => marshalCreateLastNFunctionSchema), + }), + z.object({ + $case: z.literal('firstDistinctN'), + firstDistinctN: z.lazy( + () => marshalCreateFirstDistinctNFunctionSchema + ), + }), + z.object({ + $case: z.literal('lastDistinctN'), + lastDistinctN: z.lazy(() => marshalCreateLastDistinctNFunctionSchema), + }), + ]) + .optional(), + timeWindow: z.lazy(() => marshalCreateTimeWindowSchema).optional(), + }) + .transform(d => ({ + ...(d.operation?.$case === 'avg' && {avg: d.operation.avg}), + ...(d.operation?.$case === 'countFunction' && { + count_function: d.operation.countFunction, + }), + ...(d.operation?.$case === 'sum' && {sum: d.operation.sum}), + ...(d.operation?.$case === 'min' && {min: d.operation.min}), + ...(d.operation?.$case === 'max' && {max: d.operation.max}), + ...(d.operation?.$case === 'first' && {first: d.operation.first}), + ...(d.operation?.$case === 'last' && {last: d.operation.last}), + ...(d.operation?.$case === 'approxCountDistinct' && { + approx_count_distinct: d.operation.approxCountDistinct, + }), + ...(d.operation?.$case === 'approxPercentile' && { + approx_percentile: d.operation.approxPercentile, + }), + ...(d.operation?.$case === 'stddevPop' && { + stddev_pop: d.operation.stddevPop, + }), + ...(d.operation?.$case === 'stddevSamp' && { + stddev_samp: d.operation.stddevSamp, + }), + ...(d.operation?.$case === 'varPop' && {var_pop: d.operation.varPop}), + ...(d.operation?.$case === 'varSamp' && {var_samp: d.operation.varSamp}), + ...(d.operation?.$case === 'firstN' && {first_n: d.operation.firstN}), + ...(d.operation?.$case === 'lastN' && {last_n: d.operation.lastN}), + ...(d.operation?.$case === 'firstDistinctN' && { + first_distinct_n: d.operation.firstDistinctN, + }), + ...(d.operation?.$case === 'lastDistinctN' && { + last_distinct_n: d.operation.lastDistinctN, + }), + time_window: d.timeWindow, + })); -export const unmarshalColumnIdentifierSchema: z.ZodType = z +export const marshalCreateApproxCountDistinctFunctionSchema: z.ZodType = z .object({ - variant_expr_path: z.string().optional(), + input: z.string(), + relativeSd: z.number().optional(), }) .transform(d => ({ - variantExprPath: d.variant_expr_path, + input: d.input, + relative_sd: d.relativeSd, })); -export const unmarshalColumnSelectionSchema: z.ZodType = z +export const marshalCreateApproxPercentileFunctionSchema: z.ZodType = z .object({ - column: z.string().optional(), + input: z.string(), + percentile: z.number(), + accuracy: z.bigint().optional(), }) .transform(d => ({ - column: d.column, + input: d.input, + percentile: d.percentile, + accuracy: d.accuracy, })); -export const unmarshalContinuousWindowSchema: z.ZodType = z +export const marshalCreateAuthConfigSchema: z.ZodType = z .object({ - window_duration: z - .string() - .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) + authConfig: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('ucServiceCredentialName'), + ucServiceCredentialName: z.string(), + }), + z.object({ + $case: z.literal('mtlsConfig'), + mtlsConfig: z.lazy(() => marshalCreateMtlsConfigSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.authConfig?.$case === 'ucServiceCredentialName' && { + uc_service_credential_name: d.authConfig.ucServiceCredentialName, + }), + ...(d.authConfig?.$case === 'mtlsConfig' && { + mtls_config: d.authConfig.mtlsConfig, + }), + })); + +export const marshalCreateAvgFunctionSchema: z.ZodType = z + .object({ + input: z.string(), + }) + .transform(d => ({ + input: d.input, + })); + +export const marshalCreateBackfillSourceSchema: z.ZodType = z + .object({ + backfillSource: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('deltaTableSource'), + deltaTableSource: z.lazy(() => marshalCreateDeltaTableSourceSchema), + }), + z.object({ + $case: z.literal('deltaTableName'), + deltaTableName: z.string(), + }), + ]) .optional(), + }) + .transform(d => ({ + ...(d.backfillSource?.$case === 'deltaTableSource' && { + delta_table_source: d.backfillSource.deltaTableSource, + }), + ...(d.backfillSource?.$case === 'deltaTableName' && { + delta_table_name: d.backfillSource.deltaTableName, + }), + })); + +export const marshalCreateColumnIdentifierSchema: z.ZodType = z + .object({ + variantExprPath: z.string(), + }) + .transform(d => ({ + variant_expr_path: d.variantExprPath, + })); + +export const marshalCreateColumnSelectionSchema: z.ZodType = z + .object({ + column: z.string(), + }) + .transform(d => ({ + column: d.column, + })); + +export const marshalCreateContinuousWindowSchema: z.ZodType = z + .object({ + windowDuration: z + .any() + .transform((d: Temporal.Duration) => d.toString().slice(2).toLowerCase()), offset: z - .string() - .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) + .any() + .transform((d: Temporal.Duration) => d.toString().slice(2).toLowerCase()) .optional(), }) .transform(d => ({ - windowDuration: d.window_duration, + window_duration: d.windowDuration, offset: d.offset, })); -export const unmarshalCountFunctionSchema: z.ZodType = z +export const marshalCreateCountFunctionSchema: z.ZodType = z .object({ - input: z.string().optional(), + input: z.string(), }) .transform(d => ({ input: d.input, })); -export const unmarshalCronScheduleSchema: z.ZodType = z +export const marshalCreateCreateMaterializedFeatureRequestSchema: z.ZodType = z .object({ - cron_expression: z.string().optional(), + materializedFeature: z.lazy(() => marshalCreateMaterializedFeatureSchema), }) .transform(d => ({ - cronExpression: d.cron_expression, + materialized_feature: d.materializedFeature, })); -export const unmarshalDataSourceSchema: z.ZodType = z +export const marshalCreateCronScheduleSchema: z.ZodType = z .object({ - delta_table_source: z - .lazy(() => unmarshalDeltaTableSourceSchema) + cronExpression: z.string().optional(), + }) + .transform(d => ({ + cron_expression: d.cronExpression, + })); + +export const marshalCreateDataSourceSchema: z.ZodType = z + .object({ + dataSource: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('deltaTableSource'), + deltaTableSource: z.lazy(() => marshalCreateDeltaTableSourceSchema), + }), + z.object({ + $case: z.literal('kafkaSource'), + kafkaSource: z.lazy(() => marshalCreateKafkaSourceSchema), + }), + z.object({ + $case: z.literal('requestSource'), + requestSource: z.lazy(() => marshalCreateRequestSourceSchema), + }), + z.object({ + $case: z.literal('streamSource'), + streamSource: z.lazy(() => marshalCreateStreamSourceSchema), + }), + ]) .optional(), - kafka_source: z.lazy(() => unmarshalKafkaSourceSchema).optional(), - request_source: z.lazy(() => unmarshalRequestSourceSchema).optional(), - stream_source: z.lazy(() => unmarshalStreamSourceSchema).optional(), }) .transform(d => ({ - dataSource: - d.delta_table_source !== undefined - ? { - $case: 'deltaTableSource' as const, - deltaTableSource: d.delta_table_source, - } - : d.kafka_source !== undefined - ? {$case: 'kafkaSource' as const, kafkaSource: d.kafka_source} - : d.request_source !== undefined - ? {$case: 'requestSource' as const, requestSource: d.request_source} - : d.stream_source !== undefined - ? {$case: 'streamSource' as const, streamSource: d.stream_source} - : undefined, + ...(d.dataSource?.$case === 'deltaTableSource' && { + delta_table_source: d.dataSource.deltaTableSource, + }), + ...(d.dataSource?.$case === 'kafkaSource' && { + kafka_source: d.dataSource.kafkaSource, + }), + ...(d.dataSource?.$case === 'requestSource' && { + request_source: d.dataSource.requestSource, + }), + ...(d.dataSource?.$case === 'streamSource' && { + stream_source: d.dataSource.streamSource, + }), })); -export const unmarshalDeltaTableSourceSchema: z.ZodType = z +export const marshalCreateDeltaTableSourceSchema: z.ZodType = z .object({ - full_name: z.string().optional(), - entity_columns: z.array(z.string()).optional(), - timeseries_column: z.string().optional(), - filter_condition: z.string().optional(), - transformation_sql: z.string().optional(), - dataframe_schema: z.string().optional(), + fullName: z.string(), + entityColumns: z.array(z.string()).optional(), + timeseriesColumn: z.string().optional(), + filterCondition: z.string().optional(), + transformationSql: z.string().optional(), + dataframeSchema: z.string().optional(), }) .transform(d => ({ - fullName: d.full_name, - entityColumns: d.entity_columns, - timeseriesColumn: d.timeseries_column, - filterCondition: d.filter_condition, - transformationSql: d.transformation_sql, - dataframeSchema: d.dataframe_schema, + full_name: d.fullName, + entity_columns: d.entityColumns, + timeseries_column: d.timeseriesColumn, + filter_condition: d.filterCondition, + transformation_sql: d.transformationSql, + dataframe_schema: d.dataframeSchema, })); -export const unmarshalDirectMtlsConfigSchema: z.ZodType = z +export const marshalCreateDirectMtlsConfigSchema: z.ZodType = z .object({ - bootstrap_servers: z.string().optional(), - mtls_config: z.lazy(() => unmarshalMtlsConfigSchema).optional(), + bootstrapServers: z.string(), + mtlsConfig: z.lazy(() => marshalCreateMtlsConfigSchema), }) .transform(d => ({ - bootstrapServers: d.bootstrap_servers, - mtlsConfig: d.mtls_config, + bootstrap_servers: d.bootstrapServers, + mtls_config: d.mtlsConfig, })); -export const unmarshalDirectSchemasSchema: z.ZodType = z +export const marshalCreateDirectSchemasSchema: z.ZodType = z .object({ - payload_schema: z.lazy(() => unmarshalSchemaConfigSchema).optional(), - key_schema: z.lazy(() => unmarshalSchemaConfigSchema).optional(), + payloadSchema: z.lazy(() => marshalCreateSchemaConfigSchema).optional(), + keySchema: z.lazy(() => marshalCreateSchemaConfigSchema).optional(), }) .transform(d => ({ - payloadSchema: d.payload_schema, - keySchema: d.key_schema, + payload_schema: d.payloadSchema, + key_schema: d.keySchema, })); -export const unmarshalEntityColumnSchema: z.ZodType = z +export const marshalCreateEntityColumnSchema: z.ZodType = z .object({ - name: z.string().optional(), + name: z.string(), }) .transform(d => ({ name: d.name, })); -export const unmarshalFeatureSchema: z.ZodType = z +export const marshalCreateFeatureSchema: z.ZodType = z .object({ - full_name: z.string().optional(), - source: z.lazy(() => unmarshalDataSourceSchema).optional(), + fullName: z.string().optional(), + source: z.lazy(() => marshalCreateDataSourceSchema), inputs: z.array(z.string()).optional(), - function: z.lazy(() => unmarshalFunctionSchema).optional(), - time_window: z.lazy(() => unmarshalTimeWindowSchema).optional(), + function: z.lazy(() => marshalCreateFunctionSchema), + timeWindow: z.lazy(() => marshalCreateTimeWindowSchema).optional(), description: z.string().optional(), - filter_condition: z.string().optional(), - lineage_context: z.lazy(() => unmarshalLineageContextSchema).optional(), - entities: z.array(z.lazy(() => unmarshalEntityColumnSchema)).optional(), - timeseries_column: z.lazy(() => unmarshalTimeseriesColumnSchema).optional(), - catalog_name: z.string().optional(), - schema_name: z.string().optional(), - name: z.string().optional(), - created_at: z - .string() - .transform(s => Temporal.Instant.from(s)) + filterCondition: z.string().optional(), + lineageContext: z.lazy(() => marshalCreateLineageContextSchema).optional(), + entities: z.array(z.lazy(() => marshalCreateEntityColumnSchema)).optional(), + timeseriesColumn: z + .lazy(() => marshalCreateTimeseriesColumnSchema) .optional(), - created_by: z.string().optional(), }) .transform(d => ({ - fullName: d.full_name, + full_name: d.fullName, source: d.source, inputs: d.inputs, function: d.function, - timeWindow: d.time_window, + time_window: d.timeWindow, description: d.description, - filterCondition: d.filter_condition, - lineageContext: d.lineage_context, + filter_condition: d.filterCondition, + lineage_context: d.lineageContext, entities: d.entities, - timeseriesColumn: d.timeseries_column, - catalogName: d.catalog_name, - schemaName: d.schema_name, - name: d.name, - createdAt: d.created_at, - createdBy: d.created_by, + timeseries_column: d.timeseriesColumn, })); -export const unmarshalFieldDefinitionSchema: z.ZodType = z +export const marshalCreateFieldDefinitionSchema: z.ZodType = z .object({ - name: z.string().optional(), - data_type: z.string().optional(), + name: z.string(), + dataType: z.string(), }) .transform(d => ({ name: d.name, - dataType: d.data_type, + data_type: d.dataType, })); -export const unmarshalFirstDistinctNFunctionSchema: z.ZodType = - z - .object({ - input: z.string().optional(), - n: z - .union([z.number(), z.bigint()]) - .transform(v => BigInt(v)) - .optional(), - }) - .transform(d => ({ - input: d.input, - n: d.n, - })); +export const marshalCreateFirstDistinctNFunctionSchema: z.ZodType = z + .object({ + input: z.string(), + n: z.bigint(), + }) + .transform(d => ({ + input: d.input, + n: d.n, + })); -export const unmarshalFirstFunctionSchema: z.ZodType = z +export const marshalCreateFirstFunctionSchema: z.ZodType = z .object({ - input: z.string().optional(), + input: z.string(), }) .transform(d => ({ input: d.input, })); -export const unmarshalFirstNFunctionSchema: z.ZodType = z +export const marshalCreateFirstNFunctionSchema: z.ZodType = z .object({ - input: z.string().optional(), - n: z - .union([z.number(), z.bigint()]) - .transform(v => BigInt(v)) - .optional(), + input: z.string(), + n: z.bigint(), }) .transform(d => ({ input: d.input, n: d.n, })); -export const unmarshalFlatSchemaSchema: z.ZodType = z +export const marshalCreateFlatSchemaSchema: z.ZodType = z .object({ - fields: z.array(z.lazy(() => unmarshalFieldDefinitionSchema)).optional(), + fields: z.array(z.lazy(() => marshalCreateFieldDefinitionSchema)), }) .transform(d => ({ fields: d.fields, })); -export const unmarshalFunctionSchema: z.ZodType = z +export const marshalCreateFunctionSchema: z.ZodType = z .object({ - function_type: z.string().optional(), - extra_parameters: z - .array(z.lazy(() => unmarshalFunction_ExtraParameterSchema)) + functionType: z.string().optional(), + extraParameters: z + .array(z.lazy(() => marshalFunction_CreateExtraParameterSchema)) .optional(), - aggregation_function: z - .lazy(() => unmarshalAggregationFunctionSchema) + function: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('aggregationFunction'), + aggregationFunction: z.lazy( + () => marshalCreateAggregationFunctionSchema + ), + }), + z.object({ + $case: z.literal('columnSelection'), + columnSelection: z.lazy(() => marshalCreateColumnSelectionSchema), + }), + ]) .optional(), - column_selection: z.lazy(() => unmarshalColumnSelectionSchema).optional(), }) .transform(d => ({ - functionType: d.function_type, - extraParameters: d.extra_parameters, - function: - d.aggregation_function !== undefined - ? { - $case: 'aggregationFunction' as const, - aggregationFunction: d.aggregation_function, - } - : d.column_selection !== undefined - ? { - $case: 'columnSelection' as const, - columnSelection: d.column_selection, - } - : undefined, + function_type: d.functionType, + extra_parameters: d.extraParameters, + ...(d.function?.$case === 'aggregationFunction' && { + aggregation_function: d.function.aggregationFunction, + }), + ...(d.function?.$case === 'columnSelection' && { + column_selection: d.function.columnSelection, + }), })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const unmarshalFunction_ExtraParameterSchema: z.ZodType = - z - .object({ - key: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - -export const unmarshalIngestionConfigSchema: z.ZodType = z +export const marshalCreateIngestionConfigSchema: z.ZodType = z .object({ - ingestion_destination: z - .lazy(() => unmarshalIngestionDestinationSchema) - .optional(), - backfill_source: z.lazy(() => unmarshalBackfillSourceSchema).optional(), - deduplication_columns: z.array(z.string()).optional(), - ingestion_pipeline_id: z.string().optional(), - ingestion_job_id: z - .union([z.number(), z.bigint()]) - .transform(v => BigInt(v)) - .optional(), - backfill_job_id: z - .union([z.number(), z.bigint()]) - .transform(v => BigInt(v)) - .optional(), + ingestionDestination: z.lazy(() => marshalCreateIngestionDestinationSchema), + backfillSource: z.lazy(() => marshalCreateBackfillSourceSchema).optional(), + deduplicationColumns: z.array(z.string()).optional(), }) .transform(d => ({ - ingestionDestination: d.ingestion_destination, - backfillSource: d.backfill_source, - deduplicationColumns: d.deduplication_columns, - ingestionPipelineId: d.ingestion_pipeline_id, - ingestionJobId: d.ingestion_job_id, - backfillJobId: d.backfill_job_id, + ingestion_destination: d.ingestionDestination, + backfill_source: d.backfillSource, + deduplication_columns: d.deduplicationColumns, })); -export const unmarshalIngestionDestinationSchema: z.ZodType = - z - .object({ - delta_table_name: z.string().optional(), - }) - .transform(d => ({ - ingestionDestination: - d.delta_table_name !== undefined - ? { - $case: 'deltaTableName' as const, - deltaTableName: d.delta_table_name, - } - : undefined, - })); - -export const unmarshalJobContextSchema: z.ZodType = z +export const marshalCreateIngestionDestinationSchema: z.ZodType = z .object({ - job_id: z - .union([z.number(), z.bigint()]) - .transform(v => BigInt(v)) - .optional(), - job_run_id: z - .union([z.number(), z.bigint()]) - .transform(v => BigInt(v)) + ingestionDestination: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('deltaTableName'), + deltaTableName: z.string(), + }), + ]) .optional(), }) .transform(d => ({ - jobId: d.job_id, - jobRunId: d.job_run_id, + ...(d.ingestionDestination?.$case === 'deltaTableName' && { + delta_table_name: d.ingestionDestination.deltaTableName, + }), + })); + +export const marshalCreateJobContextSchema: z.ZodType = z + .object({ + jobId: z.bigint().optional(), + jobRunId: z.bigint().optional(), + }) + .transform(d => ({ + job_id: d.jobId, + job_run_id: d.jobRunId, })); -export const unmarshalKafkaConfigSchema: z.ZodType = z +export const marshalCreateKafkaConfigSchema: z.ZodType = z .object({ name: z.string().optional(), - bootstrap_servers: z.string().optional(), - subscription_mode: z.lazy(() => unmarshalSubscriptionModeSchema).optional(), - auth_config: z.lazy(() => unmarshalAuthConfigSchema).optional(), - key_schema: z.lazy(() => unmarshalSchemaConfigSchema).optional(), - value_schema: z.lazy(() => unmarshalSchemaConfigSchema).optional(), - extra_options: z.record(z.string(), z.string()).optional(), - backfill_source: z.lazy(() => unmarshalBackfillSourceSchema).optional(), - ingestion_config: z.lazy(() => unmarshalIngestionConfigSchema).optional(), + bootstrapServers: z.string(), + subscriptionMode: z.lazy(() => marshalCreateSubscriptionModeSchema), + authConfig: z.lazy(() => marshalCreateAuthConfigSchema), + keySchema: z.lazy(() => marshalCreateSchemaConfigSchema).optional(), + valueSchema: z.lazy(() => marshalCreateSchemaConfigSchema).optional(), + extraOptions: z.record(z.string(), z.string()).optional(), + backfillSource: z.lazy(() => marshalCreateBackfillSourceSchema).optional(), + ingestionConfig: z + .lazy(() => marshalCreateIngestionConfigSchema) + .optional(), }) .transform(d => ({ name: d.name, - bootstrapServers: d.bootstrap_servers, - subscriptionMode: d.subscription_mode, - authConfig: d.auth_config, - keySchema: d.key_schema, - valueSchema: d.value_schema, - extraOptions: d.extra_options, - backfillSource: d.backfill_source, - ingestionConfig: d.ingestion_config, + bootstrap_servers: d.bootstrapServers, + subscription_mode: d.subscriptionMode, + auth_config: d.authConfig, + key_schema: d.keySchema, + value_schema: d.valueSchema, + extra_options: d.extraOptions, + backfill_source: d.backfillSource, + ingestion_config: d.ingestionConfig, })); -export const unmarshalKafkaSourceSchema: z.ZodType = z +export const marshalCreateKafkaSourceSchema: z.ZodType = z .object({ - name: z.string().optional(), - entity_column_identifiers: z - .array(z.lazy(() => unmarshalColumnIdentifierSchema)) + name: z.string(), + entityColumnIdentifiers: z + .array(z.lazy(() => marshalCreateColumnIdentifierSchema)) .optional(), - timeseries_column_identifier: z - .lazy(() => unmarshalColumnIdentifierSchema) + timeseriesColumnIdentifier: z + .lazy(() => marshalCreateColumnIdentifierSchema) .optional(), - filter_condition: z.string().optional(), + filterCondition: z.string().optional(), }) .transform(d => ({ name: d.name, - entityColumnIdentifiers: d.entity_column_identifiers, - timeseriesColumnIdentifier: d.timeseries_column_identifier, - filterCondition: d.filter_condition, + entity_column_identifiers: d.entityColumnIdentifiers, + timeseries_column_identifier: d.timeseriesColumnIdentifier, + filter_condition: d.filterCondition, })); -export const unmarshalKafkaStreamConfigSchema: z.ZodType = z +export const marshalCreateKafkaStreamConfigSchema: z.ZodType = z .object({ - subscription_mode: z - .lazy(() => unmarshalKafkaSubscriptionModeSchema) - .optional(), - extra_options: z.record(z.string(), z.string()).optional(), + subscriptionMode: z.lazy(() => marshalCreateKafkaSubscriptionModeSchema), + extraOptions: z.record(z.string(), z.string()).optional(), }) .transform(d => ({ - subscriptionMode: d.subscription_mode, - extraOptions: d.extra_options, + subscription_mode: d.subscriptionMode, + extra_options: d.extraOptions, })); -export const unmarshalKafkaSubscriptionModeSchema: z.ZodType = - z - .object({ - assign: z.string().optional(), - subscribe: z.string().optional(), - subscribe_pattern: z.string().optional(), - }) - .transform(d => ({ - subscriptionMode: - d.assign !== undefined - ? {$case: 'assign' as const, assign: d.assign} - : d.subscribe !== undefined - ? {$case: 'subscribe' as const, subscribe: d.subscribe} - : d.subscribe_pattern !== undefined - ? { - $case: 'subscribePattern' as const, - subscribePattern: d.subscribe_pattern, - } - : undefined, - })); +export const marshalCreateKafkaSubscriptionModeSchema: z.ZodType = z + .object({ + subscriptionMode: z + .discriminatedUnion('$case', [ + z.object({$case: z.literal('assign'), assign: z.string()}), + z.object({$case: z.literal('subscribe'), subscribe: z.string()}), + z.object({ + $case: z.literal('subscribePattern'), + subscribePattern: z.string(), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.subscriptionMode?.$case === 'assign' && { + assign: d.subscriptionMode.assign, + }), + ...(d.subscriptionMode?.$case === 'subscribe' && { + subscribe: d.subscriptionMode.subscribe, + }), + ...(d.subscriptionMode?.$case === 'subscribePattern' && { + subscribe_pattern: d.subscriptionMode.subscribePattern, + }), + })); -export const unmarshalLastDistinctNFunctionSchema: z.ZodType = - z - .object({ - input: z.string().optional(), - n: z - .union([z.number(), z.bigint()]) - .transform(v => BigInt(v)) - .optional(), - }) - .transform(d => ({ - input: d.input, - n: d.n, - })); +export const marshalCreateLastDistinctNFunctionSchema: z.ZodType = z + .object({ + input: z.string(), + n: z.bigint(), + }) + .transform(d => ({ + input: d.input, + n: d.n, + })); -export const unmarshalLastFunctionSchema: z.ZodType = z +export const marshalCreateLastFunctionSchema: z.ZodType = z .object({ - input: z.string().optional(), + input: z.string(), }) .transform(d => ({ input: d.input, })); -export const unmarshalLastNFunctionSchema: z.ZodType = z +export const marshalCreateLastNFunctionSchema: z.ZodType = z .object({ - input: z.string().optional(), - n: z - .union([z.number(), z.bigint()]) - .transform(v => BigInt(v)) - .optional(), + input: z.string(), + n: z.bigint(), }) .transform(d => ({ input: d.input, n: d.n, })); -export const unmarshalLineageContextSchema: z.ZodType = z +export const marshalCreateLineageContextSchema: z.ZodType = z .object({ - notebook_id: z - .union([z.number(), z.bigint()]) - .transform(v => BigInt(v)) - .optional(), - job_context: z.lazy(() => unmarshalJobContextSchema).optional(), + notebookId: z.bigint().optional(), + jobContext: z.lazy(() => marshalCreateJobContextSchema).optional(), }) .transform(d => ({ - notebookId: d.notebook_id, - jobContext: d.job_context, + notebook_id: d.notebookId, + job_context: d.jobContext, })); -export const unmarshalListFeaturesResponseSchema: z.ZodType = - z - .object({ - features: z.array(z.lazy(() => unmarshalFeatureSchema)).optional(), - next_page_token: z.string().optional(), - }) - .transform(d => ({ - features: d.features, - nextPageToken: d.next_page_token, - })); - -export const unmarshalListKafkaConfigsResponseSchema: z.ZodType = - z - .object({ - kafka_configs: z - .array(z.lazy(() => unmarshalKafkaConfigSchema)) - .optional(), - next_page_token: z.string().optional(), - }) - .transform(d => ({ - kafkaConfigs: d.kafka_configs, - nextPageToken: d.next_page_token, - })); - -export const unmarshalListMaterializedFeaturesResponseSchema: z.ZodType = - z - .object({ - materialized_features: z - .array(z.lazy(() => unmarshalMaterializedFeatureSchema)) - .optional(), - next_page_token: z.string().optional(), - }) - .transform(d => ({ - materializedFeatures: d.materialized_features, - nextPageToken: d.next_page_token, - })); - -export const unmarshalListStreamsResponseSchema: z.ZodType = - z - .object({ - streams: z.array(z.lazy(() => unmarshalStreamSchema)).optional(), - next_page_token: z.string().optional(), - }) - .transform(d => ({ - streams: d.streams, - nextPageToken: d.next_page_token, - })); - -export const unmarshalMaterializedFeatureSchema: z.ZodType = - z - .object({ - materialized_feature_id: z.string().optional(), - feature_name: z.string().optional(), - offline_store_config: z - .lazy(() => unmarshalOfflineStoreConfigSchema) - .optional(), - online_store_config: z - .lazy(() => unmarshalOnlineStoreConfigSchema) - .optional(), - table_name: z.string().optional(), - pipeline_schedule_state: z.string().optional(), - last_materialization_time: z - .string() - .transform(s => Temporal.Instant.from(s)) - .optional(), - cron_schedule: z.string().optional(), - is_online: z.boolean().optional(), - cron_schedule_trigger: z - .lazy(() => unmarshalCronScheduleSchema) - .optional(), - table_trigger: z.lazy(() => unmarshalTableTriggerSchema).optional(), - streaming_mode: z.lazy(() => unmarshalStreamingModeSchema).optional(), - }) - .transform(d => ({ - materializedFeatureId: d.materialized_feature_id, - featureName: d.feature_name, - destination: - d.offline_store_config !== undefined - ? { - $case: 'offlineStoreConfig' as const, - offlineStoreConfig: d.offline_store_config, - } - : d.online_store_config !== undefined - ? { - $case: 'onlineStoreConfig' as const, - onlineStoreConfig: d.online_store_config, - } - : undefined, - tableName: d.table_name, - pipelineScheduleState: d.pipeline_schedule_state, - lastMaterializationTime: d.last_materialization_time, - cronSchedule: d.cron_schedule, - isOnline: d.is_online, - trigger: - d.cron_schedule_trigger !== undefined - ? { - $case: 'cronScheduleTrigger' as const, - cronScheduleTrigger: d.cron_schedule_trigger, - } - : d.table_trigger !== undefined - ? {$case: 'tableTrigger' as const, tableTrigger: d.table_trigger} - : d.streaming_mode !== undefined - ? { - $case: 'streamingMode' as const, - streamingMode: d.streaming_mode, - } - : undefined, - })); +export const marshalCreateMaterializedFeatureSchema: z.ZodType = z + .object({ + materializedFeatureId: z.string().optional(), + featureName: z.string(), + destination: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('offlineStoreConfig'), + offlineStoreConfig: z.lazy( + () => marshalCreateOfflineStoreConfigSchema + ), + }), + z.object({ + $case: z.literal('onlineStoreConfig'), + onlineStoreConfig: z.lazy(() => marshalCreateOnlineStoreConfigSchema), + }), + ]) + .optional(), + pipelineScheduleState: z.string().optional(), + cronSchedule: z.string().optional(), + trigger: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('cronScheduleTrigger'), + cronScheduleTrigger: z.lazy(() => marshalCreateCronScheduleSchema), + }), + z.object({ + $case: z.literal('tableTrigger'), + tableTrigger: z.lazy(() => marshalCreateTableTriggerSchema), + }), + z.object({ + $case: z.literal('streamingMode'), + streamingMode: z.lazy(() => marshalCreateStreamingModeSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + materialized_feature_id: d.materializedFeatureId, + feature_name: d.featureName, + ...(d.destination?.$case === 'offlineStoreConfig' && { + offline_store_config: d.destination.offlineStoreConfig, + }), + ...(d.destination?.$case === 'onlineStoreConfig' && { + online_store_config: d.destination.onlineStoreConfig, + }), + pipeline_schedule_state: d.pipelineScheduleState, + cron_schedule: d.cronSchedule, + ...(d.trigger?.$case === 'cronScheduleTrigger' && { + cron_schedule_trigger: d.trigger.cronScheduleTrigger, + }), + ...(d.trigger?.$case === 'tableTrigger' && { + table_trigger: d.trigger.tableTrigger, + }), + ...(d.trigger?.$case === 'streamingMode' && { + streaming_mode: d.trigger.streamingMode, + }), + })); -export const unmarshalMaxFunctionSchema: z.ZodType = z +export const marshalCreateMaxFunctionSchema: z.ZodType = z .object({ - input: z.string().optional(), + input: z.string(), }) .transform(d => ({ input: d.input, })); -export const unmarshalMinFunctionSchema: z.ZodType = z +export const marshalCreateMinFunctionSchema: z.ZodType = z .object({ - input: z.string().optional(), + input: z.string(), }) .transform(d => ({ input: d.input, })); -export const unmarshalMtlsConfigSchema: z.ZodType = z +export const marshalCreateMtlsConfigSchema: z.ZodType = z .object({ - keystore_location: z.string().optional(), - keystore_password_ref: z - .lazy(() => unmarshalSecretScopeReferenceSchema) - .optional(), - key_password_ref: z - .lazy(() => unmarshalSecretScopeReferenceSchema) - .optional(), - truststore_location: z.string().optional(), - truststore_password_ref: z - .lazy(() => unmarshalSecretScopeReferenceSchema) - .optional(), - disable_hostname_verification: z.boolean().optional(), + keystoreLocation: z.string(), + keystorePasswordRef: z.lazy(() => marshalCreateSecretScopeReferenceSchema), + keyPasswordRef: z.lazy(() => marshalCreateSecretScopeReferenceSchema), + truststoreLocation: z.string(), + truststorePasswordRef: z.lazy( + () => marshalCreateSecretScopeReferenceSchema + ), + disableHostnameVerification: z.boolean().optional(), }) .transform(d => ({ - keystoreLocation: d.keystore_location, - keystorePasswordRef: d.keystore_password_ref, - keyPasswordRef: d.key_password_ref, - truststoreLocation: d.truststore_location, - truststorePasswordRef: d.truststore_password_ref, - disableHostnameVerification: d.disable_hostname_verification, + keystore_location: d.keystoreLocation, + keystore_password_ref: d.keystorePasswordRef, + key_password_ref: d.keyPasswordRef, + truststore_location: d.truststoreLocation, + truststore_password_ref: d.truststorePasswordRef, + disable_hostname_verification: d.disableHostnameVerification, })); -export const unmarshalOfflineStoreConfigSchema: z.ZodType = - z - .object({ - catalog_name: z.string().optional(), - schema_name: z.string().optional(), - table_name_prefix: z.string().optional(), - }) - .transform(d => ({ - catalogName: d.catalog_name, - schemaName: d.schema_name, - tableNamePrefix: d.table_name_prefix, - })); - -export const unmarshalOnlineStoreConfigSchema: z.ZodType = z +export const marshalCreateOfflineStoreConfigSchema: z.ZodType = z .object({ - catalog_name: z.string().optional(), - schema_name: z.string().optional(), - table_name_prefix: z.string().optional(), - online_store_name: z.string().optional(), + catalogName: z.string(), + schemaName: z.string(), + tableNamePrefix: z.string(), }) .transform(d => ({ - catalogName: d.catalog_name, - schemaName: d.schema_name, - tableNamePrefix: d.table_name_prefix, - onlineStoreName: d.online_store_name, + catalog_name: d.catalogName, + schema_name: d.schemaName, + table_name_prefix: d.tableNamePrefix, })); -export const unmarshalRequestSourceSchema: z.ZodType = z +export const marshalCreateOnlineStoreConfigSchema: z.ZodType = z .object({ - flat_schema: z.lazy(() => unmarshalFlatSchemaSchema).optional(), + catalogName: z.string(), + schemaName: z.string(), + tableNamePrefix: z.string(), + onlineStoreName: z.string(), }) .transform(d => ({ - schema: - d.flat_schema !== undefined - ? {$case: 'flatSchema' as const, flatSchema: d.flat_schema} - : undefined, + catalog_name: d.catalogName, + schema_name: d.schemaName, + table_name_prefix: d.tableNamePrefix, + online_store_name: d.onlineStoreName, })); -export const unmarshalRollingWindowSchema: z.ZodType = z +export const marshalCreateRequestSourceSchema: z.ZodType = z .object({ - window_duration: z - .string() - .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) + schema: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('flatSchema'), + flatSchema: z.lazy(() => marshalCreateFlatSchemaSchema), + }), + ]) .optional(), + }) + .transform(d => ({ + ...(d.schema?.$case === 'flatSchema' && {flat_schema: d.schema.flatSchema}), + })); + +export const marshalCreateRollingWindowSchema: z.ZodType = z + .object({ + windowDuration: z + .any() + .transform((d: Temporal.Duration) => d.toString().slice(2).toLowerCase()), delay: z - .string() - .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) + .any() + .transform((d: Temporal.Duration) => d.toString().slice(2).toLowerCase()) .optional(), }) .transform(d => ({ - windowDuration: d.window_duration, + window_duration: d.windowDuration, delay: d.delay, })); -export const unmarshalSchemaConfigSchema: z.ZodType = z +export const marshalCreateSchemaConfigSchema: z.ZodType = z .object({ - json_schema: z.string().optional(), + schema: z + .discriminatedUnion('$case', [ + z.object({$case: z.literal('jsonSchema'), jsonSchema: z.string()}), + ]) + .optional(), }) .transform(d => ({ - schema: - d.json_schema !== undefined - ? {$case: 'jsonSchema' as const, jsonSchema: d.json_schema} - : undefined, + ...(d.schema?.$case === 'jsonSchema' && {json_schema: d.schema.jsonSchema}), })); -export const unmarshalSecretScopeReferenceSchema: z.ZodType = - z - .object({ - scope: z.string().optional(), - key: z.string().optional(), - }) - .transform(d => ({ - scope: d.scope, - key: d.key, - })); +export const marshalCreateSecretScopeReferenceSchema: z.ZodType = z + .object({ + scope: z.string(), + key: z.string(), + }) + .transform(d => ({ + scope: d.scope, + key: d.key, + })); -export const unmarshalSlidingWindowSchema: z.ZodType = z +export const marshalCreateSlidingWindowSchema: z.ZodType = z .object({ - window_duration: z - .string() - .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) - .optional(), - slide_duration: z - .string() - .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) - .optional(), + windowDuration: z + .any() + .transform((d: Temporal.Duration) => d.toString().slice(2).toLowerCase()), + slideDuration: z + .any() + .transform((d: Temporal.Duration) => d.toString().slice(2).toLowerCase()), }) .transform(d => ({ - windowDuration: d.window_duration, - slideDuration: d.slide_duration, + window_duration: d.windowDuration, + slide_duration: d.slideDuration, })); -export const unmarshalStddevPopFunctionSchema: z.ZodType = z +export const marshalCreateStddevPopFunctionSchema: z.ZodType = z .object({ - input: z.string().optional(), + input: z.string(), }) .transform(d => ({ input: d.input, })); -export const unmarshalStddevSampFunctionSchema: z.ZodType = - z - .object({ - input: z.string().optional(), - }) - .transform(d => ({ - input: d.input, - })); +export const marshalCreateStddevSampFunctionSchema: z.ZodType = z + .object({ + input: z.string(), + }) + .transform(d => ({ + input: d.input, + })); -export const unmarshalStreamSchema: z.ZodType = z +export const marshalCreateStreamSchema: z.ZodType = z .object({ name: z.string().optional(), description: z.string().optional(), - source_config: z.lazy(() => unmarshalStreamSourceConfigSchema).optional(), - connection_config: z - .lazy(() => unmarshalStreamConnectionConfigSchema) - .optional(), - schema_config: z.lazy(() => unmarshalStreamSchemaConfigSchema).optional(), - ingestion_config: z.lazy(() => unmarshalIngestionConfigSchema).optional(), - create_time: z - .string() - .transform(s => Temporal.Instant.from(s)) - .optional(), - created_by: z.string().optional(), - update_time: z - .string() - .transform(s => Temporal.Instant.from(s)) - .optional(), - updated_by: z.string().optional(), - browse_only: z.boolean().optional(), + sourceConfig: z.lazy(() => marshalCreateStreamSourceConfigSchema), + connectionConfig: z.lazy(() => marshalCreateStreamConnectionConfigSchema), + schemaConfig: z.lazy(() => marshalCreateStreamSchemaConfigSchema), + ingestionConfig: z.lazy(() => marshalCreateIngestionConfigSchema), }) .transform(d => ({ name: d.name, description: d.description, - sourceConfig: d.source_config, - connectionConfig: d.connection_config, - schemaConfig: d.schema_config, - ingestionConfig: d.ingestion_config, - createTime: d.create_time, - createdBy: d.created_by, - updateTime: d.update_time, - updatedBy: d.updated_by, - browseOnly: d.browse_only, + source_config: d.sourceConfig, + connection_config: d.connectionConfig, + schema_config: d.schemaConfig, + ingestion_config: d.ingestionConfig, })); -export const unmarshalStreamConnectionConfigSchema: z.ZodType = - z - .object({ - uc_connection_name: z.string().optional(), - direct_mtls_config: z - .lazy(() => unmarshalDirectMtlsConfigSchema) - .optional(), - }) - .transform(d => ({ - connectionConfig: - d.uc_connection_name !== undefined - ? { - $case: 'ucConnectionName' as const, - ucConnectionName: d.uc_connection_name, - } - : d.direct_mtls_config !== undefined - ? { - $case: 'directMtlsConfig' as const, - directMtlsConfig: d.direct_mtls_config, - } - : undefined, - })); +export const marshalCreateStreamConnectionConfigSchema: z.ZodType = z + .object({ + connectionConfig: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('ucConnectionName'), + ucConnectionName: z.string(), + }), + z.object({ + $case: z.literal('directMtlsConfig'), + directMtlsConfig: z.lazy(() => marshalCreateDirectMtlsConfigSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.connectionConfig?.$case === 'ucConnectionName' && { + uc_connection_name: d.connectionConfig.ucConnectionName, + }), + ...(d.connectionConfig?.$case === 'directMtlsConfig' && { + direct_mtls_config: d.connectionConfig.directMtlsConfig, + }), + })); -export const unmarshalStreamSchemaConfigSchema: z.ZodType = - z - .object({ - direct_schemas: z.lazy(() => unmarshalDirectSchemasSchema).optional(), - }) - .transform(d => ({ - schemaConfig: - d.direct_schemas !== undefined - ? {$case: 'directSchemas' as const, directSchemas: d.direct_schemas} - : undefined, - })); +export const marshalCreateStreamSchemaConfigSchema: z.ZodType = z + .object({ + schemaConfig: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('directSchemas'), + directSchemas: z.lazy(() => marshalCreateDirectSchemasSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.schemaConfig?.$case === 'directSchemas' && { + direct_schemas: d.schemaConfig.directSchemas, + }), + })); -export const unmarshalStreamSourceSchema: z.ZodType = z +export const marshalCreateStreamSourceSchema: z.ZodType = z .object({ - full_name: z.string().optional(), - filter_condition: z.string().optional(), + fullName: z.string(), + filterCondition: z.string().optional(), }) .transform(d => ({ - fullName: d.full_name, - filterCondition: d.filter_condition, + full_name: d.fullName, + filter_condition: d.filterCondition, })); -export const unmarshalStreamSourceConfigSchema: z.ZodType = - z - .object({ - kafka_stream_config: z - .lazy(() => unmarshalKafkaStreamConfigSchema) - .optional(), - }) - .transform(d => ({ - sourceConfig: - d.kafka_stream_config !== undefined - ? { - $case: 'kafkaStreamConfig' as const, - kafkaStreamConfig: d.kafka_stream_config, - } - : undefined, - })); +export const marshalCreateStreamSourceConfigSchema: z.ZodType = z + .object({ + sourceConfig: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('kafkaStreamConfig'), + kafkaStreamConfig: z.lazy(() => marshalCreateKafkaStreamConfigSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.sourceConfig?.$case === 'kafkaStreamConfig' && { + kafka_stream_config: d.sourceConfig.kafkaStreamConfig, + }), + })); -export const unmarshalStreamingModeSchema: z.ZodType = z +export const marshalCreateStreamingModeSchema: z.ZodType = z .object({ mode: z.string().optional(), }) @@ -2194,170 +4983,212 @@ export const unmarshalStreamingModeSchema: z.ZodType = z mode: d.mode, })); -export const unmarshalSubscriptionModeSchema: z.ZodType = z +export const marshalCreateSubscriptionModeSchema: z.ZodType = z .object({ - assign: z.string().optional(), - subscribe: z.string().optional(), - subscribe_pattern: z.string().optional(), + subscriptionMode: z + .discriminatedUnion('$case', [ + z.object({$case: z.literal('assign'), assign: z.string()}), + z.object({$case: z.literal('subscribe'), subscribe: z.string()}), + z.object({ + $case: z.literal('subscribePattern'), + subscribePattern: z.string(), + }), + ]) + .optional(), }) .transform(d => ({ - subscriptionMode: - d.assign !== undefined - ? {$case: 'assign' as const, assign: d.assign} - : d.subscribe !== undefined - ? {$case: 'subscribe' as const, subscribe: d.subscribe} - : d.subscribe_pattern !== undefined - ? { - $case: 'subscribePattern' as const, - subscribePattern: d.subscribe_pattern, - } - : undefined, + ...(d.subscriptionMode?.$case === 'assign' && { + assign: d.subscriptionMode.assign, + }), + ...(d.subscriptionMode?.$case === 'subscribe' && { + subscribe: d.subscriptionMode.subscribe, + }), + ...(d.subscriptionMode?.$case === 'subscribePattern' && { + subscribe_pattern: d.subscriptionMode.subscribePattern, + }), })); -export const unmarshalSumFunctionSchema: z.ZodType = z +export const marshalCreateSumFunctionSchema: z.ZodType = z .object({ - input: z.string().optional(), + input: z.string(), }) .transform(d => ({ input: d.input, })); -export const unmarshalTableTriggerSchema: z.ZodType = z.object( - {} -); +export const marshalCreateTableTriggerSchema: z.ZodType = z.object({}); -export const unmarshalTimeWindowSchema: z.ZodType = z +export const marshalCreateTimeWindowSchema: z.ZodType = z .object({ - continuous: z.lazy(() => unmarshalContinuousWindowSchema).optional(), - tumbling: z.lazy(() => unmarshalTumblingWindowSchema).optional(), - sliding: z.lazy(() => unmarshalSlidingWindowSchema).optional(), - rolling: z.lazy(() => unmarshalRollingWindowSchema).optional(), + windowType: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('continuous'), + continuous: z.lazy(() => marshalCreateContinuousWindowSchema), + }), + z.object({ + $case: z.literal('tumbling'), + tumbling: z.lazy(() => marshalCreateTumblingWindowSchema), + }), + z.object({ + $case: z.literal('sliding'), + sliding: z.lazy(() => marshalCreateSlidingWindowSchema), + }), + z.object({ + $case: z.literal('rolling'), + rolling: z.lazy(() => marshalCreateRollingWindowSchema), + }), + ]) + .optional(), }) .transform(d => ({ - windowType: - d.continuous !== undefined - ? {$case: 'continuous' as const, continuous: d.continuous} - : d.tumbling !== undefined - ? {$case: 'tumbling' as const, tumbling: d.tumbling} - : d.sliding !== undefined - ? {$case: 'sliding' as const, sliding: d.sliding} - : d.rolling !== undefined - ? {$case: 'rolling' as const, rolling: d.rolling} - : undefined, + ...(d.windowType?.$case === 'continuous' && { + continuous: d.windowType.continuous, + }), + ...(d.windowType?.$case === 'tumbling' && { + tumbling: d.windowType.tumbling, + }), + ...(d.windowType?.$case === 'sliding' && {sliding: d.windowType.sliding}), + ...(d.windowType?.$case === 'rolling' && {rolling: d.windowType.rolling}), })); -export const unmarshalTimeseriesColumnSchema: z.ZodType = z +export const marshalCreateTimeseriesColumnSchema: z.ZodType = z .object({ - name: z.string().optional(), + name: z.string(), }) .transform(d => ({ name: d.name, })); -export const unmarshalTumblingWindowSchema: z.ZodType = z +export const marshalCreateTumblingWindowSchema: z.ZodType = z .object({ - window_duration: z - .string() - .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) - .optional(), + windowDuration: z + .any() + .transform((d: Temporal.Duration) => d.toString().slice(2).toLowerCase()), }) .transform(d => ({ - windowDuration: d.window_duration, + window_duration: d.windowDuration, })); -export const unmarshalVarPopFunctionSchema: z.ZodType = z +export const marshalCreateVarPopFunctionSchema: z.ZodType = z .object({ - input: z.string().optional(), + input: z.string(), }) .transform(d => ({ input: d.input, })); -export const unmarshalVarSampFunctionSchema: z.ZodType = z +export const marshalCreateVarSampFunctionSchema: z.ZodType = z .object({ - input: z.string().optional(), + input: z.string(), }) .transform(d => ({ input: d.input, })); -export const marshalAggregationFunctionSchema: z.ZodType = z +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalFunction_CreateExtraParameterSchema: z.ZodType = z + .object({ + key: z.string(), + value: z.string(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalFunction_UpdateExtraParameterSchema: z.ZodType = z + .object({ + key: z.string().optional(), + value: z.string().optional(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); + +export const marshalUpdateAggregationFunctionSchema: z.ZodType = z .object({ operation: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('avg'), - avg: z.lazy(() => marshalAvgFunctionSchema), + avg: z.lazy(() => marshalUpdateAvgFunctionSchema), }), z.object({ $case: z.literal('countFunction'), - countFunction: z.lazy(() => marshalCountFunctionSchema), + countFunction: z.lazy(() => marshalUpdateCountFunctionSchema), }), z.object({ $case: z.literal('sum'), - sum: z.lazy(() => marshalSumFunctionSchema), + sum: z.lazy(() => marshalUpdateSumFunctionSchema), }), z.object({ $case: z.literal('min'), - min: z.lazy(() => marshalMinFunctionSchema), + min: z.lazy(() => marshalUpdateMinFunctionSchema), }), z.object({ $case: z.literal('max'), - max: z.lazy(() => marshalMaxFunctionSchema), + max: z.lazy(() => marshalUpdateMaxFunctionSchema), }), z.object({ $case: z.literal('first'), - first: z.lazy(() => marshalFirstFunctionSchema), + first: z.lazy(() => marshalUpdateFirstFunctionSchema), }), z.object({ $case: z.literal('last'), - last: z.lazy(() => marshalLastFunctionSchema), + last: z.lazy(() => marshalUpdateLastFunctionSchema), }), z.object({ $case: z.literal('approxCountDistinct'), approxCountDistinct: z.lazy( - () => marshalApproxCountDistinctFunctionSchema + () => marshalUpdateApproxCountDistinctFunctionSchema ), }), z.object({ $case: z.literal('approxPercentile'), - approxPercentile: z.lazy(() => marshalApproxPercentileFunctionSchema), + approxPercentile: z.lazy( + () => marshalUpdateApproxPercentileFunctionSchema + ), }), z.object({ $case: z.literal('stddevPop'), - stddevPop: z.lazy(() => marshalStddevPopFunctionSchema), + stddevPop: z.lazy(() => marshalUpdateStddevPopFunctionSchema), }), z.object({ $case: z.literal('stddevSamp'), - stddevSamp: z.lazy(() => marshalStddevSampFunctionSchema), + stddevSamp: z.lazy(() => marshalUpdateStddevSampFunctionSchema), }), z.object({ $case: z.literal('varPop'), - varPop: z.lazy(() => marshalVarPopFunctionSchema), + varPop: z.lazy(() => marshalUpdateVarPopFunctionSchema), }), z.object({ $case: z.literal('varSamp'), - varSamp: z.lazy(() => marshalVarSampFunctionSchema), + varSamp: z.lazy(() => marshalUpdateVarSampFunctionSchema), }), z.object({ $case: z.literal('firstN'), - firstN: z.lazy(() => marshalFirstNFunctionSchema), + firstN: z.lazy(() => marshalUpdateFirstNFunctionSchema), }), z.object({ $case: z.literal('lastN'), - lastN: z.lazy(() => marshalLastNFunctionSchema), + lastN: z.lazy(() => marshalUpdateLastNFunctionSchema), }), z.object({ $case: z.literal('firstDistinctN'), - firstDistinctN: z.lazy(() => marshalFirstDistinctNFunctionSchema), + firstDistinctN: z.lazy( + () => marshalUpdateFirstDistinctNFunctionSchema + ), }), z.object({ $case: z.literal('lastDistinctN'), - lastDistinctN: z.lazy(() => marshalLastDistinctNFunctionSchema), + lastDistinctN: z.lazy(() => marshalUpdateLastDistinctNFunctionSchema), }), ]) .optional(), - timeWindow: z.lazy(() => marshalTimeWindowSchema).optional(), + timeWindow: z.lazy(() => marshalUpdateTimeWindowSchema).optional(), }) .transform(d => ({ ...(d.operation?.$case === 'avg' && {avg: d.operation.avg}), @@ -2394,7 +5225,7 @@ export const marshalAggregationFunctionSchema: z.ZodType = z time_window: d.timeWindow, })); -export const marshalApproxCountDistinctFunctionSchema: z.ZodType = z +export const marshalUpdateApproxCountDistinctFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), relativeSd: z.number().optional(), @@ -2404,7 +5235,7 @@ export const marshalApproxCountDistinctFunctionSchema: z.ZodType = z relative_sd: d.relativeSd, })); -export const marshalApproxPercentileFunctionSchema: z.ZodType = z +export const marshalUpdateApproxPercentileFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), percentile: z.number().optional(), @@ -2416,7 +5247,7 @@ export const marshalApproxPercentileFunctionSchema: z.ZodType = z accuracy: d.accuracy, })); -export const marshalAuthConfigSchema: z.ZodType = z +export const marshalUpdateAuthConfigSchema: z.ZodType = z .object({ authConfig: z .discriminatedUnion('$case', [ @@ -2426,7 +5257,7 @@ export const marshalAuthConfigSchema: z.ZodType = z }), z.object({ $case: z.literal('mtlsConfig'), - mtlsConfig: z.lazy(() => marshalMtlsConfigSchema), + mtlsConfig: z.lazy(() => marshalUpdateMtlsConfigSchema), }), ]) .optional(), @@ -2440,7 +5271,7 @@ export const marshalAuthConfigSchema: z.ZodType = z }), })); -export const marshalAvgFunctionSchema: z.ZodType = z +export const marshalUpdateAvgFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), }) @@ -2448,13 +5279,13 @@ export const marshalAvgFunctionSchema: z.ZodType = z input: d.input, })); -export const marshalBackfillSourceSchema: z.ZodType = z +export const marshalUpdateBackfillSourceSchema: z.ZodType = z .object({ backfillSource: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('deltaTableSource'), - deltaTableSource: z.lazy(() => marshalDeltaTableSourceSchema), + deltaTableSource: z.lazy(() => marshalUpdateDeltaTableSourceSchema), }), z.object({ $case: z.literal('deltaTableName'), @@ -2472,17 +5303,7 @@ export const marshalBackfillSourceSchema: z.ZodType = z }), })); -export const marshalBatchCreateMaterializedFeaturesRequestSchema: z.ZodType = z - .object({ - requests: z - .array(z.lazy(() => marshalCreateMaterializedFeatureRequestSchema)) - .optional(), - }) - .transform(d => ({ - requests: d.requests, - })); - -export const marshalColumnIdentifierSchema: z.ZodType = z +export const marshalUpdateColumnIdentifierSchema: z.ZodType = z .object({ variantExprPath: z.string().optional(), }) @@ -2490,7 +5311,7 @@ export const marshalColumnIdentifierSchema: z.ZodType = z variant_expr_path: d.variantExprPath, })); -export const marshalColumnSelectionSchema: z.ZodType = z +export const marshalUpdateColumnSelectionSchema: z.ZodType = z .object({ column: z.string().optional(), }) @@ -2498,7 +5319,7 @@ export const marshalColumnSelectionSchema: z.ZodType = z column: d.column, })); -export const marshalContinuousWindowSchema: z.ZodType = z +export const marshalUpdateContinuousWindowSchema: z.ZodType = z .object({ windowDuration: z .any() @@ -2514,7 +5335,7 @@ export const marshalContinuousWindowSchema: z.ZodType = z offset: d.offset, })); -export const marshalCountFunctionSchema: z.ZodType = z +export const marshalUpdateCountFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), }) @@ -2522,17 +5343,7 @@ export const marshalCountFunctionSchema: z.ZodType = z input: d.input, })); -export const marshalCreateMaterializedFeatureRequestSchema: z.ZodType = z - .object({ - materializedFeature: z - .lazy(() => marshalMaterializedFeatureSchema) - .optional(), - }) - .transform(d => ({ - materialized_feature: d.materializedFeature, - })); - -export const marshalCronScheduleSchema: z.ZodType = z +export const marshalUpdateCronScheduleSchema: z.ZodType = z .object({ cronExpression: z.string().optional(), }) @@ -2540,25 +5351,25 @@ export const marshalCronScheduleSchema: z.ZodType = z cron_expression: d.cronExpression, })); -export const marshalDataSourceSchema: z.ZodType = z +export const marshalUpdateDataSourceSchema: z.ZodType = z .object({ dataSource: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('deltaTableSource'), - deltaTableSource: z.lazy(() => marshalDeltaTableSourceSchema), + deltaTableSource: z.lazy(() => marshalUpdateDeltaTableSourceSchema), }), z.object({ $case: z.literal('kafkaSource'), - kafkaSource: z.lazy(() => marshalKafkaSourceSchema), + kafkaSource: z.lazy(() => marshalUpdateKafkaSourceSchema), }), z.object({ $case: z.literal('requestSource'), - requestSource: z.lazy(() => marshalRequestSourceSchema), + requestSource: z.lazy(() => marshalUpdateRequestSourceSchema), }), z.object({ $case: z.literal('streamSource'), - streamSource: z.lazy(() => marshalStreamSourceSchema), + streamSource: z.lazy(() => marshalUpdateStreamSourceSchema), }), ]) .optional(), @@ -2578,7 +5389,7 @@ export const marshalDataSourceSchema: z.ZodType = z }), })); -export const marshalDeltaTableSourceSchema: z.ZodType = z +export const marshalUpdateDeltaTableSourceSchema: z.ZodType = z .object({ fullName: z.string().optional(), entityColumns: z.array(z.string()).optional(), @@ -2596,27 +5407,27 @@ export const marshalDeltaTableSourceSchema: z.ZodType = z dataframe_schema: d.dataframeSchema, })); -export const marshalDirectMtlsConfigSchema: z.ZodType = z +export const marshalUpdateDirectMtlsConfigSchema: z.ZodType = z .object({ bootstrapServers: z.string().optional(), - mtlsConfig: z.lazy(() => marshalMtlsConfigSchema).optional(), + mtlsConfig: z.lazy(() => marshalUpdateMtlsConfigSchema).optional(), }) .transform(d => ({ bootstrap_servers: d.bootstrapServers, mtls_config: d.mtlsConfig, })); -export const marshalDirectSchemasSchema: z.ZodType = z +export const marshalUpdateDirectSchemasSchema: z.ZodType = z .object({ - payloadSchema: z.lazy(() => marshalSchemaConfigSchema).optional(), - keySchema: z.lazy(() => marshalSchemaConfigSchema).optional(), + payloadSchema: z.lazy(() => marshalUpdateSchemaConfigSchema).optional(), + keySchema: z.lazy(() => marshalUpdateSchemaConfigSchema).optional(), }) .transform(d => ({ payload_schema: d.payloadSchema, key_schema: d.keySchema, })); -export const marshalEntityColumnSchema: z.ZodType = z +export const marshalUpdateEntityColumnSchema: z.ZodType = z .object({ name: z.string().optional(), }) @@ -2624,26 +5435,20 @@ export const marshalEntityColumnSchema: z.ZodType = z name: d.name, })); -export const marshalFeatureSchema: z.ZodType = z +export const marshalUpdateFeatureSchema: z.ZodType = z .object({ fullName: z.string().optional(), - source: z.lazy(() => marshalDataSourceSchema).optional(), + source: z.lazy(() => marshalUpdateDataSourceSchema).optional(), inputs: z.array(z.string()).optional(), - function: z.lazy(() => marshalFunctionSchema).optional(), - timeWindow: z.lazy(() => marshalTimeWindowSchema).optional(), + function: z.lazy(() => marshalUpdateFunctionSchema).optional(), + timeWindow: z.lazy(() => marshalUpdateTimeWindowSchema).optional(), description: z.string().optional(), filterCondition: z.string().optional(), - lineageContext: z.lazy(() => marshalLineageContextSchema).optional(), - entities: z.array(z.lazy(() => marshalEntityColumnSchema)).optional(), - timeseriesColumn: z.lazy(() => marshalTimeseriesColumnSchema).optional(), - catalogName: z.string().optional(), - schemaName: z.string().optional(), - name: z.string().optional(), - createdAt: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + lineageContext: z.lazy(() => marshalUpdateLineageContextSchema).optional(), + entities: z.array(z.lazy(() => marshalUpdateEntityColumnSchema)).optional(), + timeseriesColumn: z + .lazy(() => marshalUpdateTimeseriesColumnSchema) .optional(), - createdBy: z.string().optional(), }) .transform(d => ({ full_name: d.fullName, @@ -2656,14 +5461,9 @@ export const marshalFeatureSchema: z.ZodType = z lineage_context: d.lineageContext, entities: d.entities, timeseries_column: d.timeseriesColumn, - catalog_name: d.catalogName, - schema_name: d.schemaName, - name: d.name, - created_at: d.createdAt, - created_by: d.createdBy, })); -export const marshalFieldDefinitionSchema: z.ZodType = z +export const marshalUpdateFieldDefinitionSchema: z.ZodType = z .object({ name: z.string().optional(), dataType: z.string().optional(), @@ -2673,7 +5473,7 @@ export const marshalFieldDefinitionSchema: z.ZodType = z data_type: d.dataType, })); -export const marshalFirstDistinctNFunctionSchema: z.ZodType = z +export const marshalUpdateFirstDistinctNFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), n: z.bigint().optional(), @@ -2683,7 +5483,7 @@ export const marshalFirstDistinctNFunctionSchema: z.ZodType = z n: d.n, })); -export const marshalFirstFunctionSchema: z.ZodType = z +export const marshalUpdateFirstFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), }) @@ -2691,7 +5491,7 @@ export const marshalFirstFunctionSchema: z.ZodType = z input: d.input, })); -export const marshalFirstNFunctionSchema: z.ZodType = z +export const marshalUpdateFirstNFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), n: z.bigint().optional(), @@ -2701,29 +5501,33 @@ export const marshalFirstNFunctionSchema: z.ZodType = z n: d.n, })); -export const marshalFlatSchemaSchema: z.ZodType = z +export const marshalUpdateFlatSchemaSchema: z.ZodType = z .object({ - fields: z.array(z.lazy(() => marshalFieldDefinitionSchema)).optional(), + fields: z + .array(z.lazy(() => marshalUpdateFieldDefinitionSchema)) + .optional(), }) .transform(d => ({ fields: d.fields, })); -export const marshalFunctionSchema: z.ZodType = z +export const marshalUpdateFunctionSchema: z.ZodType = z .object({ functionType: z.string().optional(), extraParameters: z - .array(z.lazy(() => marshalFunction_ExtraParameterSchema)) + .array(z.lazy(() => marshalFunction_UpdateExtraParameterSchema)) .optional(), function: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('aggregationFunction'), - aggregationFunction: z.lazy(() => marshalAggregationFunctionSchema), + aggregationFunction: z.lazy( + () => marshalUpdateAggregationFunctionSchema + ), }), z.object({ $case: z.literal('columnSelection'), - columnSelection: z.lazy(() => marshalColumnSelectionSchema), + columnSelection: z.lazy(() => marshalUpdateColumnSelectionSchema), }), ]) .optional(), @@ -2739,38 +5543,21 @@ export const marshalFunctionSchema: z.ZodType = z }), })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalFunction_ExtraParameterSchema: z.ZodType = z - .object({ - key: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - -export const marshalIngestionConfigSchema: z.ZodType = z +export const marshalUpdateIngestionConfigSchema: z.ZodType = z .object({ ingestionDestination: z - .lazy(() => marshalIngestionDestinationSchema) + .lazy(() => marshalUpdateIngestionDestinationSchema) .optional(), - backfillSource: z.lazy(() => marshalBackfillSourceSchema).optional(), + backfillSource: z.lazy(() => marshalUpdateBackfillSourceSchema).optional(), deduplicationColumns: z.array(z.string()).optional(), - ingestionPipelineId: z.string().optional(), - ingestionJobId: z.bigint().optional(), - backfillJobId: z.bigint().optional(), }) .transform(d => ({ ingestion_destination: d.ingestionDestination, backfill_source: d.backfillSource, deduplication_columns: d.deduplicationColumns, - ingestion_pipeline_id: d.ingestionPipelineId, - ingestion_job_id: d.ingestionJobId, - backfill_job_id: d.backfillJobId, })); -export const marshalIngestionDestinationSchema: z.ZodType = z +export const marshalUpdateIngestionDestinationSchema: z.ZodType = z .object({ ingestionDestination: z .discriminatedUnion('$case', [ @@ -2787,7 +5574,7 @@ export const marshalIngestionDestinationSchema: z.ZodType = z }), })); -export const marshalJobContextSchema: z.ZodType = z +export const marshalUpdateJobContextSchema: z.ZodType = z .object({ jobId: z.bigint().optional(), jobRunId: z.bigint().optional(), @@ -2797,17 +5584,21 @@ export const marshalJobContextSchema: z.ZodType = z job_run_id: d.jobRunId, })); -export const marshalKafkaConfigSchema: z.ZodType = z +export const marshalUpdateKafkaConfigSchema: z.ZodType = z .object({ name: z.string().optional(), bootstrapServers: z.string().optional(), - subscriptionMode: z.lazy(() => marshalSubscriptionModeSchema).optional(), - authConfig: z.lazy(() => marshalAuthConfigSchema).optional(), - keySchema: z.lazy(() => marshalSchemaConfigSchema).optional(), - valueSchema: z.lazy(() => marshalSchemaConfigSchema).optional(), + subscriptionMode: z + .lazy(() => marshalUpdateSubscriptionModeSchema) + .optional(), + authConfig: z.lazy(() => marshalUpdateAuthConfigSchema).optional(), + keySchema: z.lazy(() => marshalUpdateSchemaConfigSchema).optional(), + valueSchema: z.lazy(() => marshalUpdateSchemaConfigSchema).optional(), extraOptions: z.record(z.string(), z.string()).optional(), - backfillSource: z.lazy(() => marshalBackfillSourceSchema).optional(), - ingestionConfig: z.lazy(() => marshalIngestionConfigSchema).optional(), + backfillSource: z.lazy(() => marshalUpdateBackfillSourceSchema).optional(), + ingestionConfig: z + .lazy(() => marshalUpdateIngestionConfigSchema) + .optional(), }) .transform(d => ({ name: d.name, @@ -2821,14 +5612,14 @@ export const marshalKafkaConfigSchema: z.ZodType = z ingestion_config: d.ingestionConfig, })); -export const marshalKafkaSourceSchema: z.ZodType = z +export const marshalUpdateKafkaSourceSchema: z.ZodType = z .object({ name: z.string().optional(), entityColumnIdentifiers: z - .array(z.lazy(() => marshalColumnIdentifierSchema)) + .array(z.lazy(() => marshalUpdateColumnIdentifierSchema)) .optional(), timeseriesColumnIdentifier: z - .lazy(() => marshalColumnIdentifierSchema) + .lazy(() => marshalUpdateColumnIdentifierSchema) .optional(), filterCondition: z.string().optional(), }) @@ -2839,10 +5630,10 @@ export const marshalKafkaSourceSchema: z.ZodType = z filter_condition: d.filterCondition, })); -export const marshalKafkaStreamConfigSchema: z.ZodType = z +export const marshalUpdateKafkaStreamConfigSchema: z.ZodType = z .object({ subscriptionMode: z - .lazy(() => marshalKafkaSubscriptionModeSchema) + .lazy(() => marshalUpdateKafkaSubscriptionModeSchema) .optional(), extraOptions: z.record(z.string(), z.string()).optional(), }) @@ -2851,7 +5642,7 @@ export const marshalKafkaStreamConfigSchema: z.ZodType = z extra_options: d.extraOptions, })); -export const marshalKafkaSubscriptionModeSchema: z.ZodType = z +export const marshalUpdateKafkaSubscriptionModeSchema: z.ZodType = z .object({ subscriptionMode: z .discriminatedUnion('$case', [ @@ -2876,7 +5667,7 @@ export const marshalKafkaSubscriptionModeSchema: z.ZodType = z }), })); -export const marshalLastDistinctNFunctionSchema: z.ZodType = z +export const marshalUpdateLastDistinctNFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), n: z.bigint().optional(), @@ -2886,7 +5677,7 @@ export const marshalLastDistinctNFunctionSchema: z.ZodType = z n: d.n, })); -export const marshalLastFunctionSchema: z.ZodType = z +export const marshalUpdateLastFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), }) @@ -2894,7 +5685,7 @@ export const marshalLastFunctionSchema: z.ZodType = z input: d.input, })); -export const marshalLastNFunctionSchema: z.ZodType = z +export const marshalUpdateLastNFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), n: z.bigint().optional(), @@ -2904,17 +5695,17 @@ export const marshalLastNFunctionSchema: z.ZodType = z n: d.n, })); -export const marshalLineageContextSchema: z.ZodType = z +export const marshalUpdateLineageContextSchema: z.ZodType = z .object({ notebookId: z.bigint().optional(), - jobContext: z.lazy(() => marshalJobContextSchema).optional(), + jobContext: z.lazy(() => marshalUpdateJobContextSchema).optional(), }) .transform(d => ({ notebook_id: d.notebookId, job_context: d.jobContext, })); -export const marshalMaterializedFeatureSchema: z.ZodType = z +export const marshalUpdateMaterializedFeatureSchema: z.ZodType = z .object({ materializedFeatureId: z.string().optional(), featureName: z.string().optional(), @@ -2922,35 +5713,31 @@ export const marshalMaterializedFeatureSchema: z.ZodType = z .discriminatedUnion('$case', [ z.object({ $case: z.literal('offlineStoreConfig'), - offlineStoreConfig: z.lazy(() => marshalOfflineStoreConfigSchema), + offlineStoreConfig: z.lazy( + () => marshalUpdateOfflineStoreConfigSchema + ), }), z.object({ $case: z.literal('onlineStoreConfig'), - onlineStoreConfig: z.lazy(() => marshalOnlineStoreConfigSchema), + onlineStoreConfig: z.lazy(() => marshalUpdateOnlineStoreConfigSchema), }), ]) .optional(), - tableName: z.string().optional(), pipelineScheduleState: z.string().optional(), - lastMaterializationTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), cronSchedule: z.string().optional(), - isOnline: z.boolean().optional(), trigger: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('cronScheduleTrigger'), - cronScheduleTrigger: z.lazy(() => marshalCronScheduleSchema), + cronScheduleTrigger: z.lazy(() => marshalUpdateCronScheduleSchema), }), z.object({ $case: z.literal('tableTrigger'), - tableTrigger: z.lazy(() => marshalTableTriggerSchema), + tableTrigger: z.lazy(() => marshalUpdateTableTriggerSchema), }), z.object({ $case: z.literal('streamingMode'), - streamingMode: z.lazy(() => marshalStreamingModeSchema), + streamingMode: z.lazy(() => marshalUpdateStreamingModeSchema), }), ]) .optional(), @@ -2964,11 +5751,8 @@ export const marshalMaterializedFeatureSchema: z.ZodType = z ...(d.destination?.$case === 'onlineStoreConfig' && { online_store_config: d.destination.onlineStoreConfig, }), - table_name: d.tableName, pipeline_schedule_state: d.pipelineScheduleState, - last_materialization_time: d.lastMaterializationTime, cron_schedule: d.cronSchedule, - is_online: d.isOnline, ...(d.trigger?.$case === 'cronScheduleTrigger' && { cron_schedule_trigger: d.trigger.cronScheduleTrigger, }), @@ -2980,7 +5764,7 @@ export const marshalMaterializedFeatureSchema: z.ZodType = z }), })); -export const marshalMaxFunctionSchema: z.ZodType = z +export const marshalUpdateMaxFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), }) @@ -2988,7 +5772,7 @@ export const marshalMaxFunctionSchema: z.ZodType = z input: d.input, })); -export const marshalMinFunctionSchema: z.ZodType = z +export const marshalUpdateMinFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), }) @@ -2996,16 +5780,18 @@ export const marshalMinFunctionSchema: z.ZodType = z input: d.input, })); -export const marshalMtlsConfigSchema: z.ZodType = z +export const marshalUpdateMtlsConfigSchema: z.ZodType = z .object({ keystoreLocation: z.string().optional(), keystorePasswordRef: z - .lazy(() => marshalSecretScopeReferenceSchema) + .lazy(() => marshalUpdateSecretScopeReferenceSchema) + .optional(), + keyPasswordRef: z + .lazy(() => marshalUpdateSecretScopeReferenceSchema) .optional(), - keyPasswordRef: z.lazy(() => marshalSecretScopeReferenceSchema).optional(), truststoreLocation: z.string().optional(), truststorePasswordRef: z - .lazy(() => marshalSecretScopeReferenceSchema) + .lazy(() => marshalUpdateSecretScopeReferenceSchema) .optional(), disableHostnameVerification: z.boolean().optional(), }) @@ -3018,7 +5804,7 @@ export const marshalMtlsConfigSchema: z.ZodType = z disable_hostname_verification: d.disableHostnameVerification, })); -export const marshalOfflineStoreConfigSchema: z.ZodType = z +export const marshalUpdateOfflineStoreConfigSchema: z.ZodType = z .object({ catalogName: z.string().optional(), schemaName: z.string().optional(), @@ -3030,7 +5816,7 @@ export const marshalOfflineStoreConfigSchema: z.ZodType = z table_name_prefix: d.tableNamePrefix, })); -export const marshalOnlineStoreConfigSchema: z.ZodType = z +export const marshalUpdateOnlineStoreConfigSchema: z.ZodType = z .object({ catalogName: z.string().optional(), schemaName: z.string().optional(), @@ -3044,13 +5830,13 @@ export const marshalOnlineStoreConfigSchema: z.ZodType = z online_store_name: d.onlineStoreName, })); -export const marshalRequestSourceSchema: z.ZodType = z +export const marshalUpdateRequestSourceSchema: z.ZodType = z .object({ schema: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('flatSchema'), - flatSchema: z.lazy(() => marshalFlatSchemaSchema), + flatSchema: z.lazy(() => marshalUpdateFlatSchemaSchema), }), ]) .optional(), @@ -3059,7 +5845,7 @@ export const marshalRequestSourceSchema: z.ZodType = z ...(d.schema?.$case === 'flatSchema' && {flat_schema: d.schema.flatSchema}), })); -export const marshalRollingWindowSchema: z.ZodType = z +export const marshalUpdateRollingWindowSchema: z.ZodType = z .object({ windowDuration: z .any() @@ -3075,7 +5861,7 @@ export const marshalRollingWindowSchema: z.ZodType = z delay: d.delay, })); -export const marshalSchemaConfigSchema: z.ZodType = z +export const marshalUpdateSchemaConfigSchema: z.ZodType = z .object({ schema: z .discriminatedUnion('$case', [ @@ -3087,7 +5873,7 @@ export const marshalSchemaConfigSchema: z.ZodType = z ...(d.schema?.$case === 'jsonSchema' && {json_schema: d.schema.jsonSchema}), })); -export const marshalSecretScopeReferenceSchema: z.ZodType = z +export const marshalUpdateSecretScopeReferenceSchema: z.ZodType = z .object({ scope: z.string().optional(), key: z.string().optional(), @@ -3097,7 +5883,7 @@ export const marshalSecretScopeReferenceSchema: z.ZodType = z key: d.key, })); -export const marshalSlidingWindowSchema: z.ZodType = z +export const marshalUpdateSlidingWindowSchema: z.ZodType = z .object({ windowDuration: z .any() @@ -3113,7 +5899,7 @@ export const marshalSlidingWindowSchema: z.ZodType = z slide_duration: d.slideDuration, })); -export const marshalStddevPopFunctionSchema: z.ZodType = z +export const marshalUpdateStddevPopFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), }) @@ -3121,7 +5907,7 @@ export const marshalStddevPopFunctionSchema: z.ZodType = z input: d.input, })); -export const marshalStddevSampFunctionSchema: z.ZodType = z +export const marshalUpdateStddevSampFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), }) @@ -3129,27 +5915,22 @@ export const marshalStddevSampFunctionSchema: z.ZodType = z input: d.input, })); -export const marshalStreamSchema: z.ZodType = z +export const marshalUpdateStreamSchema: z.ZodType = z .object({ name: z.string().optional(), description: z.string().optional(), - sourceConfig: z.lazy(() => marshalStreamSourceConfigSchema).optional(), + sourceConfig: z + .lazy(() => marshalUpdateStreamSourceConfigSchema) + .optional(), connectionConfig: z - .lazy(() => marshalStreamConnectionConfigSchema) + .lazy(() => marshalUpdateStreamConnectionConfigSchema) .optional(), - schemaConfig: z.lazy(() => marshalStreamSchemaConfigSchema).optional(), - ingestionConfig: z.lazy(() => marshalIngestionConfigSchema).optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + schemaConfig: z + .lazy(() => marshalUpdateStreamSchemaConfigSchema) .optional(), - createdBy: z.string().optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + ingestionConfig: z + .lazy(() => marshalUpdateIngestionConfigSchema) .optional(), - updatedBy: z.string().optional(), - browseOnly: z.boolean().optional(), }) .transform(d => ({ name: d.name, @@ -3158,14 +5939,9 @@ export const marshalStreamSchema: z.ZodType = z connection_config: d.connectionConfig, schema_config: d.schemaConfig, ingestion_config: d.ingestionConfig, - create_time: d.createTime, - created_by: d.createdBy, - update_time: d.updateTime, - updated_by: d.updatedBy, - browse_only: d.browseOnly, })); -export const marshalStreamConnectionConfigSchema: z.ZodType = z +export const marshalUpdateStreamConnectionConfigSchema: z.ZodType = z .object({ connectionConfig: z .discriminatedUnion('$case', [ @@ -3175,7 +5951,7 @@ export const marshalStreamConnectionConfigSchema: z.ZodType = z }), z.object({ $case: z.literal('directMtlsConfig'), - directMtlsConfig: z.lazy(() => marshalDirectMtlsConfigSchema), + directMtlsConfig: z.lazy(() => marshalUpdateDirectMtlsConfigSchema), }), ]) .optional(), @@ -3189,13 +5965,13 @@ export const marshalStreamConnectionConfigSchema: z.ZodType = z }), })); -export const marshalStreamSchemaConfigSchema: z.ZodType = z +export const marshalUpdateStreamSchemaConfigSchema: z.ZodType = z .object({ schemaConfig: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('directSchemas'), - directSchemas: z.lazy(() => marshalDirectSchemasSchema), + directSchemas: z.lazy(() => marshalUpdateDirectSchemasSchema), }), ]) .optional(), @@ -3206,7 +5982,7 @@ export const marshalStreamSchemaConfigSchema: z.ZodType = z }), })); -export const marshalStreamSourceSchema: z.ZodType = z +export const marshalUpdateStreamSourceSchema: z.ZodType = z .object({ fullName: z.string().optional(), filterCondition: z.string().optional(), @@ -3216,13 +5992,13 @@ export const marshalStreamSourceSchema: z.ZodType = z filter_condition: d.filterCondition, })); -export const marshalStreamSourceConfigSchema: z.ZodType = z +export const marshalUpdateStreamSourceConfigSchema: z.ZodType = z .object({ sourceConfig: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('kafkaStreamConfig'), - kafkaStreamConfig: z.lazy(() => marshalKafkaStreamConfigSchema), + kafkaStreamConfig: z.lazy(() => marshalUpdateKafkaStreamConfigSchema), }), ]) .optional(), @@ -3233,7 +6009,7 @@ export const marshalStreamSourceConfigSchema: z.ZodType = z }), })); -export const marshalStreamingModeSchema: z.ZodType = z +export const marshalUpdateStreamingModeSchema: z.ZodType = z .object({ mode: z.string().optional(), }) @@ -3241,7 +6017,7 @@ export const marshalStreamingModeSchema: z.ZodType = z mode: d.mode, })); -export const marshalSubscriptionModeSchema: z.ZodType = z +export const marshalUpdateSubscriptionModeSchema: z.ZodType = z .object({ subscriptionMode: z .discriminatedUnion('$case', [ @@ -3266,7 +6042,7 @@ export const marshalSubscriptionModeSchema: z.ZodType = z }), })); -export const marshalSumFunctionSchema: z.ZodType = z +export const marshalUpdateSumFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), }) @@ -3274,27 +6050,27 @@ export const marshalSumFunctionSchema: z.ZodType = z input: d.input, })); -export const marshalTableTriggerSchema: z.ZodType = z.object({}); +export const marshalUpdateTableTriggerSchema: z.ZodType = z.object({}); -export const marshalTimeWindowSchema: z.ZodType = z +export const marshalUpdateTimeWindowSchema: z.ZodType = z .object({ windowType: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('continuous'), - continuous: z.lazy(() => marshalContinuousWindowSchema), + continuous: z.lazy(() => marshalUpdateContinuousWindowSchema), }), z.object({ $case: z.literal('tumbling'), - tumbling: z.lazy(() => marshalTumblingWindowSchema), + tumbling: z.lazy(() => marshalUpdateTumblingWindowSchema), }), z.object({ $case: z.literal('sliding'), - sliding: z.lazy(() => marshalSlidingWindowSchema), + sliding: z.lazy(() => marshalUpdateSlidingWindowSchema), }), z.object({ $case: z.literal('rolling'), - rolling: z.lazy(() => marshalRollingWindowSchema), + rolling: z.lazy(() => marshalUpdateRollingWindowSchema), }), ]) .optional(), @@ -3310,7 +6086,7 @@ export const marshalTimeWindowSchema: z.ZodType = z ...(d.windowType?.$case === 'rolling' && {rolling: d.windowType.rolling}), })); -export const marshalTimeseriesColumnSchema: z.ZodType = z +export const marshalUpdateTimeseriesColumnSchema: z.ZodType = z .object({ name: z.string().optional(), }) @@ -3318,7 +6094,7 @@ export const marshalTimeseriesColumnSchema: z.ZodType = z name: d.name, })); -export const marshalTumblingWindowSchema: z.ZodType = z +export const marshalUpdateTumblingWindowSchema: z.ZodType = z .object({ windowDuration: z .any() @@ -3329,7 +6105,7 @@ export const marshalTumblingWindowSchema: z.ZodType = z window_duration: d.windowDuration, })); -export const marshalVarPopFunctionSchema: z.ZodType = z +export const marshalUpdateVarPopFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), }) @@ -3337,7 +6113,7 @@ export const marshalVarPopFunctionSchema: z.ZodType = z input: d.input, })); -export const marshalVarSampFunctionSchema: z.ZodType = z +export const marshalUpdateVarSampFunctionSchema: z.ZodType = z .object({ input: z.string().optional(), }) @@ -3345,117 +6121,132 @@ export const marshalVarSampFunctionSchema: z.ZodType = z input: d.input, })); -const aggregationFunctionFieldMaskSchema: FieldMaskSchema = { +const updateAggregationFunctionFieldMaskSchema: FieldMaskSchema = { approxCountDistinct: { wire: 'approx_count_distinct', - children: () => approxCountDistinctFunctionFieldMaskSchema, + children: () => updateApproxCountDistinctFunctionFieldMaskSchema, }, approxPercentile: { wire: 'approx_percentile', - children: () => approxPercentileFunctionFieldMaskSchema, + children: () => updateApproxPercentileFunctionFieldMaskSchema, }, - avg: {wire: 'avg', children: () => avgFunctionFieldMaskSchema}, + avg: {wire: 'avg', children: () => updateAvgFunctionFieldMaskSchema}, countFunction: { wire: 'count_function', - children: () => countFunctionFieldMaskSchema, + children: () => updateCountFunctionFieldMaskSchema, }, - first: {wire: 'first', children: () => firstFunctionFieldMaskSchema}, + first: {wire: 'first', children: () => updateFirstFunctionFieldMaskSchema}, firstDistinctN: { wire: 'first_distinct_n', - children: () => firstDistinctNFunctionFieldMaskSchema, + children: () => updateFirstDistinctNFunctionFieldMaskSchema, }, - firstN: {wire: 'first_n', children: () => firstNFunctionFieldMaskSchema}, - last: {wire: 'last', children: () => lastFunctionFieldMaskSchema}, + firstN: { + wire: 'first_n', + children: () => updateFirstNFunctionFieldMaskSchema, + }, + last: {wire: 'last', children: () => updateLastFunctionFieldMaskSchema}, lastDistinctN: { wire: 'last_distinct_n', - children: () => lastDistinctNFunctionFieldMaskSchema, + children: () => updateLastDistinctNFunctionFieldMaskSchema, }, - lastN: {wire: 'last_n', children: () => lastNFunctionFieldMaskSchema}, - max: {wire: 'max', children: () => maxFunctionFieldMaskSchema}, - min: {wire: 'min', children: () => minFunctionFieldMaskSchema}, + lastN: {wire: 'last_n', children: () => updateLastNFunctionFieldMaskSchema}, + max: {wire: 'max', children: () => updateMaxFunctionFieldMaskSchema}, + min: {wire: 'min', children: () => updateMinFunctionFieldMaskSchema}, stddevPop: { wire: 'stddev_pop', - children: () => stddevPopFunctionFieldMaskSchema, + children: () => updateStddevPopFunctionFieldMaskSchema, }, stddevSamp: { wire: 'stddev_samp', - children: () => stddevSampFunctionFieldMaskSchema, + children: () => updateStddevSampFunctionFieldMaskSchema, + }, + sum: {wire: 'sum', children: () => updateSumFunctionFieldMaskSchema}, + timeWindow: { + wire: 'time_window', + children: () => updateTimeWindowFieldMaskSchema, + }, + varPop: { + wire: 'var_pop', + children: () => updateVarPopFunctionFieldMaskSchema, + }, + varSamp: { + wire: 'var_samp', + children: () => updateVarSampFunctionFieldMaskSchema, }, - sum: {wire: 'sum', children: () => sumFunctionFieldMaskSchema}, - timeWindow: {wire: 'time_window', children: () => timeWindowFieldMaskSchema}, - varPop: {wire: 'var_pop', children: () => varPopFunctionFieldMaskSchema}, - varSamp: {wire: 'var_samp', children: () => varSampFunctionFieldMaskSchema}, }; -const approxCountDistinctFunctionFieldMaskSchema: FieldMaskSchema = { +const updateApproxCountDistinctFunctionFieldMaskSchema: FieldMaskSchema = { input: {wire: 'input'}, relativeSd: {wire: 'relative_sd'}, }; -const approxPercentileFunctionFieldMaskSchema: FieldMaskSchema = { +const updateApproxPercentileFunctionFieldMaskSchema: FieldMaskSchema = { accuracy: {wire: 'accuracy'}, input: {wire: 'input'}, percentile: {wire: 'percentile'}, }; -const authConfigFieldMaskSchema: FieldMaskSchema = { - mtlsConfig: {wire: 'mtls_config', children: () => mtlsConfigFieldMaskSchema}, +const updateAuthConfigFieldMaskSchema: FieldMaskSchema = { + mtlsConfig: { + wire: 'mtls_config', + children: () => updateMtlsConfigFieldMaskSchema, + }, ucServiceCredentialName: {wire: 'uc_service_credential_name'}, }; -const avgFunctionFieldMaskSchema: FieldMaskSchema = { +const updateAvgFunctionFieldMaskSchema: FieldMaskSchema = { input: {wire: 'input'}, }; -const backfillSourceFieldMaskSchema: FieldMaskSchema = { +const updateBackfillSourceFieldMaskSchema: FieldMaskSchema = { deltaTableName: {wire: 'delta_table_name'}, deltaTableSource: { wire: 'delta_table_source', - children: () => deltaTableSourceFieldMaskSchema, + children: () => updateDeltaTableSourceFieldMaskSchema, }, }; -const columnIdentifierFieldMaskSchema: FieldMaskSchema = { +const updateColumnIdentifierFieldMaskSchema: FieldMaskSchema = { variantExprPath: {wire: 'variant_expr_path'}, }; -const columnSelectionFieldMaskSchema: FieldMaskSchema = { +const updateColumnSelectionFieldMaskSchema: FieldMaskSchema = { column: {wire: 'column'}, }; -const continuousWindowFieldMaskSchema: FieldMaskSchema = { +const updateContinuousWindowFieldMaskSchema: FieldMaskSchema = { offset: {wire: 'offset'}, windowDuration: {wire: 'window_duration'}, }; -const countFunctionFieldMaskSchema: FieldMaskSchema = { +const updateCountFunctionFieldMaskSchema: FieldMaskSchema = { input: {wire: 'input'}, }; -const cronScheduleFieldMaskSchema: FieldMaskSchema = { +const updateCronScheduleFieldMaskSchema: FieldMaskSchema = { cronExpression: {wire: 'cron_expression'}, }; -const dataSourceFieldMaskSchema: FieldMaskSchema = { +const updateDataSourceFieldMaskSchema: FieldMaskSchema = { deltaTableSource: { wire: 'delta_table_source', - children: () => deltaTableSourceFieldMaskSchema, + children: () => updateDeltaTableSourceFieldMaskSchema, }, kafkaSource: { wire: 'kafka_source', - children: () => kafkaSourceFieldMaskSchema, + children: () => updateKafkaSourceFieldMaskSchema, }, requestSource: { wire: 'request_source', - children: () => requestSourceFieldMaskSchema, + children: () => updateRequestSourceFieldMaskSchema, }, streamSource: { wire: 'stream_source', - children: () => streamSourceFieldMaskSchema, + children: () => updateStreamSourceFieldMaskSchema, }, }; -const deltaTableSourceFieldMaskSchema: FieldMaskSchema = { +const updateDeltaTableSourceFieldMaskSchema: FieldMaskSchema = { dataframeSchema: {wire: 'dataframe_schema'}, entityColumns: {wire: 'entity_columns'}, filterCondition: {wire: 'filter_condition'}, @@ -3464,379 +6255,400 @@ const deltaTableSourceFieldMaskSchema: FieldMaskSchema = { transformationSql: {wire: 'transformation_sql'}, }; -const directMtlsConfigFieldMaskSchema: FieldMaskSchema = { +const updateDirectMtlsConfigFieldMaskSchema: FieldMaskSchema = { bootstrapServers: {wire: 'bootstrap_servers'}, - mtlsConfig: {wire: 'mtls_config', children: () => mtlsConfigFieldMaskSchema}, + mtlsConfig: { + wire: 'mtls_config', + children: () => updateMtlsConfigFieldMaskSchema, + }, }; -const directSchemasFieldMaskSchema: FieldMaskSchema = { - keySchema: {wire: 'key_schema', children: () => schemaConfigFieldMaskSchema}, +const updateDirectSchemasFieldMaskSchema: FieldMaskSchema = { + keySchema: { + wire: 'key_schema', + children: () => updateSchemaConfigFieldMaskSchema, + }, payloadSchema: { wire: 'payload_schema', - children: () => schemaConfigFieldMaskSchema, + children: () => updateSchemaConfigFieldMaskSchema, }, }; -const featureFieldMaskSchema: FieldMaskSchema = { - catalogName: {wire: 'catalog_name'}, - createdAt: {wire: 'created_at'}, - createdBy: {wire: 'created_by'}, +const updateFeatureFieldMaskSchema: FieldMaskSchema = { description: {wire: 'description'}, entities: {wire: 'entities'}, filterCondition: {wire: 'filter_condition'}, fullName: {wire: 'full_name'}, - function: {wire: 'function', children: () => functionFieldMaskSchema}, + function: {wire: 'function', children: () => updateFunctionFieldMaskSchema}, inputs: {wire: 'inputs'}, lineageContext: { wire: 'lineage_context', - children: () => lineageContextFieldMaskSchema, + children: () => updateLineageContextFieldMaskSchema, + }, + source: {wire: 'source', children: () => updateDataSourceFieldMaskSchema}, + timeWindow: { + wire: 'time_window', + children: () => updateTimeWindowFieldMaskSchema, }, - name: {wire: 'name'}, - schemaName: {wire: 'schema_name'}, - source: {wire: 'source', children: () => dataSourceFieldMaskSchema}, - timeWindow: {wire: 'time_window', children: () => timeWindowFieldMaskSchema}, timeseriesColumn: { wire: 'timeseries_column', - children: () => timeseriesColumnFieldMaskSchema, + children: () => updateTimeseriesColumnFieldMaskSchema, }, }; -export function featureFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, featureFieldMaskSchema); +export function updateFeatureFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, updateFeatureFieldMaskSchema); } -const firstDistinctNFunctionFieldMaskSchema: FieldMaskSchema = { +const updateFirstDistinctNFunctionFieldMaskSchema: FieldMaskSchema = { input: {wire: 'input'}, n: {wire: 'n'}, }; -const firstFunctionFieldMaskSchema: FieldMaskSchema = { +const updateFirstFunctionFieldMaskSchema: FieldMaskSchema = { input: {wire: 'input'}, }; -const firstNFunctionFieldMaskSchema: FieldMaskSchema = { +const updateFirstNFunctionFieldMaskSchema: FieldMaskSchema = { input: {wire: 'input'}, n: {wire: 'n'}, }; -const flatSchemaFieldMaskSchema: FieldMaskSchema = { +const updateFlatSchemaFieldMaskSchema: FieldMaskSchema = { fields: {wire: 'fields'}, }; -const functionFieldMaskSchema: FieldMaskSchema = { +const updateFunctionFieldMaskSchema: FieldMaskSchema = { aggregationFunction: { wire: 'aggregation_function', - children: () => aggregationFunctionFieldMaskSchema, + children: () => updateAggregationFunctionFieldMaskSchema, }, columnSelection: { wire: 'column_selection', - children: () => columnSelectionFieldMaskSchema, + children: () => updateColumnSelectionFieldMaskSchema, }, extraParameters: {wire: 'extra_parameters'}, functionType: {wire: 'function_type'}, }; -const ingestionConfigFieldMaskSchema: FieldMaskSchema = { - backfillJobId: {wire: 'backfill_job_id'}, +const updateIngestionConfigFieldMaskSchema: FieldMaskSchema = { backfillSource: { wire: 'backfill_source', - children: () => backfillSourceFieldMaskSchema, + children: () => updateBackfillSourceFieldMaskSchema, }, deduplicationColumns: {wire: 'deduplication_columns'}, ingestionDestination: { wire: 'ingestion_destination', - children: () => ingestionDestinationFieldMaskSchema, + children: () => updateIngestionDestinationFieldMaskSchema, }, - ingestionJobId: {wire: 'ingestion_job_id'}, - ingestionPipelineId: {wire: 'ingestion_pipeline_id'}, }; -const ingestionDestinationFieldMaskSchema: FieldMaskSchema = { +const updateIngestionDestinationFieldMaskSchema: FieldMaskSchema = { deltaTableName: {wire: 'delta_table_name'}, }; -const jobContextFieldMaskSchema: FieldMaskSchema = { +const updateJobContextFieldMaskSchema: FieldMaskSchema = { jobId: {wire: 'job_id'}, jobRunId: {wire: 'job_run_id'}, }; -const kafkaConfigFieldMaskSchema: FieldMaskSchema = { - authConfig: {wire: 'auth_config', children: () => authConfigFieldMaskSchema}, +const updateKafkaConfigFieldMaskSchema: FieldMaskSchema = { + authConfig: { + wire: 'auth_config', + children: () => updateAuthConfigFieldMaskSchema, + }, backfillSource: { wire: 'backfill_source', - children: () => backfillSourceFieldMaskSchema, + children: () => updateBackfillSourceFieldMaskSchema, }, bootstrapServers: {wire: 'bootstrap_servers'}, extraOptions: {wire: 'extra_options'}, ingestionConfig: { wire: 'ingestion_config', - children: () => ingestionConfigFieldMaskSchema, + children: () => updateIngestionConfigFieldMaskSchema, + }, + keySchema: { + wire: 'key_schema', + children: () => updateSchemaConfigFieldMaskSchema, }, - keySchema: {wire: 'key_schema', children: () => schemaConfigFieldMaskSchema}, name: {wire: 'name'}, subscriptionMode: { wire: 'subscription_mode', - children: () => subscriptionModeFieldMaskSchema, + children: () => updateSubscriptionModeFieldMaskSchema, }, valueSchema: { wire: 'value_schema', - children: () => schemaConfigFieldMaskSchema, + children: () => updateSchemaConfigFieldMaskSchema, }, }; -export function kafkaConfigFieldMask( +export function updateKafkaConfigFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build(paths, kafkaConfigFieldMaskSchema); +): FieldMask { + return FieldMask.build( + paths, + updateKafkaConfigFieldMaskSchema + ); } -const kafkaSourceFieldMaskSchema: FieldMaskSchema = { +const updateKafkaSourceFieldMaskSchema: FieldMaskSchema = { entityColumnIdentifiers: {wire: 'entity_column_identifiers'}, filterCondition: {wire: 'filter_condition'}, name: {wire: 'name'}, timeseriesColumnIdentifier: { wire: 'timeseries_column_identifier', - children: () => columnIdentifierFieldMaskSchema, + children: () => updateColumnIdentifierFieldMaskSchema, }, }; -const kafkaStreamConfigFieldMaskSchema: FieldMaskSchema = { +const updateKafkaStreamConfigFieldMaskSchema: FieldMaskSchema = { extraOptions: {wire: 'extra_options'}, subscriptionMode: { wire: 'subscription_mode', - children: () => kafkaSubscriptionModeFieldMaskSchema, + children: () => updateKafkaSubscriptionModeFieldMaskSchema, }, }; -const kafkaSubscriptionModeFieldMaskSchema: FieldMaskSchema = { +const updateKafkaSubscriptionModeFieldMaskSchema: FieldMaskSchema = { assign: {wire: 'assign'}, subscribe: {wire: 'subscribe'}, subscribePattern: {wire: 'subscribe_pattern'}, }; -const lastDistinctNFunctionFieldMaskSchema: FieldMaskSchema = { +const updateLastDistinctNFunctionFieldMaskSchema: FieldMaskSchema = { input: {wire: 'input'}, n: {wire: 'n'}, }; -const lastFunctionFieldMaskSchema: FieldMaskSchema = { +const updateLastFunctionFieldMaskSchema: FieldMaskSchema = { input: {wire: 'input'}, }; -const lastNFunctionFieldMaskSchema: FieldMaskSchema = { +const updateLastNFunctionFieldMaskSchema: FieldMaskSchema = { input: {wire: 'input'}, n: {wire: 'n'}, }; -const lineageContextFieldMaskSchema: FieldMaskSchema = { - jobContext: {wire: 'job_context', children: () => jobContextFieldMaskSchema}, +const updateLineageContextFieldMaskSchema: FieldMaskSchema = { + jobContext: { + wire: 'job_context', + children: () => updateJobContextFieldMaskSchema, + }, notebookId: {wire: 'notebook_id'}, }; -const materializedFeatureFieldMaskSchema: FieldMaskSchema = { +const updateMaterializedFeatureFieldMaskSchema: FieldMaskSchema = { cronSchedule: {wire: 'cron_schedule'}, cronScheduleTrigger: { wire: 'cron_schedule_trigger', - children: () => cronScheduleFieldMaskSchema, + children: () => updateCronScheduleFieldMaskSchema, }, featureName: {wire: 'feature_name'}, - isOnline: {wire: 'is_online'}, - lastMaterializationTime: {wire: 'last_materialization_time'}, materializedFeatureId: {wire: 'materialized_feature_id'}, offlineStoreConfig: { wire: 'offline_store_config', - children: () => offlineStoreConfigFieldMaskSchema, + children: () => updateOfflineStoreConfigFieldMaskSchema, }, onlineStoreConfig: { wire: 'online_store_config', - children: () => onlineStoreConfigFieldMaskSchema, + children: () => updateOnlineStoreConfigFieldMaskSchema, }, pipelineScheduleState: {wire: 'pipeline_schedule_state'}, streamingMode: { wire: 'streaming_mode', - children: () => streamingModeFieldMaskSchema, + children: () => updateStreamingModeFieldMaskSchema, }, - tableName: {wire: 'table_name'}, tableTrigger: { wire: 'table_trigger', - children: () => tableTriggerFieldMaskSchema, + children: () => updateTableTriggerFieldMaskSchema, }, }; -export function materializedFeatureFieldMask( +export function updateMaterializedFeatureFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - materializedFeatureFieldMaskSchema + updateMaterializedFeatureFieldMaskSchema ); } -const maxFunctionFieldMaskSchema: FieldMaskSchema = { +const updateMaxFunctionFieldMaskSchema: FieldMaskSchema = { input: {wire: 'input'}, }; -const minFunctionFieldMaskSchema: FieldMaskSchema = { +const updateMinFunctionFieldMaskSchema: FieldMaskSchema = { input: {wire: 'input'}, }; -const mtlsConfigFieldMaskSchema: FieldMaskSchema = { +const updateMtlsConfigFieldMaskSchema: FieldMaskSchema = { disableHostnameVerification: {wire: 'disable_hostname_verification'}, keyPasswordRef: { wire: 'key_password_ref', - children: () => secretScopeReferenceFieldMaskSchema, + children: () => updateSecretScopeReferenceFieldMaskSchema, }, keystoreLocation: {wire: 'keystore_location'}, keystorePasswordRef: { wire: 'keystore_password_ref', - children: () => secretScopeReferenceFieldMaskSchema, + children: () => updateSecretScopeReferenceFieldMaskSchema, }, truststoreLocation: {wire: 'truststore_location'}, truststorePasswordRef: { wire: 'truststore_password_ref', - children: () => secretScopeReferenceFieldMaskSchema, + children: () => updateSecretScopeReferenceFieldMaskSchema, }, }; -const offlineStoreConfigFieldMaskSchema: FieldMaskSchema = { +const updateOfflineStoreConfigFieldMaskSchema: FieldMaskSchema = { catalogName: {wire: 'catalog_name'}, schemaName: {wire: 'schema_name'}, tableNamePrefix: {wire: 'table_name_prefix'}, }; -const onlineStoreConfigFieldMaskSchema: FieldMaskSchema = { +const updateOnlineStoreConfigFieldMaskSchema: FieldMaskSchema = { catalogName: {wire: 'catalog_name'}, onlineStoreName: {wire: 'online_store_name'}, schemaName: {wire: 'schema_name'}, tableNamePrefix: {wire: 'table_name_prefix'}, }; -const requestSourceFieldMaskSchema: FieldMaskSchema = { - flatSchema: {wire: 'flat_schema', children: () => flatSchemaFieldMaskSchema}, +const updateRequestSourceFieldMaskSchema: FieldMaskSchema = { + flatSchema: { + wire: 'flat_schema', + children: () => updateFlatSchemaFieldMaskSchema, + }, }; -const rollingWindowFieldMaskSchema: FieldMaskSchema = { +const updateRollingWindowFieldMaskSchema: FieldMaskSchema = { delay: {wire: 'delay'}, windowDuration: {wire: 'window_duration'}, }; -const schemaConfigFieldMaskSchema: FieldMaskSchema = { +const updateSchemaConfigFieldMaskSchema: FieldMaskSchema = { jsonSchema: {wire: 'json_schema'}, }; -const secretScopeReferenceFieldMaskSchema: FieldMaskSchema = { +const updateSecretScopeReferenceFieldMaskSchema: FieldMaskSchema = { key: {wire: 'key'}, scope: {wire: 'scope'}, }; -const slidingWindowFieldMaskSchema: FieldMaskSchema = { +const updateSlidingWindowFieldMaskSchema: FieldMaskSchema = { slideDuration: {wire: 'slide_duration'}, windowDuration: {wire: 'window_duration'}, }; -const stddevPopFunctionFieldMaskSchema: FieldMaskSchema = { +const updateStddevPopFunctionFieldMaskSchema: FieldMaskSchema = { input: {wire: 'input'}, }; -const stddevSampFunctionFieldMaskSchema: FieldMaskSchema = { +const updateStddevSampFunctionFieldMaskSchema: FieldMaskSchema = { input: {wire: 'input'}, }; -const streamFieldMaskSchema: FieldMaskSchema = { - browseOnly: {wire: 'browse_only'}, +const updateStreamFieldMaskSchema: FieldMaskSchema = { connectionConfig: { wire: 'connection_config', - children: () => streamConnectionConfigFieldMaskSchema, + children: () => updateStreamConnectionConfigFieldMaskSchema, }, - createTime: {wire: 'create_time'}, - createdBy: {wire: 'created_by'}, description: {wire: 'description'}, ingestionConfig: { wire: 'ingestion_config', - children: () => ingestionConfigFieldMaskSchema, + children: () => updateIngestionConfigFieldMaskSchema, }, name: {wire: 'name'}, schemaConfig: { wire: 'schema_config', - children: () => streamSchemaConfigFieldMaskSchema, + children: () => updateStreamSchemaConfigFieldMaskSchema, }, sourceConfig: { wire: 'source_config', - children: () => streamSourceConfigFieldMaskSchema, + children: () => updateStreamSourceConfigFieldMaskSchema, }, - updateTime: {wire: 'update_time'}, - updatedBy: {wire: 'updated_by'}, }; -export function streamFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, streamFieldMaskSchema); +export function updateStreamFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, updateStreamFieldMaskSchema); } -const streamConnectionConfigFieldMaskSchema: FieldMaskSchema = { +const updateStreamConnectionConfigFieldMaskSchema: FieldMaskSchema = { directMtlsConfig: { wire: 'direct_mtls_config', - children: () => directMtlsConfigFieldMaskSchema, + children: () => updateDirectMtlsConfigFieldMaskSchema, }, ucConnectionName: {wire: 'uc_connection_name'}, }; -const streamSchemaConfigFieldMaskSchema: FieldMaskSchema = { +const updateStreamSchemaConfigFieldMaskSchema: FieldMaskSchema = { directSchemas: { wire: 'direct_schemas', - children: () => directSchemasFieldMaskSchema, + children: () => updateDirectSchemasFieldMaskSchema, }, }; -const streamSourceFieldMaskSchema: FieldMaskSchema = { +const updateStreamSourceFieldMaskSchema: FieldMaskSchema = { filterCondition: {wire: 'filter_condition'}, fullName: {wire: 'full_name'}, }; -const streamSourceConfigFieldMaskSchema: FieldMaskSchema = { +const updateStreamSourceConfigFieldMaskSchema: FieldMaskSchema = { kafkaStreamConfig: { wire: 'kafka_stream_config', - children: () => kafkaStreamConfigFieldMaskSchema, + children: () => updateKafkaStreamConfigFieldMaskSchema, }, }; -const streamingModeFieldMaskSchema: FieldMaskSchema = { +const updateStreamingModeFieldMaskSchema: FieldMaskSchema = { mode: {wire: 'mode'}, }; -const subscriptionModeFieldMaskSchema: FieldMaskSchema = { +const updateSubscriptionModeFieldMaskSchema: FieldMaskSchema = { assign: {wire: 'assign'}, subscribe: {wire: 'subscribe'}, subscribePattern: {wire: 'subscribe_pattern'}, }; -const sumFunctionFieldMaskSchema: FieldMaskSchema = { +const updateSumFunctionFieldMaskSchema: FieldMaskSchema = { input: {wire: 'input'}, }; -const tableTriggerFieldMaskSchema: FieldMaskSchema = {}; +const updateTableTriggerFieldMaskSchema: FieldMaskSchema = {}; -const timeWindowFieldMaskSchema: FieldMaskSchema = { +const updateTimeWindowFieldMaskSchema: FieldMaskSchema = { continuous: { wire: 'continuous', - children: () => continuousWindowFieldMaskSchema, + children: () => updateContinuousWindowFieldMaskSchema, + }, + rolling: { + wire: 'rolling', + children: () => updateRollingWindowFieldMaskSchema, + }, + sliding: { + wire: 'sliding', + children: () => updateSlidingWindowFieldMaskSchema, + }, + tumbling: { + wire: 'tumbling', + children: () => updateTumblingWindowFieldMaskSchema, }, - rolling: {wire: 'rolling', children: () => rollingWindowFieldMaskSchema}, - sliding: {wire: 'sliding', children: () => slidingWindowFieldMaskSchema}, - tumbling: {wire: 'tumbling', children: () => tumblingWindowFieldMaskSchema}, }; -const timeseriesColumnFieldMaskSchema: FieldMaskSchema = { +const updateTimeseriesColumnFieldMaskSchema: FieldMaskSchema = { name: {wire: 'name'}, }; -const tumblingWindowFieldMaskSchema: FieldMaskSchema = { +const updateTumblingWindowFieldMaskSchema: FieldMaskSchema = { windowDuration: {wire: 'window_duration'}, }; -const varPopFunctionFieldMaskSchema: FieldMaskSchema = { +const updateVarPopFunctionFieldMaskSchema: FieldMaskSchema = { input: {wire: 'input'}, }; -const varSampFunctionFieldMaskSchema: FieldMaskSchema = { +const updateVarSampFunctionFieldMaskSchema: FieldMaskSchema = { input: {wire: 'input'}, }; diff --git a/packages/featurestore/src/v1/client.ts b/packages/featurestore/src/v1/client.ts index b8fc293a..93848d24 100644 --- a/packages/featurestore/src/v1/client.ts +++ b/packages/featurestore/src/v1/client.ts @@ -29,8 +29,9 @@ import type { UpdateOnlineStoreRequest, } from './model'; import { - marshalOnlineStoreSchema, + marshalCreateOnlineStoreSchema, marshalPublishTableRequestSchema, + marshalUpdateOnlineStoreSchema, unmarshalListOnlineStoresResponseSchema, unmarshalOnlineStoreSchema, unmarshalPublishTableResponseSchema, @@ -76,7 +77,10 @@ export class FeatureStoreClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/feature-store/online-stores`; - const body = marshalRequest(req.onlineStore, marshalOnlineStoreSchema); + const body = marshalRequest( + req.onlineStore, + marshalCreateOnlineStoreSchema + ); let resp: OnlineStore | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -272,7 +276,10 @@ export class FeatureStoreClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.onlineStore, marshalOnlineStoreSchema); + const body = marshalRequest( + req.onlineStore, + marshalUpdateOnlineStoreSchema + ); let resp: OnlineStore | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/featurestore/src/v1/index.ts b/packages/featurestore/src/v1/index.ts index 9172fea5..b1b3b14f 100755 --- a/packages/featurestore/src/v1/index.ts +++ b/packages/featurestore/src/v1/index.ts @@ -9,7 +9,9 @@ export {FeatureStoreClient} from './client'; export {OnlineStore_State, PublishSpec_PublishMode} from './model'; export type { + CreateOnlineStore, CreateOnlineStoreRequest, + CreatePublishSpec, DeleteOnlineStoreRequest, DeleteOnlineTableRequest, GetOnlineStoreRequest, @@ -19,7 +21,8 @@ export type { PublishSpec, PublishTableRequest, PublishTableResponse, + UpdateOnlineStore, UpdateOnlineStoreRequest, } from './model'; -export {onlineStoreFieldMask} from './model'; +export {updateOnlineStoreFieldMask} from './model'; diff --git a/packages/featurestore/src/v1/model.ts b/packages/featurestore/src/v1/model.ts index f2bf0fdf..dcf9a20c 100644 --- a/packages/featurestore/src/v1/model.ts +++ b/packages/featurestore/src/v1/model.ts @@ -52,9 +52,30 @@ export type PublishSpec_PublishMode = | (typeof PublishSpec_PublishMode)[keyof typeof PublishSpec_PublishMode] | (string & {}); +/** An OnlineStore is a logical database instance that stores and serves features online. */ +export interface CreateOnlineStore { + /** The name of the online store. This is the unique identifier for the online store. */ + name?: string | undefined; + /** The capacity of the online store. Valid values are "CU_1", "CU_2", "CU_4", "CU_8". */ + capacity: string; + /** The number of read replicas for the online store. Defaults to 0. */ + readReplicaCount?: number | undefined; + /** The usage policy applied to the online store to track billing. */ + usagePolicyId?: string | undefined; +} + export interface CreateOnlineStoreRequest { /** Online store to create. */ - onlineStore?: OnlineStore | undefined; + onlineStore?: CreateOnlineStore | undefined; +} + +export interface CreatePublishSpec { + /** The name of the target online store. */ + onlineStore: string; + /** The full three-part (catalog, schema, table) name of the online table. */ + onlineTableName: string; + /** The publish mode of the pipeline that syncs the online table with the source table. */ + publishMode: PublishSpec_PublishMode; } export interface DeleteOnlineStoreRequest { @@ -117,7 +138,7 @@ export interface PublishTableRequest { /** The full three-part (catalog, schema, table) name of the source table. */ sourceTableName?: string | undefined; /** The specification for publishing the online table from the source table. */ - publishSpec?: PublishSpec | undefined; + publishSpec?: CreatePublishSpec | undefined; } export interface PublishTableResponse { @@ -127,11 +148,23 @@ export interface PublishTableResponse { pipelineId?: string | undefined; } +/** An OnlineStore is a logical database instance that stores and serves features online. */ +export interface UpdateOnlineStore { + /** The name of the online store. This is the unique identifier for the online store. */ + name?: string | undefined; + /** The capacity of the online store. Valid values are "CU_1", "CU_2", "CU_4", "CU_8". */ + capacity?: string | undefined; + /** The number of read replicas for the online store. Defaults to 0. */ + readReplicaCount?: number | undefined; + /** The usage policy applied to the online store to track billing. */ + usagePolicyId?: string | undefined; +} + export interface UpdateOnlineStoreRequest { /** Online store to update. */ - onlineStore?: OnlineStore | undefined; + onlineStore?: UpdateOnlineStore | undefined; /** The list of fields to update. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalListOnlineStoresResponseSchema: z.ZodType = @@ -181,34 +214,25 @@ export const unmarshalPublishTableResponseSchema: z.ZodType d.toString()) - .optional(), - state: z.string().optional(), - capacity: z.string().optional(), + capacity: z.string(), readReplicaCount: z.number().optional(), usagePolicyId: z.string().optional(), }) .transform(d => ({ name: d.name, - creator: d.creator, - creation_time: d.creationTime, - state: d.state, capacity: d.capacity, read_replica_count: d.readReplicaCount, usage_policy_id: d.usagePolicyId, })); -export const marshalPublishSpecSchema: z.ZodType = z +export const marshalCreatePublishSpecSchema: z.ZodType = z .object({ - onlineStore: z.string().optional(), - onlineTableName: z.string().optional(), - publishMode: z.string().optional(), + onlineStore: z.string(), + onlineTableName: z.string(), + publishMode: z.string(), }) .transform(d => ({ online_store: d.onlineStore, @@ -219,25 +243,39 @@ export const marshalPublishSpecSchema: z.ZodType = z export const marshalPublishTableRequestSchema: z.ZodType = z .object({ sourceTableName: z.string().optional(), - publishSpec: z.lazy(() => marshalPublishSpecSchema).optional(), + publishSpec: z.lazy(() => marshalCreatePublishSpecSchema).optional(), }) .transform(d => ({ source_table_name: d.sourceTableName, publish_spec: d.publishSpec, })); -const onlineStoreFieldMaskSchema: FieldMaskSchema = { +export const marshalUpdateOnlineStoreSchema: z.ZodType = z + .object({ + name: z.string().optional(), + capacity: z.string().optional(), + readReplicaCount: z.number().optional(), + usagePolicyId: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + capacity: d.capacity, + read_replica_count: d.readReplicaCount, + usage_policy_id: d.usagePolicyId, + })); + +const updateOnlineStoreFieldMaskSchema: FieldMaskSchema = { capacity: {wire: 'capacity'}, - creationTime: {wire: 'creation_time'}, - creator: {wire: 'creator'}, name: {wire: 'name'}, readReplicaCount: {wire: 'read_replica_count'}, - state: {wire: 'state'}, usagePolicyId: {wire: 'usage_policy_id'}, }; -export function onlineStoreFieldMask( +export function updateOnlineStoreFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build(paths, onlineStoreFieldMaskSchema); +): FieldMask { + return FieldMask.build( + paths, + updateOnlineStoreFieldMaskSchema + ); } diff --git a/packages/instancepools/src/v2/index.ts b/packages/instancepools/src/v2/index.ts index 64adc0c9..0069a253 100755 --- a/packages/instancepools/src/v2/index.ts +++ b/packages/instancepools/src/v2/index.ts @@ -16,8 +16,16 @@ export { } from './model'; export type { + CreateDiskSpec, + CreateDiskType, + CreateDockerBasicAuth, + CreateDockerImage, + CreateInstancePoolAwsAttributes, + CreateInstancePoolAzureAttributes, + CreateInstancePoolGcpAttributes, CreateInstancePoolRequest, CreateInstancePoolResponse, + CreateNodeTypeFlexibility, DeleteInstancePoolRequest, DeleteInstancePoolResponse, DiskSpec, diff --git a/packages/instancepools/src/v2/model.ts b/packages/instancepools/src/v2/model.ts index f54e4f3c..307b30d7 100755 --- a/packages/instancepools/src/v2/model.ts +++ b/packages/instancepools/src/v2/model.ts @@ -111,6 +111,156 @@ export type InstancePoolState = | (typeof InstancePoolState)[keyof typeof InstancePoolState] | (string & {}); +/** + * Describes the disks that are launched for each instance in the spark cluster. + * For example, if the cluster has 3 instances, each instance is configured to launch + * 2 disks, 100 GiB each, then will launch a total of 6 disks, + * 100 GiB each, for this cluster. + */ +export interface CreateDiskSpec { + /** The type of disks that will be launched with this cluster. */ + diskType?: CreateDiskType | undefined; + /** + * The number of disks launched for each instance: + * - This feature is only enabled for supported node types. + * - Users can choose up to the limit of the disks supported by the node type. + * - For node types with no OS disk, at least one disk must be specified; + * otherwise, cluster creation will fail. + * + * If disks are attached, will configure Spark to use only the disks for + * scratch storage, because heterogenously sized scratch devices can lead to inefficient disk + * utilization. If no disks are attached, will configure Spark to use + * instance store disks. + * + * Note: If disks are specified, then the Spark configuration + * `spark.local.dir` will be overridden. + * + * Disks will be mounted at: + * - For AWS: `/ebs0`, `/ebs1`, and etc. + * - For Azure: `/remote_volume0`, `/remote_volume1`, and etc. + */ + diskCount?: number | undefined; + /** + * The size of each disk (in GiB) launched for each instance. + * Values must fall into the supported range for a particular instance type. + * + * For AWS: + * - General Purpose SSD: 100 - 4096 GiB + * - Throughput Optimized HDD: 500 - 4096 GiB + * + * For Azure: + * - Premium LRS (SSD): 1 - 1023 GiB + * - Standard LRS (HDD): 1- 1023 GiB + */ + diskSize?: number | undefined; + diskIops?: number | undefined; + diskThroughput?: number | undefined; +} + +/** Describes the disk type. */ +export interface CreateDiskType { + remoteVolumeType?: + | {$case: 'ebsVolumeType'; ebsVolumeType: EbsVolumeType} + | {$case: 'azureDiskVolumeType'; azureDiskVolumeType: AzureDiskVolumeType} + | undefined; +} + +export interface CreateDockerBasicAuth { + /** Name of the user */ + username?: string | undefined; + /** Password of the user */ + password?: string | undefined; +} + +export interface CreateDockerImage { + /** URL of the docker image. */ + url?: string | undefined; + credsOneof?: + | { + $case: 'basicAuth'; + /** Basic auth with username and password */ + basicAuth: CreateDockerBasicAuth; + } + | undefined; +} + +/** Attributes set during instance pool creation which are related to Amazon Web Services. */ +export interface CreateInstancePoolAwsAttributes { + /** Availability type used for the spot nodes. */ + availability?: AwsAvailability | undefined; + /** + * Identifier for the availability zone/datacenter in which the cluster resides. + * This string will be of a form like "us-west-2a". The provided availability + * zone must be in the same region as the deployment. For example, "us-west-2a" + * is not a valid zone id if the deployment resides in the "us-east-1" region. + * This is an optional field at cluster creation, and if not specified, a default zone will be used. + * The list of available zones as well as the default value can be found by using the + * `List Zones` method. + */ + zoneId?: string | undefined; + /** + * Calculates the bid price for AWS spot instances, as a percentage of the corresponding instance type's + * on-demand price. + * For example, if this field is set to 50, and the cluster needs a new `r3.xlarge` spot + * instance, then the bid price is half of the price of + * on-demand `r3.xlarge` instances. Similarly, if this field is set to 200, the bid price is twice + * the price of on-demand `r3.xlarge` instances. If not specified, the default value is 100. + * When spot instances are requested for this cluster, only spot instances whose bid price + * percentage matches this field will be considered. + * Note that, for safety, we enforce this field to be no more than 10000. + */ + spotBidPricePercent?: number | undefined; + /** + * All AWS instances belonging to the instance pool will have this instance profile. If omitted, instances + * will initially be launched with the workspace's default instance profile. If defined, clusters that use the + * pool will inherit the instance profile, and must not specify their own instance profile on cluster creation or + * update. If the pool does not specify an instance profile, clusters using the pool may specify any instance profile. + * The instance profile must have previously been added to the environment by an account administrator. + * + * This feature may only be available to certain customer plans. + */ + instanceProfileArn?: string | undefined; +} + +/** Attributes set during instance pool creation which are related to Azure. */ +export interface CreateInstancePoolAzureAttributes { + /** Availability type used for the spot nodes. */ + availability?: AzureAvailability | undefined; + /** + * With variable pricing, you have option to set a max price, in US dollars (USD) + * For example, the value 2 would be a max price of $2.00 USD per hour. + * If you set the max price to be -1, the VM won't be evicted based on price. + * The price for the VM will be the current price for spot or the price for a standard VM, + * which ever is less, as long as there is capacity and quota available. + */ + spotBidMaxPrice?: number | undefined; +} + +/** Attributes set during instance pool creation which are related to GCP. */ +export interface CreateInstancePoolGcpAttributes { + gcpAvailability?: GcpAvailability | undefined; + /** + * If provided, each node in the instance pool will have this number of local SSDs attached. + * Each local SSD is 375GB in size. Refer to [GCP documentation](https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds) + * for the supported number of local SSDs for each instance type. + */ + localSsdCount?: number | undefined; + /** + * Identifier for the availability zone/datacenter in which the cluster resides. + * This string will be of a form like "us-west1-a". The provided availability + * zone must be in the same region as the workspace. For example, "us-west1-a" + * is not a valid zone id if the workspace resides in the "us-east1" region. + * This is an optional field at instance pool creation, and if not specified, a default zone will be used. + * + * This field can be one of the following: + * - "HA" => High availability, spread nodes across availability zones for a deployment region + * - A GCP availability zone => Pick One of the available zones for (machine type + region) from https://cloud.google.com/compute/docs/regions-zones (e.g. "us-west1-a"). + * + * If empty, picks an availability zone to schedule the cluster on. + */ + zoneId?: string | undefined; +} + export interface CreateInstancePoolRequest { /** * Pool name requested by the user. Pool name must be unique. Length must be between 1 and 100 @@ -129,7 +279,7 @@ export interface CreateInstancePoolRequest { * Attributes related to instance pools running on Amazon Web Services. * If not specified at pool creation, a set of default values will be used. */ - awsAttributes?: InstancePoolAwsAttributes | undefined; + awsAttributes?: CreateInstancePoolAwsAttributes | undefined; /** * This field encodes, through a single value, the resources available to each of * the Spark nodes in this cluster. For example, the Spark nodes can be provisioned @@ -161,9 +311,9 @@ export interface CreateInstancePoolRequest { */ enableElasticDisk?: boolean | undefined; /** Defines the specification of the disks that will be attached to all spark containers. */ - diskSpec?: DiskSpec | undefined; + diskSpec?: CreateDiskSpec | undefined; /** Custom Docker Image BYOC */ - preloadedDockerImages?: DockerImage[] | undefined; + preloadedDockerImages?: CreateDockerImage[] | undefined; /** * A list containing at most one preloaded Spark image version for the pool. Pool-backed clusters started * with the preloaded Spark version will start faster. A list of available Spark versions @@ -174,14 +324,14 @@ export interface CreateInstancePoolRequest { * Attributes related to instance pools running on Azure. * If not specified at pool creation, a set of default values will be used. */ - azureAttributes?: InstancePoolAzureAttributes | undefined; + azureAttributes?: CreateInstancePoolAzureAttributes | undefined; /** * Attributes related to instance pools running on Google Cloud Platform. * If not specified at pool creation, a set of default values will be used. */ - gcpAttributes?: InstancePoolGcpAttributes | undefined; + gcpAttributes?: CreateInstancePoolGcpAttributes | undefined; /** Flexible node type configuration for the pool. */ - nodeTypeFlexibility?: NodeTypeFlexibility | undefined; + nodeTypeFlexibility?: CreateNodeTypeFlexibility | undefined; /** If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED types. */ remoteDiskThroughput?: number | undefined; /** If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED types. */ @@ -193,6 +343,12 @@ export interface CreateInstancePoolResponse { instancePoolId?: string | undefined; } +/** Configuration for flexible node types, allowing fallback to alternate node types during cluster launch and upscale. */ +export interface CreateNodeTypeFlexibility { + /** A list of node type IDs to use as fallbacks when the primary node type is unavailable. */ + alternateNodeTypeIds?: string[] | undefined; +} + export interface DeleteInstancePoolRequest { /** The instance pool to be terminated. */ instancePoolId?: string | undefined; @@ -294,7 +450,7 @@ export interface EditInstancePoolRequest { * Attributes related to instance pools running on Amazon Web Services. * If not specified at pool creation, a set of default values will be used. */ - awsAttributes?: InstancePoolAwsAttributes | undefined; + awsAttributes?: CreateInstancePoolAwsAttributes | undefined; /** * This field encodes, through a single value, the resources available to each of * the Spark nodes in this cluster. For example, the Spark nodes can be provisioned @@ -326,9 +482,9 @@ export interface EditInstancePoolRequest { */ enableElasticDisk?: boolean | undefined; /** Defines the specification of the disks that will be attached to all spark containers. */ - diskSpec?: DiskSpec | undefined; + diskSpec?: CreateDiskSpec | undefined; /** Custom Docker Image BYOC */ - preloadedDockerImages?: DockerImage[] | undefined; + preloadedDockerImages?: CreateDockerImage[] | undefined; /** * A list containing at most one preloaded Spark image version for the pool. Pool-backed clusters started * with the preloaded Spark version will start faster. A list of available Spark versions @@ -339,14 +495,14 @@ export interface EditInstancePoolRequest { * Attributes related to instance pools running on Azure. * If not specified at pool creation, a set of default values will be used. */ - azureAttributes?: InstancePoolAzureAttributes | undefined; + azureAttributes?: CreateInstancePoolAzureAttributes | undefined; /** * Attributes related to instance pools running on Google Cloud Platform. * If not specified at pool creation, a set of default values will be used. */ - gcpAttributes?: InstancePoolGcpAttributes | undefined; + gcpAttributes?: CreateInstancePoolGcpAttributes | undefined; /** Flexible node type configuration for the pool. */ - nodeTypeFlexibility?: NodeTypeFlexibility | undefined; + nodeTypeFlexibility?: CreateNodeTypeFlexibility | undefined; /** If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED types. */ remoteDiskThroughput?: number | undefined; /** If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED types. */ @@ -958,65 +1114,9 @@ export const unmarshalPendingInstanceErrorSchema: z.ZodType marshalInstancePoolAwsAttributesSchema) - .optional(), - nodeTypeId: z.string().optional(), - customTags: z.record(z.string(), z.string()).optional(), - idleInstanceAutoterminationMinutes: z.number().optional(), - enableElasticDisk: z.boolean().optional(), - diskSpec: z.lazy(() => marshalDiskSpecSchema).optional(), - preloadedDockerImages: z - .array(z.lazy(() => marshalDockerImageSchema)) - .optional(), - preloadedSparkVersions: z.array(z.string()).optional(), - azureAttributes: z - .lazy(() => marshalInstancePoolAzureAttributesSchema) - .optional(), - gcpAttributes: z - .lazy(() => marshalInstancePoolGcpAttributesSchema) - .optional(), - nodeTypeFlexibility: z - .lazy(() => marshalNodeTypeFlexibilitySchema) - .optional(), - remoteDiskThroughput: z.number().optional(), - totalInitialRemoteDiskSize: z.number().optional(), - }) - .transform(d => ({ - instance_pool_name: d.instancePoolName, - min_idle_instances: d.minIdleInstances, - max_capacity: d.maxCapacity, - aws_attributes: d.awsAttributes, - node_type_id: d.nodeTypeId, - custom_tags: d.customTags, - idle_instance_autotermination_minutes: d.idleInstanceAutoterminationMinutes, - enable_elastic_disk: d.enableElasticDisk, - disk_spec: d.diskSpec, - preloaded_docker_images: d.preloadedDockerImages, - preloaded_spark_versions: d.preloadedSparkVersions, - azure_attributes: d.azureAttributes, - gcp_attributes: d.gcpAttributes, - node_type_flexibility: d.nodeTypeFlexibility, - remote_disk_throughput: d.remoteDiskThroughput, - total_initial_remote_disk_size: d.totalInitialRemoteDiskSize, - })); - -export const marshalDeleteInstancePoolRequestSchema: z.ZodType = z - .object({ - instancePoolId: z.string().optional(), - }) - .transform(d => ({ - instance_pool_id: d.instancePoolId, - })); - -export const marshalDiskSpecSchema: z.ZodType = z - .object({ - diskType: z.lazy(() => marshalDiskTypeSchema).optional(), + diskType: z.lazy(() => marshalCreateDiskTypeSchema).optional(), diskCount: z.number().optional(), diskSize: z.number().optional(), diskIops: z.number().optional(), @@ -1030,7 +1130,7 @@ export const marshalDiskSpecSchema: z.ZodType = z disk_throughput: d.diskThroughput, })); -export const marshalDiskTypeSchema: z.ZodType = z +export const marshalCreateDiskTypeSchema: z.ZodType = z .object({ remoteVolumeType: z .discriminatedUnion('$case', [ @@ -1054,7 +1154,7 @@ export const marshalDiskTypeSchema: z.ZodType = z }), })); -export const marshalDockerBasicAuthSchema: z.ZodType = z +export const marshalCreateDockerBasicAuthSchema: z.ZodType = z .object({ username: z.string().optional(), password: z.string().optional(), @@ -1064,14 +1164,14 @@ export const marshalDockerBasicAuthSchema: z.ZodType = z password: d.password, })); -export const marshalDockerImageSchema: z.ZodType = z +export const marshalCreateDockerImageSchema: z.ZodType = z .object({ url: z.string().optional(), credsOneof: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('basicAuth'), - basicAuth: z.lazy(() => marshalDockerBasicAuthSchema), + basicAuth: z.lazy(() => marshalCreateDockerBasicAuthSchema), }), ]) .optional(), @@ -1083,38 +1183,72 @@ export const marshalDockerImageSchema: z.ZodType = z }), })); -export const marshalEditInstancePoolRequestSchema: z.ZodType = z +export const marshalCreateInstancePoolAwsAttributesSchema: z.ZodType = z + .object({ + availability: z.string().optional(), + zoneId: z.string().optional(), + spotBidPricePercent: z.number().optional(), + instanceProfileArn: z.string().optional(), + }) + .transform(d => ({ + availability: d.availability, + zone_id: d.zoneId, + spot_bid_price_percent: d.spotBidPricePercent, + instance_profile_arn: d.instanceProfileArn, + })); + +export const marshalCreateInstancePoolAzureAttributesSchema: z.ZodType = z + .object({ + availability: z.string().optional(), + spotBidMaxPrice: z.number().optional(), + }) + .transform(d => ({ + availability: d.availability, + spot_bid_max_price: d.spotBidMaxPrice, + })); + +export const marshalCreateInstancePoolGcpAttributesSchema: z.ZodType = z + .object({ + gcpAvailability: z.string().optional(), + localSsdCount: z.number().optional(), + zoneId: z.string().optional(), + }) + .transform(d => ({ + gcp_availability: d.gcpAvailability, + local_ssd_count: d.localSsdCount, + zone_id: d.zoneId, + })); + +export const marshalCreateInstancePoolRequestSchema: z.ZodType = z .object({ - instancePoolId: z.string().optional(), instancePoolName: z.string().optional(), minIdleInstances: z.number().optional(), maxCapacity: z.number().optional(), awsAttributes: z - .lazy(() => marshalInstancePoolAwsAttributesSchema) + .lazy(() => marshalCreateInstancePoolAwsAttributesSchema) .optional(), nodeTypeId: z.string().optional(), customTags: z.record(z.string(), z.string()).optional(), idleInstanceAutoterminationMinutes: z.number().optional(), enableElasticDisk: z.boolean().optional(), - diskSpec: z.lazy(() => marshalDiskSpecSchema).optional(), + diskSpec: z.lazy(() => marshalCreateDiskSpecSchema).optional(), preloadedDockerImages: z - .array(z.lazy(() => marshalDockerImageSchema)) + .array(z.lazy(() => marshalCreateDockerImageSchema)) .optional(), preloadedSparkVersions: z.array(z.string()).optional(), azureAttributes: z - .lazy(() => marshalInstancePoolAzureAttributesSchema) + .lazy(() => marshalCreateInstancePoolAzureAttributesSchema) .optional(), gcpAttributes: z - .lazy(() => marshalInstancePoolGcpAttributesSchema) + .lazy(() => marshalCreateInstancePoolGcpAttributesSchema) .optional(), nodeTypeFlexibility: z - .lazy(() => marshalNodeTypeFlexibilitySchema) + .lazy(() => marshalCreateNodeTypeFlexibilitySchema) .optional(), remoteDiskThroughput: z.number().optional(), totalInitialRemoteDiskSize: z.number().optional(), }) .transform(d => ({ - instance_pool_id: d.instancePoolId, instance_pool_name: d.instancePoolName, min_idle_instances: d.minIdleInstances, max_capacity: d.maxCapacity, @@ -1133,46 +1267,68 @@ export const marshalEditInstancePoolRequestSchema: z.ZodType = z total_initial_remote_disk_size: d.totalInitialRemoteDiskSize, })); -export const marshalInstancePoolAwsAttributesSchema: z.ZodType = z +export const marshalCreateNodeTypeFlexibilitySchema: z.ZodType = z .object({ - availability: z.string().optional(), - zoneId: z.string().optional(), - spotBidPricePercent: z.number().optional(), - instanceProfileArn: z.string().optional(), - }) - .transform(d => ({ - availability: d.availability, - zone_id: d.zoneId, - spot_bid_price_percent: d.spotBidPricePercent, - instance_profile_arn: d.instanceProfileArn, - })); - -export const marshalInstancePoolAzureAttributesSchema: z.ZodType = z - .object({ - availability: z.string().optional(), - spotBidMaxPrice: z.number().optional(), + alternateNodeTypeIds: z.array(z.string()).optional(), }) .transform(d => ({ - availability: d.availability, - spot_bid_max_price: d.spotBidMaxPrice, + alternate_node_type_ids: d.alternateNodeTypeIds, })); -export const marshalInstancePoolGcpAttributesSchema: z.ZodType = z +export const marshalDeleteInstancePoolRequestSchema: z.ZodType = z .object({ - gcpAvailability: z.string().optional(), - localSsdCount: z.number().optional(), - zoneId: z.string().optional(), + instancePoolId: z.string().optional(), }) .transform(d => ({ - gcp_availability: d.gcpAvailability, - local_ssd_count: d.localSsdCount, - zone_id: d.zoneId, + instance_pool_id: d.instancePoolId, })); -export const marshalNodeTypeFlexibilitySchema: z.ZodType = z +export const marshalEditInstancePoolRequestSchema: z.ZodType = z .object({ - alternateNodeTypeIds: z.array(z.string()).optional(), + instancePoolId: z.string().optional(), + instancePoolName: z.string().optional(), + minIdleInstances: z.number().optional(), + maxCapacity: z.number().optional(), + awsAttributes: z + .lazy(() => marshalCreateInstancePoolAwsAttributesSchema) + .optional(), + nodeTypeId: z.string().optional(), + customTags: z.record(z.string(), z.string()).optional(), + idleInstanceAutoterminationMinutes: z.number().optional(), + enableElasticDisk: z.boolean().optional(), + diskSpec: z.lazy(() => marshalCreateDiskSpecSchema).optional(), + preloadedDockerImages: z + .array(z.lazy(() => marshalCreateDockerImageSchema)) + .optional(), + preloadedSparkVersions: z.array(z.string()).optional(), + azureAttributes: z + .lazy(() => marshalCreateInstancePoolAzureAttributesSchema) + .optional(), + gcpAttributes: z + .lazy(() => marshalCreateInstancePoolGcpAttributesSchema) + .optional(), + nodeTypeFlexibility: z + .lazy(() => marshalCreateNodeTypeFlexibilitySchema) + .optional(), + remoteDiskThroughput: z.number().optional(), + totalInitialRemoteDiskSize: z.number().optional(), }) .transform(d => ({ - alternate_node_type_ids: d.alternateNodeTypeIds, + instance_pool_id: d.instancePoolId, + instance_pool_name: d.instancePoolName, + min_idle_instances: d.minIdleInstances, + max_capacity: d.maxCapacity, + aws_attributes: d.awsAttributes, + node_type_id: d.nodeTypeId, + custom_tags: d.customTags, + idle_instance_autotermination_minutes: d.idleInstanceAutoterminationMinutes, + enable_elastic_disk: d.enableElasticDisk, + disk_spec: d.diskSpec, + preloaded_docker_images: d.preloadedDockerImages, + preloaded_spark_versions: d.preloadedSparkVersions, + azure_attributes: d.azureAttributes, + gcp_attributes: d.gcpAttributes, + node_type_flexibility: d.nodeTypeFlexibility, + remote_disk_throughput: d.remoteDiskThroughput, + total_initial_remote_disk_size: d.totalInitialRemoteDiskSize, })); diff --git a/packages/jobs/src/v2/index.ts b/packages/jobs/src/v2/index.ts index 34b13cae..7cf7d2fd 100755 --- a/packages/jobs/src/v2/index.ts +++ b/packages/jobs/src/v2/index.ts @@ -86,14 +86,100 @@ export type { ClusterInstance, ClusterLogConf, ClusterSpec, + ClusterSpec_CreateNewCluster, ClusterSpec_NewCluster, Compute, ComputeConfig, ComputeSpec, ConditionTask, ContinuousSettings, + CreateAccessControlRequest, + CreateAdlsgen2Info, + CreateAiRuntimeTask, + CreateAlertTask, + CreateAlertTaskSubscriber, + CreateAutoScale, + CreateAwsAttributes, + CreateAzureAttributes, + CreateCleanRoomsNotebookTask, + CreateClusterLogConf, + CreateCompute, + CreateComputeConfig, + CreateComputeSpec, + CreateConditionTask, + CreateContinuousSettings, + CreateCronSchedule, + CreateDashboardTask, + CreateDbfsStorageInfo, + CreateDbtCloudTask, + CreateDbtPlatformTask, + CreateDbtTask, + CreateDeploymentSpec, + CreateDockerBasicAuth, + CreateDockerImage, + CreateEnvironment, + CreateFileArrivalTriggerConfiguration, + CreateForEachTask, + CreateGcpAttributes, + CreateGcsStorageInfo, + CreateGenAiComputeTask, + CreateGitMetadataSnapshot, + CreateGitSource, + CreateInitScriptInfo, + CreateJobCluster, + CreateJobDeployment, + CreateJobEmailNotifications, + CreateJobEnvironment, + CreateJobLevelParameter, CreateJobRequest, CreateJobResponse, + CreateJobRunAs, + CreateJobSettings, + CreateJobSource, + CreateJobsHealthRule, + CreateJobsHealthRules, + CreateLibrary, + CreateLocalFileInfo, + CreateLogAnalyticsInfo, + CreateMavenLibrary, + CreateModelTriggerConfiguration, + CreateNodeTypeFlexibility, + CreateNotebookTask, + CreateNotificationSettings, + CreatePeriodicTriggerConfiguration, + CreatePipelineParameters, + CreatePipelineTask, + CreatePowerBiModel, + CreatePowerBiTable, + CreatePowerBiTask, + CreatePythonOperatorTask, + CreatePythonPyPiLibrary, + CreatePythonWheelTask, + CreateQueueSettings, + CreateRCranLibrary, + CreateRunJobTask, + CreateRunTaskSettings, + CreateS3StorageInfo, + CreateSparkJarTask, + CreateSparkPythonTask, + CreateSparkSubmitTask, + CreateSparseCheckout, + CreateSqlTask, + CreateSqlTaskAlert, + CreateSqlTaskDashboard, + CreateSqlTaskFile, + CreateSqlTaskQuery, + CreateSqlTaskSubscription, + CreateSubscription, + CreateTableTriggerConfiguration, + CreateTaskDependency, + CreateTaskSettings, + CreateTriggerSettings, + CreateVolumesStorageInfo, + CreateWebhook, + CreateWebhookNotifications, + CreateWorkloadType, + CreateWorkspaceStorageInfo, CronSchedule, DashboardPageSnapshot, DashboardTask, @@ -172,6 +258,7 @@ export type { PowerBiTable, PowerBiTask, PythonOperatorTask, + PythonOperatorTask_CreateParameter, PythonOperatorTask_Parameter, PythonPyPiLibrary, PythonWheelTask, @@ -234,6 +321,7 @@ export type { SubmitRunRequest, SubmitRunResponse, Subscription, + Subscription_CreateSubscriber, Subscription_Subscriber, TableState, TableTriggerConfiguration, @@ -254,5 +342,6 @@ export type { WidgetErrorDetail, WorkloadType, WorkloadType_ClientsTypes, + WorkloadType_CreateClientsTypes, WorkspaceStorageInfo, } from './model'; diff --git a/packages/jobs/src/v2/model.ts b/packages/jobs/src/v2/model.ts index d9a045f9..7f78a2a3 100755 --- a/packages/jobs/src/v2/model.ts +++ b/packages/jobs/src/v2/model.ts @@ -966,6 +966,12 @@ export interface AiRuntimeTaskOutput { * MLflow APIs or the workspace MLflow UI. */ mlflowRunId?: string | undefined; + /** + * Human-readable status message for this run, suitable for display to the + * user (for example, that the run is still waiting for GPU compute). Set by + * the server only when there is something to surface; empty otherwise. + */ + statusMessage?: string | undefined; } // eslint-disable-next-line @typescript-eslint/no-empty-object-type @@ -1413,6 +1419,188 @@ export interface ClusterSpec { libraries?: Library[] | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface ClusterSpec_CreateNewCluster { + applyPolicyDefaultValues?: boolean | undefined; + /** + * Cluster name requested by the user. This doesn't have to be unique. + * If not specified at creation, the cluster name will be an empty string. + * For job clusters, the cluster name is automatically set based on the job and job run IDs. + */ + clusterName?: string | undefined; + /** + * The Spark version of the cluster, e.g. `3.3.x-scala2.11`. + * A list of available Spark versions can be retrieved by using + * the [clusters/sparkVersions](https://docs.databricks.com/api/workspace/clusters/sparkversions) API call. + */ + sparkVersion?: string | undefined; + /** + * An object containing a set of optional, user-specified Spark configuration key-value pairs. + * Users can also pass in a string of extra JVM options to the driver and the executors via + * `spark.driver.extraJavaOptions` and `spark.executor.extraJavaOptions` respectively. + */ + sparkConf?: Record | undefined; + /** + * Attributes related to clusters running on Amazon Web Services. + * If not specified at cluster creation, a set of default values will be used. + */ + awsAttributes?: CreateAwsAttributes | undefined; + /** + * Attributes related to clusters running on Microsoft Azure. + * If not specified at cluster creation, a set of default values will be used. + */ + azureAttributes?: CreateAzureAttributes | undefined; + /** + * Attributes related to clusters running on Google Cloud Platform. + * If not specified at cluster creation, a set of default values will be used. + */ + gcpAttributes?: CreateGcpAttributes | undefined; + /** + * This field encodes, through a single value, the resources available to each of + * the Spark nodes in this cluster. For example, the Spark nodes can be provisioned + * and optimized for memory or compute intensive workloads. A list of available node + * types can be retrieved by using the [clusters/listNodeTypes](https://docs.databricks.com/api/workspace/clusters/listnodetypes) API call. + */ + nodeTypeId?: string | undefined; + /** + * The node type of the Spark driver. + * Note that this field is optional; if unset, the driver node type will be set as the same value + * as `node_type_id` defined above. + * + * This field, along with node_type_id, should not be set if virtual_cluster_size is set. + * If both driver_node_type_id, node_type_id, and virtual_cluster_size are specified, driver_node_type_id and node_type_id take precedence. + */ + driverNodeTypeId?: string | undefined; + /** Flexible node type configuration for worker nodes. */ + workerNodeTypeFlexibility?: CreateNodeTypeFlexibility | undefined; + /** Flexible node type configuration for the driver node. */ + driverNodeTypeFlexibility?: CreateNodeTypeFlexibility | undefined; + /** + * SSH public key contents that will be added to each Spark node in this cluster. The + * corresponding private keys can be used to login with the user name `ubuntu` on port `2200`. + * Up to 10 keys can be specified. + */ + sshPublicKeys?: string[] | undefined; + /** + * Additional tags for cluster resources. will tag all cluster resources (e.g., AWS + * instances and EBS volumes) with these tags in addition to `default_tags`. Notes: + * + * - Currently, allows at most 45 custom tags + * + * - Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster tags + */ + customTags?: Record | undefined; + /** + * The configuration for delivering spark logs to a long-term storage destination. + * Three kinds of destinations (DBFS, S3 and Unity Catalog volumes) are supported. Only one destination can be specified + * for one cluster. If the conf is given, the logs will be delivered to the destination every + * `5 mins`. The destination of driver logs is `$destination/$clusterId/driver`, while + * the destination of executor logs is `$destination/$clusterId/executor`. + */ + clusterLogConf?: CreateClusterLogConf | undefined; + /** + * An object containing a set of optional, user-specified environment variable key-value pairs. + * Please note that key-value pair of the form (X,Y) will be exported as is (i.e., + * `export X='Y'`) while launching the driver and workers. + * + * In order to specify an additional set of `SPARK_DAEMON_JAVA_OPTS`, we recommend appending + * them to `$SPARK_DAEMON_JAVA_OPTS` as shown in the example below. This ensures that all + * default databricks managed environmental variables are included as well. + * + * Example Spark environment variables: + * `{"SPARK_WORKER_MEMORY": "28000m", "SPARK_LOCAL_DIRS": "/local_disk0"}` or + * `{"SPARK_DAEMON_JAVA_OPTS": "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` + */ + sparkEnvVars?: Record | undefined; + /** + * Automatically terminates the cluster after it is inactive for this time in minutes. If not set, + * this cluster will not be automatically terminated. If specified, the threshold must be between + * 10 and 10000 minutes. + * Users can also set this value to 0 to explicitly disable automatic termination. + */ + autoterminationMinutes?: number | undefined; + /** + * Autoscaling Local Storage: when enabled, this cluster will dynamically acquire additional disk + * space when its Spark workers are running low on disk space. + */ + enableElasticDisk?: boolean | undefined; + /** + * The configuration for storing init scripts. Any number of destinations can be specified. + * The scripts are executed sequentially in the order provided. + * If `cluster_log_conf` is specified, init script logs are sent to `//init_scripts`. + */ + initScripts?: CreateInitScriptInfo[] | undefined; + /** Custom docker image BYOC */ + dockerImage?: CreateDockerImage | undefined; + /** The optional ID of the instance pool to which the cluster belongs. */ + instancePoolId?: string | undefined; + /** Single user name if data_security_mode is `SINGLE_USER` */ + singleUserName?: string | undefined; + /** The ID of the cluster policy used to create the cluster if applicable. */ + policyId?: string | undefined; + /** Whether to enable LUKS on cluster VMs' local disks */ + enableLocalDiskEncryption?: boolean | undefined; + /** + * The optional ID of the instance pool for the driver of the cluster belongs. + * The pool cluster uses the instance pool with id (instance_pool_id) if the driver pool is not + * assigned. + */ + driverInstancePoolId?: string | undefined; + workloadType?: CreateWorkloadType | undefined; + dataSecurityMode?: DataSecurityMode | undefined; + /** + * Determines the cluster's runtime engine, either standard or Photon. + * + * This field is not compatible with legacy `spark_version` values that contain `-photon-`. + * Remove `-photon-` from the `spark_version` and set `runtime_engine` to `PHOTON`. + * + * If left unspecified, the runtime engine defaults to standard unless the spark_version + * contains -photon-, in which case Photon will be used. + */ + runtimeEngine?: RuntimeEngine | undefined; + kind?: ComputeKind | undefined; + /** + * This field can only be used when `kind = CLASSIC_PREVIEW`. + * + * `effective_spark_version` is determined by `spark_version` (DBR release), this field `use_ml_runtime`, and whether `node_type_id` is gpu node or not. + */ + useMlRuntime?: boolean | undefined; + /** + * This field can only be used when `kind = CLASSIC_PREVIEW`. + * + * When set to true, will automatically set single node related `custom_tags`, `spark_conf`, and `num_workers` + */ + isSingleNode?: boolean | undefined; + /** If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED disks. */ + remoteDiskThroughput?: number | undefined; + /** If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED disks. */ + totalInitialRemoteDiskSize?: number | undefined; + size?: + | { + $case: 'numWorkers'; + /** + * Number of worker nodes that this cluster should have. A cluster has one Spark Driver + * and `num_workers` Executors for a total of `num_workers` + 1 Spark nodes. + * + * Note: When reading the properties of a cluster, this field reflects the desired number + * of workers rather than the actual current number of workers. For instance, if a cluster + * is resized from 5 to 10 workers, this field will immediately be updated to reflect + * the target size of 10 workers, whereas the workers listed in `spark_info` will gradually + * increase from 5 to 10 as the new nodes are provisioned. + */ + numWorkers: number; + } + | { + $case: 'autoscale'; + /** + * Parameters needed in order to automatically scale clusters up and down based on load. + * Note: autoscaling works best with DB runtime versions 3.0 or later. + */ + autoscale: CreateAutoScale; + } + | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface ClusterSpec_NewCluster { applyPolicyDefaultValues?: boolean | undefined; @@ -1652,102 +1840,2045 @@ export interface ContinuousSettings { taskRetryMode?: TaskRetryMode | undefined; } -export interface CreateJobRequest { - /** List of permissions to set on the job. */ - accessControlList?: AccessControlRequest[] | undefined; - /** An optional name for the job. The maximum length is 4096 bytes in UTF-8 encoding. */ - name?: string | undefined; - /** An optional description for the job. The maximum length is 27700 characters in UTF-8 encoding. */ - description?: string | undefined; - /** An optional set of email addresses that is notified when runs of this job begin or complete as well as when this job is deleted. */ - emailNotifications?: JobEmailNotifications | undefined; - /** A collection of system notification IDs to notify when runs of this job begin or complete. */ - webhookNotifications?: WebhookNotifications | undefined; - /** Optional notification settings that are used when sending notifications to each of the `email_notifications` and `webhook_notifications` for this job. */ - notificationSettings?: NotificationSettings | undefined; - /** An optional timeout applied to each run of this job. A value of `0` means no timeout. */ - timeoutSeconds?: number | undefined; - health?: JobsHealthRules | undefined; - /** An optional periodic schedule for this job. The default behavior is that the job only runs when triggered by clicking “Run Now” in the Jobs UI or sending an API request to `runNow`. */ - schedule?: CronSchedule | undefined; - /** A configuration to trigger a run when certain conditions are met. The default behavior is that the job runs only when triggered by clicking “Run Now” in the Jobs UI or sending an API request to `runNow`. */ - trigger?: TriggerSettings | undefined; - /** An optional continuous property for this job. The continuous property will ensure that there is always one run executing. Only one of `schedule` and `continuous` can be used. */ - continuous?: ContinuousSettings | undefined; +export interface CreateAccessControlRequest { + principalName?: + | {$case: 'userName'; userName: string} + | {$case: 'groupName'; groupName: string} + | {$case: 'servicePrincipalName'; servicePrincipalName: string} + | undefined; + permissionLevel?: AccessControlRequest_JobPermission | undefined; +} + +/** A storage location in Adls Gen2 */ +export interface CreateAdlsgen2Info { + /** abfss destination, e.g. `abfss://@.dfs.core.windows.net/`. */ + destination: string; +} + +/** + * AiRuntimeTask: multi-node GPU compute task definition for Databricks AI + * Runtime workloads. + * + * Jobs-framework-level concepts (retries, per-task timeout, idempotency + * token, usage/budget policy, permissions) live on the surrounding + * TaskSettings / run-submit request and are intentionally NOT duplicated + * here. Users compose `ai_runtime_task` with the standard Jobs/DABs task + * wrapper to get those. + */ +export interface CreateAiRuntimeTask { /** - * An optional maximum allowed number of concurrent runs of the job. - * Set this value if you want to be able to execute multiple runs of the same job concurrently. - * This is useful for example if you trigger your job on a frequent schedule and want to allow consecutive runs to overlap with each other, or if you want to trigger multiple runs which differ by their input parameters. - * This setting affects only new runs. For example, suppose the job’s concurrency is 4 and there are 4 concurrent active runs. Then setting the concurrency to 3 won’t kill any of the active runs. - * However, from then on, new runs are skipped unless there are fewer than 3 active runs. - * This value cannot exceed 1000. Setting this value to `0` causes all new runs to be skipped. + * MLflow experiment name for this run. If an experiment with this name + * already exists under the calling user, the run is appended to it; + * otherwise a new experiment is created. To target a specific MLflow + * storage location (for example, when running as a service principal), set + * `mlflow_experiment_directory`. */ - maxConcurrentRuns?: number | undefined; + experiment: string; /** - * A list of task specifications to be executed by this job. - * It supports up to 1000 elements in write endpoints (:method:jobs/create, :method:jobs/reset, :method:jobs/update, :method:jobs/submit). - * Read endpoints return only 100 tasks. If more than 100 tasks are available, you can paginate through them using :method:jobs/get. Use the `next_page_token` field at the object root to determine if more results are available. + * Deployment specs for this task. Exactly one deployment is currently + * supported (a single entry where every node runs the same command); this + * is a current-Preview constraint. Role-split workloads (driver + worker, + * parameter server, separate eval node, etc.) with multiple entries are the + * eventual intent but not yet supported. */ - tasks?: TaskSettings[] | undefined; - /** A list of job cluster specifications that can be shared and reused by tasks of this job. Libraries cannot be declared in a shared job cluster. You must declare dependent libraries in task settings. */ - jobClusters?: JobCluster[] | undefined; + deployments: CreateDeploymentSpec[]; /** - * An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks. - * - * If `git_source` is set, these tasks retrieve the file from the remote repository by default. However, this behavior can be overridden by setting `source` to `WORKSPACE` on the task. + * Optional workspace or UC volume path of the uploaded code-source + * archive. The CLI packages the user's local code directory into an + * archive and populates this. Customers calling the Jobs API directly + * should upload their archive to the workspace or a UC volume first and + * supply the resulting path here. * - * Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, `git_source` must be defined on the job. + * When set, the training node exposes the value via the `$CODE_SOURCE` + * environment variable. */ - gitSource?: GitSource | undefined; - /** A map of tags associated with the job. These are forwarded to the cluster as cluster tags for jobs clusters, and are subject to the same limitations as cluster tags. A maximum of 25 tags can be added to the job. */ - tags?: Record | undefined; - /** Used to tell what is the format of the job. This field is ignored in Create/Update/Reset calls. When using the Jobs API 2.1 this value is always set to `"MULTI_TASK"`. */ - format?: Format | undefined; - /** The queue settings of the job. */ - queue?: QueueSettings | undefined; + codeSourcePath?: string | undefined; + /** + * Optional display name for the MLflow run created under `experiment`. If + * omitted, MLflow generates a default name. + */ + mlflowRun?: string | undefined; + /** + * Optional workspace directory under which the MLflow experiment named in + * `experiment` is created. Must start with `/Workspace`. Set this when + * running as a service principal that has no default user directory; for + * regular users the experiment defaults to the user's home directory. + */ + mlflowExperimentDirectory?: string | undefined; +} + +export interface CreateAlertTask { + /** The alert_id is the canonical identifier of the alert. */ + alertId?: string | undefined; + /** The warehouse_id identifies the warehouse settings used by the alert task. */ + warehouseId?: string | undefined; + /** + * The workspace_path is the path to the alert file in the workspace. The path: + * * must start with "/Workspace" + * * must be a normalized path. + * User has to select only one of alert_id or workspace_path to identify the alert. + */ + workspacePath?: string | undefined; + /** + * The subscribers receive alert evaluation result notifications after the alert task is completed. + * The number of subscriptions is limited to 100. + */ + subscribers?: CreateAlertTaskSubscriber[] | undefined; +} + +/** + * Represents a subscriber that will receive alert notifications. + * A subscriber can be either a user (via email) or a notification destination (via destination_id). + */ +export interface CreateAlertTaskSubscriber { + subscriberType?: + | { + $case: 'userName'; + /** A valid workspace email address. */ + userName: string; + } + | {$case: 'destinationId'; destinationId: string} + | undefined; +} + +export interface CreateAutoScale { + /** + * The minimum number of workers to which the cluster can scale down when underutilized. + * It is also the initial number of workers the cluster will have after creation. + */ + minWorkers?: number | undefined; + /** + * The maximum number of workers to which the cluster can scale up when overloaded. + * Note that `max_workers` must be strictly greater than `min_workers`. + */ + maxWorkers?: number | undefined; +} + +/** Attributes set during cluster creation which are related to Amazon Web Services. */ +export interface CreateAwsAttributes { + /** + * The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. + * If this value is greater than 0, the cluster driver node in particular will be placed on an + * on-demand instance. If this value is greater than or equal to the current cluster size, all + * nodes will be placed on on-demand instances. If this value is less than the current cluster + * size, `first_on_demand` nodes will be placed on on-demand instances and the remainder will + * be placed on `availability` instances. Note that this value does not affect + * cluster size and cannot currently be mutated over the lifetime of a cluster. + */ + firstOnDemand?: number | undefined; + availability?: AwsAvailability | undefined; + /** + * Identifier for the availability zone/datacenter in which the cluster resides. + * This string will be of a form like "us-west-2a". The provided availability + * zone must be in the same region as the deployment. For example, "us-west-2a" + * is not a valid zone id if the deployment resides in the "us-east-1" region. + * This is an optional field at cluster creation, and if not specified, the zone "auto" will be used. + * If the zone specified is "auto", will try to place cluster in a zone with high availability, + * and will retry placement in a different AZ if there is not enough capacity. + * + * The list of available zones as well as the default value can be found by using the + * `List Zones` method. + */ + zoneId?: string | undefined; + /** + * Nodes for this cluster will only be placed on AWS instances with this instance profile. If + * ommitted, nodes will be placed on instances without an IAM instance profile. The instance + * profile must have previously been added to the environment by an account + * administrator. + * + * This feature may only be available to certain customer plans. + */ + instanceProfileArn?: string | undefined; + /** + * The bid price for AWS spot instances, as a percentage of the corresponding instance type's + * on-demand price. + * For example, if this field is set to 50, and the cluster needs a new `r3.xlarge` spot + * instance, then the bid price is half of the price of + * on-demand `r3.xlarge` instances. Similarly, if this field is set to 200, the bid price is twice + * the price of on-demand `r3.xlarge` instances. If not specified, the default value is 100. + * When spot instances are requested for this cluster, only spot instances whose bid price + * percentage matches this field will be considered. + * Note that, for safety, we enforce this field to be no more than 10000. + */ + spotBidPricePercent?: number | undefined; + /** The type of EBS volumes that will be launched with this cluster. */ + ebsVolumeType?: EbsVolumeType | undefined; + /** + * The number of volumes launched for each instance. Users can choose up to 10 volumes. + * This feature is only enabled for supported node types. Legacy node types cannot specify + * custom EBS volumes. + * For node types with no instance store, at least one EBS volume needs to be specified; + * otherwise, cluster creation will fail. + * + * These EBS volumes will be mounted at `/ebs0`, `/ebs1`, and etc. + * Instance store volumes will be mounted at `/local_disk0`, `/local_disk1`, and etc. + * + * If EBS volumes are attached, will configure Spark to use only the EBS volumes for + * scratch storage because heterogenously sized scratch devices can lead to inefficient disk + * utilization. If no EBS volumes are attached, will configure Spark to use instance + * store volumes. + * + * Please note that if EBS volumes are specified, then the Spark configuration `spark.local.dir` + * will be overridden. + */ + ebsVolumeCount?: number | undefined; + /** + * The size of each EBS volume (in GiB) launched for each instance. For general purpose + * SSD, this value must be within the range 100 - 4096. For throughput optimized HDD, + * this value must be within the range 500 - 4096. + */ + ebsVolumeSize?: number | undefined; + /** If using gp3 volumes, what IOPS to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used. */ + ebsVolumeIops?: number | undefined; + /** If using gp3 volumes, what throughput to use for the disk. If this is not set, the maximum performance of a gp2 volume with the same volume size will be used. */ + ebsVolumeThroughput?: number | undefined; +} + +/** Attributes set during cluster creation which are related to Microsoft Azure. */ +export interface CreateAzureAttributes { + /** Defines values necessary to configure and run Azure Log Analytics agent */ + logAnalyticsInfo?: CreateLogAnalyticsInfo | undefined; + /** + * The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. + * This value should be greater than 0, to make sure the cluster driver node is placed on an + * on-demand instance. If this value is greater than or equal to the current cluster size, all + * nodes will be placed on on-demand instances. If this value is less than the current cluster + * size, `first_on_demand` nodes will be placed on on-demand instances and the remainder will + * be placed on `availability` instances. Note that this value does not affect + * cluster size and cannot currently be mutated over the lifetime of a cluster. + */ + firstOnDemand?: number | undefined; + /** + * Availability type used for all subsequent nodes past the `first_on_demand` ones. + * Note: If `first_on_demand` is zero, this availability + * type will be used for the entire cluster. + */ + availability?: AzureAvailability | undefined; + /** + * The max bid price to be used for Azure spot instances. + * The Max price for the bid cannot be higher than the on-demand price of the instance. + * If not specified, the default value is -1, which specifies that the instance cannot be evicted + * on the basis of price, and only on the basis of availability. Further, the value should > 0 or -1. + */ + spotBidMaxPrice?: number | undefined; + /** + * The Azure capacity reservation group resource ID to use for launching VMs. + * When specified, VMs will be launched using the provided capacity reservation. + * + * Capacity reservations can only be specified when the workspace uses injected vnet (i.e. customer defined vnet not + * managed by databricks). Ensure the databricks-login-prod Enterprise Application is granted the following four permissions: + * 1. Microsoft.Compute/capacityReservationGroups/read + * 2. Microsoft.Compute/capacityReservationGroups/deploy/action + * 3. Microsoft.Compute/capacityReservationGroups/capacityReservations/read + * 4. Microsoft.Compute/capacityReservationGroups/capacityReservations/deploy/action + * + * Format: `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}` + */ + capacityReservationGroup?: string | undefined; +} + +/** + * Clean Rooms notebook task for V1 Clean Room service (GA). + * Replaces the deprecated CleanRoomNotebookTask (defined above) which was for V0 service. + */ +export interface CreateCleanRoomsNotebookTask { + /** The clean room that the notebook belongs to. */ + cleanRoomName: string; + /** Name of the notebook being run. */ + notebookName: string; + /** + * Checksum to validate the freshness of the notebook resource (i.e. the notebook being run is the latest version). + * It can be fetched by calling the :method:cleanroomassets/get API. + */ + etag?: string | undefined; + /** Base parameters to be used for the clean room notebook job. */ + notebookBaseParameters?: Record | undefined; +} + +/** Cluster log delivery config */ +export interface CreateClusterLogConf { + storageInfo?: + | { + $case: 'dbfs'; + /** + * destination needs to be provided. e.g. + * `{ "dbfs" : { "destination" : "dbfs:/home/cluster_log" } }` + */ + dbfs: CreateDbfsStorageInfo; + } + | { + $case: 's3'; + /** + * destination and either the region or endpoint need to be provided. e.g. + * `{ "s3": { "destination" : "s3://cluster_log_bucket/prefix", "region" : "us-west-2" } }` + * Cluster iam role is used to access s3, please make sure the cluster iam role in + * `instance_profile_arn` has permission to write data to the s3 destination. + */ + s3: CreateS3StorageInfo; + } + | { + $case: 'volumes'; + /** + * destination needs to be provided, e.g. + * `{ "volumes": { "destination": "/Volumes/catalog/schema/volume/cluster_log" } }` + */ + volumes: CreateVolumesStorageInfo; + } + | undefined; +} + +export interface CreateCompute { + /** Hardware accelerator configuration for Serverless GPU workloads. */ + hardwareAccelerator?: HardwareAcceleratorType | undefined; +} + +export interface CreateComputeConfig { + /** Number of GPUs. */ + numGpus: number; + /** IDof the GPU pool to use. */ + gpuNodePoolId?: string | undefined; + /** GPU type. */ + gpuType?: string | undefined; +} + +/** + * ComputeSpec: compute configuration — accelerator type and total + * accelerator count across all nodes. + */ +export interface CreateComputeSpec { + /** + * Hardware accelerator type (for example, `GPU_1xA10` or `GPU_8xH100`). + * The number of accelerators per node is encoded in the enum value — + * `GPU_8xH100` means 8 H100 GPUs per node. + */ + acceleratorType: ComputeSpec_AcceleratorType; + /** + * Total number of accelerators across all nodes. Must be a positive + * multiple of the per-node accelerator count encoded in `accelerator_type`. + * For example, `GPU_8xH100` with `accelerator_count: 16` allocates 2 nodes + * (8 GPUs per node). + */ + acceleratorCount: number; +} + +export interface CreateConditionTask { + /** + * * `EQUAL_TO`, `NOT_EQUAL` operators perform string comparison of their operands. This means that `“12.0” == “12”` will evaluate to `false`. + * * `GREATER_THAN`, `GREATER_THAN_OR_EQUAL`, `LESS_THAN`, `LESS_THAN_OR_EQUAL` operators perform numeric comparison of their operands. `“12.0” >= “12”` will evaluate to `true`, `“10.0” >= “12”` will evaluate to `false`. + * + * The boolean comparison to task values can be implemented with operators `EQUAL_TO`, `NOT_EQUAL`. If a task value was set to a boolean value, it will be serialized to `“true”` or `“false”` for the comparison. + */ + op: ConditionTask_ConditionTaskOperator; + /** The left operand of the condition task. Can be either a string value or a job state or parameter reference. */ + left: string; + /** The right operand of the condition task. Can be either a string value or a job state or parameter reference. */ + right: string; + /** The condition expression evaluation result. Filled in if the task was successfully completed. Can be `"true"` or `"false"` */ + outcome?: string | undefined; +} + +export interface CreateContinuousSettings { + /** Indicate whether the continuous execution of the job is paused or not. Defaults to UNPAUSED. */ + pauseStatus?: SchedulePauseStatus | undefined; + /** Indicate whether the continuous job is applying task level retries or not. Defaults to NEVER. */ + taskRetryMode?: TaskRetryMode | undefined; +} + +export interface CreateCronSchedule { + /** A Cron expression using Quartz syntax that describes the schedule for a job. See [Cron Trigger](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html) for details. This field is required. */ + quartzCronExpression: string; + /** A Java timezone ID. The schedule for a job is resolved with respect to this timezone. See [Java TimeZone](https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html) for details. This field is required. */ + timezoneId: string; + /** Indicate whether this schedule is paused or not. */ + pauseStatus?: SchedulePauseStatus | undefined; +} + +/** Configures the Lakeview Dashboard job task type. */ +export interface CreateDashboardTask { + /** Optional: subscription configuration for sending the dashboard snapshot. */ + subscription?: CreateSubscription | undefined; + /** + * Optional: The warehouse id to execute the dashboard with for the schedule. + * If not specified, the default warehouse of the dashboard will be used. + */ + warehouseId?: string | undefined; + /** The identifier of the dashboard to refresh. */ + dashboardId?: string | undefined; + /** + * Dashboard task parameters. Used to apply dashboard filter values during dashboard task execution. Parameter values get applied to any dashboard filters that have a matching URL identifier as the parameter key. + * The parameter value format is dependent on the filter type: + * - For text and single-select filters, provide a single value (e.g. `"value"`) + * - For date and datetime filters, provide the value in ISO 8601 format (e.g. `"2000-01-01T00:00:00"`) + * - For multi-select filters, provide a JSON array of values (e.g. `"[\"value1\",\"value2\"]"`) + * - For range and date range filters, provide a JSON object with `start` and `end` (e.g. `"{\"start\":\"1\",\"end\":\"10\"}"`) + */ + filters?: Record | undefined; +} + +/** A storage location in DBFS */ +export interface CreateDbfsStorageInfo { + /** dbfs destination, e.g. `dbfs:/my/path` */ + destination: string; +} + +/** Deprecated in favor of DbtPlatformTask */ +export interface CreateDbtCloudTask { + /** Id of the dbt Cloud job to be triggered */ + dbtCloudJobId?: bigint | undefined; + /** The resource name of the UC connection that authenticates the dbt Cloud for this task */ + connectionResourceName?: string | undefined; +} + +export interface CreateDbtPlatformTask { + /** Id of the dbt platform job to be triggered. Specified as a string for maximum compatibility with clients. */ + dbtPlatformJobId?: string | undefined; + /** The resource name of the UC connection that authenticates the dbt platform for this task */ + connectionResourceName?: string | undefined; +} + +export interface CreateDbtTask { + /** + * Path to the project directory. Optional for Git sourced tasks, in which + * case if no value is provided, the root of the Git repository is used. + */ + projectDirectory?: string | undefined; + /** A list of dbt commands to execute. All commands must start with `dbt`. This parameter must not be empty. A maximum of up to 10 commands can be provided. */ + commands: string[]; + /** Optional schema to write to. This parameter is only used when a warehouse_id is also provided. If not provided, the `default` schema is used. */ + schema?: string | undefined; + /** ID of the SQL warehouse to connect to. If provided, we automatically generate and provide the profile and connection details to dbt. It can be overridden on a per-command basis by using the `--profiles-dir` command line argument. */ + warehouseId?: string | undefined; + /** Optional (relative) path to the profiles directory. Can only be specified if no warehouse_id is specified. If no warehouse_id is specified and this folder is unset, the root directory is used. */ + profilesDirectory?: string | undefined; + /** Optional name of the catalog to use. The value is the top level in the 3-level namespace of Unity Catalog (catalog / schema / relation). The catalog value can only be specified if a warehouse_id is specified. Requires dbt-databricks >= 1.1.1. */ + catalog?: string | undefined; + /** + * Optional location type of the project directory. When set to `WORKSPACE`, the project will be retrieved + * from the local workspace. When set to `GIT`, the project will be retrieved from a Git repository + * defined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise. + * + * * `WORKSPACE`: Project is located in workspace. + * * `GIT`: Project is located in cloud Git provider. + */ + source?: Source | undefined; +} + +/** + * DeploymentSpec: configuration for one deployment within an AiRuntimeTask. + * Each entry in `AiRuntimeTask.deployments` describes a group of nodes that + * share the same command and compute. Many single-program training + * algorithms use a single entry where every node runs the same command; + * role-split workloads (driver + worker, parameter server, separate eval + * node, etc.) use multiple entries. + */ +export interface CreateDeploymentSpec { + /** + * Workspace path of the bash script to execute on each node in this + * deployment. The CLI uploads the user's script and populates this. + * Customers calling the Jobs API directly should upload their script to + * the workspace first and supply the resulting path here. + */ + commandPath: string; + /** Compute resources allocated to each node in this deployment. */ + compute: CreateComputeSpec; + /** + * Optional human-readable name for this deployment (for example, `driver`, + * `worker`, `param_server`). Used for log and UI display. Distinct names + * are recommended so deployments can be told apart, but uniqueness is not + * enforced. + */ + name?: string | undefined; +} + +export interface CreateDockerBasicAuth { + /** Name of the user */ + username?: string | undefined; + /** Password of the user */ + password?: string | undefined; +} + +export interface CreateDockerImage { + /** URL of the docker image. */ + url?: string | undefined; + credsOneof?: + | { + $case: 'basicAuth'; + /** Basic auth with username and password */ + basicAuth: CreateDockerBasicAuth; + } + | undefined; +} + +/** + * The environment entity used to preserve serverless environment side panel, jobs' environment for non-notebook task, and SDP's environment for classic and serverless pipelines. + * In this minimal environment spec, only pip and java dependencies are supported. + */ +export interface CreateEnvironment { + /** Use `environment_version` instead. */ + client?: string | undefined; + /** + * List of pip dependencies, as supported by the version of pip in this environment. + * Each dependency is a valid pip requirements file line per https://pip.pypa.io/en/stable/reference/requirements-file-format/. + * Allowed dependencies include a requirement specifier, an archive URL, a local project path (such as WSFS or UC Volumes in ), or a VCS project URL. + */ + dependencies?: string[] | undefined; + /** + * The base environment this environment is built on top of. A base environment defines the environment version and a + * list of dependencies for serverless compute. The value can be a file path to a custom `env.yaml` file + * (e.g., `/Workspace/path/to/env.yaml`). Support for a -provided base environment ID + * (e.g., `workspace-base-environments/databricks_ai_v4`) and workspace base environment ID + * (e.g., `workspace-base-environments/dbe_b849b66e-b31a-4cb5-b161-1f2b10877fb7`) is in Beta. + * Either `environment_version` or `base_environment` can be provided. + * For more information about -provided base environments, see the + * [list workspace base environments](:method:Environments/ListWorkspaceBaseEnvironments) API. + * For more information, see + */ + baseEnvironment?: string | undefined; + /** + * Either `environment_version` or `base_environment` needs to be provided. Environment version used by the environment. + * Each version comes with a specific Python version and a set of Python packages. + * The version is a string, consisting of an integer. + */ + environmentVersion?: string | undefined; + /** List of java dependencies. Each dependency is a string representing a java library path. For example: `/Volumes/path/to/test.jar`. */ + javaDependencies?: string[] | undefined; +} + +export interface CreateFileArrivalTriggerConfiguration { + /** URL to be monitored for file arrivals. The path must point to the root or a subpath of the external location. */ + url: string; + /** + * If set, the trigger starts a run only after the specified amount of time passed since + * the last time the trigger fired. The minimum allowed value is 60 seconds + */ + minTimeBetweenTriggersSeconds?: number | undefined; + /** + * If set, the trigger starts a run only after no file activity has occurred for the specified amount of time. + * This makes it possible to wait for a batch of incoming files to arrive before triggering a run. The + * minimum allowed value is 60 seconds. + */ + waitAfterLastChangeSeconds?: number | undefined; +} + +export interface CreateForEachTask { + /** + * Array for task to iterate on. This can be a JSON string or a reference to + * an array parameter. + */ + inputs: string; + /** + * An optional maximum allowed number of concurrent runs of the task. + * Set this value if you want to be able to execute multiple runs of the task concurrently. + */ + concurrency?: number | undefined; + /** Configuration for the task that will be run for each element in the array */ + task: CreateTaskSettings; +} + +/** Attributes set during cluster creation which are related to GCP. */ +export interface CreateGcpAttributes { + /** + * This field determines whether the spark executors will be scheduled to run on preemptible + * VMs (when set to true) versus standard compute engine VMs (when set to false; default). + * Note: Soon to be deprecated, use the 'availability' field instead. + */ + usePreemptibleExecutors?: boolean | undefined; + /** + * If provided, the cluster will impersonate the google service account when accessing + * gcloud services (like GCS). The google service account + * must have previously been added to the environment by an account + * administrator. + */ + googleServiceAccount?: string | undefined; + /** Boot disk size in GB */ + bootDiskSize?: number | undefined; + /** + * This field determines whether the spark executors will be scheduled to run on preemptible + * VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable. + */ + availability?: GcpAvailability | undefined; + /** + * Identifier for the availability zone in which the cluster resides. + * This can be one of the following: + * - "HA" => High availability, spread nodes across availability zones for a + * deployment region [default]. + * - "AUTO" => picks an availability zone to schedule the cluster on. + * - A GCP availability zone => Pick One of the available zones for (machine type + region) from + * https://cloud.google.com/compute/docs/regions-zones. + */ + zoneId?: string | undefined; + /** + * If provided, each node (workers and driver) in the cluster will have this number of local SSDs attached. + * Each local SSD is 375GB in size. + * Refer to [GCP documentation](https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds) + * for the supported number of local SSDs for each instance type. + */ + localSsdCount?: number | undefined; + /** + * The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. + * This value should be greater than 0, to make sure the cluster driver node is placed on an + * on-demand instance. If this value is greater than or equal to the current cluster size, all + * nodes will be placed on on-demand instances. If this value is less than the current cluster + * size, `first_on_demand` nodes will be placed on on-demand instances and the remainder will + * be placed on `availability` instances. Note that this value does not affect + * cluster size and cannot currently be mutated over the lifetime of a cluster. + */ + firstOnDemand?: number | undefined; + /** + * The confidential computing technology for this cluster's instances. + * Currently only SEV_SNP is supported, and only on N2D instance types. + * When not set, no confidential computing is applied. + */ + confidentialComputeType?: ConfidentialComputeType | undefined; +} + +/** A storage location in Google Cloud Platform's GCS */ +export interface CreateGcsStorageInfo { + /** GCS destination/URI, e.g. `gs://my-bucket/some-prefix` */ + destination: string; +} + +/** + * DEPRECATED — use `AiRuntimeTask` for all new BYOT multi-node GPU + * workloads (see ai_runtime_task.proto). `AiRuntimeTask` is the only + * supported BYOT task type for new workloads; this proto is retained only + * for AIR CLI (fka SGCLI) pywheel backwards compatibility and will be + * removed once the pywheel → databricks-cli migration completes (post- + * PuPr). + */ +export interface CreateGenAiComputeTask { + /** Runtime image */ + dlRuntimeImage: string; + compute?: CreateComputeConfig | undefined; + /** Command launcher to run the actual script, e.g. bash, python etc. */ + command?: string | undefined; + /** + * Optional location type of the training script. When set to `WORKSPACE`, the script will be retrieved from the local workspace. When set to `GIT`, the script will be retrieved from a Git repository + * defined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise. + * * `WORKSPACE`: Script is located in workspace. + * * `GIT`: Script is located in cloud Git provider. + */ + source?: Source | undefined; + /** The training script file path to be executed. Cloud file URIs (such as dbfs:/, s3:/, adls:/, gcs:/) and workspace paths are supported. For python files stored in the workspace, the path must be absolute and begin with `/`. For files stored in a remote repository, the path must be relative. This field is required. */ + trainingScriptPath?: string | undefined; + /** Optional path to a YAML file containing model parameters passed to the training script. */ + yamlParametersFilePath?: string | undefined; + /** + * Optional string containing model parameters passed to the training script in yaml format. + * If present, then the content in yaml_parameters_file_path will be ignored. + */ + yamlParameters?: string | undefined; + /** + * Optional string containing the name of the MLflow experiment to log the run to. If name is not + * found, backend will create the mlflow experiment using the name. + */ + mlflowExperimentName?: string | undefined; +} + +/** Read-only state of the remote repository at the time the job was run. This field is only included on job runs. */ +export interface CreateGitMetadataSnapshot { + /** Commit that was used to execute the run. If git_branch was specified, this points to the HEAD of the branch at the time of the run; if git_tag was specified, this points to the commit the tag points to. */ + usedCommit?: string | undefined; +} + +/** + * An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks. + * + * If `git_source` is set, these tasks retrieve the file from the remote repository by default. However, this behavior can be overridden by setting `source` to `WORKSPACE` on the task. + * + * Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, `git_source` must be defined on the job. + */ +export interface CreateGitSource { + /** URL of the repository to be cloned by this job. */ + gitUrl: string; + /** Unique identifier of the service used to host the Git repository. The value is case insensitive. */ + gitProvider: string; + gitReference?: + | { + $case: 'gitBranch'; + /** Name of the branch to be checked out and used by this job. This field cannot be specified in conjunction with git_tag or git_commit. */ + gitBranch: string; + } + | { + $case: 'gitTag'; + /** Name of the tag to be checked out and used by this job. This field cannot be specified in conjunction with git_branch or git_commit. */ + gitTag: string; + } + | { + $case: 'gitCommit'; + /** Commit to be checked out and used by this job. This field cannot be specified in conjunction with git_branch or git_tag. */ + gitCommit: string; + } + | undefined; + gitSnapshot?: CreateGitMetadataSnapshot | undefined; + /** The source of the job specification in the remote repository when the job is source controlled. */ + jobSource?: CreateJobSource | undefined; + sparseCheckout?: CreateSparseCheckout | undefined; +} + +/** Config for an individual init script */ +export interface CreateInitScriptInfo { + storageInfo?: + | { + $case: 'dbfs'; + /** + * destination needs to be provided. e.g. + * `{ "dbfs": { "destination" : "dbfs:/home/cluster_log" } }` + */ + dbfs: CreateDbfsStorageInfo; + } + | { + $case: 's3'; + /** + * destination and either the region or endpoint need to be provided. e.g. + * `{ \"s3\": { \"destination\": \"s3://cluster_log_bucket/prefix\", \"region\": \"us-west-2\" } }` + * Cluster iam role is used to access s3, please make sure the cluster iam role in + * `instance_profile_arn` has permission to write data to the s3 destination. + */ + s3: CreateS3StorageInfo; + } + | { + $case: 'file'; + /** + * destination needs to be provided, e.g. + * `{ "file": { "destination": "file:/my/local/file.sh" } }` + */ + file: CreateLocalFileInfo; + } + | { + $case: 'gcs'; + /** + * destination needs to be provided, e.g. + * `{ "gcs": { "destination": "gs://my-bucket/file.sh" } }` + */ + gcs: CreateGcsStorageInfo; + } + | { + $case: 'abfss'; + /** + * destination needs to be provided, e.g. + * `abfss://@.dfs.core.windows.net/` + */ + abfss: CreateAdlsgen2Info; + } + | { + $case: 'workspace'; + /** + * destination needs to be provided, e.g. + * `{ "workspace": { "destination": "/cluster-init-scripts/setup-datadog.sh" } }` + */ + workspace: CreateWorkspaceStorageInfo; + } + | { + $case: 'volumes'; + /** + * destination needs to be provided. e.g. + * `{ \"volumes\" : { \"destination\" : \"/Volumes/my-init.sh\" } }` + */ + volumes: CreateVolumesStorageInfo; + } + | undefined; +} + +export interface CreateJobCluster { + /** + * A unique name for the job cluster. This field is required and must be unique within the job. + * `JobTaskSettings` may refer to this field to determine which cluster to launch for the task execution. + */ + jobClusterKey: string; + /** If new_cluster, a description of a cluster that is created for each task. */ + newCluster: ClusterSpec_CreateNewCluster; +} + +export interface CreateJobDeployment { + /** + * The kind of deployment that manages the job. + * + * * `BUNDLE`: The job is managed by Databricks Asset Bundle. + * * `SYSTEM_MANAGED`: The job is managed by and is read-only. + */ + kind: JobDeployment_DeploymentKind; + /** Path of the file that contains deployment metadata. */ + metadataFilePath?: string | undefined; + /** + * ID of the deployment that manages this job. Only set when `kind` is + * `BUNDLE`. Used to look up deployment metadata from the Deployment + * Metadata service. + */ + deploymentId?: string | undefined; + /** + * ID of the version of the deployment that produced this job. Only set + * when `kind` is `BUNDLE`. Identifies a specific snapshot of the deployment + * in the Deployment Metadata service. + */ + versionId?: string | undefined; +} + +export interface CreateJobEmailNotifications { + /** A list of email addresses to be notified when a run begins. If not specified on job creation, reset, or update, the list is empty, and notifications are not sent. */ + onStart?: string[] | undefined; + /** A list of email addresses to be notified when a run successfully completes. A run is considered to have completed successfully if it ends with a `TERMINATED` `life_cycle_state` and a `SUCCESS` result_state. If not specified on job creation, reset, or update, the list is empty, and notifications are not sent. */ + onSuccess?: string[] | undefined; + /** A list of email addresses to be notified when a run unsuccessfully completes. A run is considered to have completed unsuccessfully if it ends with an `INTERNAL_ERROR` `life_cycle_state` or a `FAILED`, or `TIMED_OUT` result_state. If this is not specified on job creation, reset, or update the list is empty, and notifications are not sent. */ + onFailure?: string[] | undefined; + /** A list of email addresses to be notified when the duration of a run exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in the `health` field. If no rule for the `RUN_DURATION_SECONDS` metric is specified in the `health` field for the job, notifications are not sent. */ + onDurationWarningThresholdExceeded?: string[] | undefined; + /** + * A list of email addresses to notify when any streaming backlog thresholds are exceeded for any stream. + * Streaming backlog thresholds can be set in the `health` field using the following metrics: `STREAMING_BACKLOG_BYTES`, `STREAMING_BACKLOG_RECORDS`, `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`. + * Alerting is based on the 10-minute average of these metrics. If the issue persists, notifications are resent every 30 minutes. + */ + onStreamingBacklogExceeded?: string[] | undefined; + /** + * If true, do not send email to recipients specified in `on_failure` if the run is skipped. + * This field is `deprecated`. Please use the `notification_settings.no_alert_for_skipped_runs` field. + */ + noAlertForSkippedRuns?: boolean | undefined; +} + +export interface CreateJobEnvironment { + /** The key of an environment. It has to be unique within a job. */ + environmentKey: string; + spec?: CreateEnvironment | undefined; +} + +export interface CreateJobLevelParameter { + /** The name of the defined parameter. May only contain alphanumeric characters, `_`, `-`, and `.` */ + name: string; + /** Default value of the parameter. */ + default: string; +} + +export interface CreateJobRequest { + /** List of permissions to set on the job. */ + accessControlList?: CreateAccessControlRequest[] | undefined; + /** An optional name for the job. The maximum length is 4096 bytes in UTF-8 encoding. */ + name?: string | undefined; + /** An optional description for the job. The maximum length is 27700 characters in UTF-8 encoding. */ + description?: string | undefined; + /** An optional set of email addresses that is notified when runs of this job begin or complete as well as when this job is deleted. */ + emailNotifications?: CreateJobEmailNotifications | undefined; + /** A collection of system notification IDs to notify when runs of this job begin or complete. */ + webhookNotifications?: CreateWebhookNotifications | undefined; + /** Optional notification settings that are used when sending notifications to each of the `email_notifications` and `webhook_notifications` for this job. */ + notificationSettings?: CreateNotificationSettings | undefined; + /** An optional timeout applied to each run of this job. A value of `0` means no timeout. */ + timeoutSeconds?: number | undefined; + health?: CreateJobsHealthRules | undefined; + /** An optional periodic schedule for this job. The default behavior is that the job only runs when triggered by clicking “Run Now” in the Jobs UI or sending an API request to `runNow`. */ + schedule?: CreateCronSchedule | undefined; + /** A configuration to trigger a run when certain conditions are met. The default behavior is that the job runs only when triggered by clicking “Run Now” in the Jobs UI or sending an API request to `runNow`. */ + trigger?: CreateTriggerSettings | undefined; + /** An optional continuous property for this job. The continuous property will ensure that there is always one run executing. Only one of `schedule` and `continuous` can be used. */ + continuous?: CreateContinuousSettings | undefined; + /** + * An optional maximum allowed number of concurrent runs of the job. + * Set this value if you want to be able to execute multiple runs of the same job concurrently. + * This is useful for example if you trigger your job on a frequent schedule and want to allow consecutive runs to overlap with each other, or if you want to trigger multiple runs which differ by their input parameters. + * This setting affects only new runs. For example, suppose the job’s concurrency is 4 and there are 4 concurrent active runs. Then setting the concurrency to 3 won’t kill any of the active runs. + * However, from then on, new runs are skipped unless there are fewer than 3 active runs. + * This value cannot exceed 1000. Setting this value to `0` causes all new runs to be skipped. + */ + maxConcurrentRuns?: number | undefined; + /** + * A list of task specifications to be executed by this job. + * It supports up to 1000 elements in write endpoints (:method:jobs/create, :method:jobs/reset, :method:jobs/update, :method:jobs/submit). + * Read endpoints return only 100 tasks. If more than 100 tasks are available, you can paginate through them using :method:jobs/get. Use the `next_page_token` field at the object root to determine if more results are available. + */ + tasks?: CreateTaskSettings[] | undefined; + /** A list of job cluster specifications that can be shared and reused by tasks of this job. Libraries cannot be declared in a shared job cluster. You must declare dependent libraries in task settings. */ + jobClusters?: CreateJobCluster[] | undefined; + /** + * An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks. + * + * If `git_source` is set, these tasks retrieve the file from the remote repository by default. However, this behavior can be overridden by setting `source` to `WORKSPACE` on the task. + * + * Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, `git_source` must be defined on the job. + */ + gitSource?: CreateGitSource | undefined; + /** A map of tags associated with the job. These are forwarded to the cluster as cluster tags for jobs clusters, and are subject to the same limitations as cluster tags. A maximum of 25 tags can be added to the job. */ + tags?: Record | undefined; + /** Used to tell what is the format of the job. This field is ignored in Create/Update/Reset calls. When using the Jobs API 2.1 this value is always set to `"MULTI_TASK"`. */ + format?: Format | undefined; + /** The queue settings of the job. */ + queue?: CreateQueueSettings | undefined; /** Job-level parameter definitions */ - parameters?: JobLevelParameter[] | undefined; + parameters?: CreateJobLevelParameter[] | undefined; + /** + * The user or service principal that the job runs as, if specified in the request. + * This field indicates the explicit configuration of `run_as` for the job. + * To find the value in all cases, explicit or implicit, use `run_as_user_name`. + */ + runAs?: CreateJobRunAs | undefined; + /** + * Edit mode of the job. + * + * * `UI_LOCKED`: The job is in a locked UI state and cannot be modified. + * * `EDITABLE`: The job is in an editable state and can be modified. + */ + editMode?: JobEditMode | undefined; + /** Deployment information for jobs managed by external sources. */ + deployment?: CreateJobDeployment | undefined; + /** + * A list of task execution environment specifications that can be referenced by serverless tasks of this job. + * For serverless notebook tasks, if the environment_key is not specified, the notebook environment will be used if present. If a jobs environment is specified, it will override the notebook environment. + * For other serverless tasks, the task environment is required to be specified using environment_key in the task settings. + */ + environments?: CreateJobEnvironment[] | undefined; + /** + * The id of the user specified budget policy to use for this job. + * If not specified, a default budget policy may be applied when creating or modifying the job. + * See `effective_budget_policy_id` for the budget policy used by this workload. + */ + budgetPolicyId?: string | undefined; + /** + * The id of the user specified usage policy to use for this job. + * If not specified, a default usage policy may be applied when creating or modifying the job. + * See `effective_usage_policy_id` for the usage policy used by this workload. + */ + usagePolicyId?: string | undefined; + /** + * The performance mode on a serverless job. This field determines the level of compute performance or cost-efficiency for the run. + * The performance target does not apply to tasks that run on Serverless GPU compute. + * + * * `STANDARD`: Enables cost-efficient execution of serverless workloads. + * * `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times through rapid scaling and optimized cluster performance. + */ + performanceTarget?: PerformanceTarget_PerformanceTarget | undefined; + /** An optional maximum number of times to retry an unsuccessful run. A run is considered to be unsuccessful if it completes with the `FAILED` result_state or `INTERNAL_ERROR` `life_cycle_state`. The value `-1` means to retry indefinitely and the value `0` means to never retry. */ + maxRetries?: number | undefined; + /** An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried. */ + minRetryIntervalMillis?: number | undefined; + /** + * An optional policy to specify whether to retry a job when it times out. The default behavior + * is to not retry on timeout. + */ + retryOnTimeout?: boolean | undefined; + /** An option to disable auto optimization in serverless */ + disableAutoOptimization?: boolean | undefined; +} + +/** Job was created successfully */ +export interface CreateJobResponse { + /** The canonical identifier for the newly created job. */ + jobId?: bigint | undefined; +} + +/** + * Write-only setting. Specifies the user or service principal that the job runs as. If not specified, the job runs as the user who created the job. + * + * Either `user_name` or `service_principal_name` should be specified. If not, an error is thrown. + */ +export interface CreateJobRunAs { + identity?: + | { + $case: 'userName'; + /** The email of an active workspace user. Non-admin users can only set this field to their own email. */ + userName: string; + } + | { + $case: 'servicePrincipalName'; + /** Application ID of an active service principal. Setting this field requires the `servicePrincipal/user` role. */ + servicePrincipalName: string; + } + | { + $case: 'groupName'; + /** Group name of an account group assigned to the workspace. Setting this field requires being a member of the group. */ + groupName: string; + } + | undefined; +} + +export interface CreateJobSettings { + /** An optional name for the job. The maximum length is 4096 bytes in UTF-8 encoding. */ + name?: string | undefined; + /** An optional description for the job. The maximum length is 27700 characters in UTF-8 encoding. */ + description?: string | undefined; + /** An optional set of email addresses that is notified when runs of this job begin or complete as well as when this job is deleted. */ + emailNotifications?: CreateJobEmailNotifications | undefined; + /** A collection of system notification IDs to notify when runs of this job begin or complete. */ + webhookNotifications?: CreateWebhookNotifications | undefined; + /** Optional notification settings that are used when sending notifications to each of the `email_notifications` and `webhook_notifications` for this job. */ + notificationSettings?: CreateNotificationSettings | undefined; + /** An optional timeout applied to each run of this job. A value of `0` means no timeout. */ + timeoutSeconds?: number | undefined; + health?: CreateJobsHealthRules | undefined; + /** An optional periodic schedule for this job. The default behavior is that the job only runs when triggered by clicking “Run Now” in the Jobs UI or sending an API request to `runNow`. */ + schedule?: CreateCronSchedule | undefined; + /** A configuration to trigger a run when certain conditions are met. The default behavior is that the job runs only when triggered by clicking “Run Now” in the Jobs UI or sending an API request to `runNow`. */ + trigger?: CreateTriggerSettings | undefined; + /** An optional continuous property for this job. The continuous property will ensure that there is always one run executing. Only one of `schedule` and `continuous` can be used. */ + continuous?: CreateContinuousSettings | undefined; + /** + * An optional maximum allowed number of concurrent runs of the job. + * Set this value if you want to be able to execute multiple runs of the same job concurrently. + * This is useful for example if you trigger your job on a frequent schedule and want to allow consecutive runs to overlap with each other, or if you want to trigger multiple runs which differ by their input parameters. + * This setting affects only new runs. For example, suppose the job’s concurrency is 4 and there are 4 concurrent active runs. Then setting the concurrency to 3 won’t kill any of the active runs. + * However, from then on, new runs are skipped unless there are fewer than 3 active runs. + * This value cannot exceed 1000. Setting this value to `0` causes all new runs to be skipped. + */ + maxConcurrentRuns?: number | undefined; + /** + * A list of task specifications to be executed by this job. + * It supports up to 1000 elements in write endpoints (:method:jobs/create, :method:jobs/reset, :method:jobs/update, :method:jobs/submit). + * Read endpoints return only 100 tasks. If more than 100 tasks are available, you can paginate through them using :method:jobs/get. Use the `next_page_token` field at the object root to determine if more results are available. + */ + tasks?: CreateTaskSettings[] | undefined; + /** A list of job cluster specifications that can be shared and reused by tasks of this job. Libraries cannot be declared in a shared job cluster. You must declare dependent libraries in task settings. */ + jobClusters?: CreateJobCluster[] | undefined; + /** + * An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks. + * + * If `git_source` is set, these tasks retrieve the file from the remote repository by default. However, this behavior can be overridden by setting `source` to `WORKSPACE` on the task. + * + * Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, `git_source` must be defined on the job. + */ + gitSource?: CreateGitSource | undefined; + /** A map of tags associated with the job. These are forwarded to the cluster as cluster tags for jobs clusters, and are subject to the same limitations as cluster tags. A maximum of 25 tags can be added to the job. */ + tags?: Record | undefined; + /** Used to tell what is the format of the job. This field is ignored in Create/Update/Reset calls. When using the Jobs API 2.1 this value is always set to `"MULTI_TASK"`. */ + format?: Format | undefined; + /** The queue settings of the job. */ + queue?: CreateQueueSettings | undefined; + /** Job-level parameter definitions */ + parameters?: CreateJobLevelParameter[] | undefined; + /** + * The user or service principal that the job runs as, if specified in the request. + * This field indicates the explicit configuration of `run_as` for the job. + * To find the value in all cases, explicit or implicit, use `run_as_user_name`. + */ + runAs?: CreateJobRunAs | undefined; + /** + * Edit mode of the job. + * + * * `UI_LOCKED`: The job is in a locked UI state and cannot be modified. + * * `EDITABLE`: The job is in an editable state and can be modified. + */ + editMode?: JobEditMode | undefined; + /** Deployment information for jobs managed by external sources. */ + deployment?: CreateJobDeployment | undefined; + /** + * A list of task execution environment specifications that can be referenced by serverless tasks of this job. + * For serverless notebook tasks, if the environment_key is not specified, the notebook environment will be used if present. If a jobs environment is specified, it will override the notebook environment. + * For other serverless tasks, the task environment is required to be specified using environment_key in the task settings. + */ + environments?: CreateJobEnvironment[] | undefined; + /** + * The id of the user specified budget policy to use for this job. + * If not specified, a default budget policy may be applied when creating or modifying the job. + * See `effective_budget_policy_id` for the budget policy used by this workload. + */ + budgetPolicyId?: string | undefined; + /** + * The id of the user specified usage policy to use for this job. + * If not specified, a default usage policy may be applied when creating or modifying the job. + * See `effective_usage_policy_id` for the usage policy used by this workload. + */ + usagePolicyId?: string | undefined; + /** + * The performance mode on a serverless job. This field determines the level of compute performance or cost-efficiency for the run. + * The performance target does not apply to tasks that run on Serverless GPU compute. + * + * * `STANDARD`: Enables cost-efficient execution of serverless workloads. + * * `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times through rapid scaling and optimized cluster performance. + */ + performanceTarget?: PerformanceTarget_PerformanceTarget | undefined; + /** An optional maximum number of times to retry an unsuccessful run. A run is considered to be unsuccessful if it completes with the `FAILED` result_state or `INTERNAL_ERROR` `life_cycle_state`. The value `-1` means to retry indefinitely and the value `0` means to never retry. */ + maxRetries?: number | undefined; + /** An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried. */ + minRetryIntervalMillis?: number | undefined; + /** + * An optional policy to specify whether to retry a job when it times out. The default behavior + * is to not retry on timeout. + */ + retryOnTimeout?: boolean | undefined; + /** An option to disable auto optimization in serverless */ + disableAutoOptimization?: boolean | undefined; +} + +/** The source of the job specification in the remote repository when the job is source controlled. */ +export interface CreateJobSource { + /** Path of the job YAML file that contains the job specification. */ + jobConfigPath: string; + importFromGitReference?: + | { + $case: 'importFromGitBranch'; + /** Name of the branch which the job is imported from. */ + importFromGitBranch: string; + } + | undefined; + /** + * Dirty state indicates the job is not fully synced with the job specification in the remote repository. + * + * Possible values are: + * * `NOT_SYNCED`: The job is not yet synced with the remote job specification. Import the remote job specification from UI to make the job fully synced. + * * `DISCONNECTED`: The job is temporary disconnected from the remote job specification and is allowed for live edit. Import the remote job specification again from UI to make the job fully synced. + */ + dirtyState?: JobSource_DirtyState | undefined; +} + +export interface CreateJobsHealthRule { + metric: JobsHealthMetric; + op: JobsHealthOperator; + /** Specifies the threshold value that the health metric should obey to satisfy the health rule. */ + value: bigint; +} + +/** An optional set of health rules that can be defined for this job. */ +export interface CreateJobsHealthRules { + rules?: CreateJobsHealthRule[] | undefined; +} + +export interface CreateLibrary { + lib?: + | { + $case: 'jar'; + /** + * URI of the JAR library to install. Supported URIs include Workspace paths, Unity Catalog Volumes paths, and S3 URIs. + * For example: `{ "jar": "/Workspace/path/to/library.jar" }`, `{ "jar" : "/Volumes/path/to/library.jar" }` or + * `{ "jar": "s3://my-bucket/library.jar" }`. + * If S3 is used, please make sure the cluster has read access on the library. You may need to + * launch the cluster with an IAM role to access the S3 URI. + */ + jar: string; + } + | { + $case: 'egg'; + /** Deprecated. URI of the egg library to install. Installing Python egg files is deprecated and is not supported in Databricks Runtime 14.0 and above. */ + egg: string; + } + | { + $case: 'pypi'; + /** + * Specification of a PyPi library to be installed. For example: + * `{ "package": "simplejson" }` + */ + pypi: CreatePythonPyPiLibrary; + } + | { + $case: 'maven'; + /** + * Specification of a maven library to be installed. For example: + * `{ "coordinates": "org.jsoup:jsoup:1.7.2" }` + */ + maven: CreateMavenLibrary; + } + | { + $case: 'cran'; + /** Specification of a CRAN library to be installed as part of the library */ + cran: CreateRCranLibrary; + } + | { + $case: 'whl'; + /** + * URI of the wheel library to install. Supported URIs include Workspace paths, Unity Catalog Volumes paths, and S3 URIs. + * For example: `{ "whl": "/Workspace/path/to/library.whl" }`, `{ "whl" : "/Volumes/path/to/library.whl" }` or + * `{ "whl": "s3://my-bucket/library.whl" }`. + * If S3 is used, please make sure the cluster has read access on the library. You may need to + * launch the cluster with an IAM role to access the S3 URI. + */ + whl: string; + } + | { + $case: 'requirements'; + /** + * URI of the requirements.txt file to install. Only Workspace paths and Unity Catalog Volumes paths are supported. + * For example: `{ "requirements": "/Workspace/path/to/requirements.txt" }` or `{ "requirements" : "/Volumes/path/to/requirements.txt" }` + */ + requirements: string; + } + | undefined; +} + +export interface CreateLocalFileInfo { + /** local file destination, e.g. `file:/my/local/file.sh` */ + destination: string; +} + +export interface CreateLogAnalyticsInfo { + logAnalyticsWorkspaceId?: string | undefined; + logAnalyticsPrimaryKey?: string | undefined; +} + +export interface CreateMavenLibrary { + /** Gradle-style maven coordinates. For example: "org.jsoup:jsoup:1.7.2". */ + coordinates: string; + /** + * Maven repo to install the Maven package from. If omitted, both Maven Central Repository + * and Spark Packages are searched. + */ + repo?: string | undefined; + /** + * List of dependences to exclude. For example: `["slf4j:slf4j", "*:hadoop-client"]`. + * + * Maven dependency exclusions: + * https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html. + */ + exclusions?: string[] | undefined; +} + +export interface CreateModelTriggerConfiguration { + /** + * Name of the securable to monitor ("mycatalog.myschema.mymodel" in the case of model-level triggers, + * "mycatalog.myschema" in the case of schema-level triggers) or empty in the case of metastore-level triggers. + */ + securableName?: string | undefined; + /** Aliases of the model versions to monitor. Can only be used in conjunction with condition MODEL_ALIAS_SET. */ + aliases?: string[] | undefined; + /** The condition based on which to trigger a job run. */ + condition: ModelTriggerConfiguration_ModelTriggerCondition; + /** + * If set, the trigger starts a run only after the specified amount of time has passed since + * the last time the trigger fired. The minimum allowed value is 60 seconds. + */ + minTimeBetweenTriggersSeconds?: number | undefined; + /** + * If set, the trigger starts a run only after no model updates have occurred for the specified time + * and can be used to wait for a series of model updates before triggering a run. The + * minimum allowed value is 60 seconds. + */ + waitAfterLastChangeSeconds?: number | undefined; +} + +/** Configuration for flexible node types, allowing fallback to alternate node types during cluster launch and upscale. */ +export interface CreateNodeTypeFlexibility { + /** A list of node type IDs to use as fallbacks when the primary node type is unavailable. */ + alternateNodeTypeIds?: string[] | undefined; +} + +export interface CreateNotebookTask { + /** + * The path of the notebook to be run in the workspace or remote repository. + * For notebooks stored in the workspace, the path must be absolute and begin with a slash. + * For notebooks stored in a remote repository, the path must be relative. This field is required. + */ + notebookPath: string; + /** + * Base parameters to be used for each run of this job. If the run is initiated by a call to :method:jobs/run + * Now with parameters specified, the two parameters maps are merged. If the same key is specified in + * `base_parameters` and in `run-now`, the value from `run-now` is used. + * Use [Task parameter variables](/jobs.html#parameter-variables) to set parameters containing information about job runs. + * + * If the notebook takes a parameter that is not specified in the job’s `base_parameters` or the `run-now` override parameters, + * the default value from the notebook is used. + * + * Retrieve these parameters in a notebook using [dbutils.widgets.get](/dev-tools/databricks-utils.html#dbutils-widgets). + * + * The JSON representation of this field cannot exceed 1MB. + */ + baseParameters?: Record | undefined; + /** + * Optional location type of the notebook. When set to `WORKSPACE`, the notebook will be retrieved from the local workspace. When set to `GIT`, the notebook will be retrieved from a Git repository + * defined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise. + * * `WORKSPACE`: Notebook is located in workspace. + * * `GIT`: Notebook is located in cloud Git provider. + */ + source?: Source | undefined; + /** + * Optional `warehouse_id` to run the notebook on a SQL warehouse. Classic SQL warehouses are NOT supported, please use serverless or pro SQL warehouses. + * + * Note that SQL warehouses only support SQL cells; if the notebook contains non-SQL cells, the run will fail. + */ + warehouseId?: string | undefined; +} + +export interface CreateNotificationSettings { + /** If true, do not send notifications to recipients specified in `on_failure` if the run is skipped. */ + noAlertForSkippedRuns?: boolean | undefined; + /** If true, do not send notifications to recipients specified in `on_failure` if the run is canceled. */ + noAlertForCanceledRuns?: boolean | undefined; + /** If true, do not send notifications to recipients specified in `on_start` for the retried runs and do not send notifications to recipients specified in `on_failure` until the last retry of the run. */ + alertOnLastAttempt?: boolean | undefined; +} + +export interface CreatePeriodicTriggerConfiguration { + /** The interval at which the trigger should run. */ + interval: number; + /** The unit of time for the interval. */ + unit: PeriodicTriggerConfiguration_TimeUnit; +} + +export interface CreatePipelineParameters { + /** If true, triggers a full refresh on the spark declarative pipeline. */ + fullRefresh?: boolean | undefined; + /** A list of tables to update without fullRefresh. */ + refreshSelection?: string[] | undefined; + /** A list of tables to update with fullRefresh. */ + fullRefreshSelection?: string[] | undefined; + /** A list of streaming flows to reset checkpoints without clearing data. */ + resetCheckpointSelection?: string[] | undefined; + /** + * Flow names to selectively refresh. These are unioned with other selective refresh + * options (refresh_selection, full_refresh_selection) to determine the final set of flows to refresh. + */ + refreshFlowSelection?: string[] | undefined; +} + +export interface CreatePipelineTask { + /** The full name of the pipeline task to execute. */ + pipelineId: string; + /** + * Key/value-map of parameters passed to the pipeline execution. + * Limited to 10k characters in total. + */ + pipelineTaskParameters?: Record | undefined; + /** If true, triggers a full refresh on the spark declarative pipeline. */ + fullRefresh?: boolean | undefined; + /** A list of tables to update without fullRefresh. */ + refreshSelection?: string[] | undefined; + /** A list of tables to update with fullRefresh. */ + fullRefreshSelection?: string[] | undefined; + /** A list of streaming flows to reset checkpoints without clearing data. */ + resetCheckpointSelection?: string[] | undefined; + /** + * Flow names to selectively refresh. These are unioned with other selective refresh + * options (refresh_selection, full_refresh_selection) to determine the final set of flows to refresh. + */ + refreshFlowSelection?: string[] | undefined; +} + +export interface CreatePowerBiModel { + /** The name of the Power BI workspace of the model */ + workspaceName?: string | undefined; + /** The name of the Power BI model */ + modelName?: string | undefined; + /** The default storage mode of the Power BI model */ + storageMode?: StorageMode | undefined; + /** How the published Power BI model authenticates to */ + authenticationMethod?: AuthenticationMethod | undefined; + /** Whether to overwrite existing Power BI models */ + overwriteExisting?: boolean | undefined; +} + +export interface CreatePowerBiTable { + /** The table name in */ + name?: string | undefined; + /** The catalog name in */ + catalog?: string | undefined; + /** The schema name in */ + schema?: string | undefined; + /** The Power BI storage mode of the table */ + storageMode?: StorageMode | undefined; +} + +export interface CreatePowerBiTask { + /** The tables to be exported to Power BI */ + tables?: CreatePowerBiTable[] | undefined; + /** The SQL warehouse ID to use as the Power BI data source */ + warehouseId?: string | undefined; + /** The semantic model to update */ + powerBiModel?: CreatePowerBiModel | undefined; + /** The resource name of the UC connection to authenticate from to Power BI */ + connectionResourceName?: string | undefined; + /** Whether the model should be refreshed after the update */ + refreshAfterUpdate?: boolean | undefined; +} + +export interface CreatePythonOperatorTask { + /** + * An ordered list of task parameters. + * TODO(JOBS-30885): Add limits for parameters. + */ + parameters?: PythonOperatorTask_CreateParameter[] | undefined; + /** + * Fully qualified name of the main class or function. + * For example, `my_project.my_function` or `my_project.MyOperator`. + */ + main?: string | undefined; +} + +export interface CreatePythonPyPiLibrary { + /** + * The name of the pypi package to install. An optional exact version specification is also + * supported. Examples: "simplejson" and "simplejson==3.8.0". + */ + package: string; + /** + * The repository where the package can be found. If not specified, the default pip index is + * used. + */ + repo?: string | undefined; +} + +export interface CreatePythonWheelTask { + /** Name of the package to execute */ + packageName: string; + /** Named entry point to use, if it does not exist in the metadata of the package it executes the function from the package directly using `$packageName.$entryPoint()` */ + entryPoint: string; + /** Command-line parameters passed to Python wheel task. Leave it empty if `named_parameters` is not null. */ + parameters?: string[] | undefined; + /** Command-line parameters passed to Python wheel task in the form of `["--name=task", "--data=dbfs:/path/to/data.json"]`. Leave it empty if `parameters` is not null. */ + namedParameters?: Record | undefined; +} + +export interface CreateQueueSettings { + /** If true, enable queueing for the job. This is a required field. */ + enabled: boolean; +} + +export interface CreateRCranLibrary { + /** The name of the CRAN package to install. */ + package: string; + /** The repository where the package can be found. If not specified, the default CRAN repo is used. */ + repo?: string | undefined; +} + +export interface CreateRunJobTask { + /** ID of the job to trigger. */ + jobId: bigint; + /** Job-level parameters used to trigger the job. */ + jobParameters?: Record | undefined; + /** Controls whether the pipeline should perform a full refresh */ + pipelineParams?: CreatePipelineParameters | undefined; + /** + * A list of parameters for jobs with Spark JAR tasks, for example `"jar_params": ["john doe", "35"]`. + * The parameters are used to invoke the main function of the main class specified in the Spark JAR task. + * If not specified upon `run-now`, it defaults to an empty list. + * jar_params cannot be specified in conjunction with notebook_params. + * The JSON representation of this field (for example `{"jar_params":["john doe","35"]}`) cannot exceed 10,000 bytes. + * + * ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks. + */ + jarParams?: string[] | undefined; + /** + * A map from keys to values for jobs with notebook task, for example `"notebook_params": {"name": "john doe", "age": "35"}`. + * The map is passed to the notebook and is accessible through the [dbutils.widgets.get](/dev-tools/databricks-utils.html) function. + * + * If not specified upon `run-now`, the triggered run uses the job’s base parameters. + * + * notebook_params cannot be specified in conjunction with jar_params. + * + * ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks. + * + * The JSON representation of this field (for example `{"notebook_params":{"name":"john doe","age":"35"}}`) cannot exceed 10,000 bytes. + */ + notebookParams?: Record | undefined; + /** + * A list of parameters for jobs with Python tasks, for example `"python_params": ["john doe", "35"]`. + * The parameters are passed to Python file as command-line parameters. If specified upon `run-now`, it would overwrite + * the parameters specified in job setting. The JSON representation of this field (for example `{"python_params":["john doe","35"]}`) + * cannot exceed 10,000 bytes. + * + * ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks. + * + * Important + * + * These parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error. + * Examples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis. + */ + pythonParams?: string[] | undefined; + /** + * A list of parameters for jobs with spark submit task, for example `"spark_submit_params": ["--class", "org.apache.spark.examples.SparkPi"]`. + * The parameters are passed to spark-submit script as command-line parameters. If specified upon `run-now`, it would overwrite the + * parameters specified in job setting. The JSON representation of this field (for example `{"python_params":["john doe","35"]}`) + * cannot exceed 10,000 bytes. + * + * ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks. + * + * Important + * + * These parameters accept only Latin characters (ASCII character set). Using non-ASCII characters returns an error. + * Examples of invalid, non-ASCII characters are Chinese, Japanese kanjis, and emojis. + */ + sparkSubmitParams?: string[] | undefined; + pythonNamedParams?: Record | undefined; + /** + * A map from keys to values for jobs with SQL task, for example `"sql_params": {"name": "john doe", "age": "35"}`. The SQL alert task does not support custom parameters. + * + * ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks. + */ + sqlParams?: Record | undefined; + /** + * An array of commands to execute for jobs with the dbt task, for example `"dbt_commands": ["dbt deps", "dbt seed", "dbt deps", "dbt seed", "dbt run"]` + * + * ⚠ **Deprecation note** Use [job parameters](/jobs/job-parameters.html#job-parameter-pushdown) to pass information down to tasks. + */ + dbtCommands?: string[] | undefined; +} + +export interface CreateRunTaskSettings { + /** + * A unique name for the task. This field is used to refer to this task from other tasks. + * This field is required and must be unique within its parent job. + * On Update or Reset, this field is used to reference the tasks to be updated or reset. + */ + taskKey: string; + /** An optional description for this task. */ + description?: string | undefined; + /** + * An optional array of objects specifying the dependency graph of the task. All tasks specified in this field must complete successfully before executing this task. + * The key is `task_key`, and the value is the name assigned to the dependent task. + */ + dependsOn?: CreateTaskDependency[] | undefined; + /** An optional value indicating the condition that determines whether the task should be run once its dependencies have been completed. When omitted, defaults to `ALL_SUCCESS`. See :method:jobs/create for a list of possible values. */ + runIf?: TaskDependencyType | undefined; + /** An optional timeout applied to each run of this job task. A value of `0` means no timeout. */ + timeoutSeconds?: number | undefined; + /** An optional set of email addresses notified when the task run begins or completes. The default behavior is to not send any emails. */ + emailNotifications?: CreateJobEmailNotifications | undefined; + health?: CreateJobsHealthRules | undefined; + /** Optional notification settings that are used when sending notifications to each of the `email_notifications` and `webhook_notifications` for this task run. */ + notificationSettings?: CreateNotificationSettings | undefined; + /** A collection of system notification IDs to notify when the run begins or completes. The default behavior is to not send any system notifications. Task webhooks respect the task notification settings. */ + webhookNotifications?: CreateWebhookNotifications | undefined; + environmentRef?: + | { + $case: 'environmentKey'; + /** The key that references an environment spec in a job. This field is required for Python script, Python wheel and dbt tasks when using serverless compute. */ + environmentKey: string; + } + | undefined; + /** An optional flag to disable the task. If set to true, the task will not run even if it is part of a job. */ + disabled?: boolean | undefined; + /** Task level compute configuration. */ + compute?: CreateCompute | undefined; + /** DO NOT ADD ANY NEW FIELDS TO JobTask OUTSIDE OF THIS ONEOF as it will break the TaskRegistry */ + task?: + | { + $case: 'notebookTask'; + /** The task runs a notebook when the `notebook_task` field is present. */ + notebookTask: CreateNotebookTask; + } + | { + $case: 'sparkJarTask'; + /** The task runs a JAR when the `spark_jar_task` field is present. */ + sparkJarTask: CreateSparkJarTask; + } + | { + $case: 'sparkPythonTask'; + /** The task runs a Python file when the `spark_python_task` field is present. */ + sparkPythonTask: CreateSparkPythonTask; + } + | { + $case: 'sparkSubmitTask'; + /** (Legacy) The task runs the spark-submit script when the spark_submit_task field is present. Databricks recommends using the spark_jar_task instead; see [Spark Submit task for jobs](/jobs/spark-submit). */ + sparkSubmitTask: CreateSparkSubmitTask; + } + | { + $case: 'pipelineTask'; + /** The task triggers a pipeline update when the `pipeline_task` field is present. Only pipelines configured to use triggered more are supported. */ + pipelineTask: CreatePipelineTask; + } + | { + $case: 'pythonWheelTask'; + /** The task runs a Python wheel when the `python_wheel_task` field is present. */ + pythonWheelTask: CreatePythonWheelTask; + } + | { + $case: 'dbtTask'; + /** The task runs one or more dbt commands when the `dbt_task` field is present. The dbt task requires both Databricks SQL and the ability to use a serverless or a pro SQL warehouse. */ + dbtTask: CreateDbtTask; + } + | { + $case: 'sqlTask'; + /** The task runs a SQL query or file, or it refreshes a SQL alert or a legacy SQL dashboard when the `sql_task` field is present. */ + sqlTask: CreateSqlTask; + } + | { + $case: 'runJobTask'; + /** The task triggers another job when the `run_job_task` field is present. */ + runJobTask: CreateRunJobTask; + } + | { + $case: 'conditionTask'; + /** + * The task evaluates a condition that can be used to control the execution of other tasks when the `condition_task` field is present. + * The condition task does not require a cluster to execute and does not support retries or notifications. + */ + conditionTask: CreateConditionTask; + } + | { + $case: 'forEachTask'; + /** The task executes a nested task for every input provided when the `for_each_task` field is present. */ + forEachTask: CreateForEachTask; + } + | { + $case: 'cleanRoomsNotebookTask'; + /** + * The task runs a [clean rooms](/clean-rooms/index.html) notebook + * when the `clean_rooms_notebook_task` field is present. + */ + cleanRoomsNotebookTask: CreateCleanRoomsNotebookTask; + } + | {$case: 'genAiComputeTask'; genAiComputeTask: CreateGenAiComputeTask} + | { + $case: 'alertTask'; + /** + * The task evaluates a alert and sends notifications to subscribers + * when the `alert_task` field is present. + */ + alertTask: CreateAlertTask; + } + | { + $case: 'powerBiTask'; + /** The task triggers a Power BI semantic model update when the `power_bi_task` field is present. */ + powerBiTask: CreatePowerBiTask; + } + | { + $case: 'dashboardTask'; + /** The task refreshes a dashboard and sends a snapshot to subscribers. */ + dashboardTask: CreateDashboardTask; + } + | { + $case: 'dbtCloudTask'; + /** Task type for dbt cloud, deprecated in favor of the new name dbt_platform_task */ + dbtCloudTask: CreateDbtCloudTask; + } + | {$case: 'dbtPlatformTask'; dbtPlatformTask: CreateDbtPlatformTask} + | { + $case: 'pythonOperatorTask'; + /** The task runs a Python operator task. */ + pythonOperatorTask: CreatePythonOperatorTask; + } + | { + $case: 'aiRuntimeTask'; + /** + * The task runs a multi-node GPU compute workload on Databricks AI Runtime. + * External-facing surface; mirrors the AIR CLI (fka SGCLI) v2 YAML schema. + */ + aiRuntimeTask: CreateAiRuntimeTask; + } + | undefined; + spec?: + | { + $case: 'existingClusterId'; + /** + * If existing_cluster_id, the ID of an existing cluster that is used for all runs. + * When running jobs or tasks on an existing cluster, you may need to manually restart + * the cluster if it stops responding. We suggest running jobs and tasks on new clusters for + * greater reliability + */ + existingClusterId: string; + } + | { + $case: 'newCluster'; + /** If new_cluster, a description of a new cluster that is created for each run. */ + newCluster: ClusterSpec_CreateNewCluster; + } + | { + $case: 'jobClusterKey'; + /** If job_cluster_key, this task is executed reusing the cluster specified in `job.settings.job_clusters`. */ + jobClusterKey: string; + } + | undefined; + /** + * An optional list of libraries to be installed on the cluster. + * The default value is an empty list. + */ + libraries?: CreateLibrary[] | undefined; + /** An optional maximum number of times to retry an unsuccessful run. A run is considered to be unsuccessful if it completes with the `FAILED` result_state or `INTERNAL_ERROR` `life_cycle_state`. The value `-1` means to retry indefinitely and the value `0` means to never retry. */ + maxRetries?: number | undefined; + /** An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried. */ + minRetryIntervalMillis?: number | undefined; + /** + * An optional policy to specify whether to retry a job when it times out. The default behavior + * is to not retry on timeout. + */ + retryOnTimeout?: boolean | undefined; + /** An option to disable auto optimization in serverless */ + disableAutoOptimization?: boolean | undefined; +} + +/** A storage location in Amazon S3 */ +export interface CreateS3StorageInfo { + /** + * S3 destination, e.g. `s3://my-bucket/some-prefix` Note that logs will be delivered using + * cluster iam role, please make sure you set cluster iam role and the role has write access to the + * destination. Please also note that you cannot use AWS keys to deliver logs. + */ + destination: string; + /** + * S3 region, e.g. `us-west-2`. Either region or endpoint needs to be set. If both are set, + * endpoint will be used. + */ + region?: string | undefined; + /** + * S3 endpoint, e.g. `https://s3-us-west-2.amazonaws.com`. Either region or endpoint needs to be set. + * If both are set, endpoint will be used. + */ + endpoint?: string | undefined; + /** (Optional) Flag to enable server side encryption, `false` by default. */ + enableEncryption?: boolean | undefined; /** - * The user or service principal that the job runs as, if specified in the request. - * This field indicates the explicit configuration of `run_as` for the job. - * To find the value in all cases, explicit or implicit, use `run_as_user_name`. + * (Optional) The encryption type, it could be `sse-s3` or `sse-kms`. It will be used only when + * encryption is enabled and the default type is `sse-s3`. */ - runAs?: JobRunAs | undefined; + encryptionType?: string | undefined; + /** (Optional) Kms key which will be used if encryption is enabled and encryption type is set to `sse-kms`. */ + kmsKey?: string | undefined; /** - * Edit mode of the job. + * (Optional) Set canned access control list for the logs, e.g. `bucket-owner-full-control`. + * If `canned_cal` is set, please make sure the cluster iam role has `s3:PutObjectAcl` permission on + * the destination bucket and prefix. The full list of possible canned acl can be found at + * http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl. + * Please also note that by default only the object owner gets full controls. If you are using cross account + * role for writing data, you may want to set `bucket-owner-full-control` to make bucket owner able to + * read the logs. + */ + cannedAcl?: string | undefined; +} + +export interface CreateSparkJarTask { + /** + * Deprecated since 04/2016. For classic compute, provide a `jar` through the `libraries` field instead. For serverless compute, provide a `jar` though the `java_dependencies` field inside the `environments` list. * - * * `UI_LOCKED`: The job is in a locked UI state and cannot be modified. - * * `EDITABLE`: The job is in an editable state and can be modified. + * See the examples of classic and serverless compute usage at the top of the page. */ - editMode?: JobEditMode | undefined; - /** Deployment information for jobs managed by external sources. */ - deployment?: JobDeployment | undefined; + jarUri?: string | undefined; /** - * A list of task execution environment specifications that can be referenced by serverless tasks of this job. - * For serverless notebook tasks, if the environment_key is not specified, the notebook environment will be used if present. If a jobs environment is specified, it will override the notebook environment. - * For other serverless tasks, the task environment is required to be specified using environment_key in the task settings. + * The full name of the class containing the main method to be executed. This class must be contained in a JAR provided as a library. + * + * The code must use `SparkContext.getOrCreate` to obtain a Spark context; otherwise, runs of the job fail. */ - environments?: JobEnvironment[] | undefined; + mainClassName?: string | undefined; /** - * The id of the user specified budget policy to use for this job. - * If not specified, a default budget policy may be applied when creating or modifying the job. - * See `effective_budget_policy_id` for the budget policy used by this workload. + * Parameters passed to the main method. + * + * Use [Task parameter variables](/jobs.html#parameter-variables) to set parameters containing information about job runs. */ - budgetPolicyId?: string | undefined; + parameters?: string[] | undefined; + /** Deprecated. A value of `false` is no longer supported. */ + runAsRepl?: boolean | undefined; +} + +export interface CreateSparkPythonTask { + /** The Python file to be executed. Cloud file URIs (such as dbfs:/, s3:/, adls:/, gcs:/) and workspace paths are supported. For python files stored in the workspace, the path must be absolute and begin with `/`. For files stored in a remote repository, the path must be relative. This field is required. */ + pythonFile: string; /** - * The id of the user specified usage policy to use for this job. - * If not specified, a default usage policy may be applied when creating or modifying the job. - * See `effective_usage_policy_id` for the usage policy used by this workload. + * Command line parameters passed to the Python file. + * + * Use [Task parameter variables](/jobs.html#parameter-variables) to set parameters containing information about job runs. */ - usagePolicyId?: string | undefined; + parameters?: string[] | undefined; + /** + * Optional location type of the Python file. When set to `WORKSPACE` or not specified, the file will be retrieved from the local + * workspace or cloud location (if the `python_file` has a URI format). When set to `GIT`, + * the Python file will be retrieved from a Git repository defined in `git_source`. + * + * * `WORKSPACE`: The Python file is located in a workspace or at a cloud filesystem URI. + * * `GIT`: The Python file is located in a remote Git repository. + */ + source?: Source | undefined; +} + +export interface CreateSparkSubmitTask { + /** + * Command-line parameters passed to spark submit. + * + * Use [Task parameter variables](/jobs.html#parameter-variables) to set parameters containing information about job runs. + */ + parameters?: string[] | undefined; +} + +export interface CreateSparseCheckout { + /** List of patterns to include for sparse checkout. */ + patterns?: string[] | undefined; +} + +export interface CreateSqlTask { + /** Parameters to be used for each run of this job. The SQL alert task does not support custom parameters. */ + parameters?: Record | undefined; + sqlTaskType?: + | { + $case: 'query'; + /** If query, indicates that this job must execute a SQL query. */ + query: CreateSqlTaskQuery; + } + | { + $case: 'dashboard'; + /** If dashboard, indicates that this job must refresh a SQL dashboard. */ + dashboard: CreateSqlTaskDashboard; + } + | { + $case: 'alert'; + /** If alert, indicates that this job must refresh a SQL alert. */ + alert: CreateSqlTaskAlert; + } + | { + $case: 'file'; + /** If file, indicates that this job runs a SQL file in a remote Git repository. */ + file: CreateSqlTaskFile; + } + | undefined; + /** The canonical identifier of the SQL warehouse. Recommended to use with serverless or pro SQL warehouses. Classic SQL warehouses are only supported for SQL alert, dashboard and query tasks and are limited to scheduled single-task jobs. */ + warehouseId: string; +} + +export interface CreateSqlTaskAlert { + /** The canonical identifier of the SQL alert. */ + alertId: string; + /** If specified, alert notifications are sent to subscribers. */ + subscriptions?: CreateSqlTaskSubscription[] | undefined; + /** If true, the alert notifications are not sent to subscribers. */ + pauseSubscriptions?: boolean | undefined; +} + +export interface CreateSqlTaskDashboard { + /** The canonical identifier of the SQL dashboard. */ + dashboardId: string; + /** If specified, dashboard snapshots are sent to subscriptions. */ + subscriptions?: CreateSqlTaskSubscription[] | undefined; + /** Subject of the email sent to subscribers of this task. */ + customSubject?: string | undefined; + /** If true, the dashboard snapshot is not taken, and emails are not sent to subscribers. */ + pauseSubscriptions?: boolean | undefined; +} + +export interface CreateSqlTaskFile { + /** Path of the SQL file. Must be relative if the source is a remote Git repository and absolute for workspace paths. */ + path: string; + /** + * Optional location type of the SQL file. When set to `WORKSPACE`, the SQL file will be retrieved + * from the local workspace. When set to `GIT`, the SQL file will be retrieved from a Git repository + * defined in `git_source`. If the value is empty, the task will use `GIT` if `git_source` is defined and `WORKSPACE` otherwise. + * + * * `WORKSPACE`: SQL file is located in workspace. + * * `GIT`: SQL file is located in cloud Git provider. + */ + source?: Source | undefined; +} + +export interface CreateSqlTaskQuery { + queryType?: + | { + $case: 'queryId'; + /** The canonical identifier of the SQL query. */ + queryId: string; + } + | undefined; +} + +export interface CreateSqlTaskSubscription { + subscriptionType?: + | { + $case: 'userName'; + /** The user name to receive the subscription email. This parameter is mutually exclusive with destination_id. You cannot set both destination_id and user_name for subscription notifications. */ + userName: string; + } + | { + $case: 'destinationId'; + /** The canonical identifier of the destination to receive email notification. This parameter is mutually exclusive with user_name. You cannot set both destination_id and user_name for subscription notifications. */ + destinationId: string; + } + | undefined; +} + +export interface CreateSubscription { + /** The list of subscribers to send the snapshot of the dashboard to. */ + subscribers?: Subscription_CreateSubscriber[] | undefined; + /** When true, the subscription will not send emails. */ + paused?: boolean | undefined; + /** + * Optional: Allows users to specify a custom subject line on the email sent + * to subscribers. + */ + customSubject?: string | undefined; +} + +export interface CreateTableTriggerConfiguration { + /** A list of tables to monitor for changes. The table name must be in the format `catalog_name.schema_name.table_name`. */ + tableNames: string[]; + /** + * If set, the trigger starts a run only after the specified amount of time has passed since + * the last time the trigger fired. The minimum allowed value is 60 seconds. + */ + minTimeBetweenTriggersSeconds?: number | undefined; + /** + * If set, the trigger starts a run only after no table updates have occurred for the specified time + * and can be used to wait for a series of table updates before triggering a run. The + * minimum allowed value is 60 seconds. + */ + waitAfterLastChangeSeconds?: number | undefined; + /** The table(s) condition based on which to trigger a job run. */ + condition?: TableTriggerConfiguration_Condition | undefined; +} + +export interface CreateTaskDependency { + /** The name of the task this task depends on. */ + taskKey: string; + /** Can only be specified on condition task dependencies. The outcome of the dependent task that must be met for this task to run. */ + outcome?: string | undefined; +} + +export interface CreateTaskSettings { + /** + * A unique name for the task. This field is used to refer to this task from other tasks. + * This field is required and must be unique within its parent job. + * On Update or Reset, this field is used to reference the tasks to be updated or reset. + */ + taskKey: string; + /** + * An optional array of objects specifying the dependency graph of the task. All tasks specified in this field must complete before executing this task. The task will run only if the `run_if` condition is true. + * The key is `task_key`, and the value is the name assigned to the dependent task. + */ + dependsOn?: CreateTaskDependency[] | undefined; + /** + * An optional value specifying the condition determining whether the task is run once its dependencies have been completed. + * + * * `ALL_SUCCESS`: All dependencies have executed and succeeded + * * `AT_LEAST_ONE_SUCCESS`: At least one dependency has succeeded + * * `NONE_FAILED`: None of the dependencies have failed and at least one was executed + * * `ALL_DONE`: All dependencies have been completed + * * `AT_LEAST_ONE_FAILED`: At least one dependency failed + * * `ALL_FAILED`: ALl dependencies have failed + */ + runIf?: TaskDependencyType | undefined; + /** An optional timeout applied to each run of this job task. A value of `0` means no timeout. */ + timeoutSeconds?: number | undefined; + health?: CreateJobsHealthRules | undefined; + /** An optional set of email addresses that is notified when runs of this task begin or complete as well as when this task is deleted. The default behavior is to not send any emails. */ + emailNotifications?: CreateJobEmailNotifications | undefined; + /** Optional notification settings that are used when sending notifications to each of the `email_notifications` and `webhook_notifications` for this task. */ + notificationSettings?: CreateNotificationSettings | undefined; + /** A collection of system notification IDs to notify when runs of this task begin or complete. The default behavior is to not send any system notifications. */ + webhookNotifications?: CreateWebhookNotifications | undefined; + /** An optional description for this task. */ + description?: string | undefined; + environmentRef?: + | { + $case: 'environmentKey'; + /** The key that references an environment spec in a job. This field is required for Python script, Python wheel and dbt tasks when using serverless compute. */ + environmentKey: string; + } + | undefined; + /** An optional flag to disable the task. If set to true, the task will not run even if it is part of a job. */ + disabled?: boolean | undefined; + /** Task level compute configuration. */ + compute?: CreateCompute | undefined; + /** DO NOT ADD ANY NEW FIELDS TO JobTask OUTSIDE OF THIS ONEOF as it will break the TaskRegistry */ + task?: + | { + $case: 'notebookTask'; + /** The task runs a notebook when the `notebook_task` field is present. */ + notebookTask: CreateNotebookTask; + } + | { + $case: 'sparkJarTask'; + /** The task runs a JAR when the `spark_jar_task` field is present. */ + sparkJarTask: CreateSparkJarTask; + } + | { + $case: 'sparkPythonTask'; + /** The task runs a Python file when the `spark_python_task` field is present. */ + sparkPythonTask: CreateSparkPythonTask; + } + | { + $case: 'sparkSubmitTask'; + /** (Legacy) The task runs the spark-submit script when the spark_submit_task field is present. Databricks recommends using the spark_jar_task instead; see [Spark Submit task for jobs](/jobs/spark-submit). */ + sparkSubmitTask: CreateSparkSubmitTask; + } + | { + $case: 'pipelineTask'; + /** The task triggers a pipeline update when the `pipeline_task` field is present. Only pipelines configured to use triggered more are supported. */ + pipelineTask: CreatePipelineTask; + } + | { + $case: 'pythonWheelTask'; + /** The task runs a Python wheel when the `python_wheel_task` field is present. */ + pythonWheelTask: CreatePythonWheelTask; + } + | { + $case: 'dbtTask'; + /** The task runs one or more dbt commands when the `dbt_task` field is present. The dbt task requires both Databricks SQL and the ability to use a serverless or a pro SQL warehouse. */ + dbtTask: CreateDbtTask; + } + | { + $case: 'sqlTask'; + /** The task runs a SQL query or file, or it refreshes a SQL alert or a legacy SQL dashboard when the `sql_task` field is present. */ + sqlTask: CreateSqlTask; + } + | { + $case: 'runJobTask'; + /** The task triggers another job when the `run_job_task` field is present. */ + runJobTask: CreateRunJobTask; + } + | { + $case: 'conditionTask'; + /** + * The task evaluates a condition that can be used to control the execution of other tasks when the `condition_task` field is present. + * The condition task does not require a cluster to execute and does not support retries or notifications. + */ + conditionTask: CreateConditionTask; + } + | { + $case: 'forEachTask'; + /** The task executes a nested task for every input provided when the `for_each_task` field is present. */ + forEachTask: CreateForEachTask; + } + | { + $case: 'cleanRoomsNotebookTask'; + /** + * The task runs a [clean rooms](/clean-rooms/index.html) notebook + * when the `clean_rooms_notebook_task` field is present. + */ + cleanRoomsNotebookTask: CreateCleanRoomsNotebookTask; + } + | {$case: 'genAiComputeTask'; genAiComputeTask: CreateGenAiComputeTask} + | { + $case: 'alertTask'; + /** + * The task evaluates a alert and sends notifications to subscribers + * when the `alert_task` field is present. + */ + alertTask: CreateAlertTask; + } + | { + $case: 'powerBiTask'; + /** The task triggers a Power BI semantic model update when the `power_bi_task` field is present. */ + powerBiTask: CreatePowerBiTask; + } + | { + $case: 'dashboardTask'; + /** The task refreshes a dashboard and sends a snapshot to subscribers. */ + dashboardTask: CreateDashboardTask; + } + | { + $case: 'dbtCloudTask'; + /** Task type for dbt cloud, deprecated in favor of the new name dbt_platform_task */ + dbtCloudTask: CreateDbtCloudTask; + } + | {$case: 'dbtPlatformTask'; dbtPlatformTask: CreateDbtPlatformTask} + | { + $case: 'pythonOperatorTask'; + /** The task runs a Python operator task. */ + pythonOperatorTask: CreatePythonOperatorTask; + } + | { + $case: 'aiRuntimeTask'; + /** + * The task runs a multi-node GPU compute workload on Databricks AI Runtime. + * External-facing surface; mirrors the AIR CLI (fka SGCLI) v2 YAML schema. + */ + aiRuntimeTask: CreateAiRuntimeTask; + } + | undefined; + spec?: + | { + $case: 'existingClusterId'; + /** + * If existing_cluster_id, the ID of an existing cluster that is used for all runs. + * When running jobs or tasks on an existing cluster, you may need to manually restart + * the cluster if it stops responding. We suggest running jobs and tasks on new clusters for + * greater reliability + */ + existingClusterId: string; + } + | { + $case: 'newCluster'; + /** If new_cluster, a description of a new cluster that is created for each run. */ + newCluster: ClusterSpec_CreateNewCluster; + } + | { + $case: 'jobClusterKey'; + /** If job_cluster_key, this task is executed reusing the cluster specified in `job.settings.job_clusters`. */ + jobClusterKey: string; + } + | undefined; /** - * The performance mode on a serverless job. This field determines the level of compute performance or cost-efficiency for the run. - * The performance target does not apply to tasks that run on Serverless GPU compute. - * - * * `STANDARD`: Enables cost-efficient execution of serverless workloads. - * * `PERFORMANCE_OPTIMIZED`: Prioritizes fast startup and execution times through rapid scaling and optimized cluster performance. + * An optional list of libraries to be installed on the cluster. + * The default value is an empty list. */ - performanceTarget?: PerformanceTarget_PerformanceTarget | undefined; + libraries?: CreateLibrary[] | undefined; /** An optional maximum number of times to retry an unsuccessful run. A run is considered to be unsuccessful if it completes with the `FAILED` result_state or `INTERNAL_ERROR` `life_cycle_state`. The value `-1` means to retry indefinitely and the value `0` means to never retry. */ maxRetries?: number | undefined; /** An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried. */ @@ -1761,10 +3892,66 @@ export interface CreateJobRequest { disableAutoOptimization?: boolean | undefined; } -/** Job was created successfully */ -export interface CreateJobResponse { - /** The canonical identifier for the newly created job. */ - jobId?: bigint | undefined; +export interface CreateTriggerSettings { + /** Whether this trigger is paused or not. */ + pauseStatus?: SchedulePauseStatus | undefined; + configuration?: + | { + $case: 'fileArrival'; + /** File arrival trigger settings. */ + fileArrival: CreateFileArrivalTriggerConfiguration; + } + | { + $case: 'periodic'; + /** Periodic trigger settings. */ + periodic: CreatePeriodicTriggerConfiguration; + } + | {$case: 'tableUpdate'; tableUpdate: CreateTableTriggerConfiguration} + | {$case: 'model'; model: CreateModelTriggerConfiguration} + | undefined; +} + +/** A storage location back by UC Volumes. */ +export interface CreateVolumesStorageInfo { + /** + * UC Volumes destination, e.g. `/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` + * or `dbfs:/Volumes/catalog/schema/vol1/init-scripts/setup-datadog.sh` + */ + destination: string; +} + +export interface CreateWebhook { + id: string; +} + +export interface CreateWebhookNotifications { + /** An optional list of system notification IDs to call when the run starts. A maximum of 3 destinations can be specified for the `on_start` property. */ + onStart?: CreateWebhook[] | undefined; + /** An optional list of system notification IDs to call when the run completes successfully. A maximum of 3 destinations can be specified for the `on_success` property. */ + onSuccess?: CreateWebhook[] | undefined; + /** An optional list of system notification IDs to call when the run fails. A maximum of 3 destinations can be specified for the `on_failure` property. */ + onFailure?: CreateWebhook[] | undefined; + /** An optional list of system notification IDs to call when the duration of a run exceeds the threshold specified for the `RUN_DURATION_SECONDS` metric in the `health` field. A maximum of 3 destinations can be specified for the `on_duration_warning_threshold_exceeded` property. */ + onDurationWarningThresholdExceeded?: CreateWebhook[] | undefined; + /** + * An optional list of system notification IDs to call when any streaming backlog thresholds are exceeded for any stream. + * Streaming backlog thresholds can be set in the `health` field using the following metrics: `STREAMING_BACKLOG_BYTES`, `STREAMING_BACKLOG_RECORDS`, `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`. + * Alerting is based on the 10-minute average of these metrics. If the issue persists, notifications are resent every 30 minutes. + * A maximum of 3 destinations can be specified for the `on_streaming_backlog_exceeded` property. + */ + onStreamingBacklogExceeded?: CreateWebhook[] | undefined; +} + +/** Cluster Attributes showing for clusters workload types. */ +export interface CreateWorkloadType { + /** defined what type of clients can use the cluster. E.g. Notebooks, Jobs */ + clients: WorkloadType_CreateClientsTypes; +} + +/** A storage location in Workspace Filesystem (WSFS) */ +export interface CreateWorkspaceStorageInfo { + /** wsfs destination, e.g. `workspace:/cluster-init-scripts/setup-datadog.sh` */ + destination: string; } export interface CronSchedule { @@ -3256,6 +5443,12 @@ export interface PythonOperatorTask { main?: string | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface PythonOperatorTask_CreateParameter { + name?: string | undefined; + value?: string | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface PythonOperatorTask_Parameter { name?: string | undefined; @@ -3354,7 +5547,7 @@ export interface RepairRunRequest { */ performanceTarget?: PerformanceTarget_PerformanceTarget | undefined; /** Controls whether the pipeline should perform a full refresh */ - pipelineParams?: PipelineParameters | undefined; + pipelineParams?: CreatePipelineParameters | undefined; /** * A list of parameters for jobs with Spark JAR tasks, for example `"jar_params": ["john doe", "35"]`. * The parameters are used to invoke the main function of the main class specified in the Spark JAR task. @@ -3435,7 +5628,7 @@ export interface ResetJobRequest { * * Changes to the field `JobBaseSettings.timeout_seconds` are applied to active runs. Changes to other fields are applied to future runs only. */ - newSettings?: JobSettings | undefined; + newSettings?: CreateJobSettings | undefined; } /** Job was overwritten successfully. */ @@ -3762,7 +5955,7 @@ export interface RunNowRequest { */ idempotencyToken?: string | undefined; /** The queue settings of the run. */ - queue?: QueueSettings | undefined; + queue?: CreateQueueSettings | undefined; /** A list of task keys to run inside of the job. If this field is not provided, all tasks in the job will be run. */ only?: string[] | undefined; /** @@ -3773,7 +5966,7 @@ export interface RunNowRequest { */ performanceTarget?: PerformanceTarget_PerformanceTarget | undefined; /** Controls whether the pipeline should perform a full refresh */ - pipelineParams?: PipelineParameters | undefined; + pipelineParams?: CreatePipelineParameters | undefined; /** * A list of parameters for jobs with Spark JAR tasks, for example `"jar_params": ["john doe", "35"]`. * The parameters are used to invoke the main function of the main class specified in the Spark JAR task. @@ -3999,8 +6192,6 @@ export interface RunTask { | undefined; /** An optional flag to disable the task. If set to true, the task will not run even if it is part of a job. */ disabled?: boolean | undefined; - /** Task level compute configuration. */ - compute?: Compute | undefined; /** DO NOT ADD ANY NEW FIELDS TO JobTask OUTSIDE OF THIS ONEOF as it will break the TaskRegistry */ task?: | { @@ -4625,16 +6816,16 @@ export interface SqlTaskSubscription { export interface SubmitRunRequest { /** List of permissions to set on the job. */ - accessControlList?: AccessControlRequest[] | undefined; + accessControlList?: CreateAccessControlRequest[] | undefined; /** The queue settings of the one-time run. */ - queue?: QueueSettings | undefined; + queue?: CreateQueueSettings | undefined; /** Specifies the user or service principal that the job runs as. If not specified, the job runs as the user who submits the request. */ - runAs?: JobRunAs | undefined; + runAs?: CreateJobRunAs | undefined; /** An optional name for the run. The default value is `Untitled`. */ runName?: string | undefined; /** An optional timeout applied to each run of this job. A value of `0` means no timeout. */ timeoutSeconds?: number | undefined; - health?: JobsHealthRules | undefined; + health?: CreateJobsHealthRules | undefined; /** * An optional token that can be used to guarantee the idempotency of job run requests. If a run with the provided token already exists, * the request does not create a new run but returns the ID of the existing run instead. If a run with the provided token is deleted, @@ -4648,7 +6839,7 @@ export interface SubmitRunRequest { * For more information, see [How to ensure idempotency for jobs](https://kb.databricks.com/jobs/jobs-idempotency.html). */ idempotencyToken?: string | undefined; - tasks?: RunTaskSettings[] | undefined; + tasks?: CreateRunTaskSettings[] | undefined; /** * An optional specification for a remote Git repository containing the source code used by tasks. Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks. * @@ -4656,15 +6847,15 @@ export interface SubmitRunRequest { * * Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks are used, `git_source` must be defined on the job. */ - gitSource?: GitSource | undefined; + gitSource?: CreateGitSource | undefined; /** A collection of system notification IDs to notify when the run begins or completes. */ - webhookNotifications?: WebhookNotifications | undefined; + webhookNotifications?: CreateWebhookNotifications | undefined; /** An optional set of email addresses notified when the run begins or completes. */ - emailNotifications?: JobEmailNotifications | undefined; + emailNotifications?: CreateJobEmailNotifications | undefined; /** Optional notification settings that are used when sending notifications to each of the `email_notifications` and `webhook_notifications` for this run. */ - notificationSettings?: NotificationSettings | undefined; + notificationSettings?: CreateNotificationSettings | undefined; /** A list of task execution environment specifications that can be referenced by tasks of this run. */ - environments?: JobEnvironment[] | undefined; + environments?: CreateJobEnvironment[] | undefined; /** * The user specified id of the budget policy to use for this one-time run. * If not specified, the run will be not be attributed to any budget policy. @@ -4695,6 +6886,22 @@ export interface Subscription { customSubject?: string | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface Subscription_CreateSubscriber { + subscriptionType?: + | { + $case: 'userName'; + /** A snapshot of the dashboard will be sent to the user's email when the `user_name` field is present. */ + userName: string; + } + | { + $case: 'destinationId'; + /** A snapshot of the dashboard will be sent to the destination when the `destination_id` field is present. */ + destinationId: string; + } + | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface Subscription_Subscriber { subscriptionType?: @@ -4996,7 +7203,7 @@ export interface UpdateJobRequest { * * Changes to the field `JobSettings.timeout_seconds` are applied to active runs. Changes to other fields are applied to future runs only. */ - newSettings?: JobSettings | undefined; + newSettings?: CreateJobSettings | undefined; /** Remove top-level fields in the job settings. Removing nested fields is not supported, except for tasks and job clusters (`tasks/task_1`). This field is optional. */ fieldsToRemove?: string[] | undefined; } @@ -5063,6 +7270,14 @@ export interface WorkloadType_ClientsTypes { jobs?: boolean | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface WorkloadType_CreateClientsTypes { + /** With notebooks set, this cluster can be used for notebooks */ + notebooks?: boolean | undefined; + /** With jobs set, the cluster can be used for jobs */ + jobs?: boolean | undefined; +} + /** A storage location in Workspace Filesystem (WSFS) */ export interface WorkspaceStorageInfo { /** wsfs destination, e.g. `workspace:/cluster-init-scripts/setup-datadog.sh` */ @@ -5100,10 +7315,12 @@ export const unmarshalAiRuntimeTaskOutputSchema: z.ZodType .object({ mlflow_experiment_id: z.string().optional(), mlflow_run_id: z.string().optional(), + status_message: z.string().optional(), }) .transform(d => ({ mlflowExperimentId: d.mlflow_experiment_id, mlflowRunId: d.mlflow_run_id, + statusMessage: d.status_message, })); export const unmarshalAlertTaskSchema: z.ZodType = z @@ -7372,7 +9589,6 @@ export const unmarshalRunTaskSchema: z.ZodType = z .optional(), environment_key: z.string().optional(), disabled: z.boolean().optional(), - compute: z.lazy(() => unmarshalComputeSchema).optional(), notebook_task: z.lazy(() => unmarshalNotebookTaskSchema).optional(), spark_jar_task: z.lazy(() => unmarshalSparkJarTaskSchema).optional(), spark_python_task: z.lazy(() => unmarshalSparkPythonTaskSchema).optional(), @@ -7460,7 +9676,6 @@ export const unmarshalRunTaskSchema: z.ZodType = z ? {$case: 'environmentKey' as const, environmentKey: d.environment_key} : undefined, disabled: d.disabled, - compute: d.compute, task: d.notebook_task !== undefined ? {$case: 'notebookTask' as const, notebookTask: d.notebook_task} @@ -8277,31 +10492,139 @@ export const unmarshalWorkloadTypeSchema: z.ZodType = z clients: z.lazy(() => unmarshalWorkloadType_ClientsTypesSchema).optional(), }) .transform(d => ({ - clients: d.clients, + clients: d.clients, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const unmarshalWorkloadType_ClientsTypesSchema: z.ZodType = + z + .object({ + notebooks: z.boolean().optional(), + jobs: z.boolean().optional(), + }) + .transform(d => ({ + notebooks: d.notebooks, + jobs: d.jobs, + })); + +export const unmarshalWorkspaceStorageInfoSchema: z.ZodType = + z + .object({ + destination: z.string().optional(), + }) + .transform(d => ({ + destination: d.destination, + })); + +export const marshalCancelAllRunsRequestSchema: z.ZodType = z + .object({ + jobId: z.bigint().optional(), + allQueuedRuns: z.boolean().optional(), + }) + .transform(d => ({ + job_id: d.jobId, + all_queued_runs: d.allQueuedRuns, + })); + +export const marshalCancelRunRequestSchema: z.ZodType = z + .object({ + runId: z.bigint().optional(), + }) + .transform(d => ({ + run_id: d.runId, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalClusterSpec_CreateNewClusterSchema: z.ZodType = z + .object({ + applyPolicyDefaultValues: z.boolean().optional(), + clusterName: z.string().optional(), + sparkVersion: z.string().optional(), + sparkConf: z.record(z.string(), z.string()).optional(), + awsAttributes: z.lazy(() => marshalCreateAwsAttributesSchema).optional(), + azureAttributes: z + .lazy(() => marshalCreateAzureAttributesSchema) + .optional(), + gcpAttributes: z.lazy(() => marshalCreateGcpAttributesSchema).optional(), + nodeTypeId: z.string().optional(), + driverNodeTypeId: z.string().optional(), + workerNodeTypeFlexibility: z + .lazy(() => marshalCreateNodeTypeFlexibilitySchema) + .optional(), + driverNodeTypeFlexibility: z + .lazy(() => marshalCreateNodeTypeFlexibilitySchema) + .optional(), + sshPublicKeys: z.array(z.string()).optional(), + customTags: z.record(z.string(), z.string()).optional(), + clusterLogConf: z.lazy(() => marshalCreateClusterLogConfSchema).optional(), + sparkEnvVars: z.record(z.string(), z.string()).optional(), + autoterminationMinutes: z.number().optional(), + enableElasticDisk: z.boolean().optional(), + initScripts: z + .array(z.lazy(() => marshalCreateInitScriptInfoSchema)) + .optional(), + dockerImage: z.lazy(() => marshalCreateDockerImageSchema).optional(), + instancePoolId: z.string().optional(), + singleUserName: z.string().optional(), + policyId: z.string().optional(), + enableLocalDiskEncryption: z.boolean().optional(), + driverInstancePoolId: z.string().optional(), + workloadType: z.lazy(() => marshalCreateWorkloadTypeSchema).optional(), + dataSecurityMode: z.string().optional(), + runtimeEngine: z.string().optional(), + kind: z.string().optional(), + useMlRuntime: z.boolean().optional(), + isSingleNode: z.boolean().optional(), + remoteDiskThroughput: z.number().optional(), + totalInitialRemoteDiskSize: z.number().optional(), + size: z + .discriminatedUnion('$case', [ + z.object({$case: z.literal('numWorkers'), numWorkers: z.number()}), + z.object({ + $case: z.literal('autoscale'), + autoscale: z.lazy(() => marshalCreateAutoScaleSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + apply_policy_default_values: d.applyPolicyDefaultValues, + cluster_name: d.clusterName, + spark_version: d.sparkVersion, + spark_conf: d.sparkConf, + aws_attributes: d.awsAttributes, + azure_attributes: d.azureAttributes, + gcp_attributes: d.gcpAttributes, + node_type_id: d.nodeTypeId, + driver_node_type_id: d.driverNodeTypeId, + worker_node_type_flexibility: d.workerNodeTypeFlexibility, + driver_node_type_flexibility: d.driverNodeTypeFlexibility, + ssh_public_keys: d.sshPublicKeys, + custom_tags: d.customTags, + cluster_log_conf: d.clusterLogConf, + spark_env_vars: d.sparkEnvVars, + autotermination_minutes: d.autoterminationMinutes, + enable_elastic_disk: d.enableElasticDisk, + init_scripts: d.initScripts, + docker_image: d.dockerImage, + instance_pool_id: d.instancePoolId, + single_user_name: d.singleUserName, + policy_id: d.policyId, + enable_local_disk_encryption: d.enableLocalDiskEncryption, + driver_instance_pool_id: d.driverInstancePoolId, + workload_type: d.workloadType, + data_security_mode: d.dataSecurityMode, + runtime_engine: d.runtimeEngine, + kind: d.kind, + use_ml_runtime: d.useMlRuntime, + is_single_node: d.isSingleNode, + remote_disk_throughput: d.remoteDiskThroughput, + total_initial_remote_disk_size: d.totalInitialRemoteDiskSize, + ...(d.size?.$case === 'numWorkers' && {num_workers: d.size.numWorkers}), + ...(d.size?.$case === 'autoscale' && {autoscale: d.size.autoscale}), })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const unmarshalWorkloadType_ClientsTypesSchema: z.ZodType = - z - .object({ - notebooks: z.boolean().optional(), - jobs: z.boolean().optional(), - }) - .transform(d => ({ - notebooks: d.notebooks, - jobs: d.jobs, - })); - -export const unmarshalWorkspaceStorageInfoSchema: z.ZodType = - z - .object({ - destination: z.string().optional(), - }) - .transform(d => ({ - destination: d.destination, - })); - -export const marshalAccessControlRequestSchema: z.ZodType = z +export const marshalCreateAccessControlRequestSchema: z.ZodType = z .object({ principalName: z .discriminatedUnion('$case', [ @@ -8328,18 +10651,18 @@ export const marshalAccessControlRequestSchema: z.ZodType = z permission_level: d.permissionLevel, })); -export const marshalAdlsgen2InfoSchema: z.ZodType = z +export const marshalCreateAdlsgen2InfoSchema: z.ZodType = z .object({ - destination: z.string().optional(), + destination: z.string(), }) .transform(d => ({ destination: d.destination, })); -export const marshalAiRuntimeTaskSchema: z.ZodType = z +export const marshalCreateAiRuntimeTaskSchema: z.ZodType = z .object({ - experiment: z.string().optional(), - deployments: z.array(z.lazy(() => marshalDeploymentSpecSchema)).optional(), + experiment: z.string(), + deployments: z.array(z.lazy(() => marshalCreateDeploymentSpecSchema)), codeSourcePath: z.string().optional(), mlflowRun: z.string().optional(), mlflowExperimentDirectory: z.string().optional(), @@ -8352,13 +10675,13 @@ export const marshalAiRuntimeTaskSchema: z.ZodType = z mlflow_experiment_directory: d.mlflowExperimentDirectory, })); -export const marshalAlertTaskSchema: z.ZodType = z +export const marshalCreateAlertTaskSchema: z.ZodType = z .object({ alertId: z.string().optional(), warehouseId: z.string().optional(), workspacePath: z.string().optional(), subscribers: z - .array(z.lazy(() => marshalAlertTaskSubscriberSchema)) + .array(z.lazy(() => marshalCreateAlertTaskSubscriberSchema)) .optional(), }) .transform(d => ({ @@ -8368,7 +10691,7 @@ export const marshalAlertTaskSchema: z.ZodType = z subscribers: d.subscribers, })); -export const marshalAlertTaskSubscriberSchema: z.ZodType = z +export const marshalCreateAlertTaskSubscriberSchema: z.ZodType = z .object({ subscriberType: z .discriminatedUnion('$case', [ @@ -8389,7 +10712,7 @@ export const marshalAlertTaskSubscriberSchema: z.ZodType = z }), })); -export const marshalAutoScaleSchema: z.ZodType = z +export const marshalCreateAutoScaleSchema: z.ZodType = z .object({ minWorkers: z.number().optional(), maxWorkers: z.number().optional(), @@ -8399,7 +10722,7 @@ export const marshalAutoScaleSchema: z.ZodType = z max_workers: d.maxWorkers, })); -export const marshalAwsAttributesSchema: z.ZodType = z +export const marshalCreateAwsAttributesSchema: z.ZodType = z .object({ firstOnDemand: z.number().optional(), availability: z.string().optional(), @@ -8425,9 +10748,11 @@ export const marshalAwsAttributesSchema: z.ZodType = z ebs_volume_throughput: d.ebsVolumeThroughput, })); -export const marshalAzureAttributesSchema: z.ZodType = z +export const marshalCreateAzureAttributesSchema: z.ZodType = z .object({ - logAnalyticsInfo: z.lazy(() => marshalLogAnalyticsInfoSchema).optional(), + logAnalyticsInfo: z + .lazy(() => marshalCreateLogAnalyticsInfoSchema) + .optional(), firstOnDemand: z.number().optional(), availability: z.string().optional(), spotBidMaxPrice: z.number().optional(), @@ -8441,28 +10766,10 @@ export const marshalAzureAttributesSchema: z.ZodType = z capacity_reservation_group: d.capacityReservationGroup, })); -export const marshalCancelAllRunsRequestSchema: z.ZodType = z - .object({ - jobId: z.bigint().optional(), - allQueuedRuns: z.boolean().optional(), - }) - .transform(d => ({ - job_id: d.jobId, - all_queued_runs: d.allQueuedRuns, - })); - -export const marshalCancelRunRequestSchema: z.ZodType = z - .object({ - runId: z.bigint().optional(), - }) - .transform(d => ({ - run_id: d.runId, - })); - -export const marshalCleanRoomsNotebookTaskSchema: z.ZodType = z +export const marshalCreateCleanRoomsNotebookTaskSchema: z.ZodType = z .object({ - cleanRoomName: z.string().optional(), - notebookName: z.string().optional(), + cleanRoomName: z.string(), + notebookName: z.string(), etag: z.string().optional(), notebookBaseParameters: z.record(z.string(), z.string()).optional(), }) @@ -8473,21 +10780,21 @@ export const marshalCleanRoomsNotebookTaskSchema: z.ZodType = z notebook_base_parameters: d.notebookBaseParameters, })); -export const marshalClusterLogConfSchema: z.ZodType = z +export const marshalCreateClusterLogConfSchema: z.ZodType = z .object({ storageInfo: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('dbfs'), - dbfs: z.lazy(() => marshalDbfsStorageInfoSchema), + dbfs: z.lazy(() => marshalCreateDbfsStorageInfoSchema), }), z.object({ $case: z.literal('s3'), - s3: z.lazy(() => marshalS3StorageInfoSchema), + s3: z.lazy(() => marshalCreateS3StorageInfoSchema), }), z.object({ $case: z.literal('volumes'), - volumes: z.lazy(() => marshalVolumesStorageInfoSchema), + volumes: z.lazy(() => marshalCreateVolumesStorageInfoSchema), }), ]) .optional(), @@ -8498,93 +10805,7 @@ export const marshalClusterLogConfSchema: z.ZodType = z ...(d.storageInfo?.$case === 'volumes' && {volumes: d.storageInfo.volumes}), })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalClusterSpec_NewClusterSchema: z.ZodType = z - .object({ - applyPolicyDefaultValues: z.boolean().optional(), - clusterName: z.string().optional(), - sparkVersion: z.string().optional(), - sparkConf: z.record(z.string(), z.string()).optional(), - awsAttributes: z.lazy(() => marshalAwsAttributesSchema).optional(), - azureAttributes: z.lazy(() => marshalAzureAttributesSchema).optional(), - gcpAttributes: z.lazy(() => marshalGcpAttributesSchema).optional(), - nodeTypeId: z.string().optional(), - driverNodeTypeId: z.string().optional(), - workerNodeTypeFlexibility: z - .lazy(() => marshalNodeTypeFlexibilitySchema) - .optional(), - driverNodeTypeFlexibility: z - .lazy(() => marshalNodeTypeFlexibilitySchema) - .optional(), - sshPublicKeys: z.array(z.string()).optional(), - customTags: z.record(z.string(), z.string()).optional(), - clusterLogConf: z.lazy(() => marshalClusterLogConfSchema).optional(), - sparkEnvVars: z.record(z.string(), z.string()).optional(), - autoterminationMinutes: z.number().optional(), - enableElasticDisk: z.boolean().optional(), - initScripts: z.array(z.lazy(() => marshalInitScriptInfoSchema)).optional(), - dockerImage: z.lazy(() => marshalDockerImageSchema).optional(), - instancePoolId: z.string().optional(), - singleUserName: z.string().optional(), - policyId: z.string().optional(), - enableLocalDiskEncryption: z.boolean().optional(), - driverInstancePoolId: z.string().optional(), - workloadType: z.lazy(() => marshalWorkloadTypeSchema).optional(), - dataSecurityMode: z.string().optional(), - runtimeEngine: z.string().optional(), - kind: z.string().optional(), - useMlRuntime: z.boolean().optional(), - isSingleNode: z.boolean().optional(), - remoteDiskThroughput: z.number().optional(), - totalInitialRemoteDiskSize: z.number().optional(), - size: z - .discriminatedUnion('$case', [ - z.object({$case: z.literal('numWorkers'), numWorkers: z.number()}), - z.object({ - $case: z.literal('autoscale'), - autoscale: z.lazy(() => marshalAutoScaleSchema), - }), - ]) - .optional(), - }) - .transform(d => ({ - apply_policy_default_values: d.applyPolicyDefaultValues, - cluster_name: d.clusterName, - spark_version: d.sparkVersion, - spark_conf: d.sparkConf, - aws_attributes: d.awsAttributes, - azure_attributes: d.azureAttributes, - gcp_attributes: d.gcpAttributes, - node_type_id: d.nodeTypeId, - driver_node_type_id: d.driverNodeTypeId, - worker_node_type_flexibility: d.workerNodeTypeFlexibility, - driver_node_type_flexibility: d.driverNodeTypeFlexibility, - ssh_public_keys: d.sshPublicKeys, - custom_tags: d.customTags, - cluster_log_conf: d.clusterLogConf, - spark_env_vars: d.sparkEnvVars, - autotermination_minutes: d.autoterminationMinutes, - enable_elastic_disk: d.enableElasticDisk, - init_scripts: d.initScripts, - docker_image: d.dockerImage, - instance_pool_id: d.instancePoolId, - single_user_name: d.singleUserName, - policy_id: d.policyId, - enable_local_disk_encryption: d.enableLocalDiskEncryption, - driver_instance_pool_id: d.driverInstancePoolId, - workload_type: d.workloadType, - data_security_mode: d.dataSecurityMode, - runtime_engine: d.runtimeEngine, - kind: d.kind, - use_ml_runtime: d.useMlRuntime, - is_single_node: d.isSingleNode, - remote_disk_throughput: d.remoteDiskThroughput, - total_initial_remote_disk_size: d.totalInitialRemoteDiskSize, - ...(d.size?.$case === 'numWorkers' && {num_workers: d.size.numWorkers}), - ...(d.size?.$case === 'autoscale' && {autoscale: d.size.autoscale}), - })); - -export const marshalComputeSchema: z.ZodType = z +export const marshalCreateComputeSchema: z.ZodType = z .object({ hardwareAccelerator: z.string().optional(), }) @@ -8592,9 +10813,9 @@ export const marshalComputeSchema: z.ZodType = z hardware_accelerator: d.hardwareAccelerator, })); -export const marshalComputeConfigSchema: z.ZodType = z +export const marshalCreateComputeConfigSchema: z.ZodType = z .object({ - numGpus: z.number().optional(), + numGpus: z.number(), gpuNodePoolId: z.string().optional(), gpuType: z.string().optional(), }) @@ -8604,21 +10825,21 @@ export const marshalComputeConfigSchema: z.ZodType = z gpu_type: d.gpuType, })); -export const marshalComputeSpecSchema: z.ZodType = z +export const marshalCreateComputeSpecSchema: z.ZodType = z .object({ - acceleratorType: z.string().optional(), - acceleratorCount: z.number().optional(), + acceleratorType: z.string(), + acceleratorCount: z.number(), }) .transform(d => ({ accelerator_type: d.acceleratorType, accelerator_count: d.acceleratorCount, })); -export const marshalConditionTaskSchema: z.ZodType = z +export const marshalCreateConditionTaskSchema: z.ZodType = z .object({ - op: z.string().optional(), - left: z.string().optional(), - right: z.string().optional(), + op: z.string(), + left: z.string(), + right: z.string(), outcome: z.string().optional(), }) .transform(d => ({ @@ -8628,7 +10849,7 @@ export const marshalConditionTaskSchema: z.ZodType = z outcome: d.outcome, })); -export const marshalContinuousSettingsSchema: z.ZodType = z +export const marshalCreateContinuousSettingsSchema: z.ZodType = z .object({ pauseStatus: z.string().optional(), taskRetryMode: z.string().optional(), @@ -8638,86 +10859,10 @@ export const marshalContinuousSettingsSchema: z.ZodType = z task_retry_mode: d.taskRetryMode, })); -export const marshalCreateJobRequestSchema: z.ZodType = z - .object({ - accessControlList: z - .array(z.lazy(() => marshalAccessControlRequestSchema)) - .optional(), - name: z.string().optional(), - description: z.string().optional(), - emailNotifications: z - .lazy(() => marshalJobEmailNotificationsSchema) - .optional(), - webhookNotifications: z - .lazy(() => marshalWebhookNotificationsSchema) - .optional(), - notificationSettings: z - .lazy(() => marshalNotificationSettingsSchema) - .optional(), - timeoutSeconds: z.number().optional(), - health: z.lazy(() => marshalJobsHealthRulesSchema).optional(), - schedule: z.lazy(() => marshalCronScheduleSchema).optional(), - trigger: z.lazy(() => marshalTriggerSettingsSchema).optional(), - continuous: z.lazy(() => marshalContinuousSettingsSchema).optional(), - maxConcurrentRuns: z.number().optional(), - tasks: z.array(z.lazy(() => marshalTaskSettingsSchema)).optional(), - jobClusters: z.array(z.lazy(() => marshalJobClusterSchema)).optional(), - gitSource: z.lazy(() => marshalGitSourceSchema).optional(), - tags: z.record(z.string(), z.string()).optional(), - format: z.string().optional(), - queue: z.lazy(() => marshalQueueSettingsSchema).optional(), - parameters: z - .array(z.lazy(() => marshalJobLevelParameterSchema)) - .optional(), - runAs: z.lazy(() => marshalJobRunAsSchema).optional(), - editMode: z.string().optional(), - deployment: z.lazy(() => marshalJobDeploymentSchema).optional(), - environments: z.array(z.lazy(() => marshalJobEnvironmentSchema)).optional(), - budgetPolicyId: z.string().optional(), - usagePolicyId: z.string().optional(), - performanceTarget: z.string().optional(), - maxRetries: z.number().optional(), - minRetryIntervalMillis: z.number().optional(), - retryOnTimeout: z.boolean().optional(), - disableAutoOptimization: z.boolean().optional(), - }) - .transform(d => ({ - access_control_list: d.accessControlList, - name: d.name, - description: d.description, - email_notifications: d.emailNotifications, - webhook_notifications: d.webhookNotifications, - notification_settings: d.notificationSettings, - timeout_seconds: d.timeoutSeconds, - health: d.health, - schedule: d.schedule, - trigger: d.trigger, - continuous: d.continuous, - max_concurrent_runs: d.maxConcurrentRuns, - tasks: d.tasks, - job_clusters: d.jobClusters, - git_source: d.gitSource, - tags: d.tags, - format: d.format, - queue: d.queue, - parameters: d.parameters, - run_as: d.runAs, - edit_mode: d.editMode, - deployment: d.deployment, - environments: d.environments, - budget_policy_id: d.budgetPolicyId, - usage_policy_id: d.usagePolicyId, - performance_target: d.performanceTarget, - max_retries: d.maxRetries, - min_retry_interval_millis: d.minRetryIntervalMillis, - retry_on_timeout: d.retryOnTimeout, - disable_auto_optimization: d.disableAutoOptimization, - })); - -export const marshalCronScheduleSchema: z.ZodType = z +export const marshalCreateCronScheduleSchema: z.ZodType = z .object({ - quartzCronExpression: z.string().optional(), - timezoneId: z.string().optional(), + quartzCronExpression: z.string(), + timezoneId: z.string(), pauseStatus: z.string().optional(), }) .transform(d => ({ @@ -8726,9 +10871,9 @@ export const marshalCronScheduleSchema: z.ZodType = z pause_status: d.pauseStatus, })); -export const marshalDashboardTaskSchema: z.ZodType = z +export const marshalCreateDashboardTaskSchema: z.ZodType = z .object({ - subscription: z.lazy(() => marshalSubscriptionSchema).optional(), + subscription: z.lazy(() => marshalCreateSubscriptionSchema).optional(), warehouseId: z.string().optional(), dashboardId: z.string().optional(), filters: z.record(z.string(), z.string()).optional(), @@ -8740,15 +10885,15 @@ export const marshalDashboardTaskSchema: z.ZodType = z filters: d.filters, })); -export const marshalDbfsStorageInfoSchema: z.ZodType = z +export const marshalCreateDbfsStorageInfoSchema: z.ZodType = z .object({ - destination: z.string().optional(), + destination: z.string(), }) .transform(d => ({ destination: d.destination, })); -export const marshalDbtCloudTaskSchema: z.ZodType = z +export const marshalCreateDbtCloudTaskSchema: z.ZodType = z .object({ dbtCloudJobId: z.bigint().optional(), connectionResourceName: z.string().optional(), @@ -8758,7 +10903,7 @@ export const marshalDbtCloudTaskSchema: z.ZodType = z connection_resource_name: d.connectionResourceName, })); -export const marshalDbtPlatformTaskSchema: z.ZodType = z +export const marshalCreateDbtPlatformTaskSchema: z.ZodType = z .object({ dbtPlatformJobId: z.string().optional(), connectionResourceName: z.string().optional(), @@ -8768,10 +10913,10 @@ export const marshalDbtPlatformTaskSchema: z.ZodType = z connection_resource_name: d.connectionResourceName, })); -export const marshalDbtTaskSchema: z.ZodType = z +export const marshalCreateDbtTaskSchema: z.ZodType = z .object({ projectDirectory: z.string().optional(), - commands: z.array(z.string()).optional(), + commands: z.array(z.string()), schema: z.string().optional(), warehouseId: z.string().optional(), profilesDirectory: z.string().optional(), @@ -8788,26 +10933,10 @@ export const marshalDbtTaskSchema: z.ZodType = z source: d.source, })); -export const marshalDeleteJobRequestSchema: z.ZodType = z - .object({ - jobId: z.bigint().optional(), - }) - .transform(d => ({ - job_id: d.jobId, - })); - -export const marshalDeleteRunRequestSchema: z.ZodType = z - .object({ - runId: z.bigint().optional(), - }) - .transform(d => ({ - run_id: d.runId, - })); - -export const marshalDeploymentSpecSchema: z.ZodType = z +export const marshalCreateDeploymentSpecSchema: z.ZodType = z .object({ - commandPath: z.string().optional(), - compute: z.lazy(() => marshalComputeSpecSchema).optional(), + commandPath: z.string(), + compute: z.lazy(() => marshalCreateComputeSpecSchema), name: z.string().optional(), }) .transform(d => ({ @@ -8816,7 +10945,7 @@ export const marshalDeploymentSpecSchema: z.ZodType = z name: d.name, })); -export const marshalDockerBasicAuthSchema: z.ZodType = z +export const marshalCreateDockerBasicAuthSchema: z.ZodType = z .object({ username: z.string().optional(), password: z.string().optional(), @@ -8826,14 +10955,14 @@ export const marshalDockerBasicAuthSchema: z.ZodType = z password: d.password, })); -export const marshalDockerImageSchema: z.ZodType = z +export const marshalCreateDockerImageSchema: z.ZodType = z .object({ url: z.string().optional(), credsOneof: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('basicAuth'), - basicAuth: z.lazy(() => marshalDockerBasicAuthSchema), + basicAuth: z.lazy(() => marshalCreateDockerBasicAuthSchema), }), ]) .optional(), @@ -8845,17 +10974,7 @@ export const marshalDockerImageSchema: z.ZodType = z }), })); -export const marshalEnforcePolicyComplianceForJobSchema: z.ZodType = z - .object({ - jobId: z.bigint().optional(), - validateOnly: z.boolean().optional(), - }) - .transform(d => ({ - job_id: d.jobId, - validate_only: d.validateOnly, - })); - -export const marshalEnvironmentSchema: z.ZodType = z +export const marshalCreateEnvironmentSchema: z.ZodType = z .object({ client: z.string().optional(), dependencies: z.array(z.string()).optional(), @@ -8871,9 +10990,9 @@ export const marshalEnvironmentSchema: z.ZodType = z java_dependencies: d.javaDependencies, })); -export const marshalFileArrivalTriggerConfigurationSchema: z.ZodType = z +export const marshalCreateFileArrivalTriggerConfigurationSchema: z.ZodType = z .object({ - url: z.string().optional(), + url: z.string(), minTimeBetweenTriggersSeconds: z.number().optional(), waitAfterLastChangeSeconds: z.number().optional(), }) @@ -8883,11 +11002,11 @@ export const marshalFileArrivalTriggerConfigurationSchema: z.ZodType = z wait_after_last_change_seconds: d.waitAfterLastChangeSeconds, })); -export const marshalForEachTaskSchema: z.ZodType = z +export const marshalCreateForEachTaskSchema: z.ZodType = z .object({ - inputs: z.string().optional(), + inputs: z.string(), concurrency: z.number().optional(), - task: z.lazy(() => marshalTaskSettingsSchema).optional(), + task: z.lazy(() => marshalCreateTaskSettingsSchema), }) .transform(d => ({ inputs: d.inputs, @@ -8895,7 +11014,7 @@ export const marshalForEachTaskSchema: z.ZodType = z task: d.task, })); -export const marshalGcpAttributesSchema: z.ZodType = z +export const marshalCreateGcpAttributesSchema: z.ZodType = z .object({ usePreemptibleExecutors: z.boolean().optional(), googleServiceAccount: z.string().optional(), @@ -8917,18 +11036,18 @@ export const marshalGcpAttributesSchema: z.ZodType = z confidential_compute_type: d.confidentialComputeType, })); -export const marshalGcsStorageInfoSchema: z.ZodType = z +export const marshalCreateGcsStorageInfoSchema: z.ZodType = z .object({ - destination: z.string().optional(), + destination: z.string(), }) .transform(d => ({ destination: d.destination, })); -export const marshalGenAiComputeTaskSchema: z.ZodType = z +export const marshalCreateGenAiComputeTaskSchema: z.ZodType = z .object({ - dlRuntimeImage: z.string().optional(), - compute: z.lazy(() => marshalComputeConfigSchema).optional(), + dlRuntimeImage: z.string(), + compute: z.lazy(() => marshalCreateComputeConfigSchema).optional(), command: z.string().optional(), source: z.string().optional(), trainingScriptPath: z.string().optional(), @@ -8947,7 +11066,7 @@ export const marshalGenAiComputeTaskSchema: z.ZodType = z mlflow_experiment_name: d.mlflowExperimentName, })); -export const marshalGitMetadataSnapshotSchema: z.ZodType = z +export const marshalCreateGitMetadataSnapshotSchema: z.ZodType = z .object({ usedCommit: z.string().optional(), }) @@ -8955,10 +11074,10 @@ export const marshalGitMetadataSnapshotSchema: z.ZodType = z used_commit: d.usedCommit, })); -export const marshalGitSourceSchema: z.ZodType = z +export const marshalCreateGitSourceSchema: z.ZodType = z .object({ - gitUrl: z.string().optional(), - gitProvider: z.string().optional(), + gitUrl: z.string(), + gitProvider: z.string(), gitReference: z .discriminatedUnion('$case', [ z.object({$case: z.literal('gitBranch'), gitBranch: z.string()}), @@ -8966,9 +11085,11 @@ export const marshalGitSourceSchema: z.ZodType = z z.object({$case: z.literal('gitCommit'), gitCommit: z.string()}), ]) .optional(), - gitSnapshot: z.lazy(() => marshalGitMetadataSnapshotSchema).optional(), - jobSource: z.lazy(() => marshalJobSourceSchema).optional(), - sparseCheckout: z.lazy(() => marshalSparseCheckoutSchema).optional(), + gitSnapshot: z + .lazy(() => marshalCreateGitMetadataSnapshotSchema) + .optional(), + jobSource: z.lazy(() => marshalCreateJobSourceSchema).optional(), + sparseCheckout: z.lazy(() => marshalCreateSparseCheckoutSchema).optional(), }) .transform(d => ({ git_url: d.gitUrl, @@ -8985,37 +11106,37 @@ export const marshalGitSourceSchema: z.ZodType = z sparse_checkout: d.sparseCheckout, })); -export const marshalInitScriptInfoSchema: z.ZodType = z +export const marshalCreateInitScriptInfoSchema: z.ZodType = z .object({ storageInfo: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('dbfs'), - dbfs: z.lazy(() => marshalDbfsStorageInfoSchema), + dbfs: z.lazy(() => marshalCreateDbfsStorageInfoSchema), }), z.object({ $case: z.literal('s3'), - s3: z.lazy(() => marshalS3StorageInfoSchema), + s3: z.lazy(() => marshalCreateS3StorageInfoSchema), }), z.object({ $case: z.literal('file'), - file: z.lazy(() => marshalLocalFileInfoSchema), + file: z.lazy(() => marshalCreateLocalFileInfoSchema), }), z.object({ $case: z.literal('gcs'), - gcs: z.lazy(() => marshalGcsStorageInfoSchema), + gcs: z.lazy(() => marshalCreateGcsStorageInfoSchema), }), z.object({ $case: z.literal('abfss'), - abfss: z.lazy(() => marshalAdlsgen2InfoSchema), + abfss: z.lazy(() => marshalCreateAdlsgen2InfoSchema), }), z.object({ $case: z.literal('workspace'), - workspace: z.lazy(() => marshalWorkspaceStorageInfoSchema), + workspace: z.lazy(() => marshalCreateWorkspaceStorageInfoSchema), }), z.object({ $case: z.literal('volumes'), - volumes: z.lazy(() => marshalVolumesStorageInfoSchema), + volumes: z.lazy(() => marshalCreateVolumesStorageInfoSchema), }), ]) .optional(), @@ -9032,19 +11153,19 @@ export const marshalInitScriptInfoSchema: z.ZodType = z ...(d.storageInfo?.$case === 'volumes' && {volumes: d.storageInfo.volumes}), })); -export const marshalJobClusterSchema: z.ZodType = z +export const marshalCreateJobClusterSchema: z.ZodType = z .object({ - jobClusterKey: z.string().optional(), - newCluster: z.lazy(() => marshalClusterSpec_NewClusterSchema).optional(), + jobClusterKey: z.string(), + newCluster: z.lazy(() => marshalClusterSpec_CreateNewClusterSchema), }) .transform(d => ({ job_cluster_key: d.jobClusterKey, new_cluster: d.newCluster, })); -export const marshalJobDeploymentSchema: z.ZodType = z +export const marshalCreateJobDeploymentSchema: z.ZodType = z .object({ - kind: z.string().optional(), + kind: z.string(), metadataFilePath: z.string().optional(), deploymentId: z.string().optional(), versionId: z.string().optional(), @@ -9056,7 +11177,7 @@ export const marshalJobDeploymentSchema: z.ZodType = z version_id: d.versionId, })); -export const marshalJobEmailNotificationsSchema: z.ZodType = z +export const marshalCreateJobEmailNotificationsSchema: z.ZodType = z .object({ onStart: z.array(z.string()).optional(), onSuccess: z.array(z.string()).optional(), @@ -9075,27 +11196,107 @@ export const marshalJobEmailNotificationsSchema: z.ZodType = z no_alert_for_skipped_runs: d.noAlertForSkippedRuns, })); -export const marshalJobEnvironmentSchema: z.ZodType = z +export const marshalCreateJobEnvironmentSchema: z.ZodType = z .object({ - environmentKey: z.string().optional(), - spec: z.lazy(() => marshalEnvironmentSchema).optional(), + environmentKey: z.string(), + spec: z.lazy(() => marshalCreateEnvironmentSchema).optional(), }) .transform(d => ({ environment_key: d.environmentKey, spec: d.spec, })); -export const marshalJobLevelParameterSchema: z.ZodType = z +export const marshalCreateJobLevelParameterSchema: z.ZodType = z + .object({ + name: z.string(), + default: z.string(), + }) + .transform(d => ({ + name: d.name, + default: d.default, + })); + +export const marshalCreateJobRequestSchema: z.ZodType = z .object({ + accessControlList: z + .array(z.lazy(() => marshalCreateAccessControlRequestSchema)) + .optional(), name: z.string().optional(), - default: z.string().optional(), + description: z.string().optional(), + emailNotifications: z + .lazy(() => marshalCreateJobEmailNotificationsSchema) + .optional(), + webhookNotifications: z + .lazy(() => marshalCreateWebhookNotificationsSchema) + .optional(), + notificationSettings: z + .lazy(() => marshalCreateNotificationSettingsSchema) + .optional(), + timeoutSeconds: z.number().optional(), + health: z.lazy(() => marshalCreateJobsHealthRulesSchema).optional(), + schedule: z.lazy(() => marshalCreateCronScheduleSchema).optional(), + trigger: z.lazy(() => marshalCreateTriggerSettingsSchema).optional(), + continuous: z.lazy(() => marshalCreateContinuousSettingsSchema).optional(), + maxConcurrentRuns: z.number().optional(), + tasks: z.array(z.lazy(() => marshalCreateTaskSettingsSchema)).optional(), + jobClusters: z + .array(z.lazy(() => marshalCreateJobClusterSchema)) + .optional(), + gitSource: z.lazy(() => marshalCreateGitSourceSchema).optional(), + tags: z.record(z.string(), z.string()).optional(), + format: z.string().optional(), + queue: z.lazy(() => marshalCreateQueueSettingsSchema).optional(), + parameters: z + .array(z.lazy(() => marshalCreateJobLevelParameterSchema)) + .optional(), + runAs: z.lazy(() => marshalCreateJobRunAsSchema).optional(), + editMode: z.string().optional(), + deployment: z.lazy(() => marshalCreateJobDeploymentSchema).optional(), + environments: z + .array(z.lazy(() => marshalCreateJobEnvironmentSchema)) + .optional(), + budgetPolicyId: z.string().optional(), + usagePolicyId: z.string().optional(), + performanceTarget: z.string().optional(), + maxRetries: z.number().optional(), + minRetryIntervalMillis: z.number().optional(), + retryOnTimeout: z.boolean().optional(), + disableAutoOptimization: z.boolean().optional(), }) .transform(d => ({ + access_control_list: d.accessControlList, name: d.name, - default: d.default, + description: d.description, + email_notifications: d.emailNotifications, + webhook_notifications: d.webhookNotifications, + notification_settings: d.notificationSettings, + timeout_seconds: d.timeoutSeconds, + health: d.health, + schedule: d.schedule, + trigger: d.trigger, + continuous: d.continuous, + max_concurrent_runs: d.maxConcurrentRuns, + tasks: d.tasks, + job_clusters: d.jobClusters, + git_source: d.gitSource, + tags: d.tags, + format: d.format, + queue: d.queue, + parameters: d.parameters, + run_as: d.runAs, + edit_mode: d.editMode, + deployment: d.deployment, + environments: d.environments, + budget_policy_id: d.budgetPolicyId, + usage_policy_id: d.usagePolicyId, + performance_target: d.performanceTarget, + max_retries: d.maxRetries, + min_retry_interval_millis: d.minRetryIntervalMillis, + retry_on_timeout: d.retryOnTimeout, + disable_auto_optimization: d.disableAutoOptimization, })); -export const marshalJobRunAsSchema: z.ZodType = z +export const marshalCreateJobRunAsSchema: z.ZodType = z .object({ identity: z .discriminatedUnion('$case', [ @@ -9118,38 +11319,42 @@ export const marshalJobRunAsSchema: z.ZodType = z }), })); -export const marshalJobSettingsSchema: z.ZodType = z +export const marshalCreateJobSettingsSchema: z.ZodType = z .object({ name: z.string().optional(), description: z.string().optional(), emailNotifications: z - .lazy(() => marshalJobEmailNotificationsSchema) + .lazy(() => marshalCreateJobEmailNotificationsSchema) .optional(), webhookNotifications: z - .lazy(() => marshalWebhookNotificationsSchema) + .lazy(() => marshalCreateWebhookNotificationsSchema) .optional(), notificationSettings: z - .lazy(() => marshalNotificationSettingsSchema) + .lazy(() => marshalCreateNotificationSettingsSchema) .optional(), timeoutSeconds: z.number().optional(), - health: z.lazy(() => marshalJobsHealthRulesSchema).optional(), - schedule: z.lazy(() => marshalCronScheduleSchema).optional(), - trigger: z.lazy(() => marshalTriggerSettingsSchema).optional(), - continuous: z.lazy(() => marshalContinuousSettingsSchema).optional(), + health: z.lazy(() => marshalCreateJobsHealthRulesSchema).optional(), + schedule: z.lazy(() => marshalCreateCronScheduleSchema).optional(), + trigger: z.lazy(() => marshalCreateTriggerSettingsSchema).optional(), + continuous: z.lazy(() => marshalCreateContinuousSettingsSchema).optional(), maxConcurrentRuns: z.number().optional(), - tasks: z.array(z.lazy(() => marshalTaskSettingsSchema)).optional(), - jobClusters: z.array(z.lazy(() => marshalJobClusterSchema)).optional(), - gitSource: z.lazy(() => marshalGitSourceSchema).optional(), + tasks: z.array(z.lazy(() => marshalCreateTaskSettingsSchema)).optional(), + jobClusters: z + .array(z.lazy(() => marshalCreateJobClusterSchema)) + .optional(), + gitSource: z.lazy(() => marshalCreateGitSourceSchema).optional(), tags: z.record(z.string(), z.string()).optional(), format: z.string().optional(), - queue: z.lazy(() => marshalQueueSettingsSchema).optional(), + queue: z.lazy(() => marshalCreateQueueSettingsSchema).optional(), parameters: z - .array(z.lazy(() => marshalJobLevelParameterSchema)) + .array(z.lazy(() => marshalCreateJobLevelParameterSchema)) .optional(), - runAs: z.lazy(() => marshalJobRunAsSchema).optional(), + runAs: z.lazy(() => marshalCreateJobRunAsSchema).optional(), editMode: z.string().optional(), - deployment: z.lazy(() => marshalJobDeploymentSchema).optional(), - environments: z.array(z.lazy(() => marshalJobEnvironmentSchema)).optional(), + deployment: z.lazy(() => marshalCreateJobDeploymentSchema).optional(), + environments: z + .array(z.lazy(() => marshalCreateJobEnvironmentSchema)) + .optional(), budgetPolicyId: z.string().optional(), usagePolicyId: z.string().optional(), performanceTarget: z.string().optional(), @@ -9190,9 +11395,9 @@ export const marshalJobSettingsSchema: z.ZodType = z disable_auto_optimization: d.disableAutoOptimization, })); -export const marshalJobSourceSchema: z.ZodType = z +export const marshalCreateJobSourceSchema: z.ZodType = z .object({ - jobConfigPath: z.string().optional(), + jobConfigPath: z.string(), importFromGitReference: z .discriminatedUnion('$case', [ z.object({ @@ -9211,11 +11416,11 @@ export const marshalJobSourceSchema: z.ZodType = z dirty_state: d.dirtyState, })); -export const marshalJobsHealthRuleSchema: z.ZodType = z +export const marshalCreateJobsHealthRuleSchema: z.ZodType = z .object({ - metric: z.string().optional(), - op: z.string().optional(), - value: z.bigint().optional(), + metric: z.string(), + op: z.string(), + value: z.bigint(), }) .transform(d => ({ metric: d.metric, @@ -9223,15 +11428,15 @@ export const marshalJobsHealthRuleSchema: z.ZodType = z value: d.value, })); -export const marshalJobsHealthRulesSchema: z.ZodType = z +export const marshalCreateJobsHealthRulesSchema: z.ZodType = z .object({ - rules: z.array(z.lazy(() => marshalJobsHealthRuleSchema)).optional(), + rules: z.array(z.lazy(() => marshalCreateJobsHealthRuleSchema)).optional(), }) .transform(d => ({ rules: d.rules, })); -export const marshalLibrarySchema: z.ZodType = z +export const marshalCreateLibrarySchema: z.ZodType = z .object({ lib: z .discriminatedUnion('$case', [ @@ -9239,15 +11444,15 @@ export const marshalLibrarySchema: z.ZodType = z z.object({$case: z.literal('egg'), egg: z.string()}), z.object({ $case: z.literal('pypi'), - pypi: z.lazy(() => marshalPythonPyPiLibrarySchema), + pypi: z.lazy(() => marshalCreatePythonPyPiLibrarySchema), }), z.object({ $case: z.literal('maven'), - maven: z.lazy(() => marshalMavenLibrarySchema), + maven: z.lazy(() => marshalCreateMavenLibrarySchema), }), z.object({ $case: z.literal('cran'), - cran: z.lazy(() => marshalRCranLibrarySchema), + cran: z.lazy(() => marshalCreateRCranLibrarySchema), }), z.object({$case: z.literal('whl'), whl: z.string()}), z.object({$case: z.literal('requirements'), requirements: z.string()}), @@ -9264,15 +11469,15 @@ export const marshalLibrarySchema: z.ZodType = z ...(d.lib?.$case === 'requirements' && {requirements: d.lib.requirements}), })); -export const marshalLocalFileInfoSchema: z.ZodType = z +export const marshalCreateLocalFileInfoSchema: z.ZodType = z .object({ - destination: z.string().optional(), + destination: z.string(), }) .transform(d => ({ destination: d.destination, })); -export const marshalLogAnalyticsInfoSchema: z.ZodType = z +export const marshalCreateLogAnalyticsInfoSchema: z.ZodType = z .object({ logAnalyticsWorkspaceId: z.string().optional(), logAnalyticsPrimaryKey: z.string().optional(), @@ -9282,9 +11487,9 @@ export const marshalLogAnalyticsInfoSchema: z.ZodType = z log_analytics_primary_key: d.logAnalyticsPrimaryKey, })); -export const marshalMavenLibrarySchema: z.ZodType = z +export const marshalCreateMavenLibrarySchema: z.ZodType = z .object({ - coordinates: z.string().optional(), + coordinates: z.string(), repo: z.string().optional(), exclusions: z.array(z.string()).optional(), }) @@ -9294,11 +11499,11 @@ export const marshalMavenLibrarySchema: z.ZodType = z exclusions: d.exclusions, })); -export const marshalModelTriggerConfigurationSchema: z.ZodType = z +export const marshalCreateModelTriggerConfigurationSchema: z.ZodType = z .object({ securableName: z.string().optional(), aliases: z.array(z.string()).optional(), - condition: z.string().optional(), + condition: z.string(), minTimeBetweenTriggersSeconds: z.number().optional(), waitAfterLastChangeSeconds: z.number().optional(), }) @@ -9310,7 +11515,7 @@ export const marshalModelTriggerConfigurationSchema: z.ZodType = z wait_after_last_change_seconds: d.waitAfterLastChangeSeconds, })); -export const marshalNodeTypeFlexibilitySchema: z.ZodType = z +export const marshalCreateNodeTypeFlexibilitySchema: z.ZodType = z .object({ alternateNodeTypeIds: z.array(z.string()).optional(), }) @@ -9318,9 +11523,9 @@ export const marshalNodeTypeFlexibilitySchema: z.ZodType = z alternate_node_type_ids: d.alternateNodeTypeIds, })); -export const marshalNotebookTaskSchema: z.ZodType = z +export const marshalCreateNotebookTaskSchema: z.ZodType = z .object({ - notebookPath: z.string().optional(), + notebookPath: z.string(), baseParameters: z.record(z.string(), z.string()).optional(), source: z.string().optional(), warehouseId: z.string().optional(), @@ -9332,7 +11537,7 @@ export const marshalNotebookTaskSchema: z.ZodType = z warehouse_id: d.warehouseId, })); -export const marshalNotificationSettingsSchema: z.ZodType = z +export const marshalCreateNotificationSettingsSchema: z.ZodType = z .object({ noAlertForSkippedRuns: z.boolean().optional(), noAlertForCanceledRuns: z.boolean().optional(), @@ -9344,17 +11549,17 @@ export const marshalNotificationSettingsSchema: z.ZodType = z alert_on_last_attempt: d.alertOnLastAttempt, })); -export const marshalPeriodicTriggerConfigurationSchema: z.ZodType = z +export const marshalCreatePeriodicTriggerConfigurationSchema: z.ZodType = z .object({ - interval: z.number().optional(), - unit: z.string().optional(), + interval: z.number(), + unit: z.string(), }) .transform(d => ({ interval: d.interval, unit: d.unit, })); -export const marshalPipelineParametersSchema: z.ZodType = z +export const marshalCreatePipelineParametersSchema: z.ZodType = z .object({ fullRefresh: z.boolean().optional(), refreshSelection: z.array(z.string()).optional(), @@ -9370,9 +11575,9 @@ export const marshalPipelineParametersSchema: z.ZodType = z refresh_flow_selection: d.refreshFlowSelection, })); -export const marshalPipelineTaskSchema: z.ZodType = z +export const marshalCreatePipelineTaskSchema: z.ZodType = z .object({ - pipelineId: z.string().optional(), + pipelineId: z.string(), pipelineTaskParameters: z.record(z.string(), z.string()).optional(), fullRefresh: z.boolean().optional(), refreshSelection: z.array(z.string()).optional(), @@ -9390,7 +11595,7 @@ export const marshalPipelineTaskSchema: z.ZodType = z refresh_flow_selection: d.refreshFlowSelection, })); -export const marshalPowerBiModelSchema: z.ZodType = z +export const marshalCreatePowerBiModelSchema: z.ZodType = z .object({ workspaceName: z.string().optional(), modelName: z.string().optional(), @@ -9406,7 +11611,7 @@ export const marshalPowerBiModelSchema: z.ZodType = z overwrite_existing: d.overwriteExisting, })); -export const marshalPowerBiTableSchema: z.ZodType = z +export const marshalCreatePowerBiTableSchema: z.ZodType = z .object({ name: z.string().optional(), catalog: z.string().optional(), @@ -9420,11 +11625,11 @@ export const marshalPowerBiTableSchema: z.ZodType = z storage_mode: d.storageMode, })); -export const marshalPowerBiTaskSchema: z.ZodType = z +export const marshalCreatePowerBiTaskSchema: z.ZodType = z .object({ - tables: z.array(z.lazy(() => marshalPowerBiTableSchema)).optional(), + tables: z.array(z.lazy(() => marshalCreatePowerBiTableSchema)).optional(), warehouseId: z.string().optional(), - powerBiModel: z.lazy(() => marshalPowerBiModelSchema).optional(), + powerBiModel: z.lazy(() => marshalCreatePowerBiModelSchema).optional(), connectionResourceName: z.string().optional(), refreshAfterUpdate: z.boolean().optional(), }) @@ -9436,10 +11641,10 @@ export const marshalPowerBiTaskSchema: z.ZodType = z refresh_after_update: d.refreshAfterUpdate, })); -export const marshalPythonOperatorTaskSchema: z.ZodType = z +export const marshalCreatePythonOperatorTaskSchema: z.ZodType = z .object({ parameters: z - .array(z.lazy(() => marshalPythonOperatorTask_ParameterSchema)) + .array(z.lazy(() => marshalPythonOperatorTask_CreateParameterSchema)) .optional(), main: z.string().optional(), }) @@ -9448,20 +11653,9 @@ export const marshalPythonOperatorTaskSchema: z.ZodType = z main: d.main, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalPythonOperatorTask_ParameterSchema: z.ZodType = z - .object({ - name: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - value: d.value, - })); - -export const marshalPythonPyPiLibrarySchema: z.ZodType = z +export const marshalCreatePythonPyPiLibrarySchema: z.ZodType = z .object({ - package: z.string().optional(), + package: z.string(), repo: z.string().optional(), }) .transform(d => ({ @@ -9469,10 +11663,10 @@ export const marshalPythonPyPiLibrarySchema: z.ZodType = z repo: d.repo, })); -export const marshalPythonWheelTaskSchema: z.ZodType = z +export const marshalCreatePythonWheelTaskSchema: z.ZodType = z .object({ - packageName: z.string().optional(), - entryPoint: z.string().optional(), + packageName: z.string(), + entryPoint: z.string(), parameters: z.array(z.string()).optional(), namedParameters: z.record(z.string(), z.string()).optional(), }) @@ -9483,17 +11677,17 @@ export const marshalPythonWheelTaskSchema: z.ZodType = z named_parameters: d.namedParameters, })); -export const marshalQueueSettingsSchema: z.ZodType = z +export const marshalCreateQueueSettingsSchema: z.ZodType = z .object({ - enabled: z.boolean().optional(), + enabled: z.boolean(), }) .transform(d => ({ enabled: d.enabled, })); -export const marshalRCranLibrarySchema: z.ZodType = z +export const marshalCreateRCranLibrarySchema: z.ZodType = z .object({ - package: z.string().optional(), + package: z.string(), repo: z.string().optional(), }) .transform(d => ({ @@ -9501,87 +11695,13 @@ export const marshalRCranLibrarySchema: z.ZodType = z repo: d.repo, })); -export const marshalRepairRunRequestSchema: z.ZodType = z - .object({ - runId: z.bigint().optional(), - latestRepairId: z.bigint().optional(), - rerunTasks: z.array(z.string()).optional(), - jobParameters: z.record(z.string(), z.string()).optional(), - rerunAllFailedTasks: z.boolean().optional(), - rerunDependentTasks: z.boolean().optional(), - performanceTarget: z.string().optional(), - pipelineParams: z.lazy(() => marshalPipelineParametersSchema).optional(), - jarParams: z.array(z.string()).optional(), - notebookParams: z.record(z.string(), z.string()).optional(), - pythonParams: z.array(z.string()).optional(), - sparkSubmitParams: z.array(z.string()).optional(), - pythonNamedParams: z.record(z.string(), z.string()).optional(), - sqlParams: z.record(z.string(), z.string()).optional(), - dbtCommands: z.array(z.string()).optional(), - }) - .transform(d => ({ - run_id: d.runId, - latest_repair_id: d.latestRepairId, - rerun_tasks: d.rerunTasks, - job_parameters: d.jobParameters, - rerun_all_failed_tasks: d.rerunAllFailedTasks, - rerun_dependent_tasks: d.rerunDependentTasks, - performance_target: d.performanceTarget, - pipeline_params: d.pipelineParams, - jar_params: d.jarParams, - notebook_params: d.notebookParams, - python_params: d.pythonParams, - spark_submit_params: d.sparkSubmitParams, - python_named_params: d.pythonNamedParams, - sql_params: d.sqlParams, - dbt_commands: d.dbtCommands, - })); - -export const marshalResetJobRequestSchema: z.ZodType = z - .object({ - jobId: z.bigint().optional(), - newSettings: z.lazy(() => marshalJobSettingsSchema).optional(), - }) - .transform(d => ({ - job_id: d.jobId, - new_settings: d.newSettings, - })); - -export const marshalRunJobTaskSchema: z.ZodType = z - .object({ - jobId: z.bigint().optional(), - jobParameters: z.record(z.string(), z.string()).optional(), - pipelineParams: z.lazy(() => marshalPipelineParametersSchema).optional(), - jarParams: z.array(z.string()).optional(), - notebookParams: z.record(z.string(), z.string()).optional(), - pythonParams: z.array(z.string()).optional(), - sparkSubmitParams: z.array(z.string()).optional(), - pythonNamedParams: z.record(z.string(), z.string()).optional(), - sqlParams: z.record(z.string(), z.string()).optional(), - dbtCommands: z.array(z.string()).optional(), - }) - .transform(d => ({ - job_id: d.jobId, - job_parameters: d.jobParameters, - pipeline_params: d.pipelineParams, - jar_params: d.jarParams, - notebook_params: d.notebookParams, - python_params: d.pythonParams, - spark_submit_params: d.sparkSubmitParams, - python_named_params: d.pythonNamedParams, - sql_params: d.sqlParams, - dbt_commands: d.dbtCommands, - })); - -export const marshalRunNowRequestSchema: z.ZodType = z +export const marshalCreateRunJobTaskSchema: z.ZodType = z .object({ - jobId: z.bigint().optional(), + jobId: z.bigint(), jobParameters: z.record(z.string(), z.string()).optional(), - idempotencyToken: z.string().optional(), - queue: z.lazy(() => marshalQueueSettingsSchema).optional(), - only: z.array(z.string()).optional(), - performanceTarget: z.string().optional(), - pipelineParams: z.lazy(() => marshalPipelineParametersSchema).optional(), + pipelineParams: z + .lazy(() => marshalCreatePipelineParametersSchema) + .optional(), jarParams: z.array(z.string()).optional(), notebookParams: z.record(z.string(), z.string()).optional(), pythonParams: z.array(z.string()).optional(), @@ -9593,10 +11713,6 @@ export const marshalRunNowRequestSchema: z.ZodType = z .transform(d => ({ job_id: d.jobId, job_parameters: d.jobParameters, - idempotency_token: d.idempotencyToken, - queue: d.queue, - only: d.only, - performance_target: d.performanceTarget, pipeline_params: d.pipelineParams, jar_params: d.jarParams, notebook_params: d.notebookParams, @@ -9607,22 +11723,24 @@ export const marshalRunNowRequestSchema: z.ZodType = z dbt_commands: d.dbtCommands, })); -export const marshalRunTaskSettingsSchema: z.ZodType = z +export const marshalCreateRunTaskSettingsSchema: z.ZodType = z .object({ - taskKey: z.string().optional(), + taskKey: z.string(), description: z.string().optional(), - dependsOn: z.array(z.lazy(() => marshalTaskDependencySchema)).optional(), + dependsOn: z + .array(z.lazy(() => marshalCreateTaskDependencySchema)) + .optional(), runIf: z.string().optional(), timeoutSeconds: z.number().optional(), emailNotifications: z - .lazy(() => marshalJobEmailNotificationsSchema) + .lazy(() => marshalCreateJobEmailNotificationsSchema) .optional(), - health: z.lazy(() => marshalJobsHealthRulesSchema).optional(), + health: z.lazy(() => marshalCreateJobsHealthRulesSchema).optional(), notificationSettings: z - .lazy(() => marshalNotificationSettingsSchema) + .lazy(() => marshalCreateNotificationSettingsSchema) .optional(), webhookNotifications: z - .lazy(() => marshalWebhookNotificationsSchema) + .lazy(() => marshalCreateWebhookNotificationsSchema) .optional(), environmentRef: z .discriminatedUnion('$case', [ @@ -9633,90 +11751,92 @@ export const marshalRunTaskSettingsSchema: z.ZodType = z ]) .optional(), disabled: z.boolean().optional(), - compute: z.lazy(() => marshalComputeSchema).optional(), + compute: z.lazy(() => marshalCreateComputeSchema).optional(), task: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('notebookTask'), - notebookTask: z.lazy(() => marshalNotebookTaskSchema), + notebookTask: z.lazy(() => marshalCreateNotebookTaskSchema), }), z.object({ $case: z.literal('sparkJarTask'), - sparkJarTask: z.lazy(() => marshalSparkJarTaskSchema), + sparkJarTask: z.lazy(() => marshalCreateSparkJarTaskSchema), }), z.object({ $case: z.literal('sparkPythonTask'), - sparkPythonTask: z.lazy(() => marshalSparkPythonTaskSchema), + sparkPythonTask: z.lazy(() => marshalCreateSparkPythonTaskSchema), }), z.object({ $case: z.literal('sparkSubmitTask'), - sparkSubmitTask: z.lazy(() => marshalSparkSubmitTaskSchema), + sparkSubmitTask: z.lazy(() => marshalCreateSparkSubmitTaskSchema), }), z.object({ $case: z.literal('pipelineTask'), - pipelineTask: z.lazy(() => marshalPipelineTaskSchema), + pipelineTask: z.lazy(() => marshalCreatePipelineTaskSchema), }), z.object({ $case: z.literal('pythonWheelTask'), - pythonWheelTask: z.lazy(() => marshalPythonWheelTaskSchema), + pythonWheelTask: z.lazy(() => marshalCreatePythonWheelTaskSchema), }), z.object({ $case: z.literal('dbtTask'), - dbtTask: z.lazy(() => marshalDbtTaskSchema), + dbtTask: z.lazy(() => marshalCreateDbtTaskSchema), }), z.object({ $case: z.literal('sqlTask'), - sqlTask: z.lazy(() => marshalSqlTaskSchema), + sqlTask: z.lazy(() => marshalCreateSqlTaskSchema), }), z.object({ $case: z.literal('runJobTask'), - runJobTask: z.lazy(() => marshalRunJobTaskSchema), + runJobTask: z.lazy(() => marshalCreateRunJobTaskSchema), }), z.object({ $case: z.literal('conditionTask'), - conditionTask: z.lazy(() => marshalConditionTaskSchema), + conditionTask: z.lazy(() => marshalCreateConditionTaskSchema), }), z.object({ $case: z.literal('forEachTask'), - forEachTask: z.lazy(() => marshalForEachTaskSchema), + forEachTask: z.lazy(() => marshalCreateForEachTaskSchema), }), z.object({ $case: z.literal('cleanRoomsNotebookTask'), cleanRoomsNotebookTask: z.lazy( - () => marshalCleanRoomsNotebookTaskSchema + () => marshalCreateCleanRoomsNotebookTaskSchema ), }), z.object({ $case: z.literal('genAiComputeTask'), - genAiComputeTask: z.lazy(() => marshalGenAiComputeTaskSchema), + genAiComputeTask: z.lazy(() => marshalCreateGenAiComputeTaskSchema), }), z.object({ $case: z.literal('alertTask'), - alertTask: z.lazy(() => marshalAlertTaskSchema), + alertTask: z.lazy(() => marshalCreateAlertTaskSchema), }), z.object({ $case: z.literal('powerBiTask'), - powerBiTask: z.lazy(() => marshalPowerBiTaskSchema), + powerBiTask: z.lazy(() => marshalCreatePowerBiTaskSchema), }), z.object({ $case: z.literal('dashboardTask'), - dashboardTask: z.lazy(() => marshalDashboardTaskSchema), + dashboardTask: z.lazy(() => marshalCreateDashboardTaskSchema), }), z.object({ $case: z.literal('dbtCloudTask'), - dbtCloudTask: z.lazy(() => marshalDbtCloudTaskSchema), + dbtCloudTask: z.lazy(() => marshalCreateDbtCloudTaskSchema), }), z.object({ $case: z.literal('dbtPlatformTask'), - dbtPlatformTask: z.lazy(() => marshalDbtPlatformTaskSchema), + dbtPlatformTask: z.lazy(() => marshalCreateDbtPlatformTaskSchema), }), z.object({ $case: z.literal('pythonOperatorTask'), - pythonOperatorTask: z.lazy(() => marshalPythonOperatorTaskSchema), + pythonOperatorTask: z.lazy( + () => marshalCreatePythonOperatorTaskSchema + ), }), z.object({ $case: z.literal('aiRuntimeTask'), - aiRuntimeTask: z.lazy(() => marshalAiRuntimeTaskSchema), + aiRuntimeTask: z.lazy(() => marshalCreateAiRuntimeTaskSchema), }), ]) .optional(), @@ -9728,7 +11848,7 @@ export const marshalRunTaskSettingsSchema: z.ZodType = z }), z.object({ $case: z.literal('newCluster'), - newCluster: z.lazy(() => marshalClusterSpec_NewClusterSchema), + newCluster: z.lazy(() => marshalClusterSpec_CreateNewClusterSchema), }), z.object({ $case: z.literal('jobClusterKey'), @@ -9736,7 +11856,7 @@ export const marshalRunTaskSettingsSchema: z.ZodType = z }), ]) .optional(), - libraries: z.array(z.lazy(() => marshalLibrarySchema)).optional(), + libraries: z.array(z.lazy(() => marshalCreateLibrarySchema)).optional(), maxRetries: z.number().optional(), minRetryIntervalMillis: z.number().optional(), retryOnTimeout: z.boolean().optional(), @@ -9819,9 +11939,9 @@ export const marshalRunTaskSettingsSchema: z.ZodType = z disable_auto_optimization: d.disableAutoOptimization, })); -export const marshalS3StorageInfoSchema: z.ZodType = z +export const marshalCreateS3StorageInfoSchema: z.ZodType = z .object({ - destination: z.string().optional(), + destination: z.string(), region: z.string().optional(), endpoint: z.string().optional(), enableEncryption: z.boolean().optional(), @@ -9839,7 +11959,7 @@ export const marshalS3StorageInfoSchema: z.ZodType = z canned_acl: d.cannedAcl, })); -export const marshalSparkJarTaskSchema: z.ZodType = z +export const marshalCreateSparkJarTaskSchema: z.ZodType = z .object({ jarUri: z.string().optional(), mainClassName: z.string().optional(), @@ -9853,9 +11973,9 @@ export const marshalSparkJarTaskSchema: z.ZodType = z run_as_repl: d.runAsRepl, })); -export const marshalSparkPythonTaskSchema: z.ZodType = z +export const marshalCreateSparkPythonTaskSchema: z.ZodType = z .object({ - pythonFile: z.string().optional(), + pythonFile: z.string(), parameters: z.array(z.string()).optional(), source: z.string().optional(), }) @@ -9865,7 +11985,7 @@ export const marshalSparkPythonTaskSchema: z.ZodType = z source: d.source, })); -export const marshalSparkSubmitTaskSchema: z.ZodType = z +export const marshalCreateSparkSubmitTaskSchema: z.ZodType = z .object({ parameters: z.array(z.string()).optional(), }) @@ -9873,7 +11993,7 @@ export const marshalSparkSubmitTaskSchema: z.ZodType = z parameters: d.parameters, })); -export const marshalSparseCheckoutSchema: z.ZodType = z +export const marshalCreateSparseCheckoutSchema: z.ZodType = z .object({ patterns: z.array(z.string()).optional(), }) @@ -9881,30 +12001,30 @@ export const marshalSparseCheckoutSchema: z.ZodType = z patterns: d.patterns, })); -export const marshalSqlTaskSchema: z.ZodType = z +export const marshalCreateSqlTaskSchema: z.ZodType = z .object({ parameters: z.record(z.string(), z.string()).optional(), sqlTaskType: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('query'), - query: z.lazy(() => marshalSqlTaskQuerySchema), + query: z.lazy(() => marshalCreateSqlTaskQuerySchema), }), z.object({ $case: z.literal('dashboard'), - dashboard: z.lazy(() => marshalSqlTaskDashboardSchema), + dashboard: z.lazy(() => marshalCreateSqlTaskDashboardSchema), }), z.object({ $case: z.literal('alert'), - alert: z.lazy(() => marshalSqlTaskAlertSchema), + alert: z.lazy(() => marshalCreateSqlTaskAlertSchema), }), z.object({ $case: z.literal('file'), - file: z.lazy(() => marshalSqlTaskFileSchema), + file: z.lazy(() => marshalCreateSqlTaskFileSchema), }), ]) .optional(), - warehouseId: z.string().optional(), + warehouseId: z.string(), }) .transform(d => ({ parameters: d.parameters, @@ -9917,139 +12037,59 @@ export const marshalSqlTaskSchema: z.ZodType = z warehouse_id: d.warehouseId, })); -export const marshalSqlTaskAlertSchema: z.ZodType = z - .object({ - alertId: z.string().optional(), - subscriptions: z - .array(z.lazy(() => marshalSqlTaskSubscriptionSchema)) - .optional(), - pauseSubscriptions: z.boolean().optional(), - }) - .transform(d => ({ - alert_id: d.alertId, - subscriptions: d.subscriptions, - pause_subscriptions: d.pauseSubscriptions, - })); - -export const marshalSqlTaskDashboardSchema: z.ZodType = z +export const marshalCreateSqlTaskAlertSchema: z.ZodType = z .object({ - dashboardId: z.string().optional(), + alertId: z.string(), subscriptions: z - .array(z.lazy(() => marshalSqlTaskSubscriptionSchema)) + .array(z.lazy(() => marshalCreateSqlTaskSubscriptionSchema)) .optional(), - customSubject: z.string().optional(), pauseSubscriptions: z.boolean().optional(), - }) - .transform(d => ({ - dashboard_id: d.dashboardId, - subscriptions: d.subscriptions, - custom_subject: d.customSubject, - pause_subscriptions: d.pauseSubscriptions, - })); - -export const marshalSqlTaskFileSchema: z.ZodType = z - .object({ - path: z.string().optional(), - source: z.string().optional(), - }) - .transform(d => ({ - path: d.path, - source: d.source, - })); - -export const marshalSqlTaskQuerySchema: z.ZodType = z - .object({ - queryType: z - .discriminatedUnion('$case', [ - z.object({$case: z.literal('queryId'), queryId: z.string()}), - ]) - .optional(), - }) - .transform(d => ({ - ...(d.queryType?.$case === 'queryId' && {query_id: d.queryType.queryId}), - })); - -export const marshalSqlTaskSubscriptionSchema: z.ZodType = z - .object({ - subscriptionType: z - .discriminatedUnion('$case', [ - z.object({$case: z.literal('userName'), userName: z.string()}), - z.object({ - $case: z.literal('destinationId'), - destinationId: z.string(), - }), - ]) - .optional(), - }) - .transform(d => ({ - ...(d.subscriptionType?.$case === 'userName' && { - user_name: d.subscriptionType.userName, - }), - ...(d.subscriptionType?.$case === 'destinationId' && { - destination_id: d.subscriptionType.destinationId, - }), - })); - -export const marshalSubmitRunRequestSchema: z.ZodType = z - .object({ - accessControlList: z - .array(z.lazy(() => marshalAccessControlRequestSchema)) - .optional(), - queue: z.lazy(() => marshalQueueSettingsSchema).optional(), - runAs: z.lazy(() => marshalJobRunAsSchema).optional(), - runName: z.string().optional(), - timeoutSeconds: z.number().optional(), - health: z.lazy(() => marshalJobsHealthRulesSchema).optional(), - idempotencyToken: z.string().optional(), - tasks: z.array(z.lazy(() => marshalRunTaskSettingsSchema)).optional(), - gitSource: z.lazy(() => marshalGitSourceSchema).optional(), - webhookNotifications: z - .lazy(() => marshalWebhookNotificationsSchema) - .optional(), - emailNotifications: z - .lazy(() => marshalJobEmailNotificationsSchema) - .optional(), - notificationSettings: z - .lazy(() => marshalNotificationSettingsSchema) - .optional(), - environments: z.array(z.lazy(() => marshalJobEnvironmentSchema)).optional(), - budgetPolicyId: z.string().optional(), - usagePolicyId: z.string().optional(), - }) - .transform(d => ({ - access_control_list: d.accessControlList, - queue: d.queue, - run_as: d.runAs, - run_name: d.runName, - timeout_seconds: d.timeoutSeconds, - health: d.health, - idempotency_token: d.idempotencyToken, - tasks: d.tasks, - git_source: d.gitSource, - webhook_notifications: d.webhookNotifications, - email_notifications: d.emailNotifications, - notification_settings: d.notificationSettings, - environments: d.environments, - budget_policy_id: d.budgetPolicyId, - usage_policy_id: d.usagePolicyId, + }) + .transform(d => ({ + alert_id: d.alertId, + subscriptions: d.subscriptions, + pause_subscriptions: d.pauseSubscriptions, })); -export const marshalSubscriptionSchema: z.ZodType = z +export const marshalCreateSqlTaskDashboardSchema: z.ZodType = z .object({ - subscribers: z - .array(z.lazy(() => marshalSubscription_SubscriberSchema)) + dashboardId: z.string(), + subscriptions: z + .array(z.lazy(() => marshalCreateSqlTaskSubscriptionSchema)) .optional(), - paused: z.boolean().optional(), customSubject: z.string().optional(), + pauseSubscriptions: z.boolean().optional(), }) .transform(d => ({ - subscribers: d.subscribers, - paused: d.paused, + dashboard_id: d.dashboardId, + subscriptions: d.subscriptions, custom_subject: d.customSubject, + pause_subscriptions: d.pauseSubscriptions, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalSubscription_SubscriberSchema: z.ZodType = z +export const marshalCreateSqlTaskFileSchema: z.ZodType = z + .object({ + path: z.string(), + source: z.string().optional(), + }) + .transform(d => ({ + path: d.path, + source: d.source, + })); + +export const marshalCreateSqlTaskQuerySchema: z.ZodType = z + .object({ + queryType: z + .discriminatedUnion('$case', [ + z.object({$case: z.literal('queryId'), queryId: z.string()}), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.queryType?.$case === 'queryId' && {query_id: d.queryType.queryId}), + })); + +export const marshalCreateSqlTaskSubscriptionSchema: z.ZodType = z .object({ subscriptionType: z .discriminatedUnion('$case', [ @@ -10070,9 +12110,23 @@ export const marshalSubscription_SubscriberSchema: z.ZodType = z }), })); -export const marshalTableTriggerConfigurationSchema: z.ZodType = z +export const marshalCreateSubscriptionSchema: z.ZodType = z + .object({ + subscribers: z + .array(z.lazy(() => marshalSubscription_CreateSubscriberSchema)) + .optional(), + paused: z.boolean().optional(), + customSubject: z.string().optional(), + }) + .transform(d => ({ + subscribers: d.subscribers, + paused: d.paused, + custom_subject: d.customSubject, + })); + +export const marshalCreateTableTriggerConfigurationSchema: z.ZodType = z .object({ - tableNames: z.array(z.string()).optional(), + tableNames: z.array(z.string()), minTimeBetweenTriggersSeconds: z.number().optional(), waitAfterLastChangeSeconds: z.number().optional(), condition: z.string().optional(), @@ -10084,9 +12138,9 @@ export const marshalTableTriggerConfigurationSchema: z.ZodType = z condition: d.condition, })); -export const marshalTaskDependencySchema: z.ZodType = z +export const marshalCreateTaskDependencySchema: z.ZodType = z .object({ - taskKey: z.string().optional(), + taskKey: z.string(), outcome: z.string().optional(), }) .transform(d => ({ @@ -10094,21 +12148,23 @@ export const marshalTaskDependencySchema: z.ZodType = z outcome: d.outcome, })); -export const marshalTaskSettingsSchema: z.ZodType = z +export const marshalCreateTaskSettingsSchema: z.ZodType = z .object({ - taskKey: z.string().optional(), - dependsOn: z.array(z.lazy(() => marshalTaskDependencySchema)).optional(), + taskKey: z.string(), + dependsOn: z + .array(z.lazy(() => marshalCreateTaskDependencySchema)) + .optional(), runIf: z.string().optional(), timeoutSeconds: z.number().optional(), - health: z.lazy(() => marshalJobsHealthRulesSchema).optional(), + health: z.lazy(() => marshalCreateJobsHealthRulesSchema).optional(), emailNotifications: z - .lazy(() => marshalJobEmailNotificationsSchema) + .lazy(() => marshalCreateJobEmailNotificationsSchema) .optional(), notificationSettings: z - .lazy(() => marshalNotificationSettingsSchema) + .lazy(() => marshalCreateNotificationSettingsSchema) .optional(), webhookNotifications: z - .lazy(() => marshalWebhookNotificationsSchema) + .lazy(() => marshalCreateWebhookNotificationsSchema) .optional(), description: z.string().optional(), environmentRef: z @@ -10120,90 +12176,92 @@ export const marshalTaskSettingsSchema: z.ZodType = z ]) .optional(), disabled: z.boolean().optional(), - compute: z.lazy(() => marshalComputeSchema).optional(), + compute: z.lazy(() => marshalCreateComputeSchema).optional(), task: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('notebookTask'), - notebookTask: z.lazy(() => marshalNotebookTaskSchema), + notebookTask: z.lazy(() => marshalCreateNotebookTaskSchema), }), z.object({ $case: z.literal('sparkJarTask'), - sparkJarTask: z.lazy(() => marshalSparkJarTaskSchema), + sparkJarTask: z.lazy(() => marshalCreateSparkJarTaskSchema), }), z.object({ $case: z.literal('sparkPythonTask'), - sparkPythonTask: z.lazy(() => marshalSparkPythonTaskSchema), + sparkPythonTask: z.lazy(() => marshalCreateSparkPythonTaskSchema), }), z.object({ $case: z.literal('sparkSubmitTask'), - sparkSubmitTask: z.lazy(() => marshalSparkSubmitTaskSchema), + sparkSubmitTask: z.lazy(() => marshalCreateSparkSubmitTaskSchema), }), z.object({ $case: z.literal('pipelineTask'), - pipelineTask: z.lazy(() => marshalPipelineTaskSchema), + pipelineTask: z.lazy(() => marshalCreatePipelineTaskSchema), }), z.object({ $case: z.literal('pythonWheelTask'), - pythonWheelTask: z.lazy(() => marshalPythonWheelTaskSchema), + pythonWheelTask: z.lazy(() => marshalCreatePythonWheelTaskSchema), }), z.object({ $case: z.literal('dbtTask'), - dbtTask: z.lazy(() => marshalDbtTaskSchema), + dbtTask: z.lazy(() => marshalCreateDbtTaskSchema), }), z.object({ $case: z.literal('sqlTask'), - sqlTask: z.lazy(() => marshalSqlTaskSchema), + sqlTask: z.lazy(() => marshalCreateSqlTaskSchema), }), z.object({ $case: z.literal('runJobTask'), - runJobTask: z.lazy(() => marshalRunJobTaskSchema), + runJobTask: z.lazy(() => marshalCreateRunJobTaskSchema), }), z.object({ $case: z.literal('conditionTask'), - conditionTask: z.lazy(() => marshalConditionTaskSchema), + conditionTask: z.lazy(() => marshalCreateConditionTaskSchema), }), z.object({ $case: z.literal('forEachTask'), - forEachTask: z.lazy(() => marshalForEachTaskSchema), + forEachTask: z.lazy(() => marshalCreateForEachTaskSchema), }), z.object({ $case: z.literal('cleanRoomsNotebookTask'), cleanRoomsNotebookTask: z.lazy( - () => marshalCleanRoomsNotebookTaskSchema + () => marshalCreateCleanRoomsNotebookTaskSchema ), }), z.object({ $case: z.literal('genAiComputeTask'), - genAiComputeTask: z.lazy(() => marshalGenAiComputeTaskSchema), + genAiComputeTask: z.lazy(() => marshalCreateGenAiComputeTaskSchema), }), z.object({ $case: z.literal('alertTask'), - alertTask: z.lazy(() => marshalAlertTaskSchema), + alertTask: z.lazy(() => marshalCreateAlertTaskSchema), }), z.object({ $case: z.literal('powerBiTask'), - powerBiTask: z.lazy(() => marshalPowerBiTaskSchema), + powerBiTask: z.lazy(() => marshalCreatePowerBiTaskSchema), }), z.object({ $case: z.literal('dashboardTask'), - dashboardTask: z.lazy(() => marshalDashboardTaskSchema), + dashboardTask: z.lazy(() => marshalCreateDashboardTaskSchema), }), z.object({ $case: z.literal('dbtCloudTask'), - dbtCloudTask: z.lazy(() => marshalDbtCloudTaskSchema), + dbtCloudTask: z.lazy(() => marshalCreateDbtCloudTaskSchema), }), z.object({ $case: z.literal('dbtPlatformTask'), - dbtPlatformTask: z.lazy(() => marshalDbtPlatformTaskSchema), + dbtPlatformTask: z.lazy(() => marshalCreateDbtPlatformTaskSchema), }), z.object({ $case: z.literal('pythonOperatorTask'), - pythonOperatorTask: z.lazy(() => marshalPythonOperatorTaskSchema), + pythonOperatorTask: z.lazy( + () => marshalCreatePythonOperatorTaskSchema + ), }), z.object({ $case: z.literal('aiRuntimeTask'), - aiRuntimeTask: z.lazy(() => marshalAiRuntimeTaskSchema), + aiRuntimeTask: z.lazy(() => marshalCreateAiRuntimeTaskSchema), }), ]) .optional(), @@ -10215,7 +12273,7 @@ export const marshalTaskSettingsSchema: z.ZodType = z }), z.object({ $case: z.literal('newCluster'), - newCluster: z.lazy(() => marshalClusterSpec_NewClusterSchema), + newCluster: z.lazy(() => marshalClusterSpec_CreateNewClusterSchema), }), z.object({ $case: z.literal('jobClusterKey'), @@ -10223,7 +12281,7 @@ export const marshalTaskSettingsSchema: z.ZodType = z }), ]) .optional(), - libraries: z.array(z.lazy(() => marshalLibrarySchema)).optional(), + libraries: z.array(z.lazy(() => marshalCreateLibrarySchema)).optional(), maxRetries: z.number().optional(), minRetryIntervalMillis: z.number().optional(), retryOnTimeout: z.boolean().optional(), @@ -10306,7 +12364,7 @@ export const marshalTaskSettingsSchema: z.ZodType = z disable_auto_optimization: d.disableAutoOptimization, })); -export const marshalTriggerSettingsSchema: z.ZodType = z +export const marshalCreateTriggerSettingsSchema: z.ZodType = z .object({ pauseStatus: z.string().optional(), configuration: z @@ -10314,20 +12372,24 @@ export const marshalTriggerSettingsSchema: z.ZodType = z z.object({ $case: z.literal('fileArrival'), fileArrival: z.lazy( - () => marshalFileArrivalTriggerConfigurationSchema + () => marshalCreateFileArrivalTriggerConfigurationSchema ), }), z.object({ $case: z.literal('periodic'), - periodic: z.lazy(() => marshalPeriodicTriggerConfigurationSchema), + periodic: z.lazy( + () => marshalCreatePeriodicTriggerConfigurationSchema + ), }), z.object({ $case: z.literal('tableUpdate'), - tableUpdate: z.lazy(() => marshalTableTriggerConfigurationSchema), + tableUpdate: z.lazy( + () => marshalCreateTableTriggerConfigurationSchema + ), }), z.object({ $case: z.literal('model'), - model: z.lazy(() => marshalModelTriggerConfigurationSchema), + model: z.lazy(() => marshalCreateModelTriggerConfigurationSchema), }), ]) .optional(), @@ -10346,44 +12408,32 @@ export const marshalTriggerSettingsSchema: z.ZodType = z ...(d.configuration?.$case === 'model' && {model: d.configuration.model}), })); -export const marshalUpdateJobRequestSchema: z.ZodType = z - .object({ - jobId: z.bigint().optional(), - newSettings: z.lazy(() => marshalJobSettingsSchema).optional(), - fieldsToRemove: z.array(z.string()).optional(), - }) - .transform(d => ({ - job_id: d.jobId, - new_settings: d.newSettings, - fields_to_remove: d.fieldsToRemove, - })); - -export const marshalVolumesStorageInfoSchema: z.ZodType = z +export const marshalCreateVolumesStorageInfoSchema: z.ZodType = z .object({ - destination: z.string().optional(), + destination: z.string(), }) .transform(d => ({ destination: d.destination, })); -export const marshalWebhookSchema: z.ZodType = z +export const marshalCreateWebhookSchema: z.ZodType = z .object({ - id: z.string().optional(), + id: z.string(), }) .transform(d => ({ id: d.id, })); -export const marshalWebhookNotificationsSchema: z.ZodType = z +export const marshalCreateWebhookNotificationsSchema: z.ZodType = z .object({ - onStart: z.array(z.lazy(() => marshalWebhookSchema)).optional(), - onSuccess: z.array(z.lazy(() => marshalWebhookSchema)).optional(), - onFailure: z.array(z.lazy(() => marshalWebhookSchema)).optional(), + onStart: z.array(z.lazy(() => marshalCreateWebhookSchema)).optional(), + onSuccess: z.array(z.lazy(() => marshalCreateWebhookSchema)).optional(), + onFailure: z.array(z.lazy(() => marshalCreateWebhookSchema)).optional(), onDurationWarningThresholdExceeded: z - .array(z.lazy(() => marshalWebhookSchema)) + .array(z.lazy(() => marshalCreateWebhookSchema)) .optional(), onStreamingBacklogExceeded: z - .array(z.lazy(() => marshalWebhookSchema)) + .array(z.lazy(() => marshalCreateWebhookSchema)) .optional(), }) .transform(d => ({ @@ -10395,29 +12445,230 @@ export const marshalWebhookNotificationsSchema: z.ZodType = z on_streaming_backlog_exceeded: d.onStreamingBacklogExceeded, })); -export const marshalWorkloadTypeSchema: z.ZodType = z +export const marshalCreateWorkloadTypeSchema: z.ZodType = z .object({ - clients: z.lazy(() => marshalWorkloadType_ClientsTypesSchema).optional(), + clients: z.lazy(() => marshalWorkloadType_CreateClientsTypesSchema), }) .transform(d => ({ clients: d.clients, })); +export const marshalCreateWorkspaceStorageInfoSchema: z.ZodType = z + .object({ + destination: z.string(), + }) + .transform(d => ({ + destination: d.destination, + })); + +export const marshalDeleteJobRequestSchema: z.ZodType = z + .object({ + jobId: z.bigint().optional(), + }) + .transform(d => ({ + job_id: d.jobId, + })); + +export const marshalDeleteRunRequestSchema: z.ZodType = z + .object({ + runId: z.bigint().optional(), + }) + .transform(d => ({ + run_id: d.runId, + })); + +export const marshalEnforcePolicyComplianceForJobSchema: z.ZodType = z + .object({ + jobId: z.bigint().optional(), + validateOnly: z.boolean().optional(), + }) + .transform(d => ({ + job_id: d.jobId, + validate_only: d.validateOnly, + })); + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalWorkloadType_ClientsTypesSchema: z.ZodType = z +export const marshalPythonOperatorTask_CreateParameterSchema: z.ZodType = z .object({ - notebooks: z.boolean().optional(), - jobs: z.boolean().optional(), + name: z.string().optional(), + value: z.string().optional(), }) .transform(d => ({ - notebooks: d.notebooks, - jobs: d.jobs, + name: d.name, + value: d.value, })); -export const marshalWorkspaceStorageInfoSchema: z.ZodType = z +export const marshalRepairRunRequestSchema: z.ZodType = z .object({ - destination: z.string().optional(), + runId: z.bigint().optional(), + latestRepairId: z.bigint().optional(), + rerunTasks: z.array(z.string()).optional(), + jobParameters: z.record(z.string(), z.string()).optional(), + rerunAllFailedTasks: z.boolean().optional(), + rerunDependentTasks: z.boolean().optional(), + performanceTarget: z.string().optional(), + pipelineParams: z + .lazy(() => marshalCreatePipelineParametersSchema) + .optional(), + jarParams: z.array(z.string()).optional(), + notebookParams: z.record(z.string(), z.string()).optional(), + pythonParams: z.array(z.string()).optional(), + sparkSubmitParams: z.array(z.string()).optional(), + pythonNamedParams: z.record(z.string(), z.string()).optional(), + sqlParams: z.record(z.string(), z.string()).optional(), + dbtCommands: z.array(z.string()).optional(), }) .transform(d => ({ - destination: d.destination, + run_id: d.runId, + latest_repair_id: d.latestRepairId, + rerun_tasks: d.rerunTasks, + job_parameters: d.jobParameters, + rerun_all_failed_tasks: d.rerunAllFailedTasks, + rerun_dependent_tasks: d.rerunDependentTasks, + performance_target: d.performanceTarget, + pipeline_params: d.pipelineParams, + jar_params: d.jarParams, + notebook_params: d.notebookParams, + python_params: d.pythonParams, + spark_submit_params: d.sparkSubmitParams, + python_named_params: d.pythonNamedParams, + sql_params: d.sqlParams, + dbt_commands: d.dbtCommands, + })); + +export const marshalResetJobRequestSchema: z.ZodType = z + .object({ + jobId: z.bigint().optional(), + newSettings: z.lazy(() => marshalCreateJobSettingsSchema).optional(), + }) + .transform(d => ({ + job_id: d.jobId, + new_settings: d.newSettings, + })); + +export const marshalRunNowRequestSchema: z.ZodType = z + .object({ + jobId: z.bigint().optional(), + jobParameters: z.record(z.string(), z.string()).optional(), + idempotencyToken: z.string().optional(), + queue: z.lazy(() => marshalCreateQueueSettingsSchema).optional(), + only: z.array(z.string()).optional(), + performanceTarget: z.string().optional(), + pipelineParams: z + .lazy(() => marshalCreatePipelineParametersSchema) + .optional(), + jarParams: z.array(z.string()).optional(), + notebookParams: z.record(z.string(), z.string()).optional(), + pythonParams: z.array(z.string()).optional(), + sparkSubmitParams: z.array(z.string()).optional(), + pythonNamedParams: z.record(z.string(), z.string()).optional(), + sqlParams: z.record(z.string(), z.string()).optional(), + dbtCommands: z.array(z.string()).optional(), + }) + .transform(d => ({ + job_id: d.jobId, + job_parameters: d.jobParameters, + idempotency_token: d.idempotencyToken, + queue: d.queue, + only: d.only, + performance_target: d.performanceTarget, + pipeline_params: d.pipelineParams, + jar_params: d.jarParams, + notebook_params: d.notebookParams, + python_params: d.pythonParams, + spark_submit_params: d.sparkSubmitParams, + python_named_params: d.pythonNamedParams, + sql_params: d.sqlParams, + dbt_commands: d.dbtCommands, + })); + +export const marshalSubmitRunRequestSchema: z.ZodType = z + .object({ + accessControlList: z + .array(z.lazy(() => marshalCreateAccessControlRequestSchema)) + .optional(), + queue: z.lazy(() => marshalCreateQueueSettingsSchema).optional(), + runAs: z.lazy(() => marshalCreateJobRunAsSchema).optional(), + runName: z.string().optional(), + timeoutSeconds: z.number().optional(), + health: z.lazy(() => marshalCreateJobsHealthRulesSchema).optional(), + idempotencyToken: z.string().optional(), + tasks: z.array(z.lazy(() => marshalCreateRunTaskSettingsSchema)).optional(), + gitSource: z.lazy(() => marshalCreateGitSourceSchema).optional(), + webhookNotifications: z + .lazy(() => marshalCreateWebhookNotificationsSchema) + .optional(), + emailNotifications: z + .lazy(() => marshalCreateJobEmailNotificationsSchema) + .optional(), + notificationSettings: z + .lazy(() => marshalCreateNotificationSettingsSchema) + .optional(), + environments: z + .array(z.lazy(() => marshalCreateJobEnvironmentSchema)) + .optional(), + budgetPolicyId: z.string().optional(), + usagePolicyId: z.string().optional(), + }) + .transform(d => ({ + access_control_list: d.accessControlList, + queue: d.queue, + run_as: d.runAs, + run_name: d.runName, + timeout_seconds: d.timeoutSeconds, + health: d.health, + idempotency_token: d.idempotencyToken, + tasks: d.tasks, + git_source: d.gitSource, + webhook_notifications: d.webhookNotifications, + email_notifications: d.emailNotifications, + notification_settings: d.notificationSettings, + environments: d.environments, + budget_policy_id: d.budgetPolicyId, + usage_policy_id: d.usagePolicyId, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalSubscription_CreateSubscriberSchema: z.ZodType = z + .object({ + subscriptionType: z + .discriminatedUnion('$case', [ + z.object({$case: z.literal('userName'), userName: z.string()}), + z.object({ + $case: z.literal('destinationId'), + destinationId: z.string(), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.subscriptionType?.$case === 'userName' && { + user_name: d.subscriptionType.userName, + }), + ...(d.subscriptionType?.$case === 'destinationId' && { + destination_id: d.subscriptionType.destinationId, + }), + })); + +export const marshalUpdateJobRequestSchema: z.ZodType = z + .object({ + jobId: z.bigint().optional(), + newSettings: z.lazy(() => marshalCreateJobSettingsSchema).optional(), + fieldsToRemove: z.array(z.string()).optional(), + }) + .transform(d => ({ + job_id: d.jobId, + new_settings: d.newSettings, + fields_to_remove: d.fieldsToRemove, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalWorkloadType_CreateClientsTypesSchema: z.ZodType = z + .object({ + notebooks: z.boolean().optional(), + jobs: z.boolean().optional(), + }) + .transform(d => ({ + notebooks: d.notebooks, + jobs: d.jobs, })); diff --git a/packages/keyconfigurations/src/v1/index.ts b/packages/keyconfigurations/src/v1/index.ts index bf8bb834..a45aa223 100755 --- a/packages/keyconfigurations/src/v1/index.ts +++ b/packages/keyconfigurations/src/v1/index.ts @@ -13,8 +13,13 @@ export type { AzureKeyInfo, CreateAwsKeyInfo, CreateAzureKeyInfo, + CreateCreateAwsKeyInfo, + CreateCreateAzureKeyInfo, + CreateCreateGcpKeyInfo, CreateCustomerManagedKeyRequest, CreateGcpKeyInfo, + CreateGcpServiceAccount, + CreateKeyAccessConfiguration, CustomerManagedKey, DeleteCustomerManagedKeyRequest, GcpKeyInfo, diff --git a/packages/keyconfigurations/src/v1/model.ts b/packages/keyconfigurations/src/v1/model.ts index 212ecc07..77b0ede9 100644 --- a/packages/keyconfigurations/src/v1/model.ts +++ b/packages/keyconfigurations/src/v1/model.ts @@ -83,6 +83,60 @@ export interface CreateAzureKeyInfo { keyAccessConfiguration?: KeyAccessConfiguration | undefined; } +export interface CreateCreateAwsKeyInfo { + /** The AWS KMS key's Amazon Resource Name (ARN). */ + keyArn: string; + /** The AWS KMS key alias. */ + keyAlias?: string | undefined; + /** The AWS KMS key region. */ + keyRegion?: string | undefined; + /** + * This field applies only if the `use_cases` property includes `STORAGE`. If this is set to true or omitted, the key is also used to encrypt + * cluster EBS volumes. If you do not want to use this key for encrypting EBS volumes, set to false. + */ + reuseKeyForClusterVolumes?: boolean | undefined; +} + +export interface CreateCreateAzureKeyInfo { + /** The base URI of the KeyVault. */ + keyVaultUri?: string | undefined; + /** The name of the key in KeyVault. */ + keyName?: string | undefined; + /** The current key version. */ + version?: string | undefined; + /** The tenant id where the KeyVault lives. */ + tenantId?: string | undefined; + /** + * The Disk Encryption Set id that is used to represent the key info used for + * Managed Disk BYOK use case + */ + diskEncryptionSetId?: string | undefined; + /** + * The structure to store key access credential + * This is set if the Managed Identity is being used to access the Azure Key Vault key. + */ + keyAccessConfiguration?: CreateKeyAccessConfiguration | undefined; +} + +export interface CreateCreateGcpKeyInfo { + /** + * Globally unique kms key resource id of the form + * projects/testProjectId/locations/us-east4/keyRings/gcpCmkKeyRing/cryptoKeys/cmk-eastus4 + */ + kmsKeyId: string; + /** + * Globally unique service account email that has access to the KMS key. + * The service account exists within the Databricks CP project. + */ + gcpServiceAccount?: CreateGcpServiceAccount | undefined; + /** + * When true, will not use OAuth to grant the service account + * access to the KMS key. The customer is responsible for granting access + * manually. + */ + manual?: boolean | undefined; +} + export interface CreateCustomerManagedKeyRequest { accountId?: string | undefined; /** @@ -90,9 +144,9 @@ export interface CreateCustomerManagedKeyRequest { * azure_key_info must be set, matching the cloud of the account. --) */ keyInfo?: - | {$case: 'awsKeyInfo'; awsKeyInfo: CreateAwsKeyInfo} - | {$case: 'gcpKeyInfo'; gcpKeyInfo: CreateGcpKeyInfo} - | {$case: 'azureKeyInfo'; azureKeyInfo: CreateAzureKeyInfo} + | {$case: 'awsKeyInfo'; awsKeyInfo: CreateCreateAwsKeyInfo} + | {$case: 'gcpKeyInfo'; gcpKeyInfo: CreateCreateGcpKeyInfo} + | {$case: 'azureKeyInfo'; azureKeyInfo: CreateCreateAzureKeyInfo} | undefined; /** The cases that the key can be used for. */ useCases?: CmkUseCase[] | undefined; @@ -117,6 +171,15 @@ export interface CreateGcpKeyInfo { manual?: boolean | undefined; } +export interface CreateGcpServiceAccount { + serviceAccountEmail?: string | undefined; +} + +/** The credential ID that is used to access the key vault. */ +export interface CreateKeyAccessConfiguration { + credentialId?: string | undefined; +} + export interface CustomerManagedKey { /** ID of the encryption key configuration object. */ customerManagedKeyId?: string | undefined; @@ -279,9 +342,9 @@ export const unmarshalKeyAccessConfigurationSchema: z.ZodType marshalKeyAccessConfigurationSchema) + .lazy(() => marshalCreateKeyAccessConfigurationSchema) .optional(), }) .transform(d => ({ @@ -313,6 +376,20 @@ export const marshalCreateAzureKeyInfoSchema: z.ZodType = z key_access_configuration: d.keyAccessConfiguration, })); +export const marshalCreateCreateGcpKeyInfoSchema: z.ZodType = z + .object({ + kmsKeyId: z.string(), + gcpServiceAccount: z + .lazy(() => marshalCreateGcpServiceAccountSchema) + .optional(), + manual: z.boolean().optional(), + }) + .transform(d => ({ + kms_key_id: d.kmsKeyId, + gcp_service_account: d.gcpServiceAccount, + manual: d.manual, + })); + export const marshalCreateCustomerManagedKeyRequestSchema: z.ZodType = z .object({ accountId: z.string().optional(), @@ -320,15 +397,15 @@ export const marshalCreateCustomerManagedKeyRequestSchema: z.ZodType = z .discriminatedUnion('$case', [ z.object({ $case: z.literal('awsKeyInfo'), - awsKeyInfo: z.lazy(() => marshalCreateAwsKeyInfoSchema), + awsKeyInfo: z.lazy(() => marshalCreateCreateAwsKeyInfoSchema), }), z.object({ $case: z.literal('gcpKeyInfo'), - gcpKeyInfo: z.lazy(() => marshalCreateGcpKeyInfoSchema), + gcpKeyInfo: z.lazy(() => marshalCreateCreateGcpKeyInfoSchema), }), z.object({ $case: z.literal('azureKeyInfo'), - azureKeyInfo: z.lazy(() => marshalCreateAzureKeyInfoSchema), + azureKeyInfo: z.lazy(() => marshalCreateCreateAzureKeyInfoSchema), }), ]) .optional(), @@ -348,19 +425,7 @@ export const marshalCreateCustomerManagedKeyRequestSchema: z.ZodType = z use_cases: d.useCases, })); -export const marshalCreateGcpKeyInfoSchema: z.ZodType = z - .object({ - kmsKeyId: z.string().optional(), - gcpServiceAccount: z.lazy(() => marshalGcpServiceAccountSchema).optional(), - manual: z.boolean().optional(), - }) - .transform(d => ({ - kms_key_id: d.kmsKeyId, - gcp_service_account: d.gcpServiceAccount, - manual: d.manual, - })); - -export const marshalGcpServiceAccountSchema: z.ZodType = z +export const marshalCreateGcpServiceAccountSchema: z.ZodType = z .object({ serviceAccountEmail: z.string().optional(), }) @@ -368,7 +433,7 @@ export const marshalGcpServiceAccountSchema: z.ZodType = z service_account_email: d.serviceAccountEmail, })); -export const marshalKeyAccessConfigurationSchema: z.ZodType = z +export const marshalCreateKeyAccessConfigurationSchema: z.ZodType = z .object({ credentialId: z.string().optional(), }) diff --git a/packages/knowledgeassistants/src/v1/client.ts b/packages/knowledgeassistants/src/v1/client.ts index 3a68ca5c..b38c53c8 100644 --- a/packages/knowledgeassistants/src/v1/client.ts +++ b/packages/knowledgeassistants/src/v1/client.ts @@ -41,10 +41,13 @@ import type { UpdateKnowledgeSourceRequest, } from './model'; import { - marshalExampleSchema, - marshalKnowledgeAssistantSchema, - marshalKnowledgeSourceSchema, + marshalCreateExampleSchema, + marshalCreateKnowledgeAssistantSchema, + marshalCreateKnowledgeSourceSchema, marshalSyncKnowledgeSourcesRequestSchema, + marshalUpdateExampleSchema, + marshalUpdateKnowledgeAssistantSchema, + marshalUpdateKnowledgeSourceSchema, unmarshalExampleSchema, unmarshalKnowledgeAssistantSchema, unmarshalKnowledgeSourceSchema, @@ -93,7 +96,7 @@ export class KnowledgeAssistantsClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.1/${req.parent ?? ''}/examples`; - const body = marshalRequest(req.example, marshalExampleSchema); + const body = marshalRequest(req.example, marshalCreateExampleSchema); let resp: Example | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -125,7 +128,7 @@ export class KnowledgeAssistantsClient { const url = `${host}/api/2.1/knowledge-assistants`; const body = marshalRequest( req.knowledgeAssistant, - marshalKnowledgeAssistantSchema + marshalCreateKnowledgeAssistantSchema ); let resp: KnowledgeAssistant | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -158,7 +161,7 @@ export class KnowledgeAssistantsClient { const url = `${host}/api/2.1/${req.parent ?? ''}/knowledge-sources`; const body = marshalRequest( req.knowledgeSource, - marshalKnowledgeSourceSchema + marshalCreateKnowledgeSourceSchema ); let resp: KnowledgeSource | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -546,7 +549,7 @@ export class KnowledgeAssistantsClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.example, marshalExampleSchema); + const body = marshalRequest(req.example, marshalUpdateExampleSchema); let resp: Example | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -590,7 +593,7 @@ export class KnowledgeAssistantsClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.knowledgeAssistant, - marshalKnowledgeAssistantSchema + marshalUpdateKnowledgeAssistantSchema ); let resp: KnowledgeAssistant | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -635,7 +638,7 @@ export class KnowledgeAssistantsClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.knowledgeSource, - marshalKnowledgeSourceSchema + marshalUpdateKnowledgeSourceSchema ); let resp: KnowledgeSource | undefined; const call = async (callSignal?: AbortSignal): Promise => { diff --git a/packages/knowledgeassistants/src/v1/index.ts b/packages/knowledgeassistants/src/v1/index.ts index 490cc86f..caaddf7b 100755 --- a/packages/knowledgeassistants/src/v1/index.ts +++ b/packages/knowledgeassistants/src/v1/index.ts @@ -9,8 +9,14 @@ export {KnowledgeAssistantsClient} from './client'; export {KnowledgeAssistant_State, KnowledgeSource_State} from './model'; export type { + CreateExample, CreateExampleRequest, + CreateFileTableSpec, + CreateFilesSpec, + CreateIndexSpec, + CreateKnowledgeAssistant, CreateKnowledgeAssistantRequest, + CreateKnowledgeSource, CreateKnowledgeSourceRequest, DeleteExampleRequest, DeleteKnowledgeAssistantRequest, @@ -31,13 +37,19 @@ export type { ListKnowledgeSourcesRequest, ListKnowledgeSourcesResponse, SyncKnowledgeSourcesRequest, + UpdateExample, UpdateExampleRequest, + UpdateFileTableSpec, + UpdateFilesSpec, + UpdateIndexSpec, + UpdateKnowledgeAssistant, UpdateKnowledgeAssistantRequest, + UpdateKnowledgeSource, UpdateKnowledgeSourceRequest, } from './model'; export { - exampleFieldMask, - knowledgeAssistantFieldMask, - knowledgeSourceFieldMask, + updateExampleFieldMask, + updateKnowledgeAssistantFieldMask, + updateKnowledgeSourceFieldMask, } from './model'; diff --git a/packages/knowledgeassistants/src/v1/model.ts b/packages/knowledgeassistants/src/v1/model.ts index 83757369..f7785245 100644 --- a/packages/knowledgeassistants/src/v1/model.ts +++ b/packages/knowledgeassistants/src/v1/model.ts @@ -29,6 +29,25 @@ export type KnowledgeSource_State = | (typeof KnowledgeSource_State)[keyof typeof KnowledgeSource_State] | (string & {}); +/** + * An example associated with a Knowledge Assistant. + * Contains a question and guidelines for how the assistant should respond. + */ +export interface CreateExample { + /** + * Full resource name: + * knowledge-assistants/{knowledge_assistant_id}/examples/{example_id} + */ + name?: string | undefined; + /** The example question. */ + question: string; + /** + * Guidelines for answering the question. Optional — examples may be created + * with just a question; the front-end form does not require guidelines. + */ + guidelines?: string[] | undefined; +} + /** Create an example. */ export interface CreateExampleRequest { /** @@ -37,12 +56,108 @@ export interface CreateExampleRequest { */ parent?: string | undefined; /** The example to create under the parent Knowledge Assistant. */ - example?: Example | undefined; + example?: CreateExample | undefined; +} + +/** FileTableSpec specifies a file table source configuration. */ +export interface CreateFileTableSpec { + /** Full UC name of the table, in the format of {CATALOG}.{SCHEMA}.{TABLE_NAME}. */ + tableName: string; + /** The name of the column containing BINARY file content to be indexed. */ + fileCol: string; +} + +/** FilesSpec specifies a files source configuration. */ +export interface CreateFilesSpec { + /** A UC volume path that includes a list of files. */ + path: string; +} + +/** IndexSpec specifies a vector search index source configuration. */ +export interface CreateIndexSpec { + /** Full UC name of the vector search index, in the format of {CATALOG}.{SCHEMA}.{INDEX_NAME}. */ + indexName: string; + /** The column that includes the document text for retrieval. */ + textCol: string; + /** The column that specifies a link or reference to where the information came from. */ + docUriCol: string; +} + +/** + * Entity message that represents a knowledge assistant. + * Note: REQUIRED annotations below represent create-time requirements. + * For updates, required fields are determined by the update mask. + */ +export interface CreateKnowledgeAssistant { + /** + * The resource name of the Knowledge Assistant. + * Format: knowledge-assistants/{knowledge_assistant_id} + */ + name?: string | undefined; + /** + * The display name of the Knowledge Assistant, unique at workspace level. + * Required when creating a Knowledge Assistant. + * When updating a Knowledge Assistant, optional unless included in + * update_mask. + */ + displayName: string; + /** + * Description of what this agent can do (user-facing). + * Required when creating a Knowledge Assistant. + * When updating a Knowledge Assistant, optional unless included in + * update_mask. + */ + description: string; + /** + * Additional global instructions on how the agent should generate answers. + * Optional on create and update. + * When updating a Knowledge Assistant, include this field in update_mask to + * modify it. + */ + instructions?: string | undefined; } export interface CreateKnowledgeAssistantRequest { /** The Knowledge Assistant to create. */ - knowledgeAssistant?: KnowledgeAssistant | undefined; + knowledgeAssistant?: CreateKnowledgeAssistant | undefined; +} + +/** + * KnowledgeSource represents a source of knowledge for the KnowledgeAssistant. + * Used in create/update requests and returned in Get/List responses. + * Note: REQUIRED annotations below represent create-time requirements. + * For updates, required fields are determined by the update mask. + */ +export interface CreateKnowledgeSource { + /** + * Full resource name: + * knowledge-assistants/{knowledge_assistant_id}/knowledge-sources/{knowledge_source_id} + */ + name?: string | undefined; + /** + * Human-readable display name of the knowledge source. + * Required when creating a Knowledge Source. + * When updating a Knowledge Source, optional unless included in update_mask. + */ + displayName: string; + /** + * Description of the knowledge source. + * Required when creating a Knowledge Source. + * When updating a Knowledge Source, optional unless included in update_mask. + */ + description: string; + /** + * The type of the source: "index", "files", or "file_table". + * Required when creating a Knowledge Source. + * When updating a Knowledge Source, this field is ignored. + */ + sourceType: string; + /** Specification for the knowledge source type. */ + spec?: + | {$case: 'index'; index: CreateIndexSpec} + | {$case: 'files'; files: CreateFilesSpec} + | {$case: 'fileTable'; fileTable: CreateFileTableSpec} + | undefined; } export interface CreateKnowledgeSourceRequest { @@ -51,7 +166,7 @@ export interface CreateKnowledgeSourceRequest { * Format: knowledge-assistants/{knowledge_assistant_id} */ parent?: string | undefined; - knowledgeSource?: KnowledgeSource | undefined; + knowledgeSource?: CreateKnowledgeSource | undefined; } /** Delete an example. */ @@ -323,6 +438,25 @@ export interface SyncKnowledgeSourcesRequest { name?: string | undefined; } +/** + * An example associated with a Knowledge Assistant. + * Contains a question and guidelines for how the assistant should respond. + */ +export interface UpdateExample { + /** + * Full resource name: + * knowledge-assistants/{knowledge_assistant_id}/examples/{example_id} + */ + name?: string | undefined; + /** The example question. */ + question?: string | undefined; + /** + * Guidelines for answering the question. Optional — examples may be created + * with just a question; the front-end form does not require guidelines. + */ + guidelines?: string[] | undefined; +} + /** Update an example. */ export interface UpdateExampleRequest { /** @@ -330,7 +464,7 @@ export interface UpdateExampleRequest { * Format: knowledge-assistants/{knowledge_assistant_id}/examples/{example_id} */ name?: string | undefined; - example?: Example | undefined; + example?: UpdateExample | undefined; /** * Comma-delimited list of fields to update on the example. * Allowed values: `question`, `guidelines`. @@ -338,7 +472,65 @@ export interface UpdateExampleRequest { * - `question` * - `question,guidelines` */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; +} + +/** FileTableSpec specifies a file table source configuration. */ +export interface UpdateFileTableSpec { + /** Full UC name of the table, in the format of {CATALOG}.{SCHEMA}.{TABLE_NAME}. */ + tableName?: string | undefined; + /** The name of the column containing BINARY file content to be indexed. */ + fileCol?: string | undefined; +} + +/** FilesSpec specifies a files source configuration. */ +export interface UpdateFilesSpec { + /** A UC volume path that includes a list of files. */ + path?: string | undefined; +} + +/** IndexSpec specifies a vector search index source configuration. */ +export interface UpdateIndexSpec { + /** Full UC name of the vector search index, in the format of {CATALOG}.{SCHEMA}.{INDEX_NAME}. */ + indexName?: string | undefined; + /** The column that includes the document text for retrieval. */ + textCol?: string | undefined; + /** The column that specifies a link or reference to where the information came from. */ + docUriCol?: string | undefined; +} + +/** + * Entity message that represents a knowledge assistant. + * Note: REQUIRED annotations below represent create-time requirements. + * For updates, required fields are determined by the update mask. + */ +export interface UpdateKnowledgeAssistant { + /** + * The resource name of the Knowledge Assistant. + * Format: knowledge-assistants/{knowledge_assistant_id} + */ + name?: string | undefined; + /** + * The display name of the Knowledge Assistant, unique at workspace level. + * Required when creating a Knowledge Assistant. + * When updating a Knowledge Assistant, optional unless included in + * update_mask. + */ + displayName?: string | undefined; + /** + * Description of what this agent can do (user-facing). + * Required when creating a Knowledge Assistant. + * When updating a Knowledge Assistant, optional unless included in + * update_mask. + */ + description?: string | undefined; + /** + * Additional global instructions on how the agent should generate answers. + * Optional on create and update. + * When updating a Knowledge Assistant, include this field in update_mask to + * modify it. + */ + instructions?: string | undefined; } export interface UpdateKnowledgeAssistantRequest { @@ -348,7 +540,7 @@ export interface UpdateKnowledgeAssistantRequest { * REQUIRED annotations on Knowledge Assistant fields describe create-time * requirements and do not mean all those fields are required for update. */ - knowledgeAssistant?: KnowledgeAssistant | undefined; + knowledgeAssistant?: UpdateKnowledgeAssistant | undefined; /** * Comma-delimited list of fields to update on the Knowledge Assistant. * Allowed values: `display_name`, `description`, `instructions`. @@ -356,7 +548,45 @@ export interface UpdateKnowledgeAssistantRequest { * - `display_name` * - `description,instructions` */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; +} + +/** + * KnowledgeSource represents a source of knowledge for the KnowledgeAssistant. + * Used in create/update requests and returned in Get/List responses. + * Note: REQUIRED annotations below represent create-time requirements. + * For updates, required fields are determined by the update mask. + */ +export interface UpdateKnowledgeSource { + /** + * Full resource name: + * knowledge-assistants/{knowledge_assistant_id}/knowledge-sources/{knowledge_source_id} + */ + name?: string | undefined; + /** + * Human-readable display name of the knowledge source. + * Required when creating a Knowledge Source. + * When updating a Knowledge Source, optional unless included in update_mask. + */ + displayName?: string | undefined; + /** + * Description of the knowledge source. + * Required when creating a Knowledge Source. + * When updating a Knowledge Source, optional unless included in update_mask. + */ + description?: string | undefined; + /** + * The type of the source: "index", "files", or "file_table". + * Required when creating a Knowledge Source. + * When updating a Knowledge Source, this field is ignored. + */ + sourceType?: string | undefined; + /** Specification for the knowledge source type. */ + spec?: + | {$case: 'index'; index: UpdateIndexSpec} + | {$case: 'files'; files: UpdateFilesSpec} + | {$case: 'fileTable'; fileTable: UpdateFileTableSpec} + | undefined; } export interface UpdateKnowledgeSourceRequest { @@ -371,7 +601,7 @@ export interface UpdateKnowledgeSourceRequest { * REQUIRED annotations on Knowledge Source fields describe create-time * requirements and do not mean all those fields are required for update. */ - knowledgeSource?: KnowledgeSource | undefined; + knowledgeSource?: UpdateKnowledgeSource | undefined; /** * Comma-delimited list of fields to update on the Knowledge Source. * Allowed values: `display_name`, `description`. @@ -379,7 +609,7 @@ export interface UpdateKnowledgeSourceRequest { * - `display_name` * - `display_name,description` */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalExampleSchema: z.ZodType = z @@ -544,31 +774,116 @@ export const unmarshalListKnowledgeSourcesResponseSchema: z.ZodType d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + }) + .transform(d => ({ + name: d.name, + question: d.question, + guidelines: d.guidelines, + })); + +export const marshalCreateFileTableSpecSchema: z.ZodType = z + .object({ + tableName: z.string(), + fileCol: z.string(), + }) + .transform(d => ({ + table_name: d.tableName, + file_col: d.fileCol, + })); + +export const marshalCreateFilesSpecSchema: z.ZodType = z + .object({ + path: z.string(), + }) + .transform(d => ({ + path: d.path, + })); + +export const marshalCreateIndexSpecSchema: z.ZodType = z + .object({ + indexName: z.string(), + textCol: z.string(), + docUriCol: z.string(), + }) + .transform(d => ({ + index_name: d.indexName, + text_col: d.textCol, + doc_uri_col: d.docUriCol, + })); + +export const marshalCreateKnowledgeAssistantSchema: z.ZodType = z + .object({ + name: z.string().optional(), + displayName: z.string(), + description: z.string(), + instructions: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + display_name: d.displayName, + description: d.description, + instructions: d.instructions, + })); + +export const marshalCreateKnowledgeSourceSchema: z.ZodType = z + .object({ + name: z.string().optional(), + displayName: z.string(), + description: z.string(), + sourceType: z.string(), + spec: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('index'), + index: z.lazy(() => marshalCreateIndexSpecSchema), + }), + z.object({ + $case: z.literal('files'), + files: z.lazy(() => marshalCreateFilesSpecSchema), + }), + z.object({ + $case: z.literal('fileTable'), + fileTable: z.lazy(() => marshalCreateFileTableSpecSchema), + }), + ]) .optional(), }) + .transform(d => ({ + name: d.name, + display_name: d.displayName, + description: d.description, + source_type: d.sourceType, + ...(d.spec?.$case === 'index' && {index: d.spec.index}), + ...(d.spec?.$case === 'files' && {files: d.spec.files}), + ...(d.spec?.$case === 'fileTable' && {file_table: d.spec.fileTable}), + })); + +export const marshalSyncKnowledgeSourcesRequestSchema: z.ZodType = z + .object({ + name: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + })); + +export const marshalUpdateExampleSchema: z.ZodType = z + .object({ + name: z.string().optional(), + question: z.string().optional(), + guidelines: z.array(z.string()).optional(), + }) .transform(d => ({ name: d.name, question: d.question, guidelines: d.guidelines, - example_id: d.exampleId, - create_time: d.createTime, - update_time: d.updateTime, })); -export const marshalFileTableSpecSchema: z.ZodType = z +export const marshalUpdateFileTableSpecSchema: z.ZodType = z .object({ tableName: z.string().optional(), fileCol: z.string().optional(), @@ -578,7 +893,7 @@ export const marshalFileTableSpecSchema: z.ZodType = z file_col: d.fileCol, })); -export const marshalFilesSpecSchema: z.ZodType = z +export const marshalUpdateFilesSpecSchema: z.ZodType = z .object({ path: z.string().optional(), }) @@ -586,7 +901,7 @@ export const marshalFilesSpecSchema: z.ZodType = z path: d.path, })); -export const marshalIndexSpecSchema: z.ZodType = z +export const marshalUpdateIndexSpecSchema: z.ZodType = z .object({ indexName: z.string().optional(), textCol: z.string().optional(), @@ -598,38 +913,21 @@ export const marshalIndexSpecSchema: z.ZodType = z doc_uri_col: d.docUriCol, })); -export const marshalKnowledgeAssistantSchema: z.ZodType = z +export const marshalUpdateKnowledgeAssistantSchema: z.ZodType = z .object({ name: z.string().optional(), - state: z.string().optional(), - id: z.string().optional(), displayName: z.string().optional(), description: z.string().optional(), instructions: z.string().optional(), - creator: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - endpointName: z.string().optional(), - experimentId: z.string().optional(), - errorInfo: z.string().optional(), }) .transform(d => ({ name: d.name, - state: d.state, - id: d.id, display_name: d.displayName, description: d.description, instructions: d.instructions, - creator: d.creator, - create_time: d.createTime, - endpoint_name: d.endpointName, - experiment_id: d.experimentId, - error_info: d.errorInfo, })); -export const marshalKnowledgeSourceSchema: z.ZodType = z +export const marshalUpdateKnowledgeSourceSchema: z.ZodType = z .object({ name: z.string().optional(), displayName: z.string().optional(), @@ -639,28 +937,18 @@ export const marshalKnowledgeSourceSchema: z.ZodType = z .discriminatedUnion('$case', [ z.object({ $case: z.literal('index'), - index: z.lazy(() => marshalIndexSpecSchema), + index: z.lazy(() => marshalUpdateIndexSpecSchema), }), z.object({ $case: z.literal('files'), - files: z.lazy(() => marshalFilesSpecSchema), + files: z.lazy(() => marshalUpdateFilesSpecSchema), }), z.object({ $case: z.literal('fileTable'), - fileTable: z.lazy(() => marshalFileTableSpecSchema), + fileTable: z.lazy(() => marshalUpdateFileTableSpecSchema), }), ]) .optional(), - state: z.string().optional(), - id: z.string().optional(), - knowledgeCutoffTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), }) .transform(d => ({ name: d.name, @@ -670,90 +958,69 @@ export const marshalKnowledgeSourceSchema: z.ZodType = z ...(d.spec?.$case === 'index' && {index: d.spec.index}), ...(d.spec?.$case === 'files' && {files: d.spec.files}), ...(d.spec?.$case === 'fileTable' && {file_table: d.spec.fileTable}), - state: d.state, - id: d.id, - knowledge_cutoff_time: d.knowledgeCutoffTime, - create_time: d.createTime, })); -export const marshalSyncKnowledgeSourcesRequestSchema: z.ZodType = z - .object({ - name: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - })); - -const exampleFieldMaskSchema: FieldMaskSchema = { - createTime: {wire: 'create_time'}, - exampleId: {wire: 'example_id'}, +const updateExampleFieldMaskSchema: FieldMaskSchema = { guidelines: {wire: 'guidelines'}, name: {wire: 'name'}, question: {wire: 'question'}, - updateTime: {wire: 'update_time'}, }; -export function exampleFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, exampleFieldMaskSchema); +export function updateExampleFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, updateExampleFieldMaskSchema); } -const fileTableSpecFieldMaskSchema: FieldMaskSchema = { +const updateFileTableSpecFieldMaskSchema: FieldMaskSchema = { fileCol: {wire: 'file_col'}, tableName: {wire: 'table_name'}, }; -const filesSpecFieldMaskSchema: FieldMaskSchema = { +const updateFilesSpecFieldMaskSchema: FieldMaskSchema = { path: {wire: 'path'}, }; -const indexSpecFieldMaskSchema: FieldMaskSchema = { +const updateIndexSpecFieldMaskSchema: FieldMaskSchema = { docUriCol: {wire: 'doc_uri_col'}, indexName: {wire: 'index_name'}, textCol: {wire: 'text_col'}, }; -const knowledgeAssistantFieldMaskSchema: FieldMaskSchema = { - createTime: {wire: 'create_time'}, - creator: {wire: 'creator'}, +const updateKnowledgeAssistantFieldMaskSchema: FieldMaskSchema = { description: {wire: 'description'}, displayName: {wire: 'display_name'}, - endpointName: {wire: 'endpoint_name'}, - errorInfo: {wire: 'error_info'}, - experimentId: {wire: 'experiment_id'}, - id: {wire: 'id'}, instructions: {wire: 'instructions'}, name: {wire: 'name'}, - state: {wire: 'state'}, }; -export function knowledgeAssistantFieldMask( +export function updateKnowledgeAssistantFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - knowledgeAssistantFieldMaskSchema + updateKnowledgeAssistantFieldMaskSchema ); } -const knowledgeSourceFieldMaskSchema: FieldMaskSchema = { - createTime: {wire: 'create_time'}, +const updateKnowledgeSourceFieldMaskSchema: FieldMaskSchema = { description: {wire: 'description'}, displayName: {wire: 'display_name'}, - fileTable: {wire: 'file_table', children: () => fileTableSpecFieldMaskSchema}, - files: {wire: 'files', children: () => filesSpecFieldMaskSchema}, - id: {wire: 'id'}, - index: {wire: 'index', children: () => indexSpecFieldMaskSchema}, - knowledgeCutoffTime: {wire: 'knowledge_cutoff_time'}, + fileTable: { + wire: 'file_table', + children: () => updateFileTableSpecFieldMaskSchema, + }, + files: {wire: 'files', children: () => updateFilesSpecFieldMaskSchema}, + index: {wire: 'index', children: () => updateIndexSpecFieldMaskSchema}, name: {wire: 'name'}, sourceType: {wire: 'source_type'}, - state: {wire: 'state'}, }; -export function knowledgeSourceFieldMask( +export function updateKnowledgeSourceFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - knowledgeSourceFieldMaskSchema + updateKnowledgeSourceFieldMaskSchema ); } diff --git a/packages/lakeview/src/v1/client.ts b/packages/lakeview/src/v1/client.ts index b4f1fc7e..69b97ce4 100644 --- a/packages/lakeview/src/v1/client.ts +++ b/packages/lakeview/src/v1/client.ts @@ -50,12 +50,12 @@ import type { UpdateScheduleRequest, } from './model'; import { - marshalDashboardSchema, + marshalCreateDashboardSchema, + marshalCreateScheduleSchema, + marshalCreateSubscriptionSchema, marshalMigrateDashboardRequestSchema, marshalPublishDashboardRequestSchema, marshalRevertDashboardRequestSchema, - marshalScheduleSchema, - marshalSubscriptionSchema, unmarshalDashboardSchema, unmarshalGetPublishedDashboardTokenInfoResponseSchema, unmarshalListDashboardsResponseSchema, @@ -118,7 +118,7 @@ export class LakeviewClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.dashboard, marshalDashboardSchema); + const body = marshalRequest(req.dashboard, marshalCreateDashboardSchema); let resp: Dashboard | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -154,7 +154,7 @@ export class LakeviewClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/lakeview/dashboards/${req.schedule?.dashboardId ?? ''}/schedules`; - const body = marshalRequest(req.schedule, marshalScheduleSchema); + const body = marshalRequest(req.schedule, marshalCreateScheduleSchema); let resp: Schedule | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -184,7 +184,10 @@ export class LakeviewClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/lakeview/dashboards/${req.subscription?.dashboardId ?? ''}/schedules/${req.subscription?.scheduleId ?? ''}/subscriptions`; - const body = marshalRequest(req.subscription, marshalSubscriptionSchema); + const body = marshalRequest( + req.subscription, + marshalCreateSubscriptionSchema + ); let resp: Subscription | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -757,7 +760,7 @@ export class LakeviewClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.dashboard, marshalDashboardSchema); + const body = marshalRequest(req.dashboard, marshalCreateDashboardSchema); let resp: Dashboard | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -793,7 +796,7 @@ export class LakeviewClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/lakeview/dashboards/${req.schedule?.dashboardId ?? ''}/schedules/${req.schedule?.scheduleId ?? ''}`; - const body = marshalRequest(req.schedule, marshalScheduleSchema); + const body = marshalRequest(req.schedule, marshalCreateScheduleSchema); let resp: Schedule | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/lakeview/src/v1/index.ts b/packages/lakeview/src/v1/index.ts index e2e07478..5daf6482 100755 --- a/packages/lakeview/src/v1/index.ts +++ b/packages/lakeview/src/v1/index.ts @@ -11,8 +11,12 @@ export {DashboardView, LifecycleState, SchedulePauseStatus} from './model'; export type { AuthorizationDetails, AuthorizationDetails_GrantRule, + CreateCronSchedule, + CreateDashboard, CreateDashboardRequest, + CreateSchedule, CreateScheduleRequest, + CreateSubscription, CreateSubscriptionRequest, CronSchedule, Dashboard, @@ -37,7 +41,10 @@ export type { RevertDashboardResponse, Schedule, Subscription, + Subscription_CreateSubscriber, Subscription_Subscriber, + Subscription_Subscriber_CreateDestination, + Subscription_Subscriber_CreateUser, Subscription_Subscriber_Destination, Subscription_Subscriber_User, TrashDashboardRequest, diff --git a/packages/lakeview/src/v1/model.ts b/packages/lakeview/src/v1/model.ts index b3fb1e2e..ff1ab1bb 100755 --- a/packages/lakeview/src/v1/model.ts +++ b/packages/lakeview/src/v1/model.ts @@ -63,8 +63,51 @@ export interface AuthorizationDetails_GrantRule { permissionSet?: string | undefined; } +export interface CreateCronSchedule { + /** + * A cron expression using quartz syntax. EX: `0 0 8 * * ?` represents everyday at 8am. + * See [Cron Trigger](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html) for details. + */ + quartzCronExpression: string; + /** + * A Java timezone id. The schedule will be resolved with respect to this timezone. + * See [Java TimeZone](https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html) for details. + */ + timezoneId: string; +} + +export interface CreateDashboard { + /** UUID identifying the dashboard. */ + dashboardId?: string | undefined; + /** The display name of the dashboard. */ + displayName?: string | undefined; + /** The warehouse ID used to run the dashboard. */ + warehouseId?: string | undefined; + /** + * The etag for the dashboard. Can be optionally provided on updates to ensure that the dashboard + * has not been modified since the last read. + * This field is excluded in List Dashboards responses. + */ + etag?: string | undefined; + /** + * The contents of the dashboard in serialized string form. + * This field is excluded in List Dashboards responses. + * Use the [get dashboard API](https://docs.databricks.com/api/workspace/lakeview/get) + * to retrieve an example response, which includes the `serialized_dashboard` field. + * This field provides the structure of the JSON string that represents the dashboard's + * layout and components. + */ + serializedDashboard?: string | undefined; + /** + * The workspace path of the folder containing the dashboard. Includes leading slash and no + * trailing slash. + * This field is excluded in List Dashboards responses. + */ + parentPath?: string | undefined; +} + export interface CreateDashboardRequest { - dashboard?: Dashboard | undefined; + dashboard?: CreateDashboard | undefined; /** * Sets the default catalog for all datasets in this dashboard. * Does not impact table references that use fully qualified catalog names (ex: samples.nyctaxi.trips). @@ -79,14 +122,53 @@ export interface CreateDashboardRequest { datasetSchema?: string | undefined; } +export interface CreateSchedule { + /** UUID identifying the schedule. */ + scheduleId?: string | undefined; + /** UUID identifying the dashboard to which the schedule belongs. */ + dashboardId?: string | undefined; + /** The cron expression describing the frequency of the periodic refresh for this schedule. */ + cronSchedule: CreateCronSchedule; + /** The status indicates whether this schedule is paused or not. */ + pauseStatus?: SchedulePauseStatus | undefined; + /** The display name for schedule. */ + displayName?: string | undefined; + /** + * The etag for the schedule. Must be left empty on create, must be provided on updates to ensure + * that the schedule has not been modified since the last read, and can be optionally provided on delete. + */ + etag?: string | undefined; + /** The warehouse id to run the dashboard with for the schedule. */ + warehouseId?: string | undefined; +} + export interface CreateScheduleRequest { /** The schedule to create. A dashboard is limited to 10 schedules. */ - schedule?: Schedule | undefined; + schedule?: CreateSchedule | undefined; +} + +export interface CreateSubscription { + /** UUID identifying the schedule to which the subscription belongs. */ + scheduleId?: string | undefined; + /** UUID identifying the dashboard to which the subscription belongs. */ + dashboardId?: string | undefined; + /** Subscriber details for users and destinations to be added as subscribers to the schedule. */ + subscriber: Subscription_CreateSubscriber; + /** + * The etag for the subscription. Must be left empty on create, can be optionally provided on delete + * to ensure that the subscription has not been deleted since the last read. + */ + etag?: string | undefined; + /** + * Controls whether notifications are sent to the subscriber for scheduled dashboard refreshes. + * If not defined, defaults to false in the backend to match the current behavior (refresh and notify) + */ + skipNotify?: boolean | undefined; } export interface CreateSubscriptionRequest { /** The subscription to create. A schedule is limited to 100 subscriptions. */ - subscription?: Subscription | undefined; + subscription?: CreateSubscription | undefined; } export interface CronSchedule { @@ -403,6 +485,20 @@ export interface Subscription { skipNotify?: boolean | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface Subscription_CreateSubscriber { + /** + * The user to receive the subscription email. + * This parameter is mutually exclusive with `destination_subscriber`. + */ + userSubscriber?: Subscription_Subscriber_CreateUser | undefined; + /** + * The destination to receive the subscription email. + * This parameter is mutually exclusive with `user_subscriber`. + */ + destinationSubscriber?: Subscription_Subscriber_CreateDestination | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface Subscription_Subscriber { /** @@ -417,6 +513,18 @@ export interface Subscription_Subscriber { destinationSubscriber?: Subscription_Subscriber_Destination | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface Subscription_Subscriber_CreateDestination { + /** The canonical identifier of the destination to receive email notification. */ + destinationId: string; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface Subscription_Subscriber_CreateUser { + /** UserId of the subscriber. */ + userId: bigint; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface Subscription_Subscriber_Destination { /** The canonical identifier of the destination to receive email notification. */ @@ -446,7 +554,7 @@ export interface UnpublishDashboardRequest { export interface UnpublishDashboardResponse {} export interface UpdateDashboardRequest { - dashboard?: Dashboard | undefined; + dashboard?: CreateDashboard | undefined; /** * Sets the default catalog for all datasets in this dashboard. * Does not impact table references that use fully qualified catalog names (ex: samples.nyctaxi.trips). @@ -463,7 +571,7 @@ export interface UpdateDashboardRequest { export interface UpdateScheduleRequest { /** The schedule to update. */ - schedule?: Schedule | undefined; + schedule?: CreateSchedule | undefined; } export const unmarshalAuthorizationDetailsSchema: z.ZodType = @@ -720,152 +828,114 @@ export const unmarshalTrashDashboardResponseSchema: z.ZodType = z.object({}); -export const marshalCronScheduleSchema: z.ZodType = z +export const marshalCreateCronScheduleSchema: z.ZodType = z .object({ - quartzCronExpression: z.string().optional(), - timezoneId: z.string().optional(), + quartzCronExpression: z.string(), + timezoneId: z.string(), }) .transform(d => ({ quartz_cron_expression: d.quartzCronExpression, timezone_id: d.timezoneId, })); -export const marshalDashboardSchema: z.ZodType = z +export const marshalCreateDashboardSchema: z.ZodType = z .object({ dashboardId: z.string().optional(), displayName: z.string().optional(), - path: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), warehouseId: z.string().optional(), etag: z.string().optional(), serializedDashboard: z.string().optional(), - lifecycleState: z.string().optional(), parentPath: z.string().optional(), }) .transform(d => ({ dashboard_id: d.dashboardId, display_name: d.displayName, - path: d.path, - create_time: d.createTime, - update_time: d.updateTime, warehouse_id: d.warehouseId, etag: d.etag, serialized_dashboard: d.serializedDashboard, - lifecycle_state: d.lifecycleState, parent_path: d.parentPath, })); -export const marshalMigrateDashboardRequestSchema: z.ZodType = z +export const marshalCreateScheduleSchema: z.ZodType = z .object({ - sourceDashboardId: z.string().optional(), + scheduleId: z.string().optional(), + dashboardId: z.string().optional(), + cronSchedule: z.lazy(() => marshalCreateCronScheduleSchema), + pauseStatus: z.string().optional(), displayName: z.string().optional(), - parentPath: z.string().optional(), - updateParameterSyntax: z.boolean().optional(), + etag: z.string().optional(), + warehouseId: z.string().optional(), }) .transform(d => ({ - source_dashboard_id: d.sourceDashboardId, + schedule_id: d.scheduleId, + dashboard_id: d.dashboardId, + cron_schedule: d.cronSchedule, + pause_status: d.pauseStatus, display_name: d.displayName, - parent_path: d.parentPath, - update_parameter_syntax: d.updateParameterSyntax, + etag: d.etag, + warehouse_id: d.warehouseId, })); -export const marshalPublishDashboardRequestSchema: z.ZodType = z +export const marshalCreateSubscriptionSchema: z.ZodType = z .object({ + scheduleId: z.string().optional(), dashboardId: z.string().optional(), - embedCredentials: z.boolean().optional(), - warehouseId: z.string().optional(), + subscriber: z.lazy(() => marshalSubscription_CreateSubscriberSchema), + etag: z.string().optional(), + skipNotify: z.boolean().optional(), }) .transform(d => ({ + schedule_id: d.scheduleId, dashboard_id: d.dashboardId, - embed_credentials: d.embedCredentials, - warehouse_id: d.warehouseId, + subscriber: d.subscriber, + etag: d.etag, + skip_notify: d.skipNotify, })); -export const marshalRevertDashboardRequestSchema: z.ZodType = z +export const marshalMigrateDashboardRequestSchema: z.ZodType = z .object({ - dashboardId: z.string().optional(), - etag: z.string().optional(), + sourceDashboardId: z.string().optional(), + displayName: z.string().optional(), + parentPath: z.string().optional(), + updateParameterSyntax: z.boolean().optional(), }) .transform(d => ({ - dashboard_id: d.dashboardId, - etag: d.etag, + source_dashboard_id: d.sourceDashboardId, + display_name: d.displayName, + parent_path: d.parentPath, + update_parameter_syntax: d.updateParameterSyntax, })); -export const marshalScheduleSchema: z.ZodType = z +export const marshalPublishDashboardRequestSchema: z.ZodType = z .object({ - scheduleId: z.string().optional(), dashboardId: z.string().optional(), - cronSchedule: z.lazy(() => marshalCronScheduleSchema).optional(), - pauseStatus: z.string().optional(), - displayName: z.string().optional(), - etag: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), + embedCredentials: z.boolean().optional(), warehouseId: z.string().optional(), }) .transform(d => ({ - schedule_id: d.scheduleId, dashboard_id: d.dashboardId, - cron_schedule: d.cronSchedule, - pause_status: d.pauseStatus, - display_name: d.displayName, - etag: d.etag, - create_time: d.createTime, - update_time: d.updateTime, + embed_credentials: d.embedCredentials, warehouse_id: d.warehouseId, })); -export const marshalSubscriptionSchema: z.ZodType = z +export const marshalRevertDashboardRequestSchema: z.ZodType = z .object({ - subscriptionId: z.string().optional(), - scheduleId: z.string().optional(), dashboardId: z.string().optional(), - subscriber: z.lazy(() => marshalSubscription_SubscriberSchema).optional(), - createdByUserId: z.bigint().optional(), etag: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - skipNotify: z.boolean().optional(), }) .transform(d => ({ - subscription_id: d.subscriptionId, - schedule_id: d.scheduleId, dashboard_id: d.dashboardId, - subscriber: d.subscriber, - created_by_user_id: d.createdByUserId, etag: d.etag, - create_time: d.createTime, - update_time: d.updateTime, - skip_notify: d.skipNotify, })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalSubscription_SubscriberSchema: z.ZodType = z +export const marshalSubscription_CreateSubscriberSchema: z.ZodType = z .object({ userSubscriber: z - .lazy(() => marshalSubscription_Subscriber_UserSchema) + .lazy(() => marshalSubscription_Subscriber_CreateUserSchema) .optional(), destinationSubscriber: z - .lazy(() => marshalSubscription_Subscriber_DestinationSchema) + .lazy(() => marshalSubscription_Subscriber_CreateDestinationSchema) .optional(), }) .transform(d => ({ @@ -874,18 +944,19 @@ export const marshalSubscription_SubscriberSchema: z.ZodType = z })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalSubscription_Subscriber_DestinationSchema: z.ZodType = z - .object({ - destinationId: z.string().optional(), - }) - .transform(d => ({ - destination_id: d.destinationId, - })); +export const marshalSubscription_Subscriber_CreateDestinationSchema: z.ZodType = + z + .object({ + destinationId: z.string(), + }) + .transform(d => ({ + destination_id: d.destinationId, + })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalSubscription_Subscriber_UserSchema: z.ZodType = z +export const marshalSubscription_Subscriber_CreateUserSchema: z.ZodType = z .object({ - userId: z.bigint().optional(), + userId: z.bigint(), }) .transform(d => ({ user_id: d.userId, diff --git a/packages/logdelivery/src/v1/index.ts b/packages/logdelivery/src/v1/index.ts index 6e5e1a47..80c45ddf 100755 --- a/packages/logdelivery/src/v1/index.ts +++ b/packages/logdelivery/src/v1/index.ts @@ -14,9 +14,11 @@ export { } from './model'; export type { + CreateCreateLogDeliveryConfigurationParams, CreateLogDeliveryConfigurationParams, CreateLogDeliveryConfigurationRequest, CreateLogDeliveryConfigurationResponse, + CreateLogDeliveryStatus, GetLogDeliveryConfigurationRequest, GetLogDeliveryConfigurationResponse, ListLogDeliveryConfigurationRequest, diff --git a/packages/logdelivery/src/v1/model.ts b/packages/logdelivery/src/v1/model.ts index 8c580c66..be6ac7a4 100755 --- a/packages/logdelivery/src/v1/model.ts +++ b/packages/logdelivery/src/v1/model.ts @@ -76,6 +76,49 @@ export type LogDeliveryType = | (typeof LogDeliveryType)[keyof typeof LogDeliveryType] | (string & {}); +/** + * * + * Log Delivery Configuration + */ +export interface CreateCreateLogDeliveryConfigurationParams { + /** The unique UUID of log delivery configuration */ + configId?: string | undefined; + /** The optional human-readable name of the log delivery configuration. Defaults to empty. */ + configName?: string | undefined; + /** + * Log delivery type. Supported values are: + * * `BILLABLE_USAGE` — Configure [billable usage log delivery](https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html). For the CSV schema, see the [View billable usage](https://docs.databricks.com/administration-guide/account-settings/usage.html). + * * `AUDIT_LOGS` — Configure [audit log delivery](https://docs.databricks.com/administration-guide/account-settings/audit-logs.html). For the JSON schema, see [Configure audit logging](https://docs.databricks.com/administration-guide/account-settings/audit-logs.html) + */ + logType: LogDeliveryType; + /** + * The file type of log delivery. + * * If `log_type` is `BILLABLE_USAGE`, this value must be `CSV`. Only the CSV (comma-separated values) format is supported. For the schema, see the [View billable usage](https://docs.databricks.com/administration-guide/account-settings/usage.html) + * * If `log_type` is `AUDIT_LOGS`, this value must be `JSON`. Only the JSON (JavaScript Object Notation) format is supported. For the schema, see the [Configuring audit logs](https://docs.databricks.com/administration-guide/account-settings/audit-logs.html). + */ + outputFormat: LogDeliveryOutputFormat; + /** account ID. */ + accountId?: string | undefined; + /** The ID for a method:credentials/create that represents the AWS IAM role with policy and trust relationship as described in the main billable usage documentation page. See [Configure billable usage delivery](https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html). */ + credentialsId: string; + /** The ID for a method:storage/create that represents the S3 bucket with bucket policy as described in the main billable usage documentation page. See [Configure billable usage delivery](https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html). */ + storageConfigurationId: string; + /** Optional filter that specifies workspace IDs to deliver logs for. By default the workspace filter is empty and log delivery applies at the account level, delivering workspace-level logs for all workspaces in your account, plus account level logs. You can optionally set this field to an array of workspace IDs (each one is an `int64`) to which log delivery should apply, in which case only workspace-level logs relating to the specified workspaces are delivered. If you plan to use different log delivery configurations for different workspaces, set this field explicitly. Be aware that delivery configurations mentioning specific workspaces won't apply to new workspaces created in the future, and delivery won't include account level logs. For some types of deployments there is only one workspace per account ID, so this field is unnecessary. */ + workspaceIdsFilter?: bigint[] | undefined; + /** The optional delivery path prefix within Amazon S3 storage. Defaults to empty, which means that logs are delivered to the root of the bucket. This must be a valid S3 object key. This must not start or end with a slash character. */ + deliveryPathPrefix?: string | undefined; + /** This field applies only if log_type is BILLABLE_USAGE. This is the optional start month and year for delivery, specified in YYYY-MM format. Defaults to current year and month. BILLABLE_USAGE logs are not available for usage before March 2019 (2019-03). */ + deliveryStartTime?: string | undefined; + /** Status of log delivery configuration. Set to `ENABLED` (enabled) or `DISABLED` (disabled). Defaults to `ENABLED`. You can [enable or disable the configuration](#operation/patch-log-delivery-config-status) later. Deletion of a configuration is not supported, so disable a log delivery configuration that is no longer needed. */ + status?: LogDeliveryConfigStatus | undefined; + /** Time in epoch milliseconds when the log delivery configuration was created. */ + creationTime?: bigint | undefined; + /** Time in epoch milliseconds when the log delivery configuration was updated. */ + updateTime?: bigint | undefined; + /** The LogDeliveryStatus of this log delivery configuration */ + logDeliveryStatus?: CreateLogDeliveryStatus | undefined; +} + /** * * * Log Delivery Configuration @@ -124,7 +167,9 @@ export interface CreateLogDeliveryConfigurationParams { * Properties of the new log delivery configuration. */ export interface CreateLogDeliveryConfigurationRequest { - logDeliveryConfiguration?: CreateLogDeliveryConfigurationParams | undefined; + logDeliveryConfiguration?: + | CreateCreateLogDeliveryConfigurationParams + | undefined; } export interface CreateLogDeliveryConfigurationResponse { @@ -132,6 +177,24 @@ export interface CreateLogDeliveryConfigurationResponse { logDeliveryConfiguration?: LogDeliveryConfiguration | undefined; } +export interface CreateLogDeliveryStatus { + /** + * Enum that describes the status. Possible values are: + * * `CREATED`: There were no log delivery attempts since the config was created. + * * `SUCCEEDED`: The latest attempt of log delivery has succeeded completely. + * * `USER_FAILURE`: The latest attempt of log delivery failed because of misconfiguration of customer provided permissions on role or storage. + * * `SYSTEM_FAILURE`: The latest attempt of log delivery failed because of an internal error. Contact support if it doesn't go away soon. + * * `NOT_FOUND`: The log delivery status as the configuration has been disabled since the release of this feature or there are no workspaces in the account. + */ + status: LogDeliveryStatusEnum; + /** The UTC time for the latest log delivery attempt. */ + lastAttemptTime?: string | undefined; + /** The UTC time for the latest successful log delivery. */ + lastSuccessfulAttemptTime?: string | undefined; + /** Informative message about the latest log delivery attempt. If the log delivery fails with USER_FAILURE, error details will be provided for fixing misconfigurations in cloud permissions. */ + message: string; +} + /** * * * Get Log Delivery Configuration @@ -349,56 +412,59 @@ export const unmarshalLogDeliveryStatusSchema: z.ZodType = z export const unmarshalUpdateLogDeliveryConfigurationResponseSchema: z.ZodType = z.object({}); -export const marshalCreateLogDeliveryConfigurationParamsSchema: z.ZodType = z - .object({ - configId: z.string().optional(), - configName: z.string().optional(), - logType: z.string().optional(), - outputFormat: z.string().optional(), - accountId: z.string().optional(), - credentialsId: z.string().optional(), - storageConfigurationId: z.string().optional(), - workspaceIdsFilter: z.array(z.bigint()).optional(), - deliveryPathPrefix: z.string().optional(), - deliveryStartTime: z.string().optional(), - status: z.string().optional(), - creationTime: z.bigint().optional(), - updateTime: z.bigint().optional(), - logDeliveryStatus: z.lazy(() => marshalLogDeliveryStatusSchema).optional(), - }) - .transform(d => ({ - config_id: d.configId, - config_name: d.configName, - log_type: d.logType, - output_format: d.outputFormat, - account_id: d.accountId, - credentials_id: d.credentialsId, - storage_configuration_id: d.storageConfigurationId, - workspace_ids_filter: d.workspaceIdsFilter, - delivery_path_prefix: d.deliveryPathPrefix, - delivery_start_time: d.deliveryStartTime, - status: d.status, - creation_time: d.creationTime, - update_time: d.updateTime, - log_delivery_status: d.logDeliveryStatus, - })); +export const marshalCreateCreateLogDeliveryConfigurationParamsSchema: z.ZodType = + z + .object({ + configId: z.string().optional(), + configName: z.string().optional(), + logType: z.string(), + outputFormat: z.string(), + accountId: z.string().optional(), + credentialsId: z.string(), + storageConfigurationId: z.string(), + workspaceIdsFilter: z.array(z.bigint()).optional(), + deliveryPathPrefix: z.string().optional(), + deliveryStartTime: z.string().optional(), + status: z.string().optional(), + creationTime: z.bigint().optional(), + updateTime: z.bigint().optional(), + logDeliveryStatus: z + .lazy(() => marshalCreateLogDeliveryStatusSchema) + .optional(), + }) + .transform(d => ({ + config_id: d.configId, + config_name: d.configName, + log_type: d.logType, + output_format: d.outputFormat, + account_id: d.accountId, + credentials_id: d.credentialsId, + storage_configuration_id: d.storageConfigurationId, + workspace_ids_filter: d.workspaceIdsFilter, + delivery_path_prefix: d.deliveryPathPrefix, + delivery_start_time: d.deliveryStartTime, + status: d.status, + creation_time: d.creationTime, + update_time: d.updateTime, + log_delivery_status: d.logDeliveryStatus, + })); export const marshalCreateLogDeliveryConfigurationRequestSchema: z.ZodType = z .object({ logDeliveryConfiguration: z - .lazy(() => marshalCreateLogDeliveryConfigurationParamsSchema) + .lazy(() => marshalCreateCreateLogDeliveryConfigurationParamsSchema) .optional(), }) .transform(d => ({ log_delivery_configuration: d.logDeliveryConfiguration, })); -export const marshalLogDeliveryStatusSchema: z.ZodType = z +export const marshalCreateLogDeliveryStatusSchema: z.ZodType = z .object({ - status: z.string().optional(), + status: z.string(), lastAttemptTime: z.string().optional(), lastSuccessfulAttemptTime: z.string().optional(), - message: z.string().optional(), + message: z.string(), }) .transform(d => ({ status: d.status, diff --git a/packages/marketplaces/src/v1/index.ts b/packages/marketplaces/src/v1/index.ts index 219fe98c..f4dc6c16 100755 --- a/packages/marketplaces/src/v1/index.ts +++ b/packages/marketplaces/src/v1/index.ts @@ -35,22 +35,42 @@ export type { BatchGetProvidersResponse, ConsumerTerms, ContactInfo, + CreateConsumerTerms, + CreateDataRefreshInfo, + CreateExchange, + CreateExchangeFilter, CreateExchangeFilterRequest, CreateExchangeFilterResponse, + CreateExchangeListing, CreateExchangeRequest, CreateExchangeResponse, + CreateFileInfo, + CreateFileParent, CreateFileRequest, CreateFileResponse, + CreateInstallationDetail, CreateInstallationRequest, CreateInstallationResponse, + CreateListing, + CreateListingDetail, CreateListingRequest, CreateListingResponse, + CreateListingSetting, + CreateListingSummary, + CreateListingTag, CreatePersonalizationRequest, CreatePersonalizationResponse, CreateProviderAnalyticsDashboardRequest, CreateProviderAnalyticsDashboardResponse, + CreateProviderInfo, CreateProviderRequest, CreateProviderResponse, + CreateRegionInfo, + CreateRepoInfo, + CreateRepoInstallation, + CreateShareInfo, + CreateTokenDetail, + CreateTokenInfo, DataRefreshInfo, DeleteExchangeFilterRequest, DeleteExchangeFilterResponse, diff --git a/packages/marketplaces/src/v1/model.ts b/packages/marketplaces/src/v1/model.ts index bb33435e..738b5073 100755 --- a/packages/marketplaces/src/v1/model.ts +++ b/packages/marketplaces/src/v1/model.ts @@ -241,24 +241,87 @@ export interface ContactInfo { company?: string | undefined; } +export interface CreateConsumerTerms { + version: string; +} + +export interface CreateDataRefreshInfo { + interval: bigint; + unit: DataRefresh; +} + +export interface CreateExchange { + id?: string | undefined; + name: string; + comment?: string | undefined; + filters?: CreateExchangeFilter[] | undefined; + createdAt?: bigint | undefined; + createdBy?: string | undefined; + updatedAt?: bigint | undefined; + updatedBy?: string | undefined; + linkedListings?: CreateExchangeListing[] | undefined; +} + +export interface CreateExchangeFilter { + id?: string | undefined; + exchangeId: string; + filterValue: string; + name?: string | undefined; + createdAt?: bigint | undefined; + createdBy?: string | undefined; + updatedAt?: bigint | undefined; + updatedBy?: string | undefined; + filterType: ExchangeFilterType; +} + export interface CreateExchangeFilterRequest { - filter?: ExchangeFilter | undefined; + filter?: CreateExchangeFilter | undefined; } export interface CreateExchangeFilterResponse { filterId?: string | undefined; } +export interface CreateExchangeListing { + id?: string | undefined; + exchangeId?: string | undefined; + exchangeName?: string | undefined; + listingId?: string | undefined; + listingName?: string | undefined; + createdAt?: bigint | undefined; + createdBy?: string | undefined; +} + export interface CreateExchangeRequest { - exchange?: Exchange | undefined; + exchange?: CreateExchange | undefined; } export interface CreateExchangeResponse { exchangeId?: string | undefined; } +export interface CreateFileInfo { + id?: string | undefined; + marketplaceFileType?: MarketplaceFileType | undefined; + fileParent?: CreateFileParent | undefined; + mimeType?: string | undefined; + downloadLink?: string | undefined; + createdAt?: bigint | undefined; + updatedAt?: bigint | undefined; + /** Name displayed to users for applicable files, e.g. embedded notebooks */ + displayName?: string | undefined; + status?: FileStatus | undefined; + /** Populated if status is in a failed state with more information on reason for the failure. */ + statusMessage?: string | undefined; +} + +export interface CreateFileParent { + parentId?: string | undefined; + fileParentType?: FileParentType | undefined; +} + export interface CreateFileRequest { - fileParent?: FileParent | undefined; + fileParent?: CreateFileParent | undefined; marketplaceFileType?: MarketplaceFileType | undefined; mimeType?: string | undefined; displayName?: string | undefined; @@ -270,28 +333,130 @@ export interface CreateFileResponse { fileInfo?: FileInfo | undefined; } +export interface CreateInstallationDetail { + id?: string | undefined; + listingId?: string | undefined; + shareName?: string | undefined; + catalogName?: string | undefined; + installedOn?: bigint | undefined; + status?: InstallationStatus | undefined; + errorMessage?: string | undefined; + listingName?: string | undefined; + repoName?: string | undefined; + repoPath?: string | undefined; + recipientType?: DeltaSharingRecipientType | undefined; + tokens?: CreateTokenInfo[] | undefined; + tokenDetail?: CreateTokenDetail | undefined; +} + export interface CreateInstallationRequest { listingId?: string | undefined; shareName?: string | undefined; catalogName?: string | undefined; /** for git repo installations */ - repoDetail?: RepoInstallation | undefined; + repoDetail?: CreateRepoInstallation | undefined; recipientType?: DeltaSharingRecipientType | undefined; - acceptedConsumerTerms?: ConsumerTerms | undefined; + acceptedConsumerTerms?: CreateConsumerTerms | undefined; } export interface CreateInstallationResponse { installation?: InstallationDetail | undefined; } +export interface CreateListing { + id?: string | undefined; + summary: CreateListingSummary; + detail?: CreateListingDetail | undefined; +} + +export interface CreateListingDetail { + description?: string | undefined; + termsOfService?: string | undefined; + documentationLink?: string | undefined; + supportLink?: string | undefined; + fileIds?: string[] | undefined; + privacyPolicyLink?: string | undefined; + embeddedNotebookFileInfos?: CreateFileInfo[] | undefined; + /** Which geo region the listing data is collected from */ + geographicalCoverage?: string | undefined; + /** Whether the dataset is free or paid */ + cost?: Cost | undefined; + /** What the pricing model is (e.g. paid, subscription, paid upfront); should only be present if cost is paid */ + pricingModel?: string | undefined; + /** How often data is updated */ + updateFrequency?: CreateDataRefreshInfo | undefined; + /** Smallest unit of time in the dataset */ + collectionGranularity?: CreateDataRefreshInfo | undefined; + /** The starting date timestamp for when the data spans */ + collectionDateStart?: bigint | undefined; + /** The ending date timestamp for when the data spans */ + collectionDateEnd?: bigint | undefined; + /** Where/how the data is sourced */ + dataSource?: string | undefined; + /** size of the dataset in GB */ + size?: number | undefined; + /** Type of assets included in the listing. eg. GIT_REPO, DATA_TABLE, MODEL, NOTEBOOK */ + assets?: AssetType[] | undefined; + /** + * ID 20, 21 removed don't use + * License of the data asset - Required for listings with model based assets + */ + license?: string | undefined; + /** + * Listing tags - Simple key value pair to annotate listings. + * When should I use tags vs dedicated fields? + * Using tags avoids the need to add new columns in the database for new annotations. + * However, this should be used sparingly since tags are stored as key value pair. + * Use tags only: + * 1. If the field is optional and won't need to have NOT NULL integrity check + * 2. The value is fairly fixed, static and low cardinality (eg. enums). + * 3. The value won't be used in filters or joins with other tables. + */ + tags?: CreateListingTag[] | undefined; +} + export interface CreateListingRequest { - listing?: Listing | undefined; + listing?: CreateListing | undefined; } export interface CreateListingResponse { listingId?: string | undefined; } +export interface CreateListingSetting { + visibility?: Visibility | undefined; +} + +export interface CreateListingSummary { + name: string; + subtitle?: string | undefined; + status?: ListingStatus | undefined; + share?: CreateShareInfo | undefined; + providerRegion?: CreateRegionInfo | undefined; + setting?: CreateListingSetting | undefined; + createdAt?: bigint | undefined; + createdBy?: string | undefined; + updatedAt?: bigint | undefined; + updatedBy?: string | undefined; + publishedAt?: bigint | undefined; + publishedBy?: string | undefined; + categories?: Category[] | undefined; + listingType: ListingType; + createdById?: bigint | undefined; + updatedById?: bigint | undefined; + providerId?: string | undefined; + exchangeIds?: string[] | undefined; + /** if a git repo is being created, a listing will be initialized with this field as opposed to a share */ + gitRepo?: CreateRepoInfo | undefined; +} + +export interface CreateListingTag { + /** Tag name (enum) */ + tagName?: ListingTagType | undefined; + /** String representation of the tag value. Values should be string literals (no complex types) */ + tagValues?: string[] | undefined; +} + /** * Data request messages * also creates a lead (maybe) @@ -305,7 +470,7 @@ export interface CreatePersonalizationRequest { company?: string | undefined; isFromLighthouse?: boolean | undefined; recipientType?: DeltaSharingRecipientType | undefined; - acceptedConsumerTerms?: ConsumerTerms | undefined; + acceptedConsumerTerms?: CreateConsumerTerms | undefined; } export interface CreatePersonalizationResponse { @@ -319,14 +484,89 @@ export interface CreateProviderAnalyticsDashboardResponse { id?: string | undefined; } +export interface CreateProviderInfo { + id?: string | undefined; + name: string; + description?: string | undefined; + iconFilePath?: string | undefined; + businessContactEmail: string; + supportContactEmail?: string | undefined; + /** is_featured is accessible by consumers only */ + isFeatured?: boolean | undefined; + /** published_by is only applicable to data aggregators (e.g. Crux) */ + publishedBy?: string | undefined; + companyWebsiteLink?: string | undefined; + iconFileId?: string | undefined; + termOfServiceLink: string; + privacyPolicyLink: string; + darkModeIconFileId?: string | undefined; + darkModeIconFilePath?: string | undefined; +} + export interface CreateProviderRequest { - provider?: ProviderInfo | undefined; + provider?: CreateProviderInfo | undefined; } export interface CreateProviderResponse { id?: string | undefined; } +export interface CreateRegionInfo { + cloud?: string | undefined; + region?: string | undefined; +} + +export interface CreateRepoInfo { + /** the git repo url e.g. https://github.com/databrickslabs/dolly.git */ + gitRepoUrl: string; +} + +export interface CreateRepoInstallation { + /** the user-specified repo name for their installed git repo listing */ + repoName: string; + /** + * refers to the full url file path that navigates the user to the repo's entrypoint (e.g. a README.md file, or the repo file view in the unified UI) + * should just be a relative path + */ + repoPath: string; +} + +export interface CreateShareInfo { + name: string; + type: ListingShareType; +} + +export interface CreateTokenDetail { + /** + * These field names must follow the delta sharing protocol. + * Original message: RetrieveToken.Response in managed-catalog/api/messages/recipient.proto + */ + shareCredentialsVersion?: number | undefined; + bearerToken?: string | undefined; + endpoint?: string | undefined; + expirationTime?: string | undefined; +} + +export interface CreateTokenInfo { + /** Unique id of the Recipient Token. */ + id?: string | undefined; + /** Time at which this Recipient Token was created, in epoch milliseconds. */ + createdAt?: bigint | undefined; + /** Username of Recipient Token creator. */ + createdBy?: string | undefined; + /** + * Full activation url to retrieve the access token. + * It will be empty if the token is already retrieved. + */ + activationUrl?: string | undefined; + /** Expiration timestamp of the token in epoch milliseconds. */ + expirationTime?: bigint | undefined; + /** Time at which this Recipient Token was updated, in epoch milliseconds. */ + updatedAt?: bigint | undefined; + /** Username of Recipient Token updater. */ + updatedBy?: string | undefined; +} + export interface DataRefreshInfo { interval?: bigint | undefined; unit?: DataRefresh | undefined; @@ -924,7 +1164,7 @@ export interface TokenInfo { export interface UpdateExchangeFilterRequest { id?: string | undefined; - filter?: ExchangeFilter | undefined; + filter?: CreateExchangeFilter | undefined; } export interface UpdateExchangeFilterResponse { @@ -933,7 +1173,7 @@ export interface UpdateExchangeFilterResponse { export interface UpdateExchangeRequest { id?: string | undefined; - exchange?: Exchange | undefined; + exchange?: CreateExchange | undefined; } export interface UpdateExchangeResponse { @@ -943,7 +1183,7 @@ export interface UpdateExchangeResponse { export interface UpdateInstallationRequest { listingId?: string | undefined; installationId?: string | undefined; - installation?: InstallationDetail | undefined; + installation?: CreateInstallationDetail | undefined; rotateToken?: boolean | undefined; } @@ -953,7 +1193,7 @@ export interface UpdateInstallationResponse { export interface UpdateListingRequest { id?: string | undefined; - listing?: Listing | undefined; + listing?: CreateListing | undefined; } export interface UpdateListingResponse { @@ -965,7 +1205,7 @@ export interface UpdatePersonalizationRequestStatusRequest { requestId?: string | undefined; status?: PersonalizationRequestStatus | undefined; reason?: string | undefined; - share?: ShareInfo | undefined; + share?: CreateShareInfo | undefined; } export interface UpdatePersonalizationRequestStatusResponse { @@ -992,7 +1232,7 @@ export interface UpdateProviderAnalyticsDashboardResponse { export interface UpdateProviderRequest { id?: string | undefined; - provider?: ProviderInfo | undefined; + provider?: CreateProviderInfo | undefined; } export interface UpdateProviderResponse { @@ -1996,127 +2236,38 @@ export const marshalAddExchangeForListingRequestSchema: z.ZodType = z exchange_id: d.exchangeId, })); -export const marshalConsumerTermsSchema: z.ZodType = z +export const marshalCreateConsumerTermsSchema: z.ZodType = z .object({ - version: z.string().optional(), + version: z.string(), }) .transform(d => ({ version: d.version, })); -export const marshalCreateExchangeFilterRequestSchema: z.ZodType = z - .object({ - filter: z.lazy(() => marshalExchangeFilterSchema).optional(), - }) - .transform(d => ({ - filter: d.filter, - })); - -export const marshalCreateExchangeRequestSchema: z.ZodType = z +export const marshalCreateDataRefreshInfoSchema: z.ZodType = z .object({ - exchange: z.lazy(() => marshalExchangeSchema).optional(), - }) - .transform(d => ({ - exchange: d.exchange, - })); - -export const marshalCreateFileRequestSchema: z.ZodType = z - .object({ - fileParent: z.lazy(() => marshalFileParentSchema).optional(), - marketplaceFileType: z.string().optional(), - mimeType: z.string().optional(), - displayName: z.string().optional(), - }) - .transform(d => ({ - file_parent: d.fileParent, - marketplace_file_type: d.marketplaceFileType, - mime_type: d.mimeType, - display_name: d.displayName, - })); - -export const marshalCreateInstallationRequestSchema: z.ZodType = z - .object({ - listingId: z.string().optional(), - shareName: z.string().optional(), - catalogName: z.string().optional(), - repoDetail: z.lazy(() => marshalRepoInstallationSchema).optional(), - recipientType: z.string().optional(), - acceptedConsumerTerms: z.lazy(() => marshalConsumerTermsSchema).optional(), - }) - .transform(d => ({ - listing_id: d.listingId, - share_name: d.shareName, - catalog_name: d.catalogName, - repo_detail: d.repoDetail, - recipient_type: d.recipientType, - accepted_consumer_terms: d.acceptedConsumerTerms, - })); - -export const marshalCreateListingRequestSchema: z.ZodType = z - .object({ - listing: z.lazy(() => marshalListingSchema).optional(), - }) - .transform(d => ({ - listing: d.listing, - })); - -export const marshalCreatePersonalizationRequestSchema: z.ZodType = z - .object({ - listingId: z.string().optional(), - comment: z.string().optional(), - intendedUse: z.string().optional(), - firstName: z.string().optional(), - lastName: z.string().optional(), - company: z.string().optional(), - isFromLighthouse: z.boolean().optional(), - recipientType: z.string().optional(), - acceptedConsumerTerms: z.lazy(() => marshalConsumerTermsSchema).optional(), - }) - .transform(d => ({ - listing_id: d.listingId, - comment: d.comment, - intended_use: d.intendedUse, - first_name: d.firstName, - last_name: d.lastName, - company: d.company, - is_from_lighthouse: d.isFromLighthouse, - recipient_type: d.recipientType, - accepted_consumer_terms: d.acceptedConsumerTerms, - })); - -export const marshalCreateProviderAnalyticsDashboardRequestSchema: z.ZodType = - z.object({}); - -export const marshalCreateProviderRequestSchema: z.ZodType = z - .object({ - provider: z.lazy(() => marshalProviderInfoSchema).optional(), - }) - .transform(d => ({ - provider: d.provider, - })); - -export const marshalDataRefreshInfoSchema: z.ZodType = z - .object({ - interval: z.bigint().optional(), - unit: z.string().optional(), + interval: z.bigint(), + unit: z.string(), }) .transform(d => ({ interval: d.interval, unit: d.unit, })); -export const marshalExchangeSchema: z.ZodType = z +export const marshalCreateExchangeSchema: z.ZodType = z .object({ id: z.string().optional(), - name: z.string().optional(), + name: z.string(), comment: z.string().optional(), - filters: z.array(z.lazy(() => marshalExchangeFilterSchema)).optional(), + filters: z + .array(z.lazy(() => marshalCreateExchangeFilterSchema)) + .optional(), createdAt: z.bigint().optional(), createdBy: z.string().optional(), updatedAt: z.bigint().optional(), updatedBy: z.string().optional(), linkedListings: z - .array(z.lazy(() => marshalExchangeListingSchema)) + .array(z.lazy(() => marshalCreateExchangeListingSchema)) .optional(), }) .transform(d => ({ @@ -2131,17 +2282,17 @@ export const marshalExchangeSchema: z.ZodType = z linked_listings: d.linkedListings, })); -export const marshalExchangeFilterSchema: z.ZodType = z +export const marshalCreateExchangeFilterSchema: z.ZodType = z .object({ id: z.string().optional(), - exchangeId: z.string().optional(), - filterValue: z.string().optional(), + exchangeId: z.string(), + filterValue: z.string(), name: z.string().optional(), createdAt: z.bigint().optional(), createdBy: z.string().optional(), updatedAt: z.bigint().optional(), updatedBy: z.string().optional(), - filterType: z.string().optional(), + filterType: z.string(), }) .transform(d => ({ id: d.id, @@ -2155,7 +2306,15 @@ export const marshalExchangeFilterSchema: z.ZodType = z filter_type: d.filterType, })); -export const marshalExchangeListingSchema: z.ZodType = z +export const marshalCreateExchangeFilterRequestSchema: z.ZodType = z + .object({ + filter: z.lazy(() => marshalCreateExchangeFilterSchema).optional(), + }) + .transform(d => ({ + filter: d.filter, + })); + +export const marshalCreateExchangeListingSchema: z.ZodType = z .object({ id: z.string().optional(), exchangeId: z.string().optional(), @@ -2175,11 +2334,19 @@ export const marshalExchangeListingSchema: z.ZodType = z created_by: d.createdBy, })); -export const marshalFileInfoSchema: z.ZodType = z +export const marshalCreateExchangeRequestSchema: z.ZodType = z + .object({ + exchange: z.lazy(() => marshalCreateExchangeSchema).optional(), + }) + .transform(d => ({ + exchange: d.exchange, + })); + +export const marshalCreateFileInfoSchema: z.ZodType = z .object({ id: z.string().optional(), marketplaceFileType: z.string().optional(), - fileParent: z.lazy(() => marshalFileParentSchema).optional(), + fileParent: z.lazy(() => marshalCreateFileParentSchema).optional(), mimeType: z.string().optional(), downloadLink: z.string().optional(), createdAt: z.bigint().optional(), @@ -2201,7 +2368,7 @@ export const marshalFileInfoSchema: z.ZodType = z status_message: d.statusMessage, })); -export const marshalFileParentSchema: z.ZodType = z +export const marshalCreateFileParentSchema: z.ZodType = z .object({ parentId: z.string().optional(), fileParentType: z.string().optional(), @@ -2211,7 +2378,21 @@ export const marshalFileParentSchema: z.ZodType = z file_parent_type: d.fileParentType, })); -export const marshalInstallationDetailSchema: z.ZodType = z +export const marshalCreateFileRequestSchema: z.ZodType = z + .object({ + fileParent: z.lazy(() => marshalCreateFileParentSchema).optional(), + marketplaceFileType: z.string().optional(), + mimeType: z.string().optional(), + displayName: z.string().optional(), + }) + .transform(d => ({ + file_parent: d.fileParent, + marketplace_file_type: d.marketplaceFileType, + mime_type: d.mimeType, + display_name: d.displayName, + })); + +export const marshalCreateInstallationDetailSchema: z.ZodType = z .object({ id: z.string().optional(), listingId: z.string().optional(), @@ -2224,8 +2405,8 @@ export const marshalInstallationDetailSchema: z.ZodType = z repoName: z.string().optional(), repoPath: z.string().optional(), recipientType: z.string().optional(), - tokens: z.array(z.lazy(() => marshalTokenInfoSchema)).optional(), - tokenDetail: z.lazy(() => marshalTokenDetailSchema).optional(), + tokens: z.array(z.lazy(() => marshalCreateTokenInfoSchema)).optional(), + tokenDetail: z.lazy(() => marshalCreateTokenDetailSchema).optional(), }) .transform(d => ({ id: d.id, @@ -2243,11 +2424,31 @@ export const marshalInstallationDetailSchema: z.ZodType = z token_detail: d.tokenDetail, })); -export const marshalListingSchema: z.ZodType = z +export const marshalCreateInstallationRequestSchema: z.ZodType = z + .object({ + listingId: z.string().optional(), + shareName: z.string().optional(), + catalogName: z.string().optional(), + repoDetail: z.lazy(() => marshalCreateRepoInstallationSchema).optional(), + recipientType: z.string().optional(), + acceptedConsumerTerms: z + .lazy(() => marshalCreateConsumerTermsSchema) + .optional(), + }) + .transform(d => ({ + listing_id: d.listingId, + share_name: d.shareName, + catalog_name: d.catalogName, + repo_detail: d.repoDetail, + recipient_type: d.recipientType, + accepted_consumer_terms: d.acceptedConsumerTerms, + })); + +export const marshalCreateListingSchema: z.ZodType = z .object({ id: z.string().optional(), - summary: z.lazy(() => marshalListingSummarySchema).optional(), - detail: z.lazy(() => marshalListingDetailSchema).optional(), + summary: z.lazy(() => marshalCreateListingSummarySchema), + detail: z.lazy(() => marshalCreateListingDetailSchema).optional(), }) .transform(d => ({ id: d.id, @@ -2255,7 +2456,7 @@ export const marshalListingSchema: z.ZodType = z detail: d.detail, })); -export const marshalListingDetailSchema: z.ZodType = z +export const marshalCreateListingDetailSchema: z.ZodType = z .object({ description: z.string().optional(), termsOfService: z.string().optional(), @@ -2264,14 +2465,16 @@ export const marshalListingDetailSchema: z.ZodType = z fileIds: z.array(z.string()).optional(), privacyPolicyLink: z.string().optional(), embeddedNotebookFileInfos: z - .array(z.lazy(() => marshalFileInfoSchema)) + .array(z.lazy(() => marshalCreateFileInfoSchema)) .optional(), geographicalCoverage: z.string().optional(), cost: z.string().optional(), pricingModel: z.string().optional(), - updateFrequency: z.lazy(() => marshalDataRefreshInfoSchema).optional(), + updateFrequency: z + .lazy(() => marshalCreateDataRefreshInfoSchema) + .optional(), collectionGranularity: z - .lazy(() => marshalDataRefreshInfoSchema) + .lazy(() => marshalCreateDataRefreshInfoSchema) .optional(), collectionDateStart: z.bigint().optional(), collectionDateEnd: z.bigint().optional(), @@ -2279,7 +2482,7 @@ export const marshalListingDetailSchema: z.ZodType = z size: z.number().optional(), assets: z.array(z.string()).optional(), license: z.string().optional(), - tags: z.array(z.lazy(() => marshalListingTagSchema)).optional(), + tags: z.array(z.lazy(() => marshalCreateListingTagSchema)).optional(), }) .transform(d => ({ description: d.description, @@ -2303,7 +2506,15 @@ export const marshalListingDetailSchema: z.ZodType = z tags: d.tags, })); -export const marshalListingSettingSchema: z.ZodType = z +export const marshalCreateListingRequestSchema: z.ZodType = z + .object({ + listing: z.lazy(() => marshalCreateListingSchema).optional(), + }) + .transform(d => ({ + listing: d.listing, + })); + +export const marshalCreateListingSettingSchema: z.ZodType = z .object({ visibility: z.string().optional(), }) @@ -2311,14 +2522,14 @@ export const marshalListingSettingSchema: z.ZodType = z visibility: d.visibility, })); -export const marshalListingSummarySchema: z.ZodType = z +export const marshalCreateListingSummarySchema: z.ZodType = z .object({ - name: z.string().optional(), + name: z.string(), subtitle: z.string().optional(), status: z.string().optional(), - share: z.lazy(() => marshalShareInfoSchema).optional(), - providerRegion: z.lazy(() => marshalRegionInfoSchema).optional(), - setting: z.lazy(() => marshalListingSettingSchema).optional(), + share: z.lazy(() => marshalCreateShareInfoSchema).optional(), + providerRegion: z.lazy(() => marshalCreateRegionInfoSchema).optional(), + setting: z.lazy(() => marshalCreateListingSettingSchema).optional(), createdAt: z.bigint().optional(), createdBy: z.string().optional(), updatedAt: z.bigint().optional(), @@ -2326,12 +2537,12 @@ export const marshalListingSummarySchema: z.ZodType = z publishedAt: z.bigint().optional(), publishedBy: z.string().optional(), categories: z.array(z.string()).optional(), - listingType: z.string().optional(), + listingType: z.string(), createdById: z.bigint().optional(), updatedById: z.bigint().optional(), providerId: z.string().optional(), exchangeIds: z.array(z.string()).optional(), - gitRepo: z.lazy(() => marshalRepoInfoSchema).optional(), + gitRepo: z.lazy(() => marshalCreateRepoInfoSchema).optional(), }) .transform(d => ({ name: d.name, @@ -2355,7 +2566,7 @@ export const marshalListingSummarySchema: z.ZodType = z git_repo: d.gitRepo, })); -export const marshalListingTagSchema: z.ZodType = z +export const marshalCreateListingTagSchema: z.ZodType = z .object({ tagName: z.string().optional(), tagValues: z.array(z.string()).optional(), @@ -2365,20 +2576,49 @@ export const marshalListingTagSchema: z.ZodType = z tag_values: d.tagValues, })); -export const marshalProviderInfoSchema: z.ZodType = z +export const marshalCreatePersonalizationRequestSchema: z.ZodType = z + .object({ + listingId: z.string().optional(), + comment: z.string().optional(), + intendedUse: z.string().optional(), + firstName: z.string().optional(), + lastName: z.string().optional(), + company: z.string().optional(), + isFromLighthouse: z.boolean().optional(), + recipientType: z.string().optional(), + acceptedConsumerTerms: z + .lazy(() => marshalCreateConsumerTermsSchema) + .optional(), + }) + .transform(d => ({ + listing_id: d.listingId, + comment: d.comment, + intended_use: d.intendedUse, + first_name: d.firstName, + last_name: d.lastName, + company: d.company, + is_from_lighthouse: d.isFromLighthouse, + recipient_type: d.recipientType, + accepted_consumer_terms: d.acceptedConsumerTerms, + })); + +export const marshalCreateProviderAnalyticsDashboardRequestSchema: z.ZodType = + z.object({}); + +export const marshalCreateProviderInfoSchema: z.ZodType = z .object({ id: z.string().optional(), - name: z.string().optional(), + name: z.string(), description: z.string().optional(), iconFilePath: z.string().optional(), - businessContactEmail: z.string().optional(), + businessContactEmail: z.string(), supportContactEmail: z.string().optional(), isFeatured: z.boolean().optional(), publishedBy: z.string().optional(), companyWebsiteLink: z.string().optional(), iconFileId: z.string().optional(), - termOfServiceLink: z.string().optional(), - privacyPolicyLink: z.string().optional(), + termOfServiceLink: z.string(), + privacyPolicyLink: z.string(), darkModeIconFileId: z.string().optional(), darkModeIconFilePath: z.string().optional(), }) @@ -2399,7 +2639,15 @@ export const marshalProviderInfoSchema: z.ZodType = z dark_mode_icon_file_path: d.darkModeIconFilePath, })); -export const marshalRegionInfoSchema: z.ZodType = z +export const marshalCreateProviderRequestSchema: z.ZodType = z + .object({ + provider: z.lazy(() => marshalCreateProviderInfoSchema).optional(), + }) + .transform(d => ({ + provider: d.provider, + })); + +export const marshalCreateRegionInfoSchema: z.ZodType = z .object({ cloud: z.string().optional(), region: z.string().optional(), @@ -2409,35 +2657,35 @@ export const marshalRegionInfoSchema: z.ZodType = z region: d.region, })); -export const marshalRepoInfoSchema: z.ZodType = z +export const marshalCreateRepoInfoSchema: z.ZodType = z .object({ - gitRepoUrl: z.string().optional(), + gitRepoUrl: z.string(), }) .transform(d => ({ git_repo_url: d.gitRepoUrl, })); -export const marshalRepoInstallationSchema: z.ZodType = z +export const marshalCreateRepoInstallationSchema: z.ZodType = z .object({ - repoName: z.string().optional(), - repoPath: z.string().optional(), + repoName: z.string(), + repoPath: z.string(), }) .transform(d => ({ repo_name: d.repoName, repo_path: d.repoPath, })); -export const marshalShareInfoSchema: z.ZodType = z +export const marshalCreateShareInfoSchema: z.ZodType = z .object({ - name: z.string().optional(), - type: z.string().optional(), + name: z.string(), + type: z.string(), }) .transform(d => ({ name: d.name, type: d.type, })); -export const marshalTokenDetailSchema: z.ZodType = z +export const marshalCreateTokenDetailSchema: z.ZodType = z .object({ shareCredentialsVersion: z.number().optional(), bearerToken: z.string().optional(), @@ -2451,7 +2699,7 @@ export const marshalTokenDetailSchema: z.ZodType = z expirationTime: d.expirationTime, })); -export const marshalTokenInfoSchema: z.ZodType = z +export const marshalCreateTokenInfoSchema: z.ZodType = z .object({ id: z.string().optional(), createdAt: z.bigint().optional(), @@ -2471,10 +2719,30 @@ export const marshalTokenInfoSchema: z.ZodType = z updated_by: d.updatedBy, })); +export const marshalFileParentSchema: z.ZodType = z + .object({ + parentId: z.string().optional(), + fileParentType: z.string().optional(), + }) + .transform(d => ({ + parent_id: d.parentId, + file_parent_type: d.fileParentType, + })); + +export const marshalListingTagSchema: z.ZodType = z + .object({ + tagName: z.string().optional(), + tagValues: z.array(z.string()).optional(), + }) + .transform(d => ({ + tag_name: d.tagName, + tag_values: d.tagValues, + })); + export const marshalUpdateExchangeFilterRequestSchema: z.ZodType = z .object({ id: z.string().optional(), - filter: z.lazy(() => marshalExchangeFilterSchema).optional(), + filter: z.lazy(() => marshalCreateExchangeFilterSchema).optional(), }) .transform(d => ({ id: d.id, @@ -2484,7 +2752,7 @@ export const marshalUpdateExchangeFilterRequestSchema: z.ZodType = z export const marshalUpdateExchangeRequestSchema: z.ZodType = z .object({ id: z.string().optional(), - exchange: z.lazy(() => marshalExchangeSchema).optional(), + exchange: z.lazy(() => marshalCreateExchangeSchema).optional(), }) .transform(d => ({ id: d.id, @@ -2495,7 +2763,9 @@ export const marshalUpdateInstallationRequestSchema: z.ZodType = z .object({ listingId: z.string().optional(), installationId: z.string().optional(), - installation: z.lazy(() => marshalInstallationDetailSchema).optional(), + installation: z + .lazy(() => marshalCreateInstallationDetailSchema) + .optional(), rotateToken: z.boolean().optional(), }) .transform(d => ({ @@ -2508,7 +2778,7 @@ export const marshalUpdateInstallationRequestSchema: z.ZodType = z export const marshalUpdateListingRequestSchema: z.ZodType = z .object({ id: z.string().optional(), - listing: z.lazy(() => marshalListingSchema).optional(), + listing: z.lazy(() => marshalCreateListingSchema).optional(), }) .transform(d => ({ id: d.id, @@ -2522,7 +2792,7 @@ export const marshalUpdatePersonalizationRequestStatusRequestSchema: z.ZodType = requestId: z.string().optional(), status: z.string().optional(), reason: z.string().optional(), - share: z.lazy(() => marshalShareInfoSchema).optional(), + share: z.lazy(() => marshalCreateShareInfoSchema).optional(), }) .transform(d => ({ listing_id: d.listingId, @@ -2545,7 +2815,7 @@ export const marshalUpdateProviderAnalyticsDashboardRequestSchema: z.ZodType = z export const marshalUpdateProviderRequestSchema: z.ZodType = z .object({ id: z.string().optional(), - provider: z.lazy(() => marshalProviderInfoSchema).optional(), + provider: z.lazy(() => marshalCreateProviderInfoSchema).optional(), }) .transform(d => ({ id: d.id, diff --git a/packages/modelregistry/src/v1/index.ts b/packages/modelregistry/src/v1/index.ts index 79c76504..4d453df3 100755 --- a/packages/modelregistry/src/v1/index.ts +++ b/packages/modelregistry/src/v1/index.ts @@ -23,10 +23,14 @@ export type { CommentObject, CreateCommentRequest, CreateCommentResponse, + CreateHttpUrlSpec, + CreateJobSpec, CreateModelVersionRequest, CreateModelVersionResponse, + CreateModelVersionTag, CreateRegisteredModelRequest, CreateRegisteredModelResponse, + CreateRegisteredModelTag, CreateRegistryWebhookRequest, CreateRegistryWebhookResponse, CreateTransitionRequest, diff --git a/packages/modelregistry/src/v1/model.ts b/packages/modelregistry/src/v1/model.ts index 5c076859..ef1d4545 100755 --- a/packages/modelregistry/src/v1/model.ts +++ b/packages/modelregistry/src/v1/model.ts @@ -314,6 +314,26 @@ export interface CreateCommentResponse { comment?: CommentObject | undefined; } +export interface CreateHttpUrlSpec { + /** External HTTPS URL called on event trigger (by using a POST request). */ + url?: string | undefined; + /** Enable/disable SSL certificate validation. Default is true. For self-signed certificates, this field must be false AND the destination server must disable certificate validation as well. For security purposes, it is encouraged to perform secret validation with the HMAC-encoded portion of the payload and acknowledge the risk associated with disabling hostname validation whereby it becomes more likely that requests can be maliciously routed to an unintended host. */ + enableSslVerification?: boolean | undefined; + /** Shared secret required for HMAC encoding payload. The HMAC-encoded payload will be sent in the header as: { "X-Databricks-Signature": $encoded_payload }. */ + secret?: string | undefined; + /** Value of the authorization header that should be sent in the request sent by the wehbook. It should be of the form `" "`. If set to an empty string, no authorization header will be included in the request. */ + authorization?: string | undefined; +} + +export interface CreateJobSpec { + /** ID of the job that the webhook runs. */ + jobId?: string | undefined; + /** URL of the workspace containing the job that this webhook runs. If not specified, the job’s workspace URL is assumed to be the same as the workspace where the webhook is created. */ + workspaceUrl?: string | undefined; + /** The personal access token used to authorize webhook's job runs. */ + accessToken?: string | undefined; +} + export interface CreateModelVersionRequest { /** Register model under this name */ name?: string | undefined; @@ -325,7 +345,7 @@ export interface CreateModelVersionRequest { */ runId?: string | undefined; /** Additional metadata for model version. */ - tags?: ModelVersionTag[] | undefined; + tags?: CreateModelVersionTag[] | undefined; /** * MLflow run link - this is the exact link of the run that generated this model version, * potentially hosted at another instance of MLflow. @@ -340,11 +360,18 @@ export interface CreateModelVersionResponse { modelVersion?: ModelVersion | undefined; } +export interface CreateModelVersionTag { + /** The tag key. */ + key?: string | undefined; + /** The tag value. */ + value?: string | undefined; +} + export interface CreateRegisteredModelRequest { /** Register models under this name */ name?: string | undefined; /** Additional metadata for registered model. */ - tags?: RegisteredModelTag[] | undefined; + tags?: CreateRegisteredModelTag[] | undefined; /** Optional description for registered model. */ description?: string | undefined; } @@ -353,6 +380,14 @@ export interface CreateRegisteredModelResponse { registeredModel?: RegisteredModel | undefined; } +/** Tag for a registered model */ +export interface CreateRegisteredModelTag { + /** The tag key. */ + key?: string | undefined; + /** The tag value. */ + value?: string | undefined; +} + /** Details required to create a registry webhook. */ export interface CreateRegistryWebhookRequest { /** If model name is not specified, a registry-wide webhook is created that listens for the specified events across all versions of all registered models. */ @@ -396,9 +431,9 @@ export interface CreateRegistryWebhookRequest { */ status?: RegistryWebhookStatus | undefined; /** External HTTPS URL called on event trigger (by using a POST request). */ - httpUrlSpec?: HttpUrlSpec | undefined; + httpUrlSpec?: CreateHttpUrlSpec | undefined; /** ID of the job that the webhook runs. */ - jobSpec?: JobSpec | undefined; + jobSpec?: CreateJobSpec | undefined; } export interface CreateRegistryWebhookResponse { @@ -1140,8 +1175,8 @@ export interface UpdateRegistryWebhookRequest { /** User-specified description for the webhook. */ description?: string | undefined; status?: RegistryWebhookStatus | undefined; - httpUrlSpec?: HttpUrlSpec | undefined; - jobSpec?: JobSpec | undefined; + httpUrlSpec?: CreateHttpUrlSpec | undefined; + jobSpec?: CreateJobSpec | undefined; } export interface UpdateRegistryWebhookResponse { @@ -1779,12 +1814,38 @@ export const marshalCreateCommentRequestSchema: z.ZodType = z comment: d.comment, })); +export const marshalCreateHttpUrlSpecSchema: z.ZodType = z + .object({ + url: z.string().optional(), + enableSslVerification: z.boolean().optional(), + secret: z.string().optional(), + authorization: z.string().optional(), + }) + .transform(d => ({ + url: d.url, + enable_ssl_verification: d.enableSslVerification, + secret: d.secret, + authorization: d.authorization, + })); + +export const marshalCreateJobSpecSchema: z.ZodType = z + .object({ + jobId: z.string().optional(), + workspaceUrl: z.string().optional(), + accessToken: z.string().optional(), + }) + .transform(d => ({ + job_id: d.jobId, + workspace_url: d.workspaceUrl, + access_token: d.accessToken, + })); + export const marshalCreateModelVersionRequestSchema: z.ZodType = z .object({ name: z.string().optional(), source: z.string().optional(), runId: z.string().optional(), - tags: z.array(z.lazy(() => marshalModelVersionTagSchema)).optional(), + tags: z.array(z.lazy(() => marshalCreateModelVersionTagSchema)).optional(), runLink: z.string().optional(), description: z.string().optional(), }) @@ -1797,10 +1858,22 @@ export const marshalCreateModelVersionRequestSchema: z.ZodType = z description: d.description, })); +export const marshalCreateModelVersionTagSchema: z.ZodType = z + .object({ + key: z.string().optional(), + value: z.string().optional(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); + export const marshalCreateRegisteredModelRequestSchema: z.ZodType = z .object({ name: z.string().optional(), - tags: z.array(z.lazy(() => marshalRegisteredModelTagSchema)).optional(), + tags: z + .array(z.lazy(() => marshalCreateRegisteredModelTagSchema)) + .optional(), description: z.string().optional(), }) .transform(d => ({ @@ -1809,14 +1882,24 @@ export const marshalCreateRegisteredModelRequestSchema: z.ZodType = z description: d.description, })); +export const marshalCreateRegisteredModelTagSchema: z.ZodType = z + .object({ + key: z.string().optional(), + value: z.string().optional(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); + export const marshalCreateRegistryWebhookRequestSchema: z.ZodType = z .object({ modelName: z.string().optional(), events: z.array(z.string()).optional(), description: z.string().optional(), status: z.string().optional(), - httpUrlSpec: z.lazy(() => marshalHttpUrlSpecSchema).optional(), - jobSpec: z.lazy(() => marshalJobSpecSchema).optional(), + httpUrlSpec: z.lazy(() => marshalCreateHttpUrlSpecSchema).optional(), + jobSpec: z.lazy(() => marshalCreateJobSpecSchema).optional(), }) .transform(d => ({ model_name: d.modelName, @@ -1841,32 +1924,6 @@ export const marshalCreateTransitionRequestSchema: z.ZodType = z comment: d.comment, })); -export const marshalHttpUrlSpecSchema: z.ZodType = z - .object({ - url: z.string().optional(), - enableSslVerification: z.boolean().optional(), - secret: z.string().optional(), - authorization: z.string().optional(), - }) - .transform(d => ({ - url: d.url, - enable_ssl_verification: d.enableSslVerification, - secret: d.secret, - authorization: d.authorization, - })); - -export const marshalJobSpecSchema: z.ZodType = z - .object({ - jobId: z.string().optional(), - workspaceUrl: z.string().optional(), - accessToken: z.string().optional(), - }) - .transform(d => ({ - job_id: d.jobId, - workspace_url: d.workspaceUrl, - access_token: d.accessToken, - })); - export const marshalListLatestVersionsRequestSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -1877,26 +1934,6 @@ export const marshalListLatestVersionsRequestSchema: z.ZodType = z stages: d.stages, })); -export const marshalModelVersionTagSchema: z.ZodType = z - .object({ - key: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - -export const marshalRegisteredModelTagSchema: z.ZodType = z - .object({ - key: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - export const marshalRejectTransitionRequestSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -2012,8 +2049,8 @@ export const marshalUpdateRegistryWebhookRequestSchema: z.ZodType = z events: z.array(z.string()).optional(), description: z.string().optional(), status: z.string().optional(), - httpUrlSpec: z.lazy(() => marshalHttpUrlSpecSchema).optional(), - jobSpec: z.lazy(() => marshalJobSpecSchema).optional(), + httpUrlSpec: z.lazy(() => marshalCreateHttpUrlSpecSchema).optional(), + jobSpec: z.lazy(() => marshalCreateJobSpecSchema).optional(), }) .transform(d => ({ id: d.id, diff --git a/packages/modelserving/src/v1/index.ts b/packages/modelserving/src/v1/index.ts index 6236bea3..763be857 100755 --- a/packages/modelserving/src/v1/index.ts +++ b/packages/modelserving/src/v1/index.ts @@ -34,8 +34,44 @@ export type { AutoCaptureState, BearerTokenAuth, CohereConfig, + CreateAi21LabsConfig, + CreateAiGatewayConfig, + CreateAiGatewayRateLimit, + CreateAiGuardrailParameters, + CreateAiGuardrails, + CreateAmazonBedrockConfig, + CreateAnthropicConfig, + CreateApiKeyAuth, + CreateAutoCaptureConfig, + CreateAutoCaptureState, + CreateBearerTokenAuth, + CreateCohereConfig, + CreateCustomProviderConfig, + CreateDatabricksModelServingConfig, + CreateEmailNotifications, + CreateEndpointCoreConfig, + CreateEndpointTag, + CreateExternalModel, + CreateFallbackConfig, + CreateFoundationModel, + CreateGoogleCloudVertexAiConfig, CreateInferenceEndpointRequest, + CreateInferenceTableConfig, + CreateOpenAiConfig, + CreatePaLmConfig, + CreatePayloadTable, + CreatePiiSettings, + CreatePtEndpointCoreConfig, CreatePtEndpointRequest, + CreatePtServedModel, + CreateRateLimit, + CreateRoute, + CreateServedModel, + CreateServedModelState, + CreateTelemetryConfig, + CreateTelemetryInferenceTableConfig, + CreateTrafficConfig, + CreateUsageTrackingConfig, CustomProviderConfig, DataPlaneInfo, DatabricksModelServingConfig, diff --git a/packages/modelserving/src/v1/model.ts b/packages/modelserving/src/v1/model.ts index 264deddb..5ea9ce98 100755 --- a/packages/modelserving/src/v1/model.ts +++ b/packages/modelserving/src/v1/model.ts @@ -290,29 +290,562 @@ export interface CohereConfig { cohereApiBase?: string | undefined; } +export interface CreateAi21LabsConfig { + /** + * The secret key reference for an AI21 Labs API key. If you + * prefer to paste your API key directly, see `ai21labs_api_key_plaintext`. + * You must provide an API key using one of the following fields: + * `ai21labs_api_key` or `ai21labs_api_key_plaintext`. + */ + ai21labsApiKey?: string | undefined; + /** + * An AI21 Labs API key provided as a plaintext string. If you prefer to + * reference your key using Databricks Secrets, see `ai21labs_api_key`. You + * must provide an API key using one of the following fields: + * `ai21labs_api_key` or `ai21labs_api_key_plaintext`. + */ + ai21labsApiKeyPlaintext?: string | undefined; +} + +export interface CreateAiGatewayConfig { + /** + * Configuration to enable usage tracking using system tables. + * These tables allow you to monitor operational usage on endpoints and their associated costs. + */ + usageTrackingConfig?: CreateUsageTrackingConfig | undefined; + /** + * Configuration for payload logging using inference tables. + * Use these tables to monitor and audit data being sent to and received from model APIs and to improve model quality. + */ + inferenceTableConfig?: CreateInferenceTableConfig | undefined; + /** Configuration for rate limits which can be set to limit endpoint traffic. */ + rateLimits?: CreateAiGatewayRateLimit[] | undefined; + /** Configuration for AI Guardrails to prevent unwanted data and unsafe data in requests and responses. */ + guardrails?: CreateAiGuardrails | undefined; + /** + * Configuration for traffic fallback which auto fallbacks to other served entities if the request to a served + * entity fails with certain error codes, to increase availability. + */ + fallbackConfig?: CreateFallbackConfig | undefined; +} + +export interface CreateAiGatewayRateLimit { + /** Used to specify how many calls are allowed for a key within the renewal_period. */ + calls?: bigint | undefined; + /** + * Key field for a rate limit. Currently, 'user', 'user_group, 'service_principal', and 'endpoint' are supported, + * with 'endpoint' being the default if not specified. + */ + key?: string | undefined; + /** Renewal period field for a rate limit. Currently, only 'minute' is supported. */ + renewalPeriod: string; + /** Principal field for a user, user group, or service principal to apply rate limiting to. Accepts a user email, group name, or service principal application ID. */ + principal?: string | undefined; + /** Used to specify how many tokens are allowed for a key within the renewal_period. */ + tokens?: bigint | undefined; +} + +export interface CreateAiGuardrailParameters { + /** Indicates whether the safety filter is enabled. */ + safety?: boolean | undefined; + /** Configuration for guardrail PII filter. */ + pii?: CreatePiiSettings | undefined; + /** + * The list of allowed topics. + * Given a chat request, this guardrail flags the request if its topic is not in the allowed topics. + */ + validTopics?: string[] | undefined; + /** + * List of invalid keywords. + * AI guardrail uses keyword or string matching to decide if the keyword exists in the request or response content. + */ + invalidKeywords?: string[] | undefined; +} + +export interface CreateAiGuardrails { + /** Configuration for input guardrail filters. */ + input?: CreateAiGuardrailParameters | undefined; + /** Configuration for output guardrail filters. */ + output?: CreateAiGuardrailParameters | undefined; +} + +export interface CreateAmazonBedrockConfig { + /** The AWS region to use. Bedrock has to be enabled there. */ + awsRegion: string; + /** + * The secret key reference for an AWS access key ID with + * permissions to interact with Bedrock services. If you prefer to paste + * your API key directly, see `aws_access_key_id_plaintext`. You must provide an API + * key using one of the following fields: `aws_access_key_id` or + * `aws_access_key_id_plaintext`. + */ + awsAccessKeyId?: string | undefined; + /** + * The secret key reference for an AWS secret access key paired + * with the access key ID, with permissions to interact with Bedrock + * services. If you prefer to paste your API key directly, see + * `aws_secret_access_key_plaintext`. You must provide an API key using one + * of the following fields: `aws_secret_access_key` or + * `aws_secret_access_key_plaintext`. + */ + awsSecretAccessKey?: string | undefined; + /** + * The underlying provider in Amazon Bedrock. Supported values (case + * insensitive) include: Anthropic, Cohere, AI21Labs, Amazon. + */ + bedrockProvider: string; + /** + * An AWS access key ID with permissions to interact with Bedrock services + * provided as a plaintext string. If you prefer to reference your key using + * Databricks Secrets, see `aws_access_key_id`. You must provide an API key + * using one of the following fields: `aws_access_key_id` or + * `aws_access_key_id_plaintext`. + */ + awsAccessKeyIdPlaintext?: string | undefined; + /** + * An AWS secret access key paired with the access key ID, with permissions + * to interact with Bedrock services provided as a plaintext string. If you + * prefer to reference your key using Databricks Secrets, see + * `aws_secret_access_key`. You must provide an API key using one of the + * following fields: `aws_secret_access_key` or + * `aws_secret_access_key_plaintext`. + */ + awsSecretAccessKeyPlaintext?: string | undefined; + /** + * ARN of the instance profile that the external model will use to access AWS resources. + * You must authenticate using an instance profile or access keys. + * If you prefer to authenticate using access keys, see `aws_access_key_id`, + * `aws_access_key_id_plaintext`, `aws_secret_access_key` and `aws_secret_access_key_plaintext`. + */ + instanceProfileArn?: string | undefined; +} + +export interface CreateAnthropicConfig { + /** + * The secret key reference for an Anthropic API key. If you + * prefer to paste your API key directly, see `anthropic_api_key_plaintext`. + * You must provide an API key using one of the following fields: + * `anthropic_api_key` or `anthropic_api_key_plaintext`. + */ + anthropicApiKey?: string | undefined; + /** + * The Anthropic API key provided as a plaintext string. If you prefer to + * reference your key using Databricks Secrets, see `anthropic_api_key`. You + * must provide an API key using one of the following fields: + * `anthropic_api_key` or `anthropic_api_key_plaintext`. + */ + anthropicApiKeyPlaintext?: string | undefined; +} + +export interface CreateApiKeyAuth { + /** The name of the API key parameter used for authentication. */ + key: string; + /** + * The secret key reference for an API Key. + * If you prefer to paste your token directly, see `value_plaintext`. + */ + value?: string | undefined; + /** + * The API Key provided as a plaintext string. If you prefer to reference your + * token using Databricks Secrets, see `value`. + */ + valuePlaintext?: string | undefined; +} + +/** + * Deprecated: legacy inference table configuration. Please use AI Gateway inference tables instead. + * See https://docs.databricks.com/aws/en/ai-gateway/inference-tables. + */ +export interface CreateAutoCaptureConfig { + /** The name of the catalog in Unity Catalog. NOTE: On update, you cannot change the catalog name if the inference table is already enabled. */ + catalogName?: string | undefined; + /** The name of the schema in Unity Catalog. NOTE: On update, you cannot change the schema name if the inference table is already enabled. */ + schemaName?: string | undefined; + /** The prefix of the table in Unity Catalog. NOTE: On update, you cannot change the prefix name if the inference table is already enabled. */ + tableNamePrefix?: string | undefined; + state?: CreateAutoCaptureState | undefined; + /** Indicates whether the inference table is enabled. */ + enabled?: boolean | undefined; +} + +export interface CreateAutoCaptureState { + payloadTable?: CreatePayloadTable | undefined; +} + +export interface CreateBearerTokenAuth { + /** + * The secret key reference for a token. + * If you prefer to paste your token directly, see `token_plaintext`. + */ + token?: string | undefined; + /** + * The token provided as a plaintext string. If you prefer to reference your + * token using Databricks Secrets, see `token`. + */ + tokenPlaintext?: string | undefined; +} + +export interface CreateCohereConfig { + /** + * The secret key reference for a Cohere API key. If you prefer + * to paste your API key directly, see `cohere_api_key_plaintext`. You must + * provide an API key using one of the following fields: `cohere_api_key` or + * `cohere_api_key_plaintext`. + */ + cohereApiKey?: string | undefined; + /** + * The Cohere API key provided as a plaintext string. If you prefer to + * reference your key using Databricks Secrets, see `cohere_api_key`. You + * must provide an API key using one of the following fields: + * `cohere_api_key` or `cohere_api_key_plaintext`. + */ + cohereApiKeyPlaintext?: string | undefined; + /** + * This is an optional field to provide a customized base URL for the Cohere + * API. If left unspecified, the standard Cohere base URL is used. + */ + cohereApiBase?: string | undefined; +} + +/** Configs needed to create a custom provider model route. */ +export interface CreateCustomProviderConfig { + /** This is a field to provide the URL of the custom provider API. */ + customProviderUrl: string; + /** + * This is a field to provide bearer token authentication for the custom provider API. + * You can only specify one authentication method. + */ + bearerTokenAuth?: CreateBearerTokenAuth | undefined; + /** + * This is a field to provide API key authentication for the custom provider API. + * You can only specify one authentication method. + */ + apiKeyAuth?: CreateApiKeyAuth | undefined; +} + +export interface CreateDatabricksModelServingConfig { + /** + * The secret key reference for a Databricks API token that + * corresponds to a user or service principal with Can Query access to the + * model serving endpoint pointed to by this external model. If you prefer + * to paste your API key directly, see `databricks_api_token_plaintext`. You + * must provide an API key using one of the following fields: + * `databricks_api_token` or `databricks_api_token_plaintext`. + */ + databricksApiToken?: string | undefined; + /** + * The URL of the workspace containing the model serving endpoint + * pointed to by this external model. + */ + databricksWorkspaceUrl: string; + /** + * The Databricks API token that corresponds to a user or service principal + * with Can Query access to the model serving endpoint pointed to by this + * external model provided as a plaintext string. If you prefer to reference + * your key using Databricks Secrets, see `databricks_api_token`. You must + * provide an API key using one of the following fields: + * `databricks_api_token` or `databricks_api_token_plaintext`. + */ + databricksApiTokenPlaintext?: string | undefined; +} + +export interface CreateEmailNotifications { + /** A list of email addresses to be notified when an endpoint successfully updates its configuration or state. */ + onUpdateSuccess?: string[] | undefined; + /** A list of email addresses to be notified when an endpoint fails to update its configuration or state. */ + onUpdateFailure?: string[] | undefined; +} + +export interface CreateEndpointCoreConfig { + /** The list of served entities under the serving endpoint config. */ + servedEntities?: CreateServedModel[] | undefined; + /** (Deprecated, use served_entities instead) The list of served models under the serving endpoint config. */ + servedModels?: CreateServedModel[] | undefined; + /** The traffic configuration associated with the serving endpoint config. */ + trafficConfig?: CreateTrafficConfig | undefined; + /** + * Configuration for legacy Inference Tables which automatically log requests and responses to Unity + * Catalog. + * Deprecated: please use AI Gateway inference tables instead. See + * https://docs.databricks.com/aws/en/ai-gateway/inference-tables. + */ + autoCaptureConfig?: CreateAutoCaptureConfig | undefined; +} + +export interface CreateEndpointTag { + /** Key field for a serving endpoint tag. */ + key: string; + /** Optional value field for a serving endpoint tag. */ + value?: string | undefined; +} + +export interface CreateExternalModel { + /** The name of the provider for the external model. Currently, the supported providers are 'ai21labs', 'anthropic', 'amazon-bedrock', 'cohere', 'databricks-model-serving', 'google-cloud-vertex-ai', 'openai', 'palm', and 'custom'. */ + provider: string; + /** The name of the external model. */ + name: string; + /** The task type of the external model. */ + task: string; + /** external model config. The config corresponding to the provider will be used. */ + config?: + | { + $case: 'ai21labsConfig'; + /** AI21Labs Config. Only required if the provider is 'ai21labs'. */ + ai21labsConfig: CreateAi21LabsConfig; + } + | { + $case: 'anthropicConfig'; + /** Anthropic Config. Only required if the provider is 'anthropic'. */ + anthropicConfig: CreateAnthropicConfig; + } + | { + $case: 'amazonBedrockConfig'; + /** Amazon Bedrock Config. Only required if the provider is 'amazon-bedrock'. */ + amazonBedrockConfig: CreateAmazonBedrockConfig; + } + | { + $case: 'cohereConfig'; + /** Cohere Config. Only required if the provider is 'cohere'. */ + cohereConfig: CreateCohereConfig; + } + | { + $case: 'googleCloudVertexAiConfig'; + /** Google Cloud Vertex AI Config. Only required if the provider is 'google-cloud-vertex-ai'. */ + googleCloudVertexAiConfig: CreateGoogleCloudVertexAiConfig; + } + | { + $case: 'databricksModelServingConfig'; + /** Databricks Model Serving Config. Only required if the provider is 'databricks-model-serving'. */ + databricksModelServingConfig: CreateDatabricksModelServingConfig; + } + | { + $case: 'openaiConfig'; + /** OpenAI Config. Only required if the provider is 'openai'. */ + openaiConfig: CreateOpenAiConfig; + } + | { + $case: 'palmConfig'; + /** PaLM Config. Only required if the provider is 'palm'. */ + palmConfig: CreatePaLmConfig; + } + | { + $case: 'customProviderConfig'; + /** Custom Provider Config. Only required if the provider is 'custom'. */ + customProviderConfig: CreateCustomProviderConfig; + } + | undefined; +} + +export interface CreateFallbackConfig { + /** + * Whether to enable traffic fallback. When a served entity in the serving endpoint returns specific error + * codes (e.g. 500), the request will automatically be round-robin attempted with other served entities in the same + * endpoint, following the order of served entity list, until a successful response is returned. + * If all attempts fail, return the last response with the error code. + */ + enabled: boolean; +} + +/** All fields are not sensitive as they are hard-coded in the system and made available to customers. */ +export interface CreateFoundationModel { + name?: string | undefined; + displayName?: string | undefined; + docs?: string | undefined; + description?: string | undefined; +} + +export interface CreateGoogleCloudVertexAiConfig { + /** + * The secret key reference for a private key for the service + * account which has access to the Google Cloud Vertex AI Service. See [Best + * practices for managing service account keys]. If you prefer to paste your + * API key directly, see `private_key_plaintext`. You must provide an API + * key using one of the following fields: `private_key` or + * `private_key_plaintext` + * + * [Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys + */ + privateKey?: string | undefined; + /** + * This is the Google Cloud project id that the service account is + * associated with. + */ + projectId: string; + /** + * This is the region for the Google Cloud Vertex AI Service. See [supported + * regions] for more details. Some models are only available in specific + * regions. + * + * [supported regions]: https://cloud.google.com/vertex-ai/docs/general/locations + */ + region: string; + /** + * The private key for the service account which has access to the Google + * Cloud Vertex AI Service provided as a plaintext secret. See [Best + * practices for managing service account keys]. If you prefer to reference + * your key using Databricks Secrets, see `private_key`. You must provide an + * API key using one of the following fields: `private_key` or + * `private_key_plaintext`. + * + * [Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys + */ + privateKeyPlaintext?: string | undefined; +} + export interface CreateInferenceEndpointRequest { /** - * The name of the serving endpoint. This field is required and must be unique across a . - * An endpoint name can consist of alphanumeric characters, dashes, and underscores. + * The name of the serving endpoint. This field is required and must be unique across a . + * An endpoint name can consist of alphanumeric characters, dashes, and underscores. + */ + name?: string | undefined; + /** The core config of the serving endpoint. */ + config?: CreateEndpointCoreConfig | undefined; + /** Tags to be attached to the serving endpoint and automatically propagated to billing logs. */ + tags?: CreateEndpointTag[] | undefined; + /** Enable route optimization for the serving endpoint. */ + routeOptimized?: boolean | undefined; + /** Rate limits to be applied to the serving endpoint. NOTE: this field is deprecated, please use AI Gateway to manage rate limits. */ + rateLimits?: CreateRateLimit[] | undefined; + /** The AI Gateway configuration for the serving endpoint. NOTE: External model, provisioned throughput, and pay-per-token endpoints are fully supported; agent endpoints currently only support inference tables. */ + aiGateway?: CreateAiGatewayConfig | undefined; + /** The budget policy to be applied to the serving endpoint. */ + budgetPolicyId?: string | undefined; + /** Email notification settings. */ + emailNotifications?: CreateEmailNotifications | undefined; + description?: string | undefined; + /** Configuration for persisting endpoint telemetry (logs, traces, and metrics) to Unity Catalog tables. */ + telemetryConfig?: CreateTelemetryConfig | undefined; +} + +export interface CreateInferenceTableConfig { + /** + * The name of the catalog in Unity Catalog. Required when enabling inference tables. + * NOTE: On update, you have to disable inference table first in order to change the catalog name. + */ + catalogName?: string | undefined; + /** + * The name of the schema in Unity Catalog. Required when enabling inference tables. + * NOTE: On update, you have to disable inference table first in order to change the schema name. + */ + schemaName?: string | undefined; + /** + * The prefix of the table in Unity Catalog. + * NOTE: On update, you have to disable inference table first in order to change the prefix name. + */ + tableNamePrefix?: string | undefined; + /** Indicates whether the inference table is enabled. */ + enabled?: boolean | undefined; +} + +/** Configs needed to create an OpenAI model route. */ +export interface CreateOpenAiConfig { + /** + * The secret key reference for an OpenAI API key using the + * OpenAI or Azure service. If you prefer to paste your API key directly, + * see `openai_api_key_plaintext`. You must provide an API key using one of + * the following fields: `openai_api_key` or `openai_api_key_plaintext`. + */ + openaiApiKey?: string | undefined; + /** + * This is an optional field to specify the type of OpenAI API to use. For + * Azure OpenAI, this field is required, and adjust this parameter to + * represent the preferred security access validation protocol. For access + * token validation, use azure. For authentication using Azure Active + * Directory (Azure AD) use, azuread. + */ + openaiApiType?: string | undefined; + /** + * This is a field to provide a customized base URl for the OpenAI API. For + * Azure OpenAI, this field is required, and is the base URL for the Azure + * OpenAI API service provided by Azure. For other OpenAI API types, this + * field is optional, and if left unspecified, the standard OpenAI base URL + * is used. + */ + openaiApiBase?: string | undefined; + /** + * This is an optional field to specify the OpenAI API version. For Azure + * OpenAI, this field is required, and is the version of the Azure OpenAI + * service to utilize, specified by a date. + */ + openaiApiVersion?: string | undefined; + /** + * This field is only required for Azure OpenAI and is the name of the + * deployment resource for the Azure OpenAI service. + */ + openaiDeploymentName?: string | undefined; + /** + * This is an optional field to specify the organization in OpenAI or Azure + * OpenAI. + */ + openaiOrganization?: string | undefined; + /** + * This field is only required for Azure AD OpenAI and is the Microsoft + * Entra Tenant ID. + */ + microsoftEntraTenantId?: string | undefined; + /** + * This field is only required for Azure AD OpenAI and is the Microsoft + * Entra Client ID. + */ + microsoftEntraClientId?: string | undefined; + /** + * The secret key reference for a client secret used for + * Microsoft Entra ID authentication. If you prefer to paste your client + * secret directly, see `microsoft_entra_client_secret_plaintext`. You must + * provide an API key using one of the following fields: + * `microsoft_entra_client_secret` or + * `microsoft_entra_client_secret_plaintext`. + */ + microsoftEntraClientSecret?: string | undefined; + /** + * The OpenAI API key using the OpenAI or Azure service provided as a + * plaintext string. If you prefer to reference your key using Databricks + * Secrets, see `openai_api_key`. You must provide an API key using one of + * the following fields: `openai_api_key` or `openai_api_key_plaintext`. + */ + openaiApiKeyPlaintext?: string | undefined; + /** + * The client secret used for Microsoft Entra ID authentication provided as + * a plaintext string. If you prefer to reference your key using Databricks + * Secrets, see `microsoft_entra_client_secret`. You must provide an API key + * using one of the following fields: `microsoft_entra_client_secret` or + * `microsoft_entra_client_secret_plaintext`. + */ + microsoftEntraClientSecretPlaintext?: string | undefined; +} + +export interface CreatePaLmConfig { + /** + * The secret key reference for a PaLM API key. If you prefer to + * paste your API key directly, see `palm_api_key_plaintext`. You must + * provide an API key using one of the following fields: `palm_api_key` or + * `palm_api_key_plaintext`. + */ + palmApiKey?: string | undefined; + /** + * The PaLM API key provided as a plaintext string. If you prefer to + * reference your key using Databricks Secrets, see `palm_api_key`. You must + * provide an API key using one of the following fields: `palm_api_key` or + * `palm_api_key_plaintext`. */ + palmApiKeyPlaintext?: string | undefined; +} + +export interface CreatePayloadTable { name?: string | undefined; - /** The core config of the serving endpoint. */ - config?: EndpointCoreConfig | undefined; - /** Tags to be attached to the serving endpoint and automatically propagated to billing logs. */ - tags?: EndpointTag[] | undefined; - /** Enable route optimization for the serving endpoint. */ - routeOptimized?: boolean | undefined; - /** Rate limits to be applied to the serving endpoint. NOTE: this field is deprecated, please use AI Gateway to manage rate limits. */ - rateLimits?: RateLimit[] | undefined; - /** The AI Gateway configuration for the serving endpoint. NOTE: External model, provisioned throughput, and pay-per-token endpoints are fully supported; agent endpoints currently only support inference tables. */ - aiGateway?: AiGatewayConfig | undefined; - /** The budget policy to be applied to the serving endpoint. */ - budgetPolicyId?: string | undefined; - /** Email notification settings. */ - emailNotifications?: EmailNotifications | undefined; - description?: string | undefined; - /** Configuration for persisting endpoint telemetry (logs, traces, and metrics) to Unity Catalog tables. */ - telemetryConfig?: TelemetryConfig | undefined; + status?: string | undefined; + statusMessage?: string | undefined; +} + +export interface CreatePiiSettings { + /** Configuration for input guardrail filters. */ + behavior?: Behavior | undefined; +} + +export interface CreatePtEndpointCoreConfig { + /** The list of served entities under the serving endpoint config. */ + servedEntities?: CreatePtServedModel[] | undefined; + trafficConfig?: CreateTrafficConfig | undefined; } export interface CreatePtEndpointRequest { @@ -322,15 +855,114 @@ export interface CreatePtEndpointRequest { */ name?: string | undefined; /** The core config of the serving endpoint. */ - config?: PtEndpointCoreConfig | undefined; + config?: CreatePtEndpointCoreConfig | undefined; /** Tags to be attached to the serving endpoint and automatically propagated to billing logs. */ - tags?: EndpointTag[] | undefined; + tags?: CreateEndpointTag[] | undefined; /** The AI Gateway configuration for the serving endpoint. */ - aiGateway?: AiGatewayConfig | undefined; + aiGateway?: CreateAiGatewayConfig | undefined; /** The budget policy associated with the endpoint. */ budgetPolicyId?: string | undefined; /** Email notification settings. */ - emailNotifications?: EmailNotifications | undefined; + emailNotifications?: CreateEmailNotifications | undefined; +} + +export interface CreatePtServedModel { + /** The name of a served entity. It must be unique across an endpoint. A served entity name can consist of alphanumeric characters, dashes, and underscores. If not specified for an external model, this field defaults to external_model.name, with '.' and ':' replaced with '-', and if not specified for other entities, it defaults to entity_name-entity_version. */ + name?: string | undefined; + /** The name of the entity to be served. The entity may be a model in the Databricks Model Registry, a model in the Unity Catalog (UC), or a function of type FEATURE_SPEC in the UC. If it is a UC object, the full name of the object should be given in the form of **catalog_name.schema_name.model_name**. */ + entityName: string; + entityVersion?: string | undefined; + /** The number of model units to be provisioned. */ + provisionedModelUnits: bigint; + /** + * Whether burst scaling is enabled. When enabled (default), the endpoint can automatically + * scale up beyond provisioned capacity to handle traffic spikes. When disabled, the endpoint + * maintains fixed capacity at provisioned_model_units. + */ + burstScalingEnabled?: boolean | undefined; +} + +export interface CreateRateLimit { + /** Used to specify how many calls are allowed for a key within the renewal_period. */ + calls: bigint; + /** Key field for a serving endpoint rate limit. Currently, only 'user' and 'endpoint' are supported, with 'endpoint' being the default if not specified. */ + key?: string | undefined; + /** Renewal period field for a serving endpoint rate limit. Currently, only 'minute' is supported. */ + renewalPeriod: string; +} + +export interface CreateRoute { + /** The name of the served model this route configures traffic for. */ + servedModelName?: string | undefined; + /** The percentage of endpoint traffic to send to this route. It must be an integer between 0 and 100 inclusive. */ + trafficPercentage: number; + servedEntityName?: string | undefined; +} + +export interface CreateServedModel { + /** The name of a served entity. It must be unique across an endpoint. A served entity name can consist of alphanumeric characters, dashes, and underscores. If not specified for an external model, this field defaults to external_model.name, with '.' and ':' replaced with '-', and if not specified for other entities, it defaults to entity_name-entity_version. */ + name?: string | undefined; + /** The external model to be served. NOTE: Only one of external_model and (entity_name, entity_version, workload_size, workload_type, and scale_to_zero_enabled) can be specified with the latter set being used for custom model serving for a registered model. For an existing endpoint with external_model, it cannot be updated to an endpoint without external_model. If the endpoint is created without external_model, users cannot update it to add external_model later. The task type of all external models within an endpoint must be the same. */ + externalModel?: CreateExternalModel | undefined; + /** The name of the entity to be served. The entity may be a model in the Databricks Model Registry, a model in the Unity Catalog (UC), or a function of type FEATURE_SPEC in the UC. If it is a UC object, the full name of the object should be given in the form of **catalog_name.schema_name.model_name**. */ + entityName?: string | undefined; + entityVersion?: string | undefined; + /** The minimum tokens per second that the endpoint can scale down to. */ + minProvisionedThroughput?: number | undefined; + /** The maximum tokens per second that the endpoint can scale up to. */ + maxProvisionedThroughput?: number | undefined; + /** The minimum provisioned concurrency that the endpoint can scale down to. Do not use if workload_size is specified. */ + minProvisionedConcurrency?: number | undefined; + /** The maximum provisioned concurrency that the endpoint can scale up to. Do not use if workload_size is specified. */ + maxProvisionedConcurrency?: number | undefined; + /** The workload size of the served entity. The workload size corresponds to a range of provisioned concurrency that the compute autoscales between. A single unit of provisioned concurrency can process one request at a time. Valid workload sizes are "Small" (4 - 4 provisioned concurrency), "Medium" (8 - 16 provisioned concurrency), and "Large" (16 - 64 provisioned concurrency). Additional custom workload sizes can also be used when available in the workspace. If scale-to-zero is enabled, the lower bound of the provisioned concurrency for each workload size is 0. Do not use if min_provisioned_concurrency and max_provisioned_concurrency are specified. */ + workloadSize?: string | undefined; + /** The number of model units provisioned. */ + provisionedModelUnits?: bigint | undefined; + /** + * Whether burst scaling is enabled. When enabled (default), the endpoint can automatically + * scale up beyond provisioned capacity to handle traffic spikes. When disabled, the endpoint + * maintains fixed capacity at provisioned_model_units. + */ + burstScalingEnabled?: boolean | undefined; + /** Whether the compute resources for the served entity should scale down to zero. */ + scaleToZeroEnabled?: boolean | undefined; + modelName: string; + modelVersion: string; + /** An object containing a set of optional, user-specified environment variable key-value pairs used for serving this entity. Note: this is an experimental feature and subject to change. Example entity environment variables that refer to secrets: `{"OPENAI_API_KEY": "{{secrets/my_scope/my_key}}", "DATABRICKS_TOKEN": "{{secrets/my_scope2/my_key2}}"}` */ + environmentVars?: Record | undefined; + /** ARN of the instance profile that the served entity uses to access AWS resources. */ + instanceProfileArn?: string | undefined; + foundationModel?: CreateFoundationModel | undefined; + state?: CreateServedModelState | undefined; + creator?: string | undefined; + creationTimestamp?: bigint | undefined; +} + +export interface CreateServedModelState { + deployment?: ServedModelDeploymentState | undefined; + deploymentStateMessage?: string | undefined; +} + +export interface CreateTelemetryConfig { + /** Configuration for inference table payload logging, including sampling. */ + inferenceTableConfig?: CreateTelemetryInferenceTableConfig | undefined; +} + +/** Inference table payload logging configuration */ +export interface CreateTelemetryInferenceTableConfig { + /** Fraction of requests sampled for payload logging, in the range [0.0, 1.0], where 1.0 logs all requests. */ + samplingFraction?: number | undefined; +} + +export interface CreateTrafficConfig { + /** The list of routes that define traffic to each served entity. */ + routes?: CreateRoute[] | undefined; +} + +export interface CreateUsageTrackingConfig { + /** Whether to enable usage tracking. */ + enabled?: boolean | undefined; } /** Configs needed to create a custom provider model route. */ @@ -862,7 +1494,7 @@ export interface PatchInferenceEndpointTagsRequest { /** The name of the serving endpoint who's tags to patch. This field is required. */ name?: string | undefined; /** List of endpoint tags to add */ - addTags?: EndpointTag[] | undefined; + addTags?: CreateEndpointTag[] | undefined; /** List of tag keys to delete */ deleteTags?: string[] | undefined; } @@ -931,21 +1563,21 @@ export interface PutInferenceEndpointAiGatewayRequest { * Configuration to enable usage tracking using system tables. * These tables allow you to monitor operational usage on endpoints and their associated costs. */ - usageTrackingConfig?: UsageTrackingConfig | undefined; + usageTrackingConfig?: CreateUsageTrackingConfig | undefined; /** * Configuration for payload logging using inference tables. * Use these tables to monitor and audit data being sent to and received from model APIs and to improve model quality. */ - inferenceTableConfig?: InferenceTableConfig | undefined; + inferenceTableConfig?: CreateInferenceTableConfig | undefined; /** Configuration for rate limits which can be set to limit endpoint traffic. */ - rateLimits?: AiGatewayRateLimit[] | undefined; + rateLimits?: CreateAiGatewayRateLimit[] | undefined; /** Configuration for AI Guardrails to prevent unwanted data and unsafe data in requests and responses. */ - guardrails?: AiGuardrails | undefined; + guardrails?: CreateAiGuardrails | undefined; /** * Configuration for traffic fallback which auto fallbacks to other served entities if the request to a served * entity fails with certain error codes, to increase availability. */ - fallbackConfig?: FallbackConfig | undefined; + fallbackConfig?: CreateFallbackConfig | undefined; } export interface PutInferenceEndpointAiGatewayResponse { @@ -974,25 +1606,25 @@ export interface PutInferenceEndpointConfigRequest { /** The name of the serving endpoint to update. This field is required. */ name?: string | undefined; /** The list of served entities under the serving endpoint config. */ - servedEntities?: ServedModel[] | undefined; + servedEntities?: CreateServedModel[] | undefined; /** (Deprecated, use served_entities instead) The list of served models under the serving endpoint config. */ - servedModels?: ServedModel[] | undefined; + servedModels?: CreateServedModel[] | undefined; /** The traffic configuration associated with the serving endpoint config. */ - trafficConfig?: TrafficConfig | undefined; + trafficConfig?: CreateTrafficConfig | undefined; /** * Configuration for legacy Inference Tables which automatically log requests and responses to Unity * Catalog. * Deprecated: please use AI Gateway inference tables instead. See * https://docs.databricks.com/aws/en/ai-gateway/inference-tables. */ - autoCaptureConfig?: AutoCaptureConfig | undefined; + autoCaptureConfig?: CreateAutoCaptureConfig | undefined; } export interface PutInferenceEndpointRateLimitsRequest { /** The name of the serving endpoint whose rate limits are being updated. This field is required. */ name?: string | undefined; /** The list of endpoint rate limits. */ - rateLimits?: RateLimit[] | undefined; + rateLimits?: CreateRateLimit[] | undefined; } export interface PutInferenceEndpointRateLimitsResponse { @@ -1003,7 +1635,7 @@ export interface PutInferenceEndpointRateLimitsResponse { export interface PutPtEndpointConfigRequest { /** The name of the pt endpoint to update. This field is required. */ name?: string | undefined; - config?: PtEndpointCoreConfig | undefined; + config?: CreatePtEndpointCoreConfig | undefined; } export interface RateLimit { @@ -1102,7 +1734,7 @@ export interface UpdateInferenceEndpointNotificationsRequest { /** The name of the serving endpoint whose notifications are being updated. This field is required. */ name?: string | undefined; /** The email notification settings to update. Specify email addresses to notify when endpoint state changes occur. */ - emailNotifications?: EmailNotifications | undefined; + emailNotifications?: CreateEmailNotifications | undefined; } export interface UpdateInferenceEndpointNotificationsResponse { @@ -1939,7 +2571,7 @@ export const unmarshalUsageTrackingConfigSchema: z.ZodType enabled: d.enabled, })); -export const marshalAi21LabsConfigSchema: z.ZodType = z +export const marshalCreateAi21LabsConfigSchema: z.ZodType = z .object({ ai21labsApiKey: z.string().optional(), ai21labsApiKeyPlaintext: z.string().optional(), @@ -1949,19 +2581,19 @@ export const marshalAi21LabsConfigSchema: z.ZodType = z ai21labs_api_key_plaintext: d.ai21labsApiKeyPlaintext, })); -export const marshalAiGatewayConfigSchema: z.ZodType = z +export const marshalCreateAiGatewayConfigSchema: z.ZodType = z .object({ usageTrackingConfig: z - .lazy(() => marshalUsageTrackingConfigSchema) + .lazy(() => marshalCreateUsageTrackingConfigSchema) .optional(), inferenceTableConfig: z - .lazy(() => marshalInferenceTableConfigSchema) + .lazy(() => marshalCreateInferenceTableConfigSchema) .optional(), rateLimits: z - .array(z.lazy(() => marshalAiGatewayRateLimitSchema)) + .array(z.lazy(() => marshalCreateAiGatewayRateLimitSchema)) .optional(), - guardrails: z.lazy(() => marshalAiGuardrailsSchema).optional(), - fallbackConfig: z.lazy(() => marshalFallbackConfigSchema).optional(), + guardrails: z.lazy(() => marshalCreateAiGuardrailsSchema).optional(), + fallbackConfig: z.lazy(() => marshalCreateFallbackConfigSchema).optional(), }) .transform(d => ({ usage_tracking_config: d.usageTrackingConfig, @@ -1971,11 +2603,11 @@ export const marshalAiGatewayConfigSchema: z.ZodType = z fallback_config: d.fallbackConfig, })); -export const marshalAiGatewayRateLimitSchema: z.ZodType = z +export const marshalCreateAiGatewayRateLimitSchema: z.ZodType = z .object({ calls: z.bigint().optional(), key: z.string().optional(), - renewalPeriod: z.string().optional(), + renewalPeriod: z.string(), principal: z.string().optional(), tokens: z.bigint().optional(), }) @@ -1987,10 +2619,10 @@ export const marshalAiGatewayRateLimitSchema: z.ZodType = z tokens: d.tokens, })); -export const marshalAiGuardrailParametersSchema: z.ZodType = z +export const marshalCreateAiGuardrailParametersSchema: z.ZodType = z .object({ safety: z.boolean().optional(), - pii: z.lazy(() => marshalPiiSettingsSchema).optional(), + pii: z.lazy(() => marshalCreatePiiSettingsSchema).optional(), validTopics: z.array(z.string()).optional(), invalidKeywords: z.array(z.string()).optional(), }) @@ -2001,22 +2633,22 @@ export const marshalAiGuardrailParametersSchema: z.ZodType = z invalid_keywords: d.invalidKeywords, })); -export const marshalAiGuardrailsSchema: z.ZodType = z +export const marshalCreateAiGuardrailsSchema: z.ZodType = z .object({ - input: z.lazy(() => marshalAiGuardrailParametersSchema).optional(), - output: z.lazy(() => marshalAiGuardrailParametersSchema).optional(), + input: z.lazy(() => marshalCreateAiGuardrailParametersSchema).optional(), + output: z.lazy(() => marshalCreateAiGuardrailParametersSchema).optional(), }) .transform(d => ({ input: d.input, output: d.output, })); -export const marshalAmazonBedrockConfigSchema: z.ZodType = z +export const marshalCreateAmazonBedrockConfigSchema: z.ZodType = z .object({ - awsRegion: z.string().optional(), + awsRegion: z.string(), awsAccessKeyId: z.string().optional(), awsSecretAccessKey: z.string().optional(), - bedrockProvider: z.string().optional(), + bedrockProvider: z.string(), awsAccessKeyIdPlaintext: z.string().optional(), awsSecretAccessKeyPlaintext: z.string().optional(), instanceProfileArn: z.string().optional(), @@ -2031,7 +2663,7 @@ export const marshalAmazonBedrockConfigSchema: z.ZodType = z instance_profile_arn: d.instanceProfileArn, })); -export const marshalAnthropicConfigSchema: z.ZodType = z +export const marshalCreateAnthropicConfigSchema: z.ZodType = z .object({ anthropicApiKey: z.string().optional(), anthropicApiKeyPlaintext: z.string().optional(), @@ -2041,9 +2673,9 @@ export const marshalAnthropicConfigSchema: z.ZodType = z anthropic_api_key_plaintext: d.anthropicApiKeyPlaintext, })); -export const marshalApiKeyAuthSchema: z.ZodType = z +export const marshalCreateApiKeyAuthSchema: z.ZodType = z .object({ - key: z.string().optional(), + key: z.string(), value: z.string().optional(), valuePlaintext: z.string().optional(), }) @@ -2053,12 +2685,12 @@ export const marshalApiKeyAuthSchema: z.ZodType = z value_plaintext: d.valuePlaintext, })); -export const marshalAutoCaptureConfigSchema: z.ZodType = z +export const marshalCreateAutoCaptureConfigSchema: z.ZodType = z .object({ catalogName: z.string().optional(), schemaName: z.string().optional(), tableNamePrefix: z.string().optional(), - state: z.lazy(() => marshalAutoCaptureStateSchema).optional(), + state: z.lazy(() => marshalCreateAutoCaptureStateSchema).optional(), enabled: z.boolean().optional(), }) .transform(d => ({ @@ -2069,89 +2701,43 @@ export const marshalAutoCaptureConfigSchema: z.ZodType = z enabled: d.enabled, })); -export const marshalAutoCaptureStateSchema: z.ZodType = z +export const marshalCreateAutoCaptureStateSchema: z.ZodType = z .object({ - payloadTable: z.lazy(() => marshalPayloadTableSchema).optional(), + payloadTable: z.lazy(() => marshalCreatePayloadTableSchema).optional(), }) .transform(d => ({ payload_table: d.payloadTable, })); - -export const marshalBearerTokenAuthSchema: z.ZodType = z - .object({ - token: z.string().optional(), - tokenPlaintext: z.string().optional(), - }) - .transform(d => ({ - token: d.token, - token_plaintext: d.tokenPlaintext, - })); - -export const marshalCohereConfigSchema: z.ZodType = z - .object({ - cohereApiKey: z.string().optional(), - cohereApiKeyPlaintext: z.string().optional(), - cohereApiBase: z.string().optional(), - }) - .transform(d => ({ - cohere_api_key: d.cohereApiKey, - cohere_api_key_plaintext: d.cohereApiKeyPlaintext, - cohere_api_base: d.cohereApiBase, - })); - -export const marshalCreateInferenceEndpointRequestSchema: z.ZodType = z - .object({ - name: z.string().optional(), - config: z.lazy(() => marshalEndpointCoreConfigSchema).optional(), - tags: z.array(z.lazy(() => marshalEndpointTagSchema)).optional(), - routeOptimized: z.boolean().optional(), - rateLimits: z.array(z.lazy(() => marshalRateLimitSchema)).optional(), - aiGateway: z.lazy(() => marshalAiGatewayConfigSchema).optional(), - budgetPolicyId: z.string().optional(), - emailNotifications: z - .lazy(() => marshalEmailNotificationsSchema) - .optional(), - description: z.string().optional(), - telemetryConfig: z.lazy(() => marshalTelemetryConfigSchema).optional(), - }) - .transform(d => ({ - name: d.name, - config: d.config, - tags: d.tags, - route_optimized: d.routeOptimized, - rate_limits: d.rateLimits, - ai_gateway: d.aiGateway, - budget_policy_id: d.budgetPolicyId, - email_notifications: d.emailNotifications, - description: d.description, - telemetry_config: d.telemetryConfig, + +export const marshalCreateBearerTokenAuthSchema: z.ZodType = z + .object({ + token: z.string().optional(), + tokenPlaintext: z.string().optional(), + }) + .transform(d => ({ + token: d.token, + token_plaintext: d.tokenPlaintext, })); -export const marshalCreatePtEndpointRequestSchema: z.ZodType = z +export const marshalCreateCohereConfigSchema: z.ZodType = z .object({ - name: z.string().optional(), - config: z.lazy(() => marshalPtEndpointCoreConfigSchema).optional(), - tags: z.array(z.lazy(() => marshalEndpointTagSchema)).optional(), - aiGateway: z.lazy(() => marshalAiGatewayConfigSchema).optional(), - budgetPolicyId: z.string().optional(), - emailNotifications: z - .lazy(() => marshalEmailNotificationsSchema) - .optional(), + cohereApiKey: z.string().optional(), + cohereApiKeyPlaintext: z.string().optional(), + cohereApiBase: z.string().optional(), }) .transform(d => ({ - name: d.name, - config: d.config, - tags: d.tags, - ai_gateway: d.aiGateway, - budget_policy_id: d.budgetPolicyId, - email_notifications: d.emailNotifications, + cohere_api_key: d.cohereApiKey, + cohere_api_key_plaintext: d.cohereApiKeyPlaintext, + cohere_api_base: d.cohereApiBase, })); -export const marshalCustomProviderConfigSchema: z.ZodType = z +export const marshalCreateCustomProviderConfigSchema: z.ZodType = z .object({ - customProviderUrl: z.string().optional(), - bearerTokenAuth: z.lazy(() => marshalBearerTokenAuthSchema).optional(), - apiKeyAuth: z.lazy(() => marshalApiKeyAuthSchema).optional(), + customProviderUrl: z.string(), + bearerTokenAuth: z + .lazy(() => marshalCreateBearerTokenAuthSchema) + .optional(), + apiKeyAuth: z.lazy(() => marshalCreateApiKeyAuthSchema).optional(), }) .transform(d => ({ custom_provider_url: d.customProviderUrl, @@ -2159,10 +2745,10 @@ export const marshalCustomProviderConfigSchema: z.ZodType = z api_key_auth: d.apiKeyAuth, })); -export const marshalDatabricksModelServingConfigSchema: z.ZodType = z +export const marshalCreateDatabricksModelServingConfigSchema: z.ZodType = z .object({ databricksApiToken: z.string().optional(), - databricksWorkspaceUrl: z.string().optional(), + databricksWorkspaceUrl: z.string(), databricksApiTokenPlaintext: z.string().optional(), }) .transform(d => ({ @@ -2171,7 +2757,7 @@ export const marshalDatabricksModelServingConfigSchema: z.ZodType = z databricks_api_token_plaintext: d.databricksApiTokenPlaintext, })); -export const marshalEmailNotificationsSchema: z.ZodType = z +export const marshalCreateEmailNotificationsSchema: z.ZodType = z .object({ onUpdateSuccess: z.array(z.string()).optional(), onUpdateFailure: z.array(z.string()).optional(), @@ -2181,12 +2767,18 @@ export const marshalEmailNotificationsSchema: z.ZodType = z on_update_failure: d.onUpdateFailure, })); -export const marshalEndpointCoreConfigSchema: z.ZodType = z +export const marshalCreateEndpointCoreConfigSchema: z.ZodType = z .object({ - servedEntities: z.array(z.lazy(() => marshalServedModelSchema)).optional(), - servedModels: z.array(z.lazy(() => marshalServedModelSchema)).optional(), - trafficConfig: z.lazy(() => marshalTrafficConfigSchema).optional(), - autoCaptureConfig: z.lazy(() => marshalAutoCaptureConfigSchema).optional(), + servedEntities: z + .array(z.lazy(() => marshalCreateServedModelSchema)) + .optional(), + servedModels: z + .array(z.lazy(() => marshalCreateServedModelSchema)) + .optional(), + trafficConfig: z.lazy(() => marshalCreateTrafficConfigSchema).optional(), + autoCaptureConfig: z + .lazy(() => marshalCreateAutoCaptureConfigSchema) + .optional(), }) .transform(d => ({ served_entities: d.servedEntities, @@ -2195,9 +2787,9 @@ export const marshalEndpointCoreConfigSchema: z.ZodType = z auto_capture_config: d.autoCaptureConfig, })); -export const marshalEndpointTagSchema: z.ZodType = z +export const marshalCreateEndpointTagSchema: z.ZodType = z .object({ - key: z.string().optional(), + key: z.string(), value: z.string().optional(), }) .transform(d => ({ @@ -2205,72 +2797,56 @@ export const marshalEndpointTagSchema: z.ZodType = z value: d.value, })); -export const marshalExternalFunctionRequestSchema: z.ZodType = z - .object({ - connectionName: z.string().optional(), - method: z.string().optional(), - path: z.string().optional(), - json: z.string().optional(), - headers: z.string().optional(), - params: z.string().optional(), - subDomain: z.string().optional(), - }) - .transform(d => ({ - connection_name: d.connectionName, - method: d.method, - path: d.path, - json: d.json, - headers: d.headers, - params: d.params, - sub_domain: d.subDomain, - })); - -export const marshalExternalModelSchema: z.ZodType = z +export const marshalCreateExternalModelSchema: z.ZodType = z .object({ - provider: z.string().optional(), - name: z.string().optional(), - task: z.string().optional(), + provider: z.string(), + name: z.string(), + task: z.string(), config: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('ai21labsConfig'), - ai21labsConfig: z.lazy(() => marshalAi21LabsConfigSchema), + ai21labsConfig: z.lazy(() => marshalCreateAi21LabsConfigSchema), }), z.object({ $case: z.literal('anthropicConfig'), - anthropicConfig: z.lazy(() => marshalAnthropicConfigSchema), + anthropicConfig: z.lazy(() => marshalCreateAnthropicConfigSchema), }), z.object({ $case: z.literal('amazonBedrockConfig'), - amazonBedrockConfig: z.lazy(() => marshalAmazonBedrockConfigSchema), + amazonBedrockConfig: z.lazy( + () => marshalCreateAmazonBedrockConfigSchema + ), }), z.object({ $case: z.literal('cohereConfig'), - cohereConfig: z.lazy(() => marshalCohereConfigSchema), + cohereConfig: z.lazy(() => marshalCreateCohereConfigSchema), }), z.object({ $case: z.literal('googleCloudVertexAiConfig'), googleCloudVertexAiConfig: z.lazy( - () => marshalGoogleCloudVertexAiConfigSchema + () => marshalCreateGoogleCloudVertexAiConfigSchema ), }), z.object({ $case: z.literal('databricksModelServingConfig'), databricksModelServingConfig: z.lazy( - () => marshalDatabricksModelServingConfigSchema + () => marshalCreateDatabricksModelServingConfigSchema ), }), z.object({ $case: z.literal('openaiConfig'), - openaiConfig: z.lazy(() => marshalOpenAiConfigSchema), + openaiConfig: z.lazy(() => marshalCreateOpenAiConfigSchema), }), z.object({ $case: z.literal('palmConfig'), - palmConfig: z.lazy(() => marshalPaLmConfigSchema), + palmConfig: z.lazy(() => marshalCreatePaLmConfigSchema), }), z.object({ $case: z.literal('customProviderConfig'), - customProviderConfig: z.lazy(() => marshalCustomProviderConfigSchema), + customProviderConfig: z.lazy( + () => marshalCreateCustomProviderConfigSchema + ), }), ]) .optional(), @@ -2306,15 +2882,15 @@ export const marshalExternalModelSchema: z.ZodType = z }), })); -export const marshalFallbackConfigSchema: z.ZodType = z +export const marshalCreateFallbackConfigSchema: z.ZodType = z .object({ - enabled: z.boolean().optional(), + enabled: z.boolean(), }) .transform(d => ({ enabled: d.enabled, })); -export const marshalFoundationModelSchema: z.ZodType = z +export const marshalCreateFoundationModelSchema: z.ZodType = z .object({ name: z.string().optional(), displayName: z.string().optional(), @@ -2328,11 +2904,11 @@ export const marshalFoundationModelSchema: z.ZodType = z description: d.description, })); -export const marshalGoogleCloudVertexAiConfigSchema: z.ZodType = z +export const marshalCreateGoogleCloudVertexAiConfigSchema: z.ZodType = z .object({ privateKey: z.string().optional(), - projectId: z.string().optional(), - region: z.string().optional(), + projectId: z.string(), + region: z.string(), privateKeyPlaintext: z.string().optional(), }) .transform(d => ({ @@ -2342,7 +2918,37 @@ export const marshalGoogleCloudVertexAiConfigSchema: z.ZodType = z private_key_plaintext: d.privateKeyPlaintext, })); -export const marshalInferenceTableConfigSchema: z.ZodType = z +export const marshalCreateInferenceEndpointRequestSchema: z.ZodType = z + .object({ + name: z.string().optional(), + config: z.lazy(() => marshalCreateEndpointCoreConfigSchema).optional(), + tags: z.array(z.lazy(() => marshalCreateEndpointTagSchema)).optional(), + routeOptimized: z.boolean().optional(), + rateLimits: z.array(z.lazy(() => marshalCreateRateLimitSchema)).optional(), + aiGateway: z.lazy(() => marshalCreateAiGatewayConfigSchema).optional(), + budgetPolicyId: z.string().optional(), + emailNotifications: z + .lazy(() => marshalCreateEmailNotificationsSchema) + .optional(), + description: z.string().optional(), + telemetryConfig: z + .lazy(() => marshalCreateTelemetryConfigSchema) + .optional(), + }) + .transform(d => ({ + name: d.name, + config: d.config, + tags: d.tags, + route_optimized: d.routeOptimized, + rate_limits: d.rateLimits, + ai_gateway: d.aiGateway, + budget_policy_id: d.budgetPolicyId, + email_notifications: d.emailNotifications, + description: d.description, + telemetry_config: d.telemetryConfig, + })); + +export const marshalCreateInferenceTableConfigSchema: z.ZodType = z .object({ catalogName: z.string().optional(), schemaName: z.string().optional(), @@ -2356,7 +2962,7 @@ export const marshalInferenceTableConfigSchema: z.ZodType = z enabled: d.enabled, })); -export const marshalOpenAiConfigSchema: z.ZodType = z +export const marshalCreateOpenAiConfigSchema: z.ZodType = z .object({ openaiApiKey: z.string().optional(), openaiApiType: z.string().optional(), @@ -2385,7 +2991,7 @@ export const marshalOpenAiConfigSchema: z.ZodType = z d.microsoftEntraClientSecretPlaintext, })); -export const marshalPaLmConfigSchema: z.ZodType = z +export const marshalCreatePaLmConfigSchema: z.ZodType = z .object({ palmApiKey: z.string().optional(), palmApiKeyPlaintext: z.string().optional(), @@ -2395,19 +3001,7 @@ export const marshalPaLmConfigSchema: z.ZodType = z palm_api_key_plaintext: d.palmApiKeyPlaintext, })); -export const marshalPatchInferenceEndpointTagsRequestSchema: z.ZodType = z - .object({ - name: z.string().optional(), - addTags: z.array(z.lazy(() => marshalEndpointTagSchema)).optional(), - deleteTags: z.array(z.string()).optional(), - }) - .transform(d => ({ - name: d.name, - add_tags: d.addTags, - delete_tags: d.deleteTags, - })); - -export const marshalPayloadTableSchema: z.ZodType = z +export const marshalCreatePayloadTableSchema: z.ZodType = z .object({ name: z.string().optional(), status: z.string().optional(), @@ -2419,7 +3013,7 @@ export const marshalPayloadTableSchema: z.ZodType = z status_message: d.statusMessage, })); -export const marshalPiiSettingsSchema: z.ZodType = z +export const marshalCreatePiiSettingsSchema: z.ZodType = z .object({ behavior: z.string().optional(), }) @@ -2427,99 +3021,59 @@ export const marshalPiiSettingsSchema: z.ZodType = z behavior: d.behavior, })); -export const marshalPtEndpointCoreConfigSchema: z.ZodType = z +export const marshalCreatePtEndpointCoreConfigSchema: z.ZodType = z .object({ servedEntities: z - .array(z.lazy(() => marshalPtServedModelSchema)) + .array(z.lazy(() => marshalCreatePtServedModelSchema)) .optional(), - trafficConfig: z.lazy(() => marshalTrafficConfigSchema).optional(), + trafficConfig: z.lazy(() => marshalCreateTrafficConfigSchema).optional(), }) .transform(d => ({ served_entities: d.servedEntities, traffic_config: d.trafficConfig, })); -export const marshalPtServedModelSchema: z.ZodType = z - .object({ - name: z.string().optional(), - entityName: z.string().optional(), - entityVersion: z.string().optional(), - provisionedModelUnits: z.bigint().optional(), - burstScalingEnabled: z.boolean().optional(), - }) - .transform(d => ({ - name: d.name, - entity_name: d.entityName, - entity_version: d.entityVersion, - provisioned_model_units: d.provisionedModelUnits, - burst_scaling_enabled: d.burstScalingEnabled, - })); - -export const marshalPutInferenceEndpointAiGatewayRequestSchema: z.ZodType = z +export const marshalCreatePtEndpointRequestSchema: z.ZodType = z .object({ name: z.string().optional(), - usageTrackingConfig: z - .lazy(() => marshalUsageTrackingConfigSchema) - .optional(), - inferenceTableConfig: z - .lazy(() => marshalInferenceTableConfigSchema) - .optional(), - rateLimits: z - .array(z.lazy(() => marshalAiGatewayRateLimitSchema)) + config: z.lazy(() => marshalCreatePtEndpointCoreConfigSchema).optional(), + tags: z.array(z.lazy(() => marshalCreateEndpointTagSchema)).optional(), + aiGateway: z.lazy(() => marshalCreateAiGatewayConfigSchema).optional(), + budgetPolicyId: z.string().optional(), + emailNotifications: z + .lazy(() => marshalCreateEmailNotificationsSchema) .optional(), - guardrails: z.lazy(() => marshalAiGuardrailsSchema).optional(), - fallbackConfig: z.lazy(() => marshalFallbackConfigSchema).optional(), - }) - .transform(d => ({ - name: d.name, - usage_tracking_config: d.usageTrackingConfig, - inference_table_config: d.inferenceTableConfig, - rate_limits: d.rateLimits, - guardrails: d.guardrails, - fallback_config: d.fallbackConfig, - })); - -export const marshalPutInferenceEndpointConfigRequestSchema: z.ZodType = z - .object({ - name: z.string().optional(), - servedEntities: z.array(z.lazy(() => marshalServedModelSchema)).optional(), - servedModels: z.array(z.lazy(() => marshalServedModelSchema)).optional(), - trafficConfig: z.lazy(() => marshalTrafficConfigSchema).optional(), - autoCaptureConfig: z.lazy(() => marshalAutoCaptureConfigSchema).optional(), }) .transform(d => ({ name: d.name, - served_entities: d.servedEntities, - served_models: d.servedModels, - traffic_config: d.trafficConfig, - auto_capture_config: d.autoCaptureConfig, - })); - -export const marshalPutInferenceEndpointRateLimitsRequestSchema: z.ZodType = z - .object({ - name: z.string().optional(), - rateLimits: z.array(z.lazy(() => marshalRateLimitSchema)).optional(), - }) - .transform(d => ({ - name: d.name, - rate_limits: d.rateLimits, + config: d.config, + tags: d.tags, + ai_gateway: d.aiGateway, + budget_policy_id: d.budgetPolicyId, + email_notifications: d.emailNotifications, })); -export const marshalPutPtEndpointConfigRequestSchema: z.ZodType = z +export const marshalCreatePtServedModelSchema: z.ZodType = z .object({ name: z.string().optional(), - config: z.lazy(() => marshalPtEndpointCoreConfigSchema).optional(), + entityName: z.string(), + entityVersion: z.string().optional(), + provisionedModelUnits: z.bigint(), + burstScalingEnabled: z.boolean().optional(), }) .transform(d => ({ name: d.name, - config: d.config, + entity_name: d.entityName, + entity_version: d.entityVersion, + provisioned_model_units: d.provisionedModelUnits, + burst_scaling_enabled: d.burstScalingEnabled, })); -export const marshalRateLimitSchema: z.ZodType = z +export const marshalCreateRateLimitSchema: z.ZodType = z .object({ - calls: z.bigint().optional(), + calls: z.bigint(), key: z.string().optional(), - renewalPeriod: z.string().optional(), + renewalPeriod: z.string(), }) .transform(d => ({ calls: d.calls, @@ -2527,10 +3081,10 @@ export const marshalRateLimitSchema: z.ZodType = z renewal_period: d.renewalPeriod, })); -export const marshalRouteSchema: z.ZodType = z +export const marshalCreateRouteSchema: z.ZodType = z .object({ servedModelName: z.string().optional(), - trafficPercentage: z.number().optional(), + trafficPercentage: z.number(), servedEntityName: z.string().optional(), }) .transform(d => ({ @@ -2539,10 +3093,10 @@ export const marshalRouteSchema: z.ZodType = z served_entity_name: d.servedEntityName, })); -export const marshalServedModelSchema: z.ZodType = z +export const marshalCreateServedModelSchema: z.ZodType = z .object({ name: z.string().optional(), - externalModel: z.lazy(() => marshalExternalModelSchema).optional(), + externalModel: z.lazy(() => marshalCreateExternalModelSchema).optional(), entityName: z.string().optional(), entityVersion: z.string().optional(), minProvisionedThroughput: z.number().optional(), @@ -2553,12 +3107,14 @@ export const marshalServedModelSchema: z.ZodType = z provisionedModelUnits: z.bigint().optional(), burstScalingEnabled: z.boolean().optional(), scaleToZeroEnabled: z.boolean().optional(), - modelName: z.string().optional(), - modelVersion: z.string().optional(), + modelName: z.string(), + modelVersion: z.string(), environmentVars: z.record(z.string(), z.string()).optional(), instanceProfileArn: z.string().optional(), - foundationModel: z.lazy(() => marshalFoundationModelSchema).optional(), - state: z.lazy(() => marshalServedModelStateSchema).optional(), + foundationModel: z + .lazy(() => marshalCreateFoundationModelSchema) + .optional(), + state: z.lazy(() => marshalCreateServedModelStateSchema).optional(), creator: z.string().optional(), creationTimestamp: z.bigint().optional(), }) @@ -2585,7 +3141,7 @@ export const marshalServedModelSchema: z.ZodType = z creation_timestamp: d.creationTimestamp, })); -export const marshalServedModelStateSchema: z.ZodType = z +export const marshalCreateServedModelStateSchema: z.ZodType = z .object({ deployment: z.string().optional(), deploymentStateMessage: z.string().optional(), @@ -2595,51 +3151,147 @@ export const marshalServedModelStateSchema: z.ZodType = z deployment_state_message: d.deploymentStateMessage, })); -export const marshalTelemetryConfigSchema: z.ZodType = z +export const marshalCreateTelemetryConfigSchema: z.ZodType = z .object({ inferenceTableConfig: z - .lazy(() => marshalTelemetryInferenceTableConfigSchema) + .lazy(() => marshalCreateTelemetryInferenceTableConfigSchema) .optional(), }) .transform(d => ({ inference_table_config: d.inferenceTableConfig, })); -export const marshalTelemetryInferenceTableConfigSchema: z.ZodType = z +export const marshalCreateTelemetryInferenceTableConfigSchema: z.ZodType = z .object({ samplingFraction: z.number().optional(), - name: z.string().optional(), }) .transform(d => ({ sampling_fraction: d.samplingFraction, - name: d.name, })); -export const marshalTrafficConfigSchema: z.ZodType = z +export const marshalCreateTrafficConfigSchema: z.ZodType = z .object({ - routes: z.array(z.lazy(() => marshalRouteSchema)).optional(), + routes: z.array(z.lazy(() => marshalCreateRouteSchema)).optional(), }) .transform(d => ({ routes: d.routes, })); +export const marshalCreateUsageTrackingConfigSchema: z.ZodType = z + .object({ + enabled: z.boolean().optional(), + }) + .transform(d => ({ + enabled: d.enabled, + })); + +export const marshalExternalFunctionRequestSchema: z.ZodType = z + .object({ + connectionName: z.string().optional(), + method: z.string().optional(), + path: z.string().optional(), + json: z.string().optional(), + headers: z.string().optional(), + params: z.string().optional(), + subDomain: z.string().optional(), + }) + .transform(d => ({ + connection_name: d.connectionName, + method: d.method, + path: d.path, + json: d.json, + headers: d.headers, + params: d.params, + sub_domain: d.subDomain, + })); + +export const marshalPatchInferenceEndpointTagsRequestSchema: z.ZodType = z + .object({ + name: z.string().optional(), + addTags: z.array(z.lazy(() => marshalCreateEndpointTagSchema)).optional(), + deleteTags: z.array(z.string()).optional(), + }) + .transform(d => ({ + name: d.name, + add_tags: d.addTags, + delete_tags: d.deleteTags, + })); + +export const marshalPutInferenceEndpointAiGatewayRequestSchema: z.ZodType = z + .object({ + name: z.string().optional(), + usageTrackingConfig: z + .lazy(() => marshalCreateUsageTrackingConfigSchema) + .optional(), + inferenceTableConfig: z + .lazy(() => marshalCreateInferenceTableConfigSchema) + .optional(), + rateLimits: z + .array(z.lazy(() => marshalCreateAiGatewayRateLimitSchema)) + .optional(), + guardrails: z.lazy(() => marshalCreateAiGuardrailsSchema).optional(), + fallbackConfig: z.lazy(() => marshalCreateFallbackConfigSchema).optional(), + }) + .transform(d => ({ + name: d.name, + usage_tracking_config: d.usageTrackingConfig, + inference_table_config: d.inferenceTableConfig, + rate_limits: d.rateLimits, + guardrails: d.guardrails, + fallback_config: d.fallbackConfig, + })); + +export const marshalPutInferenceEndpointConfigRequestSchema: z.ZodType = z + .object({ + name: z.string().optional(), + servedEntities: z + .array(z.lazy(() => marshalCreateServedModelSchema)) + .optional(), + servedModels: z + .array(z.lazy(() => marshalCreateServedModelSchema)) + .optional(), + trafficConfig: z.lazy(() => marshalCreateTrafficConfigSchema).optional(), + autoCaptureConfig: z + .lazy(() => marshalCreateAutoCaptureConfigSchema) + .optional(), + }) + .transform(d => ({ + name: d.name, + served_entities: d.servedEntities, + served_models: d.servedModels, + traffic_config: d.trafficConfig, + auto_capture_config: d.autoCaptureConfig, + })); + +export const marshalPutInferenceEndpointRateLimitsRequestSchema: z.ZodType = z + .object({ + name: z.string().optional(), + rateLimits: z.array(z.lazy(() => marshalCreateRateLimitSchema)).optional(), + }) + .transform(d => ({ + name: d.name, + rate_limits: d.rateLimits, + })); + +export const marshalPutPtEndpointConfigRequestSchema: z.ZodType = z + .object({ + name: z.string().optional(), + config: z.lazy(() => marshalCreatePtEndpointCoreConfigSchema).optional(), + }) + .transform(d => ({ + name: d.name, + config: d.config, + })); + export const marshalUpdateInferenceEndpointNotificationsRequestSchema: z.ZodType = z .object({ name: z.string().optional(), emailNotifications: z - .lazy(() => marshalEmailNotificationsSchema) + .lazy(() => marshalCreateEmailNotificationsSchema) .optional(), }) .transform(d => ({ name: d.name, email_notifications: d.emailNotifications, })); - -export const marshalUsageTrackingConfigSchema: z.ZodType = z - .object({ - enabled: z.boolean().optional(), - }) - .transform(d => ({ - enabled: d.enabled, - })); diff --git a/packages/modelservingquery/src/v1/index.ts b/packages/modelservingquery/src/v1/index.ts index 0582385b..7b853fdd 100755 --- a/packages/modelservingquery/src/v1/index.ts +++ b/packages/modelservingquery/src/v1/index.ts @@ -14,6 +14,8 @@ export { export type { ChatMessage, + CreateChatMessage, + CreateDataframeSplitInput, DataframeSplitInput, EmbeddingsV1ResponseEmbeddingElement, ExternalModelUsageElement, diff --git a/packages/modelservingquery/src/v1/model.ts b/packages/modelservingquery/src/v1/model.ts index b9c6df16..7bbe04b6 100755 --- a/packages/modelservingquery/src/v1/model.ts +++ b/packages/modelservingquery/src/v1/model.ts @@ -60,6 +60,22 @@ export interface ChatMessage { content?: string | undefined; } +export interface CreateChatMessage { + /** The role of the message. One of [system, user, assistant]. */ + role?: ChatMessageRole | undefined; + /** The content of the message. */ + content?: string | undefined; +} + +export interface CreateDataframeSplitInput { + /** Index array for the dataframe */ + index?: number[] | undefined; + /** Columns array for the dataframe */ + columns?: JsonValue[] | undefined; + /** Data array for the dataframe */ + data?: JsonValue[] | undefined; +} + export interface DataframeSplitInput { /** Index array for the dataframe */ index?: number[] | undefined; @@ -104,7 +120,7 @@ export interface QueryEndpointRequest { * The messages field used ONLY for __chat external & foundation model__ serving endpoints. * This is an array of ChatMessage objects and should only be used with other chat query fields. */ - messages?: ChatMessage[] | undefined; + messages?: CreateChatMessage[] | undefined; /** * The temperature field used ONLY for __completions__ and __chat external & foundation model__ serving * endpoints. This is a float between 0.0 and 2.0 with a default of 1.0 and should only be used with other @@ -141,7 +157,7 @@ export interface QueryEndpointRequest { /** Pandas Dataframe input in the records orientation. */ dataframeRecords?: JsonValue[] | undefined; /** Pandas Dataframe input in the split orientation. */ - dataframeSplit?: DataframeSplitInput | undefined; + dataframeSplit?: CreateDataframeSplitInput | undefined; /** Tensor-based input in row format. */ instances?: JsonValue[] | undefined; /** Tensor-based input in columnar format. */ @@ -286,7 +302,7 @@ export const unmarshalV1ResponseChoiceElementSchema: z.ZodType marshalChatMessageSchema)).optional(), + messages: z.array(z.lazy(() => marshalCreateChatMessageSchema)).optional(), temperature: z.number().optional(), stop: z.array(z.string()).optional(), maxTokens: z.number().optional(), @@ -321,7 +337,9 @@ export const marshalQueryEndpointRequestSchema: z.ZodType = z stream: z.boolean().optional(), extraParams: z.record(z.string(), z.string()).optional(), dataframeRecords: z.array(jsonValueSchema).optional(), - dataframeSplit: z.lazy(() => marshalDataframeSplitInputSchema).optional(), + dataframeSplit: z + .lazy(() => marshalCreateDataframeSplitInputSchema) + .optional(), instances: z.array(jsonValueSchema).optional(), inputs: jsonValueSchema.optional(), clientRequestId: z.string().optional(), diff --git a/packages/networking/src/v1/client.ts b/packages/networking/src/v1/client.ts index 557e5f87..ebf98b3a 100755 --- a/packages/networking/src/v1/client.ts +++ b/packages/networking/src/v1/client.ts @@ -92,22 +92,22 @@ import type { WorkspaceNetworkOption, } from './model'; import { - marshalAccountNetworkPolicySchema, marshalCreateAccountIpAccessListRequestSchema, + marshalCreateAccountNetworkPolicySchema, + marshalCreateCreateNetworkConnectivityConfigurationSchema, + marshalCreateCreatePrivateEndpointRuleSchema, + marshalCreateEndpointSchema, marshalCreateIpAccessListRequestSchema, - marshalCreateNetworkConnectivityConfigurationSchema, marshalCreateNetworkRequestSchema, marshalCreatePrivateAccessSettingsRequestSchema, - marshalCreatePrivateEndpointRuleSchema, + marshalCreatePrivateAccessSettingsSchema, marshalCreateVpcEndpointRequestSchema, - marshalEndpointSchema, - marshalPrivateAccessSettingsSchema, + marshalCreateWorkspaceNetworkOptionSchema, marshalReplaceAccountIpAccessListRequestSchema, marshalReplaceIpAccessListRequestSchema, marshalUpdateAccountIpAccessListRequestSchema, marshalUpdateIpAccessListRequestSchema, - marshalUpdatePrivateEndpointRuleSchema, - marshalWorkspaceNetworkOptionSchema, + marshalUpdateUpdatePrivateEndpointRuleSchema, unmarshalAccountNetworkPolicySchema, unmarshalCreateAccountIpAccessListResponseSchema, unmarshalCreateIpAccessListResponseSchema, @@ -411,7 +411,7 @@ export class NetworkingClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/networking/v1/${req.parent ?? ''}/endpoints`; - const body = marshalRequest(req.endpoint, marshalEndpointSchema); + const body = marshalRequest(req.endpoint, marshalCreateEndpointSchema); let resp: Endpoint | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -784,7 +784,7 @@ export class NetworkingClient { const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-connectivity-configs`; const body = marshalRequest( req.networkConnectivityConfig, - marshalCreateNetworkConnectivityConfigurationSchema + marshalCreateCreateNetworkConnectivityConfigurationSchema ); let resp: NetworkConnectivityConfig | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -923,7 +923,7 @@ export class NetworkingClient { const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-connectivity-configs/${req.networkConnectivityConfigId ?? ''}/private-endpoint-rules`; const body = marshalRequest( req.privateEndpointRule, - marshalCreatePrivateEndpointRuleSchema + marshalCreateCreatePrivateEndpointRuleSchema ); let resp: NccPrivateEndpointRule | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -1069,7 +1069,7 @@ export class NetworkingClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.privateEndpointRule, - marshalUpdatePrivateEndpointRuleSchema + marshalUpdateUpdatePrivateEndpointRuleSchema ); let resp: NccPrivateEndpointRule | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -1108,7 +1108,7 @@ export class NetworkingClient { const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-policies`; const body = marshalRequest( req.networkPolicy, - marshalAccountNetworkPolicySchema + marshalCreateAccountNetworkPolicySchema ); let resp: AccountNetworkPolicy | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -1236,7 +1236,7 @@ export class NetworkingClient { const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/network-policies/${req.networkPolicyId ?? ''}`; const body = marshalRequest( req.networkPolicy, - marshalAccountNetworkPolicySchema + marshalCreateAccountNetworkPolicySchema ); let resp: AccountNetworkPolicy | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -1630,7 +1630,7 @@ export class NetworkingClient { const url = `${host}/api/2.0/accounts/${req.customerFacingPrivateAccessSettings?.accountId ?? accountId ?? ''}/private-access-settings/${req.customerFacingPrivateAccessSettings?.privateAccessSettingsId ?? ''}`; const body = marshalRequest( req.customerFacingPrivateAccessSettings, - marshalPrivateAccessSettingsSchema + marshalCreatePrivateAccessSettingsSchema ); let resp: PrivateAccessSettings | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -1692,7 +1692,7 @@ export class NetworkingClient { const url = `${host}/api/2.0/accounts/${req.accountId ?? accountId ?? ''}/workspaces/${String(req.workspaceId ?? '')}/network`; const body = marshalRequest( req.workspaceNetworkOption, - marshalWorkspaceNetworkOptionSchema + marshalCreateWorkspaceNetworkOptionSchema ); let resp: WorkspaceNetworkOption | undefined; const call = async (callSignal?: AbortSignal): Promise => { diff --git a/packages/networking/src/v1/index.ts b/packages/networking/src/v1/index.ts index 4cfc8bb0..4bc2e17d 100755 --- a/packages/networking/src/v1/index.ts +++ b/packages/networking/src/v1/index.ts @@ -38,18 +38,35 @@ export type { AzurePrivateEndpointInfo, CreateAccountIpAccessListRequest, CreateAccountIpAccessListResponse, + CreateAccountNetworkPolicy, + CreateAzurePrivateEndpointInfo, + CreateCreateNetworkConnectivityConfiguration, + CreateCreatePrivateEndpointRule, + CreateCustomerFacingNetworkConnectivityConfigEgressConfig, + CreateEgressNetworkPolicy, + CreateEndpoint, CreateEndpointRequest, + CreateGcpEndpoint, + CreateGcpNetworkInfo, + CreateGcpVpcEndpointInfo, + CreateIngressNetworkPolicy, CreateIpAccessListRequest, CreateIpAccessListResponse, CreateNccPrivateEndpointRuleRequest, + CreateNetworkConnectivityConfigAwsPrivateEndpointRule, + CreateNetworkConnectivityConfigAzurePrivateEndpointRule, CreateNetworkConnectivityConfigRequest, CreateNetworkConnectivityConfiguration, CreateNetworkPolicyRequest, CreateNetworkRequest, + CreateNetworkVpcEndpoints, + CreatePrivateAccessSettings, CreatePrivateAccessSettingsRequest, CreatePrivateEndpointRule, CreateVpcEndpointRequest, + CreateWorkspaceNetworkOption, CustomerFacingNetworkConnectivityConfigEgressConfig, + CustomerFacingNetworkConnectivityConfigEgressConfig_CreateCustomerFacingTargetRule, CustomerFacingNetworkConnectivityConfigEgressConfig_CustomerFacingTargetRule, DeleteAccountIpAccessListRequest, DeleteAccountIpAccessListResponse, @@ -63,7 +80,12 @@ export type { DeletePrivateAccessSettingsRequest, DeleteVpcEndpointRequest, EgressNetworkPolicy, + EgressNetworkPolicy_CreateNetworkAccessPolicy, EgressNetworkPolicy_NetworkAccessPolicy, + EgressNetworkPolicy_NetworkAccessPolicy_CreateDatabricksDestination, + EgressNetworkPolicy_NetworkAccessPolicy_CreateInternetDestination, + EgressNetworkPolicy_NetworkAccessPolicy_CreatePolicyEnforcement, + EgressNetworkPolicy_NetworkAccessPolicy_CreateStorageDestination, EgressNetworkPolicy_NetworkAccessPolicy_DatabricksDestination, EgressNetworkPolicy_NetworkAccessPolicy_InternetDestination, EgressNetworkPolicy_NetworkAccessPolicy_PolicyEnforcement, @@ -92,6 +114,28 @@ export type { IngressNetworkPolicy_AppsRuntimeDestination, IngressNetworkPolicy_Authentication, IngressNetworkPolicy_AuthenticationIdentity, + IngressNetworkPolicy_CreateAccountApiDestination, + IngressNetworkPolicy_CreateAccountDatabricksOneDestination, + IngressNetworkPolicy_CreateAccountUiDestination, + IngressNetworkPolicy_CreateAppsRuntimeDestination, + IngressNetworkPolicy_CreateAuthentication, + IngressNetworkPolicy_CreateAuthenticationIdentity, + IngressNetworkPolicy_CreateCrossWorkspaceAccess, + IngressNetworkPolicy_CreateCrossWorkspaceIngressRule, + IngressNetworkPolicy_CreateCrossWorkspaceRequestOrigin, + IngressNetworkPolicy_CreateEndpoints, + IngressNetworkPolicy_CreateIpRanges, + IngressNetworkPolicy_CreateLakebaseRuntimeDestination, + IngressNetworkPolicy_CreatePrivateAccess, + IngressNetworkPolicy_CreatePrivateIngressRule, + IngressNetworkPolicy_CreatePrivateRequestOrigin, + IngressNetworkPolicy_CreatePublicAccess, + IngressNetworkPolicy_CreatePublicIngressRule, + IngressNetworkPolicy_CreatePublicRequestOrigin, + IngressNetworkPolicy_CreateRequestDestination, + IngressNetworkPolicy_CreateWorkspaceApiDestination, + IngressNetworkPolicy_CreateWorkspaceIdList, + IngressNetworkPolicy_CreateWorkspaceUiDestination, IngressNetworkPolicy_CrossWorkspaceAccess, IngressNetworkPolicy_CrossWorkspaceIngressRule, IngressNetworkPolicy_CrossWorkspaceRequestOrigin, @@ -133,9 +177,12 @@ export type { NetworkConnectivityConfigAwsPrivateEndpointRule, NetworkConnectivityConfigAzurePrivateEndpointRule, NetworkConnectivityConfigEgressConfig, + NetworkConnectivityConfigEgressConfig_CreateDefaultRule, NetworkConnectivityConfigEgressConfig_DefaultRule, NetworkConnectivityConfigEgressConfig_DefaultRule_AwsStableIpRule, NetworkConnectivityConfigEgressConfig_DefaultRule_AzureServiceEndpointRule, + NetworkConnectivityConfigEgressConfig_DefaultRule_CreateAwsStableIpRule, + NetworkConnectivityConfigEgressConfig_DefaultRule_CreateAzureServiceEndpointRule, NetworkHealth, NetworkVpcEndpoints, NetworkWarning, @@ -146,15 +193,17 @@ export type { ReplaceIpAccessListResponse, UpdateAccountIpAccessListRequest, UpdateAccountIpAccessListResponse, + UpdateGcpEndpoint, UpdateIpAccessListRequest, UpdateIpAccessListResponse, UpdateNccPrivateEndpointRuleRequest, UpdateNetworkPolicyRequest, UpdatePrivateAccessSettingsRequest, UpdatePrivateEndpointRule, + UpdateUpdatePrivateEndpointRule, UpdateWorkspaceNetworkOptionRequest, VpcEndpoint, WorkspaceNetworkOption, } from './model'; -export {updatePrivateEndpointRuleFieldMask} from './model'; +export {updateUpdatePrivateEndpointRuleFieldMask} from './model'; diff --git a/packages/networking/src/v1/model.ts b/packages/networking/src/v1/model.ts index a4c34643..0838f27d 100755 --- a/packages/networking/src/v1/model.ts +++ b/packages/networking/src/v1/model.ts @@ -420,48 +420,35 @@ export interface CreateAccountIpAccessListResponse { ipAccessList?: AccountIpAccessList | undefined; } -export interface CreateEndpointRequest { +export interface CreateAccountNetworkPolicy { + /** The unique identifier for the network policy. */ + networkPolicyId?: string | undefined; + /** The associated account ID for this Network Policy object. */ + accountId?: string | undefined; + /** The network policies applying for egress traffic. */ + egress?: CreateEgressNetworkPolicy | undefined; + /** The network policies applying for ingress traffic. */ + ingress?: CreateIngressNetworkPolicy | undefined; /** - * The parent resource name of the account under which the endpoint is created. - * Format: `accounts/{account_id}`. + * The ingress policy for dry run mode. Dry run will always run even if the request + * is allowed by the ingress policy. When this field is set, the policy will be evaluated + * and emit logs only without blocking requests. */ - parent?: string | undefined; - endpoint?: Endpoint | undefined; -} - -/** Details required to configure a block list or allow list. */ -export interface CreateIpAccessListRequest { - /** Label for the IP access list. This **cannot** be empty. */ - label?: string | undefined; - listType?: IpAccessListType | undefined; - ipAddresses?: string[] | undefined; -} - -/** An IP access list was successfully created. */ -export interface CreateIpAccessListResponse { - ipAccessList?: IpAccessList | undefined; -} - -/** Properties of the new private endpoint rule. */ -export interface CreateNccPrivateEndpointRuleRequest { - /** Your Network Connectivity Configuration ID. */ - networkConnectivityConfigId?: string | undefined; - /** Your account ID. You can find your account ID in your accounts console. */ - accountId?: string | undefined; - privateEndpointRule?: CreatePrivateEndpointRule | undefined; + ingressDryRun?: CreateIngressNetworkPolicy | undefined; } -/** Properties of the new network connectivity configuration. */ -export interface CreateNetworkConnectivityConfigRequest { - /** Your account ID. You can find your account ID in your accounts console. */ - accountId?: string | undefined; - networkConnectivityConfig?: - | CreateNetworkConnectivityConfiguration - | undefined; +export interface CreateAzurePrivateEndpointInfo { + /** The name of the Private Endpoint in the Azure subscription. */ + privateEndpointName: string; + /** + * The GUID of the Private Endpoint resource in the Azure subscription. + * This is assigned by Azure when the user sets up the Private Endpoint. + */ + privateEndpointResourceGuid: string; } /** Properties of the new network connectivity configuration. */ -export interface CreateNetworkConnectivityConfiguration { +export interface CreateCreateNetworkConnectivityConfiguration { /** network connectivity configuration ID. */ networkConnectivityConfigId?: string | undefined; /** Your account ID. You can find your account ID in your accounts console. */ @@ -479,7 +466,7 @@ export interface CreateNetworkConnectivityConfiguration { region?: string | undefined; /** The network connectivity rules that apply to network traffic from your serverless compute resources. */ egressConfig?: - | CustomerFacingNetworkConnectivityConfigEgressConfig + | CreateCustomerFacingNetworkConnectivityConfigEgressConfig | undefined; /** Time in epoch milliseconds when this object was updated. */ updatedTime?: bigint | undefined; @@ -487,54 +474,11 @@ export interface CreateNetworkConnectivityConfiguration { creationTime?: bigint | undefined; } -export interface CreateNetworkPolicyRequest { - /** Your account ID. You can find your account ID in your accounts console. */ - accountId?: string | undefined; - /** Network policy configuration details. */ - networkPolicy?: AccountNetworkPolicy | undefined; -} - -export interface CreateNetworkRequest { - accountId?: string | undefined; - /** The human-readable name of the network configuration. */ - networkName?: string | undefined; - /** The ID of the VPC associated with this network configuration. VPC IDs can be used in multiple networks. */ - vpcId?: string | undefined; - /** IDs of at least two subnets associated with this network. Subnet IDs **cannot** be used in multiple network configurations. */ - subnetIds?: string[] | undefined; - /** IDs of one to five security groups associated with this network. Security group IDs **cannot** be used in multiple network configurations. */ - securityGroupIds?: string[] | undefined; - vpcEndpoints?: NetworkVpcEndpoints | undefined; - gcpNetworkInfo?: GcpNetworkInfo | undefined; -} - -export interface CreatePrivateAccessSettingsRequest { - accountId?: string | undefined; - /** The human-readable name of the private access settings object. */ - privateAccessSettingsName?: string | undefined; - /** The AWS region for workspaces attached to this private access settings object. */ - region?: string | undefined; - /** Determines if the workspace can be accessed over public internet. For fully private workspaces, you can optionally specify false, but only if you implement both the front-end and the back-end PrivateLink connections. Otherwise, specify true, which means that public access is enabled. */ - publicAccessEnabled?: boolean | undefined; - /** - * The private access level controls which VPC endpoints can connect to the UI or API of any workspace that attaches this private access settings object. - * `ACCOUNT` level access (the default) allows only VPC endpoints that are registered in your account connect to your workspace. - * `ENDPOINT` level access allows only specified VPC endpoints connect to your workspace. For details, see allowed_vpc_endpoint_ids. - */ - privateAccessLevel?: PrivateAccessLevel | undefined; - /** - * An array of Databricks VPC endpoint IDs. This is the ID returned when registering the VPC endpoint configuration in your account. This is not the ID of the VPC endpoint in AWS. - * Only used when private_access_level is set to ENDPOINT. This is an allow list of VPC endpoints registered in your account that can connect to your workspace over AWS PrivateLink. - * Note: If hybrid access to your workspace is enabled by setting public_access_enabled to true, this control only works for PrivateLink connections. To control how your workspace is accessed via public internet, see IP access lists. - */ - allowedVpcEndpointIds?: string[] | undefined; -} - /** * Properties of the new private endpoint rule. * Note that you must approve the endpoint in Azure portal after initialization. */ -export interface CreatePrivateEndpointRule { +export interface CreateCreatePrivateEndpointRule { /** The ID of a private endpoint rule. */ ruleId?: string | undefined; /** The ID of a network connectivity configuration, which is the parent resource of this private endpoint rule object. */ @@ -602,117 +546,582 @@ export interface CreatePrivateEndpointRule { * serverless compute resources. Only honored for first-party services on each cloud (e.g. AWS S3). */ enabled?: boolean | undefined; - endpoint?: {$case: 'gcpEndpoint'; gcpEndpoint: GcpEndpoint} | undefined; -} - -export interface CreateVpcEndpointRequest { - accountId?: string | undefined; - /** The human-readable name of the storage configuration. */ - vpcEndpointName?: string | undefined; - /** The region in which this VPC endpoint object exists. */ - region?: string | undefined; - /** The ID of the VPC endpoint object in AWS. */ - awsVpcEndpointId?: string | undefined; - vpcEndpointInfo?: - | { - $case: 'gcpVpcEndpointInfo'; - /** The cloud info of this vpc endpoint. */ - gcpVpcEndpointInfo: GcpVpcEndpointInfo; - } - | undefined; + endpoint?: {$case: 'gcpEndpoint'; gcpEndpoint: CreateGcpEndpoint} | undefined; } -export interface CustomerFacingNetworkConnectivityConfigEgressConfig { +export interface CreateCustomerFacingNetworkConnectivityConfigEgressConfig { /** * The network connectivity rules that are applied by default without resource specific configurations. * You can find the stable network information of your serverless compute resources here. */ - defaultRules?: NetworkConnectivityConfigEgressConfig_DefaultRule | undefined; + defaultRules?: + | NetworkConnectivityConfigEgressConfig_CreateDefaultRule + | undefined; /** The network connectivity rules that configured for each destinations. These rules override default rules. */ targetRules?: - | CustomerFacingNetworkConnectivityConfigEgressConfig_CustomerFacingTargetRule + | CustomerFacingNetworkConnectivityConfigEgressConfig_CreateCustomerFacingTargetRule | undefined; } -/** Target rule controls the egress rules that are dedicated to specific resources. */ -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export interface CustomerFacingNetworkConnectivityConfigEgressConfig_CustomerFacingTargetRule { - azurePrivateEndpointRules?: - | NetworkConnectivityConfigAzurePrivateEndpointRule[] - | undefined; - /** AWS private endpoint rule controls the AWS private endpoint based egress rules. */ - awsPrivateEndpointRules?: - | NetworkConnectivityConfigAwsPrivateEndpointRule[] - | undefined; +/** The network policies applying for egress traffic. */ +export interface CreateEgressNetworkPolicy { + /** The access policy enforced for egress traffic to the internet. */ + networkAccess?: EgressNetworkPolicy_CreateNetworkAccessPolicy | undefined; } -export interface DeleteAccountIpAccessListRequest { - accountId?: string | undefined; - /** The ID for the corresponding IP access list */ - listId?: string | undefined; +/** Endpoint represents a cloud networking resource in a user's cloud account and binds it to the account. */ +export interface CreateEndpoint { + /** + * The human-readable display name of this endpoint. + * The input should conform to RFC-1034, which restricts to letters, numbers, and hyphens, + * with the first character a letter, the last a letter or a number, and a 63 character maximum. + */ + displayName: string; + /** The cloud provider region where this endpoint is located. */ + region: string; + /** + * The cloud info of this endpoint. + * (-- For now it only supports Azure PL, but in future we can support other clouds and more use cases (e.g. public endpoint) --) + */ + endpointInfo?: + | { + $case: 'azurePrivateEndpointInfo'; + /** Info for an Azure private endpoint. */ + azurePrivateEndpointInfo: CreateAzurePrivateEndpointInfo; + } + | undefined; } -/** The IP access list was successfully deleted. */ -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface DeleteAccountIpAccessListResponse {} +export interface CreateEndpointRequest { + /** + * The parent resource name of the account under which the endpoint is created. + * Format: `accounts/{account_id}`. + */ + parent?: string | undefined; + endpoint?: CreateEndpoint | undefined; +} -export interface DeleteEndpointRequest { - name?: string | undefined; +export interface CreateGcpEndpoint { + /** Selects which target services this private endpoint reaches. */ + targetServices?: + | { + $case: 'serviceAttachment'; + /** + * The full url of the target service attachment. + * Example: + * projects/my-gcp-project/regions/us-east4/serviceAttachments/my-service-attachment + */ + serviceAttachment: string; + } + | undefined; } -export interface DeleteIpAccessListRequest { - /** The ID for the corresponding IP access list */ - listId?: string | undefined; +export interface CreateGcpNetworkInfo { + /** The GCP project ID for network resources. This project is where the VPC and subnet resides. */ + networkProjectId: string; + /** The customer-provided VPC ID. */ + vpcId: string; + /** + * The customer-provided Subnet ID that will be available to Clusters in Workspaces using this + * Network. + */ + subnetId: string; + subnetRegion: string; + /** + * Name of the secondary range within the subnet that will be used by GKE as Pod IP range. + * This is BYO VPC specific. DB VPC uses network.getGcpManagedNetworkConfig.getGkeClusterPodIpRange + */ + podIpRangeName: string; + /** Name of the secondary range within the subnet that will be used by GKE as Service IP range. */ + serviceIpRangeName: string; } -/** The IP access list was successfully deleted. */ -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface DeleteIpAccessListResponse {} +export interface CreateGcpVpcEndpointInfo { + pscConnectionId?: string | undefined; + projectId: string; + pscEndpointName: string; + endpointRegion: string; + serviceAttachmentId?: string | undefined; +} /** - * Initiates deleting a private endpoint rule. If the connection state is PENDING or EXPIRED, the private endpoint is - * immediately deleted. Otherwise, the private endpoint is deactivated and will be deleted after one day of - * deactivation. When a private endpoint is deactivated, the deactivated field is set to true and the private endpoint - * is not available to your serverless compute resources. + * This proto is under development. + * The network policies applying for ingress traffic. + * Any changes here should also be synced to estore/namespaces/lakehousenetworkmanager/latest.proto. */ -export interface DeleteNccPrivateEndpointRuleRequest { - /** Your account ID. You can find your account ID in your accounts console. */ - accountId?: string | undefined; - /** Your Network Connectvity Configuration ID. */ - networkConnectivityConfigId?: string | undefined; - /** Your private endpoint rule ID. */ - privateEndpointRuleId?: string | undefined; -} - -export interface DeleteNetworkConnectivityConfigRequest { - /** Your account ID. You can find your account ID in your accounts console. */ - accountId?: string | undefined; - /** Your Network Connectivity Configuration ID. */ - networkConnectivityConfigId?: string | undefined; +export interface CreateIngressNetworkPolicy { + /** + * The network policy restrictions for public access to the workspace. + * Configures how public internet traffic is allowed or denied access. + */ + publicAccess?: IngressNetworkPolicy_CreatePublicAccess | undefined; + /** + * The network policy restrictions for private access to the workspace. + * Configures how registered private endpoints are allowed or denied access. + */ + privateAccess?: IngressNetworkPolicy_CreatePrivateAccess | undefined; + crossWorkspaceAccess?: + | IngressNetworkPolicy_CreateCrossWorkspaceAccess + | undefined; } -export interface DeleteNetworkPolicyRequest { - /** The unique identifier of the network policy to delete. */ - networkPolicyId?: string | undefined; - /** Your account ID. You can find your account ID in your accounts console. */ - accountId?: string | undefined; +/** Details required to configure a block list or allow list. */ +export interface CreateIpAccessListRequest { + /** Label for the IP access list. This **cannot** be empty. */ + label?: string | undefined; + listType?: IpAccessListType | undefined; + ipAddresses?: string[] | undefined; } -export interface DeleteNetworkRequest { - /** Databricks Account API network configuration ID. */ - networkId?: string | undefined; - accountId?: string | undefined; +/** An IP access list was successfully created. */ +export interface CreateIpAccessListResponse { + ipAccessList?: IpAccessList | undefined; } -export interface DeletePrivateAccessSettingsRequest { - privateAccessSettingsId?: string | undefined; +/** Properties of the new private endpoint rule. */ +export interface CreateNccPrivateEndpointRuleRequest { + /** Your Network Connectivity Configuration ID. */ + networkConnectivityConfigId?: string | undefined; + /** Your account ID. You can find your account ID in your accounts console. */ accountId?: string | undefined; + privateEndpointRule?: CreateCreatePrivateEndpointRule | undefined; } -export interface DeleteVpcEndpointRequest { - vpcEndpointId?: string | undefined; +/** + * Properties of the new private endpoint rule. + * Note that for private endpoints towards a VPC endpoint service behind a customer-managed NLB, + * you must approve the endpoint in AWS console after initialization. + */ +export interface CreateNetworkConnectivityConfigAwsPrivateEndpointRule { + /** The ID of a private endpoint rule. */ + ruleId?: string | undefined; + /** The ID of a network connectivity configuration, which is the parent resource of this private endpoint rule object. */ + networkConnectivityConfigId?: string | undefined; + /** account ID. You can find your account ID from the Accounts Console. */ accountId?: string | undefined; -} + /** The full target AWS endpoint service name that connects to the destination resources of the private endpoint. */ + endpointService?: string | undefined; + /** + * Only used by private endpoints towards a VPC endpoint service for customer-managed VPC endpoint service. + * + * The target AWS resource FQDNs accessible via the VPC endpoint service. + * When updating this field, we perform full update on this field. Please ensure a full list of desired domain_names is provided. + */ + domainNames?: string[] | undefined; + /** + * Only used by private endpoints towards AWS S3 service. + * + * The globally unique S3 bucket names that will be accessed via the VPC endpoint. + * The bucket names must be in the same region as the NCC/endpoint service. + * When updating this field, we perform full update on this field. + * Please ensure a full list of desired resource_names is provided. + */ + resourceNames?: string[] | undefined; + /** The AWS VPC endpoint ID. You can use this ID to identify VPC endpoint created by . */ + vpcEndpointId?: string | undefined; + /** + * The current status of this private endpoint. The private endpoint rules are effective only if the connection state + * is ESTABLISHED. Remember that you must approve new endpoints on your resources in the AWS console + * before they take effect. + * The possible values are: + * - PENDING: The endpoint has been created and pending approval. + * - ESTABLISHED: The endpoint has been approved and is ready to use in your serverless compute resources. + * - REJECTED: Connection was rejected by the private link resource owner. + * - DISCONNECTED: Connection was removed by the private link resource owner, the private endpoint becomes informative and should be deleted for clean-up. + * - EXPIRED: If the endpoint is created but not approved in 14 days, it is EXPIRED. + */ + connectionState?: + | NetworkConnectivityConfigAwsPrivateEndpointRule_PrivateLinkConnectionState + | undefined; + /** Time in epoch milliseconds when this object was created. */ + creationTime?: bigint | undefined; + /** Time in epoch milliseconds when this object was updated. */ + updatedTime?: bigint | undefined; + /** Whether this private endpoint is deactivated. */ + deactivated?: boolean | undefined; + /** Time in epoch milliseconds when this object was deactivated. */ + deactivatedAt?: bigint | undefined; + /** + * Only used by private endpoints towards an AWS S3 service. + * + * Update this field to activate/deactivate this private endpoint to allow egress access from serverless compute resources. + */ + enabled?: boolean | undefined; + errorMessage?: string | undefined; +} + +/** + * Properties of the new private endpoint rule. + * Note that you must approve the endpoint in Azure portal after initialization. + */ +export interface CreateNetworkConnectivityConfigAzurePrivateEndpointRule { + /** The ID of a private endpoint rule. */ + ruleId?: string | undefined; + /** The ID of a network connectivity configuration, which is the parent resource of this private endpoint rule object. */ + networkConnectivityConfigId?: string | undefined; + /** The Azure resource ID of the target resource. */ + resourceId?: string | undefined; + /** + * Only used by private endpoints to Azure first-party services. + * + * The sub-resource type (group ID) of the target resource. + * Note that to connect to workspace root storage (root DBFS), you need two endpoints, one for blob and one for dfs. + */ + groupId?: string | undefined; + /** The name of the Azure private endpoint resource. */ + endpointName?: string | undefined; + /** + * The current status of this private endpoint. The private endpoint rules are effective only if the connection state + * is ESTABLISHED. Remember that you must approve new endpoints on your resources in the Azure portal + * before they take effect. + * The possible values are: + * - INIT: (deprecated) The endpoint has been created and pending approval. + * - PENDING: The endpoint has been created and pending approval. + * - ESTABLISHED: The endpoint has been approved and is ready to use in your serverless compute resources. + * - REJECTED: Connection was rejected by the private link resource owner. + * - DISCONNECTED: Connection was removed by the private link resource owner, the private endpoint becomes informative and should be deleted for clean-up. + * - EXPIRED: If the endpoint was created but not approved in 14 days, it will be EXPIRED. + */ + connectionState?: + | NetworkConnectivityConfigAzurePrivateEndpointRule_PrivateLinkConnectionState + | undefined; + /** Time in epoch milliseconds when this object was created. */ + creationTime?: bigint | undefined; + /** Time in epoch milliseconds when this object was updated. */ + updatedTime?: bigint | undefined; + /** Whether this private endpoint is deactivated. */ + deactivated?: boolean | undefined; + /** Time in epoch milliseconds when this object was deactivated. */ + deactivatedAt?: bigint | undefined; + /** + * Not used by customer-managed private endpoint services. + * + * Domain names of target private link service. + * When updating this field, the full list of target domain_names must be specified. + */ + domainNames?: string[] | undefined; + errorMessage?: string | undefined; +} + +/** Properties of the new network connectivity configuration. */ +export interface CreateNetworkConnectivityConfigRequest { + /** Your account ID. You can find your account ID in your accounts console. */ + accountId?: string | undefined; + networkConnectivityConfig?: + | CreateCreateNetworkConnectivityConfiguration + | undefined; +} + +/** Properties of the new network connectivity configuration. */ +export interface CreateNetworkConnectivityConfiguration { + /** network connectivity configuration ID. */ + networkConnectivityConfigId?: string | undefined; + /** Your account ID. You can find your account ID in your accounts console. */ + accountId?: string | undefined; + /** + * The name of the network connectivity configuration. The name can contain alphanumeric characters, hyphens, + * and underscores. The length must be between 3 and 30 characters. The name must match the regular + * expression ^[0-9a-zA-Z-_]{3,30}$ + */ + name?: string | undefined; + /** + * The region for the network connectivity configuration. + * Only workspaces in the same region can be attached to the network connectivity configuration. + */ + region?: string | undefined; + /** The network connectivity rules that apply to network traffic from your serverless compute resources. */ + egressConfig?: + | CustomerFacingNetworkConnectivityConfigEgressConfig + | undefined; + /** Time in epoch milliseconds when this object was updated. */ + updatedTime?: bigint | undefined; + /** Time in epoch milliseconds when this object was created. */ + creationTime?: bigint | undefined; +} + +export interface CreateNetworkPolicyRequest { + /** Your account ID. You can find your account ID in your accounts console. */ + accountId?: string | undefined; + /** Network policy configuration details. */ + networkPolicy?: CreateAccountNetworkPolicy | undefined; +} + +export interface CreateNetworkRequest { + accountId?: string | undefined; + /** The human-readable name of the network configuration. */ + networkName?: string | undefined; + /** The ID of the VPC associated with this network configuration. VPC IDs can be used in multiple networks. */ + vpcId?: string | undefined; + /** IDs of at least two subnets associated with this network. Subnet IDs **cannot** be used in multiple network configurations. */ + subnetIds?: string[] | undefined; + /** IDs of one to five security groups associated with this network. Security group IDs **cannot** be used in multiple network configurations. */ + securityGroupIds?: string[] | undefined; + vpcEndpoints?: CreateNetworkVpcEndpoints | undefined; + gcpNetworkInfo?: CreateGcpNetworkInfo | undefined; +} + +export interface CreateNetworkVpcEndpoints { + /** The VPC endpoint ID used by this network to access the Databricks REST API. */ + restApi?: string[] | undefined; + /** The VPC endpoint ID used by this network to access the secure cluster connectivity relay. */ + dataplaneRelay?: string[] | undefined; +} + +/** * */ +export interface CreatePrivateAccessSettings { + /** private access settings ID. */ + privateAccessSettingsId?: string | undefined; + /** The account ID that hosts the private access settings. */ + accountId?: string | undefined; + /** The human-readable name of the private access settings object. */ + privateAccessSettingsName?: string | undefined; + /** The AWS region for workspaces attached to this private access settings object. */ + region?: string | undefined; + /** Determines if the workspace can be accessed over public internet. For fully private workspaces, you can optionally specify false, but only if you implement both the front-end and the back-end PrivateLink connections. Otherwise, specify true, which means that public access is enabled. */ + publicAccessEnabled?: boolean | undefined; + /** + * The private access level controls which VPC endpoints can connect to the UI or API of any workspace that attaches this private access settings object. + * `ACCOUNT` level access (the default) allows only VPC endpoints that are registered in your account connect to your workspace. + * `ENDPOINT` level access allows only specified VPC endpoints connect to your workspace. For details, see allowed_vpc_endpoint_ids. + */ + privateAccessLevel?: PrivateAccessLevel | undefined; + /** + * An array of Databricks VPC endpoint IDs. This is the ID that is returned when registering the VPC endpoint configuration in your account. This is not the ID of the VPC endpoint in AWS. + * Only used when private_access_level is set to ENDPOINT. This is an allow list of VPC endpoints that in your account that can connect to your workspace over AWS PrivateLink. + * If hybrid access to your workspace is enabled by setting public_access_enabled to true, this control only works for PrivateLink connections. To control how your workspace is accessed via public internet, see IP access lists. + */ + allowedVpcEndpointIds?: string[] | undefined; +} + +export interface CreatePrivateAccessSettingsRequest { + accountId?: string | undefined; + /** The human-readable name of the private access settings object. */ + privateAccessSettingsName?: string | undefined; + /** The AWS region for workspaces attached to this private access settings object. */ + region?: string | undefined; + /** Determines if the workspace can be accessed over public internet. For fully private workspaces, you can optionally specify false, but only if you implement both the front-end and the back-end PrivateLink connections. Otherwise, specify true, which means that public access is enabled. */ + publicAccessEnabled?: boolean | undefined; + /** + * The private access level controls which VPC endpoints can connect to the UI or API of any workspace that attaches this private access settings object. + * `ACCOUNT` level access (the default) allows only VPC endpoints that are registered in your account connect to your workspace. + * `ENDPOINT` level access allows only specified VPC endpoints connect to your workspace. For details, see allowed_vpc_endpoint_ids. + */ + privateAccessLevel?: PrivateAccessLevel | undefined; + /** + * An array of Databricks VPC endpoint IDs. This is the ID returned when registering the VPC endpoint configuration in your account. This is not the ID of the VPC endpoint in AWS. + * Only used when private_access_level is set to ENDPOINT. This is an allow list of VPC endpoints registered in your account that can connect to your workspace over AWS PrivateLink. + * Note: If hybrid access to your workspace is enabled by setting public_access_enabled to true, this control only works for PrivateLink connections. To control how your workspace is accessed via public internet, see IP access lists. + */ + allowedVpcEndpointIds?: string[] | undefined; +} + +/** + * Properties of the new private endpoint rule. + * Note that you must approve the endpoint in Azure portal after initialization. + */ +export interface CreatePrivateEndpointRule { + /** The ID of a private endpoint rule. */ + ruleId?: string | undefined; + /** The ID of a network connectivity configuration, which is the parent resource of this private endpoint rule object. */ + networkConnectivityConfigId?: string | undefined; + /** + * The current status of this private endpoint. The private endpoint rules are effective only if the connection state + * is ESTABLISHED. Remember that you must approve new endpoints on your resources in the Cloud console + * before they take effect. + * The possible values are: + * - PENDING: The endpoint has been created and pending approval. + * - ESTABLISHED: The endpoint has been approved and is ready to use in your serverless compute resources. + * - REJECTED: Connection was rejected by the private link resource owner. + * - DISCONNECTED: Connection was removed by the private link resource owner, the private endpoint becomes informative and should be deleted for clean-up. + * - EXPIRED: If the endpoint was created but not approved in 14 days, it will be EXPIRED. + * - CREATING: The endpoint creation is in progress. Once successfully created, the state will transition to PENDING. + * - CREATE_FAILED: The endpoint creation failed. You can check the error_message field for more details. + */ + connectionState?: + | NccPrivateEndpointRule_PrivateLinkConnectionState + | undefined; + /** + * Only used by private endpoints to customer-managed private endpoint services. + * + * Domain names of target private link service. + * When updating this field, the full list of target domain_names must be specified. + */ + domainNames?: string[] | undefined; + /** Time in epoch milliseconds when this object was created. */ + creationTime?: bigint | undefined; + /** Time in epoch milliseconds when this object was updated. */ + updatedTime?: bigint | undefined; + /** Whether this private endpoint is deactivated. */ + deactivated?: boolean | undefined; + /** Time in epoch milliseconds when this object was deactivated. */ + deactivatedAt?: bigint | undefined; + errorMessage?: string | undefined; + /** The Azure resource ID of the target resource. */ + resourceId?: string | undefined; + /** + * Not used by customer-managed private endpoint services. + * + * The sub-resource type (group ID) of the target resource. + * Note that to connect to workspace root storage (root DBFS), you need two endpoints, one for blob and one for dfs. + */ + groupId?: string | undefined; + /** The name of the Azure private endpoint resource. */ + endpointName?: string | undefined; + /** account ID. You can find your account ID from the Accounts Console. */ + accountId?: string | undefined; + /** The full target AWS endpoint service name that connects to the destination resources of the private endpoint. */ + endpointService?: string | undefined; + /** + * Only used by private endpoints towards AWS S3 service. + * + * The globally unique S3 bucket names that will be accessed via the VPC endpoint. + * The bucket names must be in the same region as the NCC/endpoint service. + * When updating this field, we perform full update on this field. Please ensure a full list of desired + * resource_names is provided. + */ + resourceNames?: string[] | undefined; + /** The AWS VPC endpoint ID. You can use this ID to identify the VPC endpoint created by . */ + vpcEndpointId?: string | undefined; + /** + * Update this field to activate/deactivate this private endpoint to allow egress access from + * serverless compute resources. Only honored for first-party services on each cloud (e.g. AWS S3). + */ + enabled?: boolean | undefined; + endpoint?: {$case: 'gcpEndpoint'; gcpEndpoint: GcpEndpoint} | undefined; +} + +export interface CreateVpcEndpointRequest { + accountId?: string | undefined; + /** The human-readable name of the storage configuration. */ + vpcEndpointName?: string | undefined; + /** The region in which this VPC endpoint object exists. */ + region?: string | undefined; + /** The ID of the VPC endpoint object in AWS. */ + awsVpcEndpointId?: string | undefined; + vpcEndpointInfo?: + | { + $case: 'gcpVpcEndpointInfo'; + /** The cloud info of this vpc endpoint. */ + gcpVpcEndpointInfo: CreateGcpVpcEndpointInfo; + } + | undefined; +} + +export interface CreateWorkspaceNetworkOption { + /** + * The network policy ID to apply to the workspace. This controls the network access rules + * for all serverless compute resources in the workspace. Each workspace can only be + * linked to one policy at a time. If no policy is explicitly assigned, + * the workspace will use 'default-policy'. + */ + networkPolicyId?: string | undefined; + /** The workspace ID. */ + workspaceId?: bigint | undefined; +} + +export interface CustomerFacingNetworkConnectivityConfigEgressConfig { + /** + * The network connectivity rules that are applied by default without resource specific configurations. + * You can find the stable network information of your serverless compute resources here. + */ + defaultRules?: NetworkConnectivityConfigEgressConfig_DefaultRule | undefined; + /** The network connectivity rules that configured for each destinations. These rules override default rules. */ + targetRules?: + | CustomerFacingNetworkConnectivityConfigEgressConfig_CustomerFacingTargetRule + | undefined; +} + +/** Target rule controls the egress rules that are dedicated to specific resources. */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface CustomerFacingNetworkConnectivityConfigEgressConfig_CreateCustomerFacingTargetRule { + azurePrivateEndpointRules?: + | CreateNetworkConnectivityConfigAzurePrivateEndpointRule[] + | undefined; + /** AWS private endpoint rule controls the AWS private endpoint based egress rules. */ + awsPrivateEndpointRules?: + | CreateNetworkConnectivityConfigAwsPrivateEndpointRule[] + | undefined; +} + +/** Target rule controls the egress rules that are dedicated to specific resources. */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface CustomerFacingNetworkConnectivityConfigEgressConfig_CustomerFacingTargetRule { + azurePrivateEndpointRules?: + | NetworkConnectivityConfigAzurePrivateEndpointRule[] + | undefined; + /** AWS private endpoint rule controls the AWS private endpoint based egress rules. */ + awsPrivateEndpointRules?: + | NetworkConnectivityConfigAwsPrivateEndpointRule[] + | undefined; +} + +export interface DeleteAccountIpAccessListRequest { + accountId?: string | undefined; + /** The ID for the corresponding IP access list */ + listId?: string | undefined; +} + +/** The IP access list was successfully deleted. */ +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface DeleteAccountIpAccessListResponse {} + +export interface DeleteEndpointRequest { + name?: string | undefined; +} + +export interface DeleteIpAccessListRequest { + /** The ID for the corresponding IP access list */ + listId?: string | undefined; +} + +/** The IP access list was successfully deleted. */ +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface DeleteIpAccessListResponse {} + +/** + * Initiates deleting a private endpoint rule. If the connection state is PENDING or EXPIRED, the private endpoint is + * immediately deleted. Otherwise, the private endpoint is deactivated and will be deleted after one day of + * deactivation. When a private endpoint is deactivated, the deactivated field is set to true and the private endpoint + * is not available to your serverless compute resources. + */ +export interface DeleteNccPrivateEndpointRuleRequest { + /** Your account ID. You can find your account ID in your accounts console. */ + accountId?: string | undefined; + /** Your Network Connectvity Configuration ID. */ + networkConnectivityConfigId?: string | undefined; + /** Your private endpoint rule ID. */ + privateEndpointRuleId?: string | undefined; +} + +export interface DeleteNetworkConnectivityConfigRequest { + /** Your account ID. You can find your account ID in your accounts console. */ + accountId?: string | undefined; + /** Your Network Connectivity Configuration ID. */ + networkConnectivityConfigId?: string | undefined; +} + +export interface DeleteNetworkPolicyRequest { + /** The unique identifier of the network policy to delete. */ + networkPolicyId?: string | undefined; + /** Your account ID. You can find your account ID in your accounts console. */ + accountId?: string | undefined; +} + +export interface DeleteNetworkRequest { + /** Databricks Account API network configuration ID. */ + networkId?: string | undefined; + accountId?: string | undefined; +} + +export interface DeletePrivateAccessSettingsRequest { + privateAccessSettingsId?: string | undefined; + accountId?: string | undefined; +} + +export interface DeleteVpcEndpointRequest { + vpcEndpointId?: string | undefined; + accountId?: string | undefined; +} /** The network policies applying for egress traffic. */ export interface EgressNetworkPolicy { @@ -720,6 +1129,41 @@ export interface EgressNetworkPolicy { networkAccess?: EgressNetworkPolicy_NetworkAccessPolicy | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface EgressNetworkPolicy_CreateNetworkAccessPolicy { + /** The restriction mode that controls how serverless workloads can access the internet. */ + restrictionMode?: + | EgressNetworkPolicy_NetworkAccessPolicy_RestrictionMode + | undefined; + /** List of internet destinations that serverless workloads are allowed to access when in RESTRICTED_ACCESS mode. */ + allowedInternetDestinations?: + | EgressNetworkPolicy_NetworkAccessPolicy_CreateInternetDestination[] + | undefined; + /** List of storage destinations that serverless workloads are allowed to access when in RESTRICTED_ACCESS mode. */ + allowedStorageDestinations?: + | EgressNetworkPolicy_NetworkAccessPolicy_CreateStorageDestination[] + | undefined; + /** Optional. When policy_enforcement is not provided, we default to ENFORCE_MODE_ALL_SERVICES */ + policyEnforcement?: + | EgressNetworkPolicy_NetworkAccessPolicy_CreatePolicyEnforcement + | undefined; + /** + * List of internet destinations that serverless workloads are blocked from accessing. + * These destinations are enforced when restriction mode is RESTRICTED_ACCESS or DRY_RUN. + * Currently supports DNS_NAME type only; IP_RANGE support is planned. + */ + blockedInternetDestinations?: + | EgressNetworkPolicy_NetworkAccessPolicy_CreateInternetDestination[] + | undefined; + /** + * List of workspace destinations that serverless workloads are + * allowed to access when in RESTRICTED_ACCESS mode. + */ + allowedDatabricksDestinations?: + | EgressNetworkPolicy_NetworkAccessPolicy_CreateDatabricksDestination[] + | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface EgressNetworkPolicy_NetworkAccessPolicy { /** The restriction mode that controls how serverless workloads can access the internet. */ @@ -755,6 +1199,61 @@ export interface EgressNetworkPolicy_NetworkAccessPolicy { | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface EgressNetworkPolicy_NetworkAccessPolicy_CreateDatabricksDestination { + /** The workspace IDs to allow egress traffic to. */ + workspaceIds?: bigint[] | undefined; +} + +/** + * Users can specify accessible internet destinations when outbound access is restricted. + * We only support DNS_NAME (FQDN format) destinations for the time being. + * Going forward we may extend support to host names and IP addresses. + */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface EgressNetworkPolicy_NetworkAccessPolicy_CreateInternetDestination { + /** The internet destination to which access will be allowed. Format dependent on the destination type. */ + destination?: string | undefined; + /** The type of internet destination. Currently only DNS_NAME is supported. */ + internetDestinationType?: + | EgressNetworkPolicy_NetworkAccessPolicy_InternetDestination_InternetDestinationType + | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface EgressNetworkPolicy_NetworkAccessPolicy_CreatePolicyEnforcement { + /** + * The mode of policy enforcement. ENFORCED blocks traffic that violates policy, + * while DRY_RUN only logs violations without blocking. When not specified, + * defaults to ENFORCED. + */ + enforcementMode?: + | EgressNetworkPolicy_NetworkAccessPolicy_PolicyEnforcement_EnforcementMode + | undefined; + /** + * When empty, it means dry run for all products. + * When non-empty, it means dry run for specific products and for the other products, they will run in enforced mode. + */ + dryRunModeProductFilter?: + | EgressNetworkPolicy_NetworkAccessPolicy_PolicyEnforcement_DryRunModeProductFilter[] + | undefined; +} + +/** Users can specify accessible storage destinations. */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface EgressNetworkPolicy_NetworkAccessPolicy_CreateStorageDestination { + bucketName?: string | undefined; + region?: string | undefined; + /** The type of storage destination. */ + storageDestinationType?: + | EgressNetworkPolicy_NetworkAccessPolicy_StorageDestination_StorageDestinationType + | undefined; + /** The Azure storage account name. */ + azureStorageAccount?: string | undefined; + /** The Azure storage service type (blob, dfs, etc.). */ + azureStorageService?: string | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface EgressNetworkPolicy_NetworkAccessPolicy_DatabricksDestination { /** The workspace IDs to allow egress traffic to. */ @@ -1028,6 +1527,216 @@ export interface IngressNetworkPolicy_AuthenticationIdentity { principalId?: bigint | undefined; } +/** Matches account-level Databricks API endpoints for an ingress network policy rule. */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreateAccountApiDestination { + scopes?: string[] | undefined; + /** Qualifies the breadth of API access for the listed scopes. See ApiScopeQualifier. */ + scopeQualifier?: IngressNetworkPolicy_ApiScopeQualifier | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreateAccountDatabricksOneDestination { + /** Must be set to true. */ + allDestinations?: boolean | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreateAccountUiDestination { + /** Must be set to true. */ + allDestinations?: boolean | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreateAppsRuntimeDestination { + /** Must be set to true. */ + allDestinations?: boolean | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreateAuthentication { + identityType?: IngressNetworkPolicy_Authentication_IdentityType | undefined; + /** Valid only when IdentityType is IDENTITY_TYPE_SELECTED_IDENTITIES. */ + identities?: IngressNetworkPolicy_CreateAuthenticationIdentity[] | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreateAuthenticationIdentity { + principalType?: + | IngressNetworkPolicy_AuthenticationIdentity_PrincipalType + | undefined; + principalId?: bigint | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreateCrossWorkspaceAccess { + restrictionMode?: + | IngressNetworkPolicy_CrossWorkspaceAccess_RestrictionMode + | undefined; + denyRules?: + | IngressNetworkPolicy_CreateCrossWorkspaceIngressRule[] + | undefined; + allowRules?: + | IngressNetworkPolicy_CreateCrossWorkspaceIngressRule[] + | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreateCrossWorkspaceIngressRule { + origin?: IngressNetworkPolicy_CreateCrossWorkspaceRequestOrigin | undefined; + destination?: IngressNetworkPolicy_CreateRequestDestination | undefined; + authentication?: IngressNetworkPolicy_CreateAuthentication | undefined; + /** The label for this ingress rule. */ + label?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreateCrossWorkspaceRequestOrigin { + source?: + | { + $case: 'allSourceWorkspaces'; + /** Matches all source workspaces. */ + allSourceWorkspaces: boolean; + } + | { + $case: 'selectedWorkspaces'; + /** Specific source workspace IDs to match. */ + selectedWorkspaces: IngressNetworkPolicy_CreateWorkspaceIdList; + } + | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreateEndpoints { + endpointIds?: string[] | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreateIpRanges { + /** We only support IPv4 and IPv4 CIDR notation for now. */ + ipRanges?: string[] | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreateLakebaseRuntimeDestination { + /** Must be set to true. */ + allDestinations?: boolean | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreatePrivateAccess { + restrictionMode?: + | IngressNetworkPolicy_PrivateAccess_RestrictionMode + | undefined; + denyRules?: IngressNetworkPolicy_CreatePrivateIngressRule[] | undefined; + allowRules?: IngressNetworkPolicy_CreatePrivateIngressRule[] | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreatePrivateIngressRule { + origin?: IngressNetworkPolicy_CreatePrivateRequestOrigin | undefined; + destination?: IngressNetworkPolicy_CreateRequestDestination | undefined; + authentication?: IngressNetworkPolicy_CreateAuthentication | undefined; + /** The label for this ingress rule. */ + label?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreatePrivateRequestOrigin { + source?: + | {$case: 'endpoints'; endpoints: IngressNetworkPolicy_CreateEndpoints} + | {$case: 'allRegisteredEndpoints'; allRegisteredEndpoints: boolean} + | {$case: 'azureWorkspacePrivateLink'; azureWorkspacePrivateLink: boolean} + | {$case: 'allPrivateAccess'; allPrivateAccess: boolean} + | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreatePublicAccess { + restrictionMode?: + | IngressNetworkPolicy_PublicAccess_RestrictionMode + | undefined; + denyRules?: IngressNetworkPolicy_CreatePublicIngressRule[] | undefined; + allowRules?: IngressNetworkPolicy_CreatePublicIngressRule[] | undefined; +} + +/** + * An ingress rule is enforced when a request satisfies all + * specified attributes — including request origin, destination, and authentication. + */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreatePublicIngressRule { + origin?: IngressNetworkPolicy_CreatePublicRequestOrigin | undefined; + destination?: IngressNetworkPolicy_CreateRequestDestination | undefined; + authentication?: IngressNetworkPolicy_CreateAuthentication | undefined; + /** The label for this ingress rule. */ + label?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreatePublicRequestOrigin { + source?: + | { + $case: 'allIpRanges'; + /** Matches all IPv4 and IPv6 ranges (both public and private). */ + allIpRanges: boolean; + } + | { + $case: 'includedIpRanges'; + /** Will not allow IP ranges with private IPs. */ + includedIpRanges: IngressNetworkPolicy_CreateIpRanges; + } + | { + $case: 'excludedIpRanges'; + /** Excluded means: all public IP ranges except this one. */ + excludedIpRanges: IngressNetworkPolicy_CreateIpRanges; + } + | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreateRequestDestination { + /** + * When true, match all destinations, no other destination fields can be set. + * When not set or false, at least one specific destination must be provided. + */ + allDestinations?: boolean | undefined; + workspaceUi?: IngressNetworkPolicy_CreateWorkspaceUiDestination | undefined; + workspaceApi?: IngressNetworkPolicy_CreateWorkspaceApiDestination | undefined; + appsRuntime?: IngressNetworkPolicy_CreateAppsRuntimeDestination | undefined; + lakebaseRuntime?: + | IngressNetworkPolicy_CreateLakebaseRuntimeDestination + | undefined; + accountUi?: IngressNetworkPolicy_CreateAccountUiDestination | undefined; + accountApi?: IngressNetworkPolicy_CreateAccountApiDestination | undefined; + /** + * Account DatabricksOne destination is not supported. + * DO NOT change the stage of this destination past PRIVATE_PREVIEW. + */ + accountDatabricksOne?: + | IngressNetworkPolicy_CreateAccountDatabricksOneDestination + | undefined; +} + +/** Matches workspace-level Databricks API endpoints for an ingress network policy rule. */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreateWorkspaceApiDestination { + scopes?: string[] | undefined; + /** Qualifies the breadth of API access for the listed scopes. See ApiScopeQualifier. */ + scopeQualifier?: IngressNetworkPolicy_ApiScopeQualifier | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreateWorkspaceIdList { + workspaceIds?: bigint[] | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngressNetworkPolicy_CreateWorkspaceUiDestination { + /** Must be set to true. */ + allDestinations?: boolean | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface IngressNetworkPolicy_CrossWorkspaceAccess { restrictionMode?: @@ -1567,6 +2276,17 @@ export interface NetworkConnectivityConfigAzurePrivateEndpointRule { // eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface NetworkConnectivityConfigEgressConfig {} +/** Default rules don't have specific targets. */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface NetworkConnectivityConfigEgressConfig_CreateDefaultRule { + azureServiceEndpointRule?: + | NetworkConnectivityConfigEgressConfig_DefaultRule_CreateAzureServiceEndpointRule + | undefined; + awsStableIpRule?: + | NetworkConnectivityConfigEgressConfig_DefaultRule_CreateAwsStableIpRule + | undefined; +} + /** Default rules don't have specific targets. */ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface NetworkConnectivityConfigEgressConfig_DefaultRule { @@ -1599,6 +2319,27 @@ export interface NetworkConnectivityConfigEgressConfig_DefaultRule_AzureServiceE subnets?: string[] | undefined; } +/** The stable AWS IP CIDR blocks. You can use these to configure the firewall of your resources to allow traffic from your workspace. */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface NetworkConnectivityConfigEgressConfig_DefaultRule_CreateAwsStableIpRule { + /** The list of stable IP CIDR blocks from which network traffic originates when accessing your resources. */ + cidrBlocks?: string[] | undefined; +} + +/** + * The stable Azure service endpoints. You can configure the firewall of your Azure resources + * to allow traffic from your serverless compute resources. + */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface NetworkConnectivityConfigEgressConfig_DefaultRule_CreateAzureServiceEndpointRule { + /** The Azure region in which this service endpoint rule applies.. */ + targetRegion?: string | undefined; + /** The Azure services to which this service endpoint rule applies to. */ + targetServices?: EgressResourceType[] | undefined; + /** The list of subnets from which network traffic originates when accessing your Azure resources. */ + subnets?: string[] | undefined; +} + export interface NetworkHealth { errorType?: string | undefined; /** Details of the error. */ @@ -1697,6 +2438,21 @@ export interface UpdateAccountIpAccessListResponse { ipAccessList?: AccountIpAccessList | undefined; } +export interface UpdateGcpEndpoint { + /** Selects which target services this private endpoint reaches. */ + targetServices?: + | { + $case: 'serviceAttachment'; + /** + * The full url of the target service attachment. + * Example: + * projects/my-gcp-project/regions/us-east4/serviceAttachments/my-service-attachment + */ + serviceAttachment: string; + } + | undefined; +} + /** Details required to update an IP access list. */ export interface UpdateIpAccessListRequest { /** The ID for the corresponding IP access list */ @@ -1722,8 +2478,8 @@ export interface UpdateNccPrivateEndpointRuleRequest { accountId?: string | undefined; /** Your private endpoint rule ID. */ privateEndpointRuleId?: string | undefined; - privateEndpointRule?: UpdatePrivateEndpointRule | undefined; - updateMask?: FieldMask | undefined; + privateEndpointRule?: UpdateUpdatePrivateEndpointRule | undefined; + updateMask?: FieldMask | undefined; } export interface UpdateNetworkPolicyRequest { @@ -1732,12 +2488,12 @@ export interface UpdateNetworkPolicyRequest { /** Your account ID. You can find your account ID in your accounts console. */ accountId?: string | undefined; /** Updated network policy configuration details. */ - networkPolicy?: AccountNetworkPolicy | undefined; + networkPolicy?: CreateAccountNetworkPolicy | undefined; } export interface UpdatePrivateAccessSettingsRequest { /** Properties of the new private access settings object. */ - customerFacingPrivateAccessSettings?: PrivateAccessSettings | undefined; + customerFacingPrivateAccessSettings?: CreatePrivateAccessSettings | undefined; } /** @@ -1815,13 +2571,88 @@ export interface UpdatePrivateEndpointRule { endpoint?: {$case: 'gcpEndpoint'; gcpEndpoint: GcpEndpoint} | undefined; } +/** + * Properties of the new private endpoint rule. + * Note that you must approve the endpoint in Azure portal after initialization. + */ +export interface UpdateUpdatePrivateEndpointRule { + /** The ID of a private endpoint rule. */ + ruleId?: string | undefined; + /** The ID of a network connectivity configuration, which is the parent resource of this private endpoint rule object. */ + networkConnectivityConfigId?: string | undefined; + /** + * The current status of this private endpoint. The private endpoint rules are effective only if the connection state + * is ESTABLISHED. Remember that you must approve new endpoints on your resources in the Cloud console + * before they take effect. + * The possible values are: + * - PENDING: The endpoint has been created and pending approval. + * - ESTABLISHED: The endpoint has been approved and is ready to use in your serverless compute resources. + * - REJECTED: Connection was rejected by the private link resource owner. + * - DISCONNECTED: Connection was removed by the private link resource owner, the private endpoint becomes informative and should be deleted for clean-up. + * - EXPIRED: If the endpoint was created but not approved in 14 days, it will be EXPIRED. + * - CREATING: The endpoint creation is in progress. Once successfully created, the state will transition to PENDING. + * - CREATE_FAILED: The endpoint creation failed. You can check the error_message field for more details. + */ + connectionState?: + | NccPrivateEndpointRule_PrivateLinkConnectionState + | undefined; + /** + * Only used by private endpoints to customer-managed private endpoint services. + * + * Domain names of target private link service. + * When updating this field, the full list of target domain_names must be specified. + */ + domainNames?: string[] | undefined; + /** Time in epoch milliseconds when this object was created. */ + creationTime?: bigint | undefined; + /** Time in epoch milliseconds when this object was updated. */ + updatedTime?: bigint | undefined; + /** Whether this private endpoint is deactivated. */ + deactivated?: boolean | undefined; + /** Time in epoch milliseconds when this object was deactivated. */ + deactivatedAt?: bigint | undefined; + errorMessage?: string | undefined; + /** The Azure resource ID of the target resource. */ + resourceId?: string | undefined; + /** + * Not used by customer-managed private endpoint services. + * + * The sub-resource type (group ID) of the target resource. + * Note that to connect to workspace root storage (root DBFS), you need two endpoints, one for blob and one for dfs. + */ + groupId?: string | undefined; + /** The name of the Azure private endpoint resource. */ + endpointName?: string | undefined; + /** account ID. You can find your account ID from the Accounts Console. */ + accountId?: string | undefined; + /** The full target AWS endpoint service name that connects to the destination resources of the private endpoint. */ + endpointService?: string | undefined; + /** + * Only used by private endpoints towards AWS S3 service. + * + * The globally unique S3 bucket names that will be accessed via the VPC endpoint. + * The bucket names must be in the same region as the NCC/endpoint service. + * When updating this field, we perform full update on this field. Please ensure a full list of desired + * resource_names is provided. + */ + resourceNames?: string[] | undefined; + /** The AWS VPC endpoint ID. You can use this ID to identify the VPC endpoint created by . */ + vpcEndpointId?: string | undefined; + /** + * Update this field to activate/deactivate this private endpoint to allow egress access from + * serverless compute resources. Only honored for first-party services on each cloud (e.g. AWS S3). + */ + enabled?: boolean | undefined; + endpoint?: {$case: 'gcpEndpoint'; gcpEndpoint: UpdateGcpEndpoint} | undefined; +} + export interface UpdateWorkspaceNetworkOptionRequest { /** Your account ID. You can find your account ID in your accounts console. */ accountId?: string | undefined; /** The workspace ID. */ workspaceId?: bigint | undefined; /** The network option details for the workspace. */ - workspaceNetworkOption?: WorkspaceNetworkOption | undefined; + workspaceNetworkOption?: CreateWorkspaceNetworkOption | undefined; } /** * */ @@ -3089,136 +3920,334 @@ export const unmarshalPrivateAccessSettingsSchema: z.ZodType = +export const unmarshalReplaceAccountIpAccessListResponseSchema: z.ZodType = + z + .object({ + ip_access_list: z + .lazy(() => unmarshalAccountIpAccessListSchema) + .optional(), + }) + .transform(d => ({ + ipAccessList: d.ip_access_list, + })); + +export const unmarshalReplaceIpAccessListResponseSchema: z.ZodType = + z + .object({ + ip_access_list: z.lazy(() => unmarshalIpAccessListSchema).optional(), + }) + .transform(d => ({ + ipAccessList: d.ip_access_list, + })); + +export const unmarshalUpdateAccountIpAccessListResponseSchema: z.ZodType = + z + .object({ + ip_access_list: z + .lazy(() => unmarshalAccountIpAccessListSchema) + .optional(), + }) + .transform(d => ({ + ipAccessList: d.ip_access_list, + })); + +export const unmarshalUpdateIpAccessListResponseSchema: z.ZodType = + z + .object({ + ip_access_list: z.lazy(() => unmarshalIpAccessListSchema).optional(), + }) + .transform(d => ({ + ipAccessList: d.ip_access_list, + })); + +export const unmarshalVpcEndpointSchema: z.ZodType = z + .object({ + vpc_endpoint_id: z.string().optional(), + account_id: z.string().optional(), + vpc_endpoint_name: z.string().optional(), + aws_vpc_endpoint_id: z.string().optional(), + aws_endpoint_service_id: z.string().optional(), + use_case: z.string().optional(), + region: z.string().optional(), + aws_account_id: z.string().optional(), + state: z.string().optional(), + gcp_vpc_endpoint_info: z + .lazy(() => unmarshalGcpVpcEndpointInfoSchema) + .optional(), + }) + .transform(d => ({ + vpcEndpointId: d.vpc_endpoint_id, + accountId: d.account_id, + vpcEndpointName: d.vpc_endpoint_name, + awsVpcEndpointId: d.aws_vpc_endpoint_id, + awsEndpointServiceId: d.aws_endpoint_service_id, + useCase: d.use_case, + region: d.region, + awsAccountId: d.aws_account_id, + state: d.state, + vpcEndpointInfo: + d.gcp_vpc_endpoint_info !== undefined + ? { + $case: 'gcpVpcEndpointInfo' as const, + gcpVpcEndpointInfo: d.gcp_vpc_endpoint_info, + } + : undefined, + })); + +export const unmarshalWorkspaceNetworkOptionSchema: z.ZodType = + z + .object({ + network_policy_id: z.string().optional(), + workspace_id: z + .union([z.number(), z.bigint()]) + .transform(v => BigInt(v)) + .optional(), + }) + .transform(d => ({ + networkPolicyId: d.network_policy_id, + workspaceId: d.workspace_id, + })); + +export const marshalCreateAccountIpAccessListRequestSchema: z.ZodType = z + .object({ + accountId: z.string().optional(), + label: z.string().optional(), + listType: z.string().optional(), + ipAddresses: z.array(z.string()).optional(), + }) + .transform(d => ({ + account_id: d.accountId, + label: d.label, + list_type: d.listType, + ip_addresses: d.ipAddresses, + })); + +export const marshalCreateAccountNetworkPolicySchema: z.ZodType = z + .object({ + networkPolicyId: z.string().optional(), + accountId: z.string().optional(), + egress: z.lazy(() => marshalCreateEgressNetworkPolicySchema).optional(), + ingress: z.lazy(() => marshalCreateIngressNetworkPolicySchema).optional(), + ingressDryRun: z + .lazy(() => marshalCreateIngressNetworkPolicySchema) + .optional(), + }) + .transform(d => ({ + network_policy_id: d.networkPolicyId, + account_id: d.accountId, + egress: d.egress, + ingress: d.ingress, + ingress_dry_run: d.ingressDryRun, + })); + +export const marshalCreateAzurePrivateEndpointInfoSchema: z.ZodType = z + .object({ + privateEndpointName: z.string(), + privateEndpointResourceGuid: z.string(), + }) + .transform(d => ({ + private_endpoint_name: d.privateEndpointName, + private_endpoint_resource_guid: d.privateEndpointResourceGuid, + })); + +export const marshalCreateCreateNetworkConnectivityConfigurationSchema: z.ZodType = + z + .object({ + networkConnectivityConfigId: z.string().optional(), + accountId: z.string().optional(), + name: z.string().optional(), + region: z.string().optional(), + egressConfig: z + .lazy( + () => + marshalCreateCustomerFacingNetworkConnectivityConfigEgressConfigSchema + ) + .optional(), + updatedTime: z.bigint().optional(), + creationTime: z.bigint().optional(), + }) + .transform(d => ({ + network_connectivity_config_id: d.networkConnectivityConfigId, + account_id: d.accountId, + name: d.name, + region: d.region, + egress_config: d.egressConfig, + updated_time: d.updatedTime, + creation_time: d.creationTime, + })); + +export const marshalCreateCreatePrivateEndpointRuleSchema: z.ZodType = z + .object({ + ruleId: z.string().optional(), + networkConnectivityConfigId: z.string().optional(), + connectionState: z.string().optional(), + domainNames: z.array(z.string()).optional(), + creationTime: z.bigint().optional(), + updatedTime: z.bigint().optional(), + deactivated: z.boolean().optional(), + deactivatedAt: z.bigint().optional(), + errorMessage: z.string().optional(), + resourceId: z.string().optional(), + groupId: z.string().optional(), + endpointName: z.string().optional(), + accountId: z.string().optional(), + endpointService: z.string().optional(), + resourceNames: z.array(z.string()).optional(), + vpcEndpointId: z.string().optional(), + enabled: z.boolean().optional(), + endpoint: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('gcpEndpoint'), + gcpEndpoint: z.lazy(() => marshalCreateGcpEndpointSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + rule_id: d.ruleId, + network_connectivity_config_id: d.networkConnectivityConfigId, + connection_state: d.connectionState, + domain_names: d.domainNames, + creation_time: d.creationTime, + updated_time: d.updatedTime, + deactivated: d.deactivated, + deactivated_at: d.deactivatedAt, + error_message: d.errorMessage, + resource_id: d.resourceId, + group_id: d.groupId, + endpoint_name: d.endpointName, + account_id: d.accountId, + endpoint_service: d.endpointService, + resource_names: d.resourceNames, + vpc_endpoint_id: d.vpcEndpointId, + enabled: d.enabled, + ...(d.endpoint?.$case === 'gcpEndpoint' && { + gcp_endpoint: d.endpoint.gcpEndpoint, + }), + })); + +export const marshalCreateCustomerFacingNetworkConnectivityConfigEgressConfigSchema: z.ZodType = z .object({ - ip_access_list: z - .lazy(() => unmarshalAccountIpAccessListSchema) + defaultRules: z + .lazy( + () => + marshalNetworkConnectivityConfigEgressConfig_CreateDefaultRuleSchema + ) .optional(), - }) - .transform(d => ({ - ipAccessList: d.ip_access_list, - })); - -export const unmarshalReplaceIpAccessListResponseSchema: z.ZodType = - z - .object({ - ip_access_list: z.lazy(() => unmarshalIpAccessListSchema).optional(), - }) - .transform(d => ({ - ipAccessList: d.ip_access_list, - })); - -export const unmarshalUpdateAccountIpAccessListResponseSchema: z.ZodType = - z - .object({ - ip_access_list: z - .lazy(() => unmarshalAccountIpAccessListSchema) + targetRules: z + .lazy( + () => + marshalCustomerFacingNetworkConnectivityConfigEgressConfig_CreateCustomerFacingTargetRuleSchema + ) .optional(), }) .transform(d => ({ - ipAccessList: d.ip_access_list, + default_rules: d.defaultRules, + target_rules: d.targetRules, })); -export const unmarshalUpdateIpAccessListResponseSchema: z.ZodType = - z - .object({ - ip_access_list: z.lazy(() => unmarshalIpAccessListSchema).optional(), - }) - .transform(d => ({ - ipAccessList: d.ip_access_list, - })); +export const marshalCreateEgressNetworkPolicySchema: z.ZodType = z + .object({ + networkAccess: z + .lazy(() => marshalEgressNetworkPolicy_CreateNetworkAccessPolicySchema) + .optional(), + }) + .transform(d => ({ + network_access: d.networkAccess, + })); -export const unmarshalVpcEndpointSchema: z.ZodType = z +export const marshalCreateEndpointSchema: z.ZodType = z .object({ - vpc_endpoint_id: z.string().optional(), - account_id: z.string().optional(), - vpc_endpoint_name: z.string().optional(), - aws_vpc_endpoint_id: z.string().optional(), - aws_endpoint_service_id: z.string().optional(), - use_case: z.string().optional(), - region: z.string().optional(), - aws_account_id: z.string().optional(), - state: z.string().optional(), - gcp_vpc_endpoint_info: z - .lazy(() => unmarshalGcpVpcEndpointInfoSchema) + displayName: z.string(), + region: z.string(), + endpointInfo: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('azurePrivateEndpointInfo'), + azurePrivateEndpointInfo: z.lazy( + () => marshalCreateAzurePrivateEndpointInfoSchema + ), + }), + ]) .optional(), }) .transform(d => ({ - vpcEndpointId: d.vpc_endpoint_id, - accountId: d.account_id, - vpcEndpointName: d.vpc_endpoint_name, - awsVpcEndpointId: d.aws_vpc_endpoint_id, - awsEndpointServiceId: d.aws_endpoint_service_id, - useCase: d.use_case, + display_name: d.displayName, region: d.region, - awsAccountId: d.aws_account_id, - state: d.state, - vpcEndpointInfo: - d.gcp_vpc_endpoint_info !== undefined - ? { - $case: 'gcpVpcEndpointInfo' as const, - gcpVpcEndpointInfo: d.gcp_vpc_endpoint_info, - } - : undefined, + ...(d.endpointInfo?.$case === 'azurePrivateEndpointInfo' && { + azure_private_endpoint_info: d.endpointInfo.azurePrivateEndpointInfo, + }), })); -export const unmarshalWorkspaceNetworkOptionSchema: z.ZodType = - z - .object({ - network_policy_id: z.string().optional(), - workspace_id: z - .union([z.number(), z.bigint()]) - .transform(v => BigInt(v)) - .optional(), - }) - .transform(d => ({ - networkPolicyId: d.network_policy_id, - workspaceId: d.workspace_id, - })); +export const marshalCreateGcpEndpointSchema: z.ZodType = z + .object({ + targetServices: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('serviceAttachment'), + serviceAttachment: z.string(), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.targetServices?.$case === 'serviceAttachment' && { + service_attachment: d.targetServices.serviceAttachment, + }), + })); -export const marshalAccountNetworkPolicySchema: z.ZodType = z +export const marshalCreateGcpNetworkInfoSchema: z.ZodType = z .object({ - networkPolicyId: z.string().optional(), - accountId: z.string().optional(), - egress: z.lazy(() => marshalEgressNetworkPolicySchema).optional(), - ingress: z.lazy(() => marshalIngressNetworkPolicySchema).optional(), - ingressDryRun: z.lazy(() => marshalIngressNetworkPolicySchema).optional(), + networkProjectId: z.string(), + vpcId: z.string(), + subnetId: z.string(), + subnetRegion: z.string(), + podIpRangeName: z.string(), + serviceIpRangeName: z.string(), }) .transform(d => ({ - network_policy_id: d.networkPolicyId, - account_id: d.accountId, - egress: d.egress, - ingress: d.ingress, - ingress_dry_run: d.ingressDryRun, + network_project_id: d.networkProjectId, + vpc_id: d.vpcId, + subnet_id: d.subnetId, + subnet_region: d.subnetRegion, + pod_ip_range_name: d.podIpRangeName, + service_ip_range_name: d.serviceIpRangeName, })); -export const marshalAzurePrivateEndpointInfoSchema: z.ZodType = z +export const marshalCreateGcpVpcEndpointInfoSchema: z.ZodType = z .object({ - privateEndpointName: z.string().optional(), - privateEndpointResourceGuid: z.string().optional(), - privateEndpointResourceId: z.string().optional(), - privateLinkServiceId: z.string().optional(), + pscConnectionId: z.string().optional(), + projectId: z.string(), + pscEndpointName: z.string(), + endpointRegion: z.string(), + serviceAttachmentId: z.string().optional(), }) .transform(d => ({ - private_endpoint_name: d.privateEndpointName, - private_endpoint_resource_guid: d.privateEndpointResourceGuid, - private_endpoint_resource_id: d.privateEndpointResourceId, - private_link_service_id: d.privateLinkServiceId, + psc_connection_id: d.pscConnectionId, + project_id: d.projectId, + psc_endpoint_name: d.pscEndpointName, + endpoint_region: d.endpointRegion, + service_attachment_id: d.serviceAttachmentId, })); -export const marshalCreateAccountIpAccessListRequestSchema: z.ZodType = z +export const marshalCreateIngressNetworkPolicySchema: z.ZodType = z .object({ - accountId: z.string().optional(), - label: z.string().optional(), - listType: z.string().optional(), - ipAddresses: z.array(z.string()).optional(), + publicAccess: z + .lazy(() => marshalIngressNetworkPolicy_CreatePublicAccessSchema) + .optional(), + privateAccess: z + .lazy(() => marshalIngressNetworkPolicy_CreatePrivateAccessSchema) + .optional(), + crossWorkspaceAccess: z + .lazy(() => marshalIngressNetworkPolicy_CreateCrossWorkspaceAccessSchema) + .optional(), }) .transform(d => ({ - account_id: d.accountId, - label: d.label, - list_type: d.listType, - ip_addresses: d.ipAddresses, + public_access: d.publicAccess, + private_access: d.privateAccess, + cross_workspace_access: d.crossWorkspaceAccess, })); export const marshalCreateIpAccessListRequestSchema: z.ZodType = z @@ -3233,29 +4262,71 @@ export const marshalCreateIpAccessListRequestSchema: z.ZodType = z ip_addresses: d.ipAddresses, })); -export const marshalCreateNetworkConnectivityConfigurationSchema: z.ZodType = z - .object({ - networkConnectivityConfigId: z.string().optional(), - accountId: z.string().optional(), - name: z.string().optional(), - region: z.string().optional(), - egressConfig: z - .lazy( - () => marshalCustomerFacingNetworkConnectivityConfigEgressConfigSchema - ) - .optional(), - updatedTime: z.bigint().optional(), - creationTime: z.bigint().optional(), - }) - .transform(d => ({ - network_connectivity_config_id: d.networkConnectivityConfigId, - account_id: d.accountId, - name: d.name, - region: d.region, - egress_config: d.egressConfig, - updated_time: d.updatedTime, - creation_time: d.creationTime, - })); +export const marshalCreateNetworkConnectivityConfigAwsPrivateEndpointRuleSchema: z.ZodType = + z + .object({ + ruleId: z.string().optional(), + networkConnectivityConfigId: z.string().optional(), + accountId: z.string().optional(), + endpointService: z.string().optional(), + domainNames: z.array(z.string()).optional(), + resourceNames: z.array(z.string()).optional(), + vpcEndpointId: z.string().optional(), + connectionState: z.string().optional(), + creationTime: z.bigint().optional(), + updatedTime: z.bigint().optional(), + deactivated: z.boolean().optional(), + deactivatedAt: z.bigint().optional(), + enabled: z.boolean().optional(), + errorMessage: z.string().optional(), + }) + .transform(d => ({ + rule_id: d.ruleId, + network_connectivity_config_id: d.networkConnectivityConfigId, + account_id: d.accountId, + endpoint_service: d.endpointService, + domain_names: d.domainNames, + resource_names: d.resourceNames, + vpc_endpoint_id: d.vpcEndpointId, + connection_state: d.connectionState, + creation_time: d.creationTime, + updated_time: d.updatedTime, + deactivated: d.deactivated, + deactivated_at: d.deactivatedAt, + enabled: d.enabled, + error_message: d.errorMessage, + })); + +export const marshalCreateNetworkConnectivityConfigAzurePrivateEndpointRuleSchema: z.ZodType = + z + .object({ + ruleId: z.string().optional(), + networkConnectivityConfigId: z.string().optional(), + resourceId: z.string().optional(), + groupId: z.string().optional(), + endpointName: z.string().optional(), + connectionState: z.string().optional(), + creationTime: z.bigint().optional(), + updatedTime: z.bigint().optional(), + deactivated: z.boolean().optional(), + deactivatedAt: z.bigint().optional(), + domainNames: z.array(z.string()).optional(), + errorMessage: z.string().optional(), + }) + .transform(d => ({ + rule_id: d.ruleId, + network_connectivity_config_id: d.networkConnectivityConfigId, + resource_id: d.resourceId, + group_id: d.groupId, + endpoint_name: d.endpointName, + connection_state: d.connectionState, + creation_time: d.creationTime, + updated_time: d.updatedTime, + deactivated: d.deactivated, + deactivated_at: d.deactivatedAt, + domain_names: d.domainNames, + error_message: d.errorMessage, + })); export const marshalCreateNetworkRequestSchema: z.ZodType = z .object({ @@ -3264,8 +4335,10 @@ export const marshalCreateNetworkRequestSchema: z.ZodType = z vpcId: z.string().optional(), subnetIds: z.array(z.string()).optional(), securityGroupIds: z.array(z.string()).optional(), - vpcEndpoints: z.lazy(() => marshalNetworkVpcEndpointsSchema).optional(), - gcpNetworkInfo: z.lazy(() => marshalGcpNetworkInfoSchema).optional(), + vpcEndpoints: z + .lazy(() => marshalCreateNetworkVpcEndpointsSchema) + .optional(), + gcpNetworkInfo: z.lazy(() => marshalCreateGcpNetworkInfoSchema).optional(), }) .transform(d => ({ account_id: d.accountId, @@ -3277,8 +4350,19 @@ export const marshalCreateNetworkRequestSchema: z.ZodType = z gcp_network_info: d.gcpNetworkInfo, })); -export const marshalCreatePrivateAccessSettingsRequestSchema: z.ZodType = z +export const marshalCreateNetworkVpcEndpointsSchema: z.ZodType = z + .object({ + restApi: z.array(z.string()).optional(), + dataplaneRelay: z.array(z.string()).optional(), + }) + .transform(d => ({ + rest_api: d.restApi, + dataplane_relay: d.dataplaneRelay, + })); + +export const marshalCreatePrivateAccessSettingsSchema: z.ZodType = z .object({ + privateAccessSettingsId: z.string().optional(), accountId: z.string().optional(), privateAccessSettingsName: z.string().optional(), region: z.string().optional(), @@ -3287,6 +4371,7 @@ export const marshalCreatePrivateAccessSettingsRequestSchema: z.ZodType = z allowedVpcEndpointIds: z.array(z.string()).optional(), }) .transform(d => ({ + private_access_settings_id: d.privateAccessSettingsId, account_id: d.accountId, private_access_settings_name: d.privateAccessSettingsName, region: d.region, @@ -3295,55 +4380,22 @@ export const marshalCreatePrivateAccessSettingsRequestSchema: z.ZodType = z allowed_vpc_endpoint_ids: d.allowedVpcEndpointIds, })); -export const marshalCreatePrivateEndpointRuleSchema: z.ZodType = z +export const marshalCreatePrivateAccessSettingsRequestSchema: z.ZodType = z .object({ - ruleId: z.string().optional(), - networkConnectivityConfigId: z.string().optional(), - connectionState: z.string().optional(), - domainNames: z.array(z.string()).optional(), - creationTime: z.bigint().optional(), - updatedTime: z.bigint().optional(), - deactivated: z.boolean().optional(), - deactivatedAt: z.bigint().optional(), - errorMessage: z.string().optional(), - resourceId: z.string().optional(), - groupId: z.string().optional(), - endpointName: z.string().optional(), accountId: z.string().optional(), - endpointService: z.string().optional(), - resourceNames: z.array(z.string()).optional(), - vpcEndpointId: z.string().optional(), - enabled: z.boolean().optional(), - endpoint: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('gcpEndpoint'), - gcpEndpoint: z.lazy(() => marshalGcpEndpointSchema), - }), - ]) - .optional(), + privateAccessSettingsName: z.string().optional(), + region: z.string().optional(), + publicAccessEnabled: z.boolean().optional(), + privateAccessLevel: z.string().optional(), + allowedVpcEndpointIds: z.array(z.string()).optional(), }) .transform(d => ({ - rule_id: d.ruleId, - network_connectivity_config_id: d.networkConnectivityConfigId, - connection_state: d.connectionState, - domain_names: d.domainNames, - creation_time: d.creationTime, - updated_time: d.updatedTime, - deactivated: d.deactivated, - deactivated_at: d.deactivatedAt, - error_message: d.errorMessage, - resource_id: d.resourceId, - group_id: d.groupId, - endpoint_name: d.endpointName, account_id: d.accountId, - endpoint_service: d.endpointService, - resource_names: d.resourceNames, - vpc_endpoint_id: d.vpcEndpointId, - enabled: d.enabled, - ...(d.endpoint?.$case === 'gcpEndpoint' && { - gcp_endpoint: d.endpoint.gcpEndpoint, - }), + private_access_settings_name: d.privateAccessSettingsName, + region: d.region, + public_access_enabled: d.publicAccessEnabled, + private_access_level: d.privateAccessLevel, + allowed_vpc_endpoint_ids: d.allowedVpcEndpointIds, })); export const marshalCreateVpcEndpointRequestSchema: z.ZodType = z @@ -3356,7 +4408,9 @@ export const marshalCreateVpcEndpointRequestSchema: z.ZodType = z .discriminatedUnion('$case', [ z.object({ $case: z.literal('gcpVpcEndpointInfo'), - gcpVpcEndpointInfo: z.lazy(() => marshalGcpVpcEndpointInfoSchema), + gcpVpcEndpointInfo: z.lazy( + () => marshalCreateGcpVpcEndpointInfoSchema + ), }), ]) .optional(), @@ -3371,41 +4425,33 @@ export const marshalCreateVpcEndpointRequestSchema: z.ZodType = z }), })); -export const marshalCustomerFacingNetworkConnectivityConfigEgressConfigSchema: z.ZodType = - z - .object({ - defaultRules: z - .lazy( - () => marshalNetworkConnectivityConfigEgressConfig_DefaultRuleSchema - ) - .optional(), - targetRules: z - .lazy( - () => - marshalCustomerFacingNetworkConnectivityConfigEgressConfig_CustomerFacingTargetRuleSchema - ) - .optional(), - }) - .transform(d => ({ - default_rules: d.defaultRules, - target_rules: d.targetRules, - })); +export const marshalCreateWorkspaceNetworkOptionSchema: z.ZodType = z + .object({ + networkPolicyId: z.string().optional(), + workspaceId: z.bigint().optional(), + }) + .transform(d => ({ + network_policy_id: d.networkPolicyId, + workspace_id: d.workspaceId, + })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCustomerFacingNetworkConnectivityConfigEgressConfig_CustomerFacingTargetRuleSchema: z.ZodType = +export const marshalCustomerFacingNetworkConnectivityConfigEgressConfig_CreateCustomerFacingTargetRuleSchema: z.ZodType = z .object({ azurePrivateEndpointRules: z .array( z.lazy( - () => marshalNetworkConnectivityConfigAzurePrivateEndpointRuleSchema + () => + marshalCreateNetworkConnectivityConfigAzurePrivateEndpointRuleSchema ) ) .optional(), awsPrivateEndpointRules: z .array( z.lazy( - () => marshalNetworkConnectivityConfigAwsPrivateEndpointRuleSchema + () => + marshalCreateNetworkConnectivityConfigAwsPrivateEndpointRuleSchema ) ) .optional(), @@ -3415,70 +4461,61 @@ export const marshalCustomerFacingNetworkConnectivityConfigEgressConfig_Customer aws_private_endpoint_rules: d.awsPrivateEndpointRules, })); -export const marshalEgressNetworkPolicySchema: z.ZodType = z - .object({ - networkAccess: z - .lazy(() => marshalEgressNetworkPolicy_NetworkAccessPolicySchema) - .optional(), - }) - .transform(d => ({ - network_access: d.networkAccess, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalEgressNetworkPolicy_NetworkAccessPolicySchema: z.ZodType = z - .object({ - restrictionMode: z.string().optional(), - allowedInternetDestinations: z - .array( - z.lazy( - () => - marshalEgressNetworkPolicy_NetworkAccessPolicy_InternetDestinationSchema +export const marshalEgressNetworkPolicy_CreateNetworkAccessPolicySchema: z.ZodType = + z + .object({ + restrictionMode: z.string().optional(), + allowedInternetDestinations: z + .array( + z.lazy( + () => + marshalEgressNetworkPolicy_NetworkAccessPolicy_CreateInternetDestinationSchema + ) ) - ) - .optional(), - allowedStorageDestinations: z - .array( - z.lazy( - () => - marshalEgressNetworkPolicy_NetworkAccessPolicy_StorageDestinationSchema + .optional(), + allowedStorageDestinations: z + .array( + z.lazy( + () => + marshalEgressNetworkPolicy_NetworkAccessPolicy_CreateStorageDestinationSchema + ) ) - ) - .optional(), - policyEnforcement: z - .lazy( - () => - marshalEgressNetworkPolicy_NetworkAccessPolicy_PolicyEnforcementSchema - ) - .optional(), - blockedInternetDestinations: z - .array( - z.lazy( + .optional(), + policyEnforcement: z + .lazy( () => - marshalEgressNetworkPolicy_NetworkAccessPolicy_InternetDestinationSchema + marshalEgressNetworkPolicy_NetworkAccessPolicy_CreatePolicyEnforcementSchema ) - ) - .optional(), - allowedDatabricksDestinations: z - .array( - z.lazy( - () => - marshalEgressNetworkPolicy_NetworkAccessPolicy_DatabricksDestinationSchema + .optional(), + blockedInternetDestinations: z + .array( + z.lazy( + () => + marshalEgressNetworkPolicy_NetworkAccessPolicy_CreateInternetDestinationSchema + ) ) - ) - .optional(), - }) - .transform(d => ({ - restriction_mode: d.restrictionMode, - allowed_internet_destinations: d.allowedInternetDestinations, - allowed_storage_destinations: d.allowedStorageDestinations, - policy_enforcement: d.policyEnforcement, - blocked_internet_destinations: d.blockedInternetDestinations, - allowed_databricks_destinations: d.allowedDatabricksDestinations, - })); + .optional(), + allowedDatabricksDestinations: z + .array( + z.lazy( + () => + marshalEgressNetworkPolicy_NetworkAccessPolicy_CreateDatabricksDestinationSchema + ) + ) + .optional(), + }) + .transform(d => ({ + restriction_mode: d.restrictionMode, + allowed_internet_destinations: d.allowedInternetDestinations, + allowed_storage_destinations: d.allowedStorageDestinations, + policy_enforcement: d.policyEnforcement, + blocked_internet_destinations: d.blockedInternetDestinations, + allowed_databricks_destinations: d.allowedDatabricksDestinations, + })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalEgressNetworkPolicy_NetworkAccessPolicy_DatabricksDestinationSchema: z.ZodType = +export const marshalEgressNetworkPolicy_NetworkAccessPolicy_CreateDatabricksDestinationSchema: z.ZodType = z .object({ workspaceIds: z.array(z.bigint()).optional(), @@ -3488,7 +4525,7 @@ export const marshalEgressNetworkPolicy_NetworkAccessPolicy_DatabricksDestinatio })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalEgressNetworkPolicy_NetworkAccessPolicy_InternetDestinationSchema: z.ZodType = +export const marshalEgressNetworkPolicy_NetworkAccessPolicy_CreateInternetDestinationSchema: z.ZodType = z .object({ destination: z.string().optional(), @@ -3500,7 +4537,7 @@ export const marshalEgressNetworkPolicy_NetworkAccessPolicy_InternetDestinationS })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalEgressNetworkPolicy_NetworkAccessPolicy_PolicyEnforcementSchema: z.ZodType = +export const marshalEgressNetworkPolicy_NetworkAccessPolicy_CreatePolicyEnforcementSchema: z.ZodType = z .object({ enforcementMode: z.string().optional(), @@ -3512,7 +4549,7 @@ export const marshalEgressNetworkPolicy_NetworkAccessPolicy_PolicyEnforcementSch })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalEgressNetworkPolicy_NetworkAccessPolicy_StorageDestinationSchema: z.ZodType = +export const marshalEgressNetworkPolicy_NetworkAccessPolicy_CreateStorageDestinationSchema: z.ZodType = z .object({ bucketName: z.string().optional(), @@ -3529,117 +4566,8 @@ export const marshalEgressNetworkPolicy_NetworkAccessPolicy_StorageDestinationSc azure_storage_service: d.azureStorageService, })); -export const marshalEndpointSchema: z.ZodType = z - .object({ - name: z.string().optional(), - endpointId: z.string().optional(), - accountId: z.string().optional(), - displayName: z.string().optional(), - useCase: z.string().optional(), - region: z.string().optional(), - state: z.string().optional(), - endpointInfo: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('azurePrivateEndpointInfo'), - azurePrivateEndpointInfo: z.lazy( - () => marshalAzurePrivateEndpointInfoSchema - ), - }), - ]) - .optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - }) - .transform(d => ({ - name: d.name, - endpoint_id: d.endpointId, - account_id: d.accountId, - display_name: d.displayName, - use_case: d.useCase, - region: d.region, - state: d.state, - ...(d.endpointInfo?.$case === 'azurePrivateEndpointInfo' && { - azure_private_endpoint_info: d.endpointInfo.azurePrivateEndpointInfo, - }), - create_time: d.createTime, - })); - -export const marshalGcpEndpointSchema: z.ZodType = z - .object({ - pscEndpointUri: z.string().optional(), - targetServices: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('serviceAttachment'), - serviceAttachment: z.string(), - }), - ]) - .optional(), - }) - .transform(d => ({ - psc_endpoint_uri: d.pscEndpointUri, - ...(d.targetServices?.$case === 'serviceAttachment' && { - service_attachment: d.targetServices.serviceAttachment, - }), - })); - -export const marshalGcpNetworkInfoSchema: z.ZodType = z - .object({ - networkProjectId: z.string().optional(), - vpcId: z.string().optional(), - subnetId: z.string().optional(), - subnetRegion: z.string().optional(), - podIpRangeName: z.string().optional(), - serviceIpRangeName: z.string().optional(), - }) - .transform(d => ({ - network_project_id: d.networkProjectId, - vpc_id: d.vpcId, - subnet_id: d.subnetId, - subnet_region: d.subnetRegion, - pod_ip_range_name: d.podIpRangeName, - service_ip_range_name: d.serviceIpRangeName, - })); - -export const marshalGcpVpcEndpointInfoSchema: z.ZodType = z - .object({ - pscConnectionId: z.string().optional(), - projectId: z.string().optional(), - pscEndpointName: z.string().optional(), - endpointRegion: z.string().optional(), - serviceAttachmentId: z.string().optional(), - }) - .transform(d => ({ - psc_connection_id: d.pscConnectionId, - project_id: d.projectId, - psc_endpoint_name: d.pscEndpointName, - endpoint_region: d.endpointRegion, - service_attachment_id: d.serviceAttachmentId, - })); - -export const marshalIngressNetworkPolicySchema: z.ZodType = z - .object({ - publicAccess: z - .lazy(() => marshalIngressNetworkPolicy_PublicAccessSchema) - .optional(), - privateAccess: z - .lazy(() => marshalIngressNetworkPolicy_PrivateAccessSchema) - .optional(), - crossWorkspaceAccess: z - .lazy(() => marshalIngressNetworkPolicy_CrossWorkspaceAccessSchema) - .optional(), - }) - .transform(d => ({ - public_access: d.publicAccess, - private_access: d.privateAccess, - cross_workspace_access: d.crossWorkspaceAccess, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_AccountApiDestinationSchema: z.ZodType = +export const marshalIngressNetworkPolicy_CreateAccountApiDestinationSchema: z.ZodType = z .object({ scopes: z.array(z.string()).optional(), @@ -3651,7 +4579,7 @@ export const marshalIngressNetworkPolicy_AccountApiDestinationSchema: z.ZodType })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_AccountDatabricksOneDestinationSchema: z.ZodType = +export const marshalIngressNetworkPolicy_CreateAccountDatabricksOneDestinationSchema: z.ZodType = z .object({ allDestinations: z.boolean().optional(), @@ -3661,7 +4589,7 @@ export const marshalIngressNetworkPolicy_AccountDatabricksOneDestinationSchema: })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_AccountUiDestinationSchema: z.ZodType = +export const marshalIngressNetworkPolicy_CreateAccountUiDestinationSchema: z.ZodType = z .object({ allDestinations: z.boolean().optional(), @@ -3671,7 +4599,7 @@ export const marshalIngressNetworkPolicy_AccountUiDestinationSchema: z.ZodType = })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_AppsRuntimeDestinationSchema: z.ZodType = +export const marshalIngressNetworkPolicy_CreateAppsRuntimeDestinationSchema: z.ZodType = z .object({ allDestinations: z.boolean().optional(), @@ -3681,22 +4609,25 @@ export const marshalIngressNetworkPolicy_AppsRuntimeDestinationSchema: z.ZodType })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_AuthenticationSchema: z.ZodType = z - .object({ - identityType: z.string().optional(), - identities: z - .array( - z.lazy(() => marshalIngressNetworkPolicy_AuthenticationIdentitySchema) - ) - .optional(), - }) - .transform(d => ({ - identity_type: d.identityType, - identities: d.identities, - })); +export const marshalIngressNetworkPolicy_CreateAuthenticationSchema: z.ZodType = + z + .object({ + identityType: z.string().optional(), + identities: z + .array( + z.lazy( + () => marshalIngressNetworkPolicy_CreateAuthenticationIdentitySchema + ) + ) + .optional(), + }) + .transform(d => ({ + identity_type: d.identityType, + identities: d.identities, + })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_AuthenticationIdentitySchema: z.ZodType = +export const marshalIngressNetworkPolicy_CreateAuthenticationIdentitySchema: z.ZodType = z .object({ principalType: z.string().optional(), @@ -3708,21 +4639,23 @@ export const marshalIngressNetworkPolicy_AuthenticationIdentitySchema: z.ZodType })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_CrossWorkspaceAccessSchema: z.ZodType = +export const marshalIngressNetworkPolicy_CreateCrossWorkspaceAccessSchema: z.ZodType = z .object({ restrictionMode: z.string().optional(), denyRules: z .array( z.lazy( - () => marshalIngressNetworkPolicy_CrossWorkspaceIngressRuleSchema + () => + marshalIngressNetworkPolicy_CreateCrossWorkspaceIngressRuleSchema ) ) .optional(), allowRules: z .array( z.lazy( - () => marshalIngressNetworkPolicy_CrossWorkspaceIngressRuleSchema + () => + marshalIngressNetworkPolicy_CreateCrossWorkspaceIngressRuleSchema ) ) .optional(), @@ -3734,19 +4667,20 @@ export const marshalIngressNetworkPolicy_CrossWorkspaceAccessSchema: z.ZodType = })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_CrossWorkspaceIngressRuleSchema: z.ZodType = +export const marshalIngressNetworkPolicy_CreateCrossWorkspaceIngressRuleSchema: z.ZodType = z .object({ origin: z .lazy( - () => marshalIngressNetworkPolicy_CrossWorkspaceRequestOriginSchema + () => + marshalIngressNetworkPolicy_CreateCrossWorkspaceRequestOriginSchema ) .optional(), destination: z - .lazy(() => marshalIngressNetworkPolicy_RequestDestinationSchema) + .lazy(() => marshalIngressNetworkPolicy_CreateRequestDestinationSchema) .optional(), authentication: z - .lazy(() => marshalIngressNetworkPolicy_AuthenticationSchema) + .lazy(() => marshalIngressNetworkPolicy_CreateAuthenticationSchema) .optional(), label: z.string().optional(), }) @@ -3758,7 +4692,7 @@ export const marshalIngressNetworkPolicy_CrossWorkspaceIngressRuleSchema: z.ZodT })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_CrossWorkspaceRequestOriginSchema: z.ZodType = +export const marshalIngressNetworkPolicy_CreateCrossWorkspaceRequestOriginSchema: z.ZodType = z .object({ source: z @@ -3770,7 +4704,7 @@ export const marshalIngressNetworkPolicy_CrossWorkspaceRequestOriginSchema: z.Zo z.object({ $case: z.literal('selectedWorkspaces'), selectedWorkspaces: z.lazy( - () => marshalIngressNetworkPolicy_WorkspaceIdListSchema + () => marshalIngressNetworkPolicy_CreateWorkspaceIdListSchema ), }), ]) @@ -3786,7 +4720,7 @@ export const marshalIngressNetworkPolicy_CrossWorkspaceRequestOriginSchema: z.Zo })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_EndpointsSchema: z.ZodType = z +export const marshalIngressNetworkPolicy_CreateEndpointsSchema: z.ZodType = z .object({ endpointIds: z.array(z.string()).optional(), }) @@ -3795,7 +4729,7 @@ export const marshalIngressNetworkPolicy_EndpointsSchema: z.ZodType = z })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_IpRangesSchema: z.ZodType = z +export const marshalIngressNetworkPolicy_CreateIpRangesSchema: z.ZodType = z .object({ ipRanges: z.array(z.string()).optional(), }) @@ -3804,7 +4738,7 @@ export const marshalIngressNetworkPolicy_IpRangesSchema: z.ZodType = z })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_LakebaseRuntimeDestinationSchema: z.ZodType = +export const marshalIngressNetworkPolicy_CreateLakebaseRuntimeDestinationSchema: z.ZodType = z .object({ allDestinations: z.boolean().optional(), @@ -3814,45 +4748,57 @@ export const marshalIngressNetworkPolicy_LakebaseRuntimeDestinationSchema: z.Zod })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_PrivateAccessSchema: z.ZodType = z - .object({ - restrictionMode: z.string().optional(), - denyRules: z - .array(z.lazy(() => marshalIngressNetworkPolicy_PrivateIngressRuleSchema)) - .optional(), - allowRules: z - .array(z.lazy(() => marshalIngressNetworkPolicy_PrivateIngressRuleSchema)) - .optional(), - }) - .transform(d => ({ - restriction_mode: d.restrictionMode, - deny_rules: d.denyRules, - allow_rules: d.allowRules, - })); +export const marshalIngressNetworkPolicy_CreatePrivateAccessSchema: z.ZodType = + z + .object({ + restrictionMode: z.string().optional(), + denyRules: z + .array( + z.lazy( + () => marshalIngressNetworkPolicy_CreatePrivateIngressRuleSchema + ) + ) + .optional(), + allowRules: z + .array( + z.lazy( + () => marshalIngressNetworkPolicy_CreatePrivateIngressRuleSchema + ) + ) + .optional(), + }) + .transform(d => ({ + restriction_mode: d.restrictionMode, + deny_rules: d.denyRules, + allow_rules: d.allowRules, + })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_PrivateIngressRuleSchema: z.ZodType = z - .object({ - origin: z - .lazy(() => marshalIngressNetworkPolicy_PrivateRequestOriginSchema) - .optional(), - destination: z - .lazy(() => marshalIngressNetworkPolicy_RequestDestinationSchema) - .optional(), - authentication: z - .lazy(() => marshalIngressNetworkPolicy_AuthenticationSchema) - .optional(), - label: z.string().optional(), - }) - .transform(d => ({ - origin: d.origin, - destination: d.destination, - authentication: d.authentication, - label: d.label, - })); +export const marshalIngressNetworkPolicy_CreatePrivateIngressRuleSchema: z.ZodType = + z + .object({ + origin: z + .lazy( + () => marshalIngressNetworkPolicy_CreatePrivateRequestOriginSchema + ) + .optional(), + destination: z + .lazy(() => marshalIngressNetworkPolicy_CreateRequestDestinationSchema) + .optional(), + authentication: z + .lazy(() => marshalIngressNetworkPolicy_CreateAuthenticationSchema) + .optional(), + label: z.string().optional(), + }) + .transform(d => ({ + origin: d.origin, + destination: d.destination, + authentication: d.authentication, + label: d.label, + })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_PrivateRequestOriginSchema: z.ZodType = +export const marshalIngressNetworkPolicy_CreatePrivateRequestOriginSchema: z.ZodType = z .object({ source: z @@ -3860,7 +4806,7 @@ export const marshalIngressNetworkPolicy_PrivateRequestOriginSchema: z.ZodType = z.object({ $case: z.literal('endpoints'), endpoints: z.lazy( - () => marshalIngressNetworkPolicy_EndpointsSchema + () => marshalIngressNetworkPolicy_CreateEndpointsSchema ), }), z.object({ @@ -3892,14 +4838,18 @@ export const marshalIngressNetworkPolicy_PrivateRequestOriginSchema: z.ZodType = })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_PublicAccessSchema: z.ZodType = z +export const marshalIngressNetworkPolicy_CreatePublicAccessSchema: z.ZodType = z .object({ restrictionMode: z.string().optional(), denyRules: z - .array(z.lazy(() => marshalIngressNetworkPolicy_PublicIngressRuleSchema)) + .array( + z.lazy(() => marshalIngressNetworkPolicy_CreatePublicIngressRuleSchema) + ) .optional(), allowRules: z - .array(z.lazy(() => marshalIngressNetworkPolicy_PublicIngressRuleSchema)) + .array( + z.lazy(() => marshalIngressNetworkPolicy_CreatePublicIngressRuleSchema) + ) .optional(), }) .transform(d => ({ @@ -3909,28 +4859,29 @@ export const marshalIngressNetworkPolicy_PublicAccessSchema: z.ZodType = z })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_PublicIngressRuleSchema: z.ZodType = z - .object({ - origin: z - .lazy(() => marshalIngressNetworkPolicy_PublicRequestOriginSchema) - .optional(), - destination: z - .lazy(() => marshalIngressNetworkPolicy_RequestDestinationSchema) - .optional(), - authentication: z - .lazy(() => marshalIngressNetworkPolicy_AuthenticationSchema) - .optional(), - label: z.string().optional(), - }) - .transform(d => ({ - origin: d.origin, - destination: d.destination, - authentication: d.authentication, - label: d.label, - })); +export const marshalIngressNetworkPolicy_CreatePublicIngressRuleSchema: z.ZodType = + z + .object({ + origin: z + .lazy(() => marshalIngressNetworkPolicy_CreatePublicRequestOriginSchema) + .optional(), + destination: z + .lazy(() => marshalIngressNetworkPolicy_CreateRequestDestinationSchema) + .optional(), + authentication: z + .lazy(() => marshalIngressNetworkPolicy_CreateAuthenticationSchema) + .optional(), + label: z.string().optional(), + }) + .transform(d => ({ + origin: d.origin, + destination: d.destination, + authentication: d.authentication, + label: d.label, + })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_PublicRequestOriginSchema: z.ZodType = +export const marshalIngressNetworkPolicy_CreatePublicRequestOriginSchema: z.ZodType = z .object({ source: z @@ -3939,13 +4890,13 @@ export const marshalIngressNetworkPolicy_PublicRequestOriginSchema: z.ZodType = z.object({ $case: z.literal('includedIpRanges'), includedIpRanges: z.lazy( - () => marshalIngressNetworkPolicy_IpRangesSchema + () => marshalIngressNetworkPolicy_CreateIpRangesSchema ), }), z.object({ $case: z.literal('excludedIpRanges'), excludedIpRanges: z.lazy( - () => marshalIngressNetworkPolicy_IpRangesSchema + () => marshalIngressNetworkPolicy_CreateIpRangesSchema ), }), ]) @@ -3964,155 +4915,105 @@ export const marshalIngressNetworkPolicy_PublicRequestOriginSchema: z.ZodType = })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_RequestDestinationSchema: z.ZodType = z - .object({ - allDestinations: z.boolean().optional(), - workspaceUi: z - .lazy(() => marshalIngressNetworkPolicy_WorkspaceUiDestinationSchema) - .optional(), - workspaceApi: z - .lazy(() => marshalIngressNetworkPolicy_WorkspaceApiDestinationSchema) - .optional(), - appsRuntime: z - .lazy(() => marshalIngressNetworkPolicy_AppsRuntimeDestinationSchema) - .optional(), - lakebaseRuntime: z - .lazy(() => marshalIngressNetworkPolicy_LakebaseRuntimeDestinationSchema) - .optional(), - accountUi: z - .lazy(() => marshalIngressNetworkPolicy_AccountUiDestinationSchema) - .optional(), - accountApi: z - .lazy(() => marshalIngressNetworkPolicy_AccountApiDestinationSchema) - .optional(), - accountDatabricksOne: z - .lazy( - () => marshalIngressNetworkPolicy_AccountDatabricksOneDestinationSchema - ) - .optional(), - }) - .transform(d => ({ - all_destinations: d.allDestinations, - workspace_ui: d.workspaceUi, - workspace_api: d.workspaceApi, - apps_runtime: d.appsRuntime, - lakebase_runtime: d.lakebaseRuntime, - account_ui: d.accountUi, - account_api: d.accountApi, - account_databricks_one: d.accountDatabricksOne, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_WorkspaceApiDestinationSchema: z.ZodType = +export const marshalIngressNetworkPolicy_CreateRequestDestinationSchema: z.ZodType = z .object({ - scopes: z.array(z.string()).optional(), - scopeQualifier: z.string().optional(), + allDestinations: z.boolean().optional(), + workspaceUi: z + .lazy( + () => marshalIngressNetworkPolicy_CreateWorkspaceUiDestinationSchema + ) + .optional(), + workspaceApi: z + .lazy( + () => marshalIngressNetworkPolicy_CreateWorkspaceApiDestinationSchema + ) + .optional(), + appsRuntime: z + .lazy( + () => marshalIngressNetworkPolicy_CreateAppsRuntimeDestinationSchema + ) + .optional(), + lakebaseRuntime: z + .lazy( + () => + marshalIngressNetworkPolicy_CreateLakebaseRuntimeDestinationSchema + ) + .optional(), + accountUi: z + .lazy( + () => marshalIngressNetworkPolicy_CreateAccountUiDestinationSchema + ) + .optional(), + accountApi: z + .lazy( + () => marshalIngressNetworkPolicy_CreateAccountApiDestinationSchema + ) + .optional(), + accountDatabricksOne: z + .lazy( + () => + marshalIngressNetworkPolicy_CreateAccountDatabricksOneDestinationSchema + ) + .optional(), }) .transform(d => ({ - scopes: d.scopes, - scope_qualifier: d.scopeQualifier, + all_destinations: d.allDestinations, + workspace_ui: d.workspaceUi, + workspace_api: d.workspaceApi, + apps_runtime: d.appsRuntime, + lakebase_runtime: d.lakebaseRuntime, + account_ui: d.accountUi, + account_api: d.accountApi, + account_databricks_one: d.accountDatabricksOne, })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_WorkspaceIdListSchema: z.ZodType = z - .object({ - workspaceIds: z.array(z.bigint()).optional(), - }) - .transform(d => ({ - workspace_ids: d.workspaceIds, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngressNetworkPolicy_WorkspaceUiDestinationSchema: z.ZodType = +export const marshalIngressNetworkPolicy_CreateWorkspaceApiDestinationSchema: z.ZodType = z .object({ - allDestinations: z.boolean().optional(), + scopes: z.array(z.string()).optional(), + scopeQualifier: z.string().optional(), }) .transform(d => ({ - all_destinations: d.allDestinations, + scopes: d.scopes, + scope_qualifier: d.scopeQualifier, })); -export const marshalNetworkConnectivityConfigAwsPrivateEndpointRuleSchema: z.ZodType = +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalIngressNetworkPolicy_CreateWorkspaceIdListSchema: z.ZodType = z .object({ - ruleId: z.string().optional(), - networkConnectivityConfigId: z.string().optional(), - accountId: z.string().optional(), - endpointService: z.string().optional(), - domainNames: z.array(z.string()).optional(), - resourceNames: z.array(z.string()).optional(), - vpcEndpointId: z.string().optional(), - connectionState: z.string().optional(), - creationTime: z.bigint().optional(), - updatedTime: z.bigint().optional(), - deactivated: z.boolean().optional(), - deactivatedAt: z.bigint().optional(), - enabled: z.boolean().optional(), - errorMessage: z.string().optional(), + workspaceIds: z.array(z.bigint()).optional(), }) .transform(d => ({ - rule_id: d.ruleId, - network_connectivity_config_id: d.networkConnectivityConfigId, - account_id: d.accountId, - endpoint_service: d.endpointService, - domain_names: d.domainNames, - resource_names: d.resourceNames, - vpc_endpoint_id: d.vpcEndpointId, - connection_state: d.connectionState, - creation_time: d.creationTime, - updated_time: d.updatedTime, - deactivated: d.deactivated, - deactivated_at: d.deactivatedAt, - enabled: d.enabled, - error_message: d.errorMessage, + workspace_ids: d.workspaceIds, })); -export const marshalNetworkConnectivityConfigAzurePrivateEndpointRuleSchema: z.ZodType = +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalIngressNetworkPolicy_CreateWorkspaceUiDestinationSchema: z.ZodType = z .object({ - ruleId: z.string().optional(), - networkConnectivityConfigId: z.string().optional(), - resourceId: z.string().optional(), - groupId: z.string().optional(), - endpointName: z.string().optional(), - connectionState: z.string().optional(), - creationTime: z.bigint().optional(), - updatedTime: z.bigint().optional(), - deactivated: z.boolean().optional(), - deactivatedAt: z.bigint().optional(), - domainNames: z.array(z.string()).optional(), - errorMessage: z.string().optional(), + allDestinations: z.boolean().optional(), }) .transform(d => ({ - rule_id: d.ruleId, - network_connectivity_config_id: d.networkConnectivityConfigId, - resource_id: d.resourceId, - group_id: d.groupId, - endpoint_name: d.endpointName, - connection_state: d.connectionState, - creation_time: d.creationTime, - updated_time: d.updatedTime, - deactivated: d.deactivated, - deactivated_at: d.deactivatedAt, - domain_names: d.domainNames, - error_message: d.errorMessage, + all_destinations: d.allDestinations, })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalNetworkConnectivityConfigEgressConfig_DefaultRuleSchema: z.ZodType = +export const marshalNetworkConnectivityConfigEgressConfig_CreateDefaultRuleSchema: z.ZodType = z .object({ azureServiceEndpointRule: z .lazy( () => - marshalNetworkConnectivityConfigEgressConfig_DefaultRule_AzureServiceEndpointRuleSchema + marshalNetworkConnectivityConfigEgressConfig_DefaultRule_CreateAzureServiceEndpointRuleSchema ) .optional(), awsStableIpRule: z .lazy( () => - marshalNetworkConnectivityConfigEgressConfig_DefaultRule_AwsStableIpRuleSchema + marshalNetworkConnectivityConfigEgressConfig_DefaultRule_CreateAwsStableIpRuleSchema ) .optional(), }) @@ -4122,7 +5023,7 @@ export const marshalNetworkConnectivityConfigEgressConfig_DefaultRuleSchema: z.Z })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalNetworkConnectivityConfigEgressConfig_DefaultRule_AwsStableIpRuleSchema: z.ZodType = +export const marshalNetworkConnectivityConfigEgressConfig_DefaultRule_CreateAwsStableIpRuleSchema: z.ZodType = z .object({ cidrBlocks: z.array(z.string()).optional(), @@ -4132,7 +5033,7 @@ export const marshalNetworkConnectivityConfigEgressConfig_DefaultRule_AwsStableI })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalNetworkConnectivityConfigEgressConfig_DefaultRule_AzureServiceEndpointRuleSchema: z.ZodType = +export const marshalNetworkConnectivityConfigEgressConfig_DefaultRule_CreateAzureServiceEndpointRuleSchema: z.ZodType = z .object({ targetRegion: z.string().optional(), @@ -4145,36 +5046,6 @@ export const marshalNetworkConnectivityConfigEgressConfig_DefaultRule_AzureServi subnets: d.subnets, })); -export const marshalNetworkVpcEndpointsSchema: z.ZodType = z - .object({ - restApi: z.array(z.string()).optional(), - dataplaneRelay: z.array(z.string()).optional(), - }) - .transform(d => ({ - rest_api: d.restApi, - dataplane_relay: d.dataplaneRelay, - })); - -export const marshalPrivateAccessSettingsSchema: z.ZodType = z - .object({ - privateAccessSettingsId: z.string().optional(), - accountId: z.string().optional(), - privateAccessSettingsName: z.string().optional(), - region: z.string().optional(), - publicAccessEnabled: z.boolean().optional(), - privateAccessLevel: z.string().optional(), - allowedVpcEndpointIds: z.array(z.string()).optional(), - }) - .transform(d => ({ - private_access_settings_id: d.privateAccessSettingsId, - account_id: d.accountId, - private_access_settings_name: d.privateAccessSettingsName, - region: d.region, - public_access_enabled: d.publicAccessEnabled, - private_access_level: d.privateAccessLevel, - allowed_vpc_endpoint_ids: d.allowedVpcEndpointIds, - })); - export const marshalReplaceAccountIpAccessListRequestSchema: z.ZodType = z .object({ accountId: z.string().optional(), @@ -4227,6 +5098,23 @@ export const marshalUpdateAccountIpAccessListRequestSchema: z.ZodType = z enabled: d.enabled, })); +export const marshalUpdateGcpEndpointSchema: z.ZodType = z + .object({ + targetServices: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('serviceAttachment'), + serviceAttachment: z.string(), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.targetServices?.$case === 'serviceAttachment' && { + service_attachment: d.targetServices.serviceAttachment, + }), + })); + export const marshalUpdateIpAccessListRequestSchema: z.ZodType = z .object({ listId: z.string().optional(), @@ -4243,7 +5131,7 @@ export const marshalUpdateIpAccessListRequestSchema: z.ZodType = z enabled: d.enabled, })); -export const marshalUpdatePrivateEndpointRuleSchema: z.ZodType = z +export const marshalUpdateUpdatePrivateEndpointRuleSchema: z.ZodType = z .object({ ruleId: z.string().optional(), networkConnectivityConfigId: z.string().optional(), @@ -4266,7 +5154,7 @@ export const marshalUpdatePrivateEndpointRuleSchema: z.ZodType = z .discriminatedUnion('$case', [ z.object({ $case: z.literal('gcpEndpoint'), - gcpEndpoint: z.lazy(() => marshalGcpEndpointSchema), + gcpEndpoint: z.lazy(() => marshalUpdateGcpEndpointSchema), }), ]) .optional(), @@ -4294,22 +5182,11 @@ export const marshalUpdatePrivateEndpointRuleSchema: z.ZodType = z }), })); -export const marshalWorkspaceNetworkOptionSchema: z.ZodType = z - .object({ - networkPolicyId: z.string().optional(), - workspaceId: z.bigint().optional(), - }) - .transform(d => ({ - network_policy_id: d.networkPolicyId, - workspace_id: d.workspaceId, - })); - -const gcpEndpointFieldMaskSchema: FieldMaskSchema = { - pscEndpointUri: {wire: 'psc_endpoint_uri'}, +const updateGcpEndpointFieldMaskSchema: FieldMaskSchema = { serviceAttachment: {wire: 'service_attachment'}, }; -const updatePrivateEndpointRuleFieldMaskSchema: FieldMaskSchema = { +const updateUpdatePrivateEndpointRuleFieldMaskSchema: FieldMaskSchema = { accountId: {wire: 'account_id'}, connectionState: {wire: 'connection_state'}, creationTime: {wire: 'creation_time'}, @@ -4322,7 +5199,7 @@ const updatePrivateEndpointRuleFieldMaskSchema: FieldMaskSchema = { errorMessage: {wire: 'error_message'}, gcpEndpoint: { wire: 'gcp_endpoint', - children: () => gcpEndpointFieldMaskSchema, + children: () => updateGcpEndpointFieldMaskSchema, }, groupId: {wire: 'group_id'}, networkConnectivityConfigId: {wire: 'network_connectivity_config_id'}, @@ -4333,11 +5210,11 @@ const updatePrivateEndpointRuleFieldMaskSchema: FieldMaskSchema = { vpcEndpointId: {wire: 'vpc_endpoint_id'}, }; -export function updatePrivateEndpointRuleFieldMask( +export function updateUpdatePrivateEndpointRuleFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - updatePrivateEndpointRuleFieldMaskSchema + updateUpdatePrivateEndpointRuleFieldMaskSchema ); } diff --git a/packages/notificationdestinations/src/v1/index.ts b/packages/notificationdestinations/src/v1/index.ts index 32f3297a..98879cb8 100755 --- a/packages/notificationdestinations/src/v1/index.ts +++ b/packages/notificationdestinations/src/v1/index.ts @@ -10,7 +10,13 @@ export {DestinationType} from './model'; export type { Config, + CreateConfig, + CreateEmailConfig, + CreateGenericWebhookConfig, + CreateMicrosoftTeamsConfig, CreateNotificationDestinationRequest, + CreatePagerdutyConfig, + CreateSlackConfig, DeleteNotificationDestinationRequest, EmailConfig, Empty, diff --git a/packages/notificationdestinations/src/v1/model.ts b/packages/notificationdestinations/src/v1/model.ts index ae9c343a..9df3491b 100644 --- a/packages/notificationdestinations/src/v1/model.ts +++ b/packages/notificationdestinations/src/v1/model.ts @@ -24,11 +24,86 @@ export interface Config { | undefined; } +export interface CreateConfig { + config?: + | {$case: 'slack'; slack: CreateSlackConfig} + | {$case: 'email'; email: CreateEmailConfig} + | {$case: 'genericWebhook'; genericWebhook: CreateGenericWebhookConfig} + | {$case: 'pagerduty'; pagerduty: CreatePagerdutyConfig} + | {$case: 'microsoftTeams'; microsoftTeams: CreateMicrosoftTeamsConfig} + | undefined; +} + +export interface CreateEmailConfig { + /** Email addresses to notify. */ + addresses?: string[] | undefined; +} + +export interface CreateGenericWebhookConfig { + /** [Input-Only] URL for webhook. */ + url?: string | undefined; + /** [Output-Only] Whether URL is set. */ + urlSet?: boolean | undefined; + /** [Input-Only][Optional] Username for webhook. */ + username?: string | undefined; + /** [Output-Only] Whether username is set. */ + usernameSet?: boolean | undefined; + /** [Input-Only][Optional] Password for webhook. */ + password?: string | undefined; + /** [Output-Only] Whether password is set. */ + passwordSet?: boolean | undefined; +} + +export interface CreateMicrosoftTeamsConfig { + /** [Input-Only] URL for Microsoft Teams webhook. */ + url?: string | undefined; + /** [Output-Only] Whether URL is set. */ + urlSet?: boolean | undefined; + /** [Input-Only] App ID for Microsoft Teams App. */ + appId?: string | undefined; + /** [Output-Only] Whether App ID is set. */ + appIdSet?: boolean | undefined; + /** [Input-Only] Secret for Microsoft Teams App authentication. */ + authSecret?: string | undefined; + /** [Output-Only] Whether secret is set. */ + authSecretSet?: boolean | undefined; + /** [Input-Only] Channel URL for Microsoft Teams App. */ + channelUrl?: string | undefined; + /** [Output-Only] Whether Channel URL is set. */ + channelUrlSet?: boolean | undefined; + /** [Input-Only] Tenant ID for Microsoft Teams App. */ + tenantId?: string | undefined; + /** [Output-Only] Whether Tenant ID is set. */ + tenantIdSet?: boolean | undefined; +} + export interface CreateNotificationDestinationRequest { /** The display name for the notification destination. */ displayName?: string | undefined; /** The configuration for the notification destination. Must wrap EXACTLY one of the nested configs. */ - config?: Config | undefined; + config?: CreateConfig | undefined; +} + +export interface CreatePagerdutyConfig { + /** [Input-Only] Integration key for PagerDuty. */ + integrationKey?: string | undefined; + /** [Output-Only] Whether integration key is set. */ + integrationKeySet?: boolean | undefined; +} + +export interface CreateSlackConfig { + /** [Input-Only] URL for Slack destination. */ + url?: string | undefined; + /** [Output-Only] Whether URL is set. */ + urlSet?: boolean | undefined; + /** [Input-Only] OAuth token for Slack authentication. */ + oauthToken?: string | undefined; + /** [Output-Only] Whether OAuth token is set. */ + oauthTokenSet?: boolean | undefined; + /** [Input-Only] Slack channel ID for notifications. */ + channelId?: string | undefined; + /** [Output-Only] Whether channel ID is set. */ + channelIdSet?: boolean | undefined; } export interface DeleteNotificationDestinationRequest { @@ -146,7 +221,7 @@ export interface UpdateNotificationDestinationRequest { /** The display name for the notification destination. */ displayName?: string | undefined; /** The configuration for the notification destination. Must wrap EXACTLY one of the nested configs. */ - config?: Config | undefined; + config?: CreateConfig | undefined; } export const unmarshalConfigSchema: z.ZodType = z @@ -309,29 +384,29 @@ export const unmarshalSlackConfigSchema: z.ZodType = z channelIdSet: d.channel_id_set, })); -export const marshalConfigSchema: z.ZodType = z +export const marshalCreateConfigSchema: z.ZodType = z .object({ config: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('slack'), - slack: z.lazy(() => marshalSlackConfigSchema), + slack: z.lazy(() => marshalCreateSlackConfigSchema), }), z.object({ $case: z.literal('email'), - email: z.lazy(() => marshalEmailConfigSchema), + email: z.lazy(() => marshalCreateEmailConfigSchema), }), z.object({ $case: z.literal('genericWebhook'), - genericWebhook: z.lazy(() => marshalGenericWebhookConfigSchema), + genericWebhook: z.lazy(() => marshalCreateGenericWebhookConfigSchema), }), z.object({ $case: z.literal('pagerduty'), - pagerduty: z.lazy(() => marshalPagerdutyConfigSchema), + pagerduty: z.lazy(() => marshalCreatePagerdutyConfigSchema), }), z.object({ $case: z.literal('microsoftTeams'), - microsoftTeams: z.lazy(() => marshalMicrosoftTeamsConfigSchema), + microsoftTeams: z.lazy(() => marshalCreateMicrosoftTeamsConfigSchema), }), ]) .optional(), @@ -348,17 +423,7 @@ export const marshalConfigSchema: z.ZodType = z }), })); -export const marshalCreateNotificationDestinationRequestSchema: z.ZodType = z - .object({ - displayName: z.string().optional(), - config: z.lazy(() => marshalConfigSchema).optional(), - }) - .transform(d => ({ - display_name: d.displayName, - config: d.config, - })); - -export const marshalEmailConfigSchema: z.ZodType = z +export const marshalCreateEmailConfigSchema: z.ZodType = z .object({ addresses: z.array(z.string()).optional(), }) @@ -366,7 +431,7 @@ export const marshalEmailConfigSchema: z.ZodType = z addresses: d.addresses, })); -export const marshalGenericWebhookConfigSchema: z.ZodType = z +export const marshalCreateGenericWebhookConfigSchema: z.ZodType = z .object({ url: z.string().optional(), urlSet: z.boolean().optional(), @@ -384,7 +449,7 @@ export const marshalGenericWebhookConfigSchema: z.ZodType = z password_set: d.passwordSet, })); -export const marshalMicrosoftTeamsConfigSchema: z.ZodType = z +export const marshalCreateMicrosoftTeamsConfigSchema: z.ZodType = z .object({ url: z.string().optional(), urlSet: z.boolean().optional(), @@ -410,7 +475,17 @@ export const marshalMicrosoftTeamsConfigSchema: z.ZodType = z tenant_id_set: d.tenantIdSet, })); -export const marshalPagerdutyConfigSchema: z.ZodType = z +export const marshalCreateNotificationDestinationRequestSchema: z.ZodType = z + .object({ + displayName: z.string().optional(), + config: z.lazy(() => marshalCreateConfigSchema).optional(), + }) + .transform(d => ({ + display_name: d.displayName, + config: d.config, + })); + +export const marshalCreatePagerdutyConfigSchema: z.ZodType = z .object({ integrationKey: z.string().optional(), integrationKeySet: z.boolean().optional(), @@ -420,7 +495,7 @@ export const marshalPagerdutyConfigSchema: z.ZodType = z integration_key_set: d.integrationKeySet, })); -export const marshalSlackConfigSchema: z.ZodType = z +export const marshalCreateSlackConfigSchema: z.ZodType = z .object({ url: z.string().optional(), urlSet: z.boolean().optional(), @@ -442,7 +517,7 @@ export const marshalUpdateNotificationDestinationRequestSchema: z.ZodType = z .object({ id: z.string().optional(), displayName: z.string().optional(), - config: z.lazy(() => marshalConfigSchema).optional(), + config: z.lazy(() => marshalCreateConfigSchema).optional(), }) .transform(d => ({ id: d.id, diff --git a/packages/oauth/src/v1/index.ts b/packages/oauth/src/v1/index.ts index b51c3680..57e4e59b 100755 --- a/packages/oauth/src/v1/index.ts +++ b/packages/oauth/src/v1/index.ts @@ -10,6 +10,7 @@ export type { CreateCustomOAuthAppIntegrationRequest, CreatePublishedOAuthAppIntegrationRequest, CreatePublishedOAuthAppIntegrationResponse, + CreateTokenAccessPolicy, CustomOAuthAppIntegration, CustomOAuthAppIntegrationSecret, DeleteCustomOAuthAppIntegrationRequest, diff --git a/packages/oauth/src/v1/model.ts b/packages/oauth/src/v1/model.ts index dc972b79..42bb3e27 100755 --- a/packages/oauth/src/v1/model.ts +++ b/packages/oauth/src/v1/model.ts @@ -11,7 +11,7 @@ export interface CreateCustomOAuthAppIntegrationRequest { /** This field indicates whether an OAuth client secret is required to authenticate this client. */ confidential?: boolean | undefined; /** Token access policy */ - tokenAccessPolicy?: TokenAccessPolicy | undefined; + tokenAccessPolicy?: CreateTokenAccessPolicy | undefined; /** * OAuth scopes granted to the application. * Supported scopes: all-apis, sql, offline_access, openid, profile, email. @@ -33,7 +33,7 @@ export interface CreatePublishedOAuthAppIntegrationRequest { */ appId?: string | undefined; /** Token access policy */ - tokenAccessPolicy?: TokenAccessPolicy | undefined; + tokenAccessPolicy?: CreateTokenAccessPolicy | undefined; } export interface CreatePublishedOAuthAppIntegrationResponse { @@ -41,6 +41,31 @@ export interface CreatePublishedOAuthAppIntegrationResponse { integrationId?: string | undefined; } +export interface CreateTokenAccessPolicy { + /** access token time to live in minutes */ + accessTokenTtlInMinutes?: number | undefined; + /** + * Refresh token time to live in minutes. + * When single-use refresh tokens are enabled, this represents the TTL of an individual refresh token. + * If the refresh token is used before it expires, a new one is issued with a renewed individual TTL. + */ + refreshTokenTtlInMinutes?: number | undefined; + /** + * Whether to enable single-use refresh tokens (refresh token rotation). + * If this feature is enabled, upon successfully getting a new access token using a refresh token, will + * issue a new refresh token along with the access token in the response and invalidate the old refresh token. + * The client should use the new refresh token to get access tokens in future requests. + */ + enableSingleUseRefreshTokens?: boolean | undefined; + /** + * Absolute OAuth session TTL in minutes. Effective only when the single-use refresh token feature is enabled. + * This is the absolute TTL of all refresh tokens issued in one OAuth session. When a new refresh token is issued + * during refresh token rotation, it will inherit the same absolute TTL as the old refresh token. + * In other words, this represents the maximum amount of time a user can stay logged in without re-authenticating. + */ + absoluteSessionLifetimeInMinutes?: number | undefined; +} + export interface CustomOAuthAppIntegration { /** ID of this custom app */ integrationId?: string | undefined; @@ -208,7 +233,7 @@ export interface UpdateCustomOAuthAppIntegrationRequest { /** List of OAuth redirect urls to be updated in the custom OAuth app integration */ redirectUrls?: string[] | undefined; /** Token access policy to be updated in the custom OAuth app integration */ - tokenAccessPolicy?: TokenAccessPolicy | undefined; + tokenAccessPolicy?: CreateTokenAccessPolicy | undefined; /** * List of OAuth scopes to be updated in the custom OAuth app integration, similar to redirect URIs this will fully * replace the existing values instead of appending @@ -229,7 +254,7 @@ export interface UpdatePublishedOAuthAppIntegrationRequest { accountId?: string | undefined; integrationId?: string | undefined; /** Token access policy to be updated in the published OAuth app integration */ - tokenAccessPolicy?: TokenAccessPolicy | undefined; + tokenAccessPolicy?: CreateTokenAccessPolicy | undefined; } // eslint-disable-next-line @typescript-eslint/no-empty-object-type @@ -404,7 +429,9 @@ export const marshalCreateCustomOAuthAppIntegrationRequestSchema: z.ZodType = z redirectUrls: z.array(z.string()).optional(), name: z.string().optional(), confidential: z.boolean().optional(), - tokenAccessPolicy: z.lazy(() => marshalTokenAccessPolicySchema).optional(), + tokenAccessPolicy: z + .lazy(() => marshalCreateTokenAccessPolicySchema) + .optional(), scopes: z.array(z.string()).optional(), userAuthorizedScopes: z.array(z.string()).optional(), }) @@ -424,7 +451,7 @@ export const marshalCreatePublishedOAuthAppIntegrationRequestSchema: z.ZodType = accountId: z.string().optional(), appId: z.string().optional(), tokenAccessPolicy: z - .lazy(() => marshalTokenAccessPolicySchema) + .lazy(() => marshalCreateTokenAccessPolicySchema) .optional(), }) .transform(d => ({ @@ -433,7 +460,7 @@ export const marshalCreatePublishedOAuthAppIntegrationRequestSchema: z.ZodType = token_access_policy: d.tokenAccessPolicy, })); -export const marshalTokenAccessPolicySchema: z.ZodType = z +export const marshalCreateTokenAccessPolicySchema: z.ZodType = z .object({ accessTokenTtlInMinutes: z.number().optional(), refreshTokenTtlInMinutes: z.number().optional(), @@ -452,7 +479,9 @@ export const marshalUpdateCustomOAuthAppIntegrationRequestSchema: z.ZodType = z accountId: z.string().optional(), integrationId: z.string().optional(), redirectUrls: z.array(z.string()).optional(), - tokenAccessPolicy: z.lazy(() => marshalTokenAccessPolicySchema).optional(), + tokenAccessPolicy: z + .lazy(() => marshalCreateTokenAccessPolicySchema) + .optional(), scopes: z.array(z.string()).optional(), userAuthorizedScopes: z.array(z.string()).optional(), }) @@ -471,7 +500,7 @@ export const marshalUpdatePublishedOAuthAppIntegrationRequestSchema: z.ZodType = accountId: z.string().optional(), integrationId: z.string().optional(), tokenAccessPolicy: z - .lazy(() => marshalTokenAccessPolicySchema) + .lazy(() => marshalCreateTokenAccessPolicySchema) .optional(), }) .transform(d => ({ diff --git a/packages/pipelines/src/v2/index.ts b/packages/pipelines/src/v2/index.ts index 8c139500..c28bfdd2 100755 --- a/packages/pipelines/src/v2/index.ts +++ b/packages/pipelines/src/v2/index.ts @@ -44,8 +44,61 @@ export type { ConfluenceConnectorOptions, ConnectionParameters, ConnectorOptions, + CreateAutoFullRefreshPolicy, + CreateConfluenceConnectorOptions, + CreateConnectionParameters, + CreateConnectorOptions, + CreateCronTrigger, + CreateDataStagingOptions, + CreateEventLogSpec, + CreateFileFilter, + CreateFileIngestionOptions, + CreateFilters, + CreateGoogleAdsConfig, + CreateGoogleAdsOptions, + CreateGoogleDriveOptions, + CreateIngestionGatewayPipelineDefinition, + CreateIngestionPipelineDefinition, + CreateJiraConnectorOptions, + CreateJsonTransformerOptions, + CreateKafkaOptions, + CreateManualTrigger, + CreateMetaMarketingOptions, + CreateNotebookLibrary, + CreateNotifications, + CreateOperationTimeWindow, + CreateOutlookOptions, + CreatePathPattern, + CreatePipelineCluster, + CreatePipelineDeployment, + CreatePipelineLibrary, CreatePipelineRequest, CreatePipelineResponse, + CreatePipelineTrigger, + CreatePipelinesAutoScale, + CreatePipelinesAwsAttributes, + CreatePipelinesAzureAttributes, + CreatePipelinesClusterLogConf, + CreatePipelinesDbfsStorageInfo, + CreatePipelinesEnvironment, + CreatePipelinesGcpAttributes, + CreatePipelinesInitScriptInfo, + CreatePipelinesJobRunAs, + CreatePipelinesMavenLibrary, + CreatePipelinesS3StorageInfo, + CreatePostgresCatalogConfig, + CreatePostgresSlotConfig, + CreateReplaceWhereOverride, + CreateRestartWindow, + CreateRewindDatasetSpec, + CreateRewindSpec, + CreateSharepointOptions, + CreateSmartsheetOptions, + CreateSourceCatalogConfig, + CreateSourceConfig, + CreateTikTokAdsOptions, + CreateTransformer, + CreateZendeskSupportOptions, CronTrigger, DataPlaneId, DataStagingOptions, @@ -67,13 +120,21 @@ export type { GoogleDriveOptions, IngestionGatewayPipelineDefinition, IngestionPipelineDefinition, + IngestionPipelineDefinition_CreateIngestionConfig, + IngestionPipelineDefinition_CreateReportSpec, + IngestionPipelineDefinition_CreateSchemaSpec, + IngestionPipelineDefinition_CreateTableSpec, + IngestionPipelineDefinition_CreateTableSpecificConfig, + IngestionPipelineDefinition_CreateWorkdayReportParameters, IngestionPipelineDefinition_IngestionConfig, IngestionPipelineDefinition_ReportSpec, IngestionPipelineDefinition_SchemaSpec, IngestionPipelineDefinition_TableSpec, IngestionPipelineDefinition_TableSpecificConfig, + IngestionPipelineDefinition_TableSpecificConfig_CreateQueryBasedConnectorConfig, IngestionPipelineDefinition_TableSpecificConfig_QueryBasedConnectorConfig, IngestionPipelineDefinition_WorkdayReportParameters, + IngestionPipelineDefinition_WorkdayReportParameters_CreateQueryKeyValue, IngestionPipelineDefinition_WorkdayReportParameters_QueryKeyValue, JiraConnectorOptions, JsonTransformerOptions, diff --git a/packages/pipelines/src/v2/model.ts b/packages/pipelines/src/v2/model.ts index fe343310..dda33952 100755 --- a/packages/pipelines/src/v2/model.ts +++ b/packages/pipelines/src/v2/model.ts @@ -457,21 +457,21 @@ export interface ClonePipelineRequest { /** String-String configuration for this pipeline execution. */ configuration?: Record | undefined; /** Cluster settings for this pipeline deployment. */ - clusters?: PipelineCluster[] | undefined; + clusters?: CreatePipelineCluster[] | undefined; /** Libraries or code needed by this deployment. */ - libraries?: PipelineLibrary[] | undefined; + libraries?: CreatePipelineLibrary[] | undefined; /** The configuration for a managed ingestion pipeline. These settings cannot be used with the 'libraries', 'schema', 'target', or 'catalog' settings. */ - ingestionDefinition?: IngestionPipelineDefinition | undefined; + ingestionDefinition?: CreateIngestionPipelineDefinition | undefined; /** The definition of a gateway pipeline to support change data capture. */ - gatewayDefinition?: IngestionGatewayPipelineDefinition | undefined; + gatewayDefinition?: CreateIngestionGatewayPipelineDefinition | undefined; /** Which pipeline trigger to use. Deprecated: Use `continuous` instead. */ - trigger?: PipelineTrigger | undefined; + trigger?: CreatePipelineTrigger | undefined; /** Target schema (database) to add tables in this pipeline to. Exactly one of `schema` or `target` must be specified. To publish to Unity Catalog, also specify `catalog`. This legacy field is deprecated for pipeline creation in favor of the `schema` field. */ target?: string | undefined; /** The default schema (database) where tables are read from or published to. */ schema?: string | undefined; /** Filters on which Pipeline packages to include in the deployed graph. */ - filters?: Filters | undefined; + filters?: CreateFilters | undefined; /** Whether the pipeline is continuous or triggered. This replaces `trigger`. */ continuous?: boolean | undefined; /** Whether the pipeline is in Development mode. Defaults to false. */ @@ -485,13 +485,13 @@ export interface ClonePipelineRequest { /** A catalog in Unity Catalog to publish data from this pipeline to. If `target` is specified, tables in this pipeline are published to a `target` schema inside `catalog` (for example, `catalog`.`target`.`table`). If `target` is not specified, no data is published to Unity Catalog. */ catalog?: string | undefined; /** List of notification settings for this pipeline. */ - notifications?: Notifications[] | undefined; + notifications?: CreateNotifications[] | undefined; /** Whether serverless compute is enabled for this pipeline. */ serverless?: boolean | undefined; /** Deployment type of this pipeline. */ - deployment?: PipelineDeployment | undefined; + deployment?: CreatePipelineDeployment | undefined; /** Restart window of this pipeline. */ - restartWindow?: RestartWindow | undefined; + restartWindow?: CreateRestartWindow | undefined; /** Budget policy of this pipeline. */ budgetPolicyId?: string | undefined; /** @@ -501,7 +501,7 @@ export interface ClonePipelineRequest { */ tags?: Record | undefined; /** Event log configuration for this pipeline */ - eventLog?: EventLogSpec | undefined; + eventLog?: CreateEventLogSpec | undefined; /** * Root path for this pipeline. * This is used as the root directory when editing the pipeline in the user interface and it is @@ -509,7 +509,7 @@ export interface ClonePipelineRequest { */ rootPath?: string | undefined; /** Environment specification for this pipeline used to install dependencies. */ - environment?: PipelinesEnvironment | undefined; + environment?: CreatePipelinesEnvironment | undefined; /** Usage policy of this pipeline. */ usagePolicyId?: string | undefined; /** Serverless compute ID specified by the user for serverless pipelines. */ @@ -562,109 +562,68 @@ export interface ConnectorOptions { | undefined; } -export interface CreatePipelineRequest { - /** If false, deployment will fail if name conflicts with that of another pipeline. */ - allowDuplicateNames?: boolean | undefined; - dryRun?: boolean | undefined; - runAs?: PipelinesJobRunAs | undefined; - /** - * Key/value map of default parameters to use for pipeline execution. - * Maximum total size: 10k characters (JSON format) - */ - parameters?: Record | undefined; - /** Unique identifier for this pipeline. */ - id?: string | undefined; - /** Friendly identifier for this pipeline. */ - name?: string | undefined; - /** DBFS root directory for storing checkpoints and tables. */ - storage?: string | undefined; - /** String-String configuration for this pipeline execution. */ - configuration?: Record | undefined; - /** Cluster settings for this pipeline deployment. */ - clusters?: PipelineCluster[] | undefined; - /** Libraries or code needed by this deployment. */ - libraries?: PipelineLibrary[] | undefined; - /** The configuration for a managed ingestion pipeline. These settings cannot be used with the 'libraries', 'schema', 'target', or 'catalog' settings. */ - ingestionDefinition?: IngestionPipelineDefinition | undefined; - /** The definition of a gateway pipeline to support change data capture. */ - gatewayDefinition?: IngestionGatewayPipelineDefinition | undefined; - /** Which pipeline trigger to use. Deprecated: Use `continuous` instead. */ - trigger?: PipelineTrigger | undefined; - /** Target schema (database) to add tables in this pipeline to. Exactly one of `schema` or `target` must be specified. To publish to Unity Catalog, also specify `catalog`. This legacy field is deprecated for pipeline creation in favor of the `schema` field. */ - target?: string | undefined; - /** The default schema (database) where tables are read from or published to. */ - schema?: string | undefined; - /** Filters on which Pipeline packages to include in the deployed graph. */ - filters?: Filters | undefined; - /** Whether the pipeline is continuous or triggered. This replaces `trigger`. */ - continuous?: boolean | undefined; - /** Whether the pipeline is in Development mode. Defaults to false. */ - development?: boolean | undefined; - /** Whether Photon is enabled for this pipeline. */ - photon?: boolean | undefined; - /** Pipeline product edition. */ - edition?: string | undefined; - /** SDP Release Channel that specifies which version to use. */ - channel?: string | undefined; - /** A catalog in Unity Catalog to publish data from this pipeline to. If `target` is specified, tables in this pipeline are published to a `target` schema inside `catalog` (for example, `catalog`.`target`.`table`). If `target` is not specified, no data is published to Unity Catalog. */ - catalog?: string | undefined; - /** List of notification settings for this pipeline. */ - notifications?: Notifications[] | undefined; - /** Whether serverless compute is enabled for this pipeline. */ - serverless?: boolean | undefined; - /** Deployment type of this pipeline. */ - deployment?: PipelineDeployment | undefined; - /** Restart window of this pipeline. */ - restartWindow?: RestartWindow | undefined; - /** Budget policy of this pipeline. */ - budgetPolicyId?: string | undefined; +/** Policy for auto full refresh. */ +export interface CreateAutoFullRefreshPolicy { + /** (Required, Mutable) Whether to enable auto full refresh or not. */ + enabled: boolean; /** - * A map of tags associated with the pipeline. - * These are forwarded to the cluster as cluster tags, and are therefore subject to the same limitations. - * A maximum of 25 tags can be added to the pipeline. + * (Optional, Mutable) Specify the minimum interval in hours between the timestamp + * at which a table was last full refreshed and the current timestamp for triggering auto full + * If unspecified and autoFullRefresh is enabled then by default min_interval_hours is 24 hours. */ - tags?: Record | undefined; - /** Event log configuration for this pipeline */ - eventLog?: EventLogSpec | undefined; + minIntervalHours?: number | undefined; +} + +/** Confluence specific options for ingestion */ +export interface CreateConfluenceConnectorOptions { + /** (Optional) Spaces to filter Confluence data on */ + includeConfluenceSpaces?: string[] | undefined; +} + +export interface CreateConnectionParameters { /** - * Root path for this pipeline. - * This is used as the root directory when editing the pipeline in the user interface and it is - * added to sys.path when executing Python sources during pipeline execution. + * Source catalog for initial connection. + * This is necessary for schema exploration in some database systems like Oracle, and optional but nice-to-have + * in some other database systems like Postgres. + * For Oracle databases, this maps to a service name. */ - rootPath?: string | undefined; - /** Environment specification for this pipeline used to install dependencies. */ - environment?: PipelinesEnvironment | undefined; - /** Usage policy of this pipeline. */ - usagePolicyId?: string | undefined; - /** Serverless compute ID specified by the user for serverless pipelines. */ - serverlessComputeId?: string | undefined; + sourceCatalog?: string | undefined; } -export interface CreatePipelineResponse { - /** The unique identifier for the newly created pipeline. Only returned when dry_run is false. */ - pipelineId?: string | undefined; - /** Only returned when dry_run is true. */ - effectiveSettings?: PipelineSpec | undefined; +/** Wrapper message for source-specific options to support multiple connector types */ +export interface CreateConnectorOptions { + connectorOptions?: + | {$case: 'googleAdsOptions'; googleAdsOptions: CreateGoogleAdsOptions} + | {$case: 'tiktokAdsOptions'; tiktokAdsOptions: CreateTikTokAdsOptions} + | {$case: 'sharepointOptions'; sharepointOptions: CreateSharepointOptions} + | {$case: 'gdriveOptions'; gdriveOptions: CreateGoogleDriveOptions} + | {$case: 'outlookOptions'; outlookOptions: CreateOutlookOptions} + | {$case: 'smartsheetOptions'; smartsheetOptions: CreateSmartsheetOptions} + | {$case: 'jiraOptions'; jiraOptions: CreateJiraConnectorOptions} + | { + $case: 'confluenceOptions'; + confluenceOptions: CreateConfluenceConnectorOptions; + } + | {$case: 'metaAdsOptions'; metaAdsOptions: CreateMetaMarketingOptions} + | { + $case: 'zendeskSupportOptions'; + zendeskSupportOptions: CreateZendeskSupportOptions; + } + | {$case: 'kafkaOptions'; kafkaOptions: CreateKafkaOptions} + | undefined; } -export interface CronTrigger { +export interface CreateCronTrigger { quartzCronSchedule?: string | undefined; timezoneId?: string | undefined; } -export interface DataPlaneId { - /** The instance name of the data plane emitting an event. */ - instance?: string | undefined; - /** A sequence number, unique and increasing within the data plane instance. */ - seqNo?: bigint | undefined; -} - /** Location of staged data storage */ -export interface DataStagingOptions { +export interface CreateDataStagingOptions { /** (Required, Immutable) The name of the catalog for the connector's staging storage location. */ - catalogName?: string | undefined; + catalogName: string; /** (Required, Immutable) The name of the schema for the connector's staging storage location. */ - schemaName?: string | undefined; + schemaName: string; /** * (Optional) The Unity Catalog-compatible name for the storage location. * This is the volume to use for the data that is extracted by the connector. @@ -675,120 +634,8 @@ export interface DataStagingOptions { volumeName?: string | undefined; } -export interface DeletePipelineRequest { - pipelineId?: string | undefined; - /** - * If true, deletion will proceed even if resource cleanup fails. - * By default, deletion will fail if resources cleanup is required but fails. - */ - force?: boolean | undefined; - /** - * If false, pipeline deletion will not cascade to its datasets (MVs, STs, Views). - * By default, this parameter will be true and all tables will be deleted with the pipeline. - */ - cascade?: boolean | undefined; -} - -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface DeletePipelineResponse {} - -export interface EditPipelineRequest { - /** Unique identifier for this pipeline. */ - pipelineId?: string | undefined; - /** If false, deployment will fail if name has changed and conflicts the name of another pipeline. */ - allowDuplicateNames?: boolean | undefined; - /** - * If present, the last-modified time of the pipeline settings before the edit. - * If the settings were modified after that time, then the request will fail with - * a conflict. - */ - expectedLastModified?: bigint | undefined; - runAs?: PipelinesJobRunAs | undefined; - /** - * Key/value map of default parameters to use for pipeline execution. - * Maximum total size: 10k characters (JSON format) - */ - parameters?: Record | undefined; - /** Unique identifier for this pipeline. */ - id?: string | undefined; - /** Friendly identifier for this pipeline. */ - name?: string | undefined; - /** DBFS root directory for storing checkpoints and tables. */ - storage?: string | undefined; - /** String-String configuration for this pipeline execution. */ - configuration?: Record | undefined; - /** Cluster settings for this pipeline deployment. */ - clusters?: PipelineCluster[] | undefined; - /** Libraries or code needed by this deployment. */ - libraries?: PipelineLibrary[] | undefined; - /** The configuration for a managed ingestion pipeline. These settings cannot be used with the 'libraries', 'schema', 'target', or 'catalog' settings. */ - ingestionDefinition?: IngestionPipelineDefinition | undefined; - /** The definition of a gateway pipeline to support change data capture. */ - gatewayDefinition?: IngestionGatewayPipelineDefinition | undefined; - /** Which pipeline trigger to use. Deprecated: Use `continuous` instead. */ - trigger?: PipelineTrigger | undefined; - /** Target schema (database) to add tables in this pipeline to. Exactly one of `schema` or `target` must be specified. To publish to Unity Catalog, also specify `catalog`. This legacy field is deprecated for pipeline creation in favor of the `schema` field. */ - target?: string | undefined; - /** The default schema (database) where tables are read from or published to. */ - schema?: string | undefined; - /** Filters on which Pipeline packages to include in the deployed graph. */ - filters?: Filters | undefined; - /** Whether the pipeline is continuous or triggered. This replaces `trigger`. */ - continuous?: boolean | undefined; - /** Whether the pipeline is in Development mode. Defaults to false. */ - development?: boolean | undefined; - /** Whether Photon is enabled for this pipeline. */ - photon?: boolean | undefined; - /** Pipeline product edition. */ - edition?: string | undefined; - /** SDP Release Channel that specifies which version to use. */ - channel?: string | undefined; - /** A catalog in Unity Catalog to publish data from this pipeline to. If `target` is specified, tables in this pipeline are published to a `target` schema inside `catalog` (for example, `catalog`.`target`.`table`). If `target` is not specified, no data is published to Unity Catalog. */ - catalog?: string | undefined; - /** List of notification settings for this pipeline. */ - notifications?: Notifications[] | undefined; - /** Whether serverless compute is enabled for this pipeline. */ - serverless?: boolean | undefined; - /** Deployment type of this pipeline. */ - deployment?: PipelineDeployment | undefined; - /** Restart window of this pipeline. */ - restartWindow?: RestartWindow | undefined; - /** Budget policy of this pipeline. */ - budgetPolicyId?: string | undefined; - /** - * A map of tags associated with the pipeline. - * These are forwarded to the cluster as cluster tags, and are therefore subject to the same limitations. - * A maximum of 25 tags can be added to the pipeline. - */ - tags?: Record | undefined; - /** Event log configuration for this pipeline */ - eventLog?: EventLogSpec | undefined; - /** - * Root path for this pipeline. - * This is used as the root directory when editing the pipeline in the user interface and it is - * added to sys.path when executing Python sources during pipeline execution. - */ - rootPath?: string | undefined; - /** Environment specification for this pipeline used to install dependencies. */ - environment?: PipelinesEnvironment | undefined; - /** Usage policy of this pipeline. */ - usagePolicyId?: string | undefined; - /** Serverless compute ID specified by the user for serverless pipelines. */ - serverlessComputeId?: string | undefined; -} - -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface EditPipelineResponse {} - -export interface ErrorDetail { - /** The exception thrown for this error, with its chain of cause. */ - exceptions?: SerializedException[] | undefined; - /** Whether this error is considered fatal, that is, unrecoverable. */ - fatal?: boolean | undefined; -} - /** Configurable event log parameters. */ -export interface EventLogSpec { +export interface CreateEventLogSpec { /** The name the event log is published to in UC. */ name?: string | undefined; /** The UC schema the event log is published under. */ @@ -797,7 +644,7 @@ export interface EventLogSpec { catalog?: string | undefined; } -export interface FileFilter { +export interface CreateFileFilter { filter?: | { $case: 'pathFilter'; @@ -828,11 +675,11 @@ export interface FileFilter { | undefined; } -export interface FileIngestionOptions { +export interface CreateFileIngestionOptions { /** required for TableSpec */ format?: FileIngestionOptions_FileFormat | undefined; /** Generic options */ - fileFilters?: FileFilter[] | undefined; + fileFilters?: CreateFileFilter[] | undefined; inferColumnTypes?: boolean | undefined; schemaEvolutionMode?: FileIngestionOptions_SchemaEvolutionMode | undefined; /** @@ -856,78 +703,22 @@ export interface FileIngestionOptions { formatOptions?: Record | undefined; } -export interface Filters { +export interface CreateFilters { /** Paths to include. */ include?: string[] | undefined; /** Paths to exclude. */ exclude?: string[] | undefined; } -export interface GetPipelineRequest { - pipelineId?: string | undefined; -} - -export interface GetPipelineResponse { - /** The ID of the pipeline. */ - pipelineId?: string | undefined; - /** The pipeline specification. This field is not returned when called by `ListPipelines`. */ - spec?: PipelineSpec | undefined; - /** The pipeline state. */ - state?: PipelineState_PipelineState | undefined; - /** An optional message detailing the cause of the pipeline state. */ - cause?: string | undefined; - /** The ID of the cluster that the pipeline is running on. */ - clusterId?: string | undefined; - /** A human friendly identifier for the pipeline, taken from the `spec`. */ - name?: string | undefined; - /** The health of a pipeline. */ - health?: PipelineHealthStatus | undefined; - /** The username of the pipeline creator. */ - creatorUserName?: string | undefined; - /** Status of the latest updates for the pipeline. Ordered with the newest update first. */ - latestUpdates?: UpdateStateInfo[] | undefined; - /** The last time the pipeline settings were modified or created. */ - lastModified?: bigint | undefined; - /** Username of the user that the pipeline will run on behalf of. */ - runAsUserName?: string | undefined; - /** Serverless budget policy ID of this pipeline. */ - effectiveBudgetPolicyId?: string | undefined; - /** Publishing mode of the pipeline */ - effectivePublishingMode?: PublishingMode | undefined; - /** - * The user or service principal that the pipeline runs as, if specified in the request. - * This field indicates the explicit configuration of `run_as` for the pipeline. - * To find the value in all cases, explicit or implicit, use `run_as_user_name`. - */ - runAs?: PipelinesJobRunAs | undefined; - /** - * Key/value map of default parameters to use for pipeline execution. - * Maximum total size: 10k characters (JSON format) - */ - parameters?: Record | undefined; -} - -export interface GetUpdateRequest { - /** The ID of the pipeline. */ - pipelineId?: string | undefined; - /** The ID of the update. */ - updateId?: string | undefined; -} - -export interface GetUpdateResponse { - /** The current update info. */ - update?: UpdateInfo | undefined; -} - -export interface GoogleAdsConfig { - /** - * (Required) Manager Account ID (also called MCC Account ID) used to list and access - * customer accounts under this manager account. This is required for fetching the list - * of customer accounts during source selection. - * If the same field is also set in the object-level GoogleAdsOptions (connector_options), - * the object-level value takes precedence over this top-level config. - */ - managerAccountId?: string | undefined; +export interface CreateGoogleAdsConfig { + /** + * (Required) Manager Account ID (also called MCC Account ID) used to list and access + * customer accounts under this manager account. This is required for fetching the list + * of customer accounts during source selection. + * If the same field is also set in the object-level GoogleAdsOptions (connector_options), + * the object-level value takes precedence over this top-level config. + */ + managerAccountId?: string | undefined; } /** @@ -935,13 +726,13 @@ export interface GoogleAdsConfig { * When set, these values override the corresponding fields in GoogleAdsConfig * (source_configurations). */ -export interface GoogleAdsOptions { +export interface CreateGoogleAdsOptions { /** * (Optional at this level) Manager Account ID (also called MCC Account ID) used to list * and access customer accounts under this manager account. * Overrides GoogleAdsConfig.manager_account_id from source_configurations when set. */ - managerAccountId?: string | undefined; + managerAccountId: string; /** * (Optional) Number of days to look back for report tables to capture late-arriving data. * If not specified, defaults to 30 days. @@ -955,22 +746,22 @@ export interface GoogleAdsOptions { syncStartDate?: string | undefined; } -export interface GoogleDriveOptions { +export interface CreateGoogleDriveOptions { /** Google Drive URL. */ url?: string | undefined; entityType?: GoogleDriveOptions_GoogleDriveEntityType | undefined; - fileIngestionOptions?: FileIngestionOptions | undefined; + fileIngestionOptions?: CreateFileIngestionOptions | undefined; } -export interface IngestionGatewayPipelineDefinition { +export interface CreateIngestionGatewayPipelineDefinition { /** Immutable. The Unity Catalog connection that this gateway pipeline uses to communicate with the source. */ - connectionName?: string | undefined; + connectionName: string; /** [Deprecated, use connection_name instead] Immutable. The Unity Catalog connection that this gateway pipeline uses to communicate with the source. */ connectionId?: string | undefined; /** Required, Immutable. The name of the catalog for the gateway pipeline's storage location. */ - gatewayStorageCatalog?: string | undefined; + gatewayStorageCatalog: string; /** Required, Immutable. The name of the schema for the gateway pipelines's storage location. */ - gatewayStorageSchema?: string | undefined; + gatewayStorageSchema: string; /** * Optional. The Unity Catalog-compatible name for the gateway storage location. * This is the destination to use for the data that is extracted by the gateway. @@ -978,10 +769,10 @@ export interface IngestionGatewayPipelineDefinition { */ gatewayStorageName?: string | undefined; /** Optional, Internal. Parameters required to establish an initial connection with the source. */ - connectionParameters?: ConnectionParameters | undefined; + connectionParameters?: CreateConnectionParameters | undefined; } -export interface IngestionPipelineDefinition { +export interface CreateIngestionPipelineDefinition { /** * (Required, Mutable) Identifies the data source for the Lakeflow Connect Ingestion pipeline. * Exactly one option must be specified. @@ -1023,16 +814,10 @@ export interface IngestionPipelineDefinition { } | undefined; /** Required. Settings specifying tables to replicate and the destination for the replicated tables. */ - objects?: IngestionPipelineDefinition_IngestionConfig[] | undefined; - /** - * The type of the foreign source. - * The source type will be inferred from the source connection or ingestion gateway. - * This field is output only and will be ignored if provided. - */ - sourceType?: IngestionSourceType | undefined; + objects?: IngestionPipelineDefinition_CreateIngestionConfig[] | undefined; /** Configuration settings to control the ingestion of tables. These settings are applied to all tables in the pipeline. */ tableConfiguration?: - | IngestionPipelineDefinition_TableSpecificConfig + | IngestionPipelineDefinition_CreateTableSpecificConfig | undefined; /** * Netsuite only configuration. When the field is set for a netsuite connector, @@ -1041,9 +826,9 @@ export interface IngestionPipelineDefinition { */ netsuiteJarPath?: string | undefined; /** Top-level source configurations */ - sourceConfigurations?: SourceConfig[] | undefined; + sourceConfigurations?: CreateSourceConfig[] | undefined; /** (Optional) A window that specifies a set of time ranges for snapshot queries in CDC. */ - fullRefreshWindow?: OperationTimeWindow | undefined; + fullRefreshWindow?: CreateOperationTimeWindow | undefined; /** (Optional) Connector Type for sources. Ex: CDC, Query Based. */ connectorType?: ConnectorType | undefined; /** @@ -1052,416 +837,69 @@ export interface IngestionPipelineDefinition { * If not specified, the volume for staged data will be created in catalog and schema/target specified in the * top level pipeline definition. */ - dataStagingOptions?: DataStagingOptions | undefined; -} - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export interface IngestionPipelineDefinition_IngestionConfig { - sourceTables?: - | { - $case: 'schema'; - /** Select all tables from a specific source schema. */ - schema: IngestionPipelineDefinition_SchemaSpec; - } - | { - $case: 'table'; - /** Select a specific source table. */ - table: IngestionPipelineDefinition_TableSpec; - } - | { - $case: 'report'; - /** Select a specific source report. */ - report: IngestionPipelineDefinition_ReportSpec; - } - | undefined; -} - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export interface IngestionPipelineDefinition_ReportSpec { - /** Required. Report URL in the source system. */ - sourceUrl?: string | undefined; - /** Required. Destination catalog to store table. */ - destinationCatalog?: string | undefined; - /** Required. Destination schema to store table. */ - destinationSchema?: string | undefined; - /** Required. Destination table name. The pipeline fails if a table with that name already exists. */ - destinationTable?: string | undefined; - /** Configuration settings to control the ingestion of tables. These settings override the table_configuration defined in the IngestionPipelineDefinition object. */ - tableConfiguration?: - | IngestionPipelineDefinition_TableSpecificConfig - | undefined; + dataStagingOptions?: CreateDataStagingOptions | undefined; } -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export interface IngestionPipelineDefinition_SchemaSpec { - /** The source catalog name. Might be optional depending on the type of source. */ - sourceCatalog?: string | undefined; - /** Required. Schema name in the source database. */ - sourceSchema?: string | undefined; - /** Required. Destination catalog to store tables. */ - destinationCatalog?: string | undefined; - /** Required. Destination schema to store tables in. Tables with the same name as the source tables are created in this destination schema. The pipeline fails If a table with the same name already exists. */ - destinationSchema?: string | undefined; - /** Configuration settings to control the ingestion of tables. These settings are applied to all tables in this schema and override the table_configuration defined in the IngestionPipelineDefinition object. */ - tableConfiguration?: - | IngestionPipelineDefinition_TableSpecificConfig - | undefined; - /** (Optional) Source Specific Connector Options */ - connectorOptions?: ConnectorOptions | undefined; +/** Jira specific options for ingestion */ +export interface CreateJiraConnectorOptions { + /** (Optional) Projects to filter Jira data on */ + includeJiraSpaces?: string[] | undefined; } -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export interface IngestionPipelineDefinition_TableSpec { - /** Source catalog name. Might be optional depending on the type of source. */ - sourceCatalog?: string | undefined; - /** Schema name in the source database. Might be optional depending on the type of source. */ - sourceSchema?: string | undefined; - /** Required. Table name in the source database. */ - sourceTable?: string | undefined; - /** Required. Destination catalog to store table. */ - destinationCatalog?: string | undefined; - /** Required. Destination schema to store table. */ - destinationSchema?: string | undefined; - /** Optional. Destination table name. The pipeline fails if a table with that name already exists. If not set, the source table name is used. */ - destinationTable?: string | undefined; - /** Configuration settings to control the ingestion of tables. These settings override the table_configuration defined in the IngestionPipelineDefinition object and the SchemaSpec. */ - tableConfiguration?: - | IngestionPipelineDefinition_TableSpecificConfig - | undefined; - /** (Optional) Source Specific Connector Options */ - connectorOptions?: ConnectorOptions | undefined; +export interface CreateJsonTransformerOptions { + /** Parse the entire value as a single Variant column. */ + asVariant?: boolean | undefined; + /** Inline schema string for JSON parsing (Spark DDL format). */ + schema?: string | undefined; + /** Path to a schema file (.ddl). */ + schemaFilePath?: string | undefined; + /** (Optional) Schema evolution mode for schema inference. */ + schemaEvolutionMode?: FileIngestionOptions_SchemaEvolutionMode | undefined; + /** (Optional) Schema hints as a comma-separated string of "column_name type" pairs. */ + schemaHints?: string | undefined; } -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export interface IngestionPipelineDefinition_TableSpecificConfig { - scdType?: ScdType_ScdType | undefined; - /** The primary key of the table used to apply changes. */ - primaryKeys?: string[] | undefined; - /** The column names specifying the logical order of events in the source data. Spark Declarative Pipelines uses this sequencing to handle change events that arrive out of order. */ - sequenceBy?: string[] | undefined; - /** - * A list of column names to be included for the ingestion. - * When not specified, all columns except ones in exclude_columns will be included. Future - * columns will be automatically included. - * When specified, all other future columns will be automatically excluded from ingestion. - * This field in mutually exclusive with `exclude_columns`. - */ - includeColumns?: string[] | undefined; +export interface CreateKafkaOptions { /** - * A list of column names to be excluded for the ingestion. - * When not specified, include_columns fully controls what columns to be ingested. - * When specified, all other columns including future ones will be automatically included for ingestion. - * This field in mutually exclusive with `include_columns`. + * Topics to subscribe to. + * Only one of topics or topic_pattern must be specified. */ - excludeColumns?: string[] | undefined; - /** If true, formula fields defined in the table are included in the ingestion. This setting is only valid for the Salesforce connector */ - salesforceIncludeFormulaFields?: boolean | undefined; - /** (Optional) Additional custom parameters for Workday Report */ - workdayReportParameters?: - | IngestionPipelineDefinition_WorkdayReportParameters - | undefined; + topics?: string[] | undefined; /** - * (Optional, Immutable) The row filter condition to be applied to the table. - * It must not contain the WHERE keyword, only the actual filter condition. - * It must be in DBSQL format. + * Java regex pattern to subscribe to matching topics. + * Only one of topics or topic_pattern must be specified. */ - rowFilter?: string | undefined; - queryBasedConnectorConfig?: - | IngestionPipelineDefinition_TableSpecificConfig_QueryBasedConnectorConfig - | undefined; + topicPattern?: string | undefined; /** - * (Optional, Mutable) Policy for auto full refresh, if enabled pipeline will automatically try - * to fix issues by doing a full refresh on the table in the retry run. auto_full_refresh_policy - * in table configuration will override the above level auto_full_refresh_policy. - * For example, - * { - * "auto_full_refresh_policy": { - * "enabled": true, - * "min_interval_hours": 23, - * } - * } - * If unspecified, auto full refresh is disabled. + * (Optional) Transformer for the message key. + * If not specified, the key is left as raw bytes. */ - autoFullRefreshPolicy?: AutoFullRefreshPolicy | undefined; + keyTransformer?: CreateTransformer | undefined; /** - * Table properties to set on the destination table. - * These are key-value pairs that configure various Delta table behaviors or any user defined properties. - * Example: {"delta.feature.variantType": "supported", "delta.enableTypeWidening": "true"} - * Note: table_properties in table specific configuration will override the table_properties of the pipeline definition. + * (Optional) Transformer for the message value. + * If not specified, the value is left as raw bytes. */ - tableProperties?: Record | undefined; + valueTransformer?: CreateTransformer | undefined; /** - * Whether to enable auto clustering on the destination table. - * When enabled, Delta will automatically optimize the data layout - * based on the clustering columns for improved query performance. - * Note: enable_auto_clustering in table specific configuration will override the pipeline definition. - * Note: we can only provide enable_auto_clustering or clustering_columns, - * added as separate fields as we cannot have repeated field in oneof. + * (Optional) Where to begin reading when no checkpoint exists. + * Valid values: "latest" and "earliest". Defaults to "latest". */ - enableAutoClustering?: boolean | undefined; + startingOffset?: string | undefined; + /** Internal option to control the maximum number of offsets to process per trigger. */ + maxOffsetsPerTrigger?: bigint | undefined; /** - * List of column names to use for clustering the destination table. - * When specified, the destination Delta table will be clustered by these columns. - * This can improve query performance when filtering on these columns. - * Note: clustering_columns in table specific configuration will override the pipeline definition. - * Note: we can only provide enable_auto_clustering or clustering_columns, - * added as separate fields as we cannot have repeated field in oneof. + * Undocumented backdoor mechanism for overriding parameters + * to pass to the Kafka client. + * This is not supported and may break at any time. */ - clusteringColumns?: string[] | undefined; + clientConfig?: Record | undefined; } -/** Configurations that are only applicable for query-based ingestion connectors. */ -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export interface IngestionPipelineDefinition_TableSpecificConfig_QueryBasedConnectorConfig { - /** - * The names of the monotonically increasing columns in the source table that are used to enable - * the table to be read and ingested incrementally through structured streaming. - * The columns are allowed to have repeated values but have to be non-decreasing. - * If the source data is merged into the destination (e.g., using SCD Type 1 or Type 2), these - * columns will implicitly define the `sequence_by` behavior. You can still explicitly set - * `sequence_by` to override this default. - */ - cursorColumns?: string[] | undefined; - /** - * Specifies a SQL WHERE condition that specifies that the source row has been deleted. - * This is sometimes referred to as "soft-deletes". - * For example: "Operation = 'DELETE'" or "is_deleted = true". - * This field is orthogonal to `hard_deletion_sync_interval_in_seconds`, - * one for soft-deletes and the other for hard-deletes. - * See also the hard_deletion_sync_min_interval_in_seconds field for - * handling of "hard deletes" where the source rows are physically removed from the table. - */ - deletionCondition?: string | undefined; - /** - * Specifies the minimum interval (in seconds) between snapshots on primary keys - * for detecting and synchronizing hard deletions—i.e., rows that have been - * physically removed from the source table. - * This interval acts as a lower bound. If ingestion runs less frequently than - * this value, hard deletion synchronization will align with the actual ingestion - * frequency instead of happening more often. - * If not set, hard deletion synchronization via snapshots is disabled. - * This field is mutable and can be updated without triggering a full snapshot. - */ - hardDeletionSyncMinIntervalInSeconds?: bigint | undefined; -} - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export interface IngestionPipelineDefinition_WorkdayReportParameters { - /** - * (Optional) Marks the report as incremental. - * This field is deprecated and should not be used. Use `parameters` instead. The incremental behavior is now - * controlled by the `parameters` field. - */ - incremental?: boolean | undefined; - /** - * (Optional) Additional custom parameters for Workday Report - * This field is deprecated and should not be used. Use `parameters` instead. - */ - reportParameters?: - | IngestionPipelineDefinition_WorkdayReportParameters_QueryKeyValue[] - | undefined; - /** - * Parameters for the Workday report. Each key represents the parameter name (e.g., "start_date", "end_date"), - * and the corresponding value is a SQL-like expression used to compute the parameter value at runtime. - * Example: - * { - * "start_date": "{ coalesce(current_offset(), date(\"2025-02-01\")) }", - * "end_date": "{ current_date() - INTERVAL 1 DAY }" - * } - */ - parameters?: Record | undefined; -} - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export interface IngestionPipelineDefinition_WorkdayReportParameters_QueryKeyValue { - /** Key for the report parameter, can be a column name or other metadata */ - key?: string | undefined; - /** - * Value for the report parameter. - * Possible values it can take are these sql functions: - * 1. coalesce(current_offset(), date("YYYY-MM-DD")) -> if current_offset() is null, then the passed date, else current_offset() - * 2. current_date() - * 3. date_sub(current_date(), x) -> subtract x (some non-negative integer) days from current date - */ - value?: string | undefined; -} - -/** Jira specific options for ingestion */ -export interface JiraConnectorOptions { - /** (Optional) Projects to filter Jira data on */ - includeJiraSpaces?: string[] | undefined; -} - -export interface JsonTransformerOptions { - /** Parse the entire value as a single Variant column. */ - asVariant?: boolean | undefined; - /** Inline schema string for JSON parsing (Spark DDL format). */ - schema?: string | undefined; - /** Path to a schema file (.ddl). */ - schemaFilePath?: string | undefined; - /** (Optional) Schema evolution mode for schema inference. */ - schemaEvolutionMode?: FileIngestionOptions_SchemaEvolutionMode | undefined; - /** (Optional) Schema hints as a comma-separated string of "column_name type" pairs. */ - schemaHints?: string | undefined; -} - -export interface KafkaOptions { - /** - * Topics to subscribe to. - * Only one of topics or topic_pattern must be specified. - */ - topics?: string[] | undefined; - /** - * Java regex pattern to subscribe to matching topics. - * Only one of topics or topic_pattern must be specified. - */ - topicPattern?: string | undefined; - /** - * (Optional) Transformer for the message key. - * If not specified, the key is left as raw bytes. - */ - keyTransformer?: Transformer | undefined; - /** - * (Optional) Transformer for the message value. - * If not specified, the value is left as raw bytes. - */ - valueTransformer?: Transformer | undefined; - /** - * (Optional) Where to begin reading when no checkpoint exists. - * Valid values: "latest" and "earliest". Defaults to "latest". - */ - startingOffset?: string | undefined; - /** Internal option to control the maximum number of offsets to process per trigger. */ - maxOffsetsPerTrigger?: bigint | undefined; - /** - * Undocumented backdoor mechanism for overriding parameters - * to pass to the Kafka client. - * This is not supported and may break at any time. - */ - clientConfig?: Record | undefined; -} - -/** - * The request/response messages for the ListPipelines API. The default behavior is to return - * the 25 newest events in timestamp descending order for the given pipeline. - */ -export interface ListPipelineEventsRequest { - /** The pipeline to return events for. */ - pipelineId?: string | undefined; - /** - * Page token returned by previous call. This field is mutually - * exclusive with all fields in this request except max_results. An error is - * returned if any fields other than max_results are set when this field is set. - */ - pageToken?: string | undefined; - /** - * Max number of entries to return in a single page. The system may return - * fewer than max_results events in a response, even if there are more events - * available. - */ - maxResults?: number | undefined; - /** - * A string indicating a sort order by timestamp for the results, for example, ["timestamp asc"]. - * The sort order can be ascending or descending. By default, events are returned - * in descending order by timestamp. - */ - orderBy?: string[] | undefined; - /** - * Criteria to select a subset of results, expressed using a SQL-like syntax. - * The supported filters are: - * 1. level='INFO' (or WARN or ERROR) - * 2. level in ('INFO', 'WARN') - * 3. id='[event-id]' - * 4. timestamp > 'TIMESTAMP' (or >=,<,<=,=) - * - * Composite expressions are supported, for example: level in ('ERROR', 'WARN') - * AND timestamp> '2021-07-22T06:37:33.083Z' - */ - filter?: string | undefined; -} - -export interface ListPipelineEventsResponse { - /** The list of events matching the request criteria. */ - events?: PipelineEvent[] | undefined; - /** If present, a token to fetch the next page of events. */ - nextPageToken?: string | undefined; - /** If present, a token to fetch the previous page of events. */ - prevPageToken?: string | undefined; -} - -/** - * The request/response messages for the ListPipelines API. The default behavior is to return - * the 25 first pipelines in ascending order of pipeline id. - */ -export interface ListPipelinesRequest { - /** Page token returned by previous call */ - pageToken?: string | undefined; - /** - * The maximum number of entries to return in a single page. The system may - * return fewer than max_results events in a response, even if there are - * more events available. This field is optional. The default value is 25. - * The maximum value is 100. An error is returned if the value of max_results - * is greater than 100. - */ - maxResults?: number | undefined; - /** - * A list of strings specifying the order of results. - * Supported order_by fields are id and name. The default is id asc. - * This field is optional. - */ - orderBy?: string[] | undefined; - /** - * Select a subset of results based on the specified criteria. - * The supported filters are: - * - * * `notebook=''` to select pipelines that reference the provided notebook path. - * * `name LIKE '[pattern]'` to select pipelines with a name that matches pattern. - * Wildcards are supported, for example: `name LIKE '%shopping%'` - * - * Composite filters are not supported. This field is optional. - */ - filter?: string | undefined; -} - -export interface ListPipelinesResponse { - /** The list of events matching the request criteria. */ - statuses?: PipelineStateInfo[] | undefined; - /** If present, a token to fetch the next page of events. */ - nextPageToken?: string | undefined; -} - -/** - * The request/response messages for the ListUpdates API. The default behavior is to return - * the 25 most recent updates in timestamp descending order for the given pipeline. No custom - * sorting or filtering is supported. - */ -export interface ListUpdatesRequest { - /** The pipeline to return updates for. */ - pipelineId?: string | undefined; - /** Page token returned by previous call */ - pageToken?: string | undefined; - /** Max number of entries to return in a single page. */ - maxResults?: number | undefined; - /** If present, returns updates until and including this update_id. */ - untilUpdateId?: string | undefined; -} - -export interface ListUpdatesResponse { - updates?: UpdateInfo[] | undefined; - /** - * If present, then there are more results, and this a token to be used in a subsequent request - * to fetch the next page. - */ - nextPageToken?: string | undefined; - /** If present, then this token can be used in a subsequent request to fetch the previous page. */ - prevPageToken?: string | undefined; -} - -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface ManualTrigger {} - -/** Meta Marketing (Meta Ads) specific options for ingestion */ -export interface MetaMarketingOptions { +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface CreateManualTrigger {} + +/** Meta Marketing (Meta Ads) specific options for ingestion */ +export interface CreateMetaMarketingOptions { /** * (Optional, DEPRECATED — use custom_report_options.level) Granularity of data to pull * (account, ad, adset, campaign) @@ -1498,12 +936,12 @@ export interface MetaMarketingOptions { actionAttributionWindows?: string[] | undefined; } -export interface NotebookLibrary { +export interface CreateNotebookLibrary { /** The absolute path of the source code. */ path?: string | undefined; } -export interface Notifications { +export interface CreateNotifications { /** A list of email addresses notified when a configured alert is triggered. */ emailRecipients?: string[] | undefined; /** @@ -1519,9 +957,9 @@ export interface Notifications { } /** Proto representing a window */ -export interface OperationTimeWindow { +export interface CreateOperationTimeWindow { /** An integer between 0 and 23 denoting the start hour for the window in the 24-hour day. */ - startHour?: number | undefined; + startHour: number; /** * Days of week in which the window is allowed to happen * If not specified all days of the week will be used. @@ -1534,58 +972,8 @@ export interface OperationTimeWindow { timeZoneId?: string | undefined; } -export interface Origin { - /** The cloud provider, e.g., AWS or Azure. */ - cloud?: string | undefined; - /** The cloud region. */ - region?: string | undefined; - /** The org id of the user. Unique within a cloud. */ - orgId?: bigint | undefined; - /** The id of the pipeline. Globally unique. */ - pipelineId?: string | undefined; - /** The name of the pipeline. Not unique. */ - pipelineName?: string | undefined; - /** The id of the cluster where an execution happens. Unique within a region. */ - clusterId?: string | undefined; - /** The id of an execution. Globally unique. */ - updateId?: string | undefined; - /** The id of a maintenance run. Globally unique. */ - maintenanceId?: string | undefined; - /** The id of a (delta) table. Globally unique. */ - tableId?: string | undefined; - /** The name of a dataset. Unique within a pipeline. */ - datasetName?: string | undefined; - /** - * The id of the flow. Globally unique. Incremental queries will generally - * reuse the same id while complete queries will have a new id per update. - */ - flowId?: string | undefined; - /** The name of the flow. Not unique. */ - flowName?: string | undefined; - /** The id of a batch. Unique within a flow. */ - batchId?: bigint | undefined; - /** The id of the request that caused an update. */ - requestId?: string | undefined; - /** The Unity Catalog id of the MV or ST being updated. */ - ucResourceId?: string | undefined; - /** The optional host name where the event was triggered */ - host?: string | undefined; - /** Materialization name. */ - materializationName?: string | undefined; - /** The name of the source UC connection (if known) from whose data ingestion is described by this event. */ - ingestionSourceConnectionName?: string | undefined; - /** The name of the source catalog name (if known) from whose data ingestion is described by this event. */ - ingestionSourceCatalogName?: string | undefined; - /** The name of the source schema name (if known) from whose data ingestion is described by this event. */ - ingestionSourceSchemaName?: string | undefined; - /** The name of the source table name (if known) from whose data ingestion is described by this event. */ - ingestionSourceTableName?: string | undefined; - /** An optional implementation-defined source table version of a dataset being (re)ingested. */ - ingestionSourceTableVersion?: string | undefined; -} - /** Outlook specific options for ingestion */ -export interface OutlookOptions { +export interface CreateOutlookOptions { /** Deprecated. Use include_folders instead. */ folderFilter?: string[] | undefined; /** Deprecated. Use include_senders instead. */ @@ -1640,12 +1028,12 @@ export interface OutlookOptions { includeSubjects?: string[] | undefined; } -export interface PathPattern { +export interface CreatePathPattern { /** The source code to include for pipelines */ include?: string | undefined; } -export interface PipelineCluster { +export interface CreatePipelineCluster { /** A label for the cluster specification, either `default` to configure the default cluster, or `maintenance` to configure the maintenance cluster. This field is optional. The default value is `default`. */ label?: string | undefined; /** Note: This field won't be persisted. Only API users will check this field. */ @@ -1659,17 +1047,17 @@ export interface PipelineCluster { * Attributes related to clusters running on Amazon Web Services. * If not specified at cluster creation, a set of default values will be used. */ - awsAttributes?: PipelinesAwsAttributes | undefined; + awsAttributes?: CreatePipelinesAwsAttributes | undefined; /** * Attributes related to clusters running on Microsoft Azure. * If not specified at cluster creation, a set of default values will be used. */ - azureAttributes?: PipelinesAzureAttributes | undefined; + azureAttributes?: CreatePipelinesAzureAttributes | undefined; /** * Attributes related to clusters running on Google Cloud Platform. * If not specified at cluster creation, a set of default values will be used. */ - gcpAttributes?: PipelinesGcpAttributes | undefined; + gcpAttributes?: CreatePipelinesGcpAttributes | undefined; /** * This field encodes, through a single value, the resources available to each of * the Spark nodes in this cluster. For example, the Spark nodes can be provisioned @@ -1705,7 +1093,7 @@ export interface PipelineCluster { * `5 mins`. The destination of driver logs is `$destination/$clusterId/driver`, while * the destination of executor logs is `$destination/$clusterId/executor`. */ - clusterLogConf?: PipelinesClusterLogConf | undefined; + clusterLogConf?: CreatePipelinesClusterLogConf | undefined; /** * An object containing a set of optional, user-specified environment variable key-value pairs. * Please note that key-value pair of the form (X,Y) will be exported as is (i.e., @@ -1721,7 +1109,7 @@ export interface PipelineCluster { */ sparkEnvVars?: Record | undefined; /** The configuration for storing init scripts. Any number of destinations can be specified. The scripts are executed sequentially in the order provided. If `cluster_log_conf` is specified, init script logs are sent to `//init_scripts`. */ - initScripts?: PipelinesInitScriptInfo[] | undefined; + initScripts?: CreatePipelinesInitScriptInfo[] | undefined; /** The optional ID of the instance pool to which the cluster belongs. */ instancePoolId?: string | undefined; /** The ID of the cluster policy used to create the cluster if applicable. */ @@ -1755,14 +1143,14 @@ export interface PipelineCluster { * Parameters needed in order to automatically scale clusters up and down based on load. * Note: autoscaling works best with DB runtime versions 3.0 or later. */ - autoscale: PipelinesAutoScale; + autoscale: CreatePipelinesAutoScale; } | undefined; } -export interface PipelineDeployment { +export interface CreatePipelineDeployment { /** The deployment method that manages the pipeline. */ - kind?: DeploymentKind | undefined; + kind: DeploymentKind; /** The path to the file containing metadata about the deployment. */ metadataFilePath?: string | undefined; /** @@ -1779,35 +1167,7 @@ export interface PipelineDeployment { versionId?: string | undefined; } -export interface PipelineEvent { - /** A time-based, globally unique id. */ - id?: string | undefined; - /** A sequencing object to identify and order events. */ - sequence?: Sequencing | undefined; - /** Describes where the event originates from. */ - origin?: Origin | undefined; - /** The time of the event. */ - timestamp?: string | undefined; - /** The display message associated with the event. */ - message?: string | undefined; - /** The severity level of the event. */ - level?: EventLevel | undefined; - /** Information about an error captured by the event. */ - error?: ErrorDetail | undefined; - /** The event type. Should always correspond to the details */ - eventType?: string | undefined; - /** Maturity level for event_type. */ - maturityLevel?: MaturityLevel | undefined; - /** - * Information about which fields were truncated from this event due to size constraints. - * If empty or absent, no truncation occurred. - * See https://docs.databricks.com/en/ldp/monitor-event-logs for information on - * retrieving complete event data. - */ - truncation?: Truncation | undefined; -} - -export interface PipelineLibrary { +export interface CreatePipelineLibrary { lib?: | { $case: 'jar'; @@ -1817,7 +1177,7 @@ export interface PipelineLibrary { | { $case: 'maven'; /** Specification of a maven library to be installed. */ - maven: PipelinesMavenLibrary; + maven: CreatePipelinesMavenLibrary; } | { $case: 'whl'; @@ -1827,12 +1187,12 @@ export interface PipelineLibrary { | { $case: 'notebook'; /** The path to a notebook that defines a pipeline and is stored in the workspace. */ - notebook: NotebookLibrary; + notebook: CreateNotebookLibrary; } | { $case: 'file'; /** The path to a file that defines a pipeline and is stored in the Databricks Repos. */ - file: NotebookLibrary; + file: CreateNotebookLibrary; } | { $case: 'glob'; @@ -1841,12 +1201,21 @@ export interface PipelineLibrary { * Each entry can be a notebook path, a file path, or a folder path that ends `/\**`. * This field cannot be used together with `notebook` or `file`. */ - glob: PathPattern; + glob: CreatePathPattern; } | undefined; } -export interface PipelineSpec { +export interface CreatePipelineRequest { + /** If false, deployment will fail if name conflicts with that of another pipeline. */ + allowDuplicateNames?: boolean | undefined; + dryRun?: boolean | undefined; + runAs?: CreatePipelinesJobRunAs | undefined; + /** + * Key/value map of default parameters to use for pipeline execution. + * Maximum total size: 10k characters (JSON format) + */ + parameters?: Record | undefined; /** Unique identifier for this pipeline. */ id?: string | undefined; /** Friendly identifier for this pipeline. */ @@ -1856,21 +1225,21 @@ export interface PipelineSpec { /** String-String configuration for this pipeline execution. */ configuration?: Record | undefined; /** Cluster settings for this pipeline deployment. */ - clusters?: PipelineCluster[] | undefined; + clusters?: CreatePipelineCluster[] | undefined; /** Libraries or code needed by this deployment. */ - libraries?: PipelineLibrary[] | undefined; + libraries?: CreatePipelineLibrary[] | undefined; /** The configuration for a managed ingestion pipeline. These settings cannot be used with the 'libraries', 'schema', 'target', or 'catalog' settings. */ - ingestionDefinition?: IngestionPipelineDefinition | undefined; + ingestionDefinition?: CreateIngestionPipelineDefinition | undefined; /** The definition of a gateway pipeline to support change data capture. */ - gatewayDefinition?: IngestionGatewayPipelineDefinition | undefined; + gatewayDefinition?: CreateIngestionGatewayPipelineDefinition | undefined; /** Which pipeline trigger to use. Deprecated: Use `continuous` instead. */ - trigger?: PipelineTrigger | undefined; + trigger?: CreatePipelineTrigger | undefined; /** Target schema (database) to add tables in this pipeline to. Exactly one of `schema` or `target` must be specified. To publish to Unity Catalog, also specify `catalog`. This legacy field is deprecated for pipeline creation in favor of the `schema` field. */ target?: string | undefined; /** The default schema (database) where tables are read from or published to. */ schema?: string | undefined; /** Filters on which Pipeline packages to include in the deployed graph. */ - filters?: Filters | undefined; + filters?: CreateFilters | undefined; /** Whether the pipeline is continuous or triggered. This replaces `trigger`. */ continuous?: boolean | undefined; /** Whether the pipeline is in Development mode. Defaults to false. */ @@ -1884,13 +1253,13 @@ export interface PipelineSpec { /** A catalog in Unity Catalog to publish data from this pipeline to. If `target` is specified, tables in this pipeline are published to a `target` schema inside `catalog` (for example, `catalog`.`target`.`table`). If `target` is not specified, no data is published to Unity Catalog. */ catalog?: string | undefined; /** List of notification settings for this pipeline. */ - notifications?: Notifications[] | undefined; + notifications?: CreateNotifications[] | undefined; /** Whether serverless compute is enabled for this pipeline. */ serverless?: boolean | undefined; /** Deployment type of this pipeline. */ - deployment?: PipelineDeployment | undefined; + deployment?: CreatePipelineDeployment | undefined; /** Restart window of this pipeline. */ - restartWindow?: RestartWindow | undefined; + restartWindow?: CreateRestartWindow | undefined; /** Budget policy of this pipeline. */ budgetPolicyId?: string | undefined; /** @@ -1900,7 +1269,7 @@ export interface PipelineSpec { */ tags?: Record | undefined; /** Event log configuration for this pipeline */ - eventLog?: EventLogSpec | undefined; + eventLog?: CreateEventLogSpec | undefined; /** * Root path for this pipeline. * This is used as the root directory when editing the pipeline in the user interface and it is @@ -1908,49 +1277,35 @@ export interface PipelineSpec { */ rootPath?: string | undefined; /** Environment specification for this pipeline used to install dependencies. */ - environment?: PipelinesEnvironment | undefined; + environment?: CreatePipelinesEnvironment | undefined; /** Usage policy of this pipeline. */ usagePolicyId?: string | undefined; /** Serverless compute ID specified by the user for serverless pipelines. */ serverlessComputeId?: string | undefined; } -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface PipelineState {} - -export interface PipelineStateInfo { - /** The unique identifier of the pipeline. */ +export interface CreatePipelineResponse { + /** The unique identifier for the newly created pipeline. Only returned when dry_run is false. */ pipelineId?: string | undefined; - state?: PipelineState_PipelineState | undefined; - /** The unique identifier of the cluster running the pipeline. */ - clusterId?: string | undefined; - /** The user-friendly name of the pipeline. */ - name?: string | undefined; - /** Status of the latest updates for the pipeline. Ordered with the newest update first. */ - latestUpdates?: UpdateStateInfo[] | undefined; - /** The username of the pipeline creator. */ - creatorUserName?: string | undefined; - /** The username that the pipeline runs as. This is a read only value derived from the pipeline owner. */ - runAsUserName?: string | undefined; - /** The health of a pipeline. */ - health?: PipelineHealthStatus | undefined; + /** Only returned when dry_run is true. */ + effectiveSettings?: PipelineSpec | undefined; } -export interface PipelineTrigger { +export interface CreatePipelineTrigger { trigger?: - | {$case: 'manual'; manual: ManualTrigger} - | {$case: 'cron'; cron: CronTrigger} + | {$case: 'manual'; manual: CreateManualTrigger} + | {$case: 'cron'; cron: CreateCronTrigger} | undefined; } -export interface PipelinesAutoScale { +export interface CreatePipelinesAutoScale { /** * The minimum number of workers the cluster can scale down to when underutilized. * It is also the initial number of workers the cluster will have after creation. */ - minWorkers?: number | undefined; + minWorkers: number; /** The maximum number of workers to which the cluster can scale up when overloaded. `max_workers` must be strictly greater than `min_workers`. */ - maxWorkers?: number | undefined; + maxWorkers: number; /** * Databricks Enhanced Autoscaling optimizes cluster utilization by automatically * allocating cluster resources based on workload volume, with minimal impact to @@ -1962,7 +1317,7 @@ export interface PipelinesAutoScale { } /** Attributes set during cluster creation which are related to Amazon Web Services. */ -export interface PipelinesAwsAttributes { +export interface CreatePipelinesAwsAttributes { /** * The first ``first_on_demand`` nodes of the cluster will be placed on on-demand instances. * If this value is greater than 0, the cluster driver node in particular will be placed on an @@ -2051,7 +1406,7 @@ export interface PipelinesAwsAttributes { } /** Attributes set during cluster creation which are related to Azure. */ -export interface PipelinesAzureAttributes { +export interface CreatePipelinesAzureAttributes { /** * The first ``first_on_demand`` nodes of the cluster will be placed on on-demand instances. * This value should be greater than 0, to make sure the cluster driver node is placed on an @@ -2078,7 +1433,7 @@ export interface PipelinesAzureAttributes { } /** Cluster log delivery config */ -export interface PipelinesClusterLogConf { +export interface CreatePipelinesClusterLogConf { storageInfo?: | { $case: 'dbfs'; @@ -2086,13 +1441,13 @@ export interface PipelinesClusterLogConf { * destination needs to be provided. e.g. * ``{ "dbfs" : { "destination" : "dbfs:/home/cluster_log" } }`` */ - dbfs: PipelinesDbfsStorageInfo; + dbfs: CreatePipelinesDbfsStorageInfo; } | undefined; } /** A storage location in DBFS */ -export interface PipelinesDbfsStorageInfo { +export interface CreatePipelinesDbfsStorageInfo { /** dbfs destination, e.g. ``dbfs:/my/path`` */ destination?: string | undefined; } @@ -2101,7 +1456,7 @@ export interface PipelinesDbfsStorageInfo { * The environment entity used to preserve serverless environment side panel, jobs' environment for non-notebook task, and SDP's environment for classic and serverless pipelines. * In this minimal environment spec, only pip dependencies are supported. */ -export interface PipelinesEnvironment { +export interface CreatePipelinesEnvironment { /** * List of pip dependencies, as supported by the version of pip in this environment. * Each dependency is a pip requirement file line https://pip.pypa.io/en/stable/reference/requirements-file-format/ @@ -2124,7 +1479,7 @@ export interface PipelinesEnvironment { } /** Attributes set during cluster creation which are related to Gcp. */ -export interface PipelinesGcpAttributes { +export interface CreatePipelinesGcpAttributes { /** * If provided, the cluster will impersonate the google service account when accessing * gcloud services (like GCS). The google service account @@ -2165,7 +1520,7 @@ export interface PipelinesGcpAttributes { } /** Config for an individual init script */ -export interface PipelinesInitScriptInfo { +export interface CreatePipelinesInitScriptInfo { storageInfo?: | { $case: 'dbfs'; @@ -2173,7 +1528,7 @@ export interface PipelinesInitScriptInfo { * destination needs to be provided. e.g. * ``{ "dbfs" : { "destination" : "dbfs:/init-scripts/my_script.sh" } }`` */ - dbfs: PipelinesDbfsStorageInfo; + dbfs: CreatePipelinesDbfsStorageInfo; } | { $case: 's3'; @@ -2183,7 +1538,7 @@ export interface PipelinesInitScriptInfo { * Cluster iam role is used to access s3, please make sure the cluster iam role in * ``instance_profile_arn`` has permission to write data to the s3 destination. */ - s3: PipelinesS3StorageInfo; + s3: CreatePipelinesS3StorageInfo; } | undefined; } @@ -2193,7 +1548,7 @@ export interface PipelinesInitScriptInfo { * * Only `user_name` or `service_principal_name` can be specified. If both are specified, an error is thrown. */ -export interface PipelinesJobRunAs { +export interface CreatePipelinesJobRunAs { identity?: | { $case: 'userName'; @@ -2208,9 +1563,9 @@ export interface PipelinesJobRunAs { | undefined; } -export interface PipelinesMavenLibrary { +export interface CreatePipelinesMavenLibrary { /** Gradle-style maven coordinates. For example: "org.jsoup:jsoup:1.7.2". */ - coordinates?: string | undefined; + coordinates: string; /** * Maven repo to install the Maven package from. If omitted, both Maven Central Repository * and Spark Packages are searched. @@ -2226,7 +1581,7 @@ export interface PipelinesMavenLibrary { } /** A storage location in Amazon S3 */ -export interface PipelinesS3StorageInfo { +export interface CreatePipelinesS3StorageInfo { /** * S3 destination, e.g. ``s3://my-bucket/some-prefix`` Note that logs will be delivered using * cluster iam role, please make sure you set cluster iam role and the role has write access to the @@ -2265,13 +1620,13 @@ export interface PipelinesS3StorageInfo { } /** PG-specific catalog-level configuration parameters */ -export interface PostgresCatalogConfig { +export interface CreatePostgresCatalogConfig { /** Optional. The Postgres slot configuration to use for logical replication */ - slotConfig?: PostgresSlotConfig | undefined; + slotConfig?: CreatePostgresSlotConfig | undefined; } /** PostgresSlotConfig contains the configuration for a Postgres logical replication slot */ -export interface PostgresSlotConfig { +export interface CreatePostgresSlotConfig { /** The name of the logical replication slot to use for the Postgres source */ slotName?: string | undefined; /** The name of the publication to use for the Postgres source */ @@ -2279,7 +1634,7 @@ export interface PostgresSlotConfig { } /** Specifies a replace_where predicate override for a replace where flow. */ -export interface ReplaceWhereOverride { +export interface CreateReplaceWhereOverride { /** Name of the flow to apply this override to. */ flowName?: string | undefined; /** @@ -2289,12 +1644,12 @@ export interface ReplaceWhereOverride { predicateOverride?: string | undefined; } -export interface RestartWindow { +export interface CreateRestartWindow { /** * An integer between 0 and 23 denoting the start hour for the restart window in the 24-hour day. * Continuous pipeline restart is triggered only within a five-hour window starting at this hour. */ - startHour?: number | undefined; + startHour: number; /** * Days of week in which the restart is allowed to happen (within a five-hour window starting at start_hour). * If not specified all days of the week will be used. @@ -2308,7 +1663,7 @@ export interface RestartWindow { } /** Configuration for rewinding a specific dataset. */ -export interface RewindDatasetSpec { +export interface CreateRewindDatasetSpec { /** The identifier of the dataset (e.g., "main.foo.tbl1"). */ identifier?: string | undefined; /** Whether to cascade the rewind to dependent datasets. Must be specified. */ @@ -2318,7 +1673,7 @@ export interface RewindDatasetSpec { } /** Information about a rewind being requested for this pipeline or some of the datasets in it. */ -export interface RewindSpec { +export interface CreateRewindSpec { /** * The base timestamp to rewind to. Exactly one of rewind_timestamp or rewind_point_id must be * specified. @@ -2330,29 +1685,10 @@ export interface RewindSpec { * List of datasets to rewind with specific configuration for each. When not specified, * all datasets will be rewound with cascade = true and reset_checkpoints = true. */ - datasets?: RewindDatasetSpec[] | undefined; -} - -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface ScdType {} - -export interface Sequencing { - /** the ID assigned by the data plane. */ - dataPlaneId?: DataPlaneId | undefined; - /** A sequence number, unique and increasing per pipeline. */ - controlPlaneSeqNo?: bigint | undefined; -} - -export interface SerializedException { - /** Runtime class of the exception */ - className?: string | undefined; - /** Exception message */ - message?: string | undefined; - /** Stack trace consisting of a list of stack frames */ - stack?: StackFrame[] | undefined; + datasets?: CreateRewindDatasetSpec[] | undefined; } -export interface SharepointOptions { +export interface CreateSharepointOptions { /** Required. The SharePoint URL. */ url?: string | undefined; /** @@ -2361,11 +1697,11 @@ export interface SharepointOptions { */ entityType?: SharepointOptions_SharepointEntityType | undefined; /** (Optional) File ingestion options for processing files. */ - fileIngestionOptions?: FileIngestionOptions | undefined; + fileIngestionOptions?: CreateFileIngestionOptions | undefined; } /** Smartsheet specific options for ingestion */ -export interface SmartsheetOptions { +export interface CreateSmartsheetOptions { /** * (Optional) When true, maps each column to its Smartsheet-declared type (Text/Number/Date/ * Checkbox/etc.). Cells that do not conform to the declared type are set to NULL. @@ -2377,7 +1713,7 @@ export interface SmartsheetOptions { } /** SourceCatalogConfig contains catalog-level custom configuration parameters for each source */ -export interface SourceCatalogConfig { +export interface CreateSourceCatalogConfig { /** Source catalog name */ sourceCatalog?: string | undefined; /** Configuration options for the source catalog */ @@ -2385,85 +1721,25 @@ export interface SourceCatalogConfig { | { $case: 'postgres'; /** Postgres-specific catalog-level configuration parameters */ - postgres: PostgresCatalogConfig; + postgres: CreatePostgresCatalogConfig; } | undefined; } -export interface SourceConfig { +export interface CreateSourceConfig { /** Catalog-level source configuration parameters */ - catalog?: SourceCatalogConfig | undefined; + catalog?: CreateSourceCatalogConfig | undefined; /** * Connector-specific top-level configuration. Values here act as defaults and * can be overridden by the same field in the object-level connector_options. */ connectorConfig?: - | {$case: 'googleAdsConfig'; googleAdsConfig: GoogleAdsConfig} + | {$case: 'googleAdsConfig'; googleAdsConfig: CreateGoogleAdsConfig} | undefined; } -export interface StackFrame { - /** Class from which the method call originated */ - declaringClass?: string | undefined; - /** Name of the method which was called */ - methodName?: string | undefined; - /** File where the method is defined */ - fileName?: string | undefined; - /** Line from which the method was called */ - lineNumber?: number | undefined; -} - -export interface StartUpdateRequest { - pipelineId?: string | undefined; - /** If true, this update will reset all tables before running. */ - fullRefresh?: boolean | undefined; - cause?: UpdateCause | undefined; - /** - * A list of tables to update without fullRefresh. If both refresh_selection and - * full_refresh_selection are empty, this is a full graph update. Full Refresh on a table means - * that the states of the table will be reset before the refresh. - */ - refreshSelection?: string[] | undefined; - /** - * A list of tables to update with fullRefresh. If both refresh_selection and - * full_refresh_selection are empty, this is a full graph update. Full Refresh on a table means - * that the states of the table will be reset before the refresh. - */ - fullRefreshSelection?: string[] | undefined; - /** - * A list of flows for which this update should reset the streaming checkpoint. This selection will not clear - * the data in the flow's target table. Flows in this list may also appear in refresh_selection and full_refresh_selection. - */ - resetCheckpointSelection?: string[] | undefined; - /** If true, this update only validates the correctness of pipeline source code but does not materialize or publish any datasets. */ - validateOnly?: boolean | undefined; - /** - * The information about the requested rewind operation. - * If specified this is a rewind mode update. - */ - rewindSpec?: RewindSpec | undefined; - /** Key/value map of parameters to pass to the pipeline execution */ - parameters?: Record | undefined; - /** - * 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. - */ - replaceWhereOverrides?: ReplaceWhereOverride[] | undefined; -} - -export interface StartUpdateResponse { - updateId?: string | undefined; -} - -export interface StopPipelineRequest { - pipelineId?: string | undefined; -} - -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface StopPipelineResponse {} - /** TikTok Ads specific options for ingestion */ -export interface TikTokAdsOptions { +export interface CreateTikTokAdsOptions { /** * (Optional) Number of days to look back for report tables during incremental sync * to capture late-arriving conversions and attribution data. @@ -2487,7 +1763,7 @@ export interface TikTokAdsOptions { } /** Specifies how to transform binary data into structured data. */ -export interface Transformer { +export interface CreateTransformer { /** Required: the wire format of the data. */ format?: Transformer_Format | undefined; /** @@ -2495,15 +1771,2107 @@ export interface Transformer { * STRING format requires no additional config. */ config?: - | {$case: 'jsonOptions'; jsonOptions: JsonTransformerOptions} + | {$case: 'jsonOptions'; jsonOptions: CreateJsonTransformerOptions} | undefined; } -/** Information about truncations applied to this event. */ -export interface Truncation { +/** Zendesk Support specific options for ingestion */ +export interface CreateZendeskSupportOptions { /** - * List of fields that were truncated from this event. If empty or absent, - * no truncation occurred. + * (Optional) Start date in YYYY-MM-DD format for the initial sync. + * This determines the earliest date from which to sync historical data. + */ + startDate?: string | undefined; +} + +export interface CronTrigger { + quartzCronSchedule?: string | undefined; + timezoneId?: string | undefined; +} + +export interface DataPlaneId { + /** The instance name of the data plane emitting an event. */ + instance?: string | undefined; + /** A sequence number, unique and increasing within the data plane instance. */ + seqNo?: bigint | undefined; +} + +/** Location of staged data storage */ +export interface DataStagingOptions { + /** (Required, Immutable) The name of the catalog for the connector's staging storage location. */ + catalogName?: string | undefined; + /** (Required, Immutable) The name of the schema for the connector's staging storage location. */ + schemaName?: string | undefined; + /** + * (Optional) The Unity Catalog-compatible name for the storage location. + * This is the volume to use for the data that is extracted by the connector. + * Spark Declarative Pipelines system will automatically create the volume under the catalog and schema. + * For Combined Cdc Managed Ingestion pipelines default name for the volume would be : + * __databricks_ingestion_gateway_staging_data-$pipelineId + */ + volumeName?: string | undefined; +} + +export interface DeletePipelineRequest { + pipelineId?: string | undefined; + /** + * If true, deletion will proceed even if resource cleanup fails. + * By default, deletion will fail if resources cleanup is required but fails. + */ + force?: boolean | undefined; + /** + * If false, pipeline deletion will not cascade to its datasets (MVs, STs, Views). + * By default, this parameter will be true and all tables will be deleted with the pipeline. + */ + cascade?: boolean | undefined; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface DeletePipelineResponse {} + +export interface EditPipelineRequest { + /** Unique identifier for this pipeline. */ + pipelineId?: string | undefined; + /** If false, deployment will fail if name has changed and conflicts the name of another pipeline. */ + allowDuplicateNames?: boolean | undefined; + /** + * If present, the last-modified time of the pipeline settings before the edit. + * If the settings were modified after that time, then the request will fail with + * a conflict. + */ + expectedLastModified?: bigint | undefined; + runAs?: CreatePipelinesJobRunAs | undefined; + /** + * Key/value map of default parameters to use for pipeline execution. + * Maximum total size: 10k characters (JSON format) + */ + parameters?: Record | undefined; + /** Unique identifier for this pipeline. */ + id?: string | undefined; + /** Friendly identifier for this pipeline. */ + name?: string | undefined; + /** DBFS root directory for storing checkpoints and tables. */ + storage?: string | undefined; + /** String-String configuration for this pipeline execution. */ + configuration?: Record | undefined; + /** Cluster settings for this pipeline deployment. */ + clusters?: CreatePipelineCluster[] | undefined; + /** Libraries or code needed by this deployment. */ + libraries?: CreatePipelineLibrary[] | undefined; + /** The configuration for a managed ingestion pipeline. These settings cannot be used with the 'libraries', 'schema', 'target', or 'catalog' settings. */ + ingestionDefinition?: CreateIngestionPipelineDefinition | undefined; + /** The definition of a gateway pipeline to support change data capture. */ + gatewayDefinition?: CreateIngestionGatewayPipelineDefinition | undefined; + /** Which pipeline trigger to use. Deprecated: Use `continuous` instead. */ + trigger?: CreatePipelineTrigger | undefined; + /** Target schema (database) to add tables in this pipeline to. Exactly one of `schema` or `target` must be specified. To publish to Unity Catalog, also specify `catalog`. This legacy field is deprecated for pipeline creation in favor of the `schema` field. */ + target?: string | undefined; + /** The default schema (database) where tables are read from or published to. */ + schema?: string | undefined; + /** Filters on which Pipeline packages to include in the deployed graph. */ + filters?: CreateFilters | undefined; + /** Whether the pipeline is continuous or triggered. This replaces `trigger`. */ + continuous?: boolean | undefined; + /** Whether the pipeline is in Development mode. Defaults to false. */ + development?: boolean | undefined; + /** Whether Photon is enabled for this pipeline. */ + photon?: boolean | undefined; + /** Pipeline product edition. */ + edition?: string | undefined; + /** SDP Release Channel that specifies which version to use. */ + channel?: string | undefined; + /** A catalog in Unity Catalog to publish data from this pipeline to. If `target` is specified, tables in this pipeline are published to a `target` schema inside `catalog` (for example, `catalog`.`target`.`table`). If `target` is not specified, no data is published to Unity Catalog. */ + catalog?: string | undefined; + /** List of notification settings for this pipeline. */ + notifications?: CreateNotifications[] | undefined; + /** Whether serverless compute is enabled for this pipeline. */ + serverless?: boolean | undefined; + /** Deployment type of this pipeline. */ + deployment?: CreatePipelineDeployment | undefined; + /** Restart window of this pipeline. */ + restartWindow?: CreateRestartWindow | undefined; + /** Budget policy of this pipeline. */ + budgetPolicyId?: string | undefined; + /** + * A map of tags associated with the pipeline. + * These are forwarded to the cluster as cluster tags, and are therefore subject to the same limitations. + * A maximum of 25 tags can be added to the pipeline. + */ + tags?: Record | undefined; + /** Event log configuration for this pipeline */ + eventLog?: CreateEventLogSpec | undefined; + /** + * Root path for this pipeline. + * This is used as the root directory when editing the pipeline in the user interface and it is + * added to sys.path when executing Python sources during pipeline execution. + */ + rootPath?: string | undefined; + /** Environment specification for this pipeline used to install dependencies. */ + environment?: CreatePipelinesEnvironment | undefined; + /** Usage policy of this pipeline. */ + usagePolicyId?: string | undefined; + /** Serverless compute ID specified by the user for serverless pipelines. */ + serverlessComputeId?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface EditPipelineResponse {} + +export interface ErrorDetail { + /** The exception thrown for this error, with its chain of cause. */ + exceptions?: SerializedException[] | undefined; + /** Whether this error is considered fatal, that is, unrecoverable. */ + fatal?: boolean | undefined; +} + +/** Configurable event log parameters. */ +export interface EventLogSpec { + /** The name the event log is published to in UC. */ + name?: string | undefined; + /** The UC schema the event log is published under. */ + schema?: string | undefined; + /** The UC catalog the event log is published under. */ + catalog?: string | undefined; +} + +export interface FileFilter { + filter?: + | { + $case: 'pathFilter'; + /** + * Include files with file names matching the pattern + * Based on https://spark.apache.org/docs/latest/sql-data-sources-generic-options.html#path-glob-filter + */ + pathFilter: string; + } + | { + $case: 'modifiedBefore'; + /** + * Include files with modification times occurring before the specified time. + * Timestamp format: YYYY-MM-DDTHH:mm:ss (e.g. 2020-06-01T13:00:00) + * Based on https://spark.apache.org/docs/latest/sql-data-sources-generic-options.html#modification-time-path-filters + */ + modifiedBefore: string; + } + | { + $case: 'modifiedAfter'; + /** + * Include files with modification times occurring after the specified time. + * Timestamp format: YYYY-MM-DDTHH:mm:ss (e.g. 2020-06-01T13:00:00) + * Based on https://spark.apache.org/docs/latest/sql-data-sources-generic-options.html#modification-time-path-filters + */ + modifiedAfter: string; + } + | undefined; +} + +export interface FileIngestionOptions { + /** required for TableSpec */ + format?: FileIngestionOptions_FileFormat | undefined; + /** Generic options */ + fileFilters?: FileFilter[] | undefined; + inferColumnTypes?: boolean | undefined; + schemaEvolutionMode?: FileIngestionOptions_SchemaEvolutionMode | undefined; + /** + * Override inferred schema of specific columns + * Based on https://docs.databricks.com/aws/en/ingestion/cloud-object-storage/auto-loader/schema#override-schema-inference-with-schema-hints + */ + schemaHints?: string | undefined; + ignoreCorruptFiles?: boolean | undefined; + corruptRecordColumn?: string | undefined; + rescuedDataColumn?: string | undefined; + singleVariantColumn?: string | undefined; + /** + * Column name case sensitivity + * https://docs.databricks.com/aws/en/ingestion/cloud-object-storage/auto-loader/schema#change-case-sensitive-behavior + */ + readerCaseSensitive?: boolean | undefined; + /** + * Format-specific options + * Based on https://docs.databricks.com/aws/en/ingestion/cloud-object-storage/auto-loader/options#file-format-options + */ + formatOptions?: Record | undefined; +} + +export interface Filters { + /** Paths to include. */ + include?: string[] | undefined; + /** Paths to exclude. */ + exclude?: string[] | undefined; +} + +export interface GetPipelineRequest { + pipelineId?: string | undefined; +} + +export interface GetPipelineResponse { + /** The ID of the pipeline. */ + pipelineId?: string | undefined; + /** The pipeline specification. This field is not returned when called by `ListPipelines`. */ + spec?: PipelineSpec | undefined; + /** The pipeline state. */ + state?: PipelineState_PipelineState | undefined; + /** An optional message detailing the cause of the pipeline state. */ + cause?: string | undefined; + /** The ID of the cluster that the pipeline is running on. */ + clusterId?: string | undefined; + /** A human friendly identifier for the pipeline, taken from the `spec`. */ + name?: string | undefined; + /** The health of a pipeline. */ + health?: PipelineHealthStatus | undefined; + /** The username of the pipeline creator. */ + creatorUserName?: string | undefined; + /** Status of the latest updates for the pipeline. Ordered with the newest update first. */ + latestUpdates?: UpdateStateInfo[] | undefined; + /** The last time the pipeline settings were modified or created. */ + lastModified?: bigint | undefined; + /** Username of the user that the pipeline will run on behalf of. */ + runAsUserName?: string | undefined; + /** Serverless budget policy ID of this pipeline. */ + effectiveBudgetPolicyId?: string | undefined; + /** Publishing mode of the pipeline */ + effectivePublishingMode?: PublishingMode | undefined; + /** + * The user or service principal that the pipeline runs as, if specified in the request. + * This field indicates the explicit configuration of `run_as` for the pipeline. + * To find the value in all cases, explicit or implicit, use `run_as_user_name`. + */ + runAs?: PipelinesJobRunAs | undefined; + /** + * Key/value map of default parameters to use for pipeline execution. + * Maximum total size: 10k characters (JSON format) + */ + parameters?: Record | undefined; +} + +export interface GetUpdateRequest { + /** The ID of the pipeline. */ + pipelineId?: string | undefined; + /** The ID of the update. */ + updateId?: string | undefined; +} + +export interface GetUpdateResponse { + /** The current update info. */ + update?: UpdateInfo | undefined; +} + +export interface GoogleAdsConfig { + /** + * (Required) Manager Account ID (also called MCC Account ID) used to list and access + * customer accounts under this manager account. This is required for fetching the list + * of customer accounts during source selection. + * If the same field is also set in the object-level GoogleAdsOptions (connector_options), + * the object-level value takes precedence over this top-level config. + */ + managerAccountId?: string | undefined; +} + +/** + * Google Ads specific options for ingestion (object-level). + * When set, these values override the corresponding fields in GoogleAdsConfig + * (source_configurations). + */ +export interface GoogleAdsOptions { + /** + * (Optional at this level) Manager Account ID (also called MCC Account ID) used to list + * and access customer accounts under this manager account. + * Overrides GoogleAdsConfig.manager_account_id from source_configurations when set. + */ + managerAccountId?: string | undefined; + /** + * (Optional) Number of days to look back for report tables to capture late-arriving data. + * If not specified, defaults to 30 days. + */ + lookbackWindowDays?: number | undefined; + /** + * (Optional) Start date for the initial sync of report tables in YYYY-MM-DD format. + * This determines the earliest date from which to sync historical data. + * If not specified, defaults to 2 years of historical data. + */ + syncStartDate?: string | undefined; +} + +export interface GoogleDriveOptions { + /** Google Drive URL. */ + url?: string | undefined; + entityType?: GoogleDriveOptions_GoogleDriveEntityType | undefined; + fileIngestionOptions?: FileIngestionOptions | undefined; +} + +export interface IngestionGatewayPipelineDefinition { + /** Immutable. The Unity Catalog connection that this gateway pipeline uses to communicate with the source. */ + connectionName?: string | undefined; + /** [Deprecated, use connection_name instead] Immutable. The Unity Catalog connection that this gateway pipeline uses to communicate with the source. */ + connectionId?: string | undefined; + /** Required, Immutable. The name of the catalog for the gateway pipeline's storage location. */ + gatewayStorageCatalog?: string | undefined; + /** Required, Immutable. The name of the schema for the gateway pipelines's storage location. */ + gatewayStorageSchema?: string | undefined; + /** + * Optional. The Unity Catalog-compatible name for the gateway storage location. + * This is the destination to use for the data that is extracted by the gateway. + * Spark Declarative Pipelines system will automatically create the storage location under the catalog and schema. + */ + gatewayStorageName?: string | undefined; + /** Optional, Internal. Parameters required to establish an initial connection with the source. */ + connectionParameters?: ConnectionParameters | undefined; +} + +export interface IngestionPipelineDefinition { + /** + * (Required, Mutable) Identifies the data source for the Lakeflow Connect Ingestion pipeline. + * Exactly one option must be specified. + */ + source?: + | { + $case: 'connectionName'; + /** + * The Unity Catalog connection that this ingestion pipeline uses to communicate with the source. This is used with + * both connectors for applications like Salesforce, Workday, and so on, and also database connectors like Oracle, + * (connector_type = QUERY_BASED OR connector_type = CDC). + * If connection name corresponds to database connectors like Oracle, and connector_type is not provided then + * connector_type defaults to QUERY_BASED. If connector_type is passed as CDC we use Combined Cdc Managed Ingestion + * pipeline. + * Under certain conditions, this can be replaced with ingestion_gateway_id to change the connector to Cdc Managed + * Ingestion Pipeline with Gateway pipeline. + */ + connectionName: string; + } + | { + $case: 'ingestionGatewayId'; + /** + * Identifier for the gateway that is used by this ingestion pipeline to communicate with the source database. + * This is used with CDC connectors to databases like SQL Server using a gateway pipeline (connector_type = CDC). + * Under certain conditions, this can be replaced with connection_name to change the connector to Combined Cdc + * Managed Ingestion Pipeline. + */ + ingestionGatewayId: string; + } + | { + $case: 'ingestFromUcForeignCatalog'; + /** + * Immutable. If set to true, the pipeline will ingest tables from the + * UC foreign catalogs directly without the need to specify a UC connection or ingestion gateway. + * The `source_catalog` fields in objects of IngestionConfig are interpreted as + * the UC foreign catalogs to ingest from. + */ + ingestFromUcForeignCatalog: boolean; + } + | undefined; + /** Required. Settings specifying tables to replicate and the destination for the replicated tables. */ + objects?: IngestionPipelineDefinition_IngestionConfig[] | undefined; + /** + * The type of the foreign source. + * The source type will be inferred from the source connection or ingestion gateway. + * This field is output only and will be ignored if provided. + */ + sourceType?: IngestionSourceType | undefined; + /** Configuration settings to control the ingestion of tables. These settings are applied to all tables in the pipeline. */ + tableConfiguration?: + | IngestionPipelineDefinition_TableSpecificConfig + | undefined; + /** + * Netsuite only configuration. When the field is set for a netsuite connector, + * the jar stored in the field will be validated and added to the classpath of + * pipeline's cluster. + */ + netsuiteJarPath?: string | undefined; + /** Top-level source configurations */ + sourceConfigurations?: SourceConfig[] | undefined; + /** (Optional) A window that specifies a set of time ranges for snapshot queries in CDC. */ + fullRefreshWindow?: OperationTimeWindow | undefined; + /** (Optional) Connector Type for sources. Ex: CDC, Query Based. */ + connectorType?: ConnectorType | undefined; + /** + * (Optional) Location of staged data storage. This is required for migration from Cdc Managed Ingestion Pipeline + * with Gateway pipeline to Combined Cdc Managed Ingestion Pipeline. + * If not specified, the volume for staged data will be created in catalog and schema/target specified in the + * top level pipeline definition. + */ + dataStagingOptions?: DataStagingOptions | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngestionPipelineDefinition_CreateIngestionConfig { + sourceTables?: + | { + $case: 'schema'; + /** Select all tables from a specific source schema. */ + schema: IngestionPipelineDefinition_CreateSchemaSpec; + } + | { + $case: 'table'; + /** Select a specific source table. */ + table: IngestionPipelineDefinition_CreateTableSpec; + } + | { + $case: 'report'; + /** Select a specific source report. */ + report: IngestionPipelineDefinition_CreateReportSpec; + } + | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngestionPipelineDefinition_CreateReportSpec { + /** Required. Report URL in the source system. */ + sourceUrl: string; + /** Required. Destination catalog to store table. */ + destinationCatalog: string; + /** Required. Destination schema to store table. */ + destinationSchema: string; + /** Required. Destination table name. The pipeline fails if a table with that name already exists. */ + destinationTable?: string | undefined; + /** Configuration settings to control the ingestion of tables. These settings override the table_configuration defined in the IngestionPipelineDefinition object. */ + tableConfiguration?: + | IngestionPipelineDefinition_CreateTableSpecificConfig + | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngestionPipelineDefinition_CreateSchemaSpec { + /** The source catalog name. Might be optional depending on the type of source. */ + sourceCatalog?: string | undefined; + /** Required. Schema name in the source database. */ + sourceSchema: string; + /** Required. Destination catalog to store tables. */ + destinationCatalog: string; + /** Required. Destination schema to store tables in. Tables with the same name as the source tables are created in this destination schema. The pipeline fails If a table with the same name already exists. */ + destinationSchema: string; + /** Configuration settings to control the ingestion of tables. These settings are applied to all tables in this schema and override the table_configuration defined in the IngestionPipelineDefinition object. */ + tableConfiguration?: + | IngestionPipelineDefinition_CreateTableSpecificConfig + | undefined; + /** (Optional) Source Specific Connector Options */ + connectorOptions?: CreateConnectorOptions | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngestionPipelineDefinition_CreateTableSpec { + /** Source catalog name. Might be optional depending on the type of source. */ + sourceCatalog?: string | undefined; + /** Schema name in the source database. Might be optional depending on the type of source. */ + sourceSchema?: string | undefined; + /** Required. Table name in the source database. */ + sourceTable: string; + /** Required. Destination catalog to store table. */ + destinationCatalog: string; + /** Required. Destination schema to store table. */ + destinationSchema: string; + /** Optional. Destination table name. The pipeline fails if a table with that name already exists. If not set, the source table name is used. */ + destinationTable?: string | undefined; + /** Configuration settings to control the ingestion of tables. These settings override the table_configuration defined in the IngestionPipelineDefinition object and the SchemaSpec. */ + tableConfiguration?: + | IngestionPipelineDefinition_CreateTableSpecificConfig + | undefined; + /** (Optional) Source Specific Connector Options */ + connectorOptions?: CreateConnectorOptions | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngestionPipelineDefinition_CreateTableSpecificConfig { + scdType?: ScdType_ScdType | undefined; + /** The primary key of the table used to apply changes. */ + primaryKeys?: string[] | undefined; + /** The column names specifying the logical order of events in the source data. Spark Declarative Pipelines uses this sequencing to handle change events that arrive out of order. */ + sequenceBy?: string[] | undefined; + /** + * A list of column names to be included for the ingestion. + * When not specified, all columns except ones in exclude_columns will be included. Future + * columns will be automatically included. + * When specified, all other future columns will be automatically excluded from ingestion. + * This field in mutually exclusive with `exclude_columns`. + */ + includeColumns?: string[] | undefined; + /** + * A list of column names to be excluded for the ingestion. + * When not specified, include_columns fully controls what columns to be ingested. + * When specified, all other columns including future ones will be automatically included for ingestion. + * This field in mutually exclusive with `include_columns`. + */ + excludeColumns?: string[] | undefined; + /** If true, formula fields defined in the table are included in the ingestion. This setting is only valid for the Salesforce connector */ + salesforceIncludeFormulaFields?: boolean | undefined; + /** (Optional) Additional custom parameters for Workday Report */ + workdayReportParameters?: + | IngestionPipelineDefinition_CreateWorkdayReportParameters + | undefined; + /** + * (Optional, Immutable) The row filter condition to be applied to the table. + * It must not contain the WHERE keyword, only the actual filter condition. + * It must be in DBSQL format. + */ + rowFilter?: string | undefined; + queryBasedConnectorConfig?: + | IngestionPipelineDefinition_TableSpecificConfig_CreateQueryBasedConnectorConfig + | undefined; + /** + * (Optional, Mutable) Policy for auto full refresh, if enabled pipeline will automatically try + * to fix issues by doing a full refresh on the table in the retry run. auto_full_refresh_policy + * in table configuration will override the above level auto_full_refresh_policy. + * For example, + * { + * "auto_full_refresh_policy": { + * "enabled": true, + * "min_interval_hours": 23, + * } + * } + * If unspecified, auto full refresh is disabled. + */ + autoFullRefreshPolicy?: CreateAutoFullRefreshPolicy | undefined; + /** + * Table properties to set on the destination table. + * These are key-value pairs that configure various Delta table behaviors or any user defined properties. + * Example: {"delta.feature.variantType": "supported", "delta.enableTypeWidening": "true"} + * Note: table_properties in table specific configuration will override the table_properties of the pipeline definition. + */ + tableProperties?: Record | undefined; + /** + * Whether to enable auto clustering on the destination table. + * When enabled, Delta will automatically optimize the data layout + * based on the clustering columns for improved query performance. + * Note: enable_auto_clustering in table specific configuration will override the pipeline definition. + * Note: we can only provide enable_auto_clustering or clustering_columns, + * added as separate fields as we cannot have repeated field in oneof. + */ + enableAutoClustering?: boolean | undefined; + /** + * List of column names to use for clustering the destination table. + * When specified, the destination Delta table will be clustered by these columns. + * This can improve query performance when filtering on these columns. + * Note: clustering_columns in table specific configuration will override the pipeline definition. + * Note: we can only provide enable_auto_clustering or clustering_columns, + * added as separate fields as we cannot have repeated field in oneof. + */ + clusteringColumns?: string[] | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngestionPipelineDefinition_CreateWorkdayReportParameters { + /** + * (Optional) Marks the report as incremental. + * This field is deprecated and should not be used. Use `parameters` instead. The incremental behavior is now + * controlled by the `parameters` field. + */ + incremental?: boolean | undefined; + /** + * (Optional) Additional custom parameters for Workday Report + * This field is deprecated and should not be used. Use `parameters` instead. + */ + reportParameters?: + | IngestionPipelineDefinition_WorkdayReportParameters_CreateQueryKeyValue[] + | undefined; + /** + * Parameters for the Workday report. Each key represents the parameter name (e.g., "start_date", "end_date"), + * and the corresponding value is a SQL-like expression used to compute the parameter value at runtime. + * Example: + * { + * "start_date": "{ coalesce(current_offset(), date(\"2025-02-01\")) }", + * "end_date": "{ current_date() - INTERVAL 1 DAY }" + * } + */ + parameters?: Record | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngestionPipelineDefinition_IngestionConfig { + sourceTables?: + | { + $case: 'schema'; + /** Select all tables from a specific source schema. */ + schema: IngestionPipelineDefinition_SchemaSpec; + } + | { + $case: 'table'; + /** Select a specific source table. */ + table: IngestionPipelineDefinition_TableSpec; + } + | { + $case: 'report'; + /** Select a specific source report. */ + report: IngestionPipelineDefinition_ReportSpec; + } + | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngestionPipelineDefinition_ReportSpec { + /** Required. Report URL in the source system. */ + sourceUrl?: string | undefined; + /** Required. Destination catalog to store table. */ + destinationCatalog?: string | undefined; + /** Required. Destination schema to store table. */ + destinationSchema?: string | undefined; + /** Required. Destination table name. The pipeline fails if a table with that name already exists. */ + destinationTable?: string | undefined; + /** Configuration settings to control the ingestion of tables. These settings override the table_configuration defined in the IngestionPipelineDefinition object. */ + tableConfiguration?: + | IngestionPipelineDefinition_TableSpecificConfig + | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngestionPipelineDefinition_SchemaSpec { + /** The source catalog name. Might be optional depending on the type of source. */ + sourceCatalog?: string | undefined; + /** Required. Schema name in the source database. */ + sourceSchema?: string | undefined; + /** Required. Destination catalog to store tables. */ + destinationCatalog?: string | undefined; + /** Required. Destination schema to store tables in. Tables with the same name as the source tables are created in this destination schema. The pipeline fails If a table with the same name already exists. */ + destinationSchema?: string | undefined; + /** Configuration settings to control the ingestion of tables. These settings are applied to all tables in this schema and override the table_configuration defined in the IngestionPipelineDefinition object. */ + tableConfiguration?: + | IngestionPipelineDefinition_TableSpecificConfig + | undefined; + /** (Optional) Source Specific Connector Options */ + connectorOptions?: ConnectorOptions | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngestionPipelineDefinition_TableSpec { + /** Source catalog name. Might be optional depending on the type of source. */ + sourceCatalog?: string | undefined; + /** Schema name in the source database. Might be optional depending on the type of source. */ + sourceSchema?: string | undefined; + /** Required. Table name in the source database. */ + sourceTable?: string | undefined; + /** Required. Destination catalog to store table. */ + destinationCatalog?: string | undefined; + /** Required. Destination schema to store table. */ + destinationSchema?: string | undefined; + /** Optional. Destination table name. The pipeline fails if a table with that name already exists. If not set, the source table name is used. */ + destinationTable?: string | undefined; + /** Configuration settings to control the ingestion of tables. These settings override the table_configuration defined in the IngestionPipelineDefinition object and the SchemaSpec. */ + tableConfiguration?: + | IngestionPipelineDefinition_TableSpecificConfig + | undefined; + /** (Optional) Source Specific Connector Options */ + connectorOptions?: ConnectorOptions | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngestionPipelineDefinition_TableSpecificConfig { + scdType?: ScdType_ScdType | undefined; + /** The primary key of the table used to apply changes. */ + primaryKeys?: string[] | undefined; + /** The column names specifying the logical order of events in the source data. Spark Declarative Pipelines uses this sequencing to handle change events that arrive out of order. */ + sequenceBy?: string[] | undefined; + /** + * A list of column names to be included for the ingestion. + * When not specified, all columns except ones in exclude_columns will be included. Future + * columns will be automatically included. + * When specified, all other future columns will be automatically excluded from ingestion. + * This field in mutually exclusive with `exclude_columns`. + */ + includeColumns?: string[] | undefined; + /** + * A list of column names to be excluded for the ingestion. + * When not specified, include_columns fully controls what columns to be ingested. + * When specified, all other columns including future ones will be automatically included for ingestion. + * This field in mutually exclusive with `include_columns`. + */ + excludeColumns?: string[] | undefined; + /** If true, formula fields defined in the table are included in the ingestion. This setting is only valid for the Salesforce connector */ + salesforceIncludeFormulaFields?: boolean | undefined; + /** (Optional) Additional custom parameters for Workday Report */ + workdayReportParameters?: + | IngestionPipelineDefinition_WorkdayReportParameters + | undefined; + /** + * (Optional, Immutable) The row filter condition to be applied to the table. + * It must not contain the WHERE keyword, only the actual filter condition. + * It must be in DBSQL format. + */ + rowFilter?: string | undefined; + queryBasedConnectorConfig?: + | IngestionPipelineDefinition_TableSpecificConfig_QueryBasedConnectorConfig + | undefined; + /** + * (Optional, Mutable) Policy for auto full refresh, if enabled pipeline will automatically try + * to fix issues by doing a full refresh on the table in the retry run. auto_full_refresh_policy + * in table configuration will override the above level auto_full_refresh_policy. + * For example, + * { + * "auto_full_refresh_policy": { + * "enabled": true, + * "min_interval_hours": 23, + * } + * } + * If unspecified, auto full refresh is disabled. + */ + autoFullRefreshPolicy?: AutoFullRefreshPolicy | undefined; + /** + * Table properties to set on the destination table. + * These are key-value pairs that configure various Delta table behaviors or any user defined properties. + * Example: {"delta.feature.variantType": "supported", "delta.enableTypeWidening": "true"} + * Note: table_properties in table specific configuration will override the table_properties of the pipeline definition. + */ + tableProperties?: Record | undefined; + /** + * Whether to enable auto clustering on the destination table. + * When enabled, Delta will automatically optimize the data layout + * based on the clustering columns for improved query performance. + * Note: enable_auto_clustering in table specific configuration will override the pipeline definition. + * Note: we can only provide enable_auto_clustering or clustering_columns, + * added as separate fields as we cannot have repeated field in oneof. + */ + enableAutoClustering?: boolean | undefined; + /** + * List of column names to use for clustering the destination table. + * When specified, the destination Delta table will be clustered by these columns. + * This can improve query performance when filtering on these columns. + * Note: clustering_columns in table specific configuration will override the pipeline definition. + * Note: we can only provide enable_auto_clustering or clustering_columns, + * added as separate fields as we cannot have repeated field in oneof. + */ + clusteringColumns?: string[] | undefined; +} + +/** Configurations that are only applicable for query-based ingestion connectors. */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngestionPipelineDefinition_TableSpecificConfig_CreateQueryBasedConnectorConfig { + /** + * The names of the monotonically increasing columns in the source table that are used to enable + * the table to be read and ingested incrementally through structured streaming. + * The columns are allowed to have repeated values but have to be non-decreasing. + * If the source data is merged into the destination (e.g., using SCD Type 1 or Type 2), these + * columns will implicitly define the `sequence_by` behavior. You can still explicitly set + * `sequence_by` to override this default. + */ + cursorColumns?: string[] | undefined; + /** + * Specifies a SQL WHERE condition that specifies that the source row has been deleted. + * This is sometimes referred to as "soft-deletes". + * For example: "Operation = 'DELETE'" or "is_deleted = true". + * This field is orthogonal to `hard_deletion_sync_interval_in_seconds`, + * one for soft-deletes and the other for hard-deletes. + * See also the hard_deletion_sync_min_interval_in_seconds field for + * handling of "hard deletes" where the source rows are physically removed from the table. + */ + deletionCondition?: string | undefined; + /** + * Specifies the minimum interval (in seconds) between snapshots on primary keys + * for detecting and synchronizing hard deletions—i.e., rows that have been + * physically removed from the source table. + * This interval acts as a lower bound. If ingestion runs less frequently than + * this value, hard deletion synchronization will align with the actual ingestion + * frequency instead of happening more often. + * If not set, hard deletion synchronization via snapshots is disabled. + * This field is mutable and can be updated without triggering a full snapshot. + */ + hardDeletionSyncMinIntervalInSeconds?: bigint | undefined; +} + +/** Configurations that are only applicable for query-based ingestion connectors. */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngestionPipelineDefinition_TableSpecificConfig_QueryBasedConnectorConfig { + /** + * The names of the monotonically increasing columns in the source table that are used to enable + * the table to be read and ingested incrementally through structured streaming. + * The columns are allowed to have repeated values but have to be non-decreasing. + * If the source data is merged into the destination (e.g., using SCD Type 1 or Type 2), these + * columns will implicitly define the `sequence_by` behavior. You can still explicitly set + * `sequence_by` to override this default. + */ + cursorColumns?: string[] | undefined; + /** + * Specifies a SQL WHERE condition that specifies that the source row has been deleted. + * This is sometimes referred to as "soft-deletes". + * For example: "Operation = 'DELETE'" or "is_deleted = true". + * This field is orthogonal to `hard_deletion_sync_interval_in_seconds`, + * one for soft-deletes and the other for hard-deletes. + * See also the hard_deletion_sync_min_interval_in_seconds field for + * handling of "hard deletes" where the source rows are physically removed from the table. + */ + deletionCondition?: string | undefined; + /** + * Specifies the minimum interval (in seconds) between snapshots on primary keys + * for detecting and synchronizing hard deletions—i.e., rows that have been + * physically removed from the source table. + * This interval acts as a lower bound. If ingestion runs less frequently than + * this value, hard deletion synchronization will align with the actual ingestion + * frequency instead of happening more often. + * If not set, hard deletion synchronization via snapshots is disabled. + * This field is mutable and can be updated without triggering a full snapshot. + */ + hardDeletionSyncMinIntervalInSeconds?: bigint | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngestionPipelineDefinition_WorkdayReportParameters { + /** + * (Optional) Marks the report as incremental. + * This field is deprecated and should not be used. Use `parameters` instead. The incremental behavior is now + * controlled by the `parameters` field. + */ + incremental?: boolean | undefined; + /** + * (Optional) Additional custom parameters for Workday Report + * This field is deprecated and should not be used. Use `parameters` instead. + */ + reportParameters?: + | IngestionPipelineDefinition_WorkdayReportParameters_QueryKeyValue[] + | undefined; + /** + * Parameters for the Workday report. Each key represents the parameter name (e.g., "start_date", "end_date"), + * and the corresponding value is a SQL-like expression used to compute the parameter value at runtime. + * Example: + * { + * "start_date": "{ coalesce(current_offset(), date(\"2025-02-01\")) }", + * "end_date": "{ current_date() - INTERVAL 1 DAY }" + * } + */ + parameters?: Record | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngestionPipelineDefinition_WorkdayReportParameters_CreateQueryKeyValue { + /** Key for the report parameter, can be a column name or other metadata */ + key?: string | undefined; + /** + * Value for the report parameter. + * Possible values it can take are these sql functions: + * 1. coalesce(current_offset(), date("YYYY-MM-DD")) -> if current_offset() is null, then the passed date, else current_offset() + * 2. current_date() + * 3. date_sub(current_date(), x) -> subtract x (some non-negative integer) days from current date + */ + value?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface IngestionPipelineDefinition_WorkdayReportParameters_QueryKeyValue { + /** Key for the report parameter, can be a column name or other metadata */ + key?: string | undefined; + /** + * Value for the report parameter. + * Possible values it can take are these sql functions: + * 1. coalesce(current_offset(), date("YYYY-MM-DD")) -> if current_offset() is null, then the passed date, else current_offset() + * 2. current_date() + * 3. date_sub(current_date(), x) -> subtract x (some non-negative integer) days from current date + */ + value?: string | undefined; +} + +/** Jira specific options for ingestion */ +export interface JiraConnectorOptions { + /** (Optional) Projects to filter Jira data on */ + includeJiraSpaces?: string[] | undefined; +} + +export interface JsonTransformerOptions { + /** Parse the entire value as a single Variant column. */ + asVariant?: boolean | undefined; + /** Inline schema string for JSON parsing (Spark DDL format). */ + schema?: string | undefined; + /** Path to a schema file (.ddl). */ + schemaFilePath?: string | undefined; + /** (Optional) Schema evolution mode for schema inference. */ + schemaEvolutionMode?: FileIngestionOptions_SchemaEvolutionMode | undefined; + /** (Optional) Schema hints as a comma-separated string of "column_name type" pairs. */ + schemaHints?: string | undefined; +} + +export interface KafkaOptions { + /** + * Topics to subscribe to. + * Only one of topics or topic_pattern must be specified. + */ + topics?: string[] | undefined; + /** + * Java regex pattern to subscribe to matching topics. + * Only one of topics or topic_pattern must be specified. + */ + topicPattern?: string | undefined; + /** + * (Optional) Transformer for the message key. + * If not specified, the key is left as raw bytes. + */ + keyTransformer?: Transformer | undefined; + /** + * (Optional) Transformer for the message value. + * If not specified, the value is left as raw bytes. + */ + valueTransformer?: Transformer | undefined; + /** + * (Optional) Where to begin reading when no checkpoint exists. + * Valid values: "latest" and "earliest". Defaults to "latest". + */ + startingOffset?: string | undefined; + /** Internal option to control the maximum number of offsets to process per trigger. */ + maxOffsetsPerTrigger?: bigint | undefined; + /** + * Undocumented backdoor mechanism for overriding parameters + * to pass to the Kafka client. + * This is not supported and may break at any time. + */ + clientConfig?: Record | undefined; +} + +/** + * The request/response messages for the ListPipelines API. The default behavior is to return + * the 25 newest events in timestamp descending order for the given pipeline. + */ +export interface ListPipelineEventsRequest { + /** The pipeline to return events for. */ + pipelineId?: string | undefined; + /** + * Page token returned by previous call. This field is mutually + * exclusive with all fields in this request except max_results. An error is + * returned if any fields other than max_results are set when this field is set. + */ + pageToken?: string | undefined; + /** + * Max number of entries to return in a single page. The system may return + * fewer than max_results events in a response, even if there are more events + * available. + */ + maxResults?: number | undefined; + /** + * A string indicating a sort order by timestamp for the results, for example, ["timestamp asc"]. + * The sort order can be ascending or descending. By default, events are returned + * in descending order by timestamp. + */ + orderBy?: string[] | undefined; + /** + * Criteria to select a subset of results, expressed using a SQL-like syntax. + * The supported filters are: + * 1. level='INFO' (or WARN or ERROR) + * 2. level in ('INFO', 'WARN') + * 3. id='[event-id]' + * 4. timestamp > 'TIMESTAMP' (or >=,<,<=,=) + * + * Composite expressions are supported, for example: level in ('ERROR', 'WARN') + * AND timestamp> '2021-07-22T06:37:33.083Z' + */ + filter?: string | undefined; +} + +export interface ListPipelineEventsResponse { + /** The list of events matching the request criteria. */ + events?: PipelineEvent[] | undefined; + /** If present, a token to fetch the next page of events. */ + nextPageToken?: string | undefined; + /** If present, a token to fetch the previous page of events. */ + prevPageToken?: string | undefined; +} + +/** + * The request/response messages for the ListPipelines API. The default behavior is to return + * the 25 first pipelines in ascending order of pipeline id. + */ +export interface ListPipelinesRequest { + /** Page token returned by previous call */ + pageToken?: string | undefined; + /** + * The maximum number of entries to return in a single page. The system may + * return fewer than max_results events in a response, even if there are + * more events available. This field is optional. The default value is 25. + * The maximum value is 100. An error is returned if the value of max_results + * is greater than 100. + */ + maxResults?: number | undefined; + /** + * A list of strings specifying the order of results. + * Supported order_by fields are id and name. The default is id asc. + * This field is optional. + */ + orderBy?: string[] | undefined; + /** + * Select a subset of results based on the specified criteria. + * The supported filters are: + * + * * `notebook=''` to select pipelines that reference the provided notebook path. + * * `name LIKE '[pattern]'` to select pipelines with a name that matches pattern. + * Wildcards are supported, for example: `name LIKE '%shopping%'` + * + * Composite filters are not supported. This field is optional. + */ + filter?: string | undefined; +} + +export interface ListPipelinesResponse { + /** The list of events matching the request criteria. */ + statuses?: PipelineStateInfo[] | undefined; + /** If present, a token to fetch the next page of events. */ + nextPageToken?: string | undefined; +} + +/** + * The request/response messages for the ListUpdates API. The default behavior is to return + * the 25 most recent updates in timestamp descending order for the given pipeline. No custom + * sorting or filtering is supported. + */ +export interface ListUpdatesRequest { + /** The pipeline to return updates for. */ + pipelineId?: string | undefined; + /** Page token returned by previous call */ + pageToken?: string | undefined; + /** Max number of entries to return in a single page. */ + maxResults?: number | undefined; + /** If present, returns updates until and including this update_id. */ + untilUpdateId?: string | undefined; +} + +export interface ListUpdatesResponse { + updates?: UpdateInfo[] | undefined; + /** + * If present, then there are more results, and this a token to be used in a subsequent request + * to fetch the next page. + */ + nextPageToken?: string | undefined; + /** If present, then this token can be used in a subsequent request to fetch the previous page. */ + prevPageToken?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface ManualTrigger {} + +/** Meta Marketing (Meta Ads) specific options for ingestion */ +export interface MetaMarketingOptions { + /** + * (Optional, DEPRECATED — use custom_report_options.level) Granularity of data to pull + * (account, ad, adset, campaign) + */ + level?: string | undefined; + /** (Optional, DEPRECATED — use custom_report_options.breakdowns) Breakdowns to configure */ + breakdowns?: string[] | undefined; + /** (Optional, DEPRECATED — use custom_report_options.action_breakdowns) Action breakdowns */ + actionBreakdowns?: string[] | undefined; + /** + * (Optional, DEPRECATED — use custom_report_options.action_report_time) Timing used to report + * action statistics (impression, conversion, mixed, or lifetime) + */ + actionReportTime?: string | undefined; + /** + * (Optional) Start date in yyyy-MM-dd format (e.g. 2025-01-15). Data added + * after this date will be ingested, shared by prebuilt and custom reports. + */ + startDate?: string | undefined; + /** + * (Optional) Window in days to revisit data during sync to capture + * updated conversion data from the API, shared by prebuilt and custom reports. + */ + customInsightsLookbackWindow?: number | undefined; + /** + * (Optional, DEPRECATED — use custom_report_options.time_increment) Value in string by which to + * aggregate statistics (can take all_days, monthly or number of days) + */ + timeIncrement?: string | undefined; + /** + * (Optional, DEPRECATED — use custom_report_options.action_attribution_windows) Action attribution + * windows for insights reporting (e.g. "28d_click", "1d_view") + */ + actionAttributionWindows?: string[] | undefined; +} + +export interface NotebookLibrary { + /** The absolute path of the source code. */ + path?: string | undefined; +} + +export interface Notifications { + /** A list of email addresses notified when a configured alert is triggered. */ + emailRecipients?: string[] | undefined; + /** + * A list of alerts that trigger the sending of notifications to the configured + * destinations. The supported alerts are: + * + * * `on-update-success`: A pipeline update completes successfully. + * * `on-update-failure`: Each time a pipeline update fails. + * * `on-update-fatal-failure`: A pipeline update fails with a non-retryable (fatal) error. + * * `on-flow-failure`: A single data flow fails. + */ + alerts?: string[] | undefined; +} + +/** Proto representing a window */ +export interface OperationTimeWindow { + /** An integer between 0 and 23 denoting the start hour for the window in the 24-hour day. */ + startHour?: number | undefined; + /** + * Days of week in which the window is allowed to happen + * If not specified all days of the week will be used. + */ + daysOfWeek?: DayOfWeek[] | undefined; + /** + * Time zone id of window. See https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-timezone.html for details. + * If not specified, UTC will be used. + */ + timeZoneId?: string | undefined; +} + +export interface Origin { + /** The cloud provider, e.g., AWS or Azure. */ + cloud?: string | undefined; + /** The cloud region. */ + region?: string | undefined; + /** The org id of the user. Unique within a cloud. */ + orgId?: bigint | undefined; + /** The id of the pipeline. Globally unique. */ + pipelineId?: string | undefined; + /** The name of the pipeline. Not unique. */ + pipelineName?: string | undefined; + /** The id of the cluster where an execution happens. Unique within a region. */ + clusterId?: string | undefined; + /** The id of an execution. Globally unique. */ + updateId?: string | undefined; + /** The id of a maintenance run. Globally unique. */ + maintenanceId?: string | undefined; + /** The id of a (delta) table. Globally unique. */ + tableId?: string | undefined; + /** The name of a dataset. Unique within a pipeline. */ + datasetName?: string | undefined; + /** + * The id of the flow. Globally unique. Incremental queries will generally + * reuse the same id while complete queries will have a new id per update. + */ + flowId?: string | undefined; + /** The name of the flow. Not unique. */ + flowName?: string | undefined; + /** The id of a batch. Unique within a flow. */ + batchId?: bigint | undefined; + /** The id of the request that caused an update. */ + requestId?: string | undefined; + /** The Unity Catalog id of the MV or ST being updated. */ + ucResourceId?: string | undefined; + /** The optional host name where the event was triggered */ + host?: string | undefined; + /** Materialization name. */ + materializationName?: string | undefined; + /** The name of the source UC connection (if known) from whose data ingestion is described by this event. */ + ingestionSourceConnectionName?: string | undefined; + /** The name of the source catalog name (if known) from whose data ingestion is described by this event. */ + ingestionSourceCatalogName?: string | undefined; + /** The name of the source schema name (if known) from whose data ingestion is described by this event. */ + ingestionSourceSchemaName?: string | undefined; + /** The name of the source table name (if known) from whose data ingestion is described by this event. */ + ingestionSourceTableName?: string | undefined; + /** An optional implementation-defined source table version of a dataset being (re)ingested. */ + ingestionSourceTableVersion?: string | undefined; +} + +/** Outlook specific options for ingestion */ +export interface OutlookOptions { + /** Deprecated. Use include_folders instead. */ + folderFilter?: string[] | undefined; + /** Deprecated. Use include_senders instead. */ + senderFilter?: string[] | undefined; + /** Deprecated. Use include_subjects instead. */ + subjectFilter?: string[] | undefined; + /** + * (Optional) Start date for the initial sync in YYYY-MM-DD format. + * Format: YYYY-MM-DD (e.g., 2024-01-01) + * This determines the earliest date from which to sync historical data. + * If not specified, complete history is ingested. + */ + startDate?: string | undefined; + /** + * (Optional) Defines how the body_content column is populated. + * TEXT_HTML: Preserves full formatting, links, and styling. + * TEXT_PLAIN: Converts body to plain text. Recommended for AI/RAG pipelines to reduce token usage and noise. + */ + bodyFormat?: OutlookBodyFormat | undefined; + /** + * (Optional) Controls which attachments to ingest. + * If not specified, defaults to ALL. + */ + attachmentMode?: OutlookAttachmentMode | undefined; + /** + * (Optional) List of mailboxes to sync (e.g. mailbox email addresses or identifiers). + * If not specified, all accessible mailboxes are ingested. + * Filter semantics: OR between different mailboxes. + */ + includeMailboxes?: string[] | undefined; + /** + * (Optional) Filter mail folders to include in the sync. + * If not specified, all folders will be synced. + * Examples: Inbox, Sent Items, Custom_Folder + * Filter semantics: OR between different folders. + */ + includeFolders?: string[] | undefined; + /** + * (Optional) Filter emails by sender address. Uses exact email match. + * Examples: user@vendor.com, alerts@system.io, noreply@company.com + * If not specified, emails from all senders will be synced. + * Filter semantics: OR between different senders. + */ + includeSenders?: string[] | undefined; + /** + * (Optional) Filter emails by subject line. Values ending with "*" use prefix match (subject starts with + * the part before "*"); otherwise substring match (subject contains the value). + * Examples: "Invoice" (substring), "Re:*" (prefix), "Support Ticket", "URGENT*" + * If not specified, emails with all subjects will be synced. + * Filter semantics: OR between different subjects. + */ + includeSubjects?: string[] | undefined; +} + +export interface PathPattern { + /** The source code to include for pipelines */ + include?: string | undefined; +} + +export interface PipelineCluster { + /** A label for the cluster specification, either `default` to configure the default cluster, or `maintenance` to configure the maintenance cluster. This field is optional. The default value is `default`. */ + label?: string | undefined; + /** Note: This field won't be persisted. Only API users will check this field. */ + applyPolicyDefaultValues?: boolean | undefined; + /** + * An object containing a set of optional, user-specified Spark configuration key-value pairs. + * See :method:clusters/create for more details. + */ + sparkConf?: Record | undefined; + /** + * Attributes related to clusters running on Amazon Web Services. + * If not specified at cluster creation, a set of default values will be used. + */ + awsAttributes?: PipelinesAwsAttributes | undefined; + /** + * Attributes related to clusters running on Microsoft Azure. + * If not specified at cluster creation, a set of default values will be used. + */ + azureAttributes?: PipelinesAzureAttributes | undefined; + /** + * Attributes related to clusters running on Google Cloud Platform. + * If not specified at cluster creation, a set of default values will be used. + */ + gcpAttributes?: PipelinesGcpAttributes | undefined; + /** + * This field encodes, through a single value, the resources available to each of + * the Spark nodes in this cluster. For example, the Spark nodes can be provisioned + * and optimized for memory or compute intensive workloads. A list of available node + * types can be retrieved by using the :method:clusters/listNodeTypes API call. + */ + nodeTypeId?: string | undefined; + /** + * The node type of the Spark driver. + * Note that this field is optional; if unset, the driver node type will be set as the same value + * as `node_type_id` defined above. + */ + driverNodeTypeId?: string | undefined; + /** + * SSH public key contents that will be added to each Spark node in this cluster. The + * corresponding private keys can be used to login with the user name `ubuntu` on port `2200`. + * Up to 10 keys can be specified. + */ + sshPublicKeys?: string[] | undefined; + /** + * Additional tags for cluster resources. will tag all cluster resources (e.g., AWS + * instances and EBS volumes) with these tags in addition to `default_tags`. Notes: + * + * - Currently, allows at most 45 custom tags + * + * - Clusters can only reuse cloud resources if the resources' tags are a subset of the cluster tags + */ + customTags?: Record | undefined; + /** + * The configuration for delivering spark logs to a long-term storage destination. + * Only dbfs destinations are supported. Only one destination can be specified + * for one cluster. If the conf is given, the logs will be delivered to the destination every + * `5 mins`. The destination of driver logs is `$destination/$clusterId/driver`, while + * the destination of executor logs is `$destination/$clusterId/executor`. + */ + clusterLogConf?: PipelinesClusterLogConf | undefined; + /** + * An object containing a set of optional, user-specified environment variable key-value pairs. + * Please note that key-value pair of the form (X,Y) will be exported as is (i.e., + * `export X='Y'`) while launching the driver and workers. + * + * In order to specify an additional set of `SPARK_DAEMON_JAVA_OPTS`, we recommend appending + * them to `$SPARK_DAEMON_JAVA_OPTS` as shown in the example below. This ensures that all + * default databricks managed environmental variables are included as well. + * + * Example Spark environment variables: + * `{"SPARK_WORKER_MEMORY": "28000m", "SPARK_LOCAL_DIRS": "/local_disk0"}` or + * `{"SPARK_DAEMON_JAVA_OPTS": "$SPARK_DAEMON_JAVA_OPTS -Dspark.shuffle.service.enabled=true"}` + */ + sparkEnvVars?: Record | undefined; + /** The configuration for storing init scripts. Any number of destinations can be specified. The scripts are executed sequentially in the order provided. If `cluster_log_conf` is specified, init script logs are sent to `//init_scripts`. */ + initScripts?: PipelinesInitScriptInfo[] | undefined; + /** The optional ID of the instance pool to which the cluster belongs. */ + instancePoolId?: string | undefined; + /** The ID of the cluster policy used to create the cluster if applicable. */ + policyId?: string | undefined; + /** Whether to enable local disk encryption for the cluster. */ + enableLocalDiskEncryption?: boolean | undefined; + /** + * The optional ID of the instance pool for the driver of the cluster belongs. + * The pool cluster uses the instance pool with id (instance_pool_id) if the driver pool is not + * assigned. + */ + driverInstancePoolId?: string | undefined; + size?: + | { + $case: 'numWorkers'; + /** + * Number of worker nodes that this cluster should have. A cluster has one Spark Driver + * and `num_workers` Executors for a total of `num_workers` + 1 Spark nodes. + * + * Note: When reading the properties of a cluster, this field reflects the desired number + * of workers rather than the actual current number of workers. For instance, if a cluster + * is resized from 5 to 10 workers, this field will immediately be updated to reflect + * the target size of 10 workers, whereas the workers listed in `spark_info` will gradually + * increase from 5 to 10 as the new nodes are provisioned. + */ + numWorkers: number; + } + | { + $case: 'autoscale'; + /** + * Parameters needed in order to automatically scale clusters up and down based on load. + * Note: autoscaling works best with DB runtime versions 3.0 or later. + */ + autoscale: PipelinesAutoScale; + } + | undefined; +} + +export interface PipelineDeployment { + /** The deployment method that manages the pipeline. */ + kind?: DeploymentKind | undefined; + /** The path to the file containing metadata about the deployment. */ + metadataFilePath?: string | undefined; + /** + * ID of the deployment that manages this pipeline. Only set when `kind` is + * `BUNDLE`. Used to look up deployment metadata from the Deployment + * Metadata service. + */ + deploymentId?: string | undefined; + /** + * ID of the version of the deployment that produced this pipeline. Only + * set when `kind` is `BUNDLE`. Identifies a specific snapshot of the + * deployment in the Deployment Metadata service. + */ + versionId?: string | undefined; +} + +export interface PipelineEvent { + /** A time-based, globally unique id. */ + id?: string | undefined; + /** A sequencing object to identify and order events. */ + sequence?: Sequencing | undefined; + /** Describes where the event originates from. */ + origin?: Origin | undefined; + /** The time of the event. */ + timestamp?: string | undefined; + /** The display message associated with the event. */ + message?: string | undefined; + /** The severity level of the event. */ + level?: EventLevel | undefined; + /** Information about an error captured by the event. */ + error?: ErrorDetail | undefined; + /** The event type. Should always correspond to the details */ + eventType?: string | undefined; + /** Maturity level for event_type. */ + maturityLevel?: MaturityLevel | undefined; + /** + * Information about which fields were truncated from this event due to size constraints. + * If empty or absent, no truncation occurred. + * See https://docs.databricks.com/en/ldp/monitor-event-logs for information on + * retrieving complete event data. + */ + truncation?: Truncation | undefined; +} + +export interface PipelineLibrary { + lib?: + | { + $case: 'jar'; + /** URI of the jar to be installed. Currently only DBFS is supported. */ + jar: string; + } + | { + $case: 'maven'; + /** Specification of a maven library to be installed. */ + maven: PipelinesMavenLibrary; + } + | { + $case: 'whl'; + /** URI of the whl to be installed. */ + whl: string; + } + | { + $case: 'notebook'; + /** The path to a notebook that defines a pipeline and is stored in the workspace. */ + notebook: NotebookLibrary; + } + | { + $case: 'file'; + /** The path to a file that defines a pipeline and is stored in the Databricks Repos. */ + file: NotebookLibrary; + } + | { + $case: 'glob'; + /** + * The unified field to include source codes. + * Each entry can be a notebook path, a file path, or a folder path that ends `/\**`. + * This field cannot be used together with `notebook` or `file`. + */ + glob: PathPattern; + } + | undefined; +} + +export interface PipelineSpec { + /** Unique identifier for this pipeline. */ + id?: string | undefined; + /** Friendly identifier for this pipeline. */ + name?: string | undefined; + /** DBFS root directory for storing checkpoints and tables. */ + storage?: string | undefined; + /** String-String configuration for this pipeline execution. */ + configuration?: Record | undefined; + /** Cluster settings for this pipeline deployment. */ + clusters?: PipelineCluster[] | undefined; + /** Libraries or code needed by this deployment. */ + libraries?: PipelineLibrary[] | undefined; + /** The configuration for a managed ingestion pipeline. These settings cannot be used with the 'libraries', 'schema', 'target', or 'catalog' settings. */ + ingestionDefinition?: IngestionPipelineDefinition | undefined; + /** The definition of a gateway pipeline to support change data capture. */ + gatewayDefinition?: IngestionGatewayPipelineDefinition | undefined; + /** Which pipeline trigger to use. Deprecated: Use `continuous` instead. */ + trigger?: PipelineTrigger | undefined; + /** Target schema (database) to add tables in this pipeline to. Exactly one of `schema` or `target` must be specified. To publish to Unity Catalog, also specify `catalog`. This legacy field is deprecated for pipeline creation in favor of the `schema` field. */ + target?: string | undefined; + /** The default schema (database) where tables are read from or published to. */ + schema?: string | undefined; + /** Filters on which Pipeline packages to include in the deployed graph. */ + filters?: Filters | undefined; + /** Whether the pipeline is continuous or triggered. This replaces `trigger`. */ + continuous?: boolean | undefined; + /** Whether the pipeline is in Development mode. Defaults to false. */ + development?: boolean | undefined; + /** Whether Photon is enabled for this pipeline. */ + photon?: boolean | undefined; + /** Pipeline product edition. */ + edition?: string | undefined; + /** SDP Release Channel that specifies which version to use. */ + channel?: string | undefined; + /** A catalog in Unity Catalog to publish data from this pipeline to. If `target` is specified, tables in this pipeline are published to a `target` schema inside `catalog` (for example, `catalog`.`target`.`table`). If `target` is not specified, no data is published to Unity Catalog. */ + catalog?: string | undefined; + /** List of notification settings for this pipeline. */ + notifications?: Notifications[] | undefined; + /** Whether serverless compute is enabled for this pipeline. */ + serverless?: boolean | undefined; + /** Deployment type of this pipeline. */ + deployment?: PipelineDeployment | undefined; + /** Restart window of this pipeline. */ + restartWindow?: RestartWindow | undefined; + /** Budget policy of this pipeline. */ + budgetPolicyId?: string | undefined; + /** + * A map of tags associated with the pipeline. + * These are forwarded to the cluster as cluster tags, and are therefore subject to the same limitations. + * A maximum of 25 tags can be added to the pipeline. + */ + tags?: Record | undefined; + /** Event log configuration for this pipeline */ + eventLog?: EventLogSpec | undefined; + /** + * Root path for this pipeline. + * This is used as the root directory when editing the pipeline in the user interface and it is + * added to sys.path when executing Python sources during pipeline execution. + */ + rootPath?: string | undefined; + /** Environment specification for this pipeline used to install dependencies. */ + environment?: PipelinesEnvironment | undefined; + /** Usage policy of this pipeline. */ + usagePolicyId?: string | undefined; + /** Serverless compute ID specified by the user for serverless pipelines. */ + serverlessComputeId?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface PipelineState {} + +export interface PipelineStateInfo { + /** The unique identifier of the pipeline. */ + pipelineId?: string | undefined; + state?: PipelineState_PipelineState | undefined; + /** The unique identifier of the cluster running the pipeline. */ + clusterId?: string | undefined; + /** The user-friendly name of the pipeline. */ + name?: string | undefined; + /** Status of the latest updates for the pipeline. Ordered with the newest update first. */ + latestUpdates?: UpdateStateInfo[] | undefined; + /** The username of the pipeline creator. */ + creatorUserName?: string | undefined; + /** The username that the pipeline runs as. This is a read only value derived from the pipeline owner. */ + runAsUserName?: string | undefined; + /** The health of a pipeline. */ + health?: PipelineHealthStatus | undefined; +} + +export interface PipelineTrigger { + trigger?: + | {$case: 'manual'; manual: ManualTrigger} + | {$case: 'cron'; cron: CronTrigger} + | undefined; +} + +export interface PipelinesAutoScale { + /** + * The minimum number of workers the cluster can scale down to when underutilized. + * It is also the initial number of workers the cluster will have after creation. + */ + minWorkers?: number | undefined; + /** The maximum number of workers to which the cluster can scale up when overloaded. `max_workers` must be strictly greater than `min_workers`. */ + maxWorkers?: number | undefined; + /** + * Databricks Enhanced Autoscaling optimizes cluster utilization by automatically + * allocating cluster resources based on workload volume, with minimal impact to + * the data processing latency of your pipelines. Enhanced Autoscaling is available + * for `updates` clusters only. The legacy autoscaling feature is used for `maintenance` + * clusters. + */ + mode?: string | undefined; +} + +/** Attributes set during cluster creation which are related to Amazon Web Services. */ +export interface PipelinesAwsAttributes { + /** + * The first ``first_on_demand`` nodes of the cluster will be placed on on-demand instances. + * If this value is greater than 0, the cluster driver node in particular will be placed on an + * on-demand instance. If this value is greater than or equal to the current cluster size, all + * nodes will be placed on on-demand instances. If this value is less than the current cluster + * size, ``first_on_demand`` nodes will be placed on on-demand instances and the remainder will + * be placed on ``availability`` instances. Note that this value does not affect + * cluster size and cannot currently be mutated over the lifetime of a cluster. + */ + firstOnDemand?: number | undefined; + /** + * Availability type used for all subsequent nodes past the ``first_on_demand`` ones. + * Note: If ``first_on_demand`` is zero, this availability type will be used for the entire cluster. + */ + availability?: PipelinesAwsAvailability | undefined; + /** + * Identifier for the availability zone/datacenter in which the cluster resides. + * This string will be of a form like "us-west-2a". The provided availability + * zone must be in the same region as the deployment. For example, "us-west-2a" + * is not a valid zone id if the deployment resides in the "us-east-1" region. + * This is an optional field at cluster creation, and if not specified, a default zone will be used. + * If the zone specified is "auto", will try to place cluster in a zone with high availability, + * and will retry placement in a different AZ if there is not enough capacity. + * See [[AutoAZHelper.scala]] for more details. + * The list of available zones as well as the default value can be found by using the + * `List Zones`_ method. + */ + zoneId?: string | undefined; + /** + * Nodes for this cluster will only be placed on AWS instances with this instance profile. If + * omitted, nodes will be placed on instances without an IAM instance profile. The instance + * profile must have previously been added to the environment by an account + * administrator. + * + * This feature may only be available to certain customer plans. + * + * ***internal + * If this field is ommitted, we will pull in the default from the conf if it exists. + */ + instanceProfileArn?: string | undefined; + /** + * The bid price for AWS spot instances, as a percentage of the corresponding instance type's + * on-demand price. + * For example, if this field is set to 50, and the cluster needs a new ``r3.xlarge`` spot + * instance, then the bid price is half of the price of + * on-demand ``r3.xlarge`` instances. Similarly, if this field is set to 200, the bid price is twice + * the price of on-demand ``r3.xlarge`` instances. If not specified, the default value is 100. + * When spot instances are requested for this cluster, only spot instances whose bid price + * percentage matches this field will be considered. + * Note that, for safety, we enforce this field to be no more than 10000. + * + * ***internal + * The default value and documentation here should be kept consistent with + * CommonConf.defaultSpotBidPricePercent and CommonConf.maxSpotBidPricePercent. + */ + spotBidPricePercent?: number | undefined; + /** The type of EBS volumes that will be launched with this cluster. */ + ebsVolumeType?: PipelinesEbsVolumeType | undefined; + /** + * The number of volumes launched for each instance. Users can choose up to 10 volumes. + * This feature is only enabled for supported node types. Legacy node types cannot specify + * custom EBS volumes. + * For node types with no instance store, at least one EBS volume needs to be specified; + * otherwise, cluster creation will fail. + * + * These EBS volumes will be mounted at ``/ebs0``, ``/ebs1``, and etc. + * Instance store volumes will be mounted at ``/local_disk0``, ``/local_disk1``, and etc. + * + * If EBS volumes are attached, will configure Spark to use only the EBS volumes for + * scratch storage because heterogeneously sized scratch devices can lead to inefficient disk + * utilization. If no EBS volumes are attached, will configure Spark to use instance + * store volumes. + * + * Please note that if EBS volumes are specified, then the Spark configuration ``spark.local.dir`` + * will be overridden. + */ + ebsVolumeCount?: number | undefined; + /** + * The size of each EBS volume (in GiB) launched for each instance. For general purpose + * SSD, this value must be within the range 100 - 4096. For throughput optimized HDD, + * this value must be within the range 500 - 4096. + */ + ebsVolumeSize?: number | undefined; + ebsVolumeIops?: number | undefined; + ebsVolumeThroughput?: number | undefined; +} + +/** Attributes set during cluster creation which are related to Azure. */ +export interface PipelinesAzureAttributes { + /** + * The first ``first_on_demand`` nodes of the cluster will be placed on on-demand instances. + * This value should be greater than 0, to make sure the cluster driver node is placed on an + * on-demand instance. If this value is greater than or equal to the current cluster size, all + * nodes will be placed on on-demand instances. If this value is less than the current cluster + * size, ``first_on_demand`` nodes will be placed on on-demand instances and the remainder will + * be placed on ``availability`` instances. Note that this value does not affect + * cluster size and cannot currently be mutated over the lifetime of a cluster. + */ + firstOnDemand?: number | undefined; + /** + * Availability type used for all subsequent nodes past the ``first_on_demand`` ones. + * Note: If ``first_on_demand`` is zero (which only happens on pool clusters), this availability + * type will be used for the entire cluster. + */ + availability?: PipelinesAzureAvailability | undefined; + /** + * The max bid price to be used for Azure spot instances. + * The Max price for the bid cannot be higher than the on-demand price of the instance. + * If not specified, the default value is -1, which specifies that the instance cannot be evicted + * on the basis of price, and only on the basis of availability. Further, the value should > 0 or -1. + */ + spotBidMaxPrice?: number | undefined; +} + +/** Cluster log delivery config */ +export interface PipelinesClusterLogConf { + storageInfo?: + | { + $case: 'dbfs'; + /** + * destination needs to be provided. e.g. + * ``{ "dbfs" : { "destination" : "dbfs:/home/cluster_log" } }`` + */ + dbfs: PipelinesDbfsStorageInfo; + } + | undefined; +} + +/** A storage location in DBFS */ +export interface PipelinesDbfsStorageInfo { + /** dbfs destination, e.g. ``dbfs:/my/path`` */ + destination?: string | undefined; +} + +/** + * The environment entity used to preserve serverless environment side panel, jobs' environment for non-notebook task, and SDP's environment for classic and serverless pipelines. + * In this minimal environment spec, only pip dependencies are supported. + */ +export interface PipelinesEnvironment { + /** + * List of pip dependencies, as supported by the version of pip in this environment. + * Each dependency is a pip requirement file line https://pip.pypa.io/en/stable/reference/requirements-file-format/ + * Allowed dependency could be , , (WSFS or Volumes in ), + */ + dependencies?: string[] | undefined; + /** + * The environment version of the serverless Python environment used to execute + * customer Python code. Each environment version includes a specific Python + * version and a curated set of pre-installed libraries with defined versions, + * providing a stable and reproducible execution environment. + * + * supports a three-year lifecycle for each environment version. + * For available versions and their included packages, see + * https://docs.databricks.com/aws/en/release-notes/serverless/environment-version/ + * + * The value should be a string representing the environment version number, for example: `"4"`. + */ + environmentVersion?: string | undefined; +} + +/** Attributes set during cluster creation which are related to Gcp. */ +export interface PipelinesGcpAttributes { + /** + * If provided, the cluster will impersonate the google service account when accessing + * gcloud services (like GCS). The google service account + * must have previously been added to the environment by an account + * administrator. + */ + googleServiceAccount?: string | undefined; + /** boot disk size in GB */ + bootDiskSize?: number | undefined; + /** + * This field determines whether the spark executors will be scheduled to run on preemptible + * VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable. + */ + availability?: PipelinesGcpAvailability | undefined; + /** + * Identifier for the availability zone in which the cluster resides. + * This can be one of the following: + * - "HA" => High availability, spread nodes across availability zones for a + * deployment region [default]. + * - "AUTO" => picks an availability zone to schedule the cluster on. + * - A GCP availability zone => Pick One of the available zones for (machine type + region) from + * https://cloud.google.com/compute/docs/regions-zones. + */ + zoneId?: string | undefined; + /** + * The number of local SSDs to attach to each worker and driver for this cluster. If left unspecified, + * the default number of local SSDs for the node type will be used. + * + * NOTE: Each instance type can only support a certain number of attached local SSDs. The value + * specified in local_ssd_count must be valid for BOTH the driver and worker instance type. See + * GCP docs here: + * https://cloud.google.com/compute/docs/disks#local_ssd_machine_type_restrictions + * + * Validation is performed at the RPC layer and the RPC will be rejected if the specified + * local_ssd_count is invalid. + */ + localSsdCount?: number | undefined; +} + +/** Config for an individual init script */ +export interface PipelinesInitScriptInfo { + storageInfo?: + | { + $case: 'dbfs'; + /** + * destination needs to be provided. e.g. + * ``{ "dbfs" : { "destination" : "dbfs:/init-scripts/my_script.sh" } }`` + */ + dbfs: PipelinesDbfsStorageInfo; + } + | { + $case: 's3'; + /** + * destination and either region or endpoint should also be provided. e.g. + * ``{ "s3": { "destination" : "s3://init-scripts/my_script.sh", "region" : "us-west-2" } }`` + * Cluster iam role is used to access s3, please make sure the cluster iam role in + * ``instance_profile_arn`` has permission to write data to the s3 destination. + */ + s3: PipelinesS3StorageInfo; + } + | undefined; +} + +/** + * Write-only setting, available only in Create/Update calls. Specifies the user or service principal that the pipeline runs as. If not specified, the pipeline runs as the user who created the pipeline. + * + * Only `user_name` or `service_principal_name` can be specified. If both are specified, an error is thrown. + */ +export interface PipelinesJobRunAs { + identity?: + | { + $case: 'userName'; + /** The email of an active workspace user. Users can only set this field to their own email. */ + userName: string; + } + | { + $case: 'servicePrincipalName'; + /** Application ID of an active service principal. Setting this field requires the `servicePrincipal/user` role. */ + servicePrincipalName: string; + } + | undefined; +} + +export interface PipelinesMavenLibrary { + /** Gradle-style maven coordinates. For example: "org.jsoup:jsoup:1.7.2". */ + coordinates?: string | undefined; + /** + * Maven repo to install the Maven package from. If omitted, both Maven Central Repository + * and Spark Packages are searched. + */ + repo?: string | undefined; + /** + * List of dependencies to exclude. For example: `["slf4j:slf4j", "*:hadoop-client"]`. + * + * Maven dependency exclusions: + * https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html. + */ + exclusions?: string[] | undefined; +} + +/** A storage location in Amazon S3 */ +export interface PipelinesS3StorageInfo { + /** + * S3 destination, e.g. ``s3://my-bucket/some-prefix`` Note that logs will be delivered using + * cluster iam role, please make sure you set cluster iam role and the role has write access to the + * destination. Please also note that you cannot use AWS keys to deliver logs. + */ + destination?: string | undefined; + /** + * S3 region, e.g. ``us-west-2``. Either region or endpoint needs to be set. If both are set, + * endpoint will be used. + */ + region?: string | undefined; + /** + * S3 endpoint, e.g. ``https://s3-us-west-2.amazonaws.com``. Either region or endpoint needs to be set. + * If both are set, endpoint will be used. + */ + endpoint?: string | undefined; + /** Flag to enable server side encryption, ``false`` by default. */ + enableEncryption?: boolean | undefined; + /** + * The encryption type, it could be ``sse-s3`` or ``sse-kms``. It will be used only when + * encryption is enabled and the default type is ``sse-s3``. + */ + encryptionType?: string | undefined; + /** Kms key which will be used if encryption is enabled and encryption type is set to ``sse-kms``. */ + kmsKey?: string | undefined; + /** + * Set canned access control list for the logs, e.g. ``bucket-owner-full-control``. + * If ``canned_cal`` is set, please make sure the cluster iam role has ``s3:PutObjectAcl`` permission on + * the destination bucket and prefix. The full list of possible canned acl can be found at + * http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl. + * Please also note that by default only the object owner gets full controls. If you are using cross account + * role for writing data, you may want to set ``bucket-owner-full-control`` to make bucket owner able to + * read the logs. + */ + cannedAcl?: string | undefined; +} + +/** PG-specific catalog-level configuration parameters */ +export interface PostgresCatalogConfig { + /** Optional. The Postgres slot configuration to use for logical replication */ + slotConfig?: PostgresSlotConfig | undefined; +} + +/** PostgresSlotConfig contains the configuration for a Postgres logical replication slot */ +export interface PostgresSlotConfig { + /** The name of the logical replication slot to use for the Postgres source */ + slotName?: string | undefined; + /** The name of the publication to use for the Postgres source */ + publicationName?: string | undefined; +} + +/** Specifies a replace_where predicate override for a replace where flow. */ +export interface ReplaceWhereOverride { + /** Name of the flow to apply this override to. */ + flowName?: string | undefined; + /** + * SQL predicate string to use as replace_where condition. + * Example: `date = '2024-10-10' AND city = 'xyz'` + */ + predicateOverride?: string | undefined; +} + +export interface RestartWindow { + /** + * An integer between 0 and 23 denoting the start hour for the restart window in the 24-hour day. + * Continuous pipeline restart is triggered only within a five-hour window starting at this hour. + */ + startHour?: number | undefined; + /** + * Days of week in which the restart is allowed to happen (within a five-hour window starting at start_hour). + * If not specified all days of the week will be used. + */ + daysOfWeek?: DayOfWeek[] | undefined; + /** + * Time zone id of restart window. See https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-timezone.html for details. + * If not specified, UTC will be used. + */ + timeZoneId?: string | undefined; +} + +/** Configuration for rewinding a specific dataset. */ +export interface RewindDatasetSpec { + /** The identifier of the dataset (e.g., "main.foo.tbl1"). */ + identifier?: string | undefined; + /** Whether to cascade the rewind to dependent datasets. Must be specified. */ + cascade?: boolean | undefined; + /** Whether to reset checkpoints for this dataset. */ + resetCheckpoints?: boolean | undefined; +} + +/** Information about a rewind being requested for this pipeline or some of the datasets in it. */ +export interface RewindSpec { + /** + * The base timestamp to rewind to. Exactly one of rewind_timestamp or rewind_point_id must be + * specified. + */ + rewindTimestamp?: string | undefined; + /** If true, this is a dry run and we should emit the RewindSummary but not perform the rewind. */ + dryRun?: boolean | undefined; + /** + * List of datasets to rewind with specific configuration for each. When not specified, + * all datasets will be rewound with cascade = true and reset_checkpoints = true. + */ + datasets?: RewindDatasetSpec[] | undefined; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface ScdType {} + +export interface Sequencing { + /** the ID assigned by the data plane. */ + dataPlaneId?: DataPlaneId | undefined; + /** A sequence number, unique and increasing per pipeline. */ + controlPlaneSeqNo?: bigint | undefined; +} + +export interface SerializedException { + /** Runtime class of the exception */ + className?: string | undefined; + /** Exception message */ + message?: string | undefined; + /** Stack trace consisting of a list of stack frames */ + stack?: StackFrame[] | undefined; +} + +export interface SharepointOptions { + /** Required. The SharePoint URL. */ + url?: string | undefined; + /** + * (Optional) The type of SharePoint entity to ingest. + * If not specified, defaults to FILE. + */ + entityType?: SharepointOptions_SharepointEntityType | undefined; + /** (Optional) File ingestion options for processing files. */ + fileIngestionOptions?: FileIngestionOptions | undefined; +} + +/** Smartsheet specific options for ingestion */ +export interface SmartsheetOptions { + /** + * (Optional) When true, maps each column to its Smartsheet-declared type (Text/Number/Date/ + * Checkbox/etc.). Cells that do not conform to the declared type are set to NULL. + * When false, all columns land as STRING. Use false for sheets with irregular data or columns + * that frequently violate their own declared type. + * If not specified, defaults to true. + */ + enforceSchema?: boolean | undefined; +} + +/** SourceCatalogConfig contains catalog-level custom configuration parameters for each source */ +export interface SourceCatalogConfig { + /** Source catalog name */ + sourceCatalog?: string | undefined; + /** Configuration options for the source catalog */ + options?: + | { + $case: 'postgres'; + /** Postgres-specific catalog-level configuration parameters */ + postgres: PostgresCatalogConfig; + } + | undefined; +} + +export interface SourceConfig { + /** Catalog-level source configuration parameters */ + catalog?: SourceCatalogConfig | undefined; + /** + * Connector-specific top-level configuration. Values here act as defaults and + * can be overridden by the same field in the object-level connector_options. + */ + connectorConfig?: + | {$case: 'googleAdsConfig'; googleAdsConfig: GoogleAdsConfig} + | undefined; +} + +export interface StackFrame { + /** Class from which the method call originated */ + declaringClass?: string | undefined; + /** Name of the method which was called */ + methodName?: string | undefined; + /** File where the method is defined */ + fileName?: string | undefined; + /** Line from which the method was called */ + lineNumber?: number | undefined; +} + +export interface StartUpdateRequest { + pipelineId?: string | undefined; + /** If true, this update will reset all tables before running. */ + fullRefresh?: boolean | undefined; + cause?: UpdateCause | undefined; + /** + * A list of tables to update without fullRefresh. If both refresh_selection and + * full_refresh_selection are empty, this is a full graph update. Full Refresh on a table means + * that the states of the table will be reset before the refresh. + */ + refreshSelection?: string[] | undefined; + /** + * A list of tables to update with fullRefresh. If both refresh_selection and + * full_refresh_selection are empty, this is a full graph update. Full Refresh on a table means + * that the states of the table will be reset before the refresh. + */ + fullRefreshSelection?: string[] | undefined; + /** + * A list of flows for which this update should reset the streaming checkpoint. This selection will not clear + * the data in the flow's target table. Flows in this list may also appear in refresh_selection and full_refresh_selection. + */ + resetCheckpointSelection?: string[] | undefined; + /** If true, this update only validates the correctness of pipeline source code but does not materialize or publish any datasets. */ + validateOnly?: boolean | undefined; + /** + * The information about the requested rewind operation. + * If specified this is a rewind mode update. + */ + rewindSpec?: CreateRewindSpec | undefined; + /** Key/value map of parameters to pass to the pipeline execution */ + parameters?: Record | undefined; + /** + * 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. + */ + replaceWhereOverrides?: CreateReplaceWhereOverride[] | undefined; +} + +export interface StartUpdateResponse { + updateId?: string | undefined; +} + +export interface StopPipelineRequest { + pipelineId?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface StopPipelineResponse {} + +/** TikTok Ads specific options for ingestion */ +export interface TikTokAdsOptions { + /** + * (Optional) Number of days to look back for report tables during incremental sync + * to capture late-arriving conversions and attribution data. + */ + lookbackWindowDays?: number | undefined; + /** + * (Optional) Start date for the initial sync of report tables in YYYY-MM-DD format. + * This determines the earliest date from which to sync historical data. + */ + syncStartDate?: string | undefined; + /** Deprecated. Use custom_report_options.dimensions instead. */ + dimensions?: string[] | undefined; + /** Deprecated. Use custom_report_options.metrics instead. */ + metrics?: string[] | undefined; + /** Deprecated. Use custom_report_options.report_type instead. */ + reportType?: TikTokAdsOptions_TikTokReportType | undefined; + /** Deprecated. Use custom_report_options.data_level instead. */ + dataLevel?: TikTokAdsOptions_TikTokDataLevel | undefined; + /** Deprecated. Use custom_report_options.query_lifetime instead. */ + queryLifetime?: boolean | undefined; +} + +/** Specifies how to transform binary data into structured data. */ +export interface Transformer { + /** Required: the wire format of the data. */ + format?: Transformer_Format | undefined; + /** + * Format-specific configuration. Only required for JSON, Avro, and Protobuf. + * STRING format requires no additional config. + */ + config?: + | {$case: 'jsonOptions'; jsonOptions: JsonTransformerOptions} + | undefined; +} + +/** Information about truncations applied to this event. */ +export interface Truncation { + /** + * List of fields that were truncated from this event. If empty or absent, + * no truncation occurred. */ truncatedFields?: Truncation_TruncationDetail[] | undefined; } @@ -4091,16 +5459,6 @@ export const marshalApplyEnvironmentRequestSchema: z.ZodType = z pipeline_id: d.pipelineId, })); -export const marshalAutoFullRefreshPolicySchema: z.ZodType = z - .object({ - enabled: z.boolean().optional(), - minIntervalHours: z.number().optional(), - }) - .transform(d => ({ - enabled: d.enabled, - min_interval_hours: d.minIntervalHours, - })); - export const marshalClonePipelineRequestSchema: z.ZodType = z .object({ pipelineId: z.string().optional(), @@ -4110,33 +5468,41 @@ export const marshalClonePipelineRequestSchema: z.ZodType = z name: z.string().optional(), storage: z.string().optional(), configuration: z.record(z.string(), z.string()).optional(), - clusters: z.array(z.lazy(() => marshalPipelineClusterSchema)).optional(), - libraries: z.array(z.lazy(() => marshalPipelineLibrarySchema)).optional(), + clusters: z + .array(z.lazy(() => marshalCreatePipelineClusterSchema)) + .optional(), + libraries: z + .array(z.lazy(() => marshalCreatePipelineLibrarySchema)) + .optional(), ingestionDefinition: z - .lazy(() => marshalIngestionPipelineDefinitionSchema) + .lazy(() => marshalCreateIngestionPipelineDefinitionSchema) .optional(), gatewayDefinition: z - .lazy(() => marshalIngestionGatewayPipelineDefinitionSchema) + .lazy(() => marshalCreateIngestionGatewayPipelineDefinitionSchema) .optional(), - trigger: z.lazy(() => marshalPipelineTriggerSchema).optional(), + trigger: z.lazy(() => marshalCreatePipelineTriggerSchema).optional(), target: z.string().optional(), schema: z.string().optional(), - filters: z.lazy(() => marshalFiltersSchema).optional(), + filters: z.lazy(() => marshalCreateFiltersSchema).optional(), continuous: z.boolean().optional(), development: z.boolean().optional(), photon: z.boolean().optional(), edition: z.string().optional(), channel: z.string().optional(), catalog: z.string().optional(), - notifications: z.array(z.lazy(() => marshalNotificationsSchema)).optional(), + notifications: z + .array(z.lazy(() => marshalCreateNotificationsSchema)) + .optional(), serverless: z.boolean().optional(), - deployment: z.lazy(() => marshalPipelineDeploymentSchema).optional(), - restartWindow: z.lazy(() => marshalRestartWindowSchema).optional(), + deployment: z.lazy(() => marshalCreatePipelineDeploymentSchema).optional(), + restartWindow: z.lazy(() => marshalCreateRestartWindowSchema).optional(), budgetPolicyId: z.string().optional(), tags: z.record(z.string(), z.string()).optional(), - eventLog: z.lazy(() => marshalEventLogSpecSchema).optional(), + eventLog: z.lazy(() => marshalCreateEventLogSpecSchema).optional(), rootPath: z.string().optional(), - environment: z.lazy(() => marshalPipelinesEnvironmentSchema).optional(), + environment: z + .lazy(() => marshalCreatePipelinesEnvironmentSchema) + .optional(), usagePolicyId: z.string().optional(), serverlessComputeId: z.string().optional(), cloneMode: z.string().optional(), @@ -4177,7 +5543,17 @@ export const marshalClonePipelineRequestSchema: z.ZodType = z clone_mode: d.cloneMode, })); -export const marshalConfluenceConnectorOptionsSchema: z.ZodType = z +export const marshalCreateAutoFullRefreshPolicySchema: z.ZodType = z + .object({ + enabled: z.boolean(), + minIntervalHours: z.number().optional(), + }) + .transform(d => ({ + enabled: d.enabled, + min_interval_hours: d.minIntervalHours, + })); + +export const marshalCreateConfluenceConnectorOptionsSchema: z.ZodType = z .object({ includeConfluenceSpaces: z.array(z.string()).optional(), }) @@ -4185,7 +5561,7 @@ export const marshalConfluenceConnectorOptionsSchema: z.ZodType = z include_confluence_spaces: d.includeConfluenceSpaces, })); -export const marshalConnectionParametersSchema: z.ZodType = z +export const marshalCreateConnectionParametersSchema: z.ZodType = z .object({ sourceCatalog: z.string().optional(), }) @@ -4193,57 +5569,57 @@ export const marshalConnectionParametersSchema: z.ZodType = z source_catalog: d.sourceCatalog, })); -export const marshalConnectorOptionsSchema: z.ZodType = z +export const marshalCreateConnectorOptionsSchema: z.ZodType = z .object({ connectorOptions: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('googleAdsOptions'), - googleAdsOptions: z.lazy(() => marshalGoogleAdsOptionsSchema), + googleAdsOptions: z.lazy(() => marshalCreateGoogleAdsOptionsSchema), }), z.object({ $case: z.literal('tiktokAdsOptions'), - tiktokAdsOptions: z.lazy(() => marshalTikTokAdsOptionsSchema), + tiktokAdsOptions: z.lazy(() => marshalCreateTikTokAdsOptionsSchema), }), z.object({ $case: z.literal('sharepointOptions'), - sharepointOptions: z.lazy(() => marshalSharepointOptionsSchema), + sharepointOptions: z.lazy(() => marshalCreateSharepointOptionsSchema), }), z.object({ $case: z.literal('gdriveOptions'), - gdriveOptions: z.lazy(() => marshalGoogleDriveOptionsSchema), + gdriveOptions: z.lazy(() => marshalCreateGoogleDriveOptionsSchema), }), z.object({ $case: z.literal('outlookOptions'), - outlookOptions: z.lazy(() => marshalOutlookOptionsSchema), + outlookOptions: z.lazy(() => marshalCreateOutlookOptionsSchema), }), z.object({ $case: z.literal('smartsheetOptions'), - smartsheetOptions: z.lazy(() => marshalSmartsheetOptionsSchema), + smartsheetOptions: z.lazy(() => marshalCreateSmartsheetOptionsSchema), }), z.object({ $case: z.literal('jiraOptions'), - jiraOptions: z.lazy(() => marshalJiraConnectorOptionsSchema), + jiraOptions: z.lazy(() => marshalCreateJiraConnectorOptionsSchema), }), z.object({ $case: z.literal('confluenceOptions'), confluenceOptions: z.lazy( - () => marshalConfluenceConnectorOptionsSchema + () => marshalCreateConfluenceConnectorOptionsSchema ), }), z.object({ $case: z.literal('metaAdsOptions'), - metaAdsOptions: z.lazy(() => marshalMetaMarketingOptionsSchema), + metaAdsOptions: z.lazy(() => marshalCreateMetaMarketingOptionsSchema), }), z.object({ $case: z.literal('zendeskSupportOptions'), zendeskSupportOptions: z.lazy( - () => marshalZendeskSupportOptionsSchema + () => marshalCreateZendeskSupportOptionsSchema ), }), z.object({ $case: z.literal('kafkaOptions'), - kafkaOptions: z.lazy(() => marshalKafkaOptionsSchema), + kafkaOptions: z.lazy(() => marshalCreateKafkaOptionsSchema), }), ]) .optional(), @@ -4257,110 +5633,34 @@ export const marshalConnectorOptionsSchema: z.ZodType = z }), ...(d.connectorOptions?.$case === 'sharepointOptions' && { sharepoint_options: d.connectorOptions.sharepointOptions, - }), - ...(d.connectorOptions?.$case === 'gdriveOptions' && { - gdrive_options: d.connectorOptions.gdriveOptions, - }), - ...(d.connectorOptions?.$case === 'outlookOptions' && { - outlook_options: d.connectorOptions.outlookOptions, - }), - ...(d.connectorOptions?.$case === 'smartsheetOptions' && { - smartsheet_options: d.connectorOptions.smartsheetOptions, - }), - ...(d.connectorOptions?.$case === 'jiraOptions' && { - jira_options: d.connectorOptions.jiraOptions, - }), - ...(d.connectorOptions?.$case === 'confluenceOptions' && { - confluence_options: d.connectorOptions.confluenceOptions, - }), - ...(d.connectorOptions?.$case === 'metaAdsOptions' && { - meta_ads_options: d.connectorOptions.metaAdsOptions, - }), - ...(d.connectorOptions?.$case === 'zendeskSupportOptions' && { - zendesk_support_options: d.connectorOptions.zendeskSupportOptions, - }), - ...(d.connectorOptions?.$case === 'kafkaOptions' && { - kafka_options: d.connectorOptions.kafkaOptions, - }), - })); - -export const marshalCreatePipelineRequestSchema: z.ZodType = z - .object({ - allowDuplicateNames: z.boolean().optional(), - dryRun: z.boolean().optional(), - runAs: z.lazy(() => marshalPipelinesJobRunAsSchema).optional(), - parameters: z.record(z.string(), z.string()).optional(), - id: z.string().optional(), - name: z.string().optional(), - storage: z.string().optional(), - configuration: z.record(z.string(), z.string()).optional(), - clusters: z.array(z.lazy(() => marshalPipelineClusterSchema)).optional(), - libraries: z.array(z.lazy(() => marshalPipelineLibrarySchema)).optional(), - ingestionDefinition: z - .lazy(() => marshalIngestionPipelineDefinitionSchema) - .optional(), - gatewayDefinition: z - .lazy(() => marshalIngestionGatewayPipelineDefinitionSchema) - .optional(), - trigger: z.lazy(() => marshalPipelineTriggerSchema).optional(), - target: z.string().optional(), - schema: z.string().optional(), - filters: z.lazy(() => marshalFiltersSchema).optional(), - continuous: z.boolean().optional(), - development: z.boolean().optional(), - photon: z.boolean().optional(), - edition: z.string().optional(), - channel: z.string().optional(), - catalog: z.string().optional(), - notifications: z.array(z.lazy(() => marshalNotificationsSchema)).optional(), - serverless: z.boolean().optional(), - deployment: z.lazy(() => marshalPipelineDeploymentSchema).optional(), - restartWindow: z.lazy(() => marshalRestartWindowSchema).optional(), - budgetPolicyId: z.string().optional(), - tags: z.record(z.string(), z.string()).optional(), - eventLog: z.lazy(() => marshalEventLogSpecSchema).optional(), - rootPath: z.string().optional(), - environment: z.lazy(() => marshalPipelinesEnvironmentSchema).optional(), - usagePolicyId: z.string().optional(), - serverlessComputeId: z.string().optional(), - }) - .transform(d => ({ - allow_duplicate_names: d.allowDuplicateNames, - dry_run: d.dryRun, - run_as: d.runAs, - parameters: d.parameters, - id: d.id, - name: d.name, - storage: d.storage, - configuration: d.configuration, - clusters: d.clusters, - libraries: d.libraries, - ingestion_definition: d.ingestionDefinition, - gateway_definition: d.gatewayDefinition, - trigger: d.trigger, - target: d.target, - schema: d.schema, - filters: d.filters, - continuous: d.continuous, - development: d.development, - photon: d.photon, - edition: d.edition, - channel: d.channel, - catalog: d.catalog, - notifications: d.notifications, - serverless: d.serverless, - deployment: d.deployment, - restart_window: d.restartWindow, - budget_policy_id: d.budgetPolicyId, - tags: d.tags, - event_log: d.eventLog, - root_path: d.rootPath, - environment: d.environment, - usage_policy_id: d.usagePolicyId, - serverless_compute_id: d.serverlessComputeId, + }), + ...(d.connectorOptions?.$case === 'gdriveOptions' && { + gdrive_options: d.connectorOptions.gdriveOptions, + }), + ...(d.connectorOptions?.$case === 'outlookOptions' && { + outlook_options: d.connectorOptions.outlookOptions, + }), + ...(d.connectorOptions?.$case === 'smartsheetOptions' && { + smartsheet_options: d.connectorOptions.smartsheetOptions, + }), + ...(d.connectorOptions?.$case === 'jiraOptions' && { + jira_options: d.connectorOptions.jiraOptions, + }), + ...(d.connectorOptions?.$case === 'confluenceOptions' && { + confluence_options: d.connectorOptions.confluenceOptions, + }), + ...(d.connectorOptions?.$case === 'metaAdsOptions' && { + meta_ads_options: d.connectorOptions.metaAdsOptions, + }), + ...(d.connectorOptions?.$case === 'zendeskSupportOptions' && { + zendesk_support_options: d.connectorOptions.zendeskSupportOptions, + }), + ...(d.connectorOptions?.$case === 'kafkaOptions' && { + kafka_options: d.connectorOptions.kafkaOptions, + }), })); -export const marshalCronTriggerSchema: z.ZodType = z +export const marshalCreateCronTriggerSchema: z.ZodType = z .object({ quartzCronSchedule: z.string().optional(), timezoneId: z.string().optional(), @@ -4370,10 +5670,10 @@ export const marshalCronTriggerSchema: z.ZodType = z timezone_id: d.timezoneId, })); -export const marshalDataStagingOptionsSchema: z.ZodType = z +export const marshalCreateDataStagingOptionsSchema: z.ZodType = z .object({ - catalogName: z.string().optional(), - schemaName: z.string().optional(), + catalogName: z.string(), + schemaName: z.string(), volumeName: z.string().optional(), }) .transform(d => ({ @@ -4382,85 +5682,7 @@ export const marshalDataStagingOptionsSchema: z.ZodType = z volume_name: d.volumeName, })); -export const marshalEditPipelineRequestSchema: z.ZodType = z - .object({ - pipelineId: z.string().optional(), - allowDuplicateNames: z.boolean().optional(), - expectedLastModified: z.bigint().optional(), - runAs: z.lazy(() => marshalPipelinesJobRunAsSchema).optional(), - parameters: z.record(z.string(), z.string()).optional(), - id: z.string().optional(), - name: z.string().optional(), - storage: z.string().optional(), - configuration: z.record(z.string(), z.string()).optional(), - clusters: z.array(z.lazy(() => marshalPipelineClusterSchema)).optional(), - libraries: z.array(z.lazy(() => marshalPipelineLibrarySchema)).optional(), - ingestionDefinition: z - .lazy(() => marshalIngestionPipelineDefinitionSchema) - .optional(), - gatewayDefinition: z - .lazy(() => marshalIngestionGatewayPipelineDefinitionSchema) - .optional(), - trigger: z.lazy(() => marshalPipelineTriggerSchema).optional(), - target: z.string().optional(), - schema: z.string().optional(), - filters: z.lazy(() => marshalFiltersSchema).optional(), - continuous: z.boolean().optional(), - development: z.boolean().optional(), - photon: z.boolean().optional(), - edition: z.string().optional(), - channel: z.string().optional(), - catalog: z.string().optional(), - notifications: z.array(z.lazy(() => marshalNotificationsSchema)).optional(), - serverless: z.boolean().optional(), - deployment: z.lazy(() => marshalPipelineDeploymentSchema).optional(), - restartWindow: z.lazy(() => marshalRestartWindowSchema).optional(), - budgetPolicyId: z.string().optional(), - tags: z.record(z.string(), z.string()).optional(), - eventLog: z.lazy(() => marshalEventLogSpecSchema).optional(), - rootPath: z.string().optional(), - environment: z.lazy(() => marshalPipelinesEnvironmentSchema).optional(), - usagePolicyId: z.string().optional(), - serverlessComputeId: z.string().optional(), - }) - .transform(d => ({ - pipeline_id: d.pipelineId, - allow_duplicate_names: d.allowDuplicateNames, - expected_last_modified: d.expectedLastModified, - run_as: d.runAs, - parameters: d.parameters, - id: d.id, - name: d.name, - storage: d.storage, - configuration: d.configuration, - clusters: d.clusters, - libraries: d.libraries, - ingestion_definition: d.ingestionDefinition, - gateway_definition: d.gatewayDefinition, - trigger: d.trigger, - target: d.target, - schema: d.schema, - filters: d.filters, - continuous: d.continuous, - development: d.development, - photon: d.photon, - edition: d.edition, - channel: d.channel, - catalog: d.catalog, - notifications: d.notifications, - serverless: d.serverless, - deployment: d.deployment, - restart_window: d.restartWindow, - budget_policy_id: d.budgetPolicyId, - tags: d.tags, - event_log: d.eventLog, - root_path: d.rootPath, - environment: d.environment, - usage_policy_id: d.usagePolicyId, - serverless_compute_id: d.serverlessComputeId, - })); - -export const marshalEventLogSpecSchema: z.ZodType = z +export const marshalCreateEventLogSpecSchema: z.ZodType = z .object({ name: z.string().optional(), schema: z.string().optional(), @@ -4472,7 +5694,7 @@ export const marshalEventLogSpecSchema: z.ZodType = z catalog: d.catalog, })); -export const marshalFileFilterSchema: z.ZodType = z +export const marshalCreateFileFilterSchema: z.ZodType = z .object({ filter: z .discriminatedUnion('$case', [ @@ -4498,10 +5720,12 @@ export const marshalFileFilterSchema: z.ZodType = z }), })); -export const marshalFileIngestionOptionsSchema: z.ZodType = z +export const marshalCreateFileIngestionOptionsSchema: z.ZodType = z .object({ format: z.string().optional(), - fileFilters: z.array(z.lazy(() => marshalFileFilterSchema)).optional(), + fileFilters: z + .array(z.lazy(() => marshalCreateFileFilterSchema)) + .optional(), inferColumnTypes: z.boolean().optional(), schemaEvolutionMode: z.string().optional(), schemaHints: z.string().optional(), @@ -4526,7 +5750,7 @@ export const marshalFileIngestionOptionsSchema: z.ZodType = z format_options: d.formatOptions, })); -export const marshalFiltersSchema: z.ZodType = z +export const marshalCreateFiltersSchema: z.ZodType = z .object({ include: z.array(z.string()).optional(), exclude: z.array(z.string()).optional(), @@ -4536,7 +5760,7 @@ export const marshalFiltersSchema: z.ZodType = z exclude: d.exclude, })); -export const marshalGoogleAdsConfigSchema: z.ZodType = z +export const marshalCreateGoogleAdsConfigSchema: z.ZodType = z .object({ managerAccountId: z.string().optional(), }) @@ -4544,9 +5768,9 @@ export const marshalGoogleAdsConfigSchema: z.ZodType = z manager_account_id: d.managerAccountId, })); -export const marshalGoogleAdsOptionsSchema: z.ZodType = z +export const marshalCreateGoogleAdsOptionsSchema: z.ZodType = z .object({ - managerAccountId: z.string().optional(), + managerAccountId: z.string(), lookbackWindowDays: z.number().optional(), syncStartDate: z.string().optional(), }) @@ -4556,12 +5780,12 @@ export const marshalGoogleAdsOptionsSchema: z.ZodType = z sync_start_date: d.syncStartDate, })); -export const marshalGoogleDriveOptionsSchema: z.ZodType = z +export const marshalCreateGoogleDriveOptionsSchema: z.ZodType = z .object({ url: z.string().optional(), entityType: z.string().optional(), fileIngestionOptions: z - .lazy(() => marshalFileIngestionOptionsSchema) + .lazy(() => marshalCreateFileIngestionOptionsSchema) .optional(), }) .transform(d => ({ @@ -4570,27 +5794,28 @@ export const marshalGoogleDriveOptionsSchema: z.ZodType = z file_ingestion_options: d.fileIngestionOptions, })); -export const marshalIngestionGatewayPipelineDefinitionSchema: z.ZodType = z - .object({ - connectionName: z.string().optional(), - connectionId: z.string().optional(), - gatewayStorageCatalog: z.string().optional(), - gatewayStorageSchema: z.string().optional(), - gatewayStorageName: z.string().optional(), - connectionParameters: z - .lazy(() => marshalConnectionParametersSchema) - .optional(), - }) - .transform(d => ({ - connection_name: d.connectionName, - connection_id: d.connectionId, - gateway_storage_catalog: d.gatewayStorageCatalog, - gateway_storage_schema: d.gatewayStorageSchema, - gateway_storage_name: d.gatewayStorageName, - connection_parameters: d.connectionParameters, - })); +export const marshalCreateIngestionGatewayPipelineDefinitionSchema: z.ZodType = + z + .object({ + connectionName: z.string(), + connectionId: z.string().optional(), + gatewayStorageCatalog: z.string(), + gatewayStorageSchema: z.string(), + gatewayStorageName: z.string().optional(), + connectionParameters: z + .lazy(() => marshalCreateConnectionParametersSchema) + .optional(), + }) + .transform(d => ({ + connection_name: d.connectionName, + connection_id: d.connectionId, + gateway_storage_catalog: d.gatewayStorageCatalog, + gateway_storage_schema: d.gatewayStorageSchema, + gateway_storage_name: d.gatewayStorageName, + connection_parameters: d.connectionParameters, + })); -export const marshalIngestionPipelineDefinitionSchema: z.ZodType = z +export const marshalCreateIngestionPipelineDefinitionSchema: z.ZodType = z .object({ source: z .discriminatedUnion('$case', [ @@ -4610,23 +5835,26 @@ export const marshalIngestionPipelineDefinitionSchema: z.ZodType = z .optional(), objects: z .array( - z.lazy(() => marshalIngestionPipelineDefinition_IngestionConfigSchema) + z.lazy( + () => marshalIngestionPipelineDefinition_CreateIngestionConfigSchema + ) ) .optional(), - sourceType: z.string().optional(), tableConfiguration: z - .lazy(() => marshalIngestionPipelineDefinition_TableSpecificConfigSchema) + .lazy( + () => marshalIngestionPipelineDefinition_CreateTableSpecificConfigSchema + ) .optional(), netsuiteJarPath: z.string().optional(), sourceConfigurations: z - .array(z.lazy(() => marshalSourceConfigSchema)) + .array(z.lazy(() => marshalCreateSourceConfigSchema)) .optional(), fullRefreshWindow: z - .lazy(() => marshalOperationTimeWindowSchema) + .lazy(() => marshalCreateOperationTimeWindowSchema) .optional(), connectorType: z.string().optional(), dataStagingOptions: z - .lazy(() => marshalDataStagingOptionsSchema) + .lazy(() => marshalCreateDataStagingOptionsSchema) .optional(), }) .transform(d => ({ @@ -4640,7 +5868,6 @@ export const marshalIngestionPipelineDefinitionSchema: z.ZodType = z ingest_from_uc_foreign_catalog: d.source.ingestFromUcForeignCatalog, }), objects: d.objects, - source_type: d.sourceType, table_configuration: d.tableConfiguration, netsuite_jar_path: d.netsuiteJarPath, source_configurations: d.sourceConfigurations, @@ -4649,202 +5876,7 @@ export const marshalIngestionPipelineDefinitionSchema: z.ZodType = z data_staging_options: d.dataStagingOptions, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngestionPipelineDefinition_IngestionConfigSchema: z.ZodType = - z - .object({ - sourceTables: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('schema'), - schema: z.lazy( - () => marshalIngestionPipelineDefinition_SchemaSpecSchema - ), - }), - z.object({ - $case: z.literal('table'), - table: z.lazy( - () => marshalIngestionPipelineDefinition_TableSpecSchema - ), - }), - z.object({ - $case: z.literal('report'), - report: z.lazy( - () => marshalIngestionPipelineDefinition_ReportSpecSchema - ), - }), - ]) - .optional(), - }) - .transform(d => ({ - ...(d.sourceTables?.$case === 'schema' && { - schema: d.sourceTables.schema, - }), - ...(d.sourceTables?.$case === 'table' && {table: d.sourceTables.table}), - ...(d.sourceTables?.$case === 'report' && { - report: d.sourceTables.report, - }), - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngestionPipelineDefinition_ReportSpecSchema: z.ZodType = z - .object({ - sourceUrl: z.string().optional(), - destinationCatalog: z.string().optional(), - destinationSchema: z.string().optional(), - destinationTable: z.string().optional(), - tableConfiguration: z - .lazy(() => marshalIngestionPipelineDefinition_TableSpecificConfigSchema) - .optional(), - }) - .transform(d => ({ - source_url: d.sourceUrl, - destination_catalog: d.destinationCatalog, - destination_schema: d.destinationSchema, - destination_table: d.destinationTable, - table_configuration: d.tableConfiguration, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngestionPipelineDefinition_SchemaSpecSchema: z.ZodType = z - .object({ - sourceCatalog: z.string().optional(), - sourceSchema: z.string().optional(), - destinationCatalog: z.string().optional(), - destinationSchema: z.string().optional(), - tableConfiguration: z - .lazy(() => marshalIngestionPipelineDefinition_TableSpecificConfigSchema) - .optional(), - connectorOptions: z.lazy(() => marshalConnectorOptionsSchema).optional(), - }) - .transform(d => ({ - source_catalog: d.sourceCatalog, - source_schema: d.sourceSchema, - destination_catalog: d.destinationCatalog, - destination_schema: d.destinationSchema, - table_configuration: d.tableConfiguration, - connector_options: d.connectorOptions, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngestionPipelineDefinition_TableSpecSchema: z.ZodType = z - .object({ - sourceCatalog: z.string().optional(), - sourceSchema: z.string().optional(), - sourceTable: z.string().optional(), - destinationCatalog: z.string().optional(), - destinationSchema: z.string().optional(), - destinationTable: z.string().optional(), - tableConfiguration: z - .lazy(() => marshalIngestionPipelineDefinition_TableSpecificConfigSchema) - .optional(), - connectorOptions: z.lazy(() => marshalConnectorOptionsSchema).optional(), - }) - .transform(d => ({ - source_catalog: d.sourceCatalog, - source_schema: d.sourceSchema, - source_table: d.sourceTable, - destination_catalog: d.destinationCatalog, - destination_schema: d.destinationSchema, - destination_table: d.destinationTable, - table_configuration: d.tableConfiguration, - connector_options: d.connectorOptions, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngestionPipelineDefinition_TableSpecificConfigSchema: z.ZodType = - z - .object({ - scdType: z.string().optional(), - primaryKeys: z.array(z.string()).optional(), - sequenceBy: z.array(z.string()).optional(), - includeColumns: z.array(z.string()).optional(), - excludeColumns: z.array(z.string()).optional(), - salesforceIncludeFormulaFields: z.boolean().optional(), - workdayReportParameters: z - .lazy( - () => marshalIngestionPipelineDefinition_WorkdayReportParametersSchema - ) - .optional(), - rowFilter: z.string().optional(), - queryBasedConnectorConfig: z - .lazy( - () => - marshalIngestionPipelineDefinition_TableSpecificConfig_QueryBasedConnectorConfigSchema - ) - .optional(), - autoFullRefreshPolicy: z - .lazy(() => marshalAutoFullRefreshPolicySchema) - .optional(), - tableProperties: z.record(z.string(), z.string()).optional(), - enableAutoClustering: z.boolean().optional(), - clusteringColumns: z.array(z.string()).optional(), - }) - .transform(d => ({ - scd_type: d.scdType, - primary_keys: d.primaryKeys, - sequence_by: d.sequenceBy, - include_columns: d.includeColumns, - exclude_columns: d.excludeColumns, - salesforce_include_formula_fields: d.salesforceIncludeFormulaFields, - workday_report_parameters: d.workdayReportParameters, - row_filter: d.rowFilter, - query_based_connector_config: d.queryBasedConnectorConfig, - auto_full_refresh_policy: d.autoFullRefreshPolicy, - table_properties: d.tableProperties, - enable_auto_clustering: d.enableAutoClustering, - clustering_columns: d.clusteringColumns, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngestionPipelineDefinition_TableSpecificConfig_QueryBasedConnectorConfigSchema: z.ZodType = - z - .object({ - cursorColumns: z.array(z.string()).optional(), - deletionCondition: z.string().optional(), - hardDeletionSyncMinIntervalInSeconds: z.bigint().optional(), - }) - .transform(d => ({ - cursor_columns: d.cursorColumns, - deletion_condition: d.deletionCondition, - hard_deletion_sync_min_interval_in_seconds: - d.hardDeletionSyncMinIntervalInSeconds, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngestionPipelineDefinition_WorkdayReportParametersSchema: z.ZodType = - z - .object({ - incremental: z.boolean().optional(), - reportParameters: z - .array( - z.lazy( - () => - marshalIngestionPipelineDefinition_WorkdayReportParameters_QueryKeyValueSchema - ) - ) - .optional(), - parameters: z.record(z.string(), z.string()).optional(), - }) - .transform(d => ({ - incremental: d.incremental, - report_parameters: d.reportParameters, - parameters: d.parameters, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalIngestionPipelineDefinition_WorkdayReportParameters_QueryKeyValueSchema: z.ZodType = - z - .object({ - key: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - -export const marshalJiraConnectorOptionsSchema: z.ZodType = z +export const marshalCreateJiraConnectorOptionsSchema: z.ZodType = z .object({ includeJiraSpaces: z.array(z.string()).optional(), }) @@ -4852,7 +5884,7 @@ export const marshalJiraConnectorOptionsSchema: z.ZodType = z include_jira_spaces: d.includeJiraSpaces, })); -export const marshalJsonTransformerOptionsSchema: z.ZodType = z +export const marshalCreateJsonTransformerOptionsSchema: z.ZodType = z .object({ asVariant: z.boolean().optional(), schema: z.string().optional(), @@ -4868,12 +5900,12 @@ export const marshalJsonTransformerOptionsSchema: z.ZodType = z schema_hints: d.schemaHints, })); -export const marshalKafkaOptionsSchema: z.ZodType = z +export const marshalCreateKafkaOptionsSchema: z.ZodType = z .object({ topics: z.array(z.string()).optional(), topicPattern: z.string().optional(), - keyTransformer: z.lazy(() => marshalTransformerSchema).optional(), - valueTransformer: z.lazy(() => marshalTransformerSchema).optional(), + keyTransformer: z.lazy(() => marshalCreateTransformerSchema).optional(), + valueTransformer: z.lazy(() => marshalCreateTransformerSchema).optional(), startingOffset: z.string().optional(), maxOffsetsPerTrigger: z.bigint().optional(), clientConfig: z.record(z.string(), z.string()).optional(), @@ -4888,9 +5920,9 @@ export const marshalKafkaOptionsSchema: z.ZodType = z client_config: d.clientConfig, })); -export const marshalManualTriggerSchema: z.ZodType = z.object({}); +export const marshalCreateManualTriggerSchema: z.ZodType = z.object({}); -export const marshalMetaMarketingOptionsSchema: z.ZodType = z +export const marshalCreateMetaMarketingOptionsSchema: z.ZodType = z .object({ level: z.string().optional(), breakdowns: z.array(z.string()).optional(), @@ -4912,7 +5944,7 @@ export const marshalMetaMarketingOptionsSchema: z.ZodType = z action_attribution_windows: d.actionAttributionWindows, })); -export const marshalNotebookLibrarySchema: z.ZodType = z +export const marshalCreateNotebookLibrarySchema: z.ZodType = z .object({ path: z.string().optional(), }) @@ -4920,7 +5952,7 @@ export const marshalNotebookLibrarySchema: z.ZodType = z path: d.path, })); -export const marshalNotificationsSchema: z.ZodType = z +export const marshalCreateNotificationsSchema: z.ZodType = z .object({ emailRecipients: z.array(z.string()).optional(), alerts: z.array(z.string()).optional(), @@ -4930,9 +5962,9 @@ export const marshalNotificationsSchema: z.ZodType = z alerts: d.alerts, })); -export const marshalOperationTimeWindowSchema: z.ZodType = z +export const marshalCreateOperationTimeWindowSchema: z.ZodType = z .object({ - startHour: z.number().optional(), + startHour: z.number(), daysOfWeek: z.array(z.string()).optional(), timeZoneId: z.string().optional(), }) @@ -4942,7 +5974,7 @@ export const marshalOperationTimeWindowSchema: z.ZodType = z time_zone_id: d.timeZoneId, })); -export const marshalOutlookOptionsSchema: z.ZodType = z +export const marshalCreateOutlookOptionsSchema: z.ZodType = z .object({ folderFilter: z.array(z.string()).optional(), senderFilter: z.array(z.string()).optional(), @@ -4968,7 +6000,7 @@ export const marshalOutlookOptionsSchema: z.ZodType = z include_subjects: d.includeSubjects, })); -export const marshalPathPatternSchema: z.ZodType = z +export const marshalCreatePathPatternSchema: z.ZodType = z .object({ include: z.string().optional(), }) @@ -4976,26 +6008,30 @@ export const marshalPathPatternSchema: z.ZodType = z include: d.include, })); -export const marshalPipelineClusterSchema: z.ZodType = z +export const marshalCreatePipelineClusterSchema: z.ZodType = z .object({ label: z.string().optional(), applyPolicyDefaultValues: z.boolean().optional(), sparkConf: z.record(z.string(), z.string()).optional(), - awsAttributes: z.lazy(() => marshalPipelinesAwsAttributesSchema).optional(), + awsAttributes: z + .lazy(() => marshalCreatePipelinesAwsAttributesSchema) + .optional(), azureAttributes: z - .lazy(() => marshalPipelinesAzureAttributesSchema) + .lazy(() => marshalCreatePipelinesAzureAttributesSchema) + .optional(), + gcpAttributes: z + .lazy(() => marshalCreatePipelinesGcpAttributesSchema) .optional(), - gcpAttributes: z.lazy(() => marshalPipelinesGcpAttributesSchema).optional(), nodeTypeId: z.string().optional(), driverNodeTypeId: z.string().optional(), sshPublicKeys: z.array(z.string()).optional(), customTags: z.record(z.string(), z.string()).optional(), clusterLogConf: z - .lazy(() => marshalPipelinesClusterLogConfSchema) + .lazy(() => marshalCreatePipelinesClusterLogConfSchema) .optional(), sparkEnvVars: z.record(z.string(), z.string()).optional(), initScripts: z - .array(z.lazy(() => marshalPipelinesInitScriptInfoSchema)) + .array(z.lazy(() => marshalCreatePipelinesInitScriptInfoSchema)) .optional(), instancePoolId: z.string().optional(), policyId: z.string().optional(), @@ -5006,7 +6042,7 @@ export const marshalPipelineClusterSchema: z.ZodType = z z.object({$case: z.literal('numWorkers'), numWorkers: z.number()}), z.object({ $case: z.literal('autoscale'), - autoscale: z.lazy(() => marshalPipelinesAutoScaleSchema), + autoscale: z.lazy(() => marshalCreatePipelinesAutoScaleSchema), }), ]) .optional(), @@ -5033,9 +6069,9 @@ export const marshalPipelineClusterSchema: z.ZodType = z ...(d.size?.$case === 'autoscale' && {autoscale: d.size.autoscale}), })); -export const marshalPipelineDeploymentSchema: z.ZodType = z +export const marshalCreatePipelineDeploymentSchema: z.ZodType = z .object({ - kind: z.string().optional(), + kind: z.string(), metadataFilePath: z.string().optional(), deploymentId: z.string().optional(), versionId: z.string().optional(), @@ -5047,27 +6083,27 @@ export const marshalPipelineDeploymentSchema: z.ZodType = z version_id: d.versionId, })); -export const marshalPipelineLibrarySchema: z.ZodType = z +export const marshalCreatePipelineLibrarySchema: z.ZodType = z .object({ lib: z .discriminatedUnion('$case', [ z.object({$case: z.literal('jar'), jar: z.string()}), z.object({ $case: z.literal('maven'), - maven: z.lazy(() => marshalPipelinesMavenLibrarySchema), + maven: z.lazy(() => marshalCreatePipelinesMavenLibrarySchema), }), z.object({$case: z.literal('whl'), whl: z.string()}), z.object({ $case: z.literal('notebook'), - notebook: z.lazy(() => marshalNotebookLibrarySchema), + notebook: z.lazy(() => marshalCreateNotebookLibrarySchema), }), z.object({ $case: z.literal('file'), - file: z.lazy(() => marshalNotebookLibrarySchema), + file: z.lazy(() => marshalCreateNotebookLibrarySchema), }), z.object({ $case: z.literal('glob'), - glob: z.lazy(() => marshalPathPatternSchema), + glob: z.lazy(() => marshalCreatePathPatternSchema), }), ]) .optional(), @@ -5081,17 +6117,101 @@ export const marshalPipelineLibrarySchema: z.ZodType = z ...(d.lib?.$case === 'glob' && {glob: d.lib.glob}), })); -export const marshalPipelineTriggerSchema: z.ZodType = z +export const marshalCreatePipelineRequestSchema: z.ZodType = z + .object({ + allowDuplicateNames: z.boolean().optional(), + dryRun: z.boolean().optional(), + runAs: z.lazy(() => marshalCreatePipelinesJobRunAsSchema).optional(), + parameters: z.record(z.string(), z.string()).optional(), + id: z.string().optional(), + name: z.string().optional(), + storage: z.string().optional(), + configuration: z.record(z.string(), z.string()).optional(), + clusters: z + .array(z.lazy(() => marshalCreatePipelineClusterSchema)) + .optional(), + libraries: z + .array(z.lazy(() => marshalCreatePipelineLibrarySchema)) + .optional(), + ingestionDefinition: z + .lazy(() => marshalCreateIngestionPipelineDefinitionSchema) + .optional(), + gatewayDefinition: z + .lazy(() => marshalCreateIngestionGatewayPipelineDefinitionSchema) + .optional(), + trigger: z.lazy(() => marshalCreatePipelineTriggerSchema).optional(), + target: z.string().optional(), + schema: z.string().optional(), + filters: z.lazy(() => marshalCreateFiltersSchema).optional(), + continuous: z.boolean().optional(), + development: z.boolean().optional(), + photon: z.boolean().optional(), + edition: z.string().optional(), + channel: z.string().optional(), + catalog: z.string().optional(), + notifications: z + .array(z.lazy(() => marshalCreateNotificationsSchema)) + .optional(), + serverless: z.boolean().optional(), + deployment: z.lazy(() => marshalCreatePipelineDeploymentSchema).optional(), + restartWindow: z.lazy(() => marshalCreateRestartWindowSchema).optional(), + budgetPolicyId: z.string().optional(), + tags: z.record(z.string(), z.string()).optional(), + eventLog: z.lazy(() => marshalCreateEventLogSpecSchema).optional(), + rootPath: z.string().optional(), + environment: z + .lazy(() => marshalCreatePipelinesEnvironmentSchema) + .optional(), + usagePolicyId: z.string().optional(), + serverlessComputeId: z.string().optional(), + }) + .transform(d => ({ + allow_duplicate_names: d.allowDuplicateNames, + dry_run: d.dryRun, + run_as: d.runAs, + parameters: d.parameters, + id: d.id, + name: d.name, + storage: d.storage, + configuration: d.configuration, + clusters: d.clusters, + libraries: d.libraries, + ingestion_definition: d.ingestionDefinition, + gateway_definition: d.gatewayDefinition, + trigger: d.trigger, + target: d.target, + schema: d.schema, + filters: d.filters, + continuous: d.continuous, + development: d.development, + photon: d.photon, + edition: d.edition, + channel: d.channel, + catalog: d.catalog, + notifications: d.notifications, + serverless: d.serverless, + deployment: d.deployment, + restart_window: d.restartWindow, + budget_policy_id: d.budgetPolicyId, + tags: d.tags, + event_log: d.eventLog, + root_path: d.rootPath, + environment: d.environment, + usage_policy_id: d.usagePolicyId, + serverless_compute_id: d.serverlessComputeId, + })); + +export const marshalCreatePipelineTriggerSchema: z.ZodType = z .object({ trigger: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('manual'), - manual: z.lazy(() => marshalManualTriggerSchema), + manual: z.lazy(() => marshalCreateManualTriggerSchema), }), z.object({ $case: z.literal('cron'), - cron: z.lazy(() => marshalCronTriggerSchema), + cron: z.lazy(() => marshalCreateCronTriggerSchema), }), ]) .optional(), @@ -5101,10 +6221,10 @@ export const marshalPipelineTriggerSchema: z.ZodType = z ...(d.trigger?.$case === 'cron' && {cron: d.trigger.cron}), })); -export const marshalPipelinesAutoScaleSchema: z.ZodType = z +export const marshalCreatePipelinesAutoScaleSchema: z.ZodType = z .object({ - minWorkers: z.number().optional(), - maxWorkers: z.number().optional(), + minWorkers: z.number(), + maxWorkers: z.number(), mode: z.string().optional(), }) .transform(d => ({ @@ -5113,7 +6233,7 @@ export const marshalPipelinesAutoScaleSchema: z.ZodType = z mode: d.mode, })); -export const marshalPipelinesAwsAttributesSchema: z.ZodType = z +export const marshalCreatePipelinesAwsAttributesSchema: z.ZodType = z .object({ firstOnDemand: z.number().optional(), availability: z.string().optional(), @@ -5139,7 +6259,7 @@ export const marshalPipelinesAwsAttributesSchema: z.ZodType = z ebs_volume_throughput: d.ebsVolumeThroughput, })); -export const marshalPipelinesAzureAttributesSchema: z.ZodType = z +export const marshalCreatePipelinesAzureAttributesSchema: z.ZodType = z .object({ firstOnDemand: z.number().optional(), availability: z.string().optional(), @@ -5151,13 +6271,13 @@ export const marshalPipelinesAzureAttributesSchema: z.ZodType = z spot_bid_max_price: d.spotBidMaxPrice, })); -export const marshalPipelinesClusterLogConfSchema: z.ZodType = z +export const marshalCreatePipelinesClusterLogConfSchema: z.ZodType = z .object({ storageInfo: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('dbfs'), - dbfs: z.lazy(() => marshalPipelinesDbfsStorageInfoSchema), + dbfs: z.lazy(() => marshalCreatePipelinesDbfsStorageInfoSchema), }), ]) .optional(), @@ -5166,7 +6286,7 @@ export const marshalPipelinesClusterLogConfSchema: z.ZodType = z ...(d.storageInfo?.$case === 'dbfs' && {dbfs: d.storageInfo.dbfs}), })); -export const marshalPipelinesDbfsStorageInfoSchema: z.ZodType = z +export const marshalCreatePipelinesDbfsStorageInfoSchema: z.ZodType = z .object({ destination: z.string().optional(), }) @@ -5174,7 +6294,7 @@ export const marshalPipelinesDbfsStorageInfoSchema: z.ZodType = z destination: d.destination, })); -export const marshalPipelinesEnvironmentSchema: z.ZodType = z +export const marshalCreatePipelinesEnvironmentSchema: z.ZodType = z .object({ dependencies: z.array(z.string()).optional(), environmentVersion: z.string().optional(), @@ -5184,7 +6304,7 @@ export const marshalPipelinesEnvironmentSchema: z.ZodType = z environment_version: d.environmentVersion, })); -export const marshalPipelinesGcpAttributesSchema: z.ZodType = z +export const marshalCreatePipelinesGcpAttributesSchema: z.ZodType = z .object({ googleServiceAccount: z.string().optional(), bootDiskSize: z.number().optional(), @@ -5200,17 +6320,17 @@ export const marshalPipelinesGcpAttributesSchema: z.ZodType = z local_ssd_count: d.localSsdCount, })); -export const marshalPipelinesInitScriptInfoSchema: z.ZodType = z +export const marshalCreatePipelinesInitScriptInfoSchema: z.ZodType = z .object({ storageInfo: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('dbfs'), - dbfs: z.lazy(() => marshalPipelinesDbfsStorageInfoSchema), + dbfs: z.lazy(() => marshalCreatePipelinesDbfsStorageInfoSchema), }), z.object({ $case: z.literal('s3'), - s3: z.lazy(() => marshalPipelinesS3StorageInfoSchema), + s3: z.lazy(() => marshalCreatePipelinesS3StorageInfoSchema), }), ]) .optional(), @@ -5220,7 +6340,7 @@ export const marshalPipelinesInitScriptInfoSchema: z.ZodType = z ...(d.storageInfo?.$case === 's3' && {s3: d.storageInfo.s3}), })); -export const marshalPipelinesJobRunAsSchema: z.ZodType = z +export const marshalCreatePipelinesJobRunAsSchema: z.ZodType = z .object({ identity: z .discriminatedUnion('$case', [ @@ -5239,9 +6359,9 @@ export const marshalPipelinesJobRunAsSchema: z.ZodType = z }), })); -export const marshalPipelinesMavenLibrarySchema: z.ZodType = z +export const marshalCreatePipelinesMavenLibrarySchema: z.ZodType = z .object({ - coordinates: z.string().optional(), + coordinates: z.string(), repo: z.string().optional(), exclusions: z.array(z.string()).optional(), }) @@ -5251,7 +6371,7 @@ export const marshalPipelinesMavenLibrarySchema: z.ZodType = z exclusions: d.exclusions, })); -export const marshalPipelinesS3StorageInfoSchema: z.ZodType = z +export const marshalCreatePipelinesS3StorageInfoSchema: z.ZodType = z .object({ destination: z.string().optional(), region: z.string().optional(), @@ -5271,15 +6391,15 @@ export const marshalPipelinesS3StorageInfoSchema: z.ZodType = z canned_acl: d.cannedAcl, })); -export const marshalPostgresCatalogConfigSchema: z.ZodType = z +export const marshalCreatePostgresCatalogConfigSchema: z.ZodType = z .object({ - slotConfig: z.lazy(() => marshalPostgresSlotConfigSchema).optional(), + slotConfig: z.lazy(() => marshalCreatePostgresSlotConfigSchema).optional(), }) .transform(d => ({ slot_config: d.slotConfig, })); -export const marshalPostgresSlotConfigSchema: z.ZodType = z +export const marshalCreatePostgresSlotConfigSchema: z.ZodType = z .object({ slotName: z.string().optional(), publicationName: z.string().optional(), @@ -5289,7 +6409,7 @@ export const marshalPostgresSlotConfigSchema: z.ZodType = z publication_name: d.publicationName, })); -export const marshalReplaceWhereOverrideSchema: z.ZodType = z +export const marshalCreateReplaceWhereOverrideSchema: z.ZodType = z .object({ flowName: z.string().optional(), predicateOverride: z.string().optional(), @@ -5299,9 +6419,9 @@ export const marshalReplaceWhereOverrideSchema: z.ZodType = z predicate_override: d.predicateOverride, })); -export const marshalRestartWindowSchema: z.ZodType = z +export const marshalCreateRestartWindowSchema: z.ZodType = z .object({ - startHour: z.number().optional(), + startHour: z.number(), daysOfWeek: z.array(z.string()).optional(), timeZoneId: z.string().optional(), }) @@ -5311,87 +6431,434 @@ export const marshalRestartWindowSchema: z.ZodType = z time_zone_id: d.timeZoneId, })); -export const marshalRewindDatasetSpecSchema: z.ZodType = z - .object({ - identifier: z.string().optional(), - cascade: z.boolean().optional(), - resetCheckpoints: z.boolean().optional(), - }) - .transform(d => ({ - identifier: d.identifier, - cascade: d.cascade, - reset_checkpoints: d.resetCheckpoints, - })); +export const marshalCreateRewindDatasetSpecSchema: z.ZodType = z + .object({ + identifier: z.string().optional(), + cascade: z.boolean().optional(), + resetCheckpoints: z.boolean().optional(), + }) + .transform(d => ({ + identifier: d.identifier, + cascade: d.cascade, + reset_checkpoints: d.resetCheckpoints, + })); + +export const marshalCreateRewindSpecSchema: z.ZodType = z + .object({ + rewindTimestamp: z.string().optional(), + dryRun: z.boolean().optional(), + datasets: z + .array(z.lazy(() => marshalCreateRewindDatasetSpecSchema)) + .optional(), + }) + .transform(d => ({ + rewind_timestamp: d.rewindTimestamp, + dry_run: d.dryRun, + datasets: d.datasets, + })); + +export const marshalCreateSharepointOptionsSchema: z.ZodType = z + .object({ + url: z.string().optional(), + entityType: z.string().optional(), + fileIngestionOptions: z + .lazy(() => marshalCreateFileIngestionOptionsSchema) + .optional(), + }) + .transform(d => ({ + url: d.url, + entity_type: d.entityType, + file_ingestion_options: d.fileIngestionOptions, + })); + +export const marshalCreateSmartsheetOptionsSchema: z.ZodType = z + .object({ + enforceSchema: z.boolean().optional(), + }) + .transform(d => ({ + enforce_schema: d.enforceSchema, + })); + +export const marshalCreateSourceCatalogConfigSchema: z.ZodType = z + .object({ + sourceCatalog: z.string().optional(), + options: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('postgres'), + postgres: z.lazy(() => marshalCreatePostgresCatalogConfigSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + source_catalog: d.sourceCatalog, + ...(d.options?.$case === 'postgres' && {postgres: d.options.postgres}), + })); + +export const marshalCreateSourceConfigSchema: z.ZodType = z + .object({ + catalog: z.lazy(() => marshalCreateSourceCatalogConfigSchema).optional(), + connectorConfig: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('googleAdsConfig'), + googleAdsConfig: z.lazy(() => marshalCreateGoogleAdsConfigSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + catalog: d.catalog, + ...(d.connectorConfig?.$case === 'googleAdsConfig' && { + google_ads_config: d.connectorConfig.googleAdsConfig, + }), + })); + +export const marshalCreateTikTokAdsOptionsSchema: z.ZodType = z + .object({ + lookbackWindowDays: z.number().optional(), + syncStartDate: z.string().optional(), + dimensions: z.array(z.string()).optional(), + metrics: z.array(z.string()).optional(), + reportType: z.string().optional(), + dataLevel: z.string().optional(), + queryLifetime: z.boolean().optional(), + }) + .transform(d => ({ + lookback_window_days: d.lookbackWindowDays, + sync_start_date: d.syncStartDate, + dimensions: d.dimensions, + metrics: d.metrics, + report_type: d.reportType, + data_level: d.dataLevel, + query_lifetime: d.queryLifetime, + })); + +export const marshalCreateTransformerSchema: z.ZodType = z + .object({ + format: z.string().optional(), + config: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('jsonOptions'), + jsonOptions: z.lazy(() => marshalCreateJsonTransformerOptionsSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + format: d.format, + ...(d.config?.$case === 'jsonOptions' && { + json_options: d.config.jsonOptions, + }), + })); + +export const marshalCreateZendeskSupportOptionsSchema: z.ZodType = z + .object({ + startDate: z.string().optional(), + }) + .transform(d => ({ + start_date: d.startDate, + })); + +export const marshalEditPipelineRequestSchema: z.ZodType = z + .object({ + pipelineId: z.string().optional(), + allowDuplicateNames: z.boolean().optional(), + expectedLastModified: z.bigint().optional(), + runAs: z.lazy(() => marshalCreatePipelinesJobRunAsSchema).optional(), + parameters: z.record(z.string(), z.string()).optional(), + id: z.string().optional(), + name: z.string().optional(), + storage: z.string().optional(), + configuration: z.record(z.string(), z.string()).optional(), + clusters: z + .array(z.lazy(() => marshalCreatePipelineClusterSchema)) + .optional(), + libraries: z + .array(z.lazy(() => marshalCreatePipelineLibrarySchema)) + .optional(), + ingestionDefinition: z + .lazy(() => marshalCreateIngestionPipelineDefinitionSchema) + .optional(), + gatewayDefinition: z + .lazy(() => marshalCreateIngestionGatewayPipelineDefinitionSchema) + .optional(), + trigger: z.lazy(() => marshalCreatePipelineTriggerSchema).optional(), + target: z.string().optional(), + schema: z.string().optional(), + filters: z.lazy(() => marshalCreateFiltersSchema).optional(), + continuous: z.boolean().optional(), + development: z.boolean().optional(), + photon: z.boolean().optional(), + edition: z.string().optional(), + channel: z.string().optional(), + catalog: z.string().optional(), + notifications: z + .array(z.lazy(() => marshalCreateNotificationsSchema)) + .optional(), + serverless: z.boolean().optional(), + deployment: z.lazy(() => marshalCreatePipelineDeploymentSchema).optional(), + restartWindow: z.lazy(() => marshalCreateRestartWindowSchema).optional(), + budgetPolicyId: z.string().optional(), + tags: z.record(z.string(), z.string()).optional(), + eventLog: z.lazy(() => marshalCreateEventLogSpecSchema).optional(), + rootPath: z.string().optional(), + environment: z + .lazy(() => marshalCreatePipelinesEnvironmentSchema) + .optional(), + usagePolicyId: z.string().optional(), + serverlessComputeId: z.string().optional(), + }) + .transform(d => ({ + pipeline_id: d.pipelineId, + allow_duplicate_names: d.allowDuplicateNames, + expected_last_modified: d.expectedLastModified, + run_as: d.runAs, + parameters: d.parameters, + id: d.id, + name: d.name, + storage: d.storage, + configuration: d.configuration, + clusters: d.clusters, + libraries: d.libraries, + ingestion_definition: d.ingestionDefinition, + gateway_definition: d.gatewayDefinition, + trigger: d.trigger, + target: d.target, + schema: d.schema, + filters: d.filters, + continuous: d.continuous, + development: d.development, + photon: d.photon, + edition: d.edition, + channel: d.channel, + catalog: d.catalog, + notifications: d.notifications, + serverless: d.serverless, + deployment: d.deployment, + restart_window: d.restartWindow, + budget_policy_id: d.budgetPolicyId, + tags: d.tags, + event_log: d.eventLog, + root_path: d.rootPath, + environment: d.environment, + usage_policy_id: d.usagePolicyId, + serverless_compute_id: d.serverlessComputeId, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalIngestionPipelineDefinition_CreateIngestionConfigSchema: z.ZodType = + z + .object({ + sourceTables: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('schema'), + schema: z.lazy( + () => marshalIngestionPipelineDefinition_CreateSchemaSpecSchema + ), + }), + z.object({ + $case: z.literal('table'), + table: z.lazy( + () => marshalIngestionPipelineDefinition_CreateTableSpecSchema + ), + }), + z.object({ + $case: z.literal('report'), + report: z.lazy( + () => marshalIngestionPipelineDefinition_CreateReportSpecSchema + ), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.sourceTables?.$case === 'schema' && { + schema: d.sourceTables.schema, + }), + ...(d.sourceTables?.$case === 'table' && {table: d.sourceTables.table}), + ...(d.sourceTables?.$case === 'report' && { + report: d.sourceTables.report, + }), + })); -export const marshalRewindSpecSchema: z.ZodType = z - .object({ - rewindTimestamp: z.string().optional(), - dryRun: z.boolean().optional(), - datasets: z.array(z.lazy(() => marshalRewindDatasetSpecSchema)).optional(), - }) - .transform(d => ({ - rewind_timestamp: d.rewindTimestamp, - dry_run: d.dryRun, - datasets: d.datasets, - })); +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalIngestionPipelineDefinition_CreateReportSpecSchema: z.ZodType = + z + .object({ + sourceUrl: z.string(), + destinationCatalog: z.string(), + destinationSchema: z.string(), + destinationTable: z.string().optional(), + tableConfiguration: z + .lazy( + () => + marshalIngestionPipelineDefinition_CreateTableSpecificConfigSchema + ) + .optional(), + }) + .transform(d => ({ + source_url: d.sourceUrl, + destination_catalog: d.destinationCatalog, + destination_schema: d.destinationSchema, + destination_table: d.destinationTable, + table_configuration: d.tableConfiguration, + })); -export const marshalSharepointOptionsSchema: z.ZodType = z - .object({ - url: z.string().optional(), - entityType: z.string().optional(), - fileIngestionOptions: z - .lazy(() => marshalFileIngestionOptionsSchema) - .optional(), - }) - .transform(d => ({ - url: d.url, - entity_type: d.entityType, - file_ingestion_options: d.fileIngestionOptions, - })); +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalIngestionPipelineDefinition_CreateSchemaSpecSchema: z.ZodType = + z + .object({ + sourceCatalog: z.string().optional(), + sourceSchema: z.string(), + destinationCatalog: z.string(), + destinationSchema: z.string(), + tableConfiguration: z + .lazy( + () => + marshalIngestionPipelineDefinition_CreateTableSpecificConfigSchema + ) + .optional(), + connectorOptions: z + .lazy(() => marshalCreateConnectorOptionsSchema) + .optional(), + }) + .transform(d => ({ + source_catalog: d.sourceCatalog, + source_schema: d.sourceSchema, + destination_catalog: d.destinationCatalog, + destination_schema: d.destinationSchema, + table_configuration: d.tableConfiguration, + connector_options: d.connectorOptions, + })); -export const marshalSmartsheetOptionsSchema: z.ZodType = z - .object({ - enforceSchema: z.boolean().optional(), - }) - .transform(d => ({ - enforce_schema: d.enforceSchema, - })); +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalIngestionPipelineDefinition_CreateTableSpecSchema: z.ZodType = + z + .object({ + sourceCatalog: z.string().optional(), + sourceSchema: z.string().optional(), + sourceTable: z.string(), + destinationCatalog: z.string(), + destinationSchema: z.string(), + destinationTable: z.string().optional(), + tableConfiguration: z + .lazy( + () => + marshalIngestionPipelineDefinition_CreateTableSpecificConfigSchema + ) + .optional(), + connectorOptions: z + .lazy(() => marshalCreateConnectorOptionsSchema) + .optional(), + }) + .transform(d => ({ + source_catalog: d.sourceCatalog, + source_schema: d.sourceSchema, + source_table: d.sourceTable, + destination_catalog: d.destinationCatalog, + destination_schema: d.destinationSchema, + destination_table: d.destinationTable, + table_configuration: d.tableConfiguration, + connector_options: d.connectorOptions, + })); -export const marshalSourceCatalogConfigSchema: z.ZodType = z - .object({ - sourceCatalog: z.string().optional(), - options: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('postgres'), - postgres: z.lazy(() => marshalPostgresCatalogConfigSchema), - }), - ]) - .optional(), - }) - .transform(d => ({ - source_catalog: d.sourceCatalog, - ...(d.options?.$case === 'postgres' && {postgres: d.options.postgres}), - })); +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalIngestionPipelineDefinition_CreateTableSpecificConfigSchema: z.ZodType = + z + .object({ + scdType: z.string().optional(), + primaryKeys: z.array(z.string()).optional(), + sequenceBy: z.array(z.string()).optional(), + includeColumns: z.array(z.string()).optional(), + excludeColumns: z.array(z.string()).optional(), + salesforceIncludeFormulaFields: z.boolean().optional(), + workdayReportParameters: z + .lazy( + () => + marshalIngestionPipelineDefinition_CreateWorkdayReportParametersSchema + ) + .optional(), + rowFilter: z.string().optional(), + queryBasedConnectorConfig: z + .lazy( + () => + marshalIngestionPipelineDefinition_TableSpecificConfig_CreateQueryBasedConnectorConfigSchema + ) + .optional(), + autoFullRefreshPolicy: z + .lazy(() => marshalCreateAutoFullRefreshPolicySchema) + .optional(), + tableProperties: z.record(z.string(), z.string()).optional(), + enableAutoClustering: z.boolean().optional(), + clusteringColumns: z.array(z.string()).optional(), + }) + .transform(d => ({ + scd_type: d.scdType, + primary_keys: d.primaryKeys, + sequence_by: d.sequenceBy, + include_columns: d.includeColumns, + exclude_columns: d.excludeColumns, + salesforce_include_formula_fields: d.salesforceIncludeFormulaFields, + workday_report_parameters: d.workdayReportParameters, + row_filter: d.rowFilter, + query_based_connector_config: d.queryBasedConnectorConfig, + auto_full_refresh_policy: d.autoFullRefreshPolicy, + table_properties: d.tableProperties, + enable_auto_clustering: d.enableAutoClustering, + clustering_columns: d.clusteringColumns, + })); -export const marshalSourceConfigSchema: z.ZodType = z - .object({ - catalog: z.lazy(() => marshalSourceCatalogConfigSchema).optional(), - connectorConfig: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('googleAdsConfig'), - googleAdsConfig: z.lazy(() => marshalGoogleAdsConfigSchema), - }), - ]) - .optional(), - }) - .transform(d => ({ - catalog: d.catalog, - ...(d.connectorConfig?.$case === 'googleAdsConfig' && { - google_ads_config: d.connectorConfig.googleAdsConfig, - }), - })); +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalIngestionPipelineDefinition_CreateWorkdayReportParametersSchema: z.ZodType = + z + .object({ + incremental: z.boolean().optional(), + reportParameters: z + .array( + z.lazy( + () => + marshalIngestionPipelineDefinition_WorkdayReportParameters_CreateQueryKeyValueSchema + ) + ) + .optional(), + parameters: z.record(z.string(), z.string()).optional(), + }) + .transform(d => ({ + incremental: d.incremental, + report_parameters: d.reportParameters, + parameters: d.parameters, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalIngestionPipelineDefinition_TableSpecificConfig_CreateQueryBasedConnectorConfigSchema: z.ZodType = + z + .object({ + cursorColumns: z.array(z.string()).optional(), + deletionCondition: z.string().optional(), + hardDeletionSyncMinIntervalInSeconds: z.bigint().optional(), + }) + .transform(d => ({ + cursor_columns: d.cursorColumns, + deletion_condition: d.deletionCondition, + hard_deletion_sync_min_interval_in_seconds: + d.hardDeletionSyncMinIntervalInSeconds, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalIngestionPipelineDefinition_WorkdayReportParameters_CreateQueryKeyValueSchema: z.ZodType = + z + .object({ + key: z.string().optional(), + value: z.string().optional(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); export const marshalStartUpdateRequestSchema: z.ZodType = z .object({ @@ -5402,10 +6869,10 @@ export const marshalStartUpdateRequestSchema: z.ZodType = z fullRefreshSelection: z.array(z.string()).optional(), resetCheckpointSelection: z.array(z.string()).optional(), validateOnly: z.boolean().optional(), - rewindSpec: z.lazy(() => marshalRewindSpecSchema).optional(), + rewindSpec: z.lazy(() => marshalCreateRewindSpecSchema).optional(), parameters: z.record(z.string(), z.string()).optional(), replaceWhereOverrides: z - .array(z.lazy(() => marshalReplaceWhereOverrideSchema)) + .array(z.lazy(() => marshalCreateReplaceWhereOverrideSchema)) .optional(), }) .transform(d => ({ @@ -5428,50 +6895,3 @@ export const marshalStopPipelineRequestSchema: z.ZodType = z .transform(d => ({ pipeline_id: d.pipelineId, })); - -export const marshalTikTokAdsOptionsSchema: z.ZodType = z - .object({ - lookbackWindowDays: z.number().optional(), - syncStartDate: z.string().optional(), - dimensions: z.array(z.string()).optional(), - metrics: z.array(z.string()).optional(), - reportType: z.string().optional(), - dataLevel: z.string().optional(), - queryLifetime: z.boolean().optional(), - }) - .transform(d => ({ - lookback_window_days: d.lookbackWindowDays, - sync_start_date: d.syncStartDate, - dimensions: d.dimensions, - metrics: d.metrics, - report_type: d.reportType, - data_level: d.dataLevel, - query_lifetime: d.queryLifetime, - })); - -export const marshalTransformerSchema: z.ZodType = z - .object({ - format: z.string().optional(), - config: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('jsonOptions'), - jsonOptions: z.lazy(() => marshalJsonTransformerOptionsSchema), - }), - ]) - .optional(), - }) - .transform(d => ({ - format: d.format, - ...(d.config?.$case === 'jsonOptions' && { - json_options: d.config.jsonOptions, - }), - })); - -export const marshalZendeskSupportOptionsSchema: z.ZodType = z - .object({ - startDate: z.string().optional(), - }) - .transform(d => ({ - start_date: d.startDate, - })); diff --git a/packages/postgres/src/v1/client.ts b/packages/postgres/src/v1/client.ts index 5f37e4eb..2d632c4b 100755 --- a/packages/postgres/src/v1/client.ts +++ b/packages/postgres/src/v1/client.ts @@ -85,17 +85,23 @@ import type { UpdateRoleRequest, } from './model'; import { - marshalBranchSchema, - marshalCatalogSchema, - marshalDataApiSchema, - marshalDatabaseSchema, - marshalEndpointSchema, + marshalCreateBranchSchema, + marshalCreateCatalogSchema, + marshalCreateDataApiSchema, + marshalCreateDatabaseSchema, + marshalCreateEndpointSchema, + marshalCreateProjectSchema, + marshalCreateRoleSchema, + marshalCreateSyncedTableSchema, marshalGenerateDatabaseCredentialRequestSchema, - marshalProjectSchema, - marshalRoleSchema, - marshalSyncedTableSchema, marshalUndeleteBranchRequestSchema, marshalUndeleteProjectRequestSchema, + marshalUpdateBranchSchema, + marshalUpdateDataApiSchema, + marshalUpdateDatabaseSchema, + marshalUpdateEndpointSchema, + marshalUpdateProjectSchema, + marshalUpdateRoleSchema, unmarshalBranchOperationMetadataSchema, unmarshalBranchSchema, unmarshalCatalogOperationMetadataSchema, @@ -170,7 +176,7 @@ export class PostgresClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.branch, marshalBranchSchema); + const body = marshalRequest(req.branch, marshalCreateBranchSchema); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -223,7 +229,7 @@ export class PostgresClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.catalog, marshalCatalogSchema); + const body = marshalRequest(req.catalog, marshalCreateCatalogSchema); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -270,7 +276,7 @@ export class PostgresClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/postgres/${req.parent ?? ''}/data-api`; - const body = marshalRequest(req.dataApi, marshalDataApiSchema); + const body = marshalRequest(req.dataApi, marshalCreateDataApiSchema); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -324,7 +330,7 @@ export class PostgresClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.database, marshalDatabaseSchema); + const body = marshalRequest(req.database, marshalCreateDatabaseSchema); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -384,7 +390,7 @@ export class PostgresClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.endpoint, marshalEndpointSchema); + const body = marshalRequest(req.endpoint, marshalCreateEndpointSchema); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -437,7 +443,7 @@ export class PostgresClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.project, marshalProjectSchema); + const body = marshalRequest(req.project, marshalCreateProjectSchema); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -493,7 +499,7 @@ export class PostgresClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.role, marshalRoleSchema); + const body = marshalRequest(req.role, marshalCreateRoleSchema); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -546,7 +552,10 @@ export class PostgresClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.syncedTable, marshalSyncedTableSchema); + const body = marshalRequest( + req.syncedTable, + marshalCreateSyncedTableSchema + ); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -1591,7 +1600,7 @@ export class PostgresClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.branch, marshalBranchSchema); + const body = marshalRequest(req.branch, marshalUpdateBranchSchema); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -1644,7 +1653,7 @@ export class PostgresClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.dataApi, marshalDataApiSchema); + const body = marshalRequest(req.dataApi, marshalUpdateDataApiSchema); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -1697,7 +1706,7 @@ export class PostgresClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.database, marshalDatabaseSchema); + const body = marshalRequest(req.database, marshalUpdateDatabaseSchema); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -1750,7 +1759,7 @@ export class PostgresClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.endpoint, marshalEndpointSchema); + const body = marshalRequest(req.endpoint, marshalUpdateEndpointSchema); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -1803,7 +1812,7 @@ export class PostgresClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.project, marshalProjectSchema); + const body = marshalRequest(req.project, marshalUpdateProjectSchema); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -1856,7 +1865,7 @@ export class PostgresClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.role, marshalRoleSchema); + const body = marshalRequest(req.role, marshalUpdateRoleSchema); let resp: Operation | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/postgres/src/v1/index.ts b/packages/postgres/src/v1/index.ts index 3445f575..66bc6f3f 100755 --- a/packages/postgres/src/v1/index.ts +++ b/packages/postgres/src/v1/index.ts @@ -58,22 +58,47 @@ export type { Catalog, Catalog_CatalogSpec, Catalog_CatalogStatus, + Catalog_CreateCatalogSpec, CatalogOperationMetadata, + CreateBranch, CreateBranchRequest, + CreateBranchSpec, + CreateCatalog, CreateCatalogRequest, + CreateDataApi, CreateDataApiRequest, + CreateDatabase, CreateDatabaseRequest, + CreateEndpoint, + CreateEndpointGroupSpec, CreateEndpointRequest, + CreateEndpointSettings, + CreateEndpointSpec, + CreateInitialBranchSpec, + CreateInitialEndpointSpec, + CreateNewPipelineSpec, + CreateProject, + CreateProjectCustomTag, + CreateProjectDefaultEndpointSettings, CreateProjectRequest, + CreateProjectSpec, + CreateRequestedClaims, + CreateRequestedResource, + CreateRole, CreateRoleRequest, + CreateSyncedTable, CreateSyncedTableRequest, DataApi, + DataApi_CreateDataApiSpec, DataApi_DataApiSpec, DataApi_DataApiStatus, + DataApi_UpdateDataApiSpec, DataApiOperationMetadata, Database, + Database_CreateDatabaseSpec, Database_DatabaseSpec, Database_DatabaseStatus, + Database_UpdateDatabaseSpec, DatabaseCredential, DatabaseOperationMetadata, DeleteBranchRequest, @@ -128,11 +153,17 @@ export type { RequestedResource, Role, Role_Attributes, + Role_CreateAttributes, + Role_CreateRoleSpec, Role_RoleSpec, Role_RoleStatus, + Role_UpdateAttributes, + Role_UpdateRoleSpec, RoleOperationMetadata, SyncedTable, + SyncedTable_CreateSyncedTableSpec, SyncedTable_SyncedTableSpec, + SyncedTable_SyncedTableSpec_CreateTypeOverride, SyncedTable_SyncedTableSpec_TypeOverride, SyncedTable_SyncedTableStatus, SyncedTableOperationMetadata, @@ -140,19 +171,34 @@ export type { SyncedTablePosition, UndeleteBranchRequest, UndeleteProjectRequest, + UpdateBranch, UpdateBranchRequest, + UpdateBranchSpec, + UpdateDataApi, UpdateDataApiRequest, + UpdateDatabase, UpdateDatabaseRequest, + UpdateEndpoint, + UpdateEndpointGroupSpec, UpdateEndpointRequest, + UpdateEndpointSettings, + UpdateEndpointSpec, + UpdateInitialBranchSpec, + UpdateInitialEndpointSpec, + UpdateProject, + UpdateProjectCustomTag, + UpdateProjectDefaultEndpointSettings, UpdateProjectRequest, + UpdateProjectSpec, + UpdateRole, UpdateRoleRequest, } from './model'; export { - branchFieldMask, - dataApiFieldMask, - databaseFieldMask, - endpointFieldMask, - projectFieldMask, - roleFieldMask, + updateBranchFieldMask, + updateDataApiFieldMask, + updateDatabaseFieldMask, + updateEndpointFieldMask, + updateProjectFieldMask, + updateRoleFieldMask, } from './model'; diff --git a/packages/postgres/src/v1/model.ts b/packages/postgres/src/v1/model.ts index ed458bfe..3d808397 100755 --- a/packages/postgres/src/v1/model.ts +++ b/packages/postgres/src/v1/model.ts @@ -800,8 +800,6 @@ export interface Branch { createTime?: Temporal.Instant | undefined; /** A timestamp indicating when the branch was last updated. */ updateTime?: Temporal.Instant | undefined; - /** The spec contains the branch configuration. */ - spec?: BranchSpec | undefined; /** The current status of a Branch. */ status?: BranchStatus | undefined; /** The part of the name, chosen by the user when the resource was created. */ @@ -906,8 +904,6 @@ export interface Catalog { name?: string | undefined; /** System-generated unique identifier for the catalog. */ uid?: string | undefined; - /** The desired state of the Catalog. */ - spec?: Catalog_CatalogSpec | undefined; /** The observed state of the Catalog. */ status?: Catalog_CatalogStatus | undefined; /** A timestamp indicating when the catalog was created. */ @@ -973,9 +969,55 @@ export interface Catalog_CatalogStatus { branch?: string | undefined; } +/** The desired state of the Catalog. */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface Catalog_CreateCatalogSpec { + /** + * The name of the Postgres database inside the specified Lakebase project and branch to be associated with the UC catalog. + * This database must already exist, unless create_database_if_missing is set to true on creation. + * + * A database can only be registered with one UC catalog at a time. + * To re-register a database with a different catalog, the existing catalog must be deleted first. + * + * A child branch inherits the fact of parent's registration. This means the same-named database + * in a child branch cannot be registered with a second catalog + * while the parent's registration exists. To allow registering the database of a child branch, + * drop and recreate the database on the child branch. + * This removes the fact of parent's registration from this branch only. + * + * Doing Point In Time Restore (PITR) prior to the moment before the Postgres DB was registered + * in the Catalog drops the fact of registration of the database. So the user should avoid doing so. + */ + postgresDatabase: string; + /** + * If set to true, the specified postgres_database is created on behalf of the calling user + * if it does not already exist. In this case, the calling user has a role created for + * them in Postgres if they do not already have one. + * + * Defaults to false, meaning that the request fails if the specified postgres_database does not already exist. + */ + createDatabaseIfMissing?: boolean | undefined; + /** + * The resource path of the branch associated with the catalog. + * + * Format: projects/{project_id}/branches/{branch_id}. + */ + branch?: string | undefined; +} + // eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface CatalogOperationMetadata {} +export interface CreateBranch { + /** + * Output only. The full resource path of the branch. + * Format: projects/{project_id}/branches/{branch_id} + */ + name?: string | undefined; + /** The spec contains the branch configuration. */ + spec?: CreateBranchSpec | undefined; +} + export interface CreateBranchRequest { /** * The Project where this Branch will be created. @@ -989,18 +1031,88 @@ export interface CreateBranchRequest { */ branchId?: string | undefined; /** The Branch to create. */ - branch?: Branch | undefined; + branch?: CreateBranch | undefined; /** If true, update the branch if it already exists instead of returning an error. */ replaceExisting?: boolean | undefined; } +export interface CreateBranchSpec { + /** + * The name of the source branch from which this branch was created (data lineage for point-in-time recovery). + * If not specified, defaults to the project's default branch. + * Format: projects/{project_id}/branches/{branch_id} + */ + sourceBranch?: string | undefined; + /** The Log Sequence Number (LSN) on the source branch from which this branch was created. */ + sourceBranchLsn?: string | undefined; + /** The point in time on the source branch from which this branch was created. */ + sourceBranchTime?: Temporal.Instant | undefined; + /** When set to true, protects the branch from deletion and reset. Associated compute endpoints and the project cannot be deleted while the branch is protected. */ + isProtected?: boolean | undefined; + /** + * Expiration configuration for the branch. One of expire_time, ttl, or no_expiry must be provided. + * To disable expiration, set no_expiry to true. + * + * When updating this field, use "spec.expiration" in the update_mask. + */ + expiration?: + | { + $case: 'expireTime'; + /** + * Absolute expiration timestamp. When set, the branch will expire at this time. + * Mutually exclusive with `ttl` and `no_expiry`. When updating, use `spec.expiration` in the update_mask. + */ + expireTime: Temporal.Instant; + } + | { + $case: 'ttl'; + /** + * Relative time-to-live duration. When set, the branch will expire at creation_time + ttl. + * Mutually exclusive with `expire_time` and `no_expiry`. When updating, use `spec.expiration` in the update_mask. + */ + ttl: Temporal.Duration; + } + | { + $case: 'noExpiry'; + /** + * Explicitly disable expiration. When set to true, the branch will not expire. + * If set to false, the request is invalid; provide either ttl or expire_time instead. + * Mutually exclusive with `expire_time` and `ttl`. When updating, use `spec.expiration` in the update_mask. + */ + noExpiry: boolean; + } + | undefined; +} + +export interface CreateCatalog { + /** + * Output only. The full resource path of the catalog. + * + * Format: "catalogs/{catalog_id}". + */ + name?: string | undefined; + /** The desired state of the Catalog. */ + spec?: Catalog_CreateCatalogSpec | undefined; +} + export interface CreateCatalogRequest { /** * The ID in the Unity Catalog. * It becomes the full resource name, for example "my_catalog" becomes "catalogs/my_catalog". */ catalogId?: string | undefined; - catalog?: Catalog | undefined; + catalog?: CreateCatalog | undefined; +} + +/** + * DataApi represents the Data API (PostgREST) configuration for a Database. + * At most one DataApi per database. Create enables Data API, Delete disables it. + */ +export interface CreateDataApi { + /** Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api */ + name?: string | undefined; + /** The desired Data API configuration. */ + spec?: DataApi_CreateDataApiSpec | undefined; } /** Enable Data API for a database. */ @@ -1008,7 +1120,18 @@ export interface CreateDataApiRequest { /** Parent database: projects/{project_id}/branches/{branch_id}/databases/{database_id} */ parent?: string | undefined; /** The Data API configuration to create. */ - dataApi?: DataApi | undefined; + dataApi?: CreateDataApi | undefined; +} + +/** Database represents a Postgres database within a Branch. */ +export interface CreateDatabase { + /** + * The resource name of the database. + * Format: projects/{project_id}/branches/{branch_id}/databases/{database_id} + */ + name?: string | undefined; + /** The desired state of the Database. */ + spec?: Database_CreateDatabaseSpec | undefined; } export interface CreateDatabaseRequest { @@ -1029,7 +1152,7 @@ export interface CreateDatabaseRequest { */ databaseId?: string | undefined; /** The desired specification of a Database. */ - database?: Database | undefined; + database?: CreateDatabase | undefined; /** * If true, update the database if it already exists instead of returning an * error. @@ -1037,6 +1160,35 @@ export interface CreateDatabaseRequest { replaceExisting?: boolean | undefined; } +export interface CreateEndpoint { + /** + * Output only. The full resource path of the endpoint. + * Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id} + */ + name?: string | undefined; + /** The spec contains the compute endpoint configuration, including autoscaling limits, suspend timeout, and disabled state. */ + spec?: CreateEndpointSpec | undefined; +} + +export interface CreateEndpointGroupSpec { + /** + * The minimum number of computes in the endpoint group. Currently, this must be equal to max. This must be greater + * than or equal to 1. + */ + min: number; + /** + * The maximum number of computes in the endpoint group. Currently, this must be equal to min. Set to 1 for single + * compute endpoints, to disable HA. To manually suspend all computes in an endpoint group, set disabled to + * true on the EndpointSpec. + */ + max: number; + /** + * Whether to allow read-only connections to read-write endpoints. Only relevant for read-write endpoints where + * size.max > 1. + */ + enableReadableSecondaries?: boolean | undefined; +} + export interface CreateEndpointRequest { /** * The Branch where this Endpoint will be created. @@ -1050,594 +1202,806 @@ export interface CreateEndpointRequest { */ endpointId?: string | undefined; /** The Endpoint to create. */ - endpoint?: Endpoint | undefined; + endpoint?: CreateEndpoint | undefined; /** If true, update the endpoint if it already exists instead of returning an error. */ replaceExisting?: boolean | undefined; } -export interface CreateProjectRequest { - /** - * The ID to use for the Project. This becomes the final component of the project's resource name. - * The ID is required and must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. - * For example, `my-app` becomes `projects/my-app`. - */ - projectId?: string | undefined; - /** The Project to create. */ - project?: Project | undefined; +/** A collection of settings for a compute endpoint. */ +export interface CreateEndpointSettings { + /** A raw representation of Postgres settings. */ + pgSettings?: Record | undefined; } -export interface CreateRoleRequest { +export interface CreateEndpointSpec { + /** The endpoint type. A branch can only have one READ_WRITE endpoint. */ + endpointType: EndpointType; + /** The minimum number of Compute Units. Minimum value is 0.5. */ + autoscalingLimitMinCu?: number | undefined; /** - * The Branch where this Role is created. - * Format: projects/{project_id}/branches/{branch_id} + * The maximum number of Compute Units. The maximum value is 64. + * The difference between the minimum and maximum Compute Units (max - min) must not exceed 16. */ - parent?: string | undefined; + autoscalingLimitMaxCu?: number | undefined; /** - * The ID to use for the Role, which will become the final component of - * the role's resource name. - * This ID becomes the role in Postgres. - * - * This value should be 4-63 characters, and valid characters - * are lowercase letters, numbers, and hyphens, as defined by RFC 1123. - * - * If role_id is not specified in the request, it is generated automatically. + * Whether to restrict connections to the compute endpoint. + * Enabling this option schedules a suspend compute operation. + * A disabled compute endpoint cannot be enabled by a connection or + * console action. */ - roleId?: string | undefined; - /** The desired specification of a Role. */ - role?: Role | undefined; + disabled?: boolean | undefined; /** - * If true, update the role if it already exists instead of returning an - * error. + * Duration of inactivity after which the compute endpoint is automatically suspended. One of suspend_timeout_duration or no_suspension can be provided. + * When not specified default suspension behavior will be used (consult with documentation). * - * When the role already exists, the provided `role` spec fully replaces the - * existing one: `membership_roles` is overwritten, not merged. Leaving - * `membership_roles` empty clears all of the role's existing memberships, - * including `DATABRICKS_SUPERUSER`. Always send the complete desired list of - * memberships when using this field. + * When updating this field, use "spec.suspension" in the update_mask. */ - replaceExisting?: boolean | undefined; -} - -/** Establish a synchronisation to the Postgres database for Reverse ETL for the source table selected from the Unity Catalog. */ -export interface CreateSyncedTableRequest { + suspension?: + | { + $case: 'suspendTimeoutDuration'; + /** + * Duration of inactivity after which the compute endpoint is automatically suspended. + * If specified should be between 60s and 604800s (1 minute to 1 week). + * Mutually exclusive with `no_suspension`. When updating, use `spec.suspension` in the update_mask. + */ + suspendTimeoutDuration: Temporal.Duration; + } + | { + $case: 'noSuspension'; + /** + * When set to true, explicitly disables automatic suspension (never suspend). + * Should be set to true when provided. + * Mutually exclusive with `suspend_timeout_duration`. When updating, use `spec.suspension` in the update_mask. + */ + noSuspension: boolean; + } + | undefined; + settings?: CreateEndpointSettings | undefined; /** - * The ID to use for the Synced Table. This becomes the final component of the SyncedTable's resource name. - * ID is required and is the synced table name, containing (catalog, schema, table) tuple. - * Elements of the tuple are the UC entity names. - * - * Example: "{catalog}.{schema}.{table}" - * - * synced_table_id represents both of the following: - * - * 1. An online VIEW virtual table in the Unity Catalog accessible via the Lakehouse Federation. - * 2. Postgres table named "{table}" in schema "{schema}" in the connected Postgres database + * Settings for optional HA configuration of the endpoint. If unspecified, the endpoint defaults + * to non HA settings, with a single compute backing the endpoint (and no readable secondaries + * for Read/Write endpoints). */ - syncedTableId?: string | undefined; - syncedTable?: SyncedTable | undefined; + group?: CreateEndpointGroupSpec | undefined; } -/** - * DataApi represents the Data API (PostgREST) configuration for a Database. - * At most one DataApi per database. Create enables Data API, Delete disables it. - */ -export interface DataApi { - /** Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api */ - name?: string | undefined; - /** - * The database containing this Data API configuration. - * Format: projects/{project_id}/branches/{branch_id}/databases/{database_id} - */ - parent?: string | undefined; - /** A timestamp indicating when the Data API was first enabled. */ - createTime?: Temporal.Instant | undefined; - /** A timestamp indicating when the Data API configuration was last updated. */ - updateTime?: Temporal.Instant | undefined; - /** The desired Data API configuration. */ - spec?: DataApi_DataApiSpec | undefined; - /** The observed Data API state (read-only). */ - status?: DataApi_DataApiStatus | undefined; +/** Configuration for the initial default branch created during project creation. */ +export interface CreateInitialBranchSpec { + /** Whether the initial default branch should be protected from deletion. */ + isProtected?: boolean | undefined; } -/** Desired PostgREST configuration (input). */ -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export interface DataApi_DataApiSpec { - /** - * Enable aggregate functions (count, sum, avg, etc.) in Data API responses. - * Default: true. - */ - dbAggregatesEnabled?: boolean | undefined; +/** Configuration for the initial Read/Write endpoint created during project creation. */ +export interface CreateInitialEndpointSpec { + /** Settings for HA configuration of the endpoint. */ + group?: CreateEndpointGroupSpec | undefined; + /** The minimum number of Compute Units for the initial endpoint. */ + autoscalingLimitMinCu?: number | undefined; + /** The maximum number of Compute Units for the initial endpoint. */ + autoscalingLimitMaxCu?: number | undefined; + suspension?: + | { + $case: 'suspendTimeoutDuration'; + /** + * Duration of inactivity after which the initial endpoint is automatically suspended. + * If specified, should be between 60s and 604800s (1 minute to 1 week). + * Mutually exclusive with `no_suspension`. + */ + suspendTimeoutDuration: Temporal.Duration; + } + | { + $case: 'noSuspension'; + /** + * When set to true, explicitly disables automatic suspension (never suspend). + * Should be set to true when provided. + * Mutually exclusive with `suspend_timeout_duration`. + */ + noSuspension: boolean; + } + | undefined; +} + +export interface CreateNewPipelineSpec { /** - * Additional schemas to include in the PostgreSQL search path. - * Each entry must be a valid PostgreSQL schema name. + * UC catalog for the pipeline to store intermediate files (checkpoints, event logs etc). + * This needs to be a standard catalog where the user has permissions to create Delta tables. */ - dbExtraSearchPath?: string[] | undefined; + storageCatalog?: string | undefined; /** - * Maximum number of rows returned in a single Data API response. - * Must be a positive integer. + * UC schema for the pipeline to store intermediate files (checkpoints, event logs etc). + * This needs to be in the standard catalog where the user has permissions to create Delta tables. */ - dbMaxRows?: number | undefined; + storageSchema?: string | undefined; + /** Budget policy to set on the newly created pipeline. */ + budgetPolicyId?: string | undefined; +} + +export interface CreateProject { /** - * Database schemas exposed through the Data API. - * Each entry must be a valid PostgreSQL schema name (1-63 chars, [a-zA-Z_][a-zA-Z0-9_$]*). - * Maximum 100 entries. Default: ["public"]. + * Output only. The full resource path of the project. + * Format: projects/{project_id} */ - dbSchemas?: string[] | undefined; + name?: string | undefined; + /** The spec contains the project configuration, including display_name, pg_version (Postgres version), history_retention_duration, and default_endpoint_settings. */ + spec?: CreateProjectSpec | undefined; /** - * JSON path to the role claim in JWT tokens (e.g., ".sub"). - * Default: ".sub". + * Configuration settings for the initial Read/Write endpoint created inside the initial branch for a newly + * created project. If omitted, the initial endpoint created will have default settings, without high availability + * configured. This field does not apply to any endpoints created after project creation. Use + * spec.default_endpoint_settings to configure default settings for endpoints created after project creation. */ - jwtRoleClaimKey?: string | undefined; - /** Maximum lifetime for cached JWT tokens. Zero duration disables caching. */ - jwtCacheMaxLifetime?: Temporal.Duration | undefined; - /** OpenAPI documentation mode for the Data API endpoint. */ - openapiMode?: OpenApiMode | undefined; + initialEndpointSpec?: CreateInitialEndpointSpec | undefined; /** - * Allowed origins for CORS requests. - * Each entry should be a valid origin URL, or use "*" to allow all origins. + * Configuration for the initial default branch created as part of project creation. + * Allows overriding branch protection. These settings only apply at creation time + * and do not affect resources created after project creation. */ - serverCorsAllowedOrigins?: string[] | undefined; - /** Enable the Server-Timing header in Data API responses. */ - serverTimingEnabled?: boolean | undefined; + initialBranchSpec?: CreateInitialBranchSpec | undefined; } -/** Observed state (output-only). */ -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export interface DataApi_DataApiStatus { - /** Actual aggregate function setting read from the database. */ - dbAggregatesEnabled?: boolean | undefined; - /** Actual extra search path schemas read from the database. */ - dbExtraSearchPath?: string[] | undefined; - /** Actual max rows setting read from the database. */ - dbMaxRows?: number | undefined; - /** Actual exposed schemas read from the database. */ - dbSchemas?: string[] | undefined; - /** Actual JWT role claim key read from the database. */ - jwtRoleClaimKey?: string | undefined; - /** Actual JWT cache max lifetime read from the database. */ - jwtCacheMaxLifetime?: Temporal.Duration | undefined; - /** Actual OpenAPI mode read from the database. */ - openapiMode?: OpenApiMode | undefined; - /** Actual CORS allowed origins read from the database. */ - serverCorsAllowedOrigins?: string[] | undefined; - /** Actual Server-Timing header setting read from the database. */ - serverTimingEnabled?: boolean | undefined; - /** Data API endpoint URL. */ - url?: string | undefined; - /** Schemas available in the database (for reference when configuring db_schemas). */ - availableSchemas?: string[] | undefined; +export interface CreateProjectCustomTag { + /** The key of the custom tag. */ + key?: string | undefined; + /** The value of the custom tag. */ + value?: string | undefined; } -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface DataApiOperationMetadata {} +/** A collection of settings for a compute endpoint. */ +export interface CreateProjectDefaultEndpointSettings { + /** The minimum number of Compute Units. Minimum value is 0.5. */ + autoscalingLimitMinCu?: number | undefined; + /** The maximum number of Compute Units. Minimum value is 0.5. */ + autoscalingLimitMaxCu?: number | undefined; + suspension?: + | { + $case: 'suspendTimeoutDuration'; + /** + * Duration of inactivity after which the compute endpoint is automatically suspended. + * If specified should be between 60s and 604800s (1 minute to 1 week). + * Mutually exclusive with `no_suspension`. When updating, use `spec.project_default_settings.suspension` in the update_mask. + */ + suspendTimeoutDuration: Temporal.Duration; + } + | { + $case: 'noSuspension'; + /** + * When set to true, explicitly disables automatic suspension (never suspend). + * Should be set to true when provided. + * Mutually exclusive with `suspend_timeout_duration`. When updating, use `spec.project_default_settings.suspension` in the update_mask. + */ + noSuspension: boolean; + } + | undefined; + /** A raw representation of Postgres settings. */ + pgSettings?: Record | undefined; +} -/** Database represents a Postgres database within a Branch. */ -export interface Database { - /** - * The resource name of the database. - * Format: projects/{project_id}/branches/{branch_id}/databases/{database_id} - */ - name?: string | undefined; +export interface CreateProjectRequest { /** - * The branch containing this database. - * Format: projects/{project_id}/branches/{branch_id} + * The ID to use for the Project. This becomes the final component of the project's resource name. + * The ID is required and must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. + * For example, `my-app` becomes `projects/my-app`. */ - parent?: string | undefined; - /** A timestamp indicating when the database was created. */ - createTime?: Temporal.Instant | undefined; - /** A timestamp indicating when the database was last updated. */ - updateTime?: Temporal.Instant | undefined; - /** The desired state of the Database. */ - spec?: Database_DatabaseSpec | undefined; - /** The observed state of the Database. */ - status?: Database_DatabaseStatus | undefined; - /** The part of the name, chosen by the user when the resource was created. */ - databaseId?: string | undefined; + projectId?: string | undefined; + /** The Project to create. */ + project?: CreateProject | undefined; } -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export interface Database_DatabaseSpec { - /** - * The name of the role that owns the database. - * Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} - * - * To change the owner, pass valid existing Role name when updating the Database - * - * A database always has an owner. - */ - role?: string | undefined; +export interface CreateProjectSpec { + /** Human-readable project name. Length should be between 1 and 256 characters. */ + displayName?: string | undefined; + /** The major Postgres version number. The set of supported versions may vary; consult the API documentation for currently accepted values. */ + pgVersion?: number | undefined; + /** The number of seconds to retain the shared history for point in time recovery for all branches in this project. Value should be between 172800s (2 days) and 3024000s (35 days). */ + historyRetentionDuration?: Temporal.Duration | undefined; + defaultEndpointSettings?: CreateProjectDefaultEndpointSettings | undefined; /** - * The name of the Postgres database. - * - * This expects a valid Postgres identifier as specified in the link below. - * https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS - * Required when creating the Database. - * - * To rename, pass a valid postgres identifier when updating the Database. + * The desired budget policy to associate with the project. + * See status.budget_policy_id for the policy that is actually applied to the project. */ - postgresDatabase?: string | undefined; -} - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export interface Database_DatabaseStatus { + budgetPolicyId?: string | undefined; /** - * The name of the role that owns the database. - * Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} + * Custom tags to associate with the project. Forwarded to LBM for billing and cost tracking. + * To update tags, provide the new tag list and include "spec.custom_tags" in the update_mask. + * To clear all tags, provide an empty list and include "spec.custom_tags" in the update_mask. + * To preserve existing tags, omit this field from the update_mask (or use wildcard "*" which auto-excludes empty tags). */ - role?: string | undefined; - /** The name of the Postgres database. */ - postgresDatabase?: string | undefined; - /** Part of the resource name. */ - databaseId?: string | undefined; -} - -export interface DatabaseCredential { - /** The OAuth token that can be used as a password when connecting to a database. */ - token?: string | undefined; - /** Timestamp in UTC of when this credential expires. */ - expireTime?: Temporal.Instant | undefined; -} - -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface DatabaseOperationMetadata {} - -export interface DeleteBranchRequest { + customTags?: CreateProjectCustomTag[] | undefined; + /** Whether to enable PG native password login on all endpoints in this project. Defaults to false. */ + enablePgNativeLogin?: boolean | undefined; /** - * The full resource path of the branch to delete. + * The full resource path for the default branch of the project * Format: projects/{project_id}/branches/{branch_id} */ - name?: string | undefined; - /** If true, permanently delete the branch; if false, soft delete. */ - purge?: boolean | undefined; + defaultBranch?: string | undefined; } -export interface DeleteCatalogRequest { - /** - * The full resource path of the catalog to delete. - * - * Format: "catalogs/{catalog_id}". - */ - name?: string | undefined; +export interface CreateRequestedClaims { + permissionSet?: RequestedClaims_PermissionSet | undefined; + resources?: CreateRequestedResource[] | undefined; } -/** Disable Data API for a database. */ -export interface DeleteDataApiRequest { - /** Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api */ - name?: string | undefined; +export interface CreateRequestedResource { + resourceName?: + | { + $case: 'tableName'; + /** The full Unity Catalog table name. */ + tableName: string; + } + | undefined; } -export interface DeleteDatabaseRequest { +/** Role represents a Postgres role within a Branch. */ +export interface CreateRole { /** - * The resource name of the postgres database. - * Format: projects/{project_id}/branches/{branch_id}/databases/{database_id} + * Output only. The full resource path of the role. + * Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} */ name?: string | undefined; + /** The spec contains the role configuration, including identity type, authentication method, and role attributes. */ + spec?: Role_CreateRoleSpec | undefined; } -export interface DeleteEndpointRequest { +export interface CreateRoleRequest { /** - * The full resource path of the endpoint to delete. - * Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id} + * The Branch where this Role is created. + * Format: projects/{project_id}/branches/{branch_id} */ - name?: string | undefined; -} - -export interface DeleteProjectRequest { - /** - * The full resource path of the project to delete. - * Format: projects/{project_id} - */ - name?: string | undefined; - /** - * If true, permanently deletes the project (hard delete). - * If false or unset, performs a soft delete. - */ - purge?: boolean | undefined; -} - -export interface DeleteRoleRequest { + parent?: string | undefined; /** - * The full resource path of the role to delete. - * Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} + * The ID to use for the Role, which will become the final component of + * the role's resource name. + * This ID becomes the role in Postgres. + * + * This value should be 4-63 characters, and valid characters + * are lowercase letters, numbers, and hyphens, as defined by RFC 1123. + * + * If role_id is not specified in the request, it is generated automatically. */ - name?: string | undefined; + roleId?: string | undefined; + /** The desired specification of a Role. */ + role?: CreateRole | undefined; /** - * Reassign objects. If this is set, all objects owned by the role are - * reassigned to the role specified in this parameter. + * If true, update the role if it already exists instead of returning an + * error. * - * NOTE: setting this requires spinning up a compute to succeed, since it involves running - * SQL queries. + * When the role already exists, the provided `role` spec fully replaces the + * existing one: `membership_roles` is overwritten, not merged. Leaving + * `membership_roles` empty clears all of the role's existing memberships, + * including `DATABRICKS_SUPERUSER`. Always send the complete desired list of + * memberships when using this field. */ - reassignOwnedTo?: string | undefined; + replaceExisting?: boolean | undefined; } -export interface DeleteSyncedTableRequest { +export interface CreateSyncedTable { /** - * The Full resource name of the synced table, of the format "synced_tables/{catalog}.{schema}.{table}", + * Output only. The Full resource name of the synced table in Postgres * where (catalog, schema, table) are the UC entity names. + * + * Format "synced_tables/{catalog}.{schema}.{table}" + * + * For the corresponding source table in the Unity catalog look for the "source_table_full_name" attribute. */ name?: string | undefined; -} - -export interface DeltaTableSyncInfo { - /** The Delta Lake commit version that was last successfully synced. */ - deltaCommitVersion?: bigint | undefined; /** - * The timestamp when the above Delta version was committed in the source Delta table. - * Note: This is the Delta commit time, not the time the data was written to the synced table. + * Configuration details of the synced table, such as the source table, scheduling policy, etc. + * This attribute is specified at creation time and most fields are returned as is on subsequent queries. */ - deltaCommitTime?: Temporal.Instant | undefined; + spec?: SyncedTable_CreateSyncedTableSpec | undefined; } -export interface Endpoint { +/** Establish a synchronisation to the Postgres database for Reverse ETL for the source table selected from the Unity Catalog. */ +export interface CreateSyncedTableRequest { /** - * Output only. The full resource path of the endpoint. - * Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id} + * The ID to use for the Synced Table. This becomes the final component of the SyncedTable's resource name. + * ID is required and is the synced table name, containing (catalog, schema, table) tuple. + * Elements of the tuple are the UC entity names. + * + * Example: "{catalog}.{schema}.{table}" + * + * synced_table_id represents both of the following: + * + * 1. An online VIEW virtual table in the Unity Catalog accessible via the Lakehouse Federation. + * 2. Postgres table named "{table}" in schema "{schema}" in the connected Postgres database */ + syncedTableId?: string | undefined; + syncedTable?: CreateSyncedTable | undefined; +} + +/** + * DataApi represents the Data API (PostgREST) configuration for a Database. + * At most one DataApi per database. Create enables Data API, Delete disables it. + */ +export interface DataApi { + /** Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api */ name?: string | undefined; - /** System-generated unique ID for the endpoint. */ - uid?: string | undefined; /** - * The branch containing this endpoint (API resource hierarchy). - * Format: projects/{project_id}/branches/{branch_id} + * The database containing this Data API configuration. + * Format: projects/{project_id}/branches/{branch_id}/databases/{database_id} */ parent?: string | undefined; - /** A timestamp indicating when the compute endpoint was created. */ + /** A timestamp indicating when the Data API was first enabled. */ createTime?: Temporal.Instant | undefined; - /** A timestamp indicating when the compute endpoint was last updated. */ + /** A timestamp indicating when the Data API configuration was last updated. */ updateTime?: Temporal.Instant | undefined; - /** The spec contains the compute endpoint configuration, including autoscaling limits, suspend timeout, and disabled state. */ - spec?: EndpointSpec | undefined; - /** Current operational status of the compute endpoint. */ - status?: EndpointStatus | undefined; - /** The part of the name, chosen by the user when the resource was created. */ - endpointId?: string | undefined; + /** The observed Data API state (read-only). */ + status?: DataApi_DataApiStatus | undefined; } -export interface EndpointGroupSpec { +/** Desired PostgREST configuration (input). */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface DataApi_CreateDataApiSpec { /** - * The minimum number of computes in the endpoint group. Currently, this must be equal to max. This must be greater - * than or equal to 1. + * Enable aggregate functions (count, sum, avg, etc.) in Data API responses. + * Default: true. */ - min?: number | undefined; + dbAggregatesEnabled?: boolean | undefined; /** - * The maximum number of computes in the endpoint group. Currently, this must be equal to min. Set to 1 for single - * compute endpoints, to disable HA. To manually suspend all computes in an endpoint group, set disabled to - * true on the EndpointSpec. + * Additional schemas to include in the PostgreSQL search path. + * Each entry must be a valid PostgreSQL schema name. */ - max?: number | undefined; + dbExtraSearchPath?: string[] | undefined; /** - * Whether to allow read-only connections to read-write endpoints. Only relevant for read-write endpoints where - * size.max > 1. + * Maximum number of rows returned in a single Data API response. + * Must be a positive integer. */ - enableReadableSecondaries?: boolean | undefined; -} - -export interface EndpointGroupStatus { + dbMaxRows?: number | undefined; /** - * The minimum number of computes in the endpoint group. Currently, this must be equal to max. This must be greater - * than or equal to 1. + * Database schemas exposed through the Data API. + * Each entry must be a valid PostgreSQL schema name (1-63 chars, [a-zA-Z_][a-zA-Z0-9_$]*). + * Maximum 100 entries. Default: ["public"]. */ - min?: number | undefined; + dbSchemas?: string[] | undefined; /** - * The maximum number of computes in the endpoint group. Currently, this must be equal to min. Set to 1 for single - * compute endpoints, to disable HA. To manually suspend all computes in an endpoint group, set disabled to - * true on the EndpointSpec. + * JSON path to the role claim in JWT tokens (e.g., ".sub"). + * Default: ".sub". */ - max?: number | undefined; + jwtRoleClaimKey?: string | undefined; + /** Maximum lifetime for cached JWT tokens. Zero duration disables caching. */ + jwtCacheMaxLifetime?: Temporal.Duration | undefined; + /** OpenAPI documentation mode for the Data API endpoint. */ + openapiMode?: OpenApiMode | undefined; /** - * Whether read-only connections to read-write endpoints are allowed. Only relevant if read replicas are configured - * by specifying size.max > 1. + * Allowed origins for CORS requests. + * Each entry should be a valid origin URL, or use "*" to allow all origins. */ - enableReadableSecondaries?: boolean | undefined; + serverCorsAllowedOrigins?: string[] | undefined; + /** Enable the Server-Timing header in Data API responses. */ + serverTimingEnabled?: boolean | undefined; } -/** Encapsulates various hostnames (r/w or r/o, pooled or not) for an endpoint. */ -export interface EndpointHosts { +/** Desired PostgREST configuration (input). */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface DataApi_DataApiSpec { /** - * The hostname to connect to this endpoint. For read-write endpoints, this is a read-write hostname which connects - * to the primary compute. For read-only endpoints, this is a read-only hostname which allows read-only operations. + * Enable aggregate functions (count, sum, avg, etc.) in Data API responses. + * Default: true. */ - host?: string | undefined; + dbAggregatesEnabled?: boolean | undefined; /** - * An optionally defined read-only host for the endpoint, without pooling. For read-only endpoints, - * this attribute is always defined and is equivalent to host. For read-write endpoints, this attribute is defined - * if the enclosing endpoint is a group with greater than 1 computes configured, and has readable secondaries enabled. + * Additional schemas to include in the PostgreSQL search path. + * Each entry must be a valid PostgreSQL schema name. */ - readOnlyHost?: string | undefined; -} - -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface EndpointOperationMetadata {} - -/** A collection of settings for a compute endpoint. */ -export interface EndpointSettings { - /** A raw representation of Postgres settings. */ - pgSettings?: Record | undefined; -} - -export interface EndpointSpec { - /** The endpoint type. A branch can only have one READ_WRITE endpoint. */ - endpointType?: EndpointType | undefined; - /** The minimum number of Compute Units. Minimum value is 0.5. */ - autoscalingLimitMinCu?: number | undefined; + dbExtraSearchPath?: string[] | undefined; /** - * The maximum number of Compute Units. The maximum value is 64. - * The difference between the minimum and maximum Compute Units (max - min) must not exceed 16. + * Maximum number of rows returned in a single Data API response. + * Must be a positive integer. */ - autoscalingLimitMaxCu?: number | undefined; + dbMaxRows?: number | undefined; /** - * Whether to restrict connections to the compute endpoint. - * Enabling this option schedules a suspend compute operation. - * A disabled compute endpoint cannot be enabled by a connection or - * console action. + * Database schemas exposed through the Data API. + * Each entry must be a valid PostgreSQL schema name (1-63 chars, [a-zA-Z_][a-zA-Z0-9_$]*). + * Maximum 100 entries. Default: ["public"]. */ - disabled?: boolean | undefined; + dbSchemas?: string[] | undefined; /** - * Duration of inactivity after which the compute endpoint is automatically suspended. One of suspend_timeout_duration or no_suspension can be provided. - * When not specified default suspension behavior will be used (consult with documentation). - * - * When updating this field, use "spec.suspension" in the update_mask. + * JSON path to the role claim in JWT tokens (e.g., ".sub"). + * Default: ".sub". */ - suspension?: - | { - $case: 'suspendTimeoutDuration'; - /** - * Duration of inactivity after which the compute endpoint is automatically suspended. - * If specified should be between 60s and 604800s (1 minute to 1 week). - * Mutually exclusive with `no_suspension`. When updating, use `spec.suspension` in the update_mask. - */ - suspendTimeoutDuration: Temporal.Duration; - } - | { - $case: 'noSuspension'; - /** - * When set to true, explicitly disables automatic suspension (never suspend). - * Should be set to true when provided. - * Mutually exclusive with `suspend_timeout_duration`. When updating, use `spec.suspension` in the update_mask. - */ - noSuspension: boolean; - } - | undefined; - settings?: EndpointSettings | undefined; + jwtRoleClaimKey?: string | undefined; + /** Maximum lifetime for cached JWT tokens. Zero duration disables caching. */ + jwtCacheMaxLifetime?: Temporal.Duration | undefined; + /** OpenAPI documentation mode for the Data API endpoint. */ + openapiMode?: OpenApiMode | undefined; /** - * Settings for optional HA configuration of the endpoint. If unspecified, the endpoint defaults - * to non HA settings, with a single compute backing the endpoint (and no readable secondaries - * for Read/Write endpoints). + * Allowed origins for CORS requests. + * Each entry should be a valid origin URL, or use "*" to allow all origins. */ - group?: EndpointGroupSpec | undefined; + serverCorsAllowedOrigins?: string[] | undefined; + /** Enable the Server-Timing header in Data API responses. */ + serverTimingEnabled?: boolean | undefined; } -export interface EndpointStatus { - /** The endpoint type. A branch can only have one READ_WRITE endpoint. */ - endpointType?: EndpointType | undefined; - /** Contains host information for connecting to the endpoint. */ - hosts?: EndpointHosts | undefined; - /** The minimum number of Compute Units. */ - autoscalingLimitMinCu?: number | undefined; - /** - * The maximum number of Compute Units. The maximum value is 64. - * The difference between the minimum and maximum Compute Units (max - min) must not exceed 16. - */ - autoscalingLimitMaxCu?: number | undefined; - currentState?: EndpointStatus_State | undefined; - pendingState?: EndpointStatus_State | undefined; - /** - * Whether to restrict connections to the compute endpoint. - * Enabling this option schedules a suspend compute operation. - * A disabled compute endpoint cannot be enabled by a connection or - * console action. +/** Observed state (output-only). */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface DataApi_DataApiStatus { + /** Actual aggregate function setting read from the database. */ + dbAggregatesEnabled?: boolean | undefined; + /** Actual extra search path schemas read from the database. */ + dbExtraSearchPath?: string[] | undefined; + /** Actual max rows setting read from the database. */ + dbMaxRows?: number | undefined; + /** Actual exposed schemas read from the database. */ + dbSchemas?: string[] | undefined; + /** Actual JWT role claim key read from the database. */ + jwtRoleClaimKey?: string | undefined; + /** Actual JWT cache max lifetime read from the database. */ + jwtCacheMaxLifetime?: Temporal.Duration | undefined; + /** Actual OpenAPI mode read from the database. */ + openapiMode?: OpenApiMode | undefined; + /** Actual CORS allowed origins read from the database. */ + serverCorsAllowedOrigins?: string[] | undefined; + /** Actual Server-Timing header setting read from the database. */ + serverTimingEnabled?: boolean | undefined; + /** Data API endpoint URL. */ + url?: string | undefined; + /** Schemas available in the database (for reference when configuring db_schemas). */ + availableSchemas?: string[] | undefined; +} + +/** Desired PostgREST configuration (input). */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface DataApi_UpdateDataApiSpec { + /** + * Enable aggregate functions (count, sum, avg, etc.) in Data API responses. + * Default: true. */ - disabled?: boolean | undefined; - /** Duration of inactivity after which the compute endpoint is automatically suspended. */ - suspendTimeoutDuration?: Temporal.Duration | undefined; - settings?: EndpointSettings | undefined; - /** Details on the HA configuration of the endpoint. */ - group?: EndpointGroupStatus | undefined; + dbAggregatesEnabled?: boolean | undefined; + /** + * Additional schemas to include in the PostgreSQL search path. + * Each entry must be a valid PostgreSQL schema name. + */ + dbExtraSearchPath?: string[] | undefined; + /** + * Maximum number of rows returned in a single Data API response. + * Must be a positive integer. + */ + dbMaxRows?: number | undefined; + /** + * Database schemas exposed through the Data API. + * Each entry must be a valid PostgreSQL schema name (1-63 chars, [a-zA-Z_][a-zA-Z0-9_$]*). + * Maximum 100 entries. Default: ["public"]. + */ + dbSchemas?: string[] | undefined; + /** + * JSON path to the role claim in JWT tokens (e.g., ".sub"). + * Default: ".sub". + */ + jwtRoleClaimKey?: string | undefined; + /** Maximum lifetime for cached JWT tokens. Zero duration disables caching. */ + jwtCacheMaxLifetime?: Temporal.Duration | undefined; + /** OpenAPI documentation mode for the Data API endpoint. */ + openapiMode?: OpenApiMode | undefined; + /** + * Allowed origins for CORS requests. + * Each entry should be a valid origin URL, or use "*" to allow all origins. + */ + serverCorsAllowedOrigins?: string[] | undefined; + /** Enable the Server-Timing header in Data API responses. */ + serverTimingEnabled?: boolean | undefined; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface DataApiOperationMetadata {} + +/** Database represents a Postgres database within a Branch. */ +export interface Database { + /** + * The resource name of the database. + * Format: projects/{project_id}/branches/{branch_id}/databases/{database_id} + */ + name?: string | undefined; + /** + * The branch containing this database. + * Format: projects/{project_id}/branches/{branch_id} + */ + parent?: string | undefined; + /** A timestamp indicating when the database was created. */ + createTime?: Temporal.Instant | undefined; + /** A timestamp indicating when the database was last updated. */ + updateTime?: Temporal.Instant | undefined; + /** The observed state of the Database. */ + status?: Database_DatabaseStatus | undefined; + /** The part of the name, chosen by the user when the resource was created. */ + databaseId?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface Database_CreateDatabaseSpec { + /** + * The name of the role that owns the database. + * Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} + * + * To change the owner, pass valid existing Role name when updating the Database + * + * A database always has an owner. + */ + role?: string | undefined; + /** + * The name of the Postgres database. + * + * This expects a valid Postgres identifier as specified in the link below. + * https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS + * Required when creating the Database. + * + * To rename, pass a valid postgres identifier when updating the Database. + */ + postgresDatabase?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface Database_DatabaseSpec { + /** + * The name of the role that owns the database. + * Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} + * + * To change the owner, pass valid existing Role name when updating the Database + * + * A database always has an owner. + */ + role?: string | undefined; + /** + * The name of the Postgres database. + * + * This expects a valid Postgres identifier as specified in the link below. + * https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS + * Required when creating the Database. + * + * To rename, pass a valid postgres identifier when updating the Database. + */ + postgresDatabase?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface Database_DatabaseStatus { + /** + * The name of the role that owns the database. + * Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} + */ + role?: string | undefined; + /** The name of the Postgres database. */ + postgresDatabase?: string | undefined; /** Part of the resource name. */ - endpointId?: string | undefined; + databaseId?: string | undefined; } -export interface GenerateDatabaseCredentialRequest { - /** The returned token will be scoped to UC tables with the specified permissions. */ - claims?: RequestedClaims[] | undefined; +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface Database_UpdateDatabaseSpec { /** - * The endpoint resource name for which this credential will be generated. - * Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id} + * The name of the role that owns the database. + * Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} + * + * To change the owner, pass valid existing Role name when updating the Database + * + * A database always has an owner. */ - endpoint?: string | undefined; + role?: string | undefined; + /** + * The name of the Postgres database. + * + * This expects a valid Postgres identifier as specified in the link below. + * https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS + * Required when creating the Database. + * + * To rename, pass a valid postgres identifier when updating the Database. + */ + postgresDatabase?: string | undefined; } -export interface GetBranchRequest { +export interface DatabaseCredential { + /** The OAuth token that can be used as a password when connecting to a database. */ + token?: string | undefined; + /** Timestamp in UTC of when this credential expires. */ + expireTime?: Temporal.Instant | undefined; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface DatabaseOperationMetadata {} + +export interface DeleteBranchRequest { /** - * The full resource path of the branch to retrieve. + * The full resource path of the branch to delete. * Format: projects/{project_id}/branches/{branch_id} */ name?: string | undefined; + /** If true, permanently delete the branch; if false, soft delete. */ + purge?: boolean | undefined; } -export interface GetCatalogRequest { +export interface DeleteCatalogRequest { /** - * The full resource path of the catalog to retrieve. + * The full resource path of the catalog to delete. * * Format: "catalogs/{catalog_id}". */ name?: string | undefined; } -/** Get Data API configuration for a database. */ -export interface GetDataApiRequest { +/** Disable Data API for a database. */ +export interface DeleteDataApiRequest { /** Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api */ name?: string | undefined; } -export interface GetDatabaseRequest { +export interface DeleteDatabaseRequest { /** - * The name of the Database to retrieve. + * The resource name of the postgres database. * Format: projects/{project_id}/branches/{branch_id}/databases/{database_id} */ name?: string | undefined; } -export interface GetEndpointRequest { +export interface DeleteEndpointRequest { /** - * The full resource path of the endpoint to retrieve. + * The full resource path of the endpoint to delete. * Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id} */ name?: string | undefined; } -/** The request message for `GetOperation` method. */ -export interface GetOperationRequest { - /** The name of the operation resource. */ - name?: string | undefined; -} - -export interface GetProjectRequest { +export interface DeleteProjectRequest { /** - * The full resource path of the project to retrieve. + * The full resource path of the project to delete. * Format: projects/{project_id} */ name?: string | undefined; + /** + * If true, permanently deletes the project (hard delete). + * If false or unset, performs a soft delete. + */ + purge?: boolean | undefined; } -export interface GetRoleRequest { +export interface DeleteRoleRequest { /** - * The full resource path of the role to retrieve. + * The full resource path of the role to delete. * Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} */ name?: string | undefined; + /** + * Reassign objects. If this is set, all objects owned by the role are + * reassigned to the role specified in this parameter. + * + * NOTE: setting this requires spinning up a compute to succeed, since it involves running + * SQL queries. + */ + reassignOwnedTo?: string | undefined; } -export interface GetSyncedTableRequest { +export interface DeleteSyncedTableRequest { /** - * The Full resource name of the synced table. - * Format: "synced_tables/{catalog}.{schema}.{table}", - * where (catalog, schema, table) are the entity names in the Unity Catalog. + * The Full resource name of the synced table, of the format "synced_tables/{catalog}.{schema}.{table}", + * where (catalog, schema, table) are the UC entity names. */ name?: string | undefined; } -/** Configuration for the initial default branch created during project creation. */ -export interface InitialBranchSpec { - /** Whether the initial default branch should be protected from deletion. */ - isProtected?: boolean | undefined; -} - -/** Configuration for the initial Read/Write endpoint created during project creation. */ -export interface InitialEndpointSpec { - /** Settings for HA configuration of the endpoint. */ - group?: EndpointGroupSpec | undefined; - /** The minimum number of Compute Units for the initial endpoint. */ +export interface DeltaTableSyncInfo { + /** The Delta Lake commit version that was last successfully synced. */ + deltaCommitVersion?: bigint | undefined; + /** + * The timestamp when the above Delta version was committed in the source Delta table. + * Note: This is the Delta commit time, not the time the data was written to the synced table. + */ + deltaCommitTime?: Temporal.Instant | undefined; +} + +export interface Endpoint { + /** + * Output only. The full resource path of the endpoint. + * Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id} + */ + name?: string | undefined; + /** System-generated unique ID for the endpoint. */ + uid?: string | undefined; + /** + * The branch containing this endpoint (API resource hierarchy). + * Format: projects/{project_id}/branches/{branch_id} + */ + parent?: string | undefined; + /** A timestamp indicating when the compute endpoint was created. */ + createTime?: Temporal.Instant | undefined; + /** A timestamp indicating when the compute endpoint was last updated. */ + updateTime?: Temporal.Instant | undefined; + /** Current operational status of the compute endpoint. */ + status?: EndpointStatus | undefined; + /** The part of the name, chosen by the user when the resource was created. */ + endpointId?: string | undefined; +} + +export interface EndpointGroupSpec { + /** + * The minimum number of computes in the endpoint group. Currently, this must be equal to max. This must be greater + * than or equal to 1. + */ + min?: number | undefined; + /** + * The maximum number of computes in the endpoint group. Currently, this must be equal to min. Set to 1 for single + * compute endpoints, to disable HA. To manually suspend all computes in an endpoint group, set disabled to + * true on the EndpointSpec. + */ + max?: number | undefined; + /** + * Whether to allow read-only connections to read-write endpoints. Only relevant for read-write endpoints where + * size.max > 1. + */ + enableReadableSecondaries?: boolean | undefined; +} + +export interface EndpointGroupStatus { + /** + * The minimum number of computes in the endpoint group. Currently, this must be equal to max. This must be greater + * than or equal to 1. + */ + min?: number | undefined; + /** + * The maximum number of computes in the endpoint group. Currently, this must be equal to min. Set to 1 for single + * compute endpoints, to disable HA. To manually suspend all computes in an endpoint group, set disabled to + * true on the EndpointSpec. + */ + max?: number | undefined; + /** + * Whether read-only connections to read-write endpoints are allowed. Only relevant if read replicas are configured + * by specifying size.max > 1. + */ + enableReadableSecondaries?: boolean | undefined; +} + +/** Encapsulates various hostnames (r/w or r/o, pooled or not) for an endpoint. */ +export interface EndpointHosts { + /** + * The hostname to connect to this endpoint. For read-write endpoints, this is a read-write hostname which connects + * to the primary compute. For read-only endpoints, this is a read-only hostname which allows read-only operations. + */ + host?: string | undefined; + /** + * An optionally defined read-only host for the endpoint, without pooling. For read-only endpoints, + * this attribute is always defined and is equivalent to host. For read-write endpoints, this attribute is defined + * if the enclosing endpoint is a group with greater than 1 computes configured, and has readable secondaries enabled. + */ + readOnlyHost?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface EndpointOperationMetadata {} + +/** A collection of settings for a compute endpoint. */ +export interface EndpointSettings { + /** A raw representation of Postgres settings. */ + pgSettings?: Record | undefined; +} + +export interface EndpointSpec { + /** The endpoint type. A branch can only have one READ_WRITE endpoint. */ + endpointType?: EndpointType | undefined; + /** The minimum number of Compute Units. Minimum value is 0.5. */ autoscalingLimitMinCu?: number | undefined; - /** The maximum number of Compute Units for the initial endpoint. */ + /** + * The maximum number of Compute Units. The maximum value is 64. + * The difference between the minimum and maximum Compute Units (max - min) must not exceed 16. + */ autoscalingLimitMaxCu?: number | undefined; + /** + * Whether to restrict connections to the compute endpoint. + * Enabling this option schedules a suspend compute operation. + * A disabled compute endpoint cannot be enabled by a connection or + * console action. + */ + disabled?: boolean | undefined; + /** + * Duration of inactivity after which the compute endpoint is automatically suspended. One of suspend_timeout_duration or no_suspension can be provided. + * When not specified default suspension behavior will be used (consult with documentation). + * + * When updating this field, use "spec.suspension" in the update_mask. + */ suspension?: | { $case: 'suspendTimeoutDuration'; /** - * Duration of inactivity after which the initial endpoint is automatically suspended. - * If specified, should be between 60s and 604800s (1 minute to 1 week). - * Mutually exclusive with `no_suspension`. + * Duration of inactivity after which the compute endpoint is automatically suspended. + * If specified should be between 60s and 604800s (1 minute to 1 week). + * Mutually exclusive with `no_suspension`. When updating, use `spec.suspension` in the update_mask. */ suspendTimeoutDuration: Temporal.Duration; } @@ -1646,95 +2010,276 @@ export interface InitialEndpointSpec { /** * When set to true, explicitly disables automatic suspension (never suspend). * Should be set to true when provided. - * Mutually exclusive with `suspend_timeout_duration`. + * Mutually exclusive with `suspend_timeout_duration`. When updating, use `spec.suspension` in the update_mask. */ noSuspension: boolean; } | undefined; + settings?: EndpointSettings | undefined; + /** + * Settings for optional HA configuration of the endpoint. If unspecified, the endpoint defaults + * to non HA settings, with a single compute backing the endpoint (and no readable secondaries + * for Read/Write endpoints). + */ + group?: EndpointGroupSpec | undefined; } -export interface ListBranchesRequest { +export interface EndpointStatus { + /** The endpoint type. A branch can only have one READ_WRITE endpoint. */ + endpointType?: EndpointType | undefined; + /** Contains host information for connecting to the endpoint. */ + hosts?: EndpointHosts | undefined; + /** The minimum number of Compute Units. */ + autoscalingLimitMinCu?: number | undefined; /** - * The Project that owns this collection of branches. - * Format: projects/{project_id} + * The maximum number of Compute Units. The maximum value is 64. + * The difference between the minimum and maximum Compute Units (max - min) must not exceed 16. */ - parent?: string | undefined; - /** Page token from a previous response. If not provided, returns the first page. */ - pageToken?: string | undefined; - /** Upper bound for items returned. Cannot be negative. */ - pageSize?: number | undefined; + autoscalingLimitMaxCu?: number | undefined; + currentState?: EndpointStatus_State | undefined; + pendingState?: EndpointStatus_State | undefined; /** - * Whether to include soft-deleted branches in the response. - * When true, deleted branches are included alongside active branches. - * Purged branches are never returned. + * Whether to restrict connections to the compute endpoint. + * Enabling this option schedules a suspend compute operation. + * A disabled compute endpoint cannot be enabled by a connection or + * console action. */ - showDeleted?: boolean | undefined; + disabled?: boolean | undefined; + /** Duration of inactivity after which the compute endpoint is automatically suspended. */ + suspendTimeoutDuration?: Temporal.Duration | undefined; + settings?: EndpointSettings | undefined; + /** Details on the HA configuration of the endpoint. */ + group?: EndpointGroupStatus | undefined; + /** Part of the resource name. */ + endpointId?: string | undefined; } -export interface ListBranchesResponse { - /** List of branches in the project. */ - branches?: Branch[] | undefined; - /** Token to request the next page of branches. */ - nextPageToken?: string | undefined; +export interface GenerateDatabaseCredentialRequest { + /** The returned token will be scoped to UC tables with the specified permissions. */ + claims?: CreateRequestedClaims[] | undefined; + /** + * The endpoint resource name for which this credential will be generated. + * Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id} + */ + endpoint?: string | undefined; + /** + * workspace group name. When provided, credentials are generated + * with permissions scoped to this group. + */ + groupName?: string | undefined; + /** + * Expiration information for the credential. + * Users can specify either expire_time or ttl. + * If unspecified, maximum allowed duration (1 hour) is used. + */ + expiration?: + | { + $case: 'ttl'; + /** + * The requested time-to-live for the generated credential token. + * Must be at least 300 seconds (5 minutes) and at most 3600 seconds (1 hour). + */ + ttl: Temporal.Duration; + } + | { + $case: 'expireTime'; + /** + * Timestamp in UTC of when this credential should expire. + * Must be at least 300 seconds (5 minutes) and at most 1 hour from the current time. + */ + expireTime: Temporal.Instant; + } + | undefined; } -/** List Databases. */ -export interface ListDatabasesRequest { +export interface GetBranchRequest { /** - * The Branch that owns this collection of databases. + * The full resource path of the branch to retrieve. * Format: projects/{project_id}/branches/{branch_id} */ - parent?: string | undefined; - /** Pagination token to go to the next page of Databases. Requests first page if absent. */ - pageToken?: string | undefined; - /** Upper bound for items returned. */ - pageSize?: number | undefined; -} - -export interface ListDatabasesResponse { - /** List of databases. */ - databases?: Database[] | undefined; - /** Pagination token to request the next page of databases. */ - nextPageToken?: string | undefined; + name?: string | undefined; } -export interface ListEndpointsRequest { +export interface GetCatalogRequest { /** - * The Branch that owns this collection of endpoints. - * Format: projects/{project_id}/branches/{branch_id} + * The full resource path of the catalog to retrieve. + * + * Format: "catalogs/{catalog_id}". */ - parent?: string | undefined; - /** Page token from a previous response. If not provided, returns the first page. */ - pageToken?: string | undefined; - /** Upper bound for items returned. Cannot be negative. */ - pageSize?: number | undefined; + name?: string | undefined; } -export interface ListEndpointsResponse { - /** List of compute endpoints in the branch. */ - endpoints?: Endpoint[] | undefined; - /** Token to request the next page of compute endpoints. */ - nextPageToken?: string | undefined; +/** Get Data API configuration for a database. */ +export interface GetDataApiRequest { + /** Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api */ + name?: string | undefined; } -export interface ListProjectsRequest { - /** Page token from a previous response. If not provided, returns the first page. */ - pageToken?: string | undefined; - /** Upper bound for items returned. Cannot be negative. The maximum value is 100. */ - pageSize?: number | undefined; +export interface GetDatabaseRequest { /** - * Whether to include soft-deleted projects in the response. - * When true, soft-deleted projects are included alongside active projects. - * Hard-deleted and already-purged projects are never returned. + * The name of the Database to retrieve. + * Format: projects/{project_id}/branches/{branch_id}/databases/{database_id} */ - showDeleted?: boolean | undefined; + name?: string | undefined; } -export interface ListProjectsResponse { - /** List of all projects in the workspace that the user has permission to access. */ - projects?: Project[] | undefined; - /** Token to request the next page of projects. */ - nextPageToken?: string | undefined; +export interface GetEndpointRequest { + /** + * The full resource path of the endpoint to retrieve. + * Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id} + */ + name?: string | undefined; +} + +/** The request message for `GetOperation` method. */ +export interface GetOperationRequest { + /** The name of the operation resource. */ + name?: string | undefined; +} + +export interface GetProjectRequest { + /** + * The full resource path of the project to retrieve. + * Format: projects/{project_id} + */ + name?: string | undefined; +} + +export interface GetRoleRequest { + /** + * The full resource path of the role to retrieve. + * Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} + */ + name?: string | undefined; +} + +export interface GetSyncedTableRequest { + /** + * The Full resource name of the synced table. + * Format: "synced_tables/{catalog}.{schema}.{table}", + * where (catalog, schema, table) are the entity names in the Unity Catalog. + */ + name?: string | undefined; +} + +/** Configuration for the initial default branch created during project creation. */ +export interface InitialBranchSpec { + /** Whether the initial default branch should be protected from deletion. */ + isProtected?: boolean | undefined; +} + +/** Configuration for the initial Read/Write endpoint created during project creation. */ +export interface InitialEndpointSpec { + /** Settings for HA configuration of the endpoint. */ + group?: EndpointGroupSpec | undefined; + /** The minimum number of Compute Units for the initial endpoint. */ + autoscalingLimitMinCu?: number | undefined; + /** The maximum number of Compute Units for the initial endpoint. */ + autoscalingLimitMaxCu?: number | undefined; + suspension?: + | { + $case: 'suspendTimeoutDuration'; + /** + * Duration of inactivity after which the initial endpoint is automatically suspended. + * If specified, should be between 60s and 604800s (1 minute to 1 week). + * Mutually exclusive with `no_suspension`. + */ + suspendTimeoutDuration: Temporal.Duration; + } + | { + $case: 'noSuspension'; + /** + * When set to true, explicitly disables automatic suspension (never suspend). + * Should be set to true when provided. + * Mutually exclusive with `suspend_timeout_duration`. + */ + noSuspension: boolean; + } + | undefined; +} + +export interface ListBranchesRequest { + /** + * The Project that owns this collection of branches. + * Format: projects/{project_id} + */ + parent?: string | undefined; + /** Page token from a previous response. If not provided, returns the first page. */ + pageToken?: string | undefined; + /** Upper bound for items returned. Cannot be negative. */ + pageSize?: number | undefined; + /** + * Whether to include soft-deleted branches in the response. + * When true, deleted branches are included alongside active branches. + * Purged branches are never returned. + */ + showDeleted?: boolean | undefined; +} + +export interface ListBranchesResponse { + /** List of branches in the project. */ + branches?: Branch[] | undefined; + /** Token to request the next page of branches. */ + nextPageToken?: string | undefined; +} + +/** List Databases. */ +export interface ListDatabasesRequest { + /** + * The Branch that owns this collection of databases. + * Format: projects/{project_id}/branches/{branch_id} + */ + parent?: string | undefined; + /** Pagination token to go to the next page of Databases. Requests first page if absent. */ + pageToken?: string | undefined; + /** Upper bound for items returned. */ + pageSize?: number | undefined; +} + +export interface ListDatabasesResponse { + /** List of databases. */ + databases?: Database[] | undefined; + /** Pagination token to request the next page of databases. */ + nextPageToken?: string | undefined; +} + +export interface ListEndpointsRequest { + /** + * The Branch that owns this collection of endpoints. + * Format: projects/{project_id}/branches/{branch_id} + */ + parent?: string | undefined; + /** Page token from a previous response. If not provided, returns the first page. */ + pageToken?: string | undefined; + /** Upper bound for items returned. Cannot be negative. */ + pageSize?: number | undefined; +} + +export interface ListEndpointsResponse { + /** List of compute endpoints in the branch. */ + endpoints?: Endpoint[] | undefined; + /** Token to request the next page of compute endpoints. */ + nextPageToken?: string | undefined; +} + +export interface ListProjectsRequest { + /** Page token from a previous response. If not provided, returns the first page. */ + pageToken?: string | undefined; + /** Upper bound for items returned. Cannot be negative. The maximum value is 100. */ + pageSize?: number | undefined; + /** + * Whether to include soft-deleted projects in the response. + * When true, soft-deleted projects are included alongside active projects. + * Hard-deleted and already-purged projects are never returned. + */ + showDeleted?: boolean | undefined; +} + +export interface ListProjectsResponse { + /** List of all projects in the workspace that the user has permission to access. */ + projects?: Project[] | undefined; + /** Token to request the next page of projects. */ + nextPageToken?: string | undefined; } export interface ListRolesRequest { @@ -1826,17 +2371,8 @@ export interface Project { createTime?: Temporal.Instant | undefined; /** A timestamp indicating when the project was last updated. */ updateTime?: Temporal.Instant | undefined; - /** The spec contains the project configuration, including display_name, pg_version (Postgres version), history_retention_duration, and default_endpoint_settings. */ - spec?: ProjectSpec | undefined; /** The current status of a Project. */ status?: ProjectStatus | undefined; - /** - * Configuration settings for the initial Read/Write endpoint created inside the initial branch for a newly - * created project. If omitted, the initial endpoint created will have default settings, without high availability - * configured. This field does not apply to any endpoints created after project creation. Use - * spec.default_endpoint_settings to configure default settings for endpoints created after project creation. - */ - initialEndpointSpec?: InitialEndpointSpec | undefined; /** * A timestamp indicating when the project was soft-deleted. * Empty if the project is not deleted, otherwise set to a timestamp in the past. @@ -1847,12 +2383,6 @@ export interface Project { * Empty if the project is not deleted, otherwise set to a timestamp in the future. */ purgeTime?: Temporal.Instant | undefined; - /** - * Configuration for the initial default branch created as part of project creation. - * Allows overriding branch protection. These settings only apply at creation time - * and do not affect resources created after project creation. - */ - initialBranchSpec?: InitialBranchSpec | undefined; /** The part of the name, chosen by the user when the resource was created. */ projectId?: string | undefined; } @@ -1988,8 +2518,6 @@ export interface Role { parent?: string | undefined; createTime?: Temporal.Instant | undefined; updateTime?: Temporal.Instant | undefined; - /** The spec contains the role configuration, including identity type, authentication method, and role attributes. */ - spec?: Role_RoleSpec | undefined; /** Current status of the role, including its identity type, authentication method, and role attributes. */ status?: Role_RoleStatus | undefined; /** The part of the name, chosen by the user when the resource was created. */ @@ -2009,6 +2537,75 @@ export interface Role_Attributes { bypassrls?: boolean | undefined; } +/** + * Attributes that can be granted to a Postgres role. We are only implementing a subset for now, see xref: + * https://www.postgresql.org/docs/16/sql-createrole.html + * The values follow Postgres keyword naming e.g. CREATEDB, BYPASSRLS, etc. which is why they don't include typical + * underscores between words. + */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface Role_CreateAttributes { + createdb?: boolean | undefined; + createrole?: boolean | undefined; + bypassrls?: boolean | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface Role_CreateRoleSpec { + /** An enum value for a standard role that this role is a member of. */ + membershipRoles?: Role_MembershipRole[] | undefined; + /** + * The type of role. + * When specifying a managed-identity, the chosen role_id must be a valid: + * + * * application ID for SERVICE_PRINCIPAL + * * user email for USER + * * group name for GROUP + */ + identityType?: Role_IdentityType | undefined; + /** The desired API-exposed Postgres role attribute to associate with the role. Optional. */ + attributes?: Role_CreateAttributes | undefined; + /** + * Controls how the Postgres role authenticates when a client opens a database + * connection. Supported values: + * + * * LAKEBASE_OAUTH_V1: the role authenticates by presenting a Databricks + * OAuth access token derived from the backing managed identity (the + * user, service principal, or group named by the role's + * `postgres_role`). No static password exists for roles using this method. + * * PG_PASSWORD_SCRAM_SHA_256: the role authenticates with a Postgres + * password verified server-side using the SCRAM-SHA-256 mechanism. + * Lakebase generates a password for the role. + * * NO_LOGIN: the role cannot open a Postgres session at all. Useful for + * roles that exist only to own objects or to aggregate privileges that + * are then granted to other, loginable roles. + * + * If auth_method is left unspecified, a meaningful authentication method is derived from the identity_type: + * * For the managed identities, OAUTH is used. + * * For the regular postgres roles, authentication based on postgres passwords is used. + * + * NOTE: for the identity type GROUP, LAKEBASE_OAUTH_V1 + * is the default auth method (group can login as well). + */ + authMethod?: Role_AuthMethod | undefined; + /** + * The name of the Postgres role. + * + * This expects a valid Postgres identifier as specified in the link below. + * https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS + * + * Required when creating the Role. + * + * If you wish to create a Postgres Role backed by a managed identity, then postgres_role + * must be one of the following: + * + * 1. user email for IdentityType.USER + * 2. app ID for IdentityType.SERVICE_PRINCIPAL + * 2. group name for IdentityType.GROUP + */ + postgresRole?: string | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface Role_RoleSpec { /** An enum value for a standard role that this role is a member of. */ @@ -2080,14 +2677,83 @@ export interface Role_RoleStatus { roleId?: string | undefined; } -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface RoleOperationMetadata {} +/** + * Attributes that can be granted to a Postgres role. We are only implementing a subset for now, see xref: + * https://www.postgresql.org/docs/16/sql-createrole.html + * The values follow Postgres keyword naming e.g. CREATEDB, BYPASSRLS, etc. which is why they don't include typical + * underscores between words. + */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface Role_UpdateAttributes { + createdb?: boolean | undefined; + createrole?: boolean | undefined; + bypassrls?: boolean | undefined; +} -export interface SyncedTable { +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface Role_UpdateRoleSpec { + /** An enum value for a standard role that this role is a member of. */ + membershipRoles?: Role_MembershipRole[] | undefined; /** - * Output only. The Full resource name of the synced table in Postgres - * where (catalog, schema, table) are the UC entity names. - * + * The type of role. + * When specifying a managed-identity, the chosen role_id must be a valid: + * + * * application ID for SERVICE_PRINCIPAL + * * user email for USER + * * group name for GROUP + */ + identityType?: Role_IdentityType | undefined; + /** The desired API-exposed Postgres role attribute to associate with the role. Optional. */ + attributes?: Role_UpdateAttributes | undefined; + /** + * Controls how the Postgres role authenticates when a client opens a database + * connection. Supported values: + * + * * LAKEBASE_OAUTH_V1: the role authenticates by presenting a Databricks + * OAuth access token derived from the backing managed identity (the + * user, service principal, or group named by the role's + * `postgres_role`). No static password exists for roles using this method. + * * PG_PASSWORD_SCRAM_SHA_256: the role authenticates with a Postgres + * password verified server-side using the SCRAM-SHA-256 mechanism. + * Lakebase generates a password for the role. + * * NO_LOGIN: the role cannot open a Postgres session at all. Useful for + * roles that exist only to own objects or to aggregate privileges that + * are then granted to other, loginable roles. + * + * If auth_method is left unspecified, a meaningful authentication method is derived from the identity_type: + * * For the managed identities, OAUTH is used. + * * For the regular postgres roles, authentication based on postgres passwords is used. + * + * NOTE: for the identity type GROUP, LAKEBASE_OAUTH_V1 + * is the default auth method (group can login as well). + */ + authMethod?: Role_AuthMethod | undefined; + /** + * The name of the Postgres role. + * + * This expects a valid Postgres identifier as specified in the link below. + * https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS + * + * Required when creating the Role. + * + * If you wish to create a Postgres Role backed by a managed identity, then postgres_role + * must be one of the following: + * + * 1. user email for IdentityType.USER + * 2. app ID for IdentityType.SERVICE_PRINCIPAL + * 2. group name for IdentityType.GROUP + */ + postgresRole?: string | undefined; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface RoleOperationMetadata {} + +export interface SyncedTable { + /** + * Output only. The Full resource name of the synced table in Postgres + * where (catalog, schema, table) are the UC entity names. + * * Format "synced_tables/{catalog}.{schema}.{table}" * * For the corresponding source table in the Unity catalog look for the "source_table_full_name" attribute. @@ -2095,11 +2761,6 @@ export interface SyncedTable { name?: string | undefined; /** The Unity Catalog table ID for this synced table. */ uid?: string | undefined; - /** - * Configuration details of the synced table, such as the source table, scheduling policy, etc. - * This attribute is specified at creation time and most fields are returned as is on subsequent queries. - */ - spec?: SyncedTable_SyncedTableSpec | undefined; /** Synced Table data synchronization status. */ status?: SyncedTable_SyncedTableStatus | undefined; createTime?: Temporal.Instant | undefined; @@ -2107,6 +2768,75 @@ export interface SyncedTable { syncedTableId?: string | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface SyncedTable_CreateSyncedTableSpec { + /** + * The Postgres database name where the synced table will be created in. + * + * If this synced table is created inside a Lakebase Catalog, this attribute can be omitted on creation and is inferred + * from the postgres_database associated with the Lakebase Catalog. If specified when inside a Lakebase Catalog, the value must match. + * + * A value must be specified when creating a synced table inside a Standard Catalog. + */ + postgresDatabase?: string | undefined; + /** + * The full resource name the branch associated with the table. + * + * Format: "projects/{project_id}/branches/{branch_id}". + */ + branch?: string | undefined; + /** Scheduling policy of the underlying pipeline. */ + schedulingPolicy?: + | SyncedTable_SyncedTableSpec_SyncedTableSchedulingPolicy + | undefined; + /** + * Three-part (catalog, schema, table) name of the source Delta table. + * + * For the corresponding destination table, use any of the two: + * + * * synced_table_id used at the creation of the SyncedTable + * * "name" consisting of "synced_tables/" prefix and the full name of the destination table. + */ + sourceTableFullName?: string | undefined; + /** Primary Key columns to be used for data insert/update in the destination. */ + primaryKeyColumns?: string[] | undefined; + /** Time series key to deduplicate (tie-break) rows with the same primary key. */ + timeseriesKey?: string | undefined; + /** + * ID of an existing pipeline to bin-pack this synced table into. + * At most one of existing_pipeline_id and new_pipeline_spec should be defined. + * + * The pipeline used for the synced table is returned via the top level pipeline_id attribute. + */ + existingPipelineId?: string | undefined; + /** + * If true, the synced table's logical database and schema resources in PG + * will be created if they do not already exist. + * The request will fail if this is false and the database/schema do not exist. + * + * Defaults to true if omitted. + */ + createDatabaseObjectsIfMissing?: boolean | undefined; + /** + * Specification for creating a new pipeline. + * At most one of existing_pipeline_id and new_pipeline_spec should be defined. + * + * The pipeline used for the synced table is returned via the top level pipeline_id attribute. + */ + newPipelineSpec?: CreateNewPipelineSpec | undefined; + /** + * When true, enables accelerated sync mode for the initial data load. + * This significantly improves performance for large tables. + * Requires workspace-level enablement through Lakebase Accelerated Sync preview. + */ + acceleratedSync?: boolean | undefined; + /** + * Override the default Delta->PG type mapping for specific columns. + * A TypeOverride with PG_SPECIFIC_TYPE_UNSPECIFIED is rejected; a valid pg_type must be set. + */ + typeOverrides?: SyncedTable_SyncedTableSpec_CreateTypeOverride[] | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface SyncedTable_SyncedTableSpec { /** @@ -2176,6 +2906,20 @@ export interface SyncedTable_SyncedTableSpec { typeOverrides?: SyncedTable_SyncedTableSpec_TypeOverride[] | undefined; } +/** Overrides the default Delta-to-PostgreSQL type mapping for a single column. */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface SyncedTable_SyncedTableSpec_CreateTypeOverride { + /** Name of the source column whose target PostgreSQL type should be overridden. */ + columnName: string; + /** PostgreSQL-specific target type to use for the column. */ + pgType: SyncedTable_SyncedTableSpec_PgSpecificType; + /** + * Size parameter for the target type. Required when pg_type is PG_SPECIFIC_TYPE_VECTOR + * (specifies the vector dimension, e.g., 1024). + */ + size?: number | undefined; +} + /** Overrides the default Delta-to-PostgreSQL type mapping for a single column. */ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface SyncedTable_SyncedTableSpec_TypeOverride { @@ -2260,80 +3004,383 @@ export interface SyncedTablePosition { | undefined; } -export interface UndeleteBranchRequest { - /** - * The full resource path of the branch to undelete. - * Format: projects/{project_id}/branches/{branch_id} - */ - name?: string | undefined; -} - -/** Request to restore a soft-deleted project within its retention period. */ -export interface UndeleteProjectRequest { - /** - * The full resource path of the project to undelete. - * Format: projects/{project_id} - */ - name?: string | undefined; -} - -export interface UpdateBranchRequest { +export interface UndeleteBranchRequest { + /** + * The full resource path of the branch to undelete. + * Format: projects/{project_id}/branches/{branch_id} + */ + name?: string | undefined; +} + +/** Request to restore a soft-deleted project within its retention period. */ +export interface UndeleteProjectRequest { + /** + * The full resource path of the project to undelete. + * Format: projects/{project_id} + */ + name?: string | undefined; +} + +export interface UpdateBranch { + /** + * Output only. The full resource path of the branch. + * Format: projects/{project_id}/branches/{branch_id} + */ + name?: string | undefined; + /** The spec contains the branch configuration. */ + spec?: UpdateBranchSpec | undefined; +} + +export interface UpdateBranchRequest { + /** + * The Branch to update. + * + * The branch's `name` field is used to identify the branch to update. + * Format: projects/{project_id}/branches/{branch_id} + */ + branch?: UpdateBranch | undefined; + /** The list of fields to update. If unspecified, all fields will be updated when possible. */ + updateMask?: FieldMask | undefined; +} + +export interface UpdateBranchSpec { + /** + * The name of the source branch from which this branch was created (data lineage for point-in-time recovery). + * If not specified, defaults to the project's default branch. + * Format: projects/{project_id}/branches/{branch_id} + */ + sourceBranch?: string | undefined; + /** The Log Sequence Number (LSN) on the source branch from which this branch was created. */ + sourceBranchLsn?: string | undefined; + /** The point in time on the source branch from which this branch was created. */ + sourceBranchTime?: Temporal.Instant | undefined; + /** When set to true, protects the branch from deletion and reset. Associated compute endpoints and the project cannot be deleted while the branch is protected. */ + isProtected?: boolean | undefined; + /** + * Expiration configuration for the branch. One of expire_time, ttl, or no_expiry must be provided. + * To disable expiration, set no_expiry to true. + * + * When updating this field, use "spec.expiration" in the update_mask. + */ + expiration?: + | { + $case: 'expireTime'; + /** + * Absolute expiration timestamp. When set, the branch will expire at this time. + * Mutually exclusive with `ttl` and `no_expiry`. When updating, use `spec.expiration` in the update_mask. + */ + expireTime: Temporal.Instant; + } + | { + $case: 'ttl'; + /** + * Relative time-to-live duration. When set, the branch will expire at creation_time + ttl. + * Mutually exclusive with `expire_time` and `no_expiry`. When updating, use `spec.expiration` in the update_mask. + */ + ttl: Temporal.Duration; + } + | { + $case: 'noExpiry'; + /** + * Explicitly disable expiration. When set to true, the branch will not expire. + * If set to false, the request is invalid; provide either ttl or expire_time instead. + * Mutually exclusive with `expire_time` and `ttl`. When updating, use `spec.expiration` in the update_mask. + */ + noExpiry: boolean; + } + | undefined; +} + +/** + * DataApi represents the Data API (PostgREST) configuration for a Database. + * At most one DataApi per database. Create enables Data API, Delete disables it. + */ +export interface UpdateDataApi { + /** Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api */ + name?: string | undefined; + /** The desired Data API configuration. */ + spec?: DataApi_UpdateDataApiSpec | undefined; +} + +/** Update Data API configuration for a database. */ +export interface UpdateDataApiRequest { + /** + * The Data API configuration to update. + * The data_api's `name` field identifies the resource. + */ + dataApi?: UpdateDataApi | undefined; + /** The list of fields to update. If unspecified, all fields will be updated when possible. */ + updateMask?: FieldMask | undefined; +} + +/** Database represents a Postgres database within a Branch. */ +export interface UpdateDatabase { + /** + * The resource name of the database. + * Format: projects/{project_id}/branches/{branch_id}/databases/{database_id} + */ + name?: string | undefined; + /** The desired state of the Database. */ + spec?: Database_UpdateDatabaseSpec | undefined; +} + +export interface UpdateDatabaseRequest { + /** + * The Database to update. + * + * The database's `name` field is used to identify the database to update. + * Format: projects/{project_id}/branches/{branch_id}/databases/{database_id} + */ + database?: UpdateDatabase | undefined; + /** The list of fields to update. If unspecified, all fields will be updated when possible. */ + updateMask?: FieldMask | undefined; +} + +export interface UpdateEndpoint { + /** + * Output only. The full resource path of the endpoint. + * Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id} + */ + name?: string | undefined; + /** The spec contains the compute endpoint configuration, including autoscaling limits, suspend timeout, and disabled state. */ + spec?: UpdateEndpointSpec | undefined; +} + +export interface UpdateEndpointGroupSpec { + /** + * The minimum number of computes in the endpoint group. Currently, this must be equal to max. This must be greater + * than or equal to 1. + */ + min?: number | undefined; + /** + * The maximum number of computes in the endpoint group. Currently, this must be equal to min. Set to 1 for single + * compute endpoints, to disable HA. To manually suspend all computes in an endpoint group, set disabled to + * true on the EndpointSpec. + */ + max?: number | undefined; + /** + * Whether to allow read-only connections to read-write endpoints. Only relevant for read-write endpoints where + * size.max > 1. + */ + enableReadableSecondaries?: boolean | undefined; +} + +export interface UpdateEndpointRequest { + /** + * The Endpoint to update. + * + * The endpoint's `name` field is used to identify the endpoint to update. + * Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id} + */ + endpoint?: UpdateEndpoint | undefined; + /** The list of fields to update. If unspecified, all fields will be updated when possible. */ + updateMask?: FieldMask | undefined; +} + +/** A collection of settings for a compute endpoint. */ +export interface UpdateEndpointSettings { + /** A raw representation of Postgres settings. */ + pgSettings?: Record | undefined; +} + +export interface UpdateEndpointSpec { + /** The endpoint type. A branch can only have one READ_WRITE endpoint. */ + endpointType?: EndpointType | undefined; + /** The minimum number of Compute Units. Minimum value is 0.5. */ + autoscalingLimitMinCu?: number | undefined; + /** + * The maximum number of Compute Units. The maximum value is 64. + * The difference between the minimum and maximum Compute Units (max - min) must not exceed 16. + */ + autoscalingLimitMaxCu?: number | undefined; + /** + * Whether to restrict connections to the compute endpoint. + * Enabling this option schedules a suspend compute operation. + * A disabled compute endpoint cannot be enabled by a connection or + * console action. + */ + disabled?: boolean | undefined; + /** + * Duration of inactivity after which the compute endpoint is automatically suspended. One of suspend_timeout_duration or no_suspension can be provided. + * When not specified default suspension behavior will be used (consult with documentation). + * + * When updating this field, use "spec.suspension" in the update_mask. + */ + suspension?: + | { + $case: 'suspendTimeoutDuration'; + /** + * Duration of inactivity after which the compute endpoint is automatically suspended. + * If specified should be between 60s and 604800s (1 minute to 1 week). + * Mutually exclusive with `no_suspension`. When updating, use `spec.suspension` in the update_mask. + */ + suspendTimeoutDuration: Temporal.Duration; + } + | { + $case: 'noSuspension'; + /** + * When set to true, explicitly disables automatic suspension (never suspend). + * Should be set to true when provided. + * Mutually exclusive with `suspend_timeout_duration`. When updating, use `spec.suspension` in the update_mask. + */ + noSuspension: boolean; + } + | undefined; + settings?: UpdateEndpointSettings | undefined; + /** + * Settings for optional HA configuration of the endpoint. If unspecified, the endpoint defaults + * to non HA settings, with a single compute backing the endpoint (and no readable secondaries + * for Read/Write endpoints). + */ + group?: UpdateEndpointGroupSpec | undefined; +} + +/** Configuration for the initial default branch created during project creation. */ +export interface UpdateInitialBranchSpec { + /** Whether the initial default branch should be protected from deletion. */ + isProtected?: boolean | undefined; +} + +/** Configuration for the initial Read/Write endpoint created during project creation. */ +export interface UpdateInitialEndpointSpec { + /** Settings for HA configuration of the endpoint. */ + group?: UpdateEndpointGroupSpec | undefined; + /** The minimum number of Compute Units for the initial endpoint. */ + autoscalingLimitMinCu?: number | undefined; + /** The maximum number of Compute Units for the initial endpoint. */ + autoscalingLimitMaxCu?: number | undefined; + suspension?: + | { + $case: 'suspendTimeoutDuration'; + /** + * Duration of inactivity after which the initial endpoint is automatically suspended. + * If specified, should be between 60s and 604800s (1 minute to 1 week). + * Mutually exclusive with `no_suspension`. + */ + suspendTimeoutDuration: Temporal.Duration; + } + | { + $case: 'noSuspension'; + /** + * When set to true, explicitly disables automatic suspension (never suspend). + * Should be set to true when provided. + * Mutually exclusive with `suspend_timeout_duration`. + */ + noSuspension: boolean; + } + | undefined; +} + +export interface UpdateProject { + /** + * Output only. The full resource path of the project. + * Format: projects/{project_id} + */ + name?: string | undefined; + /** The spec contains the project configuration, including display_name, pg_version (Postgres version), history_retention_duration, and default_endpoint_settings. */ + spec?: UpdateProjectSpec | undefined; + /** + * Configuration settings for the initial Read/Write endpoint created inside the initial branch for a newly + * created project. If omitted, the initial endpoint created will have default settings, without high availability + * configured. This field does not apply to any endpoints created after project creation. Use + * spec.default_endpoint_settings to configure default settings for endpoints created after project creation. + */ + initialEndpointSpec?: UpdateInitialEndpointSpec | undefined; + /** + * Configuration for the initial default branch created as part of project creation. + * Allows overriding branch protection. These settings only apply at creation time + * and do not affect resources created after project creation. + */ + initialBranchSpec?: UpdateInitialBranchSpec | undefined; +} + +export interface UpdateProjectCustomTag { + /** The key of the custom tag. */ + key?: string | undefined; + /** The value of the custom tag. */ + value?: string | undefined; +} + +/** A collection of settings for a compute endpoint. */ +export interface UpdateProjectDefaultEndpointSettings { + /** The minimum number of Compute Units. Minimum value is 0.5. */ + autoscalingLimitMinCu?: number | undefined; + /** The maximum number of Compute Units. Minimum value is 0.5. */ + autoscalingLimitMaxCu?: number | undefined; + suspension?: + | { + $case: 'suspendTimeoutDuration'; + /** + * Duration of inactivity after which the compute endpoint is automatically suspended. + * If specified should be between 60s and 604800s (1 minute to 1 week). + * Mutually exclusive with `no_suspension`. When updating, use `spec.project_default_settings.suspension` in the update_mask. + */ + suspendTimeoutDuration: Temporal.Duration; + } + | { + $case: 'noSuspension'; + /** + * When set to true, explicitly disables automatic suspension (never suspend). + * Should be set to true when provided. + * Mutually exclusive with `suspend_timeout_duration`. When updating, use `spec.project_default_settings.suspension` in the update_mask. + */ + noSuspension: boolean; + } + | undefined; + /** A raw representation of Postgres settings. */ + pgSettings?: Record | undefined; +} + +export interface UpdateProjectRequest { /** - * The Branch to update. + * The Project to update. * - * The branch's `name` field is used to identify the branch to update. - * Format: projects/{project_id}/branches/{branch_id} + * The project's `name` field is used to identify the project to update. + * Format: projects/{project_id} */ - branch?: Branch | undefined; + project?: UpdateProject | undefined; /** The list of fields to update. If unspecified, all fields will be updated when possible. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; } -/** Update Data API configuration for a database. */ -export interface UpdateDataApiRequest { +export interface UpdateProjectSpec { + /** Human-readable project name. Length should be between 1 and 256 characters. */ + displayName?: string | undefined; + /** The major Postgres version number. The set of supported versions may vary; consult the API documentation for currently accepted values. */ + pgVersion?: number | undefined; + /** The number of seconds to retain the shared history for point in time recovery for all branches in this project. Value should be between 172800s (2 days) and 3024000s (35 days). */ + historyRetentionDuration?: Temporal.Duration | undefined; + defaultEndpointSettings?: UpdateProjectDefaultEndpointSettings | undefined; /** - * The Data API configuration to update. - * The data_api's `name` field identifies the resource. + * The desired budget policy to associate with the project. + * See status.budget_policy_id for the policy that is actually applied to the project. */ - dataApi?: DataApi | undefined; - /** The list of fields to update. If unspecified, all fields will be updated when possible. */ - updateMask?: FieldMask | undefined; -} - -export interface UpdateDatabaseRequest { + budgetPolicyId?: string | undefined; /** - * The Database to update. - * - * The database's `name` field is used to identify the database to update. - * Format: projects/{project_id}/branches/{branch_id}/databases/{database_id} + * Custom tags to associate with the project. Forwarded to LBM for billing and cost tracking. + * To update tags, provide the new tag list and include "spec.custom_tags" in the update_mask. + * To clear all tags, provide an empty list and include "spec.custom_tags" in the update_mask. + * To preserve existing tags, omit this field from the update_mask (or use wildcard "*" which auto-excludes empty tags). */ - database?: Database | undefined; - /** The list of fields to update. If unspecified, all fields will be updated when possible. */ - updateMask?: FieldMask | undefined; -} - -export interface UpdateEndpointRequest { + customTags?: UpdateProjectCustomTag[] | undefined; + /** Whether to enable PG native password login on all endpoints in this project. Defaults to false. */ + enablePgNativeLogin?: boolean | undefined; /** - * The Endpoint to update. - * - * The endpoint's `name` field is used to identify the endpoint to update. - * Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id} + * The full resource path for the default branch of the project + * Format: projects/{project_id}/branches/{branch_id} */ - endpoint?: Endpoint | undefined; - /** The list of fields to update. If unspecified, all fields will be updated when possible. */ - updateMask?: FieldMask | undefined; + defaultBranch?: string | undefined; } -export interface UpdateProjectRequest { +/** Role represents a Postgres role within a Branch. */ +export interface UpdateRole { /** - * The Project to update. - * - * The project's `name` field is used to identify the project to update. - * Format: projects/{project_id} + * Output only. The full resource path of the role. + * Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} */ - project?: Project | undefined; - /** The list of fields to update. If unspecified, all fields will be updated when possible. */ - updateMask?: FieldMask | undefined; + name?: string | undefined; + /** The spec contains the role configuration, including identity type, authentication method, and role attributes. */ + spec?: Role_UpdateRoleSpec | undefined; } export interface UpdateRoleRequest { @@ -2343,12 +3390,12 @@ export interface UpdateRoleRequest { * The role's `name` field is used to identify the role to update. * Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} */ - role?: Role | undefined; + role?: UpdateRole | undefined; /** * The list of fields to update in Postgres Role. * If unspecified, all fields will be updated when possible. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalApiErrorSchema: z.ZodType = z @@ -2378,7 +3425,6 @@ export const unmarshalBranchSchema: z.ZodType = z .string() .transform(s => Temporal.Instant.from(s)) .optional(), - spec: z.lazy(() => unmarshalBranchSpecSchema).optional(), status: z.lazy(() => unmarshalBranchStatusSchema).optional(), branch_id: z.string().optional(), }) @@ -2388,7 +3434,6 @@ export const unmarshalBranchSchema: z.ZodType = z parent: d.parent, createTime: d.create_time, updateTime: d.update_time, - spec: d.spec, status: d.status, branchId: d.branch_id, })); @@ -2396,40 +3441,6 @@ export const unmarshalBranchSchema: z.ZodType = z export const unmarshalBranchOperationMetadataSchema: z.ZodType = z.object({}); -export const unmarshalBranchSpecSchema: z.ZodType = z - .object({ - source_branch: z.string().optional(), - source_branch_lsn: z.string().optional(), - source_branch_time: z - .string() - .transform(s => Temporal.Instant.from(s)) - .optional(), - is_protected: z.boolean().optional(), - expire_time: z - .string() - .transform(s => Temporal.Instant.from(s)) - .optional(), - ttl: z - .string() - .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) - .optional(), - no_expiry: z.boolean().optional(), - }) - .transform(d => ({ - sourceBranch: d.source_branch, - sourceBranchLsn: d.source_branch_lsn, - sourceBranchTime: d.source_branch_time, - isProtected: d.is_protected, - expiration: - d.expire_time !== undefined - ? {$case: 'expireTime' as const, expireTime: d.expire_time} - : d.ttl !== undefined - ? {$case: 'ttl' as const, ttl: d.ttl} - : d.no_expiry !== undefined - ? {$case: 'noExpiry' as const, noExpiry: d.no_expiry} - : undefined, - })); - export const unmarshalBranchStatusSchema: z.ZodType = z .object({ source_branch: z.string().optional(), @@ -2484,7 +3495,6 @@ export const unmarshalCatalogSchema: z.ZodType = z .object({ name: z.string().optional(), uid: z.string().optional(), - spec: z.lazy(() => unmarshalCatalog_CatalogSpecSchema).optional(), status: z.lazy(() => unmarshalCatalog_CatalogStatusSchema).optional(), create_time: z .string() @@ -2499,27 +3509,12 @@ export const unmarshalCatalogSchema: z.ZodType = z .transform(d => ({ name: d.name, uid: d.uid, - spec: d.spec, status: d.status, createTime: d.create_time, updateTime: d.update_time, catalogId: d.catalog_id, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const unmarshalCatalog_CatalogSpecSchema: z.ZodType = - z - .object({ - postgres_database: z.string().optional(), - create_database_if_missing: z.boolean().optional(), - branch: z.string().optional(), - }) - .transform(d => ({ - postgresDatabase: d.postgres_database, - createDatabaseIfMissing: d.create_database_if_missing, - branch: d.branch, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalCatalog_CatalogStatusSchema: z.ZodType = z @@ -2549,7 +3544,6 @@ export const unmarshalDataApiSchema: z.ZodType = z .string() .transform(s => Temporal.Instant.from(s)) .optional(), - spec: z.lazy(() => unmarshalDataApi_DataApiSpecSchema).optional(), status: z.lazy(() => unmarshalDataApi_DataApiStatusSchema).optional(), }) .transform(d => ({ @@ -2557,39 +3551,9 @@ export const unmarshalDataApiSchema: z.ZodType = z parent: d.parent, createTime: d.create_time, updateTime: d.update_time, - spec: d.spec, status: d.status, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const unmarshalDataApi_DataApiSpecSchema: z.ZodType = - z - .object({ - db_aggregates_enabled: z.boolean().optional(), - db_extra_search_path: z.array(z.string()).optional(), - db_max_rows: z.number().optional(), - db_schemas: z.array(z.string()).optional(), - jwt_role_claim_key: z.string().optional(), - jwt_cache_max_lifetime: z - .string() - .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) - .optional(), - openapi_mode: z.string().optional(), - server_cors_allowed_origins: z.array(z.string()).optional(), - server_timing_enabled: z.boolean().optional(), - }) - .transform(d => ({ - dbAggregatesEnabled: d.db_aggregates_enabled, - dbExtraSearchPath: d.db_extra_search_path, - dbMaxRows: d.db_max_rows, - dbSchemas: d.db_schemas, - jwtRoleClaimKey: d.jwt_role_claim_key, - jwtCacheMaxLifetime: d.jwt_cache_max_lifetime, - openapiMode: d.openapi_mode, - serverCorsAllowedOrigins: d.server_cors_allowed_origins, - serverTimingEnabled: d.server_timing_enabled, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalDataApi_DataApiStatusSchema: z.ZodType = z @@ -2638,7 +3602,6 @@ export const unmarshalDatabaseSchema: z.ZodType = z .string() .transform(s => Temporal.Instant.from(s)) .optional(), - spec: z.lazy(() => unmarshalDatabase_DatabaseSpecSchema).optional(), status: z.lazy(() => unmarshalDatabase_DatabaseStatusSchema).optional(), database_id: z.string().optional(), }) @@ -2647,23 +3610,10 @@ export const unmarshalDatabaseSchema: z.ZodType = z parent: d.parent, createTime: d.create_time, updateTime: d.update_time, - spec: d.spec, status: d.status, databaseId: d.database_id, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const unmarshalDatabase_DatabaseSpecSchema: z.ZodType = - z - .object({ - role: z.string().optional(), - postgres_database: z.string().optional(), - }) - .transform(d => ({ - role: d.role, - postgresDatabase: d.postgres_database, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalDatabase_DatabaseStatusSchema: z.ZodType = z @@ -2725,7 +3675,6 @@ export const unmarshalEndpointSchema: z.ZodType = z .string() .transform(s => Temporal.Instant.from(s)) .optional(), - spec: z.lazy(() => unmarshalEndpointSpecSchema).optional(), status: z.lazy(() => unmarshalEndpointStatusSchema).optional(), endpoint_id: z.string().optional(), }) @@ -2735,23 +3684,10 @@ export const unmarshalEndpointSchema: z.ZodType = z parent: d.parent, createTime: d.create_time, updateTime: d.update_time, - spec: d.spec, status: d.status, endpointId: d.endpoint_id, })); -export const unmarshalEndpointGroupSpecSchema: z.ZodType = z - .object({ - min: z.number().optional(), - max: z.number().optional(), - enable_readable_secondaries: z.boolean().optional(), - }) - .transform(d => ({ - min: d.min, - max: d.max, - enableReadableSecondaries: d.enable_readable_secondaries, - })); - export const unmarshalEndpointGroupStatusSchema: z.ZodType = z .object({ @@ -2786,38 +3722,6 @@ export const unmarshalEndpointSettingsSchema: z.ZodType = z pgSettings: d.pg_settings, })); -export const unmarshalEndpointSpecSchema: z.ZodType = z - .object({ - endpoint_type: z.string().optional(), - autoscaling_limit_min_cu: z.number().optional(), - autoscaling_limit_max_cu: z.number().optional(), - disabled: z.boolean().optional(), - suspend_timeout_duration: z - .string() - .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) - .optional(), - no_suspension: z.boolean().optional(), - settings: z.lazy(() => unmarshalEndpointSettingsSchema).optional(), - group: z.lazy(() => unmarshalEndpointGroupSpecSchema).optional(), - }) - .transform(d => ({ - endpointType: d.endpoint_type, - autoscalingLimitMinCu: d.autoscaling_limit_min_cu, - autoscalingLimitMaxCu: d.autoscaling_limit_max_cu, - disabled: d.disabled, - suspension: - d.suspend_timeout_duration !== undefined - ? { - $case: 'suspendTimeoutDuration' as const, - suspendTimeoutDuration: d.suspend_timeout_duration, - } - : d.no_suspension !== undefined - ? {$case: 'noSuspension' as const, noSuspension: d.no_suspension} - : undefined, - settings: d.settings, - group: d.group, - })); - export const unmarshalEndpointStatusSchema: z.ZodType = z .object({ endpoint_type: z.string().optional(), @@ -2849,41 +3753,6 @@ export const unmarshalEndpointStatusSchema: z.ZodType = z endpointId: d.endpoint_id, })); -export const unmarshalInitialBranchSpecSchema: z.ZodType = z - .object({ - is_protected: z.boolean().optional(), - }) - .transform(d => ({ - isProtected: d.is_protected, - })); - -export const unmarshalInitialEndpointSpecSchema: z.ZodType = - z - .object({ - group: z.lazy(() => unmarshalEndpointGroupSpecSchema).optional(), - autoscaling_limit_min_cu: z.number().optional(), - autoscaling_limit_max_cu: z.number().optional(), - suspend_timeout_duration: z - .string() - .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) - .optional(), - no_suspension: z.boolean().optional(), - }) - .transform(d => ({ - group: d.group, - autoscalingLimitMinCu: d.autoscaling_limit_min_cu, - autoscalingLimitMaxCu: d.autoscaling_limit_max_cu, - suspension: - d.suspend_timeout_duration !== undefined - ? { - $case: 'suspendTimeoutDuration' as const, - suspendTimeoutDuration: d.suspend_timeout_duration, - } - : d.no_suspension !== undefined - ? {$case: 'noSuspension' as const, noSuspension: d.no_suspension} - : undefined, - })); - export const unmarshalListBranchesResponseSchema: z.ZodType = z .object({ @@ -2938,18 +3807,6 @@ export const unmarshalListRolesResponseSchema: z.ZodType = z nextPageToken: d.next_page_token, })); -export const unmarshalNewPipelineSpecSchema: z.ZodType = z - .object({ - storage_catalog: z.string().optional(), - storage_schema: z.string().optional(), - budget_policy_id: z.string().optional(), - }) - .transform(d => ({ - storageCatalog: d.storage_catalog, - storageSchema: d.storage_schema, - budgetPolicyId: d.budget_policy_id, - })); - export const unmarshalOperationSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -2982,11 +3839,7 @@ export const unmarshalProjectSchema: z.ZodType = z .string() .transform(s => Temporal.Instant.from(s)) .optional(), - spec: z.lazy(() => unmarshalProjectSpecSchema).optional(), status: z.lazy(() => unmarshalProjectStatusSchema).optional(), - initial_endpoint_spec: z - .lazy(() => unmarshalInitialEndpointSpecSchema) - .optional(), delete_time: z .string() .transform(s => Temporal.Instant.from(s)) @@ -2995,9 +3848,6 @@ export const unmarshalProjectSchema: z.ZodType = z .string() .transform(s => Temporal.Instant.from(s)) .optional(), - initial_branch_spec: z - .lazy(() => unmarshalInitialBranchSpecSchema) - .optional(), project_id: z.string().optional(), }) .transform(d => ({ @@ -3005,12 +3855,9 @@ export const unmarshalProjectSchema: z.ZodType = z uid: d.uid, createTime: d.create_time, updateTime: d.update_time, - spec: d.spec, status: d.status, - initialEndpointSpec: d.initial_endpoint_spec, deleteTime: d.delete_time, purgeTime: d.purge_time, - initialBranchSpec: d.initial_branch_spec, projectId: d.project_id, })); @@ -3052,36 +3899,7 @@ export const unmarshalProjectDefaultEndpointSettingsSchema: z.ZodType = - z.object({}); - -export const unmarshalProjectSpecSchema: z.ZodType = z - .object({ - display_name: z.string().optional(), - pg_version: z.number().optional(), - history_retention_duration: z - .string() - .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) - .optional(), - default_endpoint_settings: z - .lazy(() => unmarshalProjectDefaultEndpointSettingsSchema) - .optional(), - budget_policy_id: z.string().optional(), - custom_tags: z - .array(z.lazy(() => unmarshalProjectCustomTagSchema)) - .optional(), - enable_pg_native_login: z.boolean().optional(), - default_branch: z.string().optional(), - }) - .transform(d => ({ - displayName: d.display_name, - pgVersion: d.pg_version, - historyRetentionDuration: d.history_retention_duration, - defaultEndpointSettings: d.default_endpoint_settings, - budgetPolicyId: d.budget_policy_id, - customTags: d.custom_tags, - enablePgNativeLogin: d.enable_pg_native_login, - defaultBranch: d.default_branch, - })); + z.object({}); export const unmarshalProjectStatusSchema: z.ZodType = z .object({ @@ -3143,7 +3961,6 @@ export const unmarshalRoleSchema: z.ZodType = z .string() .transform(s => Temporal.Instant.from(s)) .optional(), - spec: z.lazy(() => unmarshalRole_RoleSpecSchema).optional(), status: z.lazy(() => unmarshalRole_RoleStatusSchema).optional(), role_id: z.string().optional(), }) @@ -3152,7 +3969,6 @@ export const unmarshalRoleSchema: z.ZodType = z parent: d.parent, createTime: d.create_time, updateTime: d.update_time, - spec: d.spec, status: d.status, roleId: d.role_id, })); @@ -3170,23 +3986,6 @@ export const unmarshalRole_AttributesSchema: z.ZodType = z bypassrls: d.bypassrls, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const unmarshalRole_RoleSpecSchema: z.ZodType = z - .object({ - membership_roles: z.array(z.string()).optional(), - identity_type: z.string().optional(), - attributes: z.lazy(() => unmarshalRole_AttributesSchema).optional(), - auth_method: z.string().optional(), - postgres_role: z.string().optional(), - }) - .transform(d => ({ - membershipRoles: d.membership_roles, - identityType: d.identity_type, - attributes: d.attributes, - authMethod: d.auth_method, - postgresRole: d.postgres_role, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalRole_RoleStatusSchema: z.ZodType = z .object({ @@ -3213,7 +4012,6 @@ export const unmarshalSyncedTableSchema: z.ZodType = z .object({ name: z.string().optional(), uid: z.string().optional(), - spec: z.lazy(() => unmarshalSyncedTable_SyncedTableSpecSchema).optional(), status: z .lazy(() => unmarshalSyncedTable_SyncedTableStatusSchema) .optional(), @@ -3226,62 +4024,11 @@ export const unmarshalSyncedTableSchema: z.ZodType = z .transform(d => ({ name: d.name, uid: d.uid, - spec: d.spec, status: d.status, createTime: d.create_time, syncedTableId: d.synced_table_id, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const unmarshalSyncedTable_SyncedTableSpecSchema: z.ZodType = - z - .object({ - postgres_database: z.string().optional(), - branch: z.string().optional(), - scheduling_policy: z.string().optional(), - source_table_full_name: z.string().optional(), - primary_key_columns: z.array(z.string()).optional(), - timeseries_key: z.string().optional(), - existing_pipeline_id: z.string().optional(), - create_database_objects_if_missing: z.boolean().optional(), - new_pipeline_spec: z - .lazy(() => unmarshalNewPipelineSpecSchema) - .optional(), - accelerated_sync: z.boolean().optional(), - type_overrides: z - .array( - z.lazy(() => unmarshalSyncedTable_SyncedTableSpec_TypeOverrideSchema) - ) - .optional(), - }) - .transform(d => ({ - postgresDatabase: d.postgres_database, - branch: d.branch, - schedulingPolicy: d.scheduling_policy, - sourceTableFullName: d.source_table_full_name, - primaryKeyColumns: d.primary_key_columns, - timeseriesKey: d.timeseries_key, - existingPipelineId: d.existing_pipeline_id, - createDatabaseObjectsIfMissing: d.create_database_objects_if_missing, - newPipelineSpec: d.new_pipeline_spec, - acceleratedSync: d.accelerated_sync, - typeOverrides: d.type_overrides, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const unmarshalSyncedTable_SyncedTableSpec_TypeOverrideSchema: z.ZodType = - z - .object({ - column_name: z.string().optional(), - pg_type: z.string().optional(), - size: z.number().optional(), - }) - .transform(d => ({ - columnName: d.column_name, - pgType: d.pg_type, - size: d.size, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalSyncedTable_SyncedTableStatusSchema: z.ZodType = z @@ -3374,35 +4121,30 @@ export const unmarshalSyncedTablePositionSchema: z.ZodType : undefined, })); -export const marshalBranchSchema: z.ZodType = z +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalCatalog_CreateCatalogSpecSchema: z.ZodType = z + .object({ + postgresDatabase: z.string(), + createDatabaseIfMissing: z.boolean().optional(), + branch: z.string().optional(), + }) + .transform(d => ({ + postgres_database: d.postgresDatabase, + create_database_if_missing: d.createDatabaseIfMissing, + branch: d.branch, + })); + +export const marshalCreateBranchSchema: z.ZodType = z .object({ name: z.string().optional(), - uid: z.string().optional(), - parent: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - spec: z.lazy(() => marshalBranchSpecSchema).optional(), - status: z.lazy(() => marshalBranchStatusSchema).optional(), - branchId: z.string().optional(), + spec: z.lazy(() => marshalCreateBranchSpecSchema).optional(), }) .transform(d => ({ name: d.name, - uid: d.uid, - parent: d.parent, - create_time: d.createTime, - update_time: d.updateTime, spec: d.spec, - status: d.status, - branch_id: d.branchId, })); -export const marshalBranchSpecSchema: z.ZodType = z +export const marshalCreateBranchSpecSchema: z.ZodType = z .object({ sourceBranch: z.string().optional(), sourceBranchLsn: z.string().optional(), @@ -3443,131 +4185,292 @@ export const marshalBranchSpecSchema: z.ZodType = z }), })); -export const marshalBranchStatusSchema: z.ZodType = z +export const marshalCreateCatalogSchema: z.ZodType = z .object({ - sourceBranch: z.string().optional(), - sourceBranchLsn: z.string().optional(), - sourceBranchTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + name: z.string().optional(), + spec: z.lazy(() => marshalCatalog_CreateCatalogSpecSchema).optional(), + }) + .transform(d => ({ + name: d.name, + spec: d.spec, + })); + +export const marshalCreateDataApiSchema: z.ZodType = z + .object({ + name: z.string().optional(), + spec: z.lazy(() => marshalDataApi_CreateDataApiSpecSchema).optional(), + }) + .transform(d => ({ + name: d.name, + spec: d.spec, + })); + +export const marshalCreateDatabaseSchema: z.ZodType = z + .object({ + name: z.string().optional(), + spec: z.lazy(() => marshalDatabase_CreateDatabaseSpecSchema).optional(), + }) + .transform(d => ({ + name: d.name, + spec: d.spec, + })); + +export const marshalCreateEndpointSchema: z.ZodType = z + .object({ + name: z.string().optional(), + spec: z.lazy(() => marshalCreateEndpointSpecSchema).optional(), + }) + .transform(d => ({ + name: d.name, + spec: d.spec, + })); + +export const marshalCreateEndpointGroupSpecSchema: z.ZodType = z + .object({ + min: z.number(), + max: z.number(), + enableReadableSecondaries: z.boolean().optional(), + }) + .transform(d => ({ + min: d.min, + max: d.max, + enable_readable_secondaries: d.enableReadableSecondaries, + })); + +export const marshalCreateEndpointSettingsSchema: z.ZodType = z + .object({ + pgSettings: z.record(z.string(), z.string()).optional(), + }) + .transform(d => ({ + pg_settings: d.pgSettings, + })); + +export const marshalCreateEndpointSpecSchema: z.ZodType = z + .object({ + endpointType: z.string(), + autoscalingLimitMinCu: z.number().optional(), + autoscalingLimitMaxCu: z.number().optional(), + disabled: z.boolean().optional(), + suspension: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('suspendTimeoutDuration'), + suspendTimeoutDuration: z + .any() + .transform((d: Temporal.Duration) => + d.toString().slice(2).toLowerCase() + ), + }), + z.object({$case: z.literal('noSuspension'), noSuspension: z.boolean()}), + ]) .optional(), - default: z.boolean().optional(), + settings: z.lazy(() => marshalCreateEndpointSettingsSchema).optional(), + group: z.lazy(() => marshalCreateEndpointGroupSpecSchema).optional(), + }) + .transform(d => ({ + endpoint_type: d.endpointType, + autoscaling_limit_min_cu: d.autoscalingLimitMinCu, + autoscaling_limit_max_cu: d.autoscalingLimitMaxCu, + disabled: d.disabled, + ...(d.suspension?.$case === 'suspendTimeoutDuration' && { + suspend_timeout_duration: d.suspension.suspendTimeoutDuration, + }), + ...(d.suspension?.$case === 'noSuspension' && { + no_suspension: d.suspension.noSuspension, + }), + settings: d.settings, + group: d.group, + })); + +export const marshalCreateInitialBranchSpecSchema: z.ZodType = z + .object({ isProtected: z.boolean().optional(), - currentState: z.string().optional(), - pendingState: z.string().optional(), - stateChangeTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + }) + .transform(d => ({ + is_protected: d.isProtected, + })); + +export const marshalCreateInitialEndpointSpecSchema: z.ZodType = z + .object({ + group: z.lazy(() => marshalCreateEndpointGroupSpecSchema).optional(), + autoscalingLimitMinCu: z.number().optional(), + autoscalingLimitMaxCu: z.number().optional(), + suspension: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('suspendTimeoutDuration'), + suspendTimeoutDuration: z + .any() + .transform((d: Temporal.Duration) => + d.toString().slice(2).toLowerCase() + ), + }), + z.object({$case: z.literal('noSuspension'), noSuspension: z.boolean()}), + ]) .optional(), - logicalSizeBytes: z.bigint().optional(), - expireTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + }) + .transform(d => ({ + group: d.group, + autoscaling_limit_min_cu: d.autoscalingLimitMinCu, + autoscaling_limit_max_cu: d.autoscalingLimitMaxCu, + ...(d.suspension?.$case === 'suspendTimeoutDuration' && { + suspend_timeout_duration: d.suspension.suspendTimeoutDuration, + }), + ...(d.suspension?.$case === 'noSuspension' && { + no_suspension: d.suspension.noSuspension, + }), + })); + +export const marshalCreateNewPipelineSpecSchema: z.ZodType = z + .object({ + storageCatalog: z.string().optional(), + storageSchema: z.string().optional(), + budgetPolicyId: z.string().optional(), + }) + .transform(d => ({ + storage_catalog: d.storageCatalog, + storage_schema: d.storageSchema, + budget_policy_id: d.budgetPolicyId, + })); + +export const marshalCreateProjectSchema: z.ZodType = z + .object({ + name: z.string().optional(), + spec: z.lazy(() => marshalCreateProjectSpecSchema).optional(), + initialEndpointSpec: z + .lazy(() => marshalCreateInitialEndpointSpecSchema) + .optional(), + initialBranchSpec: z + .lazy(() => marshalCreateInitialBranchSpecSchema) + .optional(), + }) + .transform(d => ({ + name: d.name, + spec: d.spec, + initial_endpoint_spec: d.initialEndpointSpec, + initial_branch_spec: d.initialBranchSpec, + })); + +export const marshalCreateProjectCustomTagSchema: z.ZodType = z + .object({ + key: z.string().optional(), + value: z.string().optional(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); + +export const marshalCreateProjectDefaultEndpointSettingsSchema: z.ZodType = z + .object({ + autoscalingLimitMinCu: z.number().optional(), + autoscalingLimitMaxCu: z.number().optional(), + suspension: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('suspendTimeoutDuration'), + suspendTimeoutDuration: z + .any() + .transform((d: Temporal.Duration) => + d.toString().slice(2).toLowerCase() + ), + }), + z.object({$case: z.literal('noSuspension'), noSuspension: z.boolean()}), + ]) .optional(), - branchId: z.string().optional(), - deleteTime: z + pgSettings: z.record(z.string(), z.string()).optional(), + }) + .transform(d => ({ + autoscaling_limit_min_cu: d.autoscalingLimitMinCu, + autoscaling_limit_max_cu: d.autoscalingLimitMaxCu, + ...(d.suspension?.$case === 'suspendTimeoutDuration' && { + suspend_timeout_duration: d.suspension.suspendTimeoutDuration, + }), + ...(d.suspension?.$case === 'noSuspension' && { + no_suspension: d.suspension.noSuspension, + }), + pg_settings: d.pgSettings, + })); + +export const marshalCreateProjectSpecSchema: z.ZodType = z + .object({ + displayName: z.string().optional(), + pgVersion: z.number().optional(), + historyRetentionDuration: z .any() - .transform((d: Temporal.Instant) => d.toString()) + .transform((d: Temporal.Duration) => d.toString().slice(2).toLowerCase()) + .optional(), + defaultEndpointSettings: z + .lazy(() => marshalCreateProjectDefaultEndpointSettingsSchema) .optional(), - purgeTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + budgetPolicyId: z.string().optional(), + customTags: z + .array(z.lazy(() => marshalCreateProjectCustomTagSchema)) .optional(), + enablePgNativeLogin: z.boolean().optional(), + defaultBranch: z.string().optional(), }) .transform(d => ({ - source_branch: d.sourceBranch, - source_branch_lsn: d.sourceBranchLsn, - source_branch_time: d.sourceBranchTime, - default: d.default, - is_protected: d.isProtected, - current_state: d.currentState, - pending_state: d.pendingState, - state_change_time: d.stateChangeTime, - logical_size_bytes: d.logicalSizeBytes, - expire_time: d.expireTime, - branch_id: d.branchId, - delete_time: d.deleteTime, - purge_time: d.purgeTime, + display_name: d.displayName, + pg_version: d.pgVersion, + history_retention_duration: d.historyRetentionDuration, + default_endpoint_settings: d.defaultEndpointSettings, + budget_policy_id: d.budgetPolicyId, + custom_tags: d.customTags, + enable_pg_native_login: d.enablePgNativeLogin, + default_branch: d.defaultBranch, })); -export const marshalCatalogSchema: z.ZodType = z +export const marshalCreateRequestedClaimsSchema: z.ZodType = z .object({ - name: z.string().optional(), - uid: z.string().optional(), - spec: z.lazy(() => marshalCatalog_CatalogSpecSchema).optional(), - status: z.lazy(() => marshalCatalog_CatalogStatusSchema).optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + permissionSet: z.string().optional(), + resources: z + .array(z.lazy(() => marshalCreateRequestedResourceSchema)) .optional(), - catalogId: z.string().optional(), }) .transform(d => ({ - name: d.name, - uid: d.uid, - spec: d.spec, - status: d.status, - create_time: d.createTime, - update_time: d.updateTime, - catalog_id: d.catalogId, + permission_set: d.permissionSet, + resources: d.resources, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCatalog_CatalogSpecSchema: z.ZodType = z +export const marshalCreateRequestedResourceSchema: z.ZodType = z .object({ - postgresDatabase: z.string().optional(), - createDatabaseIfMissing: z.boolean().optional(), - branch: z.string().optional(), + resourceName: z + .discriminatedUnion('$case', [ + z.object({$case: z.literal('tableName'), tableName: z.string()}), + ]) + .optional(), }) .transform(d => ({ - postgres_database: d.postgresDatabase, - create_database_if_missing: d.createDatabaseIfMissing, - branch: d.branch, + ...(d.resourceName?.$case === 'tableName' && { + table_name: d.resourceName.tableName, + }), })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCatalog_CatalogStatusSchema: z.ZodType = z +export const marshalCreateRoleSchema: z.ZodType = z .object({ - postgresDatabase: z.string().optional(), - project: z.string().optional(), - branch: z.string().optional(), + name: z.string().optional(), + spec: z.lazy(() => marshalRole_CreateRoleSpecSchema).optional(), }) .transform(d => ({ - postgres_database: d.postgresDatabase, - project: d.project, - branch: d.branch, + name: d.name, + spec: d.spec, })); -export const marshalDataApiSchema: z.ZodType = z +export const marshalCreateSyncedTableSchema: z.ZodType = z .object({ name: z.string().optional(), - parent: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + spec: z + .lazy(() => marshalSyncedTable_CreateSyncedTableSpecSchema) .optional(), - spec: z.lazy(() => marshalDataApi_DataApiSpecSchema).optional(), - status: z.lazy(() => marshalDataApi_DataApiStatusSchema).optional(), }) .transform(d => ({ name: d.name, - parent: d.parent, - create_time: d.createTime, - update_time: d.updateTime, spec: d.spec, - status: d.status, })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDataApi_DataApiSpecSchema: z.ZodType = z +export const marshalDataApi_CreateDataApiSpecSchema: z.ZodType = z .object({ dbAggregatesEnabled: z.boolean().optional(), dbExtraSearchPath: z.array(z.string()).optional(), @@ -3595,7 +4498,7 @@ export const marshalDataApi_DataApiSpecSchema: z.ZodType = z })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDataApi_DataApiStatusSchema: z.ZodType = z +export const marshalDataApi_UpdateDataApiSpecSchema: z.ZodType = z .object({ dbAggregatesEnabled: z.boolean().optional(), dbExtraSearchPath: z.array(z.string()).optional(), @@ -3609,8 +4512,6 @@ export const marshalDataApi_DataApiStatusSchema: z.ZodType = z openapiMode: z.string().optional(), serverCorsAllowedOrigins: z.array(z.string()).optional(), serverTimingEnabled: z.boolean().optional(), - url: z.string().optional(), - availableSchemas: z.array(z.string()).optional(), }) .transform(d => ({ db_aggregates_enabled: d.dbAggregatesEnabled, @@ -3622,38 +4523,10 @@ export const marshalDataApi_DataApiStatusSchema: z.ZodType = z openapi_mode: d.openapiMode, server_cors_allowed_origins: d.serverCorsAllowedOrigins, server_timing_enabled: d.serverTimingEnabled, - url: d.url, - available_schemas: d.availableSchemas, - })); - -export const marshalDatabaseSchema: z.ZodType = z - .object({ - name: z.string().optional(), - parent: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - spec: z.lazy(() => marshalDatabase_DatabaseSpecSchema).optional(), - status: z.lazy(() => marshalDatabase_DatabaseStatusSchema).optional(), - databaseId: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - parent: d.parent, - create_time: d.createTime, - update_time: d.updateTime, - spec: d.spec, - status: d.status, - database_id: d.databaseId, })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDatabase_DatabaseSpecSchema: z.ZodType = z +export const marshalDatabase_CreateDatabaseSpecSchema: z.ZodType = z .object({ role: z.string().optional(), postgresDatabase: z.string().optional(), @@ -3664,286 +4537,284 @@ export const marshalDatabase_DatabaseSpecSchema: z.ZodType = z })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDatabase_DatabaseStatusSchema: z.ZodType = z +export const marshalDatabase_UpdateDatabaseSpecSchema: z.ZodType = z .object({ role: z.string().optional(), postgresDatabase: z.string().optional(), - databaseId: z.string().optional(), }) .transform(d => ({ role: d.role, postgres_database: d.postgresDatabase, - database_id: d.databaseId, - })); - -export const marshalDeltaTableSyncInfoSchema: z.ZodType = z - .object({ - deltaCommitVersion: z.bigint().optional(), - deltaCommitTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - }) - .transform(d => ({ - delta_commit_version: d.deltaCommitVersion, - delta_commit_time: d.deltaCommitTime, })); -export const marshalEndpointSchema: z.ZodType = z +export const marshalGenerateDatabaseCredentialRequestSchema: z.ZodType = z .object({ - name: z.string().optional(), - uid: z.string().optional(), - parent: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + claims: z + .array(z.lazy(() => marshalCreateRequestedClaimsSchema)) .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + endpoint: z.string().optional(), + groupName: z.string().optional(), + expiration: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('ttl'), + ttl: z + .any() + .transform((d: Temporal.Duration) => + d.toString().slice(2).toLowerCase() + ), + }), + z.object({ + $case: z.literal('expireTime'), + expireTime: z.any().transform((d: Temporal.Instant) => d.toString()), + }), + ]) .optional(), - spec: z.lazy(() => marshalEndpointSpecSchema).optional(), - status: z.lazy(() => marshalEndpointStatusSchema).optional(), - endpointId: z.string().optional(), }) .transform(d => ({ - name: d.name, - uid: d.uid, - parent: d.parent, - create_time: d.createTime, - update_time: d.updateTime, - spec: d.spec, - status: d.status, - endpoint_id: d.endpointId, + claims: d.claims, + endpoint: d.endpoint, + group_name: d.groupName, + ...(d.expiration?.$case === 'ttl' && {ttl: d.expiration.ttl}), + ...(d.expiration?.$case === 'expireTime' && { + expire_time: d.expiration.expireTime, + }), })); -export const marshalEndpointGroupSpecSchema: z.ZodType = z +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalRole_CreateAttributesSchema: z.ZodType = z .object({ - min: z.number().optional(), - max: z.number().optional(), - enableReadableSecondaries: z.boolean().optional(), + createdb: z.boolean().optional(), + createrole: z.boolean().optional(), + bypassrls: z.boolean().optional(), }) .transform(d => ({ - min: d.min, - max: d.max, - enable_readable_secondaries: d.enableReadableSecondaries, + createdb: d.createdb, + createrole: d.createrole, + bypassrls: d.bypassrls, })); -export const marshalEndpointGroupStatusSchema: z.ZodType = z +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalRole_CreateRoleSpecSchema: z.ZodType = z .object({ - min: z.number().optional(), - max: z.number().optional(), - enableReadableSecondaries: z.boolean().optional(), + membershipRoles: z.array(z.string()).optional(), + identityType: z.string().optional(), + attributes: z.lazy(() => marshalRole_CreateAttributesSchema).optional(), + authMethod: z.string().optional(), + postgresRole: z.string().optional(), }) .transform(d => ({ - min: d.min, - max: d.max, - enable_readable_secondaries: d.enableReadableSecondaries, + membership_roles: d.membershipRoles, + identity_type: d.identityType, + attributes: d.attributes, + auth_method: d.authMethod, + postgres_role: d.postgresRole, })); -export const marshalEndpointHostsSchema: z.ZodType = z +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalRole_UpdateAttributesSchema: z.ZodType = z .object({ - host: z.string().optional(), - readOnlyHost: z.string().optional(), + createdb: z.boolean().optional(), + createrole: z.boolean().optional(), + bypassrls: z.boolean().optional(), }) .transform(d => ({ - host: d.host, - read_only_host: d.readOnlyHost, + createdb: d.createdb, + createrole: d.createrole, + bypassrls: d.bypassrls, })); -export const marshalEndpointSettingsSchema: z.ZodType = z +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalRole_UpdateRoleSpecSchema: z.ZodType = z .object({ - pgSettings: z.record(z.string(), z.string()).optional(), + membershipRoles: z.array(z.string()).optional(), + identityType: z.string().optional(), + attributes: z.lazy(() => marshalRole_UpdateAttributesSchema).optional(), + authMethod: z.string().optional(), + postgresRole: z.string().optional(), }) .transform(d => ({ - pg_settings: d.pgSettings, + membership_roles: d.membershipRoles, + identity_type: d.identityType, + attributes: d.attributes, + auth_method: d.authMethod, + postgres_role: d.postgresRole, })); -export const marshalEndpointSpecSchema: z.ZodType = z +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalSyncedTable_CreateSyncedTableSpecSchema: z.ZodType = z .object({ - endpointType: z.string().optional(), - autoscalingLimitMinCu: z.number().optional(), - autoscalingLimitMaxCu: z.number().optional(), - disabled: z.boolean().optional(), - suspension: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('suspendTimeoutDuration'), - suspendTimeoutDuration: z - .any() - .transform((d: Temporal.Duration) => - d.toString().slice(2).toLowerCase() - ), - }), - z.object({$case: z.literal('noSuspension'), noSuspension: z.boolean()}), - ]) + postgresDatabase: z.string().optional(), + branch: z.string().optional(), + schedulingPolicy: z.string().optional(), + sourceTableFullName: z.string().optional(), + primaryKeyColumns: z.array(z.string()).optional(), + timeseriesKey: z.string().optional(), + existingPipelineId: z.string().optional(), + createDatabaseObjectsIfMissing: z.boolean().optional(), + newPipelineSpec: z + .lazy(() => marshalCreateNewPipelineSpecSchema) + .optional(), + acceleratedSync: z.boolean().optional(), + typeOverrides: z + .array( + z.lazy( + () => marshalSyncedTable_SyncedTableSpec_CreateTypeOverrideSchema + ) + ) .optional(), - settings: z.lazy(() => marshalEndpointSettingsSchema).optional(), - group: z.lazy(() => marshalEndpointGroupSpecSchema).optional(), }) .transform(d => ({ - endpoint_type: d.endpointType, - autoscaling_limit_min_cu: d.autoscalingLimitMinCu, - autoscaling_limit_max_cu: d.autoscalingLimitMaxCu, - disabled: d.disabled, - ...(d.suspension?.$case === 'suspendTimeoutDuration' && { - suspend_timeout_duration: d.suspension.suspendTimeoutDuration, - }), - ...(d.suspension?.$case === 'noSuspension' && { - no_suspension: d.suspension.noSuspension, - }), - settings: d.settings, - group: d.group, + postgres_database: d.postgresDatabase, + branch: d.branch, + scheduling_policy: d.schedulingPolicy, + source_table_full_name: d.sourceTableFullName, + primary_key_columns: d.primaryKeyColumns, + timeseries_key: d.timeseriesKey, + existing_pipeline_id: d.existingPipelineId, + create_database_objects_if_missing: d.createDatabaseObjectsIfMissing, + new_pipeline_spec: d.newPipelineSpec, + accelerated_sync: d.acceleratedSync, + type_overrides: d.typeOverrides, })); -export const marshalEndpointStatusSchema: z.ZodType = z +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const marshalSyncedTable_SyncedTableSpec_CreateTypeOverrideSchema: z.ZodType = + z + .object({ + columnName: z.string(), + pgType: z.string(), + size: z.number().optional(), + }) + .transform(d => ({ + column_name: d.columnName, + pg_type: d.pgType, + size: d.size, + })); + +export const marshalUndeleteBranchRequestSchema: z.ZodType = z .object({ - endpointType: z.string().optional(), - hosts: z.lazy(() => marshalEndpointHostsSchema).optional(), - autoscalingLimitMinCu: z.number().optional(), - autoscalingLimitMaxCu: z.number().optional(), - currentState: z.string().optional(), - pendingState: z.string().optional(), - disabled: z.boolean().optional(), - suspendTimeoutDuration: z - .any() - .transform((d: Temporal.Duration) => d.toString().slice(2).toLowerCase()) - .optional(), - settings: z.lazy(() => marshalEndpointSettingsSchema).optional(), - group: z.lazy(() => marshalEndpointGroupStatusSchema).optional(), - endpointId: z.string().optional(), + name: z.string().optional(), }) - .transform(d => ({ - endpoint_type: d.endpointType, - hosts: d.hosts, - autoscaling_limit_min_cu: d.autoscalingLimitMinCu, - autoscaling_limit_max_cu: d.autoscalingLimitMaxCu, - current_state: d.currentState, - pending_state: d.pendingState, - disabled: d.disabled, - suspend_timeout_duration: d.suspendTimeoutDuration, - settings: d.settings, - group: d.group, - endpoint_id: d.endpointId, + .transform(d => ({ + name: d.name, })); -export const marshalGenerateDatabaseCredentialRequestSchema: z.ZodType = z +export const marshalUndeleteProjectRequestSchema: z.ZodType = z .object({ - claims: z.array(z.lazy(() => marshalRequestedClaimsSchema)).optional(), - endpoint: z.string().optional(), + name: z.string().optional(), }) .transform(d => ({ - claims: d.claims, - endpoint: d.endpoint, + name: d.name, })); -export const marshalInitialBranchSpecSchema: z.ZodType = z +export const marshalUpdateBranchSchema: z.ZodType = z .object({ - isProtected: z.boolean().optional(), + name: z.string().optional(), + spec: z.lazy(() => marshalUpdateBranchSpecSchema).optional(), }) .transform(d => ({ - is_protected: d.isProtected, + name: d.name, + spec: d.spec, })); -export const marshalInitialEndpointSpecSchema: z.ZodType = z +export const marshalUpdateBranchSpecSchema: z.ZodType = z .object({ - group: z.lazy(() => marshalEndpointGroupSpecSchema).optional(), - autoscalingLimitMinCu: z.number().optional(), - autoscalingLimitMaxCu: z.number().optional(), - suspension: z + sourceBranch: z.string().optional(), + sourceBranchLsn: z.string().optional(), + sourceBranchTime: z + .any() + .transform((d: Temporal.Instant) => d.toString()) + .optional(), + isProtected: z.boolean().optional(), + expiration: z .discriminatedUnion('$case', [ z.object({ - $case: z.literal('suspendTimeoutDuration'), - suspendTimeoutDuration: z + $case: z.literal('expireTime'), + expireTime: z.any().transform((d: Temporal.Instant) => d.toString()), + }), + z.object({ + $case: z.literal('ttl'), + ttl: z .any() .transform((d: Temporal.Duration) => d.toString().slice(2).toLowerCase() ), }), - z.object({$case: z.literal('noSuspension'), noSuspension: z.boolean()}), + z.object({$case: z.literal('noExpiry'), noExpiry: z.boolean()}), ]) .optional(), }) .transform(d => ({ - group: d.group, - autoscaling_limit_min_cu: d.autoscalingLimitMinCu, - autoscaling_limit_max_cu: d.autoscalingLimitMaxCu, - ...(d.suspension?.$case === 'suspendTimeoutDuration' && { - suspend_timeout_duration: d.suspension.suspendTimeoutDuration, + source_branch: d.sourceBranch, + source_branch_lsn: d.sourceBranchLsn, + source_branch_time: d.sourceBranchTime, + is_protected: d.isProtected, + ...(d.expiration?.$case === 'expireTime' && { + expire_time: d.expiration.expireTime, }), - ...(d.suspension?.$case === 'noSuspension' && { - no_suspension: d.suspension.noSuspension, + ...(d.expiration?.$case === 'ttl' && {ttl: d.expiration.ttl}), + ...(d.expiration?.$case === 'noExpiry' && { + no_expiry: d.expiration.noExpiry, }), })); -export const marshalNewPipelineSpecSchema: z.ZodType = z +export const marshalUpdateDataApiSchema: z.ZodType = z .object({ - storageCatalog: z.string().optional(), - storageSchema: z.string().optional(), - budgetPolicyId: z.string().optional(), + name: z.string().optional(), + spec: z.lazy(() => marshalDataApi_UpdateDataApiSpecSchema).optional(), }) .transform(d => ({ - storage_catalog: d.storageCatalog, - storage_schema: d.storageSchema, - budget_policy_id: d.budgetPolicyId, + name: d.name, + spec: d.spec, })); -export const marshalProjectSchema: z.ZodType = z +export const marshalUpdateDatabaseSchema: z.ZodType = z .object({ name: z.string().optional(), - uid: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - spec: z.lazy(() => marshalProjectSpecSchema).optional(), - status: z.lazy(() => marshalProjectStatusSchema).optional(), - initialEndpointSpec: z - .lazy(() => marshalInitialEndpointSpecSchema) - .optional(), - deleteTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - purgeTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - initialBranchSpec: z.lazy(() => marshalInitialBranchSpecSchema).optional(), - projectId: z.string().optional(), + spec: z.lazy(() => marshalDatabase_UpdateDatabaseSpecSchema).optional(), }) .transform(d => ({ name: d.name, - uid: d.uid, - create_time: d.createTime, - update_time: d.updateTime, spec: d.spec, - status: d.status, - initial_endpoint_spec: d.initialEndpointSpec, - delete_time: d.deleteTime, - purge_time: d.purgeTime, - initial_branch_spec: d.initialBranchSpec, - project_id: d.projectId, })); -export const marshalProjectCustomTagSchema: z.ZodType = z +export const marshalUpdateEndpointSchema: z.ZodType = z .object({ - key: z.string().optional(), - value: z.string().optional(), + name: z.string().optional(), + spec: z.lazy(() => marshalUpdateEndpointSpecSchema).optional(), }) .transform(d => ({ - key: d.key, - value: d.value, + name: d.name, + spec: d.spec, + })); + +export const marshalUpdateEndpointGroupSpecSchema: z.ZodType = z + .object({ + min: z.number().optional(), + max: z.number().optional(), + enableReadableSecondaries: z.boolean().optional(), + }) + .transform(d => ({ + min: d.min, + max: d.max, + enable_readable_secondaries: d.enableReadableSecondaries, + })); + +export const marshalUpdateEndpointSettingsSchema: z.ZodType = z + .object({ + pgSettings: z.record(z.string(), z.string()).optional(), + }) + .transform(d => ({ + pg_settings: d.pgSettings, })); -export const marshalProjectDefaultEndpointSettingsSchema: z.ZodType = z +export const marshalUpdateEndpointSpecSchema: z.ZodType = z .object({ + endpointType: z.string().optional(), autoscalingLimitMinCu: z.number().optional(), autoscalingLimitMaxCu: z.number().optional(), + disabled: z.boolean().optional(), suspension: z .discriminatedUnion('$case', [ z.object({ @@ -3957,404 +4828,163 @@ export const marshalProjectDefaultEndpointSettingsSchema: z.ZodType = z z.object({$case: z.literal('noSuspension'), noSuspension: z.boolean()}), ]) .optional(), - pgSettings: z.record(z.string(), z.string()).optional(), + settings: z.lazy(() => marshalUpdateEndpointSettingsSchema).optional(), + group: z.lazy(() => marshalUpdateEndpointGroupSpecSchema).optional(), }) .transform(d => ({ + endpoint_type: d.endpointType, autoscaling_limit_min_cu: d.autoscalingLimitMinCu, autoscaling_limit_max_cu: d.autoscalingLimitMaxCu, + disabled: d.disabled, ...(d.suspension?.$case === 'suspendTimeoutDuration' && { suspend_timeout_duration: d.suspension.suspendTimeoutDuration, }), ...(d.suspension?.$case === 'noSuspension' && { no_suspension: d.suspension.noSuspension, }), - pg_settings: d.pgSettings, - })); - -export const marshalProjectSpecSchema: z.ZodType = z - .object({ - displayName: z.string().optional(), - pgVersion: z.number().optional(), - historyRetentionDuration: z - .any() - .transform((d: Temporal.Duration) => d.toString().slice(2).toLowerCase()) - .optional(), - defaultEndpointSettings: z - .lazy(() => marshalProjectDefaultEndpointSettingsSchema) - .optional(), - budgetPolicyId: z.string().optional(), - customTags: z.array(z.lazy(() => marshalProjectCustomTagSchema)).optional(), - enablePgNativeLogin: z.boolean().optional(), - defaultBranch: z.string().optional(), - }) - .transform(d => ({ - display_name: d.displayName, - pg_version: d.pgVersion, - history_retention_duration: d.historyRetentionDuration, - default_endpoint_settings: d.defaultEndpointSettings, - budget_policy_id: d.budgetPolicyId, - custom_tags: d.customTags, - enable_pg_native_login: d.enablePgNativeLogin, - default_branch: d.defaultBranch, - })); - -export const marshalProjectStatusSchema: z.ZodType = z - .object({ - displayName: z.string().optional(), - pgVersion: z.number().optional(), - historyRetentionDuration: z - .any() - .transform((d: Temporal.Duration) => d.toString().slice(2).toLowerCase()) - .optional(), - defaultEndpointSettings: z - .lazy(() => marshalProjectDefaultEndpointSettingsSchema) - .optional(), - branchLogicalSizeLimitBytes: z.bigint().optional(), - syntheticStorageSizeBytes: z.bigint().optional(), - computeLastActiveTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - budgetPolicyId: z.string().optional(), - customTags: z.array(z.lazy(() => marshalProjectCustomTagSchema)).optional(), - owner: z.string().optional(), - enablePgNativeLogin: z.boolean().optional(), - defaultBranch: z.string().optional(), - projectId: z.string().optional(), - }) - .transform(d => ({ - display_name: d.displayName, - pg_version: d.pgVersion, - history_retention_duration: d.historyRetentionDuration, - default_endpoint_settings: d.defaultEndpointSettings, - branch_logical_size_limit_bytes: d.branchLogicalSizeLimitBytes, - synthetic_storage_size_bytes: d.syntheticStorageSizeBytes, - compute_last_active_time: d.computeLastActiveTime, - budget_policy_id: d.budgetPolicyId, - custom_tags: d.customTags, - owner: d.owner, - enable_pg_native_login: d.enablePgNativeLogin, - default_branch: d.defaultBranch, - project_id: d.projectId, - })); - -export const marshalRequestedClaimsSchema: z.ZodType = z - .object({ - permissionSet: z.string().optional(), - resources: z.array(z.lazy(() => marshalRequestedResourceSchema)).optional(), - }) - .transform(d => ({ - permission_set: d.permissionSet, - resources: d.resources, - })); - -export const marshalRequestedResourceSchema: z.ZodType = z - .object({ - resourceName: z - .discriminatedUnion('$case', [ - z.object({$case: z.literal('tableName'), tableName: z.string()}), - ]) - .optional(), - }) - .transform(d => ({ - ...(d.resourceName?.$case === 'tableName' && { - table_name: d.resourceName.tableName, - }), - })); - -export const marshalRoleSchema: z.ZodType = z - .object({ - name: z.string().optional(), - parent: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - spec: z.lazy(() => marshalRole_RoleSpecSchema).optional(), - status: z.lazy(() => marshalRole_RoleStatusSchema).optional(), - roleId: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - parent: d.parent, - create_time: d.createTime, - update_time: d.updateTime, - spec: d.spec, - status: d.status, - role_id: d.roleId, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalRole_AttributesSchema: z.ZodType = z - .object({ - createdb: z.boolean().optional(), - createrole: z.boolean().optional(), - bypassrls: z.boolean().optional(), - }) - .transform(d => ({ - createdb: d.createdb, - createrole: d.createrole, - bypassrls: d.bypassrls, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalRole_RoleSpecSchema: z.ZodType = z - .object({ - membershipRoles: z.array(z.string()).optional(), - identityType: z.string().optional(), - attributes: z.lazy(() => marshalRole_AttributesSchema).optional(), - authMethod: z.string().optional(), - postgresRole: z.string().optional(), - }) - .transform(d => ({ - membership_roles: d.membershipRoles, - identity_type: d.identityType, - attributes: d.attributes, - auth_method: d.authMethod, - postgres_role: d.postgresRole, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalRole_RoleStatusSchema: z.ZodType = z - .object({ - membershipRoles: z.array(z.string()).optional(), - identityType: z.string().optional(), - attributes: z.lazy(() => marshalRole_AttributesSchema).optional(), - authMethod: z.string().optional(), - postgresRole: z.string().optional(), - roleId: z.string().optional(), - }) - .transform(d => ({ - membership_roles: d.membershipRoles, - identity_type: d.identityType, - attributes: d.attributes, - auth_method: d.authMethod, - postgres_role: d.postgresRole, - role_id: d.roleId, + settings: d.settings, + group: d.group, })); -export const marshalSyncedTableSchema: z.ZodType = z +export const marshalUpdateInitialBranchSpecSchema: z.ZodType = z .object({ - name: z.string().optional(), - uid: z.string().optional(), - spec: z.lazy(() => marshalSyncedTable_SyncedTableSpecSchema).optional(), - status: z.lazy(() => marshalSyncedTable_SyncedTableStatusSchema).optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - syncedTableId: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - uid: d.uid, - spec: d.spec, - status: d.status, - create_time: d.createTime, - synced_table_id: d.syncedTableId, + isProtected: z.boolean().optional(), + }) + .transform(d => ({ + is_protected: d.isProtected, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalSyncedTable_SyncedTableSpecSchema: z.ZodType = z +export const marshalUpdateInitialEndpointSpecSchema: z.ZodType = z .object({ - postgresDatabase: z.string().optional(), - branch: z.string().optional(), - schedulingPolicy: z.string().optional(), - sourceTableFullName: z.string().optional(), - primaryKeyColumns: z.array(z.string()).optional(), - timeseriesKey: z.string().optional(), - existingPipelineId: z.string().optional(), - createDatabaseObjectsIfMissing: z.boolean().optional(), - newPipelineSpec: z.lazy(() => marshalNewPipelineSpecSchema).optional(), - acceleratedSync: z.boolean().optional(), - typeOverrides: z - .array( - z.lazy(() => marshalSyncedTable_SyncedTableSpec_TypeOverrideSchema) - ) + group: z.lazy(() => marshalUpdateEndpointGroupSpecSchema).optional(), + autoscalingLimitMinCu: z.number().optional(), + autoscalingLimitMaxCu: z.number().optional(), + suspension: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('suspendTimeoutDuration'), + suspendTimeoutDuration: z + .any() + .transform((d: Temporal.Duration) => + d.toString().slice(2).toLowerCase() + ), + }), + z.object({$case: z.literal('noSuspension'), noSuspension: z.boolean()}), + ]) .optional(), }) .transform(d => ({ - postgres_database: d.postgresDatabase, - branch: d.branch, - scheduling_policy: d.schedulingPolicy, - source_table_full_name: d.sourceTableFullName, - primary_key_columns: d.primaryKeyColumns, - timeseries_key: d.timeseriesKey, - existing_pipeline_id: d.existingPipelineId, - create_database_objects_if_missing: d.createDatabaseObjectsIfMissing, - new_pipeline_spec: d.newPipelineSpec, - accelerated_sync: d.acceleratedSync, - type_overrides: d.typeOverrides, + group: d.group, + autoscaling_limit_min_cu: d.autoscalingLimitMinCu, + autoscaling_limit_max_cu: d.autoscalingLimitMaxCu, + ...(d.suspension?.$case === 'suspendTimeoutDuration' && { + suspend_timeout_duration: d.suspension.suspendTimeoutDuration, + }), + ...(d.suspension?.$case === 'noSuspension' && { + no_suspension: d.suspension.noSuspension, + }), })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalSyncedTable_SyncedTableSpec_TypeOverrideSchema: z.ZodType = - z - .object({ - columnName: z.string().optional(), - pgType: z.string().optional(), - size: z.number().optional(), - }) - .transform(d => ({ - column_name: d.columnName, - pg_type: d.pgType, - size: d.size, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalSyncedTable_SyncedTableStatusSchema: z.ZodType = z +export const marshalUpdateProjectSchema: z.ZodType = z .object({ - message: z.string().optional(), - detailedState: z.string().optional(), - lastSync: z.lazy(() => marshalSyncedTablePositionSchema).optional(), - ongoingSyncProgress: z - .lazy(() => marshalSyncedTablePipelineProgressSchema) + name: z.string().optional(), + spec: z.lazy(() => marshalUpdateProjectSpecSchema).optional(), + initialEndpointSpec: z + .lazy(() => marshalUpdateInitialEndpointSpecSchema) .optional(), - provisioningPhase: z.string().optional(), - lastProcessedCommitVersion: z.bigint().optional(), - lastSyncTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + initialBranchSpec: z + .lazy(() => marshalUpdateInitialBranchSpecSchema) .optional(), - pipelineId: z.string().optional(), - unityCatalogProvisioningState: z.string().optional(), - project: z.string().optional(), }) .transform(d => ({ - message: d.message, - detailed_state: d.detailedState, - last_sync: d.lastSync, - ongoing_sync_progress: d.ongoingSyncProgress, - provisioning_phase: d.provisioningPhase, - last_processed_commit_version: d.lastProcessedCommitVersion, - last_sync_time: d.lastSyncTime, - pipeline_id: d.pipelineId, - unity_catalog_provisioning_state: d.unityCatalogProvisioningState, - project: d.project, + name: d.name, + spec: d.spec, + initial_endpoint_spec: d.initialEndpointSpec, + initial_branch_spec: d.initialBranchSpec, })); -export const marshalSyncedTablePipelineProgressSchema: z.ZodType = z +export const marshalUpdateProjectCustomTagSchema: z.ZodType = z .object({ - latestVersionCurrentlyProcessing: z.bigint().optional(), - syncedRowCount: z.bigint().optional(), - totalRowCount: z.bigint().optional(), - syncProgressCompletion: z.number().optional(), - estimatedCompletionTimeSeconds: z.number().optional(), + key: z.string().optional(), + value: z.string().optional(), }) .transform(d => ({ - latest_version_currently_processing: d.latestVersionCurrentlyProcessing, - synced_row_count: d.syncedRowCount, - total_row_count: d.totalRowCount, - sync_progress_completion: d.syncProgressCompletion, - estimated_completion_time_seconds: d.estimatedCompletionTimeSeconds, + key: d.key, + value: d.value, })); -export const marshalSyncedTablePositionSchema: z.ZodType = z +export const marshalUpdateProjectDefaultEndpointSettingsSchema: z.ZodType = z .object({ - syncStartTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - syncEndTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - sourceSyncInfo: z + autoscalingLimitMinCu: z.number().optional(), + autoscalingLimitMaxCu: z.number().optional(), + suspension: z .discriminatedUnion('$case', [ z.object({ - $case: z.literal('deltaTableSyncInfo'), - deltaTableSyncInfo: z.lazy(() => marshalDeltaTableSyncInfoSchema), + $case: z.literal('suspendTimeoutDuration'), + suspendTimeoutDuration: z + .any() + .transform((d: Temporal.Duration) => + d.toString().slice(2).toLowerCase() + ), }), + z.object({$case: z.literal('noSuspension'), noSuspension: z.boolean()}), ]) .optional(), + pgSettings: z.record(z.string(), z.string()).optional(), }) .transform(d => ({ - sync_start_time: d.syncStartTime, - sync_end_time: d.syncEndTime, - ...(d.sourceSyncInfo?.$case === 'deltaTableSyncInfo' && { - delta_table_sync_info: d.sourceSyncInfo.deltaTableSyncInfo, + autoscaling_limit_min_cu: d.autoscalingLimitMinCu, + autoscaling_limit_max_cu: d.autoscalingLimitMaxCu, + ...(d.suspension?.$case === 'suspendTimeoutDuration' && { + suspend_timeout_duration: d.suspension.suspendTimeoutDuration, + }), + ...(d.suspension?.$case === 'noSuspension' && { + no_suspension: d.suspension.noSuspension, }), + pg_settings: d.pgSettings, })); -export const marshalUndeleteBranchRequestSchema: z.ZodType = z +export const marshalUpdateProjectSpecSchema: z.ZodType = z .object({ - name: z.string().optional(), + displayName: z.string().optional(), + pgVersion: z.number().optional(), + historyRetentionDuration: z + .any() + .transform((d: Temporal.Duration) => d.toString().slice(2).toLowerCase()) + .optional(), + defaultEndpointSettings: z + .lazy(() => marshalUpdateProjectDefaultEndpointSettingsSchema) + .optional(), + budgetPolicyId: z.string().optional(), + customTags: z + .array(z.lazy(() => marshalUpdateProjectCustomTagSchema)) + .optional(), + enablePgNativeLogin: z.boolean().optional(), + defaultBranch: z.string().optional(), }) .transform(d => ({ - name: d.name, + display_name: d.displayName, + pg_version: d.pgVersion, + history_retention_duration: d.historyRetentionDuration, + default_endpoint_settings: d.defaultEndpointSettings, + budget_policy_id: d.budgetPolicyId, + custom_tags: d.customTags, + enable_pg_native_login: d.enablePgNativeLogin, + default_branch: d.defaultBranch, })); -export const marshalUndeleteProjectRequestSchema: z.ZodType = z +export const marshalUpdateRoleSchema: z.ZodType = z .object({ name: z.string().optional(), + spec: z.lazy(() => marshalRole_UpdateRoleSpecSchema).optional(), }) .transform(d => ({ name: d.name, + spec: d.spec, })); -const branchFieldMaskSchema: FieldMaskSchema = { - branchId: {wire: 'branch_id'}, - createTime: {wire: 'create_time'}, - name: {wire: 'name'}, - parent: {wire: 'parent'}, - spec: {wire: 'spec', children: () => branchSpecFieldMaskSchema}, - status: {wire: 'status', children: () => branchStatusFieldMaskSchema}, - uid: {wire: 'uid'}, - updateTime: {wire: 'update_time'}, -}; - -export function branchFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, branchFieldMaskSchema); -} - -const branchSpecFieldMaskSchema: FieldMaskSchema = { - expireTime: {wire: 'expire_time'}, - isProtected: {wire: 'is_protected'}, - noExpiry: {wire: 'no_expiry'}, - sourceBranch: {wire: 'source_branch'}, - sourceBranchLsn: {wire: 'source_branch_lsn'}, - sourceBranchTime: {wire: 'source_branch_time'}, - ttl: {wire: 'ttl'}, -}; - -const branchStatusFieldMaskSchema: FieldMaskSchema = { - branchId: {wire: 'branch_id'}, - currentState: {wire: 'current_state'}, - default: {wire: 'default'}, - deleteTime: {wire: 'delete_time'}, - expireTime: {wire: 'expire_time'}, - isProtected: {wire: 'is_protected'}, - logicalSizeBytes: {wire: 'logical_size_bytes'}, - pendingState: {wire: 'pending_state'}, - purgeTime: {wire: 'purge_time'}, - sourceBranch: {wire: 'source_branch'}, - sourceBranchLsn: {wire: 'source_branch_lsn'}, - sourceBranchTime: {wire: 'source_branch_time'}, - stateChangeTime: {wire: 'state_change_time'}, -}; - -const dataApiFieldMaskSchema: FieldMaskSchema = { - createTime: {wire: 'create_time'}, - name: {wire: 'name'}, - parent: {wire: 'parent'}, - spec: {wire: 'spec', children: () => dataApi_DataApiSpecFieldMaskSchema}, - status: { - wire: 'status', - children: () => dataApi_DataApiStatusFieldMaskSchema, - }, - updateTime: {wire: 'update_time'}, -}; - -export function dataApiFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, dataApiFieldMaskSchema); -} - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -const dataApi_DataApiSpecFieldMaskSchema: FieldMaskSchema = { +const dataApi_UpdateDataApiSpecFieldMaskSchema: FieldMaskSchema = { dbAggregatesEnabled: {wire: 'db_aggregates_enabled'}, dbExtraSearchPath: {wire: 'db_extra_search_path'}, dbMaxRows: {wire: 'db_max_rows'}, @@ -4367,148 +4997,152 @@ const dataApi_DataApiSpecFieldMaskSchema: FieldMaskSchema = { }; // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -const dataApi_DataApiStatusFieldMaskSchema: FieldMaskSchema = { - availableSchemas: {wire: 'available_schemas'}, - dbAggregatesEnabled: {wire: 'db_aggregates_enabled'}, - dbExtraSearchPath: {wire: 'db_extra_search_path'}, - dbMaxRows: {wire: 'db_max_rows'}, - dbSchemas: {wire: 'db_schemas'}, - jwtCacheMaxLifetime: {wire: 'jwt_cache_max_lifetime'}, - jwtRoleClaimKey: {wire: 'jwt_role_claim_key'}, - openapiMode: {wire: 'openapi_mode'}, - serverCorsAllowedOrigins: {wire: 'server_cors_allowed_origins'}, - serverTimingEnabled: {wire: 'server_timing_enabled'}, - url: {wire: 'url'}, +const database_UpdateDatabaseSpecFieldMaskSchema: FieldMaskSchema = { + postgresDatabase: {wire: 'postgres_database'}, + role: {wire: 'role'}, }; -const databaseFieldMaskSchema: FieldMaskSchema = { - createTime: {wire: 'create_time'}, - databaseId: {wire: 'database_id'}, - name: {wire: 'name'}, - parent: {wire: 'parent'}, - spec: {wire: 'spec', children: () => database_DatabaseSpecFieldMaskSchema}, - status: { - wire: 'status', - children: () => database_DatabaseStatusFieldMaskSchema, +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +const role_UpdateAttributesFieldMaskSchema: FieldMaskSchema = { + bypassrls: {wire: 'bypassrls'}, + createdb: {wire: 'createdb'}, + createrole: {wire: 'createrole'}, +}; + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +const role_UpdateRoleSpecFieldMaskSchema: FieldMaskSchema = { + attributes: { + wire: 'attributes', + children: () => role_UpdateAttributesFieldMaskSchema, }, - updateTime: {wire: 'update_time'}, + authMethod: {wire: 'auth_method'}, + identityType: {wire: 'identity_type'}, + membershipRoles: {wire: 'membership_roles'}, + postgresRole: {wire: 'postgres_role'}, +}; + +const updateBranchFieldMaskSchema: FieldMaskSchema = { + name: {wire: 'name'}, + spec: {wire: 'spec', children: () => updateBranchSpecFieldMaskSchema}, }; -export function databaseFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, databaseFieldMaskSchema); +export function updateBranchFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, updateBranchFieldMaskSchema); } -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -const database_DatabaseSpecFieldMaskSchema: FieldMaskSchema = { - postgresDatabase: {wire: 'postgres_database'}, - role: {wire: 'role'}, +const updateBranchSpecFieldMaskSchema: FieldMaskSchema = { + expireTime: {wire: 'expire_time'}, + isProtected: {wire: 'is_protected'}, + noExpiry: {wire: 'no_expiry'}, + sourceBranch: {wire: 'source_branch'}, + sourceBranchLsn: {wire: 'source_branch_lsn'}, + sourceBranchTime: {wire: 'source_branch_time'}, + ttl: {wire: 'ttl'}, }; -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -const database_DatabaseStatusFieldMaskSchema: FieldMaskSchema = { - databaseId: {wire: 'database_id'}, - postgresDatabase: {wire: 'postgres_database'}, - role: {wire: 'role'}, +const updateDataApiFieldMaskSchema: FieldMaskSchema = { + name: {wire: 'name'}, + spec: { + wire: 'spec', + children: () => dataApi_UpdateDataApiSpecFieldMaskSchema, + }, }; -const endpointFieldMaskSchema: FieldMaskSchema = { - createTime: {wire: 'create_time'}, - endpointId: {wire: 'endpoint_id'}, +export function updateDataApiFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, updateDataApiFieldMaskSchema); +} + +const updateDatabaseFieldMaskSchema: FieldMaskSchema = { name: {wire: 'name'}, - parent: {wire: 'parent'}, - spec: {wire: 'spec', children: () => endpointSpecFieldMaskSchema}, - status: {wire: 'status', children: () => endpointStatusFieldMaskSchema}, - uid: {wire: 'uid'}, - updateTime: {wire: 'update_time'}, + spec: { + wire: 'spec', + children: () => database_UpdateDatabaseSpecFieldMaskSchema, + }, }; -export function endpointFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, endpointFieldMaskSchema); +export function updateDatabaseFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, updateDatabaseFieldMaskSchema); } -const endpointGroupSpecFieldMaskSchema: FieldMaskSchema = { - enableReadableSecondaries: {wire: 'enable_readable_secondaries'}, - max: {wire: 'max'}, - min: {wire: 'min'}, +const updateEndpointFieldMaskSchema: FieldMaskSchema = { + name: {wire: 'name'}, + spec: {wire: 'spec', children: () => updateEndpointSpecFieldMaskSchema}, }; -const endpointGroupStatusFieldMaskSchema: FieldMaskSchema = { +export function updateEndpointFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, updateEndpointFieldMaskSchema); +} + +const updateEndpointGroupSpecFieldMaskSchema: FieldMaskSchema = { enableReadableSecondaries: {wire: 'enable_readable_secondaries'}, max: {wire: 'max'}, min: {wire: 'min'}, }; -const endpointHostsFieldMaskSchema: FieldMaskSchema = { - host: {wire: 'host'}, - readOnlyHost: {wire: 'read_only_host'}, -}; - -const endpointSettingsFieldMaskSchema: FieldMaskSchema = { +const updateEndpointSettingsFieldMaskSchema: FieldMaskSchema = { pgSettings: {wire: 'pg_settings'}, }; -const endpointSpecFieldMaskSchema: FieldMaskSchema = { +const updateEndpointSpecFieldMaskSchema: FieldMaskSchema = { autoscalingLimitMaxCu: {wire: 'autoscaling_limit_max_cu'}, autoscalingLimitMinCu: {wire: 'autoscaling_limit_min_cu'}, disabled: {wire: 'disabled'}, endpointType: {wire: 'endpoint_type'}, - group: {wire: 'group', children: () => endpointGroupSpecFieldMaskSchema}, + group: { + wire: 'group', + children: () => updateEndpointGroupSpecFieldMaskSchema, + }, noSuspension: {wire: 'no_suspension'}, - settings: {wire: 'settings', children: () => endpointSettingsFieldMaskSchema}, - suspendTimeoutDuration: {wire: 'suspend_timeout_duration'}, -}; - -const endpointStatusFieldMaskSchema: FieldMaskSchema = { - autoscalingLimitMaxCu: {wire: 'autoscaling_limit_max_cu'}, - autoscalingLimitMinCu: {wire: 'autoscaling_limit_min_cu'}, - currentState: {wire: 'current_state'}, - disabled: {wire: 'disabled'}, - endpointId: {wire: 'endpoint_id'}, - endpointType: {wire: 'endpoint_type'}, - group: {wire: 'group', children: () => endpointGroupStatusFieldMaskSchema}, - hosts: {wire: 'hosts', children: () => endpointHostsFieldMaskSchema}, - pendingState: {wire: 'pending_state'}, - settings: {wire: 'settings', children: () => endpointSettingsFieldMaskSchema}, + settings: { + wire: 'settings', + children: () => updateEndpointSettingsFieldMaskSchema, + }, suspendTimeoutDuration: {wire: 'suspend_timeout_duration'}, }; -const initialBranchSpecFieldMaskSchema: FieldMaskSchema = { +const updateInitialBranchSpecFieldMaskSchema: FieldMaskSchema = { isProtected: {wire: 'is_protected'}, }; -const initialEndpointSpecFieldMaskSchema: FieldMaskSchema = { +const updateInitialEndpointSpecFieldMaskSchema: FieldMaskSchema = { autoscalingLimitMaxCu: {wire: 'autoscaling_limit_max_cu'}, autoscalingLimitMinCu: {wire: 'autoscaling_limit_min_cu'}, - group: {wire: 'group', children: () => endpointGroupSpecFieldMaskSchema}, + group: { + wire: 'group', + children: () => updateEndpointGroupSpecFieldMaskSchema, + }, noSuspension: {wire: 'no_suspension'}, suspendTimeoutDuration: {wire: 'suspend_timeout_duration'}, }; -const projectFieldMaskSchema: FieldMaskSchema = { - createTime: {wire: 'create_time'}, - deleteTime: {wire: 'delete_time'}, +const updateProjectFieldMaskSchema: FieldMaskSchema = { initialBranchSpec: { wire: 'initial_branch_spec', - children: () => initialBranchSpecFieldMaskSchema, + children: () => updateInitialBranchSpecFieldMaskSchema, }, initialEndpointSpec: { wire: 'initial_endpoint_spec', - children: () => initialEndpointSpecFieldMaskSchema, + children: () => updateInitialEndpointSpecFieldMaskSchema, }, name: {wire: 'name'}, - projectId: {wire: 'project_id'}, - purgeTime: {wire: 'purge_time'}, - spec: {wire: 'spec', children: () => projectSpecFieldMaskSchema}, - status: {wire: 'status', children: () => projectStatusFieldMaskSchema}, - uid: {wire: 'uid'}, - updateTime: {wire: 'update_time'}, + spec: {wire: 'spec', children: () => updateProjectSpecFieldMaskSchema}, }; -export function projectFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, projectFieldMaskSchema); +export function updateProjectFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, updateProjectFieldMaskSchema); } -const projectDefaultEndpointSettingsFieldMaskSchema: FieldMaskSchema = { +const updateProjectDefaultEndpointSettingsFieldMaskSchema: FieldMaskSchema = { autoscalingLimitMaxCu: {wire: 'autoscaling_limit_max_cu'}, autoscalingLimitMinCu: {wire: 'autoscaling_limit_min_cu'}, noSuspension: {wire: 'no_suspension'}, @@ -4516,81 +5150,25 @@ const projectDefaultEndpointSettingsFieldMaskSchema: FieldMaskSchema = { suspendTimeoutDuration: {wire: 'suspend_timeout_duration'}, }; -const projectSpecFieldMaskSchema: FieldMaskSchema = { - budgetPolicyId: {wire: 'budget_policy_id'}, - customTags: {wire: 'custom_tags'}, - defaultBranch: {wire: 'default_branch'}, - defaultEndpointSettings: { - wire: 'default_endpoint_settings', - children: () => projectDefaultEndpointSettingsFieldMaskSchema, - }, - displayName: {wire: 'display_name'}, - enablePgNativeLogin: {wire: 'enable_pg_native_login'}, - historyRetentionDuration: {wire: 'history_retention_duration'}, - pgVersion: {wire: 'pg_version'}, -}; - -const projectStatusFieldMaskSchema: FieldMaskSchema = { - branchLogicalSizeLimitBytes: {wire: 'branch_logical_size_limit_bytes'}, +const updateProjectSpecFieldMaskSchema: FieldMaskSchema = { budgetPolicyId: {wire: 'budget_policy_id'}, - computeLastActiveTime: {wire: 'compute_last_active_time'}, customTags: {wire: 'custom_tags'}, defaultBranch: {wire: 'default_branch'}, defaultEndpointSettings: { wire: 'default_endpoint_settings', - children: () => projectDefaultEndpointSettingsFieldMaskSchema, + children: () => updateProjectDefaultEndpointSettingsFieldMaskSchema, }, displayName: {wire: 'display_name'}, enablePgNativeLogin: {wire: 'enable_pg_native_login'}, historyRetentionDuration: {wire: 'history_retention_duration'}, - owner: {wire: 'owner'}, pgVersion: {wire: 'pg_version'}, - projectId: {wire: 'project_id'}, - syntheticStorageSizeBytes: {wire: 'synthetic_storage_size_bytes'}, }; -const roleFieldMaskSchema: FieldMaskSchema = { - createTime: {wire: 'create_time'}, +const updateRoleFieldMaskSchema: FieldMaskSchema = { name: {wire: 'name'}, - parent: {wire: 'parent'}, - roleId: {wire: 'role_id'}, - spec: {wire: 'spec', children: () => role_RoleSpecFieldMaskSchema}, - status: {wire: 'status', children: () => role_RoleStatusFieldMaskSchema}, - updateTime: {wire: 'update_time'}, + spec: {wire: 'spec', children: () => role_UpdateRoleSpecFieldMaskSchema}, }; -export function roleFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, roleFieldMaskSchema); +export function updateRoleFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, updateRoleFieldMaskSchema); } - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -const role_AttributesFieldMaskSchema: FieldMaskSchema = { - bypassrls: {wire: 'bypassrls'}, - createdb: {wire: 'createdb'}, - createrole: {wire: 'createrole'}, -}; - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -const role_RoleSpecFieldMaskSchema: FieldMaskSchema = { - attributes: { - wire: 'attributes', - children: () => role_AttributesFieldMaskSchema, - }, - authMethod: {wire: 'auth_method'}, - identityType: {wire: 'identity_type'}, - membershipRoles: {wire: 'membership_roles'}, - postgresRole: {wire: 'postgres_role'}, -}; - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -const role_RoleStatusFieldMaskSchema: FieldMaskSchema = { - attributes: { - wire: 'attributes', - children: () => role_AttributesFieldMaskSchema, - }, - authMethod: {wire: 'auth_method'}, - identityType: {wire: 'identity_type'}, - membershipRoles: {wire: 'membership_roles'}, - postgresRole: {wire: 'postgres_role'}, - roleId: {wire: 'role_id'}, -}; diff --git a/packages/queries/src/v1/index.ts b/packages/queries/src/v1/index.ts index 13da6157..99be415b 100755 --- a/packages/queries/src/v1/index.ts +++ b/packages/queries/src/v1/index.ts @@ -15,8 +15,18 @@ export { } from './model'; export type { + CreateCreateQueryRequestQuery, + CreateDateRange, + CreateDateRangeValue, + CreateDateValue, + CreateEnumValue, + CreateMultiValuesOptions, + CreateNumericValue, + CreateQueryBackedValue, + CreateQueryParameter, CreateQueryRequest, CreateQueryRequestQuery, + CreateTextValue, DateRange, DateRangeValue, DateValue, @@ -35,9 +45,19 @@ export type { QueryParameter, TextValue, TrashQueryRequest, + UpdateDateRange, + UpdateDateRangeValue, + UpdateDateValue, + UpdateEnumValue, + UpdateMultiValuesOptions, + UpdateNumericValue, + UpdateQueryBackedValue, + UpdateQueryParameter, UpdateQueryRequest, UpdateQueryRequestQuery, + UpdateTextValue, + UpdateUpdateQueryRequestQuery, Visualization, } from './model'; -export {updateQueryRequestQueryFieldMask} from './model'; +export {updateUpdateQueryRequestQueryFieldMask} from './model'; diff --git a/packages/queries/src/v1/model.ts b/packages/queries/src/v1/model.ts index 30b57520..8abb0166 100644 --- a/packages/queries/src/v1/model.ts +++ b/packages/queries/src/v1/model.ts @@ -68,8 +68,155 @@ export type DateValue_DynamicDate = | (typeof DateValue_DynamicDate)[keyof typeof DateValue_DynamicDate] | (string & {}); +export interface CreateCreateQueryRequestQuery { + /** UUID identifying the query. */ + id?: string | undefined; + /** Display name of the query that appears in list views, widget headings, and on the query page. */ + displayName?: string | undefined; + /** General description that conveys additional information about this query such as usage notes. */ + description?: string | undefined; + /** Username of the user that owns the query. */ + ownerUserName?: string | undefined; + /** ID of the SQL warehouse attached to the query. */ + warehouseId?: string | undefined; + /** Text of the query to be run. */ + queryText?: string | undefined; + /** Sets the "Run as" role for the object. */ + runAsMode?: RunAsMode | undefined; + /** Indicates whether the query is trashed. */ + lifecycleState?: LifecycleState | undefined; + /** Username of the user who last saved changes to this query. */ + lastModifierUserName?: string | undefined; + /** Workspace path of the workspace folder containing the object. */ + parentPath?: string | undefined; + tags?: string[] | undefined; + /** Timestamp when this query was created. */ + createTime?: Temporal.Instant | undefined; + /** Timestamp when this query was last updated. */ + updateTime?: Temporal.Instant | undefined; + /** List of query parameter definitions. */ + parameters?: CreateQueryParameter[] | undefined; + /** Whether to apply a 1000 row limit to the query result. */ + applyAutoLimit?: boolean | undefined; + /** Name of the catalog where this query will be executed. */ + catalog?: string | undefined; + /** Name of the schema where this query will be executed. */ + schema?: string | undefined; +} + +export interface CreateDateRange { + start: string; + end: string; +} + +export interface CreateDateRangeValue { + value?: + | { + $case: 'dynamicDateRangeValue'; + /** Dynamic date-time range value based on current date-time. */ + dynamicDateRangeValue: DateRangeValue_DynamicDateRange; + } + | { + $case: 'dateRangeValue'; + /** Manually specified date-time range value. */ + dateRangeValue: CreateDateRange; + } + | undefined; + /** Date-time precision to format the value into when the query is run. Defaults to DAY_PRECISION (YYYY-MM-DD). */ + precision?: DatePrecision | undefined; + startDayOfWeek?: number | undefined; +} + +export interface CreateDateValue { + value?: + | { + $case: 'dynamicDateValue'; + /** Dynamic date-time value based on current date-time. */ + dynamicDateValue: DateValue_DynamicDate; + } + | { + $case: 'dateValue'; + /** Manually specified date-time value. */ + dateValue: string; + } + | undefined; + /** Date-time precision to format the value into when the query is run. Defaults to DAY_PRECISION (YYYY-MM-DD). */ + precision?: DatePrecision | undefined; +} + +export interface CreateEnumValue { + /** List of selected query parameter values. */ + values?: string[] | undefined; + /** List of valid query parameter values, newline delimited. */ + enumOptions?: string | undefined; + /** If specified, allows multiple values to be selected for this parameter. */ + multiValuesOptions?: CreateMultiValuesOptions | undefined; +} + +export interface CreateMultiValuesOptions { + /** Character that prefixes each selected parameter value. */ + prefix?: string | undefined; + /** Character that separates each selected parameter value. Defaults to a comma. */ + separator?: string | undefined; + /** Character that suffixes each selected parameter value. */ + suffix?: string | undefined; +} + +export interface CreateNumericValue { + value?: number | undefined; +} + +export interface CreateQueryBackedValue { + /** List of selected query parameter values. */ + values?: string[] | undefined; + /** UUID of the query that provides the parameter values. */ + queryId?: string | undefined; + /** If specified, allows multiple values to be selected for this parameter. */ + multiValuesOptions?: CreateMultiValuesOptions | undefined; +} + +export interface CreateQueryParameter { + /** Text displayed in the user-facing parameter widget in the UI. */ + title?: string | undefined; + /** Literal parameter marker that appears between double curly braces in the query text. */ + name?: string | undefined; + /** Only one of the following fields may be set, depending on the type of parameter. */ + parameterValue?: + | { + $case: 'textValue'; + /** Text query parameter value. */ + textValue: CreateTextValue; + } + | { + $case: 'numericValue'; + /** Numeric query parameter value. */ + numericValue: CreateNumericValue; + } + | { + $case: 'enumValue'; + /** Dropdown query parameter value. */ + enumValue: CreateEnumValue; + } + | { + $case: 'dateValue'; + /** Date query parameter value. Can only specify one of `dynamic_date_value` or `date_value`. */ + dateValue: CreateDateValue; + } + | { + $case: 'dateRangeValue'; + /** Date-range query parameter value. Can only specify one of `dynamic_date_range_value` or `date_range_value`. */ + dateRangeValue: CreateDateRangeValue; + } + | { + $case: 'queryBackedValue'; + /** Query-based dropdown query parameter value. */ + queryBackedValue: CreateQueryBackedValue; + } + | undefined; +} + export interface CreateQueryRequest { - query?: CreateQueryRequestQuery | undefined; + query?: CreateCreateQueryRequestQuery | undefined; /** If true, automatically resolve query display name conflicts. Otherwise, fail the request if the query's display name conflicts with an existing query's display name. */ autoResolveDisplayName?: boolean | undefined; } @@ -110,6 +257,10 @@ export interface CreateQueryRequestQuery { schema?: string | undefined; } +export interface CreateTextValue { + value?: string | undefined; +} + export interface DateRange { start?: string | undefined; end?: string | undefined; @@ -333,9 +484,120 @@ export interface TrashQueryRequest { id?: string | undefined; } +export interface UpdateDateRange { + start?: string | undefined; + end?: string | undefined; +} + +export interface UpdateDateRangeValue { + value?: + | { + $case: 'dynamicDateRangeValue'; + /** Dynamic date-time range value based on current date-time. */ + dynamicDateRangeValue: DateRangeValue_DynamicDateRange; + } + | { + $case: 'dateRangeValue'; + /** Manually specified date-time range value. */ + dateRangeValue: UpdateDateRange; + } + | undefined; + /** Date-time precision to format the value into when the query is run. Defaults to DAY_PRECISION (YYYY-MM-DD). */ + precision?: DatePrecision | undefined; + startDayOfWeek?: number | undefined; +} + +export interface UpdateDateValue { + value?: + | { + $case: 'dynamicDateValue'; + /** Dynamic date-time value based on current date-time. */ + dynamicDateValue: DateValue_DynamicDate; + } + | { + $case: 'dateValue'; + /** Manually specified date-time value. */ + dateValue: string; + } + | undefined; + /** Date-time precision to format the value into when the query is run. Defaults to DAY_PRECISION (YYYY-MM-DD). */ + precision?: DatePrecision | undefined; +} + +export interface UpdateEnumValue { + /** List of selected query parameter values. */ + values?: string[] | undefined; + /** List of valid query parameter values, newline delimited. */ + enumOptions?: string | undefined; + /** If specified, allows multiple values to be selected for this parameter. */ + multiValuesOptions?: UpdateMultiValuesOptions | undefined; +} + +export interface UpdateMultiValuesOptions { + /** Character that prefixes each selected parameter value. */ + prefix?: string | undefined; + /** Character that separates each selected parameter value. Defaults to a comma. */ + separator?: string | undefined; + /** Character that suffixes each selected parameter value. */ + suffix?: string | undefined; +} + +export interface UpdateNumericValue { + value?: number | undefined; +} + +export interface UpdateQueryBackedValue { + /** List of selected query parameter values. */ + values?: string[] | undefined; + /** UUID of the query that provides the parameter values. */ + queryId?: string | undefined; + /** If specified, allows multiple values to be selected for this parameter. */ + multiValuesOptions?: UpdateMultiValuesOptions | undefined; +} + +export interface UpdateQueryParameter { + /** Text displayed in the user-facing parameter widget in the UI. */ + title?: string | undefined; + /** Literal parameter marker that appears between double curly braces in the query text. */ + name?: string | undefined; + /** Only one of the following fields may be set, depending on the type of parameter. */ + parameterValue?: + | { + $case: 'textValue'; + /** Text query parameter value. */ + textValue: UpdateTextValue; + } + | { + $case: 'numericValue'; + /** Numeric query parameter value. */ + numericValue: UpdateNumericValue; + } + | { + $case: 'enumValue'; + /** Dropdown query parameter value. */ + enumValue: UpdateEnumValue; + } + | { + $case: 'dateValue'; + /** Date query parameter value. Can only specify one of `dynamic_date_value` or `date_value`. */ + dateValue: UpdateDateValue; + } + | { + $case: 'dateRangeValue'; + /** Date-range query parameter value. Can only specify one of `dynamic_date_range_value` or `date_range_value`. */ + dateRangeValue: UpdateDateRangeValue; + } + | { + $case: 'queryBackedValue'; + /** Query-based dropdown query parameter value. */ + queryBackedValue: UpdateQueryBackedValue; + } + | undefined; +} + export interface UpdateQueryRequest { - query?: UpdateQueryRequestQuery | undefined; - updateMask?: FieldMask | undefined; + query?: UpdateUpdateQueryRequestQuery | undefined; + updateMask?: FieldMask | undefined; id?: string | undefined; /** If true, automatically resolve alert display name conflicts. Otherwise, fail the request if the alert's display name conflicts with an existing alert's display name. */ autoResolveDisplayName?: boolean | undefined; @@ -377,6 +639,46 @@ export interface UpdateQueryRequestQuery { schema?: string | undefined; } +export interface UpdateTextValue { + value?: string | undefined; +} + +export interface UpdateUpdateQueryRequestQuery { + /** UUID identifying the query. */ + id?: string | undefined; + /** Display name of the query that appears in list views, widget headings, and on the query page. */ + displayName?: string | undefined; + /** General description that conveys additional information about this query such as usage notes. */ + description?: string | undefined; + /** Username of the user that owns the query. */ + ownerUserName?: string | undefined; + /** ID of the SQL warehouse attached to the query. */ + warehouseId?: string | undefined; + /** Text of the query to be run. */ + queryText?: string | undefined; + /** Sets the "Run as" role for the object. */ + runAsMode?: RunAsMode | undefined; + /** Indicates whether the query is trashed. */ + lifecycleState?: LifecycleState | undefined; + /** Username of the user who last saved changes to this query. */ + lastModifierUserName?: string | undefined; + /** Workspace path of the workspace folder containing the object. */ + parentPath?: string | undefined; + tags?: string[] | undefined; + /** Timestamp when this query was created. */ + createTime?: Temporal.Instant | undefined; + /** Timestamp when this query was last updated. */ + updateTime?: Temporal.Instant | undefined; + /** List of query parameter definitions. */ + parameters?: UpdateQueryParameter[] | undefined; + /** Whether to apply a 1000 row limit to the query result. */ + applyAutoLimit?: boolean | undefined; + /** Name of the catalog where this query will be executed. */ + catalog?: string | undefined; + /** Name of the schema where this query will be executed. */ + schema?: string | undefined; +} + export interface Visualization { /** UUID identifying the visualization. */ id?: string | undefined; @@ -693,17 +995,7 @@ export const unmarshalVisualizationSchema: z.ZodType = z queryId: d.query_id, })); -export const marshalCreateQueryRequestSchema: z.ZodType = z - .object({ - query: z.lazy(() => marshalCreateQueryRequestQuerySchema).optional(), - autoResolveDisplayName: z.boolean().optional(), - }) - .transform(d => ({ - query: d.query, - auto_resolve_display_name: d.autoResolveDisplayName, - })); - -export const marshalCreateQueryRequestQuerySchema: z.ZodType = z +export const marshalCreateCreateQueryRequestQuerySchema: z.ZodType = z .object({ id: z.string().optional(), displayName: z.string().optional(), @@ -724,7 +1016,9 @@ export const marshalCreateQueryRequestQuerySchema: z.ZodType = z .any() .transform((d: Temporal.Instant) => d.toString()) .optional(), - parameters: z.array(z.lazy(() => marshalQueryParameterSchema)).optional(), + parameters: z + .array(z.lazy(() => marshalCreateQueryParameterSchema)) + .optional(), applyAutoLimit: z.boolean().optional(), catalog: z.string().optional(), schema: z.string().optional(), @@ -749,17 +1043,17 @@ export const marshalCreateQueryRequestQuerySchema: z.ZodType = z schema: d.schema, })); -export const marshalDateRangeSchema: z.ZodType = z +export const marshalCreateDateRangeSchema: z.ZodType = z .object({ - start: z.string().optional(), - end: z.string().optional(), + start: z.string(), + end: z.string(), }) .transform(d => ({ start: d.start, end: d.end, })); -export const marshalDateRangeValueSchema: z.ZodType = z +export const marshalCreateDateRangeValueSchema: z.ZodType = z .object({ value: z .discriminatedUnion('$case', [ @@ -769,7 +1063,7 @@ export const marshalDateRangeValueSchema: z.ZodType = z }), z.object({ $case: z.literal('dateRangeValue'), - dateRangeValue: z.lazy(() => marshalDateRangeSchema), + dateRangeValue: z.lazy(() => marshalCreateDateRangeSchema), }), ]) .optional(), @@ -787,7 +1081,7 @@ export const marshalDateRangeValueSchema: z.ZodType = z start_day_of_week: d.startDayOfWeek, })); -export const marshalDateValueSchema: z.ZodType = z +export const marshalCreateDateValueSchema: z.ZodType = z .object({ value: z .discriminatedUnion('$case', [ @@ -808,12 +1102,12 @@ export const marshalDateValueSchema: z.ZodType = z precision: d.precision, })); -export const marshalEnumValueSchema: z.ZodType = z +export const marshalCreateEnumValueSchema: z.ZodType = z .object({ values: z.array(z.string()).optional(), enumOptions: z.string().optional(), multiValuesOptions: z - .lazy(() => marshalMultiValuesOptionsSchema) + .lazy(() => marshalCreateMultiValuesOptionsSchema) .optional(), }) .transform(d => ({ @@ -822,7 +1116,7 @@ export const marshalEnumValueSchema: z.ZodType = z multi_values_options: d.multiValuesOptions, })); -export const marshalMultiValuesOptionsSchema: z.ZodType = z +export const marshalCreateMultiValuesOptionsSchema: z.ZodType = z .object({ prefix: z.string().optional(), separator: z.string().optional(), @@ -834,7 +1128,7 @@ export const marshalMultiValuesOptionsSchema: z.ZodType = z suffix: d.suffix, })); -export const marshalNumericValueSchema: z.ZodType = z +export const marshalCreateNumericValueSchema: z.ZodType = z .object({ value: z.number().optional(), }) @@ -842,12 +1136,12 @@ export const marshalNumericValueSchema: z.ZodType = z value: d.value, })); -export const marshalQueryBackedValueSchema: z.ZodType = z +export const marshalCreateQueryBackedValueSchema: z.ZodType = z .object({ values: z.array(z.string()).optional(), queryId: z.string().optional(), multiValuesOptions: z - .lazy(() => marshalMultiValuesOptionsSchema) + .lazy(() => marshalCreateMultiValuesOptionsSchema) .optional(), }) .transform(d => ({ @@ -856,7 +1150,7 @@ export const marshalQueryBackedValueSchema: z.ZodType = z multi_values_options: d.multiValuesOptions, })); -export const marshalQueryParameterSchema: z.ZodType = z +export const marshalCreateQueryParameterSchema: z.ZodType = z .object({ title: z.string().optional(), name: z.string().optional(), @@ -864,27 +1158,27 @@ export const marshalQueryParameterSchema: z.ZodType = z .discriminatedUnion('$case', [ z.object({ $case: z.literal('textValue'), - textValue: z.lazy(() => marshalTextValueSchema), + textValue: z.lazy(() => marshalCreateTextValueSchema), }), z.object({ $case: z.literal('numericValue'), - numericValue: z.lazy(() => marshalNumericValueSchema), + numericValue: z.lazy(() => marshalCreateNumericValueSchema), }), z.object({ $case: z.literal('enumValue'), - enumValue: z.lazy(() => marshalEnumValueSchema), + enumValue: z.lazy(() => marshalCreateEnumValueSchema), }), z.object({ $case: z.literal('dateValue'), - dateValue: z.lazy(() => marshalDateValueSchema), + dateValue: z.lazy(() => marshalCreateDateValueSchema), }), z.object({ $case: z.literal('dateRangeValue'), - dateRangeValue: z.lazy(() => marshalDateRangeValueSchema), + dateRangeValue: z.lazy(() => marshalCreateDateRangeValueSchema), }), z.object({ $case: z.literal('queryBackedValue'), - queryBackedValue: z.lazy(() => marshalQueryBackedValueSchema), + queryBackedValue: z.lazy(() => marshalCreateQueryBackedValueSchema), }), ]) .optional(), @@ -912,7 +1206,17 @@ export const marshalQueryParameterSchema: z.ZodType = z }), })); -export const marshalTextValueSchema: z.ZodType = z +export const marshalCreateQueryRequestSchema: z.ZodType = z + .object({ + query: z.lazy(() => marshalCreateCreateQueryRequestQuerySchema).optional(), + autoResolveDisplayName: z.boolean().optional(), + }) + .transform(d => ({ + query: d.query, + auto_resolve_display_name: d.autoResolveDisplayName, + })); + +export const marshalCreateTextValueSchema: z.ZodType = z .object({ value: z.string().optional(), }) @@ -920,9 +1224,172 @@ export const marshalTextValueSchema: z.ZodType = z value: d.value, })); +export const marshalUpdateDateRangeSchema: z.ZodType = z + .object({ + start: z.string().optional(), + end: z.string().optional(), + }) + .transform(d => ({ + start: d.start, + end: d.end, + })); + +export const marshalUpdateDateRangeValueSchema: z.ZodType = z + .object({ + value: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('dynamicDateRangeValue'), + dynamicDateRangeValue: z.string(), + }), + z.object({ + $case: z.literal('dateRangeValue'), + dateRangeValue: z.lazy(() => marshalUpdateDateRangeSchema), + }), + ]) + .optional(), + precision: z.string().optional(), + startDayOfWeek: z.number().optional(), + }) + .transform(d => ({ + ...(d.value?.$case === 'dynamicDateRangeValue' && { + dynamic_date_range_value: d.value.dynamicDateRangeValue, + }), + ...(d.value?.$case === 'dateRangeValue' && { + date_range_value: d.value.dateRangeValue, + }), + precision: d.precision, + start_day_of_week: d.startDayOfWeek, + })); + +export const marshalUpdateDateValueSchema: z.ZodType = z + .object({ + value: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('dynamicDateValue'), + dynamicDateValue: z.string(), + }), + z.object({$case: z.literal('dateValue'), dateValue: z.string()}), + ]) + .optional(), + precision: z.string().optional(), + }) + .transform(d => ({ + ...(d.value?.$case === 'dynamicDateValue' && { + dynamic_date_value: d.value.dynamicDateValue, + }), + ...(d.value?.$case === 'dateValue' && {date_value: d.value.dateValue}), + precision: d.precision, + })); + +export const marshalUpdateEnumValueSchema: z.ZodType = z + .object({ + values: z.array(z.string()).optional(), + enumOptions: z.string().optional(), + multiValuesOptions: z + .lazy(() => marshalUpdateMultiValuesOptionsSchema) + .optional(), + }) + .transform(d => ({ + values: d.values, + enum_options: d.enumOptions, + multi_values_options: d.multiValuesOptions, + })); + +export const marshalUpdateMultiValuesOptionsSchema: z.ZodType = z + .object({ + prefix: z.string().optional(), + separator: z.string().optional(), + suffix: z.string().optional(), + }) + .transform(d => ({ + prefix: d.prefix, + separator: d.separator, + suffix: d.suffix, + })); + +export const marshalUpdateNumericValueSchema: z.ZodType = z + .object({ + value: z.number().optional(), + }) + .transform(d => ({ + value: d.value, + })); + +export const marshalUpdateQueryBackedValueSchema: z.ZodType = z + .object({ + values: z.array(z.string()).optional(), + queryId: z.string().optional(), + multiValuesOptions: z + .lazy(() => marshalUpdateMultiValuesOptionsSchema) + .optional(), + }) + .transform(d => ({ + values: d.values, + query_id: d.queryId, + multi_values_options: d.multiValuesOptions, + })); + +export const marshalUpdateQueryParameterSchema: z.ZodType = z + .object({ + title: z.string().optional(), + name: z.string().optional(), + parameterValue: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('textValue'), + textValue: z.lazy(() => marshalUpdateTextValueSchema), + }), + z.object({ + $case: z.literal('numericValue'), + numericValue: z.lazy(() => marshalUpdateNumericValueSchema), + }), + z.object({ + $case: z.literal('enumValue'), + enumValue: z.lazy(() => marshalUpdateEnumValueSchema), + }), + z.object({ + $case: z.literal('dateValue'), + dateValue: z.lazy(() => marshalUpdateDateValueSchema), + }), + z.object({ + $case: z.literal('dateRangeValue'), + dateRangeValue: z.lazy(() => marshalUpdateDateRangeValueSchema), + }), + z.object({ + $case: z.literal('queryBackedValue'), + queryBackedValue: z.lazy(() => marshalUpdateQueryBackedValueSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + title: d.title, + name: d.name, + ...(d.parameterValue?.$case === 'textValue' && { + text_value: d.parameterValue.textValue, + }), + ...(d.parameterValue?.$case === 'numericValue' && { + numeric_value: d.parameterValue.numericValue, + }), + ...(d.parameterValue?.$case === 'enumValue' && { + enum_value: d.parameterValue.enumValue, + }), + ...(d.parameterValue?.$case === 'dateValue' && { + date_value: d.parameterValue.dateValue, + }), + ...(d.parameterValue?.$case === 'dateRangeValue' && { + date_range_value: d.parameterValue.dateRangeValue, + }), + ...(d.parameterValue?.$case === 'queryBackedValue' && { + query_backed_value: d.parameterValue.queryBackedValue, + }), + })); + export const marshalUpdateQueryRequestSchema: z.ZodType = z .object({ - query: z.lazy(() => marshalUpdateQueryRequestQuerySchema).optional(), + query: z.lazy(() => marshalUpdateUpdateQueryRequestQuerySchema).optional(), updateMask: z .any() .transform((m: FieldMask) => m.toString()) @@ -937,7 +1404,15 @@ export const marshalUpdateQueryRequestSchema: z.ZodType = z auto_resolve_display_name: d.autoResolveDisplayName, })); -export const marshalUpdateQueryRequestQuerySchema: z.ZodType = z +export const marshalUpdateTextValueSchema: z.ZodType = z + .object({ + value: z.string().optional(), + }) + .transform(d => ({ + value: d.value, + })); + +export const marshalUpdateUpdateQueryRequestQuerySchema: z.ZodType = z .object({ id: z.string().optional(), displayName: z.string().optional(), @@ -958,7 +1433,9 @@ export const marshalUpdateQueryRequestQuerySchema: z.ZodType = z .any() .transform((d: Temporal.Instant) => d.toString()) .optional(), - parameters: z.array(z.lazy(() => marshalQueryParameterSchema)).optional(), + parameters: z + .array(z.lazy(() => marshalUpdateQueryParameterSchema)) + .optional(), applyAutoLimit: z.boolean().optional(), catalog: z.string().optional(), schema: z.string().optional(), @@ -983,7 +1460,7 @@ export const marshalUpdateQueryRequestQuerySchema: z.ZodType = z schema: d.schema, })); -const updateQueryRequestQueryFieldMaskSchema: FieldMaskSchema = { +const updateUpdateQueryRequestQueryFieldMaskSchema: FieldMaskSchema = { applyAutoLimit: {wire: 'apply_auto_limit'}, catalog: {wire: 'catalog'}, createTime: {wire: 'create_time'}, @@ -1003,11 +1480,11 @@ const updateQueryRequestQueryFieldMaskSchema: FieldMaskSchema = { warehouseId: {wire: 'warehouse_id'}, }; -export function updateQueryRequestQueryFieldMask( +export function updateUpdateQueryRequestQueryFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - updateQueryRequestQueryFieldMaskSchema + updateUpdateQueryRequestQueryFieldMaskSchema ); } diff --git a/packages/repos/src/v1/index.ts b/packages/repos/src/v1/index.ts index 747147d1..04f536a1 100755 --- a/packages/repos/src/v1/index.ts +++ b/packages/repos/src/v1/index.ts @@ -9,6 +9,8 @@ export {ReposClient} from './client'; export type { CreateRepoRequest, CreateRepoResponse, + CreateSparseCheckout, + CreateSparseCheckoutUpdate, DeleteRepoRequest, DeleteRepoResponse, GetRepoRequest, diff --git a/packages/repos/src/v1/model.ts b/packages/repos/src/v1/model.ts index cd7a55c1..ebb0d10d 100755 --- a/packages/repos/src/v1/model.ts +++ b/packages/repos/src/v1/model.ts @@ -22,7 +22,7 @@ export interface CreateRepoRequest { * If specified, the repo will be created with sparse checkout enabled. You cannot enable/disable * sparse checkout after the repo is created. */ - sparseCheckout?: SparseCheckout | undefined; + sparseCheckout?: CreateSparseCheckout | undefined; } export interface CreateRepoResponse { @@ -46,6 +46,26 @@ export interface CreateRepoResponse { sparseCheckout?: SparseCheckout | undefined; } +/** Sparse checkout configuration, it contains options like cone patterns. */ +export interface CreateSparseCheckout { + /** + * List of sparse checkout cone patterns, see + * [cone mode handling](https://git-scm.com/docs/git-sparse-checkout#_internalscone_mode_handling) + * for details. + */ + patterns?: string[] | undefined; +} + +/** Sparse checkout configuration, it contains options like cone patterns. */ +export interface CreateSparseCheckoutUpdate { + /** + * List of sparse checkout cone patterns, see + * [cone mode handling](https://git-scm.com/docs/git-sparse-checkout#_internalscone_mode_handling) + * for details. + */ + patterns?: string[] | undefined; +} + export interface DeleteRepoRequest { /** The ID for the corresponding repo to delete. */ id?: bigint | undefined; @@ -161,7 +181,7 @@ export interface UpdateRepoRequest { * If specified, update the sparse checkout settings. The update will fail if sparse checkout is * not enabled for the repo. */ - sparseCheckout?: SparseCheckoutUpdate | undefined; + sparseCheckout?: CreateSparseCheckoutUpdate | undefined; /** * WARNING: DESTRUCTIVE AND IRREVERSIBLE. If true, permanently deletes ALL uncommitted * changes in the Git folder — staged, unstaged, and untracked files — before updating. @@ -279,7 +299,7 @@ export const marshalCreateRepoRequestSchema: z.ZodType = z url: z.string().optional(), provider: z.string().optional(), path: z.string().optional(), - sparseCheckout: z.lazy(() => marshalSparseCheckoutSchema).optional(), + sparseCheckout: z.lazy(() => marshalCreateSparseCheckoutSchema).optional(), }) .transform(d => ({ url: d.url, @@ -288,7 +308,7 @@ export const marshalCreateRepoRequestSchema: z.ZodType = z sparse_checkout: d.sparseCheckout, })); -export const marshalSparseCheckoutSchema: z.ZodType = z +export const marshalCreateSparseCheckoutSchema: z.ZodType = z .object({ patterns: z.array(z.string()).optional(), }) @@ -296,7 +316,7 @@ export const marshalSparseCheckoutSchema: z.ZodType = z patterns: d.patterns, })); -export const marshalSparseCheckoutUpdateSchema: z.ZodType = z +export const marshalCreateSparseCheckoutUpdateSchema: z.ZodType = z .object({ patterns: z.array(z.string()).optional(), }) @@ -309,7 +329,9 @@ export const marshalUpdateRepoRequestSchema: z.ZodType = z id: z.bigint().optional(), branch: z.string().optional(), tag: z.string().optional(), - sparseCheckout: z.lazy(() => marshalSparseCheckoutUpdateSchema).optional(), + sparseCheckout: z + .lazy(() => marshalCreateSparseCheckoutUpdateSchema) + .optional(), dangerouslyForceDiscardAll: z.boolean().optional(), }) .transform(d => ({ diff --git a/packages/scim/src/v1/index.ts b/packages/scim/src/v1/index.ts index 01091ac0..c5c70676 100755 --- a/packages/scim/src/v1/index.ts +++ b/packages/scim/src/v1/index.ts @@ -35,10 +35,20 @@ export type { AccountServicePrincipal, AccountUser, ComplexValue, + CreateAccountComplexValue, CreateAccountGroupRequest, + CreateAccountName, + CreateAccountPatch, + CreateAccountResourceMeta, CreateAccountServicePrincipalRequest, CreateAccountUserRequest, + CreateComplexValue, + CreateCreatePasswordAccessControlRequest, CreateGroupRequest, + CreateName, + CreatePasswordAccessControlRequest, + CreatePatch, + CreateResourceMeta, CreateServicePrincipalRequest, CreateUserRequest, DeleteAccountGroupRequest, diff --git a/packages/scim/src/v1/model.ts b/packages/scim/src/v1/model.ts index 3d5b235d..a7da1e32 100644 --- a/packages/scim/src/v1/model.ts +++ b/packages/scim/src/v1/model.ts @@ -259,21 +259,50 @@ export interface ComplexValue { value?: string | undefined; } +export interface CreateAccountComplexValue { + display?: string | undefined; + primary?: boolean | undefined; + ref?: string | undefined; + type?: string | undefined; + value?: string | undefined; +} + export interface CreateAccountGroupRequest { /** String that represents a human-readable group name */ displayName?: string | undefined; externalId?: string | undefined; /** group ID */ id?: string | undefined; - members?: AccountComplexValue[] | undefined; + members?: CreateAccountComplexValue[] | undefined; /** Container for the group identifier. Workspace local versus account. */ - meta?: AccountResourceMeta | undefined; + meta?: CreateAccountResourceMeta | undefined; /** Indicates if the group has the admin role. */ - roles?: AccountComplexValue[] | undefined; + roles?: CreateAccountComplexValue[] | undefined; /** account ID */ accountId?: string | undefined; } +export interface CreateAccountName { + /** Family name of the user. */ + familyName?: string | undefined; + /** Given name of the user. */ + givenName?: string | undefined; +} + +export interface CreateAccountPatch { + /** Type of patch operation. */ + op?: AccountPatchOp_PatchOp | undefined; + /** Selection of patch operation */ + path?: string | undefined; + /** Value to modify */ + value?: JsonValue | undefined; +} + +export interface CreateAccountResourceMeta { + /** Identifier for group type. Can be local workspace group (`WorkspaceGroup`) or account group (`Group`). */ + resourceType?: string | undefined; +} + export interface CreateAccountServicePrincipalRequest { /** If this user is active */ active?: boolean | undefined; @@ -285,7 +314,7 @@ export interface CreateAccountServicePrincipalRequest { /** service principal ID. */ id?: string | undefined; /** Indicates if the group has the admin role. */ - roles?: AccountComplexValue[] | undefined; + roles?: CreateAccountComplexValue[] | undefined; /** account ID */ accountId?: string | undefined; } @@ -296,38 +325,89 @@ export interface CreateAccountUserRequest { /** String that represents a concatenation of given and family names. For example `John Smith`. */ displayName?: string | undefined; /** All the emails associated with the user. */ - emails?: AccountComplexValue[] | undefined; + emails?: CreateAccountComplexValue[] | undefined; /** External ID is not currently supported. It is reserved for future use. */ externalId?: string | undefined; /** user ID. */ id?: string | undefined; - name?: AccountName | undefined; + name?: CreateAccountName | undefined; /** Indicates if the group has the admin role. */ - roles?: AccountComplexValue[] | undefined; + roles?: CreateAccountComplexValue[] | undefined; /** Email address of the user. */ userName?: string | undefined; /** account ID */ accountId?: string | undefined; } +export interface CreateComplexValue { + display?: string | undefined; + primary?: boolean | undefined; + ref?: string | undefined; + type?: string | undefined; + value?: string | undefined; +} + +export interface CreateCreatePasswordAccessControlRequest { + /** name of the group */ + groupName?: string | undefined; + /** Permission level */ + permissionLevel?: PasswordPermission_Level | undefined; + /** application ID of a service principal */ + servicePrincipalName?: string | undefined; + /** name of the user */ + userName?: string | undefined; +} + export interface CreateGroupRequest { /** String that represents a human-readable group name */ displayName?: string | undefined; /** Entitlements assigned to the group. See [assigning entitlements](https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements) for a full list of supported values. */ - entitlements?: ComplexValue[] | undefined; + entitlements?: CreateComplexValue[] | undefined; externalId?: string | undefined; - groups?: ComplexValue[] | undefined; + groups?: CreateComplexValue[] | undefined; /** group ID */ id?: string | undefined; - members?: ComplexValue[] | undefined; + members?: CreateComplexValue[] | undefined; /** Container for the group identifier. Workspace local versus account. */ - meta?: ResourceMeta | undefined; + meta?: CreateResourceMeta | undefined; /** Corresponds to AWS instance profile/arn role. */ - roles?: ComplexValue[] | undefined; + roles?: CreateComplexValue[] | undefined; /** The schema of the group. */ schemas?: GroupSchema[] | undefined; } +export interface CreateName { + /** Family name of the user. */ + familyName?: string | undefined; + /** Given name of the user. */ + givenName?: string | undefined; +} + +export interface CreatePasswordAccessControlRequest { + /** name of the group */ + groupName?: string | undefined; + /** Permission level */ + permissionLevel?: PasswordPermission_Level | undefined; + /** application ID of a service principal */ + servicePrincipalName?: string | undefined; + /** name of the user */ + userName?: string | undefined; +} + +export interface CreatePatch { + /** Type of patch operation. */ + op?: PatchOp | undefined; + /** Selection of patch operation */ + path?: string | undefined; + /** Value to modify */ + value?: JsonValue | undefined; +} + +export interface CreateResourceMeta { + /** Identifier for group type. Can be local workspace group (`WorkspaceGroup`) or account group (`Group`). */ + resourceType?: string | undefined; +} + export interface CreateServicePrincipalRequest { /** If this user is active */ active?: boolean | undefined; @@ -336,13 +416,13 @@ export interface CreateServicePrincipalRequest { /** String that represents a concatenation of given and family names. */ displayName?: string | undefined; /** Entitlements assigned to the service principal. See [assigning entitlements](https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements) for a full list of supported values. */ - entitlements?: ComplexValue[] | undefined; + entitlements?: CreateComplexValue[] | undefined; externalId?: string | undefined; - groups?: ComplexValue[] | undefined; + groups?: CreateComplexValue[] | undefined; /** service principal ID. */ id?: string | undefined; /** Corresponds to AWS instance profile/arn role. */ - roles?: ComplexValue[] | undefined; + roles?: CreateComplexValue[] | undefined; /** The schema of the List response. */ schemas?: ServicePrincipalSchema[] | undefined; } @@ -353,17 +433,17 @@ export interface CreateUserRequest { /** String that represents a concatenation of given and family names. For example `John Smith`. This field cannot be updated through the Workspace SCIM APIs when [identity federation is enabled](https://docs.databricks.com/administration-guide/users-groups/best-practices.html#enable-identity-federation). Use Account SCIM APIs to update `displayName`. */ displayName?: string | undefined; /** All the emails associated with the user. */ - emails?: ComplexValue[] | undefined; + emails?: CreateComplexValue[] | undefined; /** Entitlements assigned to the user. See [assigning entitlements](https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements) for a full list of supported values. */ - entitlements?: ComplexValue[] | undefined; + entitlements?: CreateComplexValue[] | undefined; /** External ID is not currently supported. It is reserved for future use. */ externalId?: string | undefined; - groups?: ComplexValue[] | undefined; + groups?: CreateComplexValue[] | undefined; /** user ID. */ id?: string | undefined; - name?: Name | undefined; + name?: CreateName | undefined; /** Corresponds to AWS instance profile/arn role. */ - roles?: ComplexValue[] | undefined; + roles?: CreateComplexValue[] | undefined; /** The schema of the user. */ schemas?: UserSchema[] | undefined; /** Email address of the user. */ @@ -764,7 +844,7 @@ export interface PasswordPermissionsDescription { } export interface PasswordPermissionsRequest { - accessControlList?: PasswordAccessControlRequest[] | undefined; + accessControlList?: CreateCreatePasswordAccessControlRequest[] | undefined; } export interface Patch { @@ -779,7 +859,7 @@ export interface Patch { export interface PatchAccountGroupRequest { /** Unique ID in the workspace. */ id?: string | undefined; - operations?: AccountPatch[] | undefined; + operations?: CreateAccountPatch[] | undefined; /** The schema of the patch request. Must be ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]. */ schemas?: AccountPatchSchema_PatchSchema[] | undefined; /** account ID */ @@ -789,7 +869,7 @@ export interface PatchAccountGroupRequest { export interface PatchAccountServicePrincipalRequest { /** Unique ID in the workspace. */ id?: string | undefined; - operations?: AccountPatch[] | undefined; + operations?: CreateAccountPatch[] | undefined; /** The schema of the patch request. Must be ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]. */ schemas?: AccountPatchSchema_PatchSchema[] | undefined; /** account ID */ @@ -799,7 +879,7 @@ export interface PatchAccountServicePrincipalRequest { export interface PatchAccountUserRequest { /** Unique ID in the workspace. */ id?: string | undefined; - operations?: AccountPatch[] | undefined; + operations?: CreateAccountPatch[] | undefined; /** The schema of the patch request. Must be ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]. */ schemas?: AccountPatchSchema_PatchSchema[] | undefined; /** account ID */ @@ -809,7 +889,7 @@ export interface PatchAccountUserRequest { export interface PatchGroupRequest { /** Unique ID in the workspace. */ id?: string | undefined; - operations?: Patch[] | undefined; + operations?: CreatePatch[] | undefined; /** The schema of the patch request. Must be ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]. */ schemas?: PatchSchema[] | undefined; } @@ -817,7 +897,7 @@ export interface PatchGroupRequest { export interface PatchServicePrincipalRequest { /** Unique ID in the workspace. */ id?: string | undefined; - operations?: Patch[] | undefined; + operations?: CreatePatch[] | undefined; /** The schema of the patch request. Must be ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]. */ schemas?: PatchSchema[] | undefined; } @@ -825,7 +905,7 @@ export interface PatchServicePrincipalRequest { export interface PatchUserRequest { /** Unique ID in the workspace. */ id?: string | undefined; - operations?: Patch[] | undefined; + operations?: CreatePatch[] | undefined; /** The schema of the patch request. Must be ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]. */ schemas?: PatchSchema[] | undefined; } @@ -860,11 +940,11 @@ export interface UpdateAccountGroupRequest { externalId?: string | undefined; /** group ID */ id?: string | undefined; - members?: AccountComplexValue[] | undefined; + members?: CreateAccountComplexValue[] | undefined; /** Container for the group identifier. Workspace local versus account. */ - meta?: AccountResourceMeta | undefined; + meta?: CreateAccountResourceMeta | undefined; /** Indicates if the group has the admin role. */ - roles?: AccountComplexValue[] | undefined; + roles?: CreateAccountComplexValue[] | undefined; /** account ID */ accountId?: string | undefined; } @@ -880,7 +960,7 @@ export interface UpdateAccountServicePrincipalRequest { /** service principal ID. */ id?: string | undefined; /** Indicates if the group has the admin role. */ - roles?: AccountComplexValue[] | undefined; + roles?: CreateAccountComplexValue[] | undefined; /** account ID */ accountId?: string | undefined; } @@ -891,14 +971,14 @@ export interface UpdateAccountUserRequest { /** String that represents a concatenation of given and family names. For example `John Smith`. */ displayName?: string | undefined; /** All the emails associated with the user. */ - emails?: AccountComplexValue[] | undefined; + emails?: CreateAccountComplexValue[] | undefined; /** External ID is not currently supported. It is reserved for future use. */ externalId?: string | undefined; /** user ID. */ id?: string | undefined; - name?: AccountName | undefined; + name?: CreateAccountName | undefined; /** Indicates if the group has the admin role. */ - roles?: AccountComplexValue[] | undefined; + roles?: CreateAccountComplexValue[] | undefined; /** Email address of the user. */ userName?: string | undefined; /** account ID */ @@ -909,16 +989,16 @@ export interface UpdateGroupRequest { /** String that represents a human-readable group name */ displayName?: string | undefined; /** Entitlements assigned to the group. See [assigning entitlements](https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements) for a full list of supported values. */ - entitlements?: ComplexValue[] | undefined; + entitlements?: CreateComplexValue[] | undefined; externalId?: string | undefined; - groups?: ComplexValue[] | undefined; + groups?: CreateComplexValue[] | undefined; /** group ID */ id?: string | undefined; - members?: ComplexValue[] | undefined; + members?: CreateComplexValue[] | undefined; /** Container for the group identifier. Workspace local versus account. */ - meta?: ResourceMeta | undefined; + meta?: CreateResourceMeta | undefined; /** Corresponds to AWS instance profile/arn role. */ - roles?: ComplexValue[] | undefined; + roles?: CreateComplexValue[] | undefined; /** The schema of the group. */ schemas?: GroupSchema[] | undefined; } @@ -931,13 +1011,13 @@ export interface UpdateServicePrincipalRequest { /** String that represents a concatenation of given and family names. */ displayName?: string | undefined; /** Entitlements assigned to the service principal. See [assigning entitlements](https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements) for a full list of supported values. */ - entitlements?: ComplexValue[] | undefined; + entitlements?: CreateComplexValue[] | undefined; externalId?: string | undefined; - groups?: ComplexValue[] | undefined; + groups?: CreateComplexValue[] | undefined; /** service principal ID. */ id?: string | undefined; /** Corresponds to AWS instance profile/arn role. */ - roles?: ComplexValue[] | undefined; + roles?: CreateComplexValue[] | undefined; /** The schema of the List response. */ schemas?: ServicePrincipalSchema[] | undefined; } @@ -948,17 +1028,17 @@ export interface UpdateUserRequest { /** String that represents a concatenation of given and family names. For example `John Smith`. This field cannot be updated through the Workspace SCIM APIs when [identity federation is enabled](https://docs.databricks.com/administration-guide/users-groups/best-practices.html#enable-identity-federation). Use Account SCIM APIs to update `displayName`. */ displayName?: string | undefined; /** All the emails associated with the user. */ - emails?: ComplexValue[] | undefined; + emails?: CreateComplexValue[] | undefined; /** Entitlements assigned to the user. See [assigning entitlements](https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements) for a full list of supported values. */ - entitlements?: ComplexValue[] | undefined; + entitlements?: CreateComplexValue[] | undefined; /** External ID is not currently supported. It is reserved for future use. */ externalId?: string | undefined; - groups?: ComplexValue[] | undefined; + groups?: CreateComplexValue[] | undefined; /** user ID. */ id?: string | undefined; - name?: Name | undefined; + name?: CreateName | undefined; /** Corresponds to AWS instance profile/arn role. */ - roles?: ComplexValue[] | undefined; + roles?: CreateComplexValue[] | undefined; /** The schema of the user. */ schemas?: UserSchema[] | undefined; /** Email address of the user. */ @@ -1391,7 +1471,7 @@ export const unmarshalUserSchema: z.ZodType = z userName: d.userName, })); -export const marshalAccountComplexValueSchema: z.ZodType = z +export const marshalCreateAccountComplexValueSchema: z.ZodType = z .object({ display: z.string().optional(), primary: z.boolean().optional(), @@ -1407,7 +1487,31 @@ export const marshalAccountComplexValueSchema: z.ZodType = z value: d.value, })); -export const marshalAccountNameSchema: z.ZodType = z +export const marshalCreateAccountGroupRequestSchema: z.ZodType = z + .object({ + displayName: z.string().optional(), + externalId: z.string().optional(), + id: z.string().optional(), + members: z + .array(z.lazy(() => marshalCreateAccountComplexValueSchema)) + .optional(), + meta: z.lazy(() => marshalCreateAccountResourceMetaSchema).optional(), + roles: z + .array(z.lazy(() => marshalCreateAccountComplexValueSchema)) + .optional(), + accountId: z.string().optional(), + }) + .transform(d => ({ + displayName: d.displayName, + externalId: d.externalId, + id: d.id, + members: d.members, + meta: d.meta, + roles: d.roles, + account_id: d.accountId, + })); + +export const marshalCreateAccountNameSchema: z.ZodType = z .object({ familyName: z.string().optional(), givenName: z.string().optional(), @@ -1417,7 +1521,7 @@ export const marshalAccountNameSchema: z.ZodType = z givenName: d.givenName, })); -export const marshalAccountPatchSchema: z.ZodType = z +export const marshalCreateAccountPatchSchema: z.ZodType = z .object({ op: z.string().optional(), path: z.string().optional(), @@ -1429,7 +1533,7 @@ export const marshalAccountPatchSchema: z.ZodType = z value: d.value, })); -export const marshalAccountResourceMetaSchema: z.ZodType = z +export const marshalCreateAccountResourceMetaSchema: z.ZodType = z .object({ resourceType: z.string().optional(), }) @@ -1437,42 +1541,6 @@ export const marshalAccountResourceMetaSchema: z.ZodType = z resourceType: d.resourceType, })); -export const marshalComplexValueSchema: z.ZodType = z - .object({ - display: z.string().optional(), - primary: z.boolean().optional(), - ref: z.string().optional(), - type: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - display: d.display, - primary: d.primary, - $ref: d.ref, - type: d.type, - value: d.value, - })); - -export const marshalCreateAccountGroupRequestSchema: z.ZodType = z - .object({ - displayName: z.string().optional(), - externalId: z.string().optional(), - id: z.string().optional(), - members: z.array(z.lazy(() => marshalAccountComplexValueSchema)).optional(), - meta: z.lazy(() => marshalAccountResourceMetaSchema).optional(), - roles: z.array(z.lazy(() => marshalAccountComplexValueSchema)).optional(), - accountId: z.string().optional(), - }) - .transform(d => ({ - displayName: d.displayName, - externalId: d.externalId, - id: d.id, - members: d.members, - meta: d.meta, - roles: d.roles, - account_id: d.accountId, - })); - export const marshalCreateAccountServicePrincipalRequestSchema: z.ZodType = z .object({ active: z.boolean().optional(), @@ -1480,7 +1548,9 @@ export const marshalCreateAccountServicePrincipalRequestSchema: z.ZodType = z displayName: z.string().optional(), externalId: z.string().optional(), id: z.string().optional(), - roles: z.array(z.lazy(() => marshalAccountComplexValueSchema)).optional(), + roles: z + .array(z.lazy(() => marshalCreateAccountComplexValueSchema)) + .optional(), accountId: z.string().optional(), }) .transform(d => ({ @@ -1497,11 +1567,15 @@ export const marshalCreateAccountUserRequestSchema: z.ZodType = z .object({ active: z.boolean().optional(), displayName: z.string().optional(), - emails: z.array(z.lazy(() => marshalAccountComplexValueSchema)).optional(), + emails: z + .array(z.lazy(() => marshalCreateAccountComplexValueSchema)) + .optional(), externalId: z.string().optional(), id: z.string().optional(), - name: z.lazy(() => marshalAccountNameSchema).optional(), - roles: z.array(z.lazy(() => marshalAccountComplexValueSchema)).optional(), + name: z.lazy(() => marshalCreateAccountNameSchema).optional(), + roles: z + .array(z.lazy(() => marshalCreateAccountComplexValueSchema)) + .optional(), userName: z.string().optional(), accountId: z.string().optional(), }) @@ -1517,16 +1591,49 @@ export const marshalCreateAccountUserRequestSchema: z.ZodType = z account_id: d.accountId, })); +export const marshalCreateComplexValueSchema: z.ZodType = z + .object({ + display: z.string().optional(), + primary: z.boolean().optional(), + ref: z.string().optional(), + type: z.string().optional(), + value: z.string().optional(), + }) + .transform(d => ({ + display: d.display, + primary: d.primary, + $ref: d.ref, + type: d.type, + value: d.value, + })); + +export const marshalCreateCreatePasswordAccessControlRequestSchema: z.ZodType = + z + .object({ + groupName: z.string().optional(), + permissionLevel: z.string().optional(), + servicePrincipalName: z.string().optional(), + userName: z.string().optional(), + }) + .transform(d => ({ + group_name: d.groupName, + permission_level: d.permissionLevel, + service_principal_name: d.servicePrincipalName, + user_name: d.userName, + })); + export const marshalCreateGroupRequestSchema: z.ZodType = z .object({ displayName: z.string().optional(), - entitlements: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + entitlements: z + .array(z.lazy(() => marshalCreateComplexValueSchema)) + .optional(), externalId: z.string().optional(), - groups: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + groups: z.array(z.lazy(() => marshalCreateComplexValueSchema)).optional(), id: z.string().optional(), - members: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), - meta: z.lazy(() => marshalResourceMetaSchema).optional(), - roles: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + members: z.array(z.lazy(() => marshalCreateComplexValueSchema)).optional(), + meta: z.lazy(() => marshalCreateResourceMetaSchema).optional(), + roles: z.array(z.lazy(() => marshalCreateComplexValueSchema)).optional(), schemas: z.array(z.string()).optional(), }) .transform(d => ({ @@ -1541,16 +1648,48 @@ export const marshalCreateGroupRequestSchema: z.ZodType = z schemas: d.schemas, })); +export const marshalCreateNameSchema: z.ZodType = z + .object({ + familyName: z.string().optional(), + givenName: z.string().optional(), + }) + .transform(d => ({ + familyName: d.familyName, + givenName: d.givenName, + })); + +export const marshalCreatePatchSchema: z.ZodType = z + .object({ + op: z.string().optional(), + path: z.string().optional(), + value: jsonValueSchema.optional(), + }) + .transform(d => ({ + op: d.op, + path: d.path, + value: d.value, + })); + +export const marshalCreateResourceMetaSchema: z.ZodType = z + .object({ + resourceType: z.string().optional(), + }) + .transform(d => ({ + resourceType: d.resourceType, + })); + export const marshalCreateServicePrincipalRequestSchema: z.ZodType = z .object({ active: z.boolean().optional(), applicationId: z.string().optional(), displayName: z.string().optional(), - entitlements: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + entitlements: z + .array(z.lazy(() => marshalCreateComplexValueSchema)) + .optional(), externalId: z.string().optional(), - groups: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + groups: z.array(z.lazy(() => marshalCreateComplexValueSchema)).optional(), id: z.string().optional(), - roles: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + roles: z.array(z.lazy(() => marshalCreateComplexValueSchema)).optional(), schemas: z.array(z.string()).optional(), }) .transform(d => ({ @@ -1569,13 +1708,15 @@ export const marshalCreateUserRequestSchema: z.ZodType = z .object({ active: z.boolean().optional(), displayName: z.string().optional(), - emails: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), - entitlements: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + emails: z.array(z.lazy(() => marshalCreateComplexValueSchema)).optional(), + entitlements: z + .array(z.lazy(() => marshalCreateComplexValueSchema)) + .optional(), externalId: z.string().optional(), - groups: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + groups: z.array(z.lazy(() => marshalCreateComplexValueSchema)).optional(), id: z.string().optional(), - name: z.lazy(() => marshalNameSchema).optional(), - roles: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + name: z.lazy(() => marshalCreateNameSchema).optional(), + roles: z.array(z.lazy(() => marshalCreateComplexValueSchema)).optional(), schemas: z.array(z.string()).optional(), userName: z.string().optional(), }) @@ -1593,56 +1734,24 @@ export const marshalCreateUserRequestSchema: z.ZodType = z userName: d.userName, })); -export const marshalNameSchema: z.ZodType = z - .object({ - familyName: z.string().optional(), - givenName: z.string().optional(), - }) - .transform(d => ({ - familyName: d.familyName, - givenName: d.givenName, - })); - -export const marshalPasswordAccessControlRequestSchema: z.ZodType = z - .object({ - groupName: z.string().optional(), - permissionLevel: z.string().optional(), - servicePrincipalName: z.string().optional(), - userName: z.string().optional(), - }) - .transform(d => ({ - group_name: d.groupName, - permission_level: d.permissionLevel, - service_principal_name: d.servicePrincipalName, - user_name: d.userName, - })); - export const marshalPasswordPermissionsRequestSchema: z.ZodType = z .object({ accessControlList: z - .array(z.lazy(() => marshalPasswordAccessControlRequestSchema)) + .array( + z.lazy(() => marshalCreateCreatePasswordAccessControlRequestSchema) + ) .optional(), }) .transform(d => ({ access_control_list: d.accessControlList, })); -export const marshalPatchSchema: z.ZodType = z - .object({ - op: z.string().optional(), - path: z.string().optional(), - value: jsonValueSchema.optional(), - }) - .transform(d => ({ - op: d.op, - path: d.path, - value: d.value, - })); - export const marshalPatchAccountGroupRequestSchema: z.ZodType = z .object({ id: z.string().optional(), - operations: z.array(z.lazy(() => marshalAccountPatchSchema)).optional(), + operations: z + .array(z.lazy(() => marshalCreateAccountPatchSchema)) + .optional(), schemas: z.array(z.string()).optional(), accountId: z.string().optional(), }) @@ -1656,7 +1765,9 @@ export const marshalPatchAccountGroupRequestSchema: z.ZodType = z export const marshalPatchAccountServicePrincipalRequestSchema: z.ZodType = z .object({ id: z.string().optional(), - operations: z.array(z.lazy(() => marshalAccountPatchSchema)).optional(), + operations: z + .array(z.lazy(() => marshalCreateAccountPatchSchema)) + .optional(), schemas: z.array(z.string()).optional(), accountId: z.string().optional(), }) @@ -1670,7 +1781,9 @@ export const marshalPatchAccountServicePrincipalRequestSchema: z.ZodType = z export const marshalPatchAccountUserRequestSchema: z.ZodType = z .object({ id: z.string().optional(), - operations: z.array(z.lazy(() => marshalAccountPatchSchema)).optional(), + operations: z + .array(z.lazy(() => marshalCreateAccountPatchSchema)) + .optional(), schemas: z.array(z.string()).optional(), accountId: z.string().optional(), }) @@ -1684,7 +1797,7 @@ export const marshalPatchAccountUserRequestSchema: z.ZodType = z export const marshalPatchGroupRequestSchema: z.ZodType = z .object({ id: z.string().optional(), - operations: z.array(z.lazy(() => marshalPatchSchema)).optional(), + operations: z.array(z.lazy(() => marshalCreatePatchSchema)).optional(), schemas: z.array(z.string()).optional(), }) .transform(d => ({ @@ -1696,7 +1809,7 @@ export const marshalPatchGroupRequestSchema: z.ZodType = z export const marshalPatchServicePrincipalRequestSchema: z.ZodType = z .object({ id: z.string().optional(), - operations: z.array(z.lazy(() => marshalPatchSchema)).optional(), + operations: z.array(z.lazy(() => marshalCreatePatchSchema)).optional(), schemas: z.array(z.string()).optional(), }) .transform(d => ({ @@ -1708,7 +1821,7 @@ export const marshalPatchServicePrincipalRequestSchema: z.ZodType = z export const marshalPatchUserRequestSchema: z.ZodType = z .object({ id: z.string().optional(), - operations: z.array(z.lazy(() => marshalPatchSchema)).optional(), + operations: z.array(z.lazy(() => marshalCreatePatchSchema)).optional(), schemas: z.array(z.string()).optional(), }) .transform(d => ({ @@ -1717,22 +1830,18 @@ export const marshalPatchUserRequestSchema: z.ZodType = z schemas: d.schemas, })); -export const marshalResourceMetaSchema: z.ZodType = z - .object({ - resourceType: z.string().optional(), - }) - .transform(d => ({ - resourceType: d.resourceType, - })); - export const marshalUpdateAccountGroupRequestSchema: z.ZodType = z .object({ displayName: z.string().optional(), externalId: z.string().optional(), id: z.string().optional(), - members: z.array(z.lazy(() => marshalAccountComplexValueSchema)).optional(), - meta: z.lazy(() => marshalAccountResourceMetaSchema).optional(), - roles: z.array(z.lazy(() => marshalAccountComplexValueSchema)).optional(), + members: z + .array(z.lazy(() => marshalCreateAccountComplexValueSchema)) + .optional(), + meta: z.lazy(() => marshalCreateAccountResourceMetaSchema).optional(), + roles: z + .array(z.lazy(() => marshalCreateAccountComplexValueSchema)) + .optional(), accountId: z.string().optional(), }) .transform(d => ({ @@ -1752,7 +1861,9 @@ export const marshalUpdateAccountServicePrincipalRequestSchema: z.ZodType = z displayName: z.string().optional(), externalId: z.string().optional(), id: z.string().optional(), - roles: z.array(z.lazy(() => marshalAccountComplexValueSchema)).optional(), + roles: z + .array(z.lazy(() => marshalCreateAccountComplexValueSchema)) + .optional(), accountId: z.string().optional(), }) .transform(d => ({ @@ -1769,11 +1880,15 @@ export const marshalUpdateAccountUserRequestSchema: z.ZodType = z .object({ active: z.boolean().optional(), displayName: z.string().optional(), - emails: z.array(z.lazy(() => marshalAccountComplexValueSchema)).optional(), + emails: z + .array(z.lazy(() => marshalCreateAccountComplexValueSchema)) + .optional(), externalId: z.string().optional(), id: z.string().optional(), - name: z.lazy(() => marshalAccountNameSchema).optional(), - roles: z.array(z.lazy(() => marshalAccountComplexValueSchema)).optional(), + name: z.lazy(() => marshalCreateAccountNameSchema).optional(), + roles: z + .array(z.lazy(() => marshalCreateAccountComplexValueSchema)) + .optional(), userName: z.string().optional(), accountId: z.string().optional(), }) @@ -1792,13 +1907,15 @@ export const marshalUpdateAccountUserRequestSchema: z.ZodType = z export const marshalUpdateGroupRequestSchema: z.ZodType = z .object({ displayName: z.string().optional(), - entitlements: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + entitlements: z + .array(z.lazy(() => marshalCreateComplexValueSchema)) + .optional(), externalId: z.string().optional(), - groups: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + groups: z.array(z.lazy(() => marshalCreateComplexValueSchema)).optional(), id: z.string().optional(), - members: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), - meta: z.lazy(() => marshalResourceMetaSchema).optional(), - roles: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + members: z.array(z.lazy(() => marshalCreateComplexValueSchema)).optional(), + meta: z.lazy(() => marshalCreateResourceMetaSchema).optional(), + roles: z.array(z.lazy(() => marshalCreateComplexValueSchema)).optional(), schemas: z.array(z.string()).optional(), }) .transform(d => ({ @@ -1818,11 +1935,13 @@ export const marshalUpdateServicePrincipalRequestSchema: z.ZodType = z active: z.boolean().optional(), applicationId: z.string().optional(), displayName: z.string().optional(), - entitlements: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + entitlements: z + .array(z.lazy(() => marshalCreateComplexValueSchema)) + .optional(), externalId: z.string().optional(), - groups: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + groups: z.array(z.lazy(() => marshalCreateComplexValueSchema)).optional(), id: z.string().optional(), - roles: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + roles: z.array(z.lazy(() => marshalCreateComplexValueSchema)).optional(), schemas: z.array(z.string()).optional(), }) .transform(d => ({ @@ -1841,13 +1960,15 @@ export const marshalUpdateUserRequestSchema: z.ZodType = z .object({ active: z.boolean().optional(), displayName: z.string().optional(), - emails: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), - entitlements: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + emails: z.array(z.lazy(() => marshalCreateComplexValueSchema)).optional(), + entitlements: z + .array(z.lazy(() => marshalCreateComplexValueSchema)) + .optional(), externalId: z.string().optional(), - groups: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + groups: z.array(z.lazy(() => marshalCreateComplexValueSchema)).optional(), id: z.string().optional(), - name: z.lazy(() => marshalNameSchema).optional(), - roles: z.array(z.lazy(() => marshalComplexValueSchema)).optional(), + name: z.lazy(() => marshalCreateNameSchema).optional(), + roles: z.array(z.lazy(() => marshalCreateComplexValueSchema)).optional(), schemas: z.array(z.string()).optional(), userName: z.string().optional(), }) diff --git a/packages/secrets/src/v1/index.ts b/packages/secrets/src/v1/index.ts index a05d3aae..8307036e 100755 --- a/packages/secrets/src/v1/index.ts +++ b/packages/secrets/src/v1/index.ts @@ -11,6 +11,7 @@ export {AclPermission, ScopeBackendType} from './model'; export type { AclItem, AzureKeyVaultSecretScopeMetadata, + CreateAzureKeyVaultSecretScopeMetadata, CreateScopeRequest, CreateScopeResponse, DeleteAclRequest, diff --git a/packages/secrets/src/v1/model.ts b/packages/secrets/src/v1/model.ts index e17a479a..55687206 100755 --- a/packages/secrets/src/v1/model.ts +++ b/packages/secrets/src/v1/model.ts @@ -56,6 +56,14 @@ export interface AzureKeyVaultSecretScopeMetadata { dnsName?: string | undefined; } +/** The metadata of the Azure KeyVault for a secret scope of type `AZURE_KEYVAULT` */ +export interface CreateAzureKeyVaultSecretScopeMetadata { + /** The resource id of the azure KeyVault that user wants to associate the scope with. */ + resourceId: string; + /** The DNS of the KeyVault */ + dnsName: string; +} + export interface CreateScopeRequest { /** Scope name requested by the user. Scope names are unique. */ scope?: string | undefined; @@ -64,7 +72,7 @@ export interface CreateScopeRequest { /** The backend type the scope will be created with. If not specified, will default to ``DATABRICKS`` */ scopeBackendType?: ScopeBackendType | undefined; /** The metadata for the secret scope if the type is ``AZURE_KEYVAULT`` */ - backendAzureKeyvault?: AzureKeyVaultSecretScopeMetadata | undefined; + backendAzureKeyvault?: CreateAzureKeyVaultSecretScopeMetadata | undefined; } // eslint-disable-next-line @typescript-eslint/no-empty-object-type @@ -311,10 +319,10 @@ export const unmarshalSecretScopeSchema: z.ZodType = z keyvaultMetadata: d.keyvault_metadata, })); -export const marshalAzureKeyVaultSecretScopeMetadataSchema: z.ZodType = z +export const marshalCreateAzureKeyVaultSecretScopeMetadataSchema: z.ZodType = z .object({ - resourceId: z.string().optional(), - dnsName: z.string().optional(), + resourceId: z.string(), + dnsName: z.string(), }) .transform(d => ({ resource_id: d.resourceId, @@ -327,7 +335,7 @@ export const marshalCreateScopeRequestSchema: z.ZodType = z initialManagePrincipal: z.string().optional(), scopeBackendType: z.string().optional(), backendAzureKeyvault: z - .lazy(() => marshalAzureKeyVaultSecretScopeMetadataSchema) + .lazy(() => marshalCreateAzureKeyVaultSecretScopeMetadataSchema) .optional(), }) .transform(d => ({ diff --git a/packages/settings/src/v2/client.ts b/packages/settings/src/v2/client.ts index 83add648..91172b75 100644 --- a/packages/settings/src/v2/client.ts +++ b/packages/settings/src/v2/client.ts @@ -34,8 +34,8 @@ import type { UserPreference, } from './model'; import { - marshalSettingSchema, - marshalUserPreferenceSchema, + marshalCreateSettingSchema, + marshalCreateUserPreferenceSchema, unmarshalListAccountSettingsMetadataResponseSchema, unmarshalListAccountUserPreferencesMetadataResponseSchema, unmarshalListWorkspaceSettingsMetadataResponseSchema, @@ -358,7 +358,7 @@ export class SettingsClient { ): Promise { const {host, accountId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.1/accounts/${req.accountId ?? accountId ?? ''}/settings/${req.name ?? ''}`; - const body = marshalRequest(req.setting, marshalSettingSchema); + const body = marshalRequest(req.setting, marshalCreateSettingSchema); let resp: Setting | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -391,7 +391,7 @@ export class SettingsClient { ): Promise { const {host, accountId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.1/accounts/${req.accountId ?? accountId ?? ''}/users/${req.userId ?? ''}/settings/${req.name ?? ''}`; - const body = marshalRequest(req.setting, marshalUserPreferenceSchema); + const body = marshalRequest(req.setting, marshalCreateUserPreferenceSchema); let resp: UserPreference | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -423,7 +423,7 @@ export class SettingsClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.1/settings/${req.name ?? ''}`; - const body = marshalRequest(req.setting, marshalSettingSchema); + const body = marshalRequest(req.setting, marshalCreateSettingSchema); let resp: Setting | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/settings/src/v2/index.ts b/packages/settings/src/v2/index.ts index 4b79439e..eaf75b7e 100755 --- a/packages/settings/src/v2/index.ts +++ b/packages/settings/src/v2/index.ts @@ -22,11 +22,28 @@ export type { AllowedAppsUserApiScopesMessage, BooleanMessage, ClusterAutoRestartMessage, + ClusterAutoRestartMessage_CreateEnablementDetails, + ClusterAutoRestartMessage_CreateMaintenanceWindow, ClusterAutoRestartMessage_EnablementDetails, ClusterAutoRestartMessage_MaintenanceWindow, + ClusterAutoRestartMessage_MaintenanceWindow_CreateWeekDayBasedSchedule, + ClusterAutoRestartMessage_MaintenanceWindow_CreateWindowStartTime, ClusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedSchedule, ClusterAutoRestartMessage_MaintenanceWindow_WindowStartTime, CollaborationPlatformConnectivityMessage, + CreateAibiDashboardEmbeddingAccessPolicy, + CreateAibiDashboardEmbeddingApprovedDomains, + CreateAllowedAppsUserApiScopesMessage, + CreateBooleanMessage, + CreateClusterAutoRestartMessage, + CreateCollaborationPlatformConnectivityMessage, + CreateIntegerMessage, + CreateOperationalEmailCustomRecipientMessage, + CreatePersonalComputeMessage, + CreateRestrictWorkspaceAdminsMessage, + CreateSetting, + CreateStringMessage, + CreateUserPreference, GetPublicAccountSettingRequest, GetPublicAccountUserPreferenceRequest, GetPublicWorkspaceSettingRequest, diff --git a/packages/settings/src/v2/model.ts b/packages/settings/src/v2/model.ts index 26ca8b2e..07a612fe 100755 --- a/packages/settings/src/v2/model.ts +++ b/packages/settings/src/v2/model.ts @@ -149,6 +149,31 @@ export interface ClusterAutoRestartMessage { restartEvenIfNoUpdatesAvailable?: boolean | undefined; } +/** + * Contains an information about the enablement status judging (e.g. whether the enterprise tier + * is enabled) + * This is only additional information that MUST NOT be used to decide whether the setting is + * enabled or not. This is intended to use only for purposes like showing an error message to + * the customer with the additional details. For example, using these details we can check + * why exactly the feature is disabled for this customer. + */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface ClusterAutoRestartMessage_CreateEnablementDetails { + /** The feature is unavailable if the customer doesn't have enterprise tier */ + unavailableForNonEnterpriseTier?: boolean | undefined; + /** The feature is unavailable if the corresponding entitlement disabled (see getShieldEntitlementEnable) */ + unavailableForDisabledEntitlement?: boolean | undefined; + /** The feature is force enabled if compliance mode is active */ + forcedForComplianceMode?: boolean | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface ClusterAutoRestartMessage_CreateMaintenanceWindow { + weekDayBasedSchedule?: + | ClusterAutoRestartMessage_MaintenanceWindow_CreateWeekDayBasedSchedule + | undefined; +} + /** * Contains an information about the enablement status judging (e.g. whether the enterprise tier * is enabled) @@ -174,6 +199,23 @@ export interface ClusterAutoRestartMessage_MaintenanceWindow { | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface ClusterAutoRestartMessage_MaintenanceWindow_CreateWeekDayBasedSchedule { + frequency?: + | ClusterAutoRestartMessage_MaintenanceWindow_WeekDayFrequency + | undefined; + dayOfWeek?: ClusterAutoRestartMessage_MaintenanceWindow_DayOfWeek | undefined; + windowStartTime?: + | ClusterAutoRestartMessage_MaintenanceWindow_CreateWindowStartTime + | undefined; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface ClusterAutoRestartMessage_MaintenanceWindow_CreateWindowStartTime { + hours?: number | undefined; + minutes?: number | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface ClusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedSchedule { frequency?: @@ -201,6 +243,188 @@ export interface CollaborationPlatformConnectivityMessage { | undefined; } +export interface CreateAibiDashboardEmbeddingAccessPolicy { + accessPolicyType: AibiDashboardEmbeddingAccessPolicy_AccessPolicyType; +} + +export interface CreateAibiDashboardEmbeddingApprovedDomains { + approvedDomains?: string[] | undefined; +} + +export interface CreateAllowedAppsUserApiScopesMessage { + allowedScopes?: string[] | undefined; +} + +export interface CreateBooleanMessage { + value?: boolean | undefined; +} + +export interface CreateClusterAutoRestartMessage { + enabled?: boolean | undefined; + canToggle?: boolean | undefined; + maintenanceWindow?: + | ClusterAutoRestartMessage_CreateMaintenanceWindow + | undefined; + enablementDetails?: + | ClusterAutoRestartMessage_CreateEnablementDetails + | undefined; + restartEvenIfNoUpdatesAvailable?: boolean | undefined; +} + +/** + * Controls which external collaboration platforms (Slack, Microsoft Teams) can connect + * to a workspace. Defaults to ALLOW_ALL. + */ +export interface CreateCollaborationPlatformConnectivityMessage { + connectivity: CollaborationPlatformConnectivityMessage_Connectivity; +} + +export interface CreateIntegerMessage { + value?: number | undefined; +} + +export interface CreateOperationalEmailCustomRecipientMessage { + email?: string | undefined; +} + +export interface CreatePersonalComputeMessage { + value?: PersonalComputeMessage_PersonalComputeMessageEnum | undefined; +} + +export interface CreateRestrictWorkspaceAdminsMessage { + status: RestrictWorkspaceAdminsMessage_Status; + /** + * When true, workspace admins cannot create governance tags. + * ALLOW_ALL status does not override this; they are independent. + */ + disableGovTagCreation?: boolean | undefined; +} + +export interface CreateSetting { + /** Name of the setting. */ + name?: string | undefined; + /** + * New fields should be added before the oneof below - unless it's a new Setting value message, + * in that case it needs to be defined in the oneof below. + * The user-set value that goes into storage + */ + value?: + | { + $case: 'booleanVal'; + /** Setting value for boolean type setting. This is the setting value set by consumers, check effective_boolean_val for final setting value. */ + booleanVal: CreateBooleanMessage; + } + | { + $case: 'stringVal'; + /** Setting value for string type setting. This is the setting value set by consumers, check effective_string_val for final setting value. */ + stringVal: CreateStringMessage; + } + | { + $case: 'integerVal'; + /** Setting value for integer type setting. This is the setting value set by consumers, check effective_integer_val for final setting value. */ + integerVal: CreateIntegerMessage; + } + | { + $case: 'automaticClusterUpdateWorkspace'; + /** Setting value for automatic_cluster_update_workspace setting. This is the setting value set by consumers, check effective_automatic_cluster_update_workspace for final setting value. */ + automaticClusterUpdateWorkspace: CreateClusterAutoRestartMessage; + } + | { + $case: 'aibiDashboardEmbeddingApprovedDomains'; + /** Setting value for aibi_dashboard_embedding_approved_domains setting. This is the setting value set by consumers, check effective_aibi_dashboard_embedding_approved_domains for final setting value. */ + aibiDashboardEmbeddingApprovedDomains: CreateAibiDashboardEmbeddingApprovedDomains; + } + | { + $case: 'aibiDashboardEmbeddingAccessPolicy'; + /** Setting value for aibi_dashboard_embedding_access_policy setting. This is the setting value set by consumers, check effective_aibi_dashboard_embedding_access_policy for final setting value. */ + aibiDashboardEmbeddingAccessPolicy: CreateAibiDashboardEmbeddingAccessPolicy; + } + | { + $case: 'restrictWorkspaceAdmins'; + /** Setting value for restrict_workspace_admins setting. This is the setting value set by consumers, check effective_restrict_workspace_admins for final setting value. */ + restrictWorkspaceAdmins: CreateRestrictWorkspaceAdminsMessage; + } + | { + $case: 'personalCompute'; + /** Setting value for personal_compute setting. This is the setting value set by consumers, check effective_personal_compute for final setting value. */ + personalCompute: CreatePersonalComputeMessage; + } + | { + $case: 'allowedAppsUserApiScopes'; + /** Setting value for allowed_apps_user_api_scopes setting. This is the setting value set by consumers, check effective_allowed_apps_user_api_scopes for final setting value. */ + allowedAppsUserApiScopes: CreateAllowedAppsUserApiScopesMessage; + } + | { + $case: 'operationalEmailCustomRecipient'; + /** Setting value for operational_email_custom_recipient setting. This is the setting value set by consumers, check effective_operational_email_custom_recipient for final setting value. */ + operationalEmailCustomRecipient: CreateOperationalEmailCustomRecipientMessage; + } + | { + $case: 'collaborationPlatformConnectivity'; + /** Setting value for collaboration_platform_connectivity setting. This is the setting value set by consumers, check effective_collaboration_platform_connectivity for final setting value. */ + collaborationPlatformConnectivity: CreateCollaborationPlatformConnectivityMessage; + } + | undefined; + /** + * New fields should be added before the oneof below - unless it's a new Setting value message, + * in that case it needs to be defined in the oneof below. + * The final effective value from server as per the policy evaluation. + */ + effectiveValue?: + | { + $case: 'effectiveAutomaticClusterUpdateWorkspace'; + /** Effective setting value for automatic_cluster_update_workspace setting. This is the final effective value of setting. To set a value use automatic_cluster_update_workspace. */ + effectiveAutomaticClusterUpdateWorkspace: CreateClusterAutoRestartMessage; + } + | { + $case: 'effectiveAibiDashboardEmbeddingApprovedDomains'; + /** Effective setting value for aibi_dashboard_embedding_approved_domains setting. This is the final effective value of setting. To set a value use aibi_dashboard_embedding_approved_domains. */ + effectiveAibiDashboardEmbeddingApprovedDomains: CreateAibiDashboardEmbeddingApprovedDomains; + } + | { + $case: 'effectiveAibiDashboardEmbeddingAccessPolicy'; + /** Effective setting value for aibi_dashboard_embedding_access_policy setting. This is the final effective value of setting. To set a value use aibi_dashboard_embedding_access_policy. */ + effectiveAibiDashboardEmbeddingAccessPolicy: CreateAibiDashboardEmbeddingAccessPolicy; + } + | { + $case: 'effectiveRestrictWorkspaceAdmins'; + /** Effective setting value for restrict_workspace_admins setting. This is the final effective value of setting. To set a value use restrict_workspace_admins. */ + effectiveRestrictWorkspaceAdmins: CreateRestrictWorkspaceAdminsMessage; + } + | { + $case: 'effectivePersonalCompute'; + /** Effective setting value for personal_compute setting. This is the final effective value of setting. To set a value use personal_compute. */ + effectivePersonalCompute: CreatePersonalComputeMessage; + } + | undefined; +} + +export interface CreateStringMessage { + /** Represents a generic string value. */ + value?: string | undefined; +} + +/** + * User Preference represents a user-specific setting scoped to an individual user within an account. + * Unlike workspace or account settings that apply to all users, user preferences allow personal + * customization (e.g., UI theme, editor preferences) without affecting other users. + */ +export interface CreateUserPreference { + /** Name of the setting. */ + name?: string | undefined; + /** User ID of the user. */ + userId?: string | undefined; + /** + * New fields should be added before the oneof below - unless it's a new Setting value message, + * in that case it needs to be defined in the oneof below. + * The user-set value that goes into storage. + */ + value?: + | {$case: 'booleanVal'; booleanVal: CreateBooleanMessage} + | {$case: 'stringVal'; stringVal: CreateStringMessage} + | undefined; +} + export interface GetPublicAccountSettingRequest { accountId?: string | undefined; name?: string | undefined; @@ -319,7 +543,7 @@ export interface PatchPublicAccountSettingRequest { /** account ID of the account being managed. */ accountId?: string | undefined; name?: string | undefined; - setting?: Setting | undefined; + setting?: CreateSetting | undefined; } export interface PatchPublicAccountUserPreferenceRequest { @@ -328,13 +552,13 @@ export interface PatchPublicAccountUserPreferenceRequest { /** User ID of the user whose setting is being updated. */ userId?: string | undefined; name?: string | undefined; - setting?: UserPreference | undefined; + setting?: CreateUserPreference | undefined; } export interface PatchPublicWorkspaceSettingRequest { /** Name of the setting */ name?: string | undefined; - setting?: Setting | undefined; + setting?: CreateSetting | undefined; } export interface PersonalComputeMessage { @@ -987,60 +1211,8 @@ export const unmarshalUserPreferenceSchema: z.ZodType = z : undefined, })); -export const marshalAibiDashboardEmbeddingAccessPolicySchema: z.ZodType = z - .object({ - accessPolicyType: z.string().optional(), - }) - .transform(d => ({ - access_policy_type: d.accessPolicyType, - })); - -export const marshalAibiDashboardEmbeddingApprovedDomainsSchema: z.ZodType = z - .object({ - approvedDomains: z.array(z.string()).optional(), - }) - .transform(d => ({ - approved_domains: d.approvedDomains, - })); - -export const marshalAllowedAppsUserApiScopesMessageSchema: z.ZodType = z - .object({ - allowedScopes: z.array(z.string()).optional(), - }) - .transform(d => ({ - allowed_scopes: d.allowedScopes, - })); - -export const marshalBooleanMessageSchema: z.ZodType = z - .object({ - value: z.boolean().optional(), - }) - .transform(d => ({ - value: d.value, - })); - -export const marshalClusterAutoRestartMessageSchema: z.ZodType = z - .object({ - enabled: z.boolean().optional(), - canToggle: z.boolean().optional(), - maintenanceWindow: z - .lazy(() => marshalClusterAutoRestartMessage_MaintenanceWindowSchema) - .optional(), - enablementDetails: z - .lazy(() => marshalClusterAutoRestartMessage_EnablementDetailsSchema) - .optional(), - restartEvenIfNoUpdatesAvailable: z.boolean().optional(), - }) - .transform(d => ({ - enabled: d.enabled, - can_toggle: d.canToggle, - maintenance_window: d.maintenanceWindow, - enablement_details: d.enablementDetails, - restart_even_if_no_updates_available: d.restartEvenIfNoUpdatesAvailable, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalClusterAutoRestartMessage_EnablementDetailsSchema: z.ZodType = +export const marshalClusterAutoRestartMessage_CreateEnablementDetailsSchema: z.ZodType = z .object({ unavailableForNonEnterpriseTier: z.boolean().optional(), @@ -1054,13 +1226,13 @@ export const marshalClusterAutoRestartMessage_EnablementDetailsSchema: z.ZodType })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalClusterAutoRestartMessage_MaintenanceWindowSchema: z.ZodType = +export const marshalClusterAutoRestartMessage_CreateMaintenanceWindowSchema: z.ZodType = z .object({ weekDayBasedSchedule: z .lazy( () => - marshalClusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedScheduleSchema + marshalClusterAutoRestartMessage_MaintenanceWindow_CreateWeekDayBasedScheduleSchema ) .optional(), }) @@ -1069,7 +1241,7 @@ export const marshalClusterAutoRestartMessage_MaintenanceWindowSchema: z.ZodType })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalClusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedScheduleSchema: z.ZodType = +export const marshalClusterAutoRestartMessage_MaintenanceWindow_CreateWeekDayBasedScheduleSchema: z.ZodType = z .object({ frequency: z.string().optional(), @@ -1077,7 +1249,7 @@ export const marshalClusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedSche windowStartTime: z .lazy( () => - marshalClusterAutoRestartMessage_MaintenanceWindow_WindowStartTimeSchema + marshalClusterAutoRestartMessage_MaintenanceWindow_CreateWindowStartTimeSchema ) .optional(), }) @@ -1088,7 +1260,7 @@ export const marshalClusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedSche })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalClusterAutoRestartMessage_MaintenanceWindow_WindowStartTimeSchema: z.ZodType = +export const marshalClusterAutoRestartMessage_MaintenanceWindow_CreateWindowStartTimeSchema: z.ZodType = z .object({ hours: z.number().optional(), @@ -1099,32 +1271,91 @@ export const marshalClusterAutoRestartMessage_MaintenanceWindow_WindowStartTimeS minutes: d.minutes, })); -export const marshalCollaborationPlatformConnectivityMessageSchema: z.ZodType = +export const marshalCreateAibiDashboardEmbeddingAccessPolicySchema: z.ZodType = z .object({ - connectivity: z.string().optional(), + accessPolicyType: z.string(), }) .transform(d => ({ - connectivity: d.connectivity, + access_policy_type: d.accessPolicyType, })); -export const marshalIntegerMessageSchema: z.ZodType = z +export const marshalCreateAibiDashboardEmbeddingApprovedDomainsSchema: z.ZodType = + z + .object({ + approvedDomains: z.array(z.string()).optional(), + }) + .transform(d => ({ + approved_domains: d.approvedDomains, + })); + +export const marshalCreateAllowedAppsUserApiScopesMessageSchema: z.ZodType = z .object({ - value: z.number().optional(), + allowedScopes: z.array(z.string()).optional(), + }) + .transform(d => ({ + allowed_scopes: d.allowedScopes, + })); + +export const marshalCreateBooleanMessageSchema: z.ZodType = z + .object({ + value: z.boolean().optional(), }) .transform(d => ({ value: d.value, })); -export const marshalOperationalEmailCustomRecipientMessageSchema: z.ZodType = z +export const marshalCreateClusterAutoRestartMessageSchema: z.ZodType = z + .object({ + enabled: z.boolean().optional(), + canToggle: z.boolean().optional(), + maintenanceWindow: z + .lazy( + () => marshalClusterAutoRestartMessage_CreateMaintenanceWindowSchema + ) + .optional(), + enablementDetails: z + .lazy( + () => marshalClusterAutoRestartMessage_CreateEnablementDetailsSchema + ) + .optional(), + restartEvenIfNoUpdatesAvailable: z.boolean().optional(), + }) + .transform(d => ({ + enabled: d.enabled, + can_toggle: d.canToggle, + maintenance_window: d.maintenanceWindow, + enablement_details: d.enablementDetails, + restart_even_if_no_updates_available: d.restartEvenIfNoUpdatesAvailable, + })); + +export const marshalCreateCollaborationPlatformConnectivityMessageSchema: z.ZodType = + z + .object({ + connectivity: z.string(), + }) + .transform(d => ({ + connectivity: d.connectivity, + })); + +export const marshalCreateIntegerMessageSchema: z.ZodType = z .object({ - email: z.string().optional(), + value: z.number().optional(), }) .transform(d => ({ - email: d.email, + value: d.value, })); -export const marshalPersonalComputeMessageSchema: z.ZodType = z +export const marshalCreateOperationalEmailCustomRecipientMessageSchema: z.ZodType = + z + .object({ + email: z.string().optional(), + }) + .transform(d => ({ + email: d.email, + })); + +export const marshalCreatePersonalComputeMessageSchema: z.ZodType = z .object({ value: z.string().optional(), }) @@ -1132,9 +1363,9 @@ export const marshalPersonalComputeMessageSchema: z.ZodType = z value: d.value, })); -export const marshalRestrictWorkspaceAdminsMessageSchema: z.ZodType = z +export const marshalCreateRestrictWorkspaceAdminsMessageSchema: z.ZodType = z .object({ - status: z.string().optional(), + status: z.string(), disableGovTagCreation: z.boolean().optional(), }) .transform(d => ({ @@ -1142,131 +1373,103 @@ export const marshalRestrictWorkspaceAdminsMessageSchema: z.ZodType = z disable_gov_tag_creation: d.disableGovTagCreation, })); -export const marshalSettingSchema: z.ZodType = z +export const marshalCreateSettingSchema: z.ZodType = z .object({ name: z.string().optional(), value: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('booleanVal'), - booleanVal: z.lazy(() => marshalBooleanMessageSchema), + booleanVal: z.lazy(() => marshalCreateBooleanMessageSchema), }), z.object({ $case: z.literal('stringVal'), - stringVal: z.lazy(() => marshalStringMessageSchema), + stringVal: z.lazy(() => marshalCreateStringMessageSchema), }), z.object({ $case: z.literal('integerVal'), - integerVal: z.lazy(() => marshalIntegerMessageSchema), + integerVal: z.lazy(() => marshalCreateIntegerMessageSchema), }), z.object({ $case: z.literal('automaticClusterUpdateWorkspace'), automaticClusterUpdateWorkspace: z.lazy( - () => marshalClusterAutoRestartMessageSchema + () => marshalCreateClusterAutoRestartMessageSchema ), }), z.object({ $case: z.literal('aibiDashboardEmbeddingApprovedDomains'), aibiDashboardEmbeddingApprovedDomains: z.lazy( - () => marshalAibiDashboardEmbeddingApprovedDomainsSchema + () => marshalCreateAibiDashboardEmbeddingApprovedDomainsSchema ), }), z.object({ $case: z.literal('aibiDashboardEmbeddingAccessPolicy'), aibiDashboardEmbeddingAccessPolicy: z.lazy( - () => marshalAibiDashboardEmbeddingAccessPolicySchema + () => marshalCreateAibiDashboardEmbeddingAccessPolicySchema ), }), z.object({ $case: z.literal('restrictWorkspaceAdmins'), restrictWorkspaceAdmins: z.lazy( - () => marshalRestrictWorkspaceAdminsMessageSchema + () => marshalCreateRestrictWorkspaceAdminsMessageSchema ), }), z.object({ $case: z.literal('personalCompute'), - personalCompute: z.lazy(() => marshalPersonalComputeMessageSchema), + personalCompute: z.lazy( + () => marshalCreatePersonalComputeMessageSchema + ), }), z.object({ $case: z.literal('allowedAppsUserApiScopes'), allowedAppsUserApiScopes: z.lazy( - () => marshalAllowedAppsUserApiScopesMessageSchema + () => marshalCreateAllowedAppsUserApiScopesMessageSchema ), }), z.object({ $case: z.literal('operationalEmailCustomRecipient'), operationalEmailCustomRecipient: z.lazy( - () => marshalOperationalEmailCustomRecipientMessageSchema + () => marshalCreateOperationalEmailCustomRecipientMessageSchema ), }), z.object({ $case: z.literal('collaborationPlatformConnectivity'), collaborationPlatformConnectivity: z.lazy( - () => marshalCollaborationPlatformConnectivityMessageSchema + () => marshalCreateCollaborationPlatformConnectivityMessageSchema ), }), ]) .optional(), effectiveValue: z .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('effectiveBooleanVal'), - effectiveBooleanVal: z.lazy(() => marshalBooleanMessageSchema), - }), - z.object({ - $case: z.literal('effectiveStringVal'), - effectiveStringVal: z.lazy(() => marshalStringMessageSchema), - }), - z.object({ - $case: z.literal('effectiveIntegerVal'), - effectiveIntegerVal: z.lazy(() => marshalIntegerMessageSchema), - }), z.object({ $case: z.literal('effectiveAutomaticClusterUpdateWorkspace'), effectiveAutomaticClusterUpdateWorkspace: z.lazy( - () => marshalClusterAutoRestartMessageSchema + () => marshalCreateClusterAutoRestartMessageSchema ), }), z.object({ $case: z.literal('effectiveAibiDashboardEmbeddingApprovedDomains'), effectiveAibiDashboardEmbeddingApprovedDomains: z.lazy( - () => marshalAibiDashboardEmbeddingApprovedDomainsSchema + () => marshalCreateAibiDashboardEmbeddingApprovedDomainsSchema ), }), z.object({ $case: z.literal('effectiveAibiDashboardEmbeddingAccessPolicy'), effectiveAibiDashboardEmbeddingAccessPolicy: z.lazy( - () => marshalAibiDashboardEmbeddingAccessPolicySchema + () => marshalCreateAibiDashboardEmbeddingAccessPolicySchema ), }), z.object({ $case: z.literal('effectiveRestrictWorkspaceAdmins'), effectiveRestrictWorkspaceAdmins: z.lazy( - () => marshalRestrictWorkspaceAdminsMessageSchema + () => marshalCreateRestrictWorkspaceAdminsMessageSchema ), }), z.object({ $case: z.literal('effectivePersonalCompute'), effectivePersonalCompute: z.lazy( - () => marshalPersonalComputeMessageSchema - ), - }), - z.object({ - $case: z.literal('effectiveAllowedAppsUserApiScopes'), - effectiveAllowedAppsUserApiScopes: z.lazy( - () => marshalAllowedAppsUserApiScopesMessageSchema - ), - }), - z.object({ - $case: z.literal('effectiveOperationalEmailCustomRecipient'), - effectiveOperationalEmailCustomRecipient: z.lazy( - () => marshalOperationalEmailCustomRecipientMessageSchema - ), - }), - z.object({ - $case: z.literal('effectiveCollaborationPlatformConnectivity'), - effectiveCollaborationPlatformConnectivity: z.lazy( - () => marshalCollaborationPlatformConnectivityMessageSchema + () => marshalCreatePersonalComputeMessageSchema ), }), ]) @@ -1306,15 +1509,6 @@ export const marshalSettingSchema: z.ZodType = z collaboration_platform_connectivity: d.value.collaborationPlatformConnectivity, }), - ...(d.effectiveValue?.$case === 'effectiveBooleanVal' && { - effective_boolean_val: d.effectiveValue.effectiveBooleanVal, - }), - ...(d.effectiveValue?.$case === 'effectiveStringVal' && { - effective_string_val: d.effectiveValue.effectiveStringVal, - }), - ...(d.effectiveValue?.$case === 'effectiveIntegerVal' && { - effective_integer_val: d.effectiveValue.effectiveIntegerVal, - }), ...(d.effectiveValue?.$case === 'effectiveAutomaticClusterUpdateWorkspace' && { effective_automatic_cluster_update_workspace: @@ -1337,23 +1531,9 @@ export const marshalSettingSchema: z.ZodType = z ...(d.effectiveValue?.$case === 'effectivePersonalCompute' && { effective_personal_compute: d.effectiveValue.effectivePersonalCompute, }), - ...(d.effectiveValue?.$case === 'effectiveAllowedAppsUserApiScopes' && { - effective_allowed_apps_user_api_scopes: - d.effectiveValue.effectiveAllowedAppsUserApiScopes, - }), - ...(d.effectiveValue?.$case === - 'effectiveOperationalEmailCustomRecipient' && { - effective_operational_email_custom_recipient: - d.effectiveValue.effectiveOperationalEmailCustomRecipient, - }), - ...(d.effectiveValue?.$case === - 'effectiveCollaborationPlatformConnectivity' && { - effective_collaboration_platform_connectivity: - d.effectiveValue.effectiveCollaborationPlatformConnectivity, - }), })); -export const marshalStringMessageSchema: z.ZodType = z +export const marshalCreateStringMessageSchema: z.ZodType = z .object({ value: z.string().optional(), }) @@ -1361,7 +1541,7 @@ export const marshalStringMessageSchema: z.ZodType = z value: d.value, })); -export const marshalUserPreferenceSchema: z.ZodType = z +export const marshalCreateUserPreferenceSchema: z.ZodType = z .object({ name: z.string().optional(), userId: z.string().optional(), @@ -1369,23 +1549,11 @@ export const marshalUserPreferenceSchema: z.ZodType = z .discriminatedUnion('$case', [ z.object({ $case: z.literal('booleanVal'), - booleanVal: z.lazy(() => marshalBooleanMessageSchema), + booleanVal: z.lazy(() => marshalCreateBooleanMessageSchema), }), z.object({ $case: z.literal('stringVal'), - stringVal: z.lazy(() => marshalStringMessageSchema), - }), - ]) - .optional(), - effectiveValue: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('effectiveBooleanVal'), - effectiveBooleanVal: z.lazy(() => marshalBooleanMessageSchema), - }), - z.object({ - $case: z.literal('effectiveStringVal'), - effectiveStringVal: z.lazy(() => marshalStringMessageSchema), + stringVal: z.lazy(() => marshalCreateStringMessageSchema), }), ]) .optional(), @@ -1395,10 +1563,4 @@ export const marshalUserPreferenceSchema: z.ZodType = z user_id: d.userId, ...(d.value?.$case === 'booleanVal' && {boolean_val: d.value.booleanVal}), ...(d.value?.$case === 'stringVal' && {string_val: d.value.stringVal}), - ...(d.effectiveValue?.$case === 'effectiveBooleanVal' && { - effective_boolean_val: d.effectiveValue.effectiveBooleanVal, - }), - ...(d.effectiveValue?.$case === 'effectiveStringVal' && { - effective_string_val: d.effectiveValue.effectiveStringVal, - }), })); diff --git a/packages/sharing/src/v1/client.ts b/packages/sharing/src/v1/client.ts index 8a569e66..f05caf83 100755 --- a/packages/sharing/src/v1/client.ts +++ b/packages/sharing/src/v1/client.ts @@ -65,10 +65,10 @@ import type { UpdateShareRequest, } from './model'; import { + marshalCreateFederationPolicySchema, marshalCreateProviderRequestSchema, marshalCreateRecipientRequestSchema, marshalCreateShareRequestSchema, - marshalFederationPolicySchema, marshalRotateRecipientTokenRequestSchema, marshalUpdateProviderRequestSchema, marshalUpdateRecipientRequestSchema, @@ -154,7 +154,10 @@ export class SharingClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/data-sharing/recipients/${req.recipientName ?? ''}/federation-policies`; - const body = marshalRequest(req.policy, marshalFederationPolicySchema); + const body = marshalRequest( + req.policy, + marshalCreateFederationPolicySchema + ); let resp: FederationPolicy | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/sharing/src/v1/index.ts b/packages/sharing/src/v1/index.ts index d295a9a4..7e81dd83 100755 --- a/packages/sharing/src/v1/index.ts +++ b/packages/sharing/src/v1/index.ts @@ -19,10 +19,18 @@ export { } from './model'; export type { + CreateFederationPolicy, CreateFederationPolicyRequest, + CreateIpAccessList, + CreateOidcFederationPolicy, + CreatePermissionsChange, + CreatePropertiesKvPairs, CreateProviderRequest, + CreateRecipientProfile, CreateRecipientRequest, + CreateRecipientTokenInfo, CreateShareRequest, + CreateSharedDataObject, DeleteFederationPolicyRequest, DeleteProviderRequest, DeleteProviderResponse, @@ -63,7 +71,9 @@ export type { NotebookFile, OidcFederationPolicy, PartitionSpecification, + PartitionSpecification_CreatePartition, PartitionSpecification_Partition, + PartitionSpecification_Partition_CreatePartitionValue, PartitionSpecification_Partition_PartitionValue, PermissionsChange, PrivilegeAssignment, @@ -91,6 +101,7 @@ export type { UpdateSharePermissionsRequest, UpdateSharePermissionsResponse, UpdateShareRequest, + UpdateShareRequest_CreateSharedDataObjectUpdate, UpdateShareRequest_SharedDataObjectUpdate, Volume, } from './model'; diff --git a/packages/sharing/src/v1/model.ts b/packages/sharing/src/v1/model.ts index d63f239a..8448e485 100755 --- a/packages/sharing/src/v1/model.ts +++ b/packages/sharing/src/v1/model.ts @@ -133,11 +133,91 @@ export type UpdateShareRequest_SharedDataObjectUpdate_Action = | (typeof UpdateShareRequest_SharedDataObjectUpdate_Action)[keyof typeof UpdateShareRequest_SharedDataObjectUpdate_Action] | (string & {}); +export interface CreateFederationPolicy { + /** + * Name of the federation policy. A recipient can have multiple policies with different names. + * The name must contain only lowercase alphanumeric characters, numbers, and hyphens. + */ + name?: string | undefined; + policy?: + | { + $case: 'oidcPolicy'; + /** Specifies the policy to use for validating OIDC claims in the federated tokens. */ + oidcPolicy: CreateOidcFederationPolicy; + } + | undefined; + /** Description of the policy. This is a user-provided description. */ + comment?: string | undefined; +} + export interface CreateFederationPolicyRequest { /** Name of the recipient. This is the name of the recipient for which the policy is being created. */ recipientName?: string | undefined; /** Name of the policy. This is the name of the policy to be created. */ - policy?: FederationPolicy | undefined; + policy?: CreateFederationPolicy | undefined; +} + +export interface CreateIpAccessList { + /** Allowed IP Addresses in CIDR notation. Limit of 100. */ + allowedIpAddresses?: string[] | undefined; +} + +/** + * Specifies the policy to use for validating OIDC claims in your federated tokens from Delta Sharing Clients. + * Refer to https://docs.databricks.com/en/delta-sharing/create-recipient-oidc-fed for more details. + */ +export interface CreateOidcFederationPolicy { + /** The required token issuer, as specified in the 'iss' claim of federated tokens. */ + issuer: string; + /** + * The claim that contains the subject of the token. + * Depending on the identity provider and the use case (U2M or M2M), this can vary: + * - For Entra ID (AAD): + * * U2M flow (group access): Use `groups`. + * * U2M flow (user access): Use `oid`. + * * M2M flow (OAuth App access): Use `azp`. + * - For other IdPs, refer to the specific IdP documentation. + * + * Supported `subject_claim` values are: + * - `oid`: Object ID of the user. + * - `azp`: Client ID of the OAuth app. + * - `groups`: Object ID of the group. + * - `sub`: Subject identifier for other use cases. + */ + subjectClaim: string; + /** + * The required token subject, as specified in the subject claim of federated tokens. + * The subject claim identifies the identity of the user or machine accessing the resource. + * Examples for Entra ID (AAD): + * - U2M flow (group access): If the subject claim is `groups`, this must be the Object ID of the group in Entra ID. + * - U2M flow (user access): If the subject claim is `oid`, this must be the Object ID of the user in Entra ID. + * - M2M flow (OAuth App access): If the subject claim is `azp`, this must be the client ID of the OAuth app registered in Entra ID. + */ + subject: string; + /** + * The allowed token audiences, as specified in the 'aud' claim of federated tokens. + * The audience identifier is intended to represent the recipient of the token. + * Can be any non-empty string value. As long as the audience in the token matches at least one audience in the policy, + */ + audiences?: string[] | undefined; +} + +export interface CreatePermissionsChange { + /** + * The principal whose privileges we are changing. + * Only one of principal or principal_id should be specified, never both at the same time. + */ + principal?: string | undefined; + /** The set of privileges to add. */ + add?: string[] | undefined; + /** The set of privileges to remove. */ + remove?: string[] | undefined; +} + +/** An object with __properties__ containing map of key-value properties attached to the securable. */ +export interface CreatePropertiesKvPairs { + /** A map of key-value properties attached to the securable. */ + properties: Record; } export interface CreateProviderRequest { @@ -151,7 +231,7 @@ export interface CreateProviderRequest { /** Username of Provider owner. */ owner?: string | undefined; /** The recipient profile. This field is only present when the authentication_type is `TOKEN` or `OAUTH_CLIENT_CREDENTIALS`. */ - recipientProfile?: RecipientProfile | undefined; + recipientProfile?: CreateRecipientProfile | undefined; /** Time at which this Provider was created, in epoch milliseconds. */ createdAt?: bigint | undefined; /** Username of Provider creator. */ @@ -170,6 +250,15 @@ export interface CreateProviderRequest { dataProviderGlobalMetastoreId?: string | undefined; } +export interface CreateRecipientProfile { + /** The version number of the recipient's credentials on a share. */ + shareCredentialsVersion?: number | undefined; + /** The endpoint for the share to be used by the recipient. */ + endpoint?: string | undefined; + /** The token used to authorize the recipient. */ + bearerToken?: string | undefined; +} + export interface CreateRecipientRequest { /** Name of Recipient. */ name?: string | undefined; @@ -187,13 +276,13 @@ export interface CreateRecipientRequest { /** Description about the recipient. */ comment?: string | undefined; /** IP Access List */ - ipAccessList?: IpAccessList | undefined; + ipAccessList?: CreateIpAccessList | undefined; /** * Recipient properties as map of string key-value pairs. * When provided in update request, the specified properties will override the existing * properties. To add and remove properties, one would need to perform a read-modify-write. */ - propertiesKvpairs?: PropertiesKvPairs | undefined; + propertiesKvpairs?: CreatePropertiesKvPairs | undefined; /** Expiration timestamp of the token, in epoch milliseconds. */ expirationTime?: bigint | undefined; /** @@ -208,7 +297,7 @@ export interface CreateRecipientRequest { /** Username of recipient creator. */ createdBy?: string | undefined; /** This field is only present when the __authentication_type__ is **TOKEN**. */ - tokens?: RecipientTokenInfo[] | undefined; + tokens?: CreateRecipientTokenInfo[] | undefined; /** Time at which the recipient was updated, in epoch milliseconds. */ updatedAt?: bigint | undefined; /** Username of recipient updater. */ @@ -232,6 +321,9 @@ export interface CreateRecipientRequest { id?: string | undefined; } +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface CreateRecipientTokenInfo {} + export interface CreateShareRequest { /** Name of the share. */ name?: string | undefined; @@ -242,7 +334,7 @@ export interface CreateShareRequest { /** Storage root URL for the share. */ storageRoot?: string | undefined; /** A list of shared data objects within the share. */ - objects?: SharedDataObject[] | undefined; + objects?: CreateSharedDataObject[] | undefined; /** Time at which this share was created, in epoch milliseconds. */ createdAt?: bigint | undefined; /** Username of share creator. */ @@ -255,6 +347,96 @@ export interface CreateShareRequest { storageLocation?: string | undefined; } +export interface CreateSharedDataObject { + /** + * A fully qualified name that uniquely identifies a data object. + * For example, a table's fully qualified name is in the format of `..`, + */ + name: string; + /** The type of the data object. */ + dataObjectType?: string | undefined; + /** A user-provided comment when adding the data object to the share. */ + comment?: string | undefined; + /** + * A user-provided alias name for table-like data objects within the share. + * + * Use this field for table-like objects (for example: TABLE, VIEW, MATERIALIZED_VIEW, STREAMING_TABLE, FOREIGN_TABLE). + * For non-table objects (for example: VOLUME, MODEL, NOTEBOOK_FILE, FUNCTION), use `string_shared_as` instead. + * + * Important: For non-table objects, this field must be omitted entirely. + * + * Format: Must be a 2-part name `.` (e.g., "sales_schema.orders_table") + * - Both schema and table names must contain only alphanumeric characters and underscores + * - No periods, spaces, forward slashes, or control characters are allowed within each part + * - Do not include the catalog name (use 2 parts, not 3) + * + * Behavior: + * - If not provided, the service automatically generates the alias as `.
` from the object's original name + * - If you don't want to specify this field, omit it entirely from the request (do not pass an empty string) + * - The `shared_as` name must be unique within the share + * + * Examples: + * - Valid: "analytics_schema.customer_view" + * - Invalid: "catalog.analytics_schema.customer_view" (3 parts not allowed) + * - Invalid: "analytics-schema.customer-view" (hyphens not allowed) + */ + sharedAs?: string | undefined; + /** Whether to enable cdf or indicate if cdf is enabled on the shared object. */ + cdfEnabled?: boolean | undefined; + /** Whether to enable or disable sharing of data history. If not specified, the default is **DISABLED**. */ + historyDataSharingStatus?: + | SharedDataObject_HistoryDataSharingStatus_Enum + | undefined; + /** + * The start version associated with the object. + * This allows data providers to control the lowest object version that is accessible by clients. + * If specified, clients can query snapshots or changes for versions >= start_version. + * If not specified, clients can only query starting from the version of the object at the time + * it was added to the share. + * + * NOTE: The start_version should be <= the `current` version of the object. + */ + startVersion?: bigint | undefined; + /** One of: **ACTIVE**, **PERMISSION_DENIED**. */ + status?: SharedDataObject_Status_Enum | undefined; + /** + * The content of the notebook file when the data object type is NOTEBOOK_FILE. + * This should be base64 encoded. + * Required for adding a NOTEBOOK_FILE, optional for updating, ignored for other types. + */ + content?: string | undefined; + /** + * 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, FOREIGN_TABLE), use `shared_as` instead. + * + * Important: For table-like objects, this field must be omitted entirely. + * + * Format: + * - For VOLUME: Must be a 2-part name `.` (e.g., "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 + * + * 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 not pass an empty string) + * - The `string_shared_as` name must be unique for objects of the same 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) + */ + stringSharedAs?: string | undefined; + /** Array of partitions for the shared data. */ + partitions?: PartitionSpecification_CreatePartition[] | undefined; +} + export interface DeleteFederationPolicyRequest { /** Name of the recipient. This is the name of the recipient for which the policy is being deleted. */ recipientName?: string | undefined; @@ -707,12 +889,38 @@ export interface OidcFederationPolicy { // eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface PartitionSpecification {} +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface PartitionSpecification_CreatePartition { + /** An array of partition values. */ + values?: PartitionSpecification_Partition_CreatePartitionValue[] | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface PartitionSpecification_Partition { /** An array of partition values. */ values?: PartitionSpecification_Partition_PartitionValue[] | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface PartitionSpecification_Partition_CreatePartitionValue { + /** The name of the partition column. */ + name?: string | undefined; + /** + * The value of the partition column. When this value is not set, it means `null` value. + * When this field is set, field `recipient_property_key` can not be set. + */ + value?: string | undefined; + /** + * The key of a Delta Sharing recipient's property. For example "databricks-account-id". + * When this field is set, field `value` can not be set. + */ + recipientPropertyKey?: string | undefined; + /** The operator to apply for the value. */ + op?: + | PartitionSpecification_Partition_PartitionValue_PartitionValueOp + | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface PartitionSpecification_Partition_PartitionValue { /** The name of the partition column. */ @@ -1103,7 +1311,7 @@ export interface UpdateProviderRequest { /** Username of Provider owner. */ owner?: string | undefined; /** The recipient profile. This field is only present when the authentication_type is `TOKEN` or `OAUTH_CLIENT_CREDENTIALS`. */ - recipientProfile?: RecipientProfile | undefined; + recipientProfile?: CreateRecipientProfile | undefined; /** Time at which this Provider was created, in epoch milliseconds. */ createdAt?: bigint | undefined; /** Username of Provider creator. */ @@ -1146,13 +1354,13 @@ export interface UpdateRecipientRequest { /** Description about the recipient. */ comment?: string | undefined; /** IP Access List */ - ipAccessList?: IpAccessList | undefined; + ipAccessList?: CreateIpAccessList | undefined; /** * Recipient properties as map of string key-value pairs. * When provided in update request, the specified properties will override the existing * properties. To add and remove properties, one would need to perform a read-modify-write. */ - propertiesKvpairs?: PropertiesKvPairs | undefined; + propertiesKvpairs?: CreatePropertiesKvPairs | undefined; /** Expiration timestamp of the token, in epoch milliseconds. */ expirationTime?: bigint | undefined; /** @@ -1167,7 +1375,7 @@ export interface UpdateRecipientRequest { /** Username of recipient creator. */ createdBy?: string | undefined; /** This field is only present when the __authentication_type__ is **TOKEN**. */ - tokens?: RecipientTokenInfo[] | undefined; + tokens?: CreateRecipientTokenInfo[] | undefined; /** Time at which the recipient was updated, in epoch milliseconds. */ updatedAt?: bigint | undefined; /** Username of recipient updater. */ @@ -1197,7 +1405,7 @@ export interface UpdateSharePermissionsRequest { /** Optional. Whether to return the latest permissions list of the share in the response. */ omitPermissionsList?: boolean | undefined; /** Array of permissions change objects. */ - changes?: PermissionsChange[] | undefined; + changes?: CreatePermissionsChange[] | undefined; } export interface UpdateSharePermissionsResponse { @@ -1211,7 +1419,7 @@ export interface UpdateShareRequest { /** New name for the share. */ newName?: string | undefined; /** Array of shared data object updates. */ - updates?: UpdateShareRequest_SharedDataObjectUpdate[] | undefined; + updates?: UpdateShareRequest_CreateSharedDataObjectUpdate[] | undefined; /** Name of the share. */ name?: string | undefined; /** Username of current owner of share. */ @@ -1221,7 +1429,7 @@ export interface UpdateShareRequest { /** Storage root URL for the share. */ storageRoot?: string | undefined; /** A list of shared data objects within the share. */ - objects?: SharedDataObject[] | undefined; + objects?: CreateSharedDataObject[] | undefined; /** Time at which this share was created, in epoch milliseconds. */ createdAt?: bigint | undefined; /** Username of share creator. */ @@ -1234,6 +1442,14 @@ export interface UpdateShareRequest { storageLocation?: string | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface UpdateShareRequest_CreateSharedDataObjectUpdate { + /** One of: **ADD**, **REMOVE**, **UPDATE**. */ + action?: UpdateShareRequest_SharedDataObjectUpdate_Action | undefined; + /** The data object that is being added, removed, or updated. The maximum number update data objects allowed is a 100. */ + dataObject?: CreateSharedDataObject | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface UpdateShareRequest_SharedDataObjectUpdate { /** One of: **ADD**, **REMOVE**, **UPDATE**. */ @@ -1959,6 +2175,67 @@ export const unmarshalVolumeSchema: z.ZodType = z tags: d.tags, })); +export const marshalCreateFederationPolicySchema: z.ZodType = z + .object({ + name: z.string().optional(), + policy: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('oidcPolicy'), + oidcPolicy: z.lazy(() => marshalCreateOidcFederationPolicySchema), + }), + ]) + .optional(), + comment: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + ...(d.policy?.$case === 'oidcPolicy' && {oidc_policy: d.policy.oidcPolicy}), + comment: d.comment, + })); + +export const marshalCreateIpAccessListSchema: z.ZodType = z + .object({ + allowedIpAddresses: z.array(z.string()).optional(), + }) + .transform(d => ({ + allowed_ip_addresses: d.allowedIpAddresses, + })); + +export const marshalCreateOidcFederationPolicySchema: z.ZodType = z + .object({ + issuer: z.string(), + subjectClaim: z.string(), + subject: z.string(), + audiences: z.array(z.string()).optional(), + }) + .transform(d => ({ + issuer: d.issuer, + subject_claim: d.subjectClaim, + subject: d.subject, + audiences: d.audiences, + })); + +export const marshalCreatePermissionsChangeSchema: z.ZodType = z + .object({ + principal: z.string().optional(), + add: z.array(z.string()).optional(), + remove: z.array(z.string()).optional(), + }) + .transform(d => ({ + principal: d.principal, + add: d.add, + remove: d.remove, + })); + +export const marshalCreatePropertiesKvPairsSchema: z.ZodType = z + .object({ + properties: z.record(z.string(), z.string()), + }) + .transform(d => ({ + properties: d.properties, + })); + export const marshalCreateProviderRequestSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -1966,7 +2243,9 @@ export const marshalCreateProviderRequestSchema: z.ZodType = z recipientProfileStr: z.string().optional(), comment: z.string().optional(), owner: z.string().optional(), - recipientProfile: z.lazy(() => marshalRecipientProfileSchema).optional(), + recipientProfile: z + .lazy(() => marshalCreateRecipientProfileSchema) + .optional(), createdAt: z.bigint().optional(), createdBy: z.string().optional(), updatedAt: z.bigint().optional(), @@ -1993,6 +2272,18 @@ export const marshalCreateProviderRequestSchema: z.ZodType = z data_provider_global_metastore_id: d.dataProviderGlobalMetastoreId, })); +export const marshalCreateRecipientProfileSchema: z.ZodType = z + .object({ + shareCredentialsVersion: z.number().optional(), + endpoint: z.string().optional(), + bearerToken: z.string().optional(), + }) + .transform(d => ({ + share_credentials_version: d.shareCredentialsVersion, + endpoint: d.endpoint, + bearer_token: d.bearerToken, + })); + export const marshalCreateRecipientRequestSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -2001,14 +2292,18 @@ export const marshalCreateRecipientRequestSchema: z.ZodType = z dataRecipientGlobalMetastoreId: z.string().optional(), owner: z.string().optional(), comment: z.string().optional(), - ipAccessList: z.lazy(() => marshalIpAccessListSchema).optional(), - propertiesKvpairs: z.lazy(() => marshalPropertiesKvPairsSchema).optional(), + ipAccessList: z.lazy(() => marshalCreateIpAccessListSchema).optional(), + propertiesKvpairs: z + .lazy(() => marshalCreatePropertiesKvPairsSchema) + .optional(), expirationTime: z.bigint().optional(), activationUrl: z.string().optional(), activated: z.boolean().optional(), createdAt: z.bigint().optional(), createdBy: z.string().optional(), - tokens: z.array(z.lazy(() => marshalRecipientTokenInfoSchema)).optional(), + tokens: z + .array(z.lazy(() => marshalCreateRecipientTokenInfoSchema)) + .optional(), updatedAt: z.bigint().optional(), updatedBy: z.string().optional(), cloud: z.string().optional(), @@ -2039,13 +2334,17 @@ export const marshalCreateRecipientRequestSchema: z.ZodType = z id: d.id, })); +export const marshalCreateRecipientTokenInfoSchema: z.ZodType = z.object({}); + export const marshalCreateShareRequestSchema: z.ZodType = z .object({ name: z.string().optional(), owner: z.string().optional(), comment: z.string().optional(), storageRoot: z.string().optional(), - objects: z.array(z.lazy(() => marshalSharedDataObjectSchema)).optional(), + objects: z + .array(z.lazy(() => marshalCreateSharedDataObjectSchema)) + .optional(), createdAt: z.bigint().optional(), createdBy: z.string().optional(), updatedAt: z.bigint().optional(), @@ -2065,66 +2364,44 @@ export const marshalCreateShareRequestSchema: z.ZodType = z storage_location: d.storageLocation, })); -export const marshalFederationPolicySchema: z.ZodType = z +export const marshalCreateSharedDataObjectSchema: z.ZodType = z .object({ - name: z.string().optional(), - policy: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('oidcPolicy'), - oidcPolicy: z.lazy(() => marshalOidcFederationPolicySchema), - }), - ]) - .optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), + name: z.string(), + dataObjectType: z.string().optional(), comment: z.string().optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) + sharedAs: z.string().optional(), + cdfEnabled: z.boolean().optional(), + historyDataSharingStatus: z.string().optional(), + startVersion: z.bigint().optional(), + status: z.string().optional(), + content: z.string().optional(), + stringSharedAs: z.string().optional(), + partitions: z + .array(z.lazy(() => marshalPartitionSpecification_CreatePartitionSchema)) .optional(), - id: z.string().optional(), }) .transform(d => ({ name: d.name, - ...(d.policy?.$case === 'oidcPolicy' && {oidc_policy: d.policy.oidcPolicy}), - create_time: d.createTime, + data_object_type: d.dataObjectType, comment: d.comment, - update_time: d.updateTime, - id: d.id, - })); - -export const marshalIpAccessListSchema: z.ZodType = z - .object({ - allowedIpAddresses: z.array(z.string()).optional(), - }) - .transform(d => ({ - allowed_ip_addresses: d.allowedIpAddresses, - })); - -export const marshalOidcFederationPolicySchema: z.ZodType = z - .object({ - issuer: z.string().optional(), - subjectClaim: z.string().optional(), - subject: z.string().optional(), - audiences: z.array(z.string()).optional(), - }) - .transform(d => ({ - issuer: d.issuer, - subject_claim: d.subjectClaim, - subject: d.subject, - audiences: d.audiences, + shared_as: d.sharedAs, + cdf_enabled: d.cdfEnabled, + history_data_sharing_status: d.historyDataSharingStatus, + start_version: d.startVersion, + status: d.status, + content: d.content, + string_shared_as: d.stringSharedAs, + partitions: d.partitions, })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalPartitionSpecification_PartitionSchema: z.ZodType = z +export const marshalPartitionSpecification_CreatePartitionSchema: z.ZodType = z .object({ values: z .array( z.lazy( - () => marshalPartitionSpecification_Partition_PartitionValueSchema + () => + marshalPartitionSpecification_Partition_CreatePartitionValueSchema ) ) .optional(), @@ -2134,7 +2411,7 @@ export const marshalPartitionSpecification_PartitionSchema: z.ZodType = z })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalPartitionSpecification_Partition_PartitionValueSchema: z.ZodType = +export const marshalPartitionSpecification_Partition_CreatePartitionValueSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -2149,58 +2426,6 @@ export const marshalPartitionSpecification_Partition_PartitionValueSchema: z.Zod op: d.op, })); -export const marshalPermissionsChangeSchema: z.ZodType = z - .object({ - principal: z.string().optional(), - add: z.array(z.string()).optional(), - remove: z.array(z.string()).optional(), - }) - .transform(d => ({ - principal: d.principal, - add: d.add, - remove: d.remove, - })); - -export const marshalPropertiesKvPairsSchema: z.ZodType = z - .object({ - properties: z.record(z.string(), z.string()).optional(), - }) - .transform(d => ({ - properties: d.properties, - })); - -export const marshalRecipientProfileSchema: z.ZodType = z - .object({ - shareCredentialsVersion: z.number().optional(), - endpoint: z.string().optional(), - bearerToken: z.string().optional(), - }) - .transform(d => ({ - share_credentials_version: d.shareCredentialsVersion, - endpoint: d.endpoint, - bearer_token: d.bearerToken, - })); - -export const marshalRecipientTokenInfoSchema: z.ZodType = z - .object({ - id: z.string().optional(), - createdAt: z.bigint().optional(), - createdBy: z.string().optional(), - activationUrl: z.string().optional(), - expirationTime: z.bigint().optional(), - updatedAt: z.bigint().optional(), - updatedBy: z.string().optional(), - }) - .transform(d => ({ - id: d.id, - created_at: d.createdAt, - created_by: d.createdBy, - activation_url: d.activationUrl, - expiration_time: d.expirationTime, - updated_at: d.updatedAt, - updated_by: d.updatedBy, - })); - export const marshalRotateRecipientTokenRequestSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -2211,40 +2436,6 @@ export const marshalRotateRecipientTokenRequestSchema: z.ZodType = z existing_token_expire_in_seconds: d.existingTokenExpireInSeconds, })); -export const marshalSharedDataObjectSchema: z.ZodType = z - .object({ - name: z.string().optional(), - dataObjectType: z.string().optional(), - addedAt: z.bigint().optional(), - addedBy: z.string().optional(), - comment: z.string().optional(), - sharedAs: z.string().optional(), - cdfEnabled: z.boolean().optional(), - historyDataSharingStatus: z.string().optional(), - startVersion: z.bigint().optional(), - status: z.string().optional(), - content: z.string().optional(), - stringSharedAs: z.string().optional(), - partitions: z - .array(z.lazy(() => marshalPartitionSpecification_PartitionSchema)) - .optional(), - }) - .transform(d => ({ - name: d.name, - data_object_type: d.dataObjectType, - added_at: d.addedAt, - added_by: d.addedBy, - comment: d.comment, - shared_as: d.sharedAs, - cdf_enabled: d.cdfEnabled, - history_data_sharing_status: d.historyDataSharingStatus, - start_version: d.startVersion, - status: d.status, - content: d.content, - string_shared_as: d.stringSharedAs, - partitions: d.partitions, - })); - export const marshalUpdateProviderRequestSchema: z.ZodType = z .object({ nameArg: z.string().optional(), @@ -2254,7 +2445,9 @@ export const marshalUpdateProviderRequestSchema: z.ZodType = z recipientProfileStr: z.string().optional(), comment: z.string().optional(), owner: z.string().optional(), - recipientProfile: z.lazy(() => marshalRecipientProfileSchema).optional(), + recipientProfile: z + .lazy(() => marshalCreateRecipientProfileSchema) + .optional(), createdAt: z.bigint().optional(), createdBy: z.string().optional(), updatedAt: z.bigint().optional(), @@ -2293,14 +2486,18 @@ export const marshalUpdateRecipientRequestSchema: z.ZodType = z dataRecipientGlobalMetastoreId: z.string().optional(), owner: z.string().optional(), comment: z.string().optional(), - ipAccessList: z.lazy(() => marshalIpAccessListSchema).optional(), - propertiesKvpairs: z.lazy(() => marshalPropertiesKvPairsSchema).optional(), + ipAccessList: z.lazy(() => marshalCreateIpAccessListSchema).optional(), + propertiesKvpairs: z + .lazy(() => marshalCreatePropertiesKvPairsSchema) + .optional(), expirationTime: z.bigint().optional(), activationUrl: z.string().optional(), activated: z.boolean().optional(), createdAt: z.bigint().optional(), createdBy: z.string().optional(), - tokens: z.array(z.lazy(() => marshalRecipientTokenInfoSchema)).optional(), + tokens: z + .array(z.lazy(() => marshalCreateRecipientTokenInfoSchema)) + .optional(), updatedAt: z.bigint().optional(), updatedBy: z.string().optional(), cloud: z.string().optional(), @@ -2337,7 +2534,9 @@ export const marshalUpdateSharePermissionsRequestSchema: z.ZodType = z .object({ name: z.string().optional(), omitPermissionsList: z.boolean().optional(), - changes: z.array(z.lazy(() => marshalPermissionsChangeSchema)).optional(), + changes: z + .array(z.lazy(() => marshalCreatePermissionsChangeSchema)) + .optional(), }) .transform(d => ({ name: d.name, @@ -2351,14 +2550,18 @@ export const marshalUpdateShareRequestSchema: z.ZodType = z newName: z.string().optional(), updates: z .array( - z.lazy(() => marshalUpdateShareRequest_SharedDataObjectUpdateSchema) + z.lazy( + () => marshalUpdateShareRequest_CreateSharedDataObjectUpdateSchema + ) ) .optional(), name: z.string().optional(), owner: z.string().optional(), comment: z.string().optional(), storageRoot: z.string().optional(), - objects: z.array(z.lazy(() => marshalSharedDataObjectSchema)).optional(), + objects: z + .array(z.lazy(() => marshalCreateSharedDataObjectSchema)) + .optional(), createdAt: z.bigint().optional(), createdBy: z.string().optional(), updatedAt: z.bigint().optional(), @@ -2382,11 +2585,11 @@ export const marshalUpdateShareRequestSchema: z.ZodType = z })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalUpdateShareRequest_SharedDataObjectUpdateSchema: z.ZodType = +export const marshalUpdateShareRequest_CreateSharedDataObjectUpdateSchema: z.ZodType = z .object({ action: z.string().optional(), - dataObject: z.lazy(() => marshalSharedDataObjectSchema).optional(), + dataObject: z.lazy(() => marshalCreateSharedDataObjectSchema).optional(), }) .transform(d => ({ action: d.action, diff --git a/packages/statementexecution/src/v1/index.ts b/packages/statementexecution/src/v1/index.ts index 0480a8c2..2120f3af 100755 --- a/packages/statementexecution/src/v1/index.ts +++ b/packages/statementexecution/src/v1/index.ts @@ -20,6 +20,8 @@ export type { CancelStatementResponse, ChunkInfo, ColumnInfo, + CreateQueryTag, + CreateStatementParameter, ExecuteStatementRequest, ExternalLink, GetResultDataRequest, diff --git a/packages/statementexecution/src/v1/model.ts b/packages/statementexecution/src/v1/model.ts index 53fd3bcc..bb693c85 100755 --- a/packages/statementexecution/src/v1/model.ts +++ b/packages/statementexecution/src/v1/model.ts @@ -167,6 +167,30 @@ export interface ColumnInfo { typeIntervalType?: string | undefined; } +/** + * * A query execution can be annotated with an optional key-value pair to + * allow users to attribute the executions by key and optional value to filter by. + * QueryTag is the user-facing representation. + */ +export interface CreateQueryTag { + key: string; + value?: string | undefined; +} + +export interface CreateStatementParameter { + /** The name of a parameter marker to be substituted in the statement. */ + name: string; + /** The value to substitute, represented as a string. If omitted, the value is interpreted as NULL. */ + value?: string | undefined; + /** + * The data type, given as a string. For example: `INT`, `STRING`, `DECIMAL(10,2)`. + * If no type is given the type is assumed to be `STRING`. Complex types, such as + * `ARRAY`, `MAP`, and `STRUCT` are not supported. For valid types, refer to the + * section [Data types](https://docs.databricks.com/sql/language-manual/functions/cast.html) of the SQL language reference. + */ + type?: string | undefined; +} + export interface ExecuteStatementRequest { /** * The SQL statement to execute. The statement can optionally be parameterized, see `parameters`. @@ -327,7 +351,7 @@ export interface ExecuteStatementRequest { * * Also see the section [Parameter markers](https://docs.databricks.com/sql/language-manual/sql-ref-parameter-marker.html) of the SQL language reference. */ - parameters?: StatementParameter[] | undefined; + parameters?: CreateStatementParameter[] | undefined; /** * An array of query tags to annotate a SQL statement. A query tag * consists of a non-empty key and, optionally, a value. To represent a NULL @@ -345,7 +369,7 @@ export interface ExecuteStatementRequest { * ] * } */ - queryTags?: QueryTag[] | undefined; + queryTags?: CreateQueryTag[] | undefined; } export interface ExternalLink { @@ -734,6 +758,28 @@ export const marshalCancelStatementRequestSchema: z.ZodType = z statement_id: d.statementId, })); +export const marshalCreateQueryTagSchema: z.ZodType = z + .object({ + key: z.string(), + value: z.string().optional(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); + +export const marshalCreateStatementParameterSchema: z.ZodType = z + .object({ + name: z.string(), + value: z.string().optional(), + type: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + value: d.value, + type: d.type, + })); + export const marshalExecuteStatementRequestSchema: z.ZodType = z .object({ statement: z.string().optional(), @@ -747,9 +793,9 @@ export const marshalExecuteStatementRequestSchema: z.ZodType = z waitTimeout: z.string().optional(), onWaitTimeout: z.string().optional(), parameters: z - .array(z.lazy(() => marshalStatementParameterSchema)) + .array(z.lazy(() => marshalCreateStatementParameterSchema)) .optional(), - queryTags: z.array(z.lazy(() => marshalQueryTagSchema)).optional(), + queryTags: z.array(z.lazy(() => marshalCreateQueryTagSchema)).optional(), }) .transform(d => ({ statement: d.statement, @@ -765,25 +811,3 @@ export const marshalExecuteStatementRequestSchema: z.ZodType = z parameters: d.parameters, query_tags: d.queryTags, })); - -export const marshalQueryTagSchema: z.ZodType = z - .object({ - key: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - -export const marshalStatementParameterSchema: z.ZodType = z - .object({ - name: z.string().optional(), - value: z.string().optional(), - type: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - value: d.value, - type: d.type, - })); diff --git a/packages/storageconfigurations/src/v1/index.ts b/packages/storageconfigurations/src/v1/index.ts index 47023285..2aa24e7c 100755 --- a/packages/storageconfigurations/src/v1/index.ts +++ b/packages/storageconfigurations/src/v1/index.ts @@ -7,6 +7,7 @@ export {StorageConfigurationsClient} from './client'; export type { + CreateRootBucketInfo, CreateStorageConfigurationRequest, DeleteStorageConfigurationRequest, GetStorageConfigurationRequest, diff --git a/packages/storageconfigurations/src/v1/model.ts b/packages/storageconfigurations/src/v1/model.ts index 7efee114..d1bc4560 100644 --- a/packages/storageconfigurations/src/v1/model.ts +++ b/packages/storageconfigurations/src/v1/model.ts @@ -2,12 +2,17 @@ import {z} from 'zod'; +export interface CreateRootBucketInfo { + /** Name of the S3 bucket */ + bucketName?: string | undefined; +} + export interface CreateStorageConfigurationRequest { accountId?: string | undefined; /** The human-readable name of the storage configuration. */ storageConfigurationName?: string | undefined; /** Root S3 bucket information. */ - rootBucketInfo?: RootBucketInfo | undefined; + rootBucketInfo?: CreateRootBucketInfo | undefined; /** * Optional IAM role that is used to access the workspace catalog which is created during workspace creation * for UC by Default. If a storage configuration with this field populated is used to create a workspace, @@ -90,11 +95,19 @@ export const unmarshalStorageConfigurationSchema: z.ZodType ({ + bucket_name: d.bucketName, + })); + export const marshalCreateStorageConfigurationRequestSchema: z.ZodType = z .object({ accountId: z.string().optional(), storageConfigurationName: z.string().optional(), - rootBucketInfo: z.lazy(() => marshalRootBucketInfoSchema).optional(), + rootBucketInfo: z.lazy(() => marshalCreateRootBucketInfoSchema).optional(), roleArn: z.string().optional(), }) .transform(d => ({ @@ -103,11 +116,3 @@ export const marshalCreateStorageConfigurationRequestSchema: z.ZodType = z root_bucket_info: d.rootBucketInfo, role_arn: d.roleArn, })); - -export const marshalRootBucketInfoSchema: z.ZodType = z - .object({ - bucketName: z.string().optional(), - }) - .transform(d => ({ - bucket_name: d.bucketName, - })); diff --git a/packages/supervisoragents/src/v1/client.ts b/packages/supervisoragents/src/v1/client.ts index ef8938b8..813c1c0e 100644 --- a/packages/supervisoragents/src/v1/client.ts +++ b/packages/supervisoragents/src/v1/client.ts @@ -40,9 +40,12 @@ import type { UpdateToolRequest, } from './model'; import { - marshalExampleSchema, - marshalSupervisorAgentSchema, - marshalToolSchema, + marshalCreateExampleSchema, + marshalCreateSupervisorAgentSchema, + marshalCreateToolSchema, + marshalUpdateExampleSchema, + marshalUpdateSupervisorAgentSchema, + marshalUpdateToolSchema, unmarshalExampleSchema, unmarshalListExamplesResponseSchema, unmarshalListSupervisorAgentsResponseSchema, @@ -91,7 +94,7 @@ export class SupervisorAgentsClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.1/${req.parent ?? ''}/examples`; - const body = marshalRequest(req.example, marshalExampleSchema); + const body = marshalRequest(req.example, marshalCreateExampleSchema); let resp: Example | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -123,7 +126,7 @@ export class SupervisorAgentsClient { const url = `${host}/api/2.1/supervisor-agents`; const body = marshalRequest( req.supervisorAgent, - marshalSupervisorAgentSchema + marshalCreateSupervisorAgentSchema ); let resp: SupervisorAgent | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -160,7 +163,7 @@ export class SupervisorAgentsClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.tool, marshalToolSchema); + const body = marshalRequest(req.tool, marshalCreateToolSchema); let resp: Tool | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -523,7 +526,7 @@ export class SupervisorAgentsClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.example, marshalExampleSchema); + const body = marshalRequest(req.example, marshalUpdateExampleSchema); let resp: Example | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -570,7 +573,7 @@ export class SupervisorAgentsClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.supervisorAgent, - marshalSupervisorAgentSchema + marshalUpdateSupervisorAgentSchema ); let resp: SupervisorAgent | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -616,7 +619,7 @@ export class SupervisorAgentsClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.tool, marshalToolSchema); + const body = marshalRequest(req.tool, marshalUpdateToolSchema); let resp: Tool | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/supervisoragents/src/v1/index.ts b/packages/supervisoragents/src/v1/index.ts index 38f9e2a1..e84aa2ec 100755 --- a/packages/supervisoragents/src/v1/index.ts +++ b/packages/supervisoragents/src/v1/index.ts @@ -8,9 +8,18 @@ export {SupervisorAgentsClient} from './client'; export type { App, + CreateApp, + CreateExample, CreateExampleRequest, + CreateGenieSpace, + CreateKnowledgeAssistant, + CreateSupervisorAgent, CreateSupervisorAgentRequest, + CreateTool, CreateToolRequest, + CreateUcConnection, + CreateUcFunction, + CreateVolume, DeleteExampleRequest, DeleteSupervisorAgentRequest, DeleteToolRequest, @@ -30,14 +39,23 @@ export type { Tool, UcConnection, UcFunction, + UpdateApp, + UpdateExample, UpdateExampleRequest, + UpdateGenieSpace, + UpdateKnowledgeAssistant, + UpdateSupervisorAgent, UpdateSupervisorAgentRequest, + UpdateTool, UpdateToolRequest, + UpdateUcConnection, + UpdateUcFunction, + UpdateVolume, Volume, } from './model'; export { - exampleFieldMask, - supervisorAgentFieldMask, - toolFieldMask, + updateExampleFieldMask, + updateSupervisorAgentFieldMask, + updateToolFieldMask, } from './model'; diff --git a/packages/supervisoragents/src/v1/model.ts b/packages/supervisoragents/src/v1/model.ts index a85ea05c..b5e9b55c 100644 --- a/packages/supervisoragents/src/v1/model.ts +++ b/packages/supervisoragents/src/v1/model.ts @@ -11,6 +11,28 @@ export interface App { name?: string | undefined; } +/** app. Supported app: custom mcp, custom agent. */ +export interface CreateApp { + /** App name */ + name: string; +} + +/** + * An example associated with a Supervisor Agent. + * Contains a question and guidelines for how the agent should respond. + */ +export interface CreateExample { + /** + * Full resource name: + * supervisor-agents/{supervisor_agent_id}/examples/{example_id} + */ + name?: string | undefined; + /** The example question. */ + question: string; + /** Guidelines for answering the question. */ + guidelines: string[]; +} + /** Create an example. */ export interface CreateExampleRequest { /** @@ -19,12 +41,65 @@ export interface CreateExampleRequest { */ parent?: string | undefined; /** The example to create under the parent Supervisor Agent. */ - example?: Example | undefined; + example?: CreateExample | undefined; +} + +export interface CreateGenieSpace { + /** + * Deprecated: use space_id instead. Still REQUIRED for backward compatibility + * until a future API version removes it. + */ + id: string; +} + +export interface CreateKnowledgeAssistant { + /** Deprecated: use knowledge_assistant_id instead. */ + servingEndpointName?: string | undefined; + /** The ID of the knowledge assistant. */ + knowledgeAssistantId: string; +} + +export interface CreateSupervisorAgent { + /** + * The resource name of the SupervisorAgent. + * Format: supervisor-agents/{supervisor_agent_id} + */ + name?: string | undefined; + /** The display name of the Supervisor Agent, unique at workspace level. */ + displayName: string; + /** Description of what this agent can do (user-facing). */ + description?: string | undefined; + /** Optional natural-language instructions for the supervisor agent. */ + instructions?: string | undefined; } export interface CreateSupervisorAgentRequest { /** The Supervisor Agent to create. */ - supervisorAgent?: SupervisorAgent | undefined; + supervisorAgent?: CreateSupervisorAgent | undefined; +} + +export interface CreateTool { + /** + * Full resource name: + * supervisor-agents/{supervisor_agent_id}/tools/{tool_id} + */ + name?: string | undefined; + /** Tool type. Must be one of: "genie_space", "knowledge_assistant", "uc_function", "uc_connection", "uc_mcp", "app", "volume", "dashboard", "serving_endpoint", "table", "vector_search_index", "catalog", "schema", "supervisor_agent", "web_search", "skill". The legacy values "lakeview_dashboard" and "uc_table" are also accepted and remain equivalent to "dashboard" and "table" respectively. */ + toolType: string; + /** Specification for the tool type. */ + spec?: + | {$case: 'genieSpace'; genieSpace: CreateGenieSpace} + | { + $case: 'knowledgeAssistant'; + knowledgeAssistant: CreateKnowledgeAssistant; + } + | {$case: 'ucFunction'; ucFunction: CreateUcFunction} + | {$case: 'app'; app: CreateApp} + | {$case: 'volume'; volume: CreateVolume} + | {$case: 'ucConnection'; ucConnection: CreateUcConnection} + | undefined; + /** Description of what this tool does (user-facing). */ + description?: string | undefined; } export interface CreateToolRequest { @@ -33,7 +108,7 @@ export interface CreateToolRequest { * Format: supervisor-agents/{supervisor_agent_id} */ parent?: string | undefined; - tool?: Tool | undefined; + tool?: CreateTool | undefined; /** * The ID to use for the tool, which will become the final component of * the tool's resource name. @@ -41,6 +116,21 @@ export interface CreateToolRequest { toolId?: string | undefined; } +/** Databricks UC connection. Supported connection: external mcp server. */ +export interface CreateUcConnection { + name: string; +} + +export interface CreateUcFunction { + /** Full uc function name */ + name: string; +} + +export interface CreateVolume { + /** Full uc volume name */ + name: string; +} + /** Delete an example. */ export interface DeleteExampleRequest { /** @@ -251,6 +341,28 @@ export interface UcFunction { name?: string | undefined; } +/** app. Supported app: custom mcp, custom agent. */ +export interface UpdateApp { + /** App name */ + name?: string | undefined; +} + +/** + * An example associated with a Supervisor Agent. + * Contains a question and guidelines for how the agent should respond. + */ +export interface UpdateExample { + /** + * Full resource name: + * supervisor-agents/{supervisor_agent_id}/examples/{example_id} + */ + name?: string | undefined; + /** The example question. */ + question?: string | undefined; + /** Guidelines for answering the question. */ + guidelines?: string[] | undefined; +} + /** Update an example. */ export interface UpdateExampleRequest { /** @@ -258,7 +370,7 @@ export interface UpdateExampleRequest { * Format: supervisor-agents/{supervisor_agent_id}/examples/{example_id} */ name?: string | undefined; - example?: Example | undefined; + example?: UpdateExample | undefined; /** * Comma-delimited list of fields to update on the example. * Allowed values: `question`, `guidelines`. @@ -266,21 +378,89 @@ export interface UpdateExampleRequest { * - `question` * - `question,guidelines` */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; +} + +export interface UpdateGenieSpace { + /** + * Deprecated: use space_id instead. Still REQUIRED for backward compatibility + * until a future API version removes it. + */ + id?: string | undefined; +} + +export interface UpdateKnowledgeAssistant { + /** Deprecated: use knowledge_assistant_id instead. */ + servingEndpointName?: string | undefined; + /** The ID of the knowledge assistant. */ + knowledgeAssistantId?: string | undefined; +} + +export interface UpdateSupervisorAgent { + /** + * The resource name of the SupervisorAgent. + * Format: supervisor-agents/{supervisor_agent_id} + */ + name?: string | undefined; + /** The display name of the Supervisor Agent, unique at workspace level. */ + displayName?: string | undefined; + /** Description of what this agent can do (user-facing). */ + description?: string | undefined; + /** Optional natural-language instructions for the supervisor agent. */ + instructions?: string | undefined; } export interface UpdateSupervisorAgentRequest { /** The SupervisorAgent to update. */ - supervisorAgent?: SupervisorAgent | undefined; + supervisorAgent?: UpdateSupervisorAgent | undefined; /** Field mask for fields to be updated. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; +} + +export interface UpdateTool { + /** + * Full resource name: + * supervisor-agents/{supervisor_agent_id}/tools/{tool_id} + */ + name?: string | undefined; + /** Tool type. Must be one of: "genie_space", "knowledge_assistant", "uc_function", "uc_connection", "uc_mcp", "app", "volume", "dashboard", "serving_endpoint", "table", "vector_search_index", "catalog", "schema", "supervisor_agent", "web_search", "skill". The legacy values "lakeview_dashboard" and "uc_table" are also accepted and remain equivalent to "dashboard" and "table" respectively. */ + toolType?: string | undefined; + /** Specification for the tool type. */ + spec?: + | {$case: 'genieSpace'; genieSpace: UpdateGenieSpace} + | { + $case: 'knowledgeAssistant'; + knowledgeAssistant: UpdateKnowledgeAssistant; + } + | {$case: 'ucFunction'; ucFunction: UpdateUcFunction} + | {$case: 'app'; app: UpdateApp} + | {$case: 'volume'; volume: UpdateVolume} + | {$case: 'ucConnection'; ucConnection: UpdateUcConnection} + | undefined; + /** Description of what this tool does (user-facing). */ + description?: string | undefined; } export interface UpdateToolRequest { /** The Tool to update. */ - tool?: Tool | undefined; + tool?: UpdateTool | undefined; /** Field mask for fields to be updated. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; +} + +/** Databricks UC connection. Supported connection: external mcp server. */ +export interface UpdateUcConnection { + name?: string | undefined; +} + +export interface UpdateUcFunction { + /** Full uc function name */ + name?: string | undefined; +} + +export interface UpdateVolume { + /** Full uc volume name */ + name?: string | undefined; } export interface Volume { @@ -460,29 +640,155 @@ export const unmarshalVolumeSchema: z.ZodType = z name: d.name, })); -export const marshalAppSchema: z.ZodType = z +export const marshalCreateAppSchema: z.ZodType = z + .object({ + name: z.string(), + }) + .transform(d => ({ + name: d.name, + })); + +export const marshalCreateExampleSchema: z.ZodType = z + .object({ + name: z.string().optional(), + question: z.string(), + guidelines: z.array(z.string()), + }) + .transform(d => ({ + name: d.name, + question: d.question, + guidelines: d.guidelines, + })); + +export const marshalCreateGenieSpaceSchema: z.ZodType = z + .object({ + id: z.string(), + }) + .transform(d => ({ + id: d.id, + })); + +export const marshalCreateKnowledgeAssistantSchema: z.ZodType = z + .object({ + servingEndpointName: z.string().optional(), + knowledgeAssistantId: z.string(), + }) + .transform(d => ({ + serving_endpoint_name: d.servingEndpointName, + knowledge_assistant_id: d.knowledgeAssistantId, + })); + +export const marshalCreateSupervisorAgentSchema: z.ZodType = z .object({ name: z.string().optional(), + displayName: z.string(), + description: z.string().optional(), + instructions: z.string().optional(), }) .transform(d => ({ name: d.name, + display_name: d.displayName, + description: d.description, + instructions: d.instructions, })); -export const marshalExampleSchema: z.ZodType = z +export const marshalCreateToolSchema: z.ZodType = z + .object({ + name: z.string().optional(), + toolType: z.string(), + spec: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('genieSpace'), + genieSpace: z.lazy(() => marshalCreateGenieSpaceSchema), + }), + z.object({ + $case: z.literal('knowledgeAssistant'), + knowledgeAssistant: z.lazy( + () => marshalCreateKnowledgeAssistantSchema + ), + }), + z.object({ + $case: z.literal('ucFunction'), + ucFunction: z.lazy(() => marshalCreateUcFunctionSchema), + }), + z.object({ + $case: z.literal('app'), + app: z.lazy(() => marshalCreateAppSchema), + }), + z.object({ + $case: z.literal('volume'), + volume: z.lazy(() => marshalCreateVolumeSchema), + }), + z.object({ + $case: z.literal('ucConnection'), + ucConnection: z.lazy(() => marshalCreateUcConnectionSchema), + }), + ]) + .optional(), + description: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + tool_type: d.toolType, + ...(d.spec?.$case === 'genieSpace' && {genie_space: d.spec.genieSpace}), + ...(d.spec?.$case === 'knowledgeAssistant' && { + knowledge_assistant: d.spec.knowledgeAssistant, + }), + ...(d.spec?.$case === 'ucFunction' && {uc_function: d.spec.ucFunction}), + ...(d.spec?.$case === 'app' && {app: d.spec.app}), + ...(d.spec?.$case === 'volume' && {volume: d.spec.volume}), + ...(d.spec?.$case === 'ucConnection' && { + uc_connection: d.spec.ucConnection, + }), + description: d.description, + })); + +export const marshalCreateUcConnectionSchema: z.ZodType = z + .object({ + name: z.string(), + }) + .transform(d => ({ + name: d.name, + })); + +export const marshalCreateUcFunctionSchema: z.ZodType = z + .object({ + name: z.string(), + }) + .transform(d => ({ + name: d.name, + })); + +export const marshalCreateVolumeSchema: z.ZodType = z + .object({ + name: z.string(), + }) + .transform(d => ({ + name: d.name, + })); + +export const marshalUpdateAppSchema: z.ZodType = z + .object({ + name: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + })); + +export const marshalUpdateExampleSchema: z.ZodType = z .object({ name: z.string().optional(), question: z.string().optional(), guidelines: z.array(z.string()).optional(), - exampleId: z.string().optional(), }) .transform(d => ({ name: d.name, question: d.question, guidelines: d.guidelines, - example_id: d.exampleId, })); -export const marshalGenieSpaceSchema: z.ZodType = z +export const marshalUpdateGenieSpaceSchema: z.ZodType = z .object({ id: z.string().optional(), }) @@ -490,7 +796,7 @@ export const marshalGenieSpaceSchema: z.ZodType = z id: d.id, })); -export const marshalKnowledgeAssistantSchema: z.ZodType = z +export const marshalUpdateKnowledgeAssistantSchema: z.ZodType = z .object({ servingEndpointName: z.string().optional(), knowledgeAssistantId: z.string().optional(), @@ -500,74 +806,58 @@ export const marshalKnowledgeAssistantSchema: z.ZodType = z knowledge_assistant_id: d.knowledgeAssistantId, })); -export const marshalSupervisorAgentSchema: z.ZodType = z +export const marshalUpdateSupervisorAgentSchema: z.ZodType = z .object({ name: z.string().optional(), displayName: z.string().optional(), description: z.string().optional(), instructions: z.string().optional(), - id: z.string().optional(), - supervisorAgentId: z.string().optional(), - creator: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - endpointName: z.string().optional(), - experimentId: z.string().optional(), }) .transform(d => ({ name: d.name, display_name: d.displayName, description: d.description, instructions: d.instructions, - id: d.id, - supervisor_agent_id: d.supervisorAgentId, - creator: d.creator, - create_time: d.createTime, - endpoint_name: d.endpointName, - experiment_id: d.experimentId, })); -export const marshalToolSchema: z.ZodType = z +export const marshalUpdateToolSchema: z.ZodType = z .object({ name: z.string().optional(), - id: z.string().optional(), toolType: z.string().optional(), spec: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('genieSpace'), - genieSpace: z.lazy(() => marshalGenieSpaceSchema), + genieSpace: z.lazy(() => marshalUpdateGenieSpaceSchema), }), z.object({ $case: z.literal('knowledgeAssistant'), - knowledgeAssistant: z.lazy(() => marshalKnowledgeAssistantSchema), + knowledgeAssistant: z.lazy( + () => marshalUpdateKnowledgeAssistantSchema + ), }), z.object({ $case: z.literal('ucFunction'), - ucFunction: z.lazy(() => marshalUcFunctionSchema), + ucFunction: z.lazy(() => marshalUpdateUcFunctionSchema), }), z.object({ $case: z.literal('app'), - app: z.lazy(() => marshalAppSchema), + app: z.lazy(() => marshalUpdateAppSchema), }), z.object({ $case: z.literal('volume'), - volume: z.lazy(() => marshalVolumeSchema), + volume: z.lazy(() => marshalUpdateVolumeSchema), }), z.object({ $case: z.literal('ucConnection'), - ucConnection: z.lazy(() => marshalUcConnectionSchema), + ucConnection: z.lazy(() => marshalUpdateUcConnectionSchema), }), ]) .optional(), description: z.string().optional(), - toolId: z.string().optional(), }) .transform(d => ({ name: d.name, - id: d.id, tool_type: d.toolType, ...(d.spec?.$case === 'genieSpace' && {genie_space: d.spec.genieSpace}), ...(d.spec?.$case === 'knowledgeAssistant' && { @@ -580,10 +870,9 @@ export const marshalToolSchema: z.ZodType = z uc_connection: d.spec.ucConnection, }), description: d.description, - tool_id: d.toolId, })); -export const marshalUcConnectionSchema: z.ZodType = z +export const marshalUpdateUcConnectionSchema: z.ZodType = z .object({ name: z.string().optional(), }) @@ -591,7 +880,7 @@ export const marshalUcConnectionSchema: z.ZodType = z name: d.name, })); -export const marshalUcFunctionSchema: z.ZodType = z +export const marshalUpdateUcFunctionSchema: z.ZodType = z .object({ name: z.string().optional(), }) @@ -599,7 +888,7 @@ export const marshalUcFunctionSchema: z.ZodType = z name: d.name, })); -export const marshalVolumeSchema: z.ZodType = z +export const marshalUpdateVolumeSchema: z.ZodType = z .object({ name: z.string().optional(), }) @@ -607,84 +896,83 @@ export const marshalVolumeSchema: z.ZodType = z name: d.name, })); -const appFieldMaskSchema: FieldMaskSchema = { +const updateAppFieldMaskSchema: FieldMaskSchema = { name: {wire: 'name'}, }; -const exampleFieldMaskSchema: FieldMaskSchema = { - exampleId: {wire: 'example_id'}, +const updateExampleFieldMaskSchema: FieldMaskSchema = { guidelines: {wire: 'guidelines'}, name: {wire: 'name'}, question: {wire: 'question'}, }; -export function exampleFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, exampleFieldMaskSchema); +export function updateExampleFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, updateExampleFieldMaskSchema); } -const genieSpaceFieldMaskSchema: FieldMaskSchema = { +const updateGenieSpaceFieldMaskSchema: FieldMaskSchema = { id: {wire: 'id'}, }; -const knowledgeAssistantFieldMaskSchema: FieldMaskSchema = { +const updateKnowledgeAssistantFieldMaskSchema: FieldMaskSchema = { knowledgeAssistantId: {wire: 'knowledge_assistant_id'}, servingEndpointName: {wire: 'serving_endpoint_name'}, }; -const supervisorAgentFieldMaskSchema: FieldMaskSchema = { - createTime: {wire: 'create_time'}, - creator: {wire: 'creator'}, +const updateSupervisorAgentFieldMaskSchema: FieldMaskSchema = { description: {wire: 'description'}, displayName: {wire: 'display_name'}, - endpointName: {wire: 'endpoint_name'}, - experimentId: {wire: 'experiment_id'}, - id: {wire: 'id'}, instructions: {wire: 'instructions'}, name: {wire: 'name'}, - supervisorAgentId: {wire: 'supervisor_agent_id'}, }; -export function supervisorAgentFieldMask( +export function updateSupervisorAgentFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - supervisorAgentFieldMaskSchema + updateSupervisorAgentFieldMaskSchema ); } -const toolFieldMaskSchema: FieldMaskSchema = { - app: {wire: 'app', children: () => appFieldMaskSchema}, +const updateToolFieldMaskSchema: FieldMaskSchema = { + app: {wire: 'app', children: () => updateAppFieldMaskSchema}, description: {wire: 'description'}, - genieSpace: {wire: 'genie_space', children: () => genieSpaceFieldMaskSchema}, - id: {wire: 'id'}, + genieSpace: { + wire: 'genie_space', + children: () => updateGenieSpaceFieldMaskSchema, + }, knowledgeAssistant: { wire: 'knowledge_assistant', - children: () => knowledgeAssistantFieldMaskSchema, + children: () => updateKnowledgeAssistantFieldMaskSchema, }, name: {wire: 'name'}, - toolId: {wire: 'tool_id'}, toolType: {wire: 'tool_type'}, ucConnection: { wire: 'uc_connection', - children: () => ucConnectionFieldMaskSchema, + children: () => updateUcConnectionFieldMaskSchema, + }, + ucFunction: { + wire: 'uc_function', + children: () => updateUcFunctionFieldMaskSchema, }, - ucFunction: {wire: 'uc_function', children: () => ucFunctionFieldMaskSchema}, - volume: {wire: 'volume', children: () => volumeFieldMaskSchema}, + volume: {wire: 'volume', children: () => updateVolumeFieldMaskSchema}, }; -export function toolFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, toolFieldMaskSchema); +export function updateToolFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, updateToolFieldMaskSchema); } -const ucConnectionFieldMaskSchema: FieldMaskSchema = { +const updateUcConnectionFieldMaskSchema: FieldMaskSchema = { name: {wire: 'name'}, }; -const ucFunctionFieldMaskSchema: FieldMaskSchema = { +const updateUcFunctionFieldMaskSchema: FieldMaskSchema = { name: {wire: 'name'}, }; -const volumeFieldMaskSchema: FieldMaskSchema = { +const updateVolumeFieldMaskSchema: FieldMaskSchema = { name: {wire: 'name'}, }; diff --git a/packages/tagassignments/src/v1/client.ts b/packages/tagassignments/src/v1/client.ts index b727de9d..139e5ec4 100644 --- a/packages/tagassignments/src/v1/client.ts +++ b/packages/tagassignments/src/v1/client.ts @@ -26,7 +26,8 @@ import type { UpdateTagAssignmentRequest, } from './model'; import { - marshalTagAssignmentSchema, + marshalCreateTagAssignmentSchema, + marshalUpdateTagAssignmentSchema, unmarshalListTagAssignmentsResponseSchema, unmarshalTagAssignmentSchema, } from './model'; @@ -71,7 +72,10 @@ export class TagAssignmentsClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/entity-tag-assignments`; - const body = marshalRequest(req.tagAssignment, marshalTagAssignmentSchema); + const body = marshalRequest( + req.tagAssignment, + marshalCreateTagAssignmentSchema + ); let resp: TagAssignment | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -214,7 +218,10 @@ export class TagAssignmentsClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.tagAssignment, marshalTagAssignmentSchema); + const body = marshalRequest( + req.tagAssignment, + marshalUpdateTagAssignmentSchema + ); let resp: TagAssignment | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/tagassignments/src/v1/index.ts b/packages/tagassignments/src/v1/index.ts index fccae00d..fd63851b 100755 --- a/packages/tagassignments/src/v1/index.ts +++ b/packages/tagassignments/src/v1/index.ts @@ -7,13 +7,15 @@ export {TagAssignmentsClient} from './client'; export type { + CreateTagAssignment, CreateTagAssignmentRequest, DeleteTagAssignmentRequest, GetTagAssignmentRequest, ListTagAssignmentsRequest, ListTagAssignmentsResponse, TagAssignment, + UpdateTagAssignment, UpdateTagAssignmentRequest, } from './model'; -export {tagAssignmentFieldMask} from './model'; +export {updateTagAssignmentFieldMask} from './model'; diff --git a/packages/tagassignments/src/v1/model.ts b/packages/tagassignments/src/v1/model.ts index 52eb60a2..3aadc01c 100644 --- a/packages/tagassignments/src/v1/model.ts +++ b/packages/tagassignments/src/v1/model.ts @@ -4,8 +4,19 @@ import {FieldMask} from '@databricks/sdk-core/wkt'; import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; +export interface CreateTagAssignment { + /** The type of entity to which the tag is assigned. Allowed values are apps, dashboards, geniespaces, notebooks */ + entityType?: string | undefined; + /** The identifier of the entity to which the tag is assigned. For apps, the entity_id is the app name */ + entityId?: string | undefined; + /** The key of the tag. The characters , . : / - = and leading/trailing spaces are not allowed */ + tagKey?: string | undefined; + /** The value of the tag */ + tagValue?: string | undefined; +} + export interface CreateTagAssignmentRequest { - tagAssignment?: TagAssignment | undefined; + tagAssignment?: CreateTagAssignment | undefined; } export interface DeleteTagAssignmentRequest { @@ -54,9 +65,20 @@ export interface TagAssignment { tagValue?: string | undefined; } +export interface UpdateTagAssignment { + /** The type of entity to which the tag is assigned. Allowed values are apps, dashboards, geniespaces, notebooks */ + entityType?: string | undefined; + /** The identifier of the entity to which the tag is assigned. For apps, the entity_id is the app name */ + entityId?: string | undefined; + /** The key of the tag. The characters , . : / - = and leading/trailing spaces are not allowed */ + tagKey?: string | undefined; + /** The value of the tag */ + tagValue?: string | undefined; +} + export interface UpdateTagAssignmentRequest { - tagAssignment?: TagAssignment | undefined; - updateMask?: FieldMask | undefined; + tagAssignment?: UpdateTagAssignment | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalListTagAssignmentsResponseSchema: z.ZodType = @@ -86,7 +108,21 @@ export const unmarshalTagAssignmentSchema: z.ZodType = z tagValue: d.tag_value, })); -export const marshalTagAssignmentSchema: z.ZodType = z +export const marshalCreateTagAssignmentSchema: z.ZodType = z + .object({ + entityType: z.string().optional(), + entityId: z.string().optional(), + tagKey: z.string().optional(), + tagValue: z.string().optional(), + }) + .transform(d => ({ + entity_type: d.entityType, + entity_id: d.entityId, + tag_key: d.tagKey, + tag_value: d.tagValue, + })); + +export const marshalUpdateTagAssignmentSchema: z.ZodType = z .object({ entityType: z.string().optional(), entityId: z.string().optional(), @@ -100,15 +136,18 @@ export const marshalTagAssignmentSchema: z.ZodType = z tag_value: d.tagValue, })); -const tagAssignmentFieldMaskSchema: FieldMaskSchema = { +const updateTagAssignmentFieldMaskSchema: FieldMaskSchema = { entityId: {wire: 'entity_id'}, entityType: {wire: 'entity_type'}, tagKey: {wire: 'tag_key'}, tagValue: {wire: 'tag_value'}, }; -export function tagAssignmentFieldMask( +export function updateTagAssignmentFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build(paths, tagAssignmentFieldMaskSchema); +): FieldMask { + return FieldMask.build( + paths, + updateTagAssignmentFieldMaskSchema + ); } diff --git a/packages/tagpolicies/src/v1/client.ts b/packages/tagpolicies/src/v1/client.ts index 1663b219..398eba13 100644 --- a/packages/tagpolicies/src/v1/client.ts +++ b/packages/tagpolicies/src/v1/client.ts @@ -26,7 +26,8 @@ import type { UpdateTagPolicyRequest, } from './model'; import { - marshalTagPolicySchema, + marshalCreateTagPolicySchema, + marshalUpdateTagPolicySchema, unmarshalListTagPoliciesResponseSchema, unmarshalTagPolicySchema, } from './model'; @@ -71,7 +72,7 @@ export class TagPoliciesClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.1/tag-policies`; - const body = marshalRequest(req.tagPolicy, marshalTagPolicySchema); + const body = marshalRequest(req.tagPolicy, marshalCreateTagPolicySchema); let resp: TagPolicy | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -214,7 +215,7 @@ export class TagPoliciesClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.tagPolicy, marshalTagPolicySchema); + const body = marshalRequest(req.tagPolicy, marshalUpdateTagPolicySchema); let resp: TagPolicy | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/tagpolicies/src/v1/index.ts b/packages/tagpolicies/src/v1/index.ts index 0dbae341..290c3270 100755 --- a/packages/tagpolicies/src/v1/index.ts +++ b/packages/tagpolicies/src/v1/index.ts @@ -7,14 +7,18 @@ export {TagPoliciesClient} from './client'; export type { + CreateTagPolicy, CreateTagPolicyRequest, + CreateValue, DeleteTagPolicyRequest, GetTagPolicyRequest, ListTagPoliciesRequest, ListTagPoliciesResponse, TagPolicy, + UpdateTagPolicy, UpdateTagPolicyRequest, + UpdateValue, Value, } from './model'; -export {tagPolicyFieldMask} from './model'; +export {updateTagPolicyFieldMask} from './model'; diff --git a/packages/tagpolicies/src/v1/model.ts b/packages/tagpolicies/src/v1/model.ts index 89de50eb..4eadd1b3 100644 --- a/packages/tagpolicies/src/v1/model.ts +++ b/packages/tagpolicies/src/v1/model.ts @@ -5,8 +5,18 @@ import {FieldMask} from '@databricks/sdk-core/wkt'; import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; +export interface CreateTagPolicy { + tagKey?: string | undefined; + description?: string | undefined; + values?: CreateValue[] | undefined; +} + export interface CreateTagPolicyRequest { - tagPolicy?: TagPolicy | undefined; + tagPolicy?: CreateTagPolicy | undefined; +} + +export interface CreateValue { + name: string; } export interface DeleteTagPolicyRequest { @@ -44,9 +54,19 @@ export interface TagPolicy { updateTime?: Temporal.Instant | undefined; } +export interface UpdateTagPolicy { + tagKey?: string | undefined; + description?: string | undefined; + values?: UpdateValue[] | undefined; +} + export interface UpdateTagPolicyRequest { - tagPolicy?: TagPolicy | undefined; - updateMask?: FieldMask | undefined; + tagPolicy?: UpdateTagPolicy | undefined; + updateMask?: FieldMask | undefined; +} + +export interface UpdateValue { + name?: string | undefined; } export interface Value { @@ -96,31 +116,39 @@ export const unmarshalValueSchema: z.ZodType = z name: d.name, })); -export const marshalTagPolicySchema: z.ZodType = z +export const marshalCreateTagPolicySchema: z.ZodType = z .object({ tagKey: z.string().optional(), - id: z.string().optional(), description: z.string().optional(), - values: z.array(z.lazy(() => marshalValueSchema)).optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), + values: z.array(z.lazy(() => marshalCreateValueSchema)).optional(), + }) + .transform(d => ({ + tag_key: d.tagKey, + description: d.description, + values: d.values, + })); + +export const marshalCreateValueSchema: z.ZodType = z + .object({ + name: z.string(), + }) + .transform(d => ({ + name: d.name, + })); + +export const marshalUpdateTagPolicySchema: z.ZodType = z + .object({ + tagKey: z.string().optional(), + description: z.string().optional(), + values: z.array(z.lazy(() => marshalUpdateValueSchema)).optional(), }) .transform(d => ({ tag_key: d.tagKey, - id: d.id, description: d.description, values: d.values, - create_time: d.createTime, - update_time: d.updateTime, })); -export const marshalValueSchema: z.ZodType = z +export const marshalUpdateValueSchema: z.ZodType = z .object({ name: z.string().optional(), }) @@ -128,15 +156,17 @@ export const marshalValueSchema: z.ZodType = z name: d.name, })); -const tagPolicyFieldMaskSchema: FieldMaskSchema = { - createTime: {wire: 'create_time'}, +const updateTagPolicyFieldMaskSchema: FieldMaskSchema = { description: {wire: 'description'}, - id: {wire: 'id'}, tagKey: {wire: 'tag_key'}, - updateTime: {wire: 'update_time'}, values: {wire: 'values'}, }; -export function tagPolicyFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, tagPolicyFieldMaskSchema); +export function updateTagPolicyFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + updateTagPolicyFieldMaskSchema + ); } diff --git a/packages/tokenmanagement/src/v1/index.ts b/packages/tokenmanagement/src/v1/index.ts index 50601c4d..c2989b77 100755 --- a/packages/tokenmanagement/src/v1/index.ts +++ b/packages/tokenmanagement/src/v1/index.ts @@ -18,7 +18,8 @@ export type { ListTokensResponse, RevokeTokenRequest, RevokeTokenResponse, + UpdateAdminTokenInfo, UpdateTokenRequest, } from './model'; -export {adminTokenInfoFieldMask} from './model'; +export {updateAdminTokenInfoFieldMask} from './model'; diff --git a/packages/tokenmanagement/src/v1/model.ts b/packages/tokenmanagement/src/v1/model.ts index 3813d486..058731f6 100755 --- a/packages/tokenmanagement/src/v1/model.ts +++ b/packages/tokenmanagement/src/v1/model.ts @@ -120,14 +120,43 @@ export interface RevokeTokenRequest { // eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface RevokeTokenResponse {} +export interface UpdateAdminTokenInfo { + /** ID of the token. */ + tokenId?: string | undefined; + /** Timestamp when the token was created. */ + creationTime?: bigint | undefined; + /** Timestamp when the token expires. */ + expiryTime?: bigint | undefined; + /** Comment that describes the purpose of the token, specified by the token creator. */ + comment?: string | undefined; + /** User ID of the user that created the token. */ + createdById?: bigint | undefined; + /** Username of the user that created the token. */ + createdByUsername?: string | undefined; + /** User ID of the user that owns the token. */ + ownerId?: bigint | undefined; + /** If applicable, the ID of the workspace that the token was created in. */ + workspaceId?: bigint | undefined; + /** Approximate timestamp for the day the token was last used. Accurate up to 1 day. */ + lastUsedDay?: bigint | undefined; + /** Scope of the token was created with, if applicable. */ + scopes?: string[] | undefined; + /** Output only. The autoscope state of this token. */ + autoscopeState?: AutoscopeState | undefined; + /** Output only. Inferred API path scopes collected for this token when autoscope is enabled. */ + inferredScopes?: string[] | undefined; + /** Output only. Scopes inferred from offline backfill processing. */ + backfillScopes?: string[] | undefined; +} + /** * For the list of supported token scopes, see * https://docs.databricks.com/api/workspace/api/scopes. */ export interface UpdateTokenRequest { - token?: AdminTokenInfo | undefined; + token?: UpdateAdminTokenInfo | undefined; /** A list of field name under token, For example, {"update_mask": "comment,scopes"} */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalAdminTokenInfoSchema: z.ZodType = z @@ -213,7 +242,23 @@ export const unmarshalListTokensResponseSchema: z.ZodType = export const unmarshalRevokeTokenResponseSchema: z.ZodType = z.object({}); -export const marshalAdminTokenInfoSchema: z.ZodType = z +export const marshalCreateOnBehalfOfTokenRequestSchema: z.ZodType = z + .object({ + applicationId: z.string().optional(), + lifetimeSeconds: z.bigint().optional(), + comment: z.string().optional(), + scopes: z.array(z.string()).optional(), + autoscopeEnabled: z.boolean().optional(), + }) + .transform(d => ({ + application_id: d.applicationId, + lifetime_seconds: d.lifetimeSeconds, + comment: d.comment, + scopes: d.scopes, + autoscope_enabled: d.autoscopeEnabled, + })); + +export const marshalUpdateAdminTokenInfoSchema: z.ZodType = z .object({ tokenId: z.string().optional(), creationTime: z.bigint().optional(), @@ -245,25 +290,9 @@ export const marshalAdminTokenInfoSchema: z.ZodType = z backfill_scopes: d.backfillScopes, })); -export const marshalCreateOnBehalfOfTokenRequestSchema: z.ZodType = z - .object({ - applicationId: z.string().optional(), - lifetimeSeconds: z.bigint().optional(), - comment: z.string().optional(), - scopes: z.array(z.string()).optional(), - autoscopeEnabled: z.boolean().optional(), - }) - .transform(d => ({ - application_id: d.applicationId, - lifetime_seconds: d.lifetimeSeconds, - comment: d.comment, - scopes: d.scopes, - autoscope_enabled: d.autoscopeEnabled, - })); - export const marshalUpdateTokenRequestSchema: z.ZodType = z .object({ - token: z.lazy(() => marshalAdminTokenInfoSchema).optional(), + token: z.lazy(() => marshalUpdateAdminTokenInfoSchema).optional(), updateMask: z .any() .transform((m: FieldMask) => m.toString()) @@ -274,7 +303,7 @@ export const marshalUpdateTokenRequestSchema: z.ZodType = z update_mask: d.updateMask, })); -const adminTokenInfoFieldMaskSchema: FieldMaskSchema = { +const updateAdminTokenInfoFieldMaskSchema: FieldMaskSchema = { autoscopeState: {wire: 'autoscope_state'}, backfillScopes: {wire: 'backfill_scopes'}, comment: {wire: 'comment'}, @@ -290,8 +319,11 @@ const adminTokenInfoFieldMaskSchema: FieldMaskSchema = { workspaceId: {wire: 'workspace_id'}, }; -export function adminTokenInfoFieldMask( +export function updateAdminTokenInfoFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build(paths, adminTokenInfoFieldMaskSchema); +): FieldMask { + return FieldMask.build( + paths, + updateAdminTokenInfoFieldMaskSchema + ); } diff --git a/packages/tokens/src/v1/index.ts b/packages/tokens/src/v1/index.ts index bfe76c7e..81030b14 100755 --- a/packages/tokens/src/v1/index.ts +++ b/packages/tokens/src/v1/index.ts @@ -16,8 +16,9 @@ export type { PublicTokenInfo, RevokeTokenRequest, RevokeTokenResponse, + UpdatePublicTokenInfo, UpdateTokenRequest, UpdateTokenResponse, } from './model'; -export {publicTokenInfoFieldMask} from './model'; +export {updatePublicTokenInfoFieldMask} from './model'; diff --git a/packages/tokens/src/v1/model.ts b/packages/tokens/src/v1/model.ts index 6a696506..8c2f5bad 100755 --- a/packages/tokens/src/v1/model.ts +++ b/packages/tokens/src/v1/model.ts @@ -84,6 +84,25 @@ export interface RevokeTokenRequest { // eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface RevokeTokenResponse {} +export interface UpdatePublicTokenInfo { + /** The ID of this token. */ + tokenId?: string | undefined; + /** Server time (in epoch milliseconds) when the token was created. */ + creationTime?: bigint | undefined; + /** Server time (in epoch milliseconds) when the token will expire, or -1 if not applicable. */ + expiryTime?: bigint | undefined; + /** Comment the token was created with, if applicable. */ + comment?: string | undefined; + /** Scope of the token was created with, if applicable. */ + scopes?: string[] | undefined; + /** Output only. The autoscope state of this token. */ + autoscopeState?: AutoscopeState | undefined; + /** Output only. Inferred API path scopes collected for this token when autoscope is enabled. */ + inferredScopes?: string[] | undefined; + /** Output only. Scopes inferred from offline backfill processing. */ + backfillScopes?: string[] | undefined; +} + /** * For the list of supported token scopes, see * https://docs.databricks.com/api/workspace/api/scopes. @@ -91,9 +110,9 @@ export interface RevokeTokenResponse {} export interface UpdateTokenRequest { /** The SHA-256 hash of the token to be updated. */ tokenId?: string | undefined; - token?: PublicTokenInfo | undefined; + token?: UpdatePublicTokenInfo | undefined; /** A list of field name under token, For example, {"update_mask": "comment,scopes"} */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; } // eslint-disable-next-line @typescript-eslint/no-empty-object-type @@ -169,7 +188,15 @@ export const marshalCreateTokenRequestSchema: z.ZodType = z autoscope_enabled: d.autoscopeEnabled, })); -export const marshalPublicTokenInfoSchema: z.ZodType = z +export const marshalRevokeTokenRequestSchema: z.ZodType = z + .object({ + tokenId: z.string().optional(), + }) + .transform(d => ({ + token_id: d.tokenId, + })); + +export const marshalUpdatePublicTokenInfoSchema: z.ZodType = z .object({ tokenId: z.string().optional(), creationTime: z.bigint().optional(), @@ -191,18 +218,10 @@ export const marshalPublicTokenInfoSchema: z.ZodType = z backfill_scopes: d.backfillScopes, })); -export const marshalRevokeTokenRequestSchema: z.ZodType = z - .object({ - tokenId: z.string().optional(), - }) - .transform(d => ({ - token_id: d.tokenId, - })); - export const marshalUpdateTokenRequestSchema: z.ZodType = z .object({ tokenId: z.string().optional(), - token: z.lazy(() => marshalPublicTokenInfoSchema).optional(), + token: z.lazy(() => marshalUpdatePublicTokenInfoSchema).optional(), updateMask: z .any() .transform((m: FieldMask) => m.toString()) @@ -214,7 +233,7 @@ export const marshalUpdateTokenRequestSchema: z.ZodType = z update_mask: d.updateMask, })); -const publicTokenInfoFieldMaskSchema: FieldMaskSchema = { +const updatePublicTokenInfoFieldMaskSchema: FieldMaskSchema = { autoscopeState: {wire: 'autoscope_state'}, backfillScopes: {wire: 'backfill_scopes'}, comment: {wire: 'comment'}, @@ -225,11 +244,11 @@ const publicTokenInfoFieldMaskSchema: FieldMaskSchema = { tokenId: {wire: 'token_id'}, }; -export function publicTokenInfoFieldMask( +export function updatePublicTokenInfoFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - publicTokenInfoFieldMaskSchema + updatePublicTokenInfoFieldMaskSchema ); } diff --git a/packages/uc/abacpolicies/src/v1/client.ts b/packages/uc/abacpolicies/src/v1/client.ts index 7730f71a..559d91ea 100755 --- a/packages/uc/abacpolicies/src/v1/client.ts +++ b/packages/uc/abacpolicies/src/v1/client.ts @@ -27,7 +27,8 @@ import type { UpdatePolicyRequest, } from './model'; import { - marshalPolicyInfoSchema, + marshalCreatePolicyInfoSchema, + marshalUpdatePolicyInfoSchema, unmarshalDeletePolicyResponseSchema, unmarshalListPoliciesResponseSchema, unmarshalPolicyInfoSchema, @@ -76,7 +77,7 @@ export class AbacPoliciesClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.1/unity-catalog/policies`; - const body = marshalRequest(req.policyInfo, marshalPolicyInfoSchema); + const body = marshalRequest(req.policyInfo, marshalCreatePolicyInfoSchema); let resp: PolicyInfo | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -234,7 +235,7 @@ export class AbacPoliciesClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.policyInfo, marshalPolicyInfoSchema); + const body = marshalRequest(req.policyInfo, marshalUpdatePolicyInfoSchema); let resp: PolicyInfo | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/uc/abacpolicies/src/v1/index.ts b/packages/uc/abacpolicies/src/v1/index.ts index 17c6fa0a..9c369c51 100755 --- a/packages/uc/abacpolicies/src/v1/index.ts +++ b/packages/uc/abacpolicies/src/v1/index.ts @@ -10,7 +10,12 @@ export {PolicyType, SecurableType} from './model'; export type { ColumnMaskOptions, + CreateColumnMaskOptions, + CreateFunctionArgument, + CreateMatchColumn, + CreatePolicyInfo, CreatePolicyRequest, + CreateRowFilterOptions, DeletePolicyRequest, DeletePolicyResponse, FunctionArgument, @@ -20,7 +25,12 @@ export type { MatchColumn, PolicyInfo, RowFilterOptions, + UpdateColumnMaskOptions, + UpdateFunctionArgument, + UpdateMatchColumn, + UpdatePolicyInfo, UpdatePolicyRequest, + UpdateRowFilterOptions, } from './model'; -export {policyInfoFieldMask} from './model'; +export {updatePolicyInfoFieldMask} from './model'; diff --git a/packages/uc/abacpolicies/src/v1/model.ts b/packages/uc/abacpolicies/src/v1/model.ts index eb366abe..5b02682f 100755 --- a/packages/uc/abacpolicies/src/v1/model.ts +++ b/packages/uc/abacpolicies/src/v1/model.ts @@ -62,9 +62,136 @@ export interface ColumnMaskOptions { using?: FunctionArgument[] | undefined; } +export interface CreateColumnMaskOptions { + /** + * The fully qualified name of the column mask function. + * The function is called on each row of the target table. + * The function's first argument and its return type should match the type of the masked column. + * Required on create and update. + */ + functionName: string; + /** + * The alias of the column to be masked. The alias must refer to one of matched columns. + * The values of the column is passed to the column mask function as the first argument. + * Required on create and update. + */ + onColumn: string; + /** + * Optional list of column aliases or constant literals to be passed as additional arguments to the column mask function. + * The type of each column should match the positional argument of the column mask function. + */ + using?: CreateFunctionArgument[] | undefined; +} + +export interface CreateFunctionArgument { + /** A positional argument pass to a row filter or column mask function. */ + arg?: + | { + $case: 'alias'; + /** The alias of a matched column. */ + alias: string; + } + | { + $case: 'constant'; + /** A constant literal. */ + constant: string; + } + | undefined; +} + +export interface CreateMatchColumn { + /** The condition expression used to match a table column. */ + condition?: string | undefined; + /** Optional alias of the matched column. */ + alias?: string | undefined; +} + +export interface CreatePolicyInfo { + /** + * Type of the securable on which the policy is defined. + * Only `CATALOG`, `SCHEMA` and `TABLE` are supported at this moment. + * Required on create. + */ + onSecurableType?: SecurableType | undefined; + /** + * Full name of the securable on which the policy is defined. + * Required on create. + */ + onSecurableFullname?: string | undefined; + /** + * Name of the policy. Required on create and optional on update. + * To rename the policy, set `name` to a different value on update. + */ + name?: string | undefined; + /** Optional description of the policy. */ + comment?: string | undefined; + /** + * List of user or group names that the policy applies to. + * Required on create and optional on update. + */ + toPrincipals: string[]; + /** Optional list of user or group names that should be excluded from the policy. */ + exceptPrincipals?: string[] | undefined; + /** + * Type of securables that the policy should take effect on. + * Only `TABLE` is supported at this moment. + * Required on create and optional on update. + */ + forSecurableType: SecurableType; + /** Optional condition when the policy should take effect. */ + whenCondition?: string | undefined; + /** Type of the policy. Required on create. */ + policyType: PolicyType; + /** + * (--[Create:REQ Update:OPT] Type-specific options for the Policy--) + * Type-specific options for the policy. + */ + options?: + | { + $case: 'rowFilter'; + /** + * Options for row filter policies. Valid only if `policy_type` is `POLICY_TYPE_ROW_FILTER`. + * Required on create and optional on update. When specified on update, + * the new options will replace the existing options as a whole. + */ + rowFilter: CreateRowFilterOptions; + } + | { + $case: 'columnMask'; + /** + * Options for column mask policies. Valid only if `policy_type` is `POLICY_TYPE_COLUMN_MASK`. + * Required on create and optional on update. When specified on update, + * the new options will replace the existing options as a whole. + */ + columnMask: CreateColumnMaskOptions; + } + | undefined; + /** + * Optional list of condition expressions used to match table columns. + * Only valid when `for_securable_type` is `TABLE`. + * When specified, the policy only applies to tables whose columns satisfy all match conditions. + */ + matchColumns?: CreateMatchColumn[] | undefined; +} + export interface CreatePolicyRequest { /** Required. The policy to create. */ - policyInfo?: PolicyInfo | undefined; + policyInfo?: CreatePolicyInfo | undefined; +} + +export interface CreateRowFilterOptions { + /** + * The fully qualified name of the row filter function. + * The function is called on each row of the target table. It should return a boolean value + * indicating whether the row should be visible to the user. + * Required on create and update. + */ + functionName: string; + /** + * Optional list of column aliases or constant literals to be passed as arguments to the row filter function. + * The type of each column should match the positional argument of the row filter function. + */ + using?: CreateFunctionArgument[] | undefined; } export interface DeletePolicyRequest { @@ -234,6 +361,118 @@ export interface RowFilterOptions { using?: FunctionArgument[] | undefined; } +export interface UpdateColumnMaskOptions { + /** + * The fully qualified name of the column mask function. + * The function is called on each row of the target table. + * The function's first argument and its return type should match the type of the masked column. + * Required on create and update. + */ + functionName?: string | undefined; + /** + * The alias of the column to be masked. The alias must refer to one of matched columns. + * The values of the column is passed to the column mask function as the first argument. + * Required on create and update. + */ + onColumn?: string | undefined; + /** + * Optional list of column aliases or constant literals to be passed as additional arguments to the column mask function. + * The type of each column should match the positional argument of the column mask function. + */ + using?: UpdateFunctionArgument[] | undefined; +} + +export interface UpdateFunctionArgument { + /** A positional argument pass to a row filter or column mask function. */ + arg?: + | { + $case: 'alias'; + /** The alias of a matched column. */ + alias: string; + } + | { + $case: 'constant'; + /** A constant literal. */ + constant: string; + } + | undefined; +} + +export interface UpdateMatchColumn { + /** The condition expression used to match a table column. */ + condition?: string | undefined; + /** Optional alias of the matched column. */ + alias?: string | undefined; +} + +export interface UpdatePolicyInfo { + /** + * Type of the securable on which the policy is defined. + * Only `CATALOG`, `SCHEMA` and `TABLE` are supported at this moment. + * Required on create. + */ + onSecurableType?: SecurableType | undefined; + /** + * Full name of the securable on which the policy is defined. + * Required on create. + */ + onSecurableFullname?: string | undefined; + /** + * Name of the policy. Required on create and optional on update. + * To rename the policy, set `name` to a different value on update. + */ + name?: string | undefined; + /** Optional description of the policy. */ + comment?: string | undefined; + /** + * List of user or group names that the policy applies to. + * Required on create and optional on update. + */ + toPrincipals?: string[] | undefined; + /** Optional list of user or group names that should be excluded from the policy. */ + exceptPrincipals?: string[] | undefined; + /** + * Type of securables that the policy should take effect on. + * Only `TABLE` is supported at this moment. + * Required on create and optional on update. + */ + forSecurableType?: SecurableType | undefined; + /** Optional condition when the policy should take effect. */ + whenCondition?: string | undefined; + /** Type of the policy. Required on create. */ + policyType?: PolicyType | undefined; + /** + * (--[Create:REQ Update:OPT] Type-specific options for the Policy--) + * Type-specific options for the policy. + */ + options?: + | { + $case: 'rowFilter'; + /** + * Options for row filter policies. Valid only if `policy_type` is `POLICY_TYPE_ROW_FILTER`. + * Required on create and optional on update. When specified on update, + * the new options will replace the existing options as a whole. + */ + rowFilter: UpdateRowFilterOptions; + } + | { + $case: 'columnMask'; + /** + * Options for column mask policies. Valid only if `policy_type` is `POLICY_TYPE_COLUMN_MASK`. + * Required on create and optional on update. When specified on update, + * the new options will replace the existing options as a whole. + */ + columnMask: UpdateColumnMaskOptions; + } + | undefined; + /** + * Optional list of condition expressions used to match table columns. + * Only valid when `for_securable_type` is `TABLE`. + * When specified, the policy only applies to tables whose columns satisfy all match conditions. + */ + matchColumns?: UpdateMatchColumn[] | undefined; +} + export interface UpdatePolicyRequest { /** Required. The type of the securable to update the policy for. */ onSecurableType?: string | undefined; @@ -250,12 +489,27 @@ export interface UpdatePolicyRequest { * Users can use the update mask to explicitly unset optional fields such as * `exception_principals` and `when_condition`. */ - policyInfo?: PolicyInfo | undefined; + policyInfo?: UpdatePolicyInfo | undefined; /** * Optional. The update mask field for specifying user intentions on which * fields to update in the request. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; +} + +export interface UpdateRowFilterOptions { + /** + * The fully qualified name of the row filter function. + * The function is called on each row of the target table. It should return a boolean value + * indicating whether the row should be visible to the user. + * Required on create and update. + */ + functionName?: string | undefined; + /** + * Optional list of column aliases or constant literals to be passed as arguments to the row filter function. + * The type of each column should match the positional argument of the row filter function. + */ + using?: UpdateFunctionArgument[] | undefined; } export const unmarshalColumnMaskOptionsSchema: z.ZodType = z @@ -368,11 +622,107 @@ export const unmarshalRowFilterOptionsSchema: z.ZodType = z using: d.using, })); -export const marshalColumnMaskOptionsSchema: z.ZodType = z +export const marshalCreateColumnMaskOptionsSchema: z.ZodType = z + .object({ + functionName: z.string(), + onColumn: z.string(), + using: z + .array(z.lazy(() => marshalCreateFunctionArgumentSchema)) + .optional(), + }) + .transform(d => ({ + function_name: d.functionName, + on_column: d.onColumn, + using: d.using, + })); + +export const marshalCreateFunctionArgumentSchema: z.ZodType = z + .object({ + arg: z + .discriminatedUnion('$case', [ + z.object({$case: z.literal('alias'), alias: z.string()}), + z.object({$case: z.literal('constant'), constant: z.string()}), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.arg?.$case === 'alias' && {alias: d.arg.alias}), + ...(d.arg?.$case === 'constant' && {constant: d.arg.constant}), + })); + +export const marshalCreateMatchColumnSchema: z.ZodType = z + .object({ + condition: z.string().optional(), + alias: z.string().optional(), + }) + .transform(d => ({ + condition: d.condition, + alias: d.alias, + })); + +export const marshalCreatePolicyInfoSchema: z.ZodType = z + .object({ + onSecurableType: z.string().optional(), + onSecurableFullname: z.string().optional(), + name: z.string().optional(), + comment: z.string().optional(), + toPrincipals: z.array(z.string()), + exceptPrincipals: z.array(z.string()).optional(), + forSecurableType: z.string(), + whenCondition: z.string().optional(), + policyType: z.string(), + options: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('rowFilter'), + rowFilter: z.lazy(() => marshalCreateRowFilterOptionsSchema), + }), + z.object({ + $case: z.literal('columnMask'), + columnMask: z.lazy(() => marshalCreateColumnMaskOptionsSchema), + }), + ]) + .optional(), + matchColumns: z + .array(z.lazy(() => marshalCreateMatchColumnSchema)) + .optional(), + }) + .transform(d => ({ + on_securable_type: d.onSecurableType, + on_securable_fullname: d.onSecurableFullname, + name: d.name, + comment: d.comment, + to_principals: d.toPrincipals, + except_principals: d.exceptPrincipals, + for_securable_type: d.forSecurableType, + when_condition: d.whenCondition, + policy_type: d.policyType, + ...(d.options?.$case === 'rowFilter' && {row_filter: d.options.rowFilter}), + ...(d.options?.$case === 'columnMask' && { + column_mask: d.options.columnMask, + }), + match_columns: d.matchColumns, + })); + +export const marshalCreateRowFilterOptionsSchema: z.ZodType = z + .object({ + functionName: z.string(), + using: z + .array(z.lazy(() => marshalCreateFunctionArgumentSchema)) + .optional(), + }) + .transform(d => ({ + function_name: d.functionName, + using: d.using, + })); + +export const marshalUpdateColumnMaskOptionsSchema: z.ZodType = z .object({ functionName: z.string().optional(), onColumn: z.string().optional(), - using: z.array(z.lazy(() => marshalFunctionArgumentSchema)).optional(), + using: z + .array(z.lazy(() => marshalUpdateFunctionArgumentSchema)) + .optional(), }) .transform(d => ({ function_name: d.functionName, @@ -380,7 +730,7 @@ export const marshalColumnMaskOptionsSchema: z.ZodType = z using: d.using, })); -export const marshalFunctionArgumentSchema: z.ZodType = z +export const marshalUpdateFunctionArgumentSchema: z.ZodType = z .object({ arg: z .discriminatedUnion('$case', [ @@ -394,7 +744,7 @@ export const marshalFunctionArgumentSchema: z.ZodType = z ...(d.arg?.$case === 'constant' && {constant: d.arg.constant}), })); -export const marshalMatchColumnSchema: z.ZodType = z +export const marshalUpdateMatchColumnSchema: z.ZodType = z .object({ condition: z.string().optional(), alias: z.string().optional(), @@ -404,9 +754,8 @@ export const marshalMatchColumnSchema: z.ZodType = z alias: d.alias, })); -export const marshalPolicyInfoSchema: z.ZodType = z +export const marshalUpdatePolicyInfoSchema: z.ZodType = z .object({ - id: z.string().optional(), onSecurableType: z.string().optional(), onSecurableFullname: z.string().optional(), name: z.string().optional(), @@ -420,22 +769,19 @@ export const marshalPolicyInfoSchema: z.ZodType = z .discriminatedUnion('$case', [ z.object({ $case: z.literal('rowFilter'), - rowFilter: z.lazy(() => marshalRowFilterOptionsSchema), + rowFilter: z.lazy(() => marshalUpdateRowFilterOptionsSchema), }), z.object({ $case: z.literal('columnMask'), - columnMask: z.lazy(() => marshalColumnMaskOptionsSchema), + columnMask: z.lazy(() => marshalUpdateColumnMaskOptionsSchema), }), ]) .optional(), - matchColumns: z.array(z.lazy(() => marshalMatchColumnSchema)).optional(), - createdAt: z.bigint().optional(), - createdBy: z.string().optional(), - updatedAt: z.bigint().optional(), - updatedBy: z.string().optional(), + matchColumns: z + .array(z.lazy(() => marshalUpdateMatchColumnSchema)) + .optional(), }) .transform(d => ({ - id: d.id, on_securable_type: d.onSecurableType, on_securable_fullname: d.onSecurableFullname, name: d.name, @@ -450,39 +796,34 @@ export const marshalPolicyInfoSchema: z.ZodType = z column_mask: d.options.columnMask, }), match_columns: d.matchColumns, - created_at: d.createdAt, - created_by: d.createdBy, - updated_at: d.updatedAt, - updated_by: d.updatedBy, })); -export const marshalRowFilterOptionsSchema: z.ZodType = z +export const marshalUpdateRowFilterOptionsSchema: z.ZodType = z .object({ functionName: z.string().optional(), - using: z.array(z.lazy(() => marshalFunctionArgumentSchema)).optional(), + using: z + .array(z.lazy(() => marshalUpdateFunctionArgumentSchema)) + .optional(), }) .transform(d => ({ function_name: d.functionName, using: d.using, })); -const columnMaskOptionsFieldMaskSchema: FieldMaskSchema = { +const updateColumnMaskOptionsFieldMaskSchema: FieldMaskSchema = { functionName: {wire: 'function_name'}, onColumn: {wire: 'on_column'}, using: {wire: 'using'}, }; -const policyInfoFieldMaskSchema: FieldMaskSchema = { +const updatePolicyInfoFieldMaskSchema: FieldMaskSchema = { columnMask: { wire: 'column_mask', - children: () => columnMaskOptionsFieldMaskSchema, + children: () => updateColumnMaskOptionsFieldMaskSchema, }, comment: {wire: 'comment'}, - createdAt: {wire: 'created_at'}, - createdBy: {wire: 'created_by'}, exceptPrincipals: {wire: 'except_principals'}, forSecurableType: {wire: 'for_securable_type'}, - id: {wire: 'id'}, matchColumns: {wire: 'match_columns'}, name: {wire: 'name'}, onSecurableFullname: {wire: 'on_securable_fullname'}, @@ -490,19 +831,22 @@ const policyInfoFieldMaskSchema: FieldMaskSchema = { policyType: {wire: 'policy_type'}, rowFilter: { wire: 'row_filter', - children: () => rowFilterOptionsFieldMaskSchema, + children: () => updateRowFilterOptionsFieldMaskSchema, }, toPrincipals: {wire: 'to_principals'}, - updatedAt: {wire: 'updated_at'}, - updatedBy: {wire: 'updated_by'}, whenCondition: {wire: 'when_condition'}, }; -export function policyInfoFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, policyInfoFieldMaskSchema); +export function updatePolicyInfoFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + updatePolicyInfoFieldMaskSchema + ); } -const rowFilterOptionsFieldMaskSchema: FieldMaskSchema = { +const updateRowFilterOptionsFieldMaskSchema: FieldMaskSchema = { functionName: {wire: 'function_name'}, using: {wire: 'using'}, }; diff --git a/packages/uc/artifactallowlists/src/v1/index.ts b/packages/uc/artifactallowlists/src/v1/index.ts index 5f7c7a37..4b2b2524 100755 --- a/packages/uc/artifactallowlists/src/v1/index.ts +++ b/packages/uc/artifactallowlists/src/v1/index.ts @@ -11,6 +11,7 @@ export {ArtifactType, ArtifactMatcher_MatchType} from './model'; export type { ArtifactAllowlistInfo, ArtifactMatcher, + CreateArtifactMatcher, GetArtifactAllowlistRequest, SetArtifactAllowlistRequest, } from './model'; diff --git a/packages/uc/artifactallowlists/src/v1/model.ts b/packages/uc/artifactallowlists/src/v1/model.ts index 13ca59cf..a64bd5ef 100644 --- a/packages/uc/artifactallowlists/src/v1/model.ts +++ b/packages/uc/artifactallowlists/src/v1/model.ts @@ -44,6 +44,13 @@ export interface ArtifactMatcher { matchType?: ArtifactMatcher_MatchType | undefined; } +export interface CreateArtifactMatcher { + /** The artifact path or maven coordinate */ + artifact: string; + /** The pattern matching type of the artifact */ + matchType: ArtifactMatcher_MatchType; +} + export interface GetArtifactAllowlistRequest { /** The artifact type of the allowlist. */ artifactType?: ArtifactType | undefined; @@ -53,7 +60,7 @@ export interface SetArtifactAllowlistRequest { /** The artifact type of the allowlist. */ artifactType?: ArtifactType | undefined; /** A list of allowed artifact match patterns. */ - artifactMatchers?: ArtifactMatcher[] | undefined; + artifactMatchers?: CreateArtifactMatcher[] | undefined; /** Unique identifier of parent metastore. */ metastoreId?: string | undefined; /** Username of the user who set the artifact allowlist. */ @@ -92,10 +99,10 @@ export const unmarshalArtifactMatcherSchema: z.ZodType = z matchType: d.match_type, })); -export const marshalArtifactMatcherSchema: z.ZodType = z +export const marshalCreateArtifactMatcherSchema: z.ZodType = z .object({ - artifact: z.string().optional(), - matchType: z.string().optional(), + artifact: z.string(), + matchType: z.string(), }) .transform(d => ({ artifact: d.artifact, @@ -106,7 +113,7 @@ export const marshalSetArtifactAllowlistRequestSchema: z.ZodType = z .object({ artifactType: z.string().optional(), artifactMatchers: z - .array(z.lazy(() => marshalArtifactMatcherSchema)) + .array(z.lazy(() => marshalCreateArtifactMatcherSchema)) .optional(), metastoreId: z.string().optional(), createdBy: z.string().optional(), diff --git a/packages/uc/catalogs/src/v1/index.ts b/packages/uc/catalogs/src/v1/index.ts index 8759c45b..575329c9 100755 --- a/packages/uc/catalogs/src/v1/index.ts +++ b/packages/uc/catalogs/src/v1/index.ts @@ -16,7 +16,11 @@ export { export type { AzureEncryptionSettings, CatalogInfo, + CreateAzureEncryptionSettings, CreateCatalogRequest, + CreateEffectivePredictiveOptimizationFlag, + CreateEncryptionSettings, + CreateProvisioningInfo, DeleteCatalogRequest, DeleteCatalogResponse, EffectivePredictiveOptimizationFlag, diff --git a/packages/uc/catalogs/src/v1/model.ts b/packages/uc/catalogs/src/v1/model.ts index 62ac1cd9..e128afb6 100755 --- a/packages/uc/catalogs/src/v1/model.ts +++ b/packages/uc/catalogs/src/v1/model.ts @@ -127,6 +127,12 @@ export interface CatalogInfo { options?: Record | undefined; } +export interface CreateAzureEncryptionSettings { + azureTenantId: string; + azureCmkAccessConnectorId?: string | undefined; + azureCmkManagedIdentityId?: string | undefined; +} + export interface CreateCatalogRequest { /** Name of catalog. */ name?: string | undefined; @@ -164,24 +170,52 @@ export interface CreateCatalogRequest { /** Whether the current securable is accessible from all workspaces or a specific set of workspaces. */ isolationMode?: CatalogIsolationMode | undefined; effectivePredictiveOptimizationFlag?: - | EffectivePredictiveOptimizationFlag + | CreateEffectivePredictiveOptimizationFlag | undefined; /** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */ browseOnly?: boolean | undefined; - provisioningInfo?: ProvisioningInfo | undefined; + provisioningInfo?: CreateProvisioningInfo | undefined; /** The full name of the catalog. Corresponds with the name field. */ fullName?: string | undefined; securableType?: SecurableType | undefined; /** Custom maximum retention period in hours for the catalog */ customMaxRetentionHours?: bigint | undefined; /** Control CMK encryption for managed catalog data */ - managedEncryptionSettings?: EncryptionSettings | undefined; + managedEncryptionSettings?: CreateEncryptionSettings | undefined; /** A map of key-value properties attached to the securable. */ properties?: Record | undefined; /** A map of key-value properties attached to the securable. */ options?: Record | undefined; } +export interface CreateEffectivePredictiveOptimizationFlag { + /** Whether predictive optimization should be enabled for this object and objects under it. */ + value: string; + /** The type of the object from which the flag was inherited. If there was no inheritance, this field is left blank. */ + inheritedFromType?: string | undefined; + /** The name of the object from which the flag was inherited. If there was no inheritance, this field is left blank. */ + inheritedFromName?: string | undefined; +} + +/** + * Encryption Settings are used to carry metadata for securable encryption at rest. + * Currently used for catalogs, we can use the information supplied here to interact with a CMK. + */ +export interface CreateEncryptionSettings { + /** the CMK uuid in AWS and GCP, null otherwise. */ + customerManagedKeyId?: string | undefined; + /** the AKV URL in Azure, null otherwise. */ + azureKeyVaultKeyId?: string | undefined; + /** optional Azure settings - only required if an Azure CMK is used. */ + azureEncryptionSettings?: CreateAzureEncryptionSettings | undefined; +} + +/** Status of an asynchronously provisioned resource. */ +export interface CreateProvisioningInfo { + /** The provisioning state of the resource. */ + state?: ProvisioningInfo_State | undefined; +} + export interface DeleteCatalogRequest { /** The name of the catalog. */ nameArg?: string | undefined; @@ -300,18 +334,18 @@ export interface UpdateCatalogRequest { /** Whether the current securable is accessible from all workspaces or a specific set of workspaces. */ isolationMode?: CatalogIsolationMode | undefined; effectivePredictiveOptimizationFlag?: - | EffectivePredictiveOptimizationFlag + | CreateEffectivePredictiveOptimizationFlag | undefined; /** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */ browseOnly?: boolean | undefined; - provisioningInfo?: ProvisioningInfo | undefined; + provisioningInfo?: CreateProvisioningInfo | undefined; /** The full name of the catalog. Corresponds with the name field. */ fullName?: string | undefined; securableType?: SecurableType | undefined; /** Custom maximum retention period in hours for the catalog */ customMaxRetentionHours?: bigint | undefined; /** Control CMK encryption for managed catalog data */ - managedEncryptionSettings?: EncryptionSettings | undefined; + managedEncryptionSettings?: CreateEncryptionSettings | undefined; /** A map of key-value properties attached to the securable. */ properties?: Record | undefined; /** A map of key-value properties attached to the securable. */ @@ -451,9 +485,9 @@ export const unmarshalProvisioningInfoSchema: z.ZodType = z state: d.state, })); -export const marshalAzureEncryptionSettingsSchema: z.ZodType = z +export const marshalCreateAzureEncryptionSettingsSchema: z.ZodType = z .object({ - azureTenantId: z.string().optional(), + azureTenantId: z.string(), azureCmkAccessConnectorId: z.string().optional(), azureCmkManagedIdentityId: z.string().optional(), }) @@ -482,15 +516,17 @@ export const marshalCreateCatalogRequestSchema: z.ZodType = z storageLocation: z.string().optional(), isolationMode: z.string().optional(), effectivePredictiveOptimizationFlag: z - .lazy(() => marshalEffectivePredictiveOptimizationFlagSchema) + .lazy(() => marshalCreateEffectivePredictiveOptimizationFlagSchema) .optional(), browseOnly: z.boolean().optional(), - provisioningInfo: z.lazy(() => marshalProvisioningInfoSchema).optional(), + provisioningInfo: z + .lazy(() => marshalCreateProvisioningInfoSchema) + .optional(), fullName: z.string().optional(), securableType: z.string().optional(), customMaxRetentionHours: z.bigint().optional(), managedEncryptionSettings: z - .lazy(() => marshalEncryptionSettingsSchema) + .lazy(() => marshalCreateEncryptionSettingsSchema) .optional(), properties: z.record(z.string(), z.string()).optional(), options: z.record(z.string(), z.string()).optional(), @@ -524,24 +560,25 @@ export const marshalCreateCatalogRequestSchema: z.ZodType = z options: d.options, })); -export const marshalEffectivePredictiveOptimizationFlagSchema: z.ZodType = z - .object({ - value: z.string().optional(), - inheritedFromType: z.string().optional(), - inheritedFromName: z.string().optional(), - }) - .transform(d => ({ - value: d.value, - inherited_from_type: d.inheritedFromType, - inherited_from_name: d.inheritedFromName, - })); +export const marshalCreateEffectivePredictiveOptimizationFlagSchema: z.ZodType = + z + .object({ + value: z.string(), + inheritedFromType: z.string().optional(), + inheritedFromName: z.string().optional(), + }) + .transform(d => ({ + value: d.value, + inherited_from_type: d.inheritedFromType, + inherited_from_name: d.inheritedFromName, + })); -export const marshalEncryptionSettingsSchema: z.ZodType = z +export const marshalCreateEncryptionSettingsSchema: z.ZodType = z .object({ customerManagedKeyId: z.string().optional(), azureKeyVaultKeyId: z.string().optional(), azureEncryptionSettings: z - .lazy(() => marshalAzureEncryptionSettingsSchema) + .lazy(() => marshalCreateAzureEncryptionSettingsSchema) .optional(), }) .transform(d => ({ @@ -550,7 +587,7 @@ export const marshalEncryptionSettingsSchema: z.ZodType = z azure_encryption_settings: d.azureEncryptionSettings, })); -export const marshalProvisioningInfoSchema: z.ZodType = z +export const marshalCreateProvisioningInfoSchema: z.ZodType = z .object({ state: z.string().optional(), }) @@ -579,15 +616,17 @@ export const marshalUpdateCatalogRequestSchema: z.ZodType = z storageLocation: z.string().optional(), isolationMode: z.string().optional(), effectivePredictiveOptimizationFlag: z - .lazy(() => marshalEffectivePredictiveOptimizationFlagSchema) + .lazy(() => marshalCreateEffectivePredictiveOptimizationFlagSchema) .optional(), browseOnly: z.boolean().optional(), - provisioningInfo: z.lazy(() => marshalProvisioningInfoSchema).optional(), + provisioningInfo: z + .lazy(() => marshalCreateProvisioningInfoSchema) + .optional(), fullName: z.string().optional(), securableType: z.string().optional(), customMaxRetentionHours: z.bigint().optional(), managedEncryptionSettings: z - .lazy(() => marshalEncryptionSettingsSchema) + .lazy(() => marshalCreateEncryptionSettingsSchema) .optional(), properties: z.record(z.string(), z.string()).optional(), options: z.record(z.string(), z.string()).optional(), diff --git a/packages/uc/connections/src/v1/index.ts b/packages/uc/connections/src/v1/index.ts index 831f6259..1c156e7e 100755 --- a/packages/uc/connections/src/v1/index.ts +++ b/packages/uc/connections/src/v1/index.ts @@ -16,6 +16,8 @@ export { export type { ConnectionInfo, CreateConnectionRequest, + CreateEnvironmentSettings, + CreateProvisioningInfo, DeleteConnectionRequest, DeleteConnectionResponse, EnvironmentSettings, diff --git a/packages/uc/connections/src/v1/model.ts b/packages/uc/connections/src/v1/model.ts index 9acd97dc..e6dbdf8d 100755 --- a/packages/uc/connections/src/v1/model.ts +++ b/packages/uc/connections/src/v1/model.ts @@ -152,7 +152,7 @@ export interface CreateConnectionRequest { /** User-provided free-form text description. */ comment?: string | undefined; /** [Create,Update:OPT] Connection environment settings as EnvironmentSettings object. */ - environmentSettings?: EnvironmentSettings | undefined; + environmentSettings?: CreateEnvironmentSettings | undefined; /** Full name of connection. */ fullName?: string | undefined; /** URL of the remote data source, extracted from options. */ @@ -172,13 +172,24 @@ export interface CreateConnectionRequest { /** Username of user who last modified connection. */ updatedBy?: string | undefined; securableType?: SecurableType | undefined; - provisioningInfo?: ProvisioningInfo | undefined; + provisioningInfo?: CreateProvisioningInfo | undefined; /** A map of key-value properties attached to the securable. */ options?: Record | undefined; /** A map of key-value properties attached to the securable. */ properties?: Record | undefined; } +export interface CreateEnvironmentSettings { + javaDependencies?: string[] | undefined; + environmentVersion?: string | undefined; +} + +/** Status of an asynchronously provisioned resource. */ +export interface CreateProvisioningInfo { + /** The provisioning state of the resource. */ + state?: ProvisioningInfo_State | undefined; +} + export interface DeleteConnectionRequest { /** The name of the connection to be deleted. */ nameArg?: string | undefined; @@ -242,7 +253,7 @@ export interface UpdateConnectionRequest { /** User-provided free-form text description. */ comment?: string | undefined; /** [Create,Update:OPT] Connection environment settings as EnvironmentSettings object. */ - environmentSettings?: EnvironmentSettings | undefined; + environmentSettings?: CreateEnvironmentSettings | undefined; /** Full name of connection. */ fullName?: string | undefined; /** URL of the remote data source, extracted from options. */ @@ -262,7 +273,7 @@ export interface UpdateConnectionRequest { /** Username of user who last modified connection. */ updatedBy?: string | undefined; securableType?: SecurableType | undefined; - provisioningInfo?: ProvisioningInfo | undefined; + provisioningInfo?: CreateProvisioningInfo | undefined; /** A map of key-value properties attached to the securable. */ options?: Record | undefined; /** A map of key-value properties attached to the securable. */ @@ -364,7 +375,7 @@ export const marshalCreateConnectionRequestSchema: z.ZodType = z readOnly: z.boolean().optional(), comment: z.string().optional(), environmentSettings: z - .lazy(() => marshalEnvironmentSettingsSchema) + .lazy(() => marshalCreateEnvironmentSettingsSchema) .optional(), fullName: z.string().optional(), url: z.string().optional(), @@ -376,7 +387,9 @@ export const marshalCreateConnectionRequestSchema: z.ZodType = z updatedAt: z.bigint().optional(), updatedBy: z.string().optional(), securableType: z.string().optional(), - provisioningInfo: z.lazy(() => marshalProvisioningInfoSchema).optional(), + provisioningInfo: z + .lazy(() => marshalCreateProvisioningInfoSchema) + .optional(), options: z.record(z.string(), z.string()).optional(), properties: z.record(z.string(), z.string()).optional(), }) @@ -402,7 +415,7 @@ export const marshalCreateConnectionRequestSchema: z.ZodType = z properties: d.properties, })); -export const marshalEnvironmentSettingsSchema: z.ZodType = z +export const marshalCreateEnvironmentSettingsSchema: z.ZodType = z .object({ javaDependencies: z.array(z.string()).optional(), environmentVersion: z.string().optional(), @@ -412,7 +425,7 @@ export const marshalEnvironmentSettingsSchema: z.ZodType = z environment_version: d.environmentVersion, })); -export const marshalProvisioningInfoSchema: z.ZodType = z +export const marshalCreateProvisioningInfoSchema: z.ZodType = z .object({ state: z.string().optional(), }) @@ -430,7 +443,7 @@ export const marshalUpdateConnectionRequestSchema: z.ZodType = z readOnly: z.boolean().optional(), comment: z.string().optional(), environmentSettings: z - .lazy(() => marshalEnvironmentSettingsSchema) + .lazy(() => marshalCreateEnvironmentSettingsSchema) .optional(), fullName: z.string().optional(), url: z.string().optional(), @@ -442,7 +455,9 @@ export const marshalUpdateConnectionRequestSchema: z.ZodType = z updatedAt: z.bigint().optional(), updatedBy: z.string().optional(), securableType: z.string().optional(), - provisioningInfo: z.lazy(() => marshalProvisioningInfoSchema).optional(), + provisioningInfo: z + .lazy(() => marshalCreateProvisioningInfoSchema) + .optional(), options: z.record(z.string(), z.string()).optional(), properties: z.record(z.string(), z.string()).optional(), }) diff --git a/packages/uc/credentials/src/v1/index.ts b/packages/uc/credentials/src/v1/index.ts index a607750d..e58f6f48 100755 --- a/packages/uc/credentials/src/v1/index.ts +++ b/packages/uc/credentials/src/v1/index.ts @@ -28,6 +28,7 @@ export type { AccountsUpdateStorageCredentialRequest, AccountsUpdateStorageCredentialResponse, AwsCredentials, + AwsCredentials_CreateStsRole, AwsCredentials_StsRole, AwsIamRole, AzureActiveDirectoryToken, @@ -36,10 +37,19 @@ export type { AzureUserDelegationSas, CloudflareApiToken, CreateAccountsStorageCredential, + CreateAwsIamRole, + CreateAzureManagedIdentity, + CreateAzureServicePrincipal, + CreateCloudflareApiToken, + CreateCreateAccountsStorageCredential, + CreateCreateCredentialAwsCredentials, CreateCredentialAwsCredentials, CreateCredentialRequest, CreateCredentialsRequest, + CreateDatabricksGcpServiceAccount, + CreateGcpServiceAccountKey, CreateStorageCredentialRequest, + CreateUpdateAccountsStorageCredential, CredentialInfo, Credentials, DatabricksGcpServiceAccount, @@ -54,6 +64,8 @@ export type { GenerateTemporaryPathCredentialResponse, GenerateTemporaryServiceCredentialRequest, GenerateTemporaryServiceCredentialRequest_AzureOptions, + GenerateTemporaryServiceCredentialRequest_CreateAzureOptions, + GenerateTemporaryServiceCredentialRequest_CreateGcpOptions, GenerateTemporaryServiceCredentialRequest_GcpOptions, GenerateTemporaryTableCredentialRequest, GenerateTemporaryTableCredentialResponse, diff --git a/packages/uc/credentials/src/v1/model.ts b/packages/uc/credentials/src/v1/model.ts index 30341e48..8a3e4dc4 100755 --- a/packages/uc/credentials/src/v1/model.ts +++ b/packages/uc/credentials/src/v1/model.ts @@ -86,7 +86,7 @@ export interface AccountsCreateStorageCredentialRequest { accountId?: string | undefined; /** Unity Catalog metastore ID */ metastoreId?: string | undefined; - credentialInfo?: CreateAccountsStorageCredential | undefined; + credentialInfo?: CreateCreateAccountsStorageCredential | undefined; /** * Optional, default false. * Supplying true to this argument skips validation of the created set of credentials. @@ -151,7 +151,7 @@ export interface AccountsUpdateStorageCredentialRequest { metastoreId?: string | undefined; /** Name of the storage credential. */ nameArg?: string | undefined; - credentialInfo?: UpdateAccountsStorageCredential | undefined; + credentialInfo?: CreateUpdateAccountsStorageCredential | undefined; /** Optional. Supplying true to this argument skips validation of the updated set of credentials. */ skipValidation?: boolean | undefined; } @@ -165,6 +165,12 @@ export interface AwsCredentials { creds?: {$case: 'stsRole'; stsRole: AwsCredentials_StsRole} | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface AwsCredentials_CreateStsRole { + /** The Amazon Resource Name (ARN) of the cross account IAM role. */ + roleArn?: string | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface AwsCredentials_StsRole { /** The Amazon Resource Name (ARN) of the cross account IAM role. */ @@ -317,6 +323,128 @@ export interface CreateAccountsStorageCredential { isolationMode?: IsolationMode | undefined; } +/** The AWS IAM role configuration */ +export interface CreateAwsIamRole { + /** The Amazon Resource Name (ARN) of the AWS IAM role used to vend temporary credentials. */ + roleArn?: string | undefined; +} + +/** The Azure managed identity configuration. */ +export interface CreateAzureManagedIdentity { + /** + * The Azure resource ID of the Azure Databricks Access Connector. Use the format + * `/subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.Databricks/accessConnectors/{connector-name}`. + */ + accessConnectorId: string; + /** + * The Azure resource ID of the managed identity. Use the format, + * `/subscriptions/{guid}/resourceGroups/{rg-name}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identity-name}` + * This is only available for user-assgined identities. For system-assigned identities, the access_connector_id is used to identify the identity. + * If this field is not provided, then we assume the AzureManagedIdentity is using the system-assigned identity. + */ + managedIdentityId?: string | undefined; +} + +/** The Azure service principal configuration. Only applicable when purpose is **STORAGE**. */ +export interface CreateAzureServicePrincipal { + /** The directory ID corresponding to the Azure Active Directory (AAD) tenant of the application. */ + directoryId: string; + /** The application ID of the application registration within the referenced AAD tenant. */ + applicationId: string; + /** The client secret generated for the above app ID in AAD. */ + clientSecret: string; +} + +/** + * The Cloudflare API token configuration. + * Read more at https://developers.cloudflare.com/r2/api/s3/tokens/ + */ +export interface CreateCloudflareApiToken { + /** The access key ID associated with the API token. */ + accessKeyId: string; + /** The secret access token generated for the above access key ID. */ + secretAccessKey: string; + /** The ID of the account associated with the API token. */ + accountId: string; +} + +export interface CreateCreateAccountsStorageCredential { + /** + * The credential name. The name must be unique among storage and service + * credentials within the metastore. + */ + name?: string | undefined; + /** (--[Create:REQ, Update:OPT] The long-lived cloud credential.--) */ + credential?: + | { + $case: 'awsIamRole'; + /** The AWS IAM role configuration. */ + awsIamRole: CreateAwsIamRole; + } + | { + $case: 'azureServicePrincipal'; + /** The Azure service principal configuration. */ + azureServicePrincipal: CreateAzureServicePrincipal; + } + | { + $case: 'gcpServiceAccountKey'; + gcpServiceAccountKey: CreateGcpServiceAccountKey; + } + | { + $case: 'azureManagedIdentity'; + /** The Azure managed identity configuration. */ + azureManagedIdentity: CreateAzureManagedIdentity; + } + | { + $case: 'databricksGcpServiceAccount'; + /** The managed GCP service account configuration. */ + databricksGcpServiceAccount: CreateDatabricksGcpServiceAccount; + } + | { + $case: 'cloudflareApiToken'; + /** The Cloudflare API token configuration. */ + cloudflareApiToken: CreateCloudflareApiToken; + } + | undefined; + /** Comment associated with the credential. */ + comment?: string | undefined; + /** + * Whether the credential is usable only for read operations. Only applicable + * when purpose is **STORAGE**. + */ + readOnly?: boolean | undefined; + /** Username of current owner of credential. */ + owner?: string | undefined; + /** The unique identifier of the credential. */ + id?: string | undefined; + /** Unique identifier of the parent metastore. */ + metastoreId?: string | undefined; + /** Time at which this credential was created, in epoch milliseconds. */ + createdAt?: bigint | undefined; + /** Username of credential creator. */ + createdBy?: string | undefined; + /** Time at which this credential was last modified, in epoch milliseconds. */ + updatedAt?: bigint | undefined; + /** Username of user who last modified the credential. */ + updatedBy?: string | undefined; + /** + * Whether this credential is the current metastore's root storage credential. + * Only applicable when purpose is **STORAGE**. + */ + usedForManagedStorage?: boolean | undefined; + /** The full name of the credential. */ + fullName?: string | undefined; + /** + * Whether the current securable is accessible from all workspaces or a + * specific set of workspaces. + */ + isolationMode?: IsolationMode | undefined; +} + +export interface CreateCreateCredentialAwsCredentials { + creds?: {$case: 'stsRole'; stsRole: AwsCredentials_CreateStsRole} | undefined; +} + export interface CreateCredentialAwsCredentials { creds?: {$case: 'stsRole'; stsRole: AwsCredentials_StsRole} | undefined; } @@ -337,31 +465,31 @@ export interface CreateCredentialRequest { | { $case: 'awsIamRole'; /** The AWS IAM role configuration. */ - awsIamRole: AwsIamRole; + awsIamRole: CreateAwsIamRole; } | { $case: 'azureServicePrincipal'; /** The Azure service principal configuration. */ - azureServicePrincipal: AzureServicePrincipal; + azureServicePrincipal: CreateAzureServicePrincipal; } | { $case: 'gcpServiceAccountKey'; - gcpServiceAccountKey: GcpServiceAccountKey; + gcpServiceAccountKey: CreateGcpServiceAccountKey; } | { $case: 'azureManagedIdentity'; /** The Azure managed identity configuration. */ - azureManagedIdentity: AzureManagedIdentity; + azureManagedIdentity: CreateAzureManagedIdentity; } | { $case: 'databricksGcpServiceAccount'; /** The managed GCP service account configuration. */ - databricksGcpServiceAccount: DatabricksGcpServiceAccount; + databricksGcpServiceAccount: CreateDatabricksGcpServiceAccount; } | { $case: 'cloudflareApiToken'; /** The Cloudflare API token configuration. */ - cloudflareApiToken: CloudflareApiToken; + cloudflareApiToken: CreateCloudflareApiToken; } | undefined; /** Comment associated with the credential. */ @@ -405,10 +533,33 @@ export interface CreateCredentialsRequest { credentialsName?: string | undefined; /** (-- NOTE(austin) This oneof is a future-looking definition when we add other clouds --) */ cloudCredentials?: - | {$case: 'awsCredentials'; awsCredentials: CreateCredentialAwsCredentials} + | { + $case: 'awsCredentials'; + awsCredentials: CreateCreateCredentialAwsCredentials; + } | undefined; } +/** + * GCP long-lived credential. + * -created Google Cloud Storage service account. + */ +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface CreateDatabricksGcpServiceAccount {} + +/** + * GCP long-lived credential. + * GCP Service Account. + */ +export interface CreateGcpServiceAccountKey { + /** The email of the service account. */ + email?: string | undefined; + /** The ID of the service account's private key. */ + privateKeyId?: string | undefined; + /** The service account's RSA private key. */ + privateKey?: string | undefined; +} + export interface CreateStorageCredentialRequest { /** Supplying true to this argument skips validation of the created credential. */ skipValidation?: boolean | undefined; @@ -422,31 +573,104 @@ export interface CreateStorageCredentialRequest { | { $case: 'awsIamRole'; /** The AWS IAM role configuration. */ - awsIamRole: AwsIamRole; + awsIamRole: CreateAwsIamRole; } | { $case: 'azureServicePrincipal'; /** The Azure service principal configuration. */ - azureServicePrincipal: AzureServicePrincipal; + azureServicePrincipal: CreateAzureServicePrincipal; } | { $case: 'gcpServiceAccountKey'; - gcpServiceAccountKey: GcpServiceAccountKey; + gcpServiceAccountKey: CreateGcpServiceAccountKey; } | { $case: 'azureManagedIdentity'; /** The Azure managed identity configuration. */ - azureManagedIdentity: AzureManagedIdentity; + azureManagedIdentity: CreateAzureManagedIdentity; } | { $case: 'databricksGcpServiceAccount'; /** The managed GCP service account configuration. */ - databricksGcpServiceAccount: DatabricksGcpServiceAccount; + databricksGcpServiceAccount: CreateDatabricksGcpServiceAccount; } | { $case: 'cloudflareApiToken'; /** The Cloudflare API token configuration. */ - cloudflareApiToken: CloudflareApiToken; + cloudflareApiToken: CreateCloudflareApiToken; + } + | undefined; + /** Comment associated with the credential. */ + comment?: string | undefined; + /** + * Whether the credential is usable only for read operations. Only applicable + * when purpose is **STORAGE**. + */ + readOnly?: boolean | undefined; + /** Username of current owner of credential. */ + owner?: string | undefined; + /** The unique identifier of the credential. */ + id?: string | undefined; + /** Unique identifier of the parent metastore. */ + metastoreId?: string | undefined; + /** Time at which this credential was created, in epoch milliseconds. */ + createdAt?: bigint | undefined; + /** Username of credential creator. */ + createdBy?: string | undefined; + /** Time at which this credential was last modified, in epoch milliseconds. */ + updatedAt?: bigint | undefined; + /** Username of user who last modified the credential. */ + updatedBy?: string | undefined; + /** + * Whether this credential is the current metastore's root storage credential. + * Only applicable when purpose is **STORAGE**. + */ + usedForManagedStorage?: boolean | undefined; + /** The full name of the credential. */ + fullName?: string | undefined; + /** + * Whether the current securable is accessible from all workspaces or a + * specific set of workspaces. + */ + isolationMode?: IsolationMode | undefined; +} + +export interface CreateUpdateAccountsStorageCredential { + /** + * The credential name. The name must be unique among storage and service + * credentials within the metastore. + */ + name?: string | undefined; + /** (--[Create:REQ, Update:OPT] The long-lived cloud credential.--) */ + credential?: + | { + $case: 'awsIamRole'; + /** The AWS IAM role configuration. */ + awsIamRole: CreateAwsIamRole; + } + | { + $case: 'azureServicePrincipal'; + /** The Azure service principal configuration. */ + azureServicePrincipal: CreateAzureServicePrincipal; + } + | { + $case: 'gcpServiceAccountKey'; + gcpServiceAccountKey: CreateGcpServiceAccountKey; + } + | { + $case: 'azureManagedIdentity'; + /** The Azure managed identity configuration. */ + azureManagedIdentity: CreateAzureManagedIdentity; + } + | { + $case: 'databricksGcpServiceAccount'; + /** The managed GCP service account configuration. */ + databricksGcpServiceAccount: CreateDatabricksGcpServiceAccount; + } + | { + $case: 'cloudflareApiToken'; + /** The Cloudflare API token configuration. */ + cloudflareApiToken: CreateCloudflareApiToken; } | undefined; /** Comment associated with the credential. */ @@ -680,11 +904,11 @@ export interface GenerateTemporaryServiceCredentialRequest { options?: | { $case: 'azureOptions'; - azureOptions: GenerateTemporaryServiceCredentialRequest_AzureOptions; + azureOptions: GenerateTemporaryServiceCredentialRequest_CreateAzureOptions; } | { $case: 'gcpOptions'; - gcpOptions: GenerateTemporaryServiceCredentialRequest_GcpOptions; + gcpOptions: GenerateTemporaryServiceCredentialRequest_CreateGcpOptions; } | undefined; } @@ -699,6 +923,27 @@ export interface GenerateTemporaryServiceCredentialRequest_AzureOptions { resources?: string[] | undefined; } +/** The Azure cloud options to customize the requested temporary credential */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface GenerateTemporaryServiceCredentialRequest_CreateAzureOptions { + /** + * The resources to which the temporary Azure credential should apply. These resources + * are the scopes that are passed to the token provider (see https://learn.microsoft.com/python/api/azure-core/azure.core.credentials.tokencredential?view=azure-python) + */ + resources?: string[] | undefined; +} + +/** The GCP cloud options to customize the requested temporary credential */ +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface GenerateTemporaryServiceCredentialRequest_CreateGcpOptions { + /** + * The scopes to which the temporary GCP credential should apply. These resources + * are the scopes that are passed to the token provider (see + * https://google-auth.readthedocs.io/en/latest/reference/google.auth.html#google.auth.credentials.Credentials) + */ + scopes?: string[] | undefined; +} + /** The GCP cloud options to customize the requested temporary credential */ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface GenerateTemporaryServiceCredentialRequest_GcpOptions { @@ -1095,31 +1340,31 @@ export interface UpdateCredentialRequest { | { $case: 'awsIamRole'; /** The AWS IAM role configuration. */ - awsIamRole: AwsIamRole; + awsIamRole: CreateAwsIamRole; } | { $case: 'azureServicePrincipal'; /** The Azure service principal configuration. */ - azureServicePrincipal: AzureServicePrincipal; + azureServicePrincipal: CreateAzureServicePrincipal; } | { $case: 'gcpServiceAccountKey'; - gcpServiceAccountKey: GcpServiceAccountKey; + gcpServiceAccountKey: CreateGcpServiceAccountKey; } | { $case: 'azureManagedIdentity'; /** The Azure managed identity configuration. */ - azureManagedIdentity: AzureManagedIdentity; + azureManagedIdentity: CreateAzureManagedIdentity; } | { $case: 'databricksGcpServiceAccount'; /** The managed GCP service account configuration. */ - databricksGcpServiceAccount: DatabricksGcpServiceAccount; + databricksGcpServiceAccount: CreateDatabricksGcpServiceAccount; } | { $case: 'cloudflareApiToken'; /** The Cloudflare API token configuration. */ - cloudflareApiToken: CloudflareApiToken; + cloudflareApiToken: CreateCloudflareApiToken; } | undefined; /** Comment associated with the credential. */ @@ -1179,31 +1424,31 @@ export interface UpdateStorageCredentialRequest { | { $case: 'awsIamRole'; /** The AWS IAM role configuration. */ - awsIamRole: AwsIamRole; + awsIamRole: CreateAwsIamRole; } | { $case: 'azureServicePrincipal'; /** The Azure service principal configuration. */ - azureServicePrincipal: AzureServicePrincipal; + azureServicePrincipal: CreateAzureServicePrincipal; } | { $case: 'gcpServiceAccountKey'; - gcpServiceAccountKey: GcpServiceAccountKey; + gcpServiceAccountKey: CreateGcpServiceAccountKey; } | { $case: 'azureManagedIdentity'; /** The Azure managed identity configuration. */ - azureManagedIdentity: AzureManagedIdentity; + azureManagedIdentity: CreateAzureManagedIdentity; } | { $case: 'databricksGcpServiceAccount'; /** The managed GCP service account configuration. */ - databricksGcpServiceAccount: DatabricksGcpServiceAccount; + databricksGcpServiceAccount: CreateDatabricksGcpServiceAccount; } | { $case: 'cloudflareApiToken'; /** The Cloudflare API token configuration. */ - cloudflareApiToken: CloudflareApiToken; + cloudflareApiToken: CreateCloudflareApiToken; } | undefined; /** Comment associated with the credential. */ @@ -1251,14 +1496,14 @@ export interface ValidateCredentialRequest { */ credentialName: string; } - | {$case: 'awsIamRole'; awsIamRole: AwsIamRole} + | {$case: 'awsIamRole'; awsIamRole: CreateAwsIamRole} | { $case: 'azureManagedIdentity'; - azureManagedIdentity: AzureManagedIdentity; + azureManagedIdentity: CreateAzureManagedIdentity; } | { $case: 'databricksGcpServiceAccount'; - databricksGcpServiceAccount: DatabricksGcpServiceAccount; + databricksGcpServiceAccount: CreateDatabricksGcpServiceAccount; } | undefined; /** @@ -1311,27 +1556,27 @@ export interface ValidateStorageCredentialRequest { | { $case: 'awsIamRole'; /** The AWS IAM role configuration. */ - awsIamRole: AwsIamRole; + awsIamRole: CreateAwsIamRole; } | { $case: 'azureServicePrincipal'; /** The Azure service principal configuration. */ - azureServicePrincipal: AzureServicePrincipal; + azureServicePrincipal: CreateAzureServicePrincipal; } | { $case: 'azureManagedIdentity'; /** The Azure managed identity configuration. */ - azureManagedIdentity: AzureManagedIdentity; + azureManagedIdentity: CreateAzureManagedIdentity; } | { $case: 'databricksGcpServiceAccount'; /** The created GCP service account configuration. */ - databricksGcpServiceAccount: DatabricksGcpServiceAccount; + databricksGcpServiceAccount: CreateDatabricksGcpServiceAccount; } | { $case: 'cloudflareApiToken'; /** The Cloudflare API token configuration. */ - cloudflareApiToken: CloudflareApiToken; + cloudflareApiToken: CreateCloudflareApiToken; } | undefined; /** The name of an existing external location to validate. */ @@ -2051,7 +2296,7 @@ export const marshalAccountsCreateStorageCredentialRequestSchema: z.ZodType = z accountId: z.string().optional(), metastoreId: z.string().optional(), credentialInfo: z - .lazy(() => marshalCreateAccountsStorageCredentialSchema) + .lazy(() => marshalCreateCreateAccountsStorageCredentialSchema) .optional(), skipValidation: z.boolean().optional(), }) @@ -2068,7 +2313,7 @@ export const marshalAccountsUpdateStorageCredentialRequestSchema: z.ZodType = z metastoreId: z.string().optional(), nameArg: z.string().optional(), credentialInfo: z - .lazy(() => marshalUpdateAccountsStorageCredentialSchema) + .lazy(() => marshalCreateUpdateAccountsStorageCredentialSchema) .optional(), skipValidation: z.boolean().optional(), }) @@ -2081,7 +2326,7 @@ export const marshalAccountsUpdateStorageCredentialRequestSchema: z.ZodType = z })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalAwsCredentials_StsRoleSchema: z.ZodType = z +export const marshalAwsCredentials_CreateStsRoleSchema: z.ZodType = z .object({ roleArn: z.string().optional(), }) @@ -2089,35 +2334,29 @@ export const marshalAwsCredentials_StsRoleSchema: z.ZodType = z role_arn: d.roleArn, })); -export const marshalAwsIamRoleSchema: z.ZodType = z +export const marshalCreateAwsIamRoleSchema: z.ZodType = z .object({ roleArn: z.string().optional(), - unityCatalogIamArn: z.string().optional(), - externalId: z.string().optional(), }) .transform(d => ({ role_arn: d.roleArn, - unity_catalog_iam_arn: d.unityCatalogIamArn, - external_id: d.externalId, })); -export const marshalAzureManagedIdentitySchema: z.ZodType = z +export const marshalCreateAzureManagedIdentitySchema: z.ZodType = z .object({ - accessConnectorId: z.string().optional(), + accessConnectorId: z.string(), managedIdentityId: z.string().optional(), - credentialId: z.string().optional(), }) .transform(d => ({ access_connector_id: d.accessConnectorId, managed_identity_id: d.managedIdentityId, - credential_id: d.credentialId, })); -export const marshalAzureServicePrincipalSchema: z.ZodType = z +export const marshalCreateAzureServicePrincipalSchema: z.ZodType = z .object({ - directoryId: z.string().optional(), - applicationId: z.string().optional(), - clientSecret: z.string().optional(), + directoryId: z.string(), + applicationId: z.string(), + clientSecret: z.string(), }) .transform(d => ({ directory_id: d.directoryId, @@ -2125,11 +2364,11 @@ export const marshalAzureServicePrincipalSchema: z.ZodType = z client_secret: d.clientSecret, })); -export const marshalCloudflareApiTokenSchema: z.ZodType = z +export const marshalCreateCloudflareApiTokenSchema: z.ZodType = z .object({ - accessKeyId: z.string().optional(), - secretAccessKey: z.string().optional(), - accountId: z.string().optional(), + accessKeyId: z.string(), + secretAccessKey: z.string(), + accountId: z.string(), }) .transform(d => ({ access_key_id: d.accessKeyId, @@ -2137,38 +2376,44 @@ export const marshalCloudflareApiTokenSchema: z.ZodType = z account_id: d.accountId, })); -export const marshalCreateAccountsStorageCredentialSchema: z.ZodType = z +export const marshalCreateCreateAccountsStorageCredentialSchema: z.ZodType = z .object({ name: z.string().optional(), credential: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('awsIamRole'), - awsIamRole: z.lazy(() => marshalAwsIamRoleSchema), + awsIamRole: z.lazy(() => marshalCreateAwsIamRoleSchema), }), z.object({ $case: z.literal('azureServicePrincipal'), azureServicePrincipal: z.lazy( - () => marshalAzureServicePrincipalSchema + () => marshalCreateAzureServicePrincipalSchema ), }), z.object({ $case: z.literal('gcpServiceAccountKey'), - gcpServiceAccountKey: z.lazy(() => marshalGcpServiceAccountKeySchema), + gcpServiceAccountKey: z.lazy( + () => marshalCreateGcpServiceAccountKeySchema + ), }), z.object({ $case: z.literal('azureManagedIdentity'), - azureManagedIdentity: z.lazy(() => marshalAzureManagedIdentitySchema), + azureManagedIdentity: z.lazy( + () => marshalCreateAzureManagedIdentitySchema + ), }), z.object({ $case: z.literal('databricksGcpServiceAccount'), databricksGcpServiceAccount: z.lazy( - () => marshalDatabricksGcpServiceAccountSchema + () => marshalCreateDatabricksGcpServiceAccountSchema ), }), z.object({ $case: z.literal('cloudflareApiToken'), - cloudflareApiToken: z.lazy(() => marshalCloudflareApiTokenSchema), + cloudflareApiToken: z.lazy( + () => marshalCreateCloudflareApiTokenSchema + ), }), ]) .optional(), @@ -2219,13 +2464,13 @@ export const marshalCreateAccountsStorageCredentialSchema: z.ZodType = z isolation_mode: d.isolationMode, })); -export const marshalCreateCredentialAwsCredentialsSchema: z.ZodType = z +export const marshalCreateCreateCredentialAwsCredentialsSchema: z.ZodType = z .object({ creds: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('stsRole'), - stsRole: z.lazy(() => marshalAwsCredentials_StsRoleSchema), + stsRole: z.lazy(() => marshalAwsCredentials_CreateStsRoleSchema), }), ]) .optional(), @@ -2242,31 +2487,37 @@ export const marshalCreateCredentialRequestSchema: z.ZodType = z .discriminatedUnion('$case', [ z.object({ $case: z.literal('awsIamRole'), - awsIamRole: z.lazy(() => marshalAwsIamRoleSchema), + awsIamRole: z.lazy(() => marshalCreateAwsIamRoleSchema), }), z.object({ $case: z.literal('azureServicePrincipal'), azureServicePrincipal: z.lazy( - () => marshalAzureServicePrincipalSchema + () => marshalCreateAzureServicePrincipalSchema ), }), z.object({ $case: z.literal('gcpServiceAccountKey'), - gcpServiceAccountKey: z.lazy(() => marshalGcpServiceAccountKeySchema), + gcpServiceAccountKey: z.lazy( + () => marshalCreateGcpServiceAccountKeySchema + ), }), z.object({ $case: z.literal('azureManagedIdentity'), - azureManagedIdentity: z.lazy(() => marshalAzureManagedIdentitySchema), + azureManagedIdentity: z.lazy( + () => marshalCreateAzureManagedIdentitySchema + ), }), z.object({ $case: z.literal('databricksGcpServiceAccount'), databricksGcpServiceAccount: z.lazy( - () => marshalDatabricksGcpServiceAccountSchema + () => marshalCreateDatabricksGcpServiceAccountSchema ), }), z.object({ $case: z.literal('cloudflareApiToken'), - cloudflareApiToken: z.lazy(() => marshalCloudflareApiTokenSchema), + cloudflareApiToken: z.lazy( + () => marshalCreateCloudflareApiTokenSchema + ), }), ]) .optional(), @@ -2327,7 +2578,7 @@ export const marshalCreateCredentialsRequestSchema: z.ZodType = z z.object({ $case: z.literal('awsCredentials'), awsCredentials: z.lazy( - () => marshalCreateCredentialAwsCredentialsSchema + () => marshalCreateCreateCredentialAwsCredentialsSchema ), }), ]) @@ -2341,6 +2592,21 @@ export const marshalCreateCredentialsRequestSchema: z.ZodType = z }), })); +export const marshalCreateDatabricksGcpServiceAccountSchema: z.ZodType = + z.object({}); + +export const marshalCreateGcpServiceAccountKeySchema: z.ZodType = z + .object({ + email: z.string().optional(), + privateKeyId: z.string().optional(), + privateKey: z.string().optional(), + }) + .transform(d => ({ + email: d.email, + private_key_id: d.privateKeyId, + private_key: d.privateKey, + })); + export const marshalCreateStorageCredentialRequestSchema: z.ZodType = z .object({ skipValidation: z.boolean().optional(), @@ -2349,31 +2615,37 @@ export const marshalCreateStorageCredentialRequestSchema: z.ZodType = z .discriminatedUnion('$case', [ z.object({ $case: z.literal('awsIamRole'), - awsIamRole: z.lazy(() => marshalAwsIamRoleSchema), + awsIamRole: z.lazy(() => marshalCreateAwsIamRoleSchema), }), z.object({ $case: z.literal('azureServicePrincipal'), azureServicePrincipal: z.lazy( - () => marshalAzureServicePrincipalSchema + () => marshalCreateAzureServicePrincipalSchema ), }), z.object({ $case: z.literal('gcpServiceAccountKey'), - gcpServiceAccountKey: z.lazy(() => marshalGcpServiceAccountKeySchema), + gcpServiceAccountKey: z.lazy( + () => marshalCreateGcpServiceAccountKeySchema + ), }), z.object({ $case: z.literal('azureManagedIdentity'), - azureManagedIdentity: z.lazy(() => marshalAzureManagedIdentitySchema), + azureManagedIdentity: z.lazy( + () => marshalCreateAzureManagedIdentitySchema + ), }), z.object({ $case: z.literal('databricksGcpServiceAccount'), databricksGcpServiceAccount: z.lazy( - () => marshalDatabricksGcpServiceAccountSchema + () => marshalCreateDatabricksGcpServiceAccountSchema ), }), z.object({ $case: z.literal('cloudflareApiToken'), - cloudflareApiToken: z.lazy(() => marshalCloudflareApiTokenSchema), + cloudflareApiToken: z.lazy( + () => marshalCreateCloudflareApiTokenSchema + ), }), ]) .optional(), @@ -2425,28 +2697,92 @@ export const marshalCreateStorageCredentialRequestSchema: z.ZodType = z isolation_mode: d.isolationMode, })); -export const marshalDatabricksGcpServiceAccountSchema: z.ZodType = z - .object({ - email: z.string().optional(), - privateKeyId: z.string().optional(), - credentialId: z.string().optional(), - }) - .transform(d => ({ - email: d.email, - private_key_id: d.privateKeyId, - credential_id: d.credentialId, - })); - -export const marshalGcpServiceAccountKeySchema: z.ZodType = z +export const marshalCreateUpdateAccountsStorageCredentialSchema: z.ZodType = z .object({ - email: z.string().optional(), - privateKeyId: z.string().optional(), - privateKey: z.string().optional(), + name: z.string().optional(), + credential: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('awsIamRole'), + awsIamRole: z.lazy(() => marshalCreateAwsIamRoleSchema), + }), + z.object({ + $case: z.literal('azureServicePrincipal'), + azureServicePrincipal: z.lazy( + () => marshalCreateAzureServicePrincipalSchema + ), + }), + z.object({ + $case: z.literal('gcpServiceAccountKey'), + gcpServiceAccountKey: z.lazy( + () => marshalCreateGcpServiceAccountKeySchema + ), + }), + z.object({ + $case: z.literal('azureManagedIdentity'), + azureManagedIdentity: z.lazy( + () => marshalCreateAzureManagedIdentitySchema + ), + }), + z.object({ + $case: z.literal('databricksGcpServiceAccount'), + databricksGcpServiceAccount: z.lazy( + () => marshalCreateDatabricksGcpServiceAccountSchema + ), + }), + z.object({ + $case: z.literal('cloudflareApiToken'), + cloudflareApiToken: z.lazy( + () => marshalCreateCloudflareApiTokenSchema + ), + }), + ]) + .optional(), + comment: z.string().optional(), + readOnly: z.boolean().optional(), + owner: z.string().optional(), + id: z.string().optional(), + metastoreId: z.string().optional(), + createdAt: z.bigint().optional(), + createdBy: z.string().optional(), + updatedAt: z.bigint().optional(), + updatedBy: z.string().optional(), + usedForManagedStorage: z.boolean().optional(), + fullName: z.string().optional(), + isolationMode: z.string().optional(), }) .transform(d => ({ - email: d.email, - private_key_id: d.privateKeyId, - private_key: d.privateKey, + name: d.name, + ...(d.credential?.$case === 'awsIamRole' && { + aws_iam_role: d.credential.awsIamRole, + }), + ...(d.credential?.$case === 'azureServicePrincipal' && { + azure_service_principal: d.credential.azureServicePrincipal, + }), + ...(d.credential?.$case === 'gcpServiceAccountKey' && { + gcp_service_account_key: d.credential.gcpServiceAccountKey, + }), + ...(d.credential?.$case === 'azureManagedIdentity' && { + azure_managed_identity: d.credential.azureManagedIdentity, + }), + ...(d.credential?.$case === 'databricksGcpServiceAccount' && { + databricks_gcp_service_account: d.credential.databricksGcpServiceAccount, + }), + ...(d.credential?.$case === 'cloudflareApiToken' && { + cloudflare_api_token: d.credential.cloudflareApiToken, + }), + comment: d.comment, + read_only: d.readOnly, + owner: d.owner, + id: d.id, + metastore_id: d.metastoreId, + created_at: d.createdAt, + created_by: d.createdBy, + updated_at: d.updatedAt, + updated_by: d.updatedBy, + used_for_managed_storage: d.usedForManagedStorage, + full_name: d.fullName, + isolation_mode: d.isolationMode, })); export const marshalGenerateTemporaryPathCredentialRequestSchema: z.ZodType = z @@ -2471,14 +2807,14 @@ export const marshalGenerateTemporaryServiceCredentialRequestSchema: z.ZodType = $case: z.literal('azureOptions'), azureOptions: z.lazy( () => - marshalGenerateTemporaryServiceCredentialRequest_AzureOptionsSchema + marshalGenerateTemporaryServiceCredentialRequest_CreateAzureOptionsSchema ), }), z.object({ $case: z.literal('gcpOptions'), gcpOptions: z.lazy( () => - marshalGenerateTemporaryServiceCredentialRequest_GcpOptionsSchema + marshalGenerateTemporaryServiceCredentialRequest_CreateGcpOptionsSchema ), }), ]) @@ -2495,7 +2831,7 @@ export const marshalGenerateTemporaryServiceCredentialRequestSchema: z.ZodType = })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGenerateTemporaryServiceCredentialRequest_AzureOptionsSchema: z.ZodType = +export const marshalGenerateTemporaryServiceCredentialRequest_CreateAzureOptionsSchema: z.ZodType = z .object({ resources: z.array(z.string()).optional(), @@ -2505,7 +2841,7 @@ export const marshalGenerateTemporaryServiceCredentialRequest_AzureOptionsSchema })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGenerateTemporaryServiceCredentialRequest_GcpOptionsSchema: z.ZodType = +export const marshalGenerateTemporaryServiceCredentialRequest_CreateGcpOptionsSchema: z.ZodType = z .object({ scopes: z.array(z.string()).optional(), @@ -2535,88 +2871,6 @@ export const marshalGenerateTemporaryVolumeCredentialRequestSchema: z.ZodType = operation: d.operation, })); -export const marshalUpdateAccountsStorageCredentialSchema: z.ZodType = z - .object({ - name: z.string().optional(), - credential: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('awsIamRole'), - awsIamRole: z.lazy(() => marshalAwsIamRoleSchema), - }), - z.object({ - $case: z.literal('azureServicePrincipal'), - azureServicePrincipal: z.lazy( - () => marshalAzureServicePrincipalSchema - ), - }), - z.object({ - $case: z.literal('gcpServiceAccountKey'), - gcpServiceAccountKey: z.lazy(() => marshalGcpServiceAccountKeySchema), - }), - z.object({ - $case: z.literal('azureManagedIdentity'), - azureManagedIdentity: z.lazy(() => marshalAzureManagedIdentitySchema), - }), - z.object({ - $case: z.literal('databricksGcpServiceAccount'), - databricksGcpServiceAccount: z.lazy( - () => marshalDatabricksGcpServiceAccountSchema - ), - }), - z.object({ - $case: z.literal('cloudflareApiToken'), - cloudflareApiToken: z.lazy(() => marshalCloudflareApiTokenSchema), - }), - ]) - .optional(), - comment: z.string().optional(), - readOnly: z.boolean().optional(), - owner: z.string().optional(), - id: z.string().optional(), - metastoreId: z.string().optional(), - createdAt: z.bigint().optional(), - createdBy: z.string().optional(), - updatedAt: z.bigint().optional(), - updatedBy: z.string().optional(), - usedForManagedStorage: z.boolean().optional(), - fullName: z.string().optional(), - isolationMode: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - ...(d.credential?.$case === 'awsIamRole' && { - aws_iam_role: d.credential.awsIamRole, - }), - ...(d.credential?.$case === 'azureServicePrincipal' && { - azure_service_principal: d.credential.azureServicePrincipal, - }), - ...(d.credential?.$case === 'gcpServiceAccountKey' && { - gcp_service_account_key: d.credential.gcpServiceAccountKey, - }), - ...(d.credential?.$case === 'azureManagedIdentity' && { - azure_managed_identity: d.credential.azureManagedIdentity, - }), - ...(d.credential?.$case === 'databricksGcpServiceAccount' && { - databricks_gcp_service_account: d.credential.databricksGcpServiceAccount, - }), - ...(d.credential?.$case === 'cloudflareApiToken' && { - cloudflare_api_token: d.credential.cloudflareApiToken, - }), - comment: d.comment, - read_only: d.readOnly, - owner: d.owner, - id: d.id, - metastore_id: d.metastoreId, - created_at: d.createdAt, - created_by: d.createdBy, - updated_at: d.updatedAt, - updated_by: d.updatedBy, - used_for_managed_storage: d.usedForManagedStorage, - full_name: d.fullName, - isolation_mode: d.isolationMode, - })); - export const marshalUpdateCredentialRequestSchema: z.ZodType = z .object({ nameArg: z.string().optional(), @@ -2628,31 +2882,37 @@ export const marshalUpdateCredentialRequestSchema: z.ZodType = z .discriminatedUnion('$case', [ z.object({ $case: z.literal('awsIamRole'), - awsIamRole: z.lazy(() => marshalAwsIamRoleSchema), + awsIamRole: z.lazy(() => marshalCreateAwsIamRoleSchema), }), z.object({ $case: z.literal('azureServicePrincipal'), azureServicePrincipal: z.lazy( - () => marshalAzureServicePrincipalSchema + () => marshalCreateAzureServicePrincipalSchema ), }), z.object({ $case: z.literal('gcpServiceAccountKey'), - gcpServiceAccountKey: z.lazy(() => marshalGcpServiceAccountKeySchema), + gcpServiceAccountKey: z.lazy( + () => marshalCreateGcpServiceAccountKeySchema + ), }), z.object({ $case: z.literal('azureManagedIdentity'), - azureManagedIdentity: z.lazy(() => marshalAzureManagedIdentitySchema), + azureManagedIdentity: z.lazy( + () => marshalCreateAzureManagedIdentitySchema + ), }), z.object({ $case: z.literal('databricksGcpServiceAccount'), databricksGcpServiceAccount: z.lazy( - () => marshalDatabricksGcpServiceAccountSchema + () => marshalCreateDatabricksGcpServiceAccountSchema ), }), z.object({ $case: z.literal('cloudflareApiToken'), - cloudflareApiToken: z.lazy(() => marshalCloudflareApiTokenSchema), + cloudflareApiToken: z.lazy( + () => marshalCreateCloudflareApiTokenSchema + ), }), ]) .optional(), @@ -2718,31 +2978,37 @@ export const marshalUpdateStorageCredentialRequestSchema: z.ZodType = z .discriminatedUnion('$case', [ z.object({ $case: z.literal('awsIamRole'), - awsIamRole: z.lazy(() => marshalAwsIamRoleSchema), + awsIamRole: z.lazy(() => marshalCreateAwsIamRoleSchema), }), z.object({ $case: z.literal('azureServicePrincipal'), azureServicePrincipal: z.lazy( - () => marshalAzureServicePrincipalSchema + () => marshalCreateAzureServicePrincipalSchema ), }), z.object({ $case: z.literal('gcpServiceAccountKey'), - gcpServiceAccountKey: z.lazy(() => marshalGcpServiceAccountKeySchema), + gcpServiceAccountKey: z.lazy( + () => marshalCreateGcpServiceAccountKeySchema + ), }), z.object({ $case: z.literal('azureManagedIdentity'), - azureManagedIdentity: z.lazy(() => marshalAzureManagedIdentitySchema), + azureManagedIdentity: z.lazy( + () => marshalCreateAzureManagedIdentitySchema + ), }), z.object({ $case: z.literal('databricksGcpServiceAccount'), databricksGcpServiceAccount: z.lazy( - () => marshalDatabricksGcpServiceAccountSchema + () => marshalCreateDatabricksGcpServiceAccountSchema ), }), z.object({ $case: z.literal('cloudflareApiToken'), - cloudflareApiToken: z.lazy(() => marshalCloudflareApiTokenSchema), + cloudflareApiToken: z.lazy( + () => marshalCreateCloudflareApiTokenSchema + ), }), ]) .optional(), @@ -2807,16 +3073,18 @@ export const marshalValidateCredentialRequestSchema: z.ZodType = z }), z.object({ $case: z.literal('awsIamRole'), - awsIamRole: z.lazy(() => marshalAwsIamRoleSchema), + awsIamRole: z.lazy(() => marshalCreateAwsIamRoleSchema), }), z.object({ $case: z.literal('azureManagedIdentity'), - azureManagedIdentity: z.lazy(() => marshalAzureManagedIdentitySchema), + azureManagedIdentity: z.lazy( + () => marshalCreateAzureManagedIdentitySchema + ), }), z.object({ $case: z.literal('databricksGcpServiceAccount'), databricksGcpServiceAccount: z.lazy( - () => marshalDatabricksGcpServiceAccountSchema + () => marshalCreateDatabricksGcpServiceAccountSchema ), }), ]) @@ -2853,27 +3121,31 @@ export const marshalValidateStorageCredentialRequestSchema: z.ZodType = z }), z.object({ $case: z.literal('awsIamRole'), - awsIamRole: z.lazy(() => marshalAwsIamRoleSchema), + awsIamRole: z.lazy(() => marshalCreateAwsIamRoleSchema), }), z.object({ $case: z.literal('azureServicePrincipal'), azureServicePrincipal: z.lazy( - () => marshalAzureServicePrincipalSchema + () => marshalCreateAzureServicePrincipalSchema ), }), z.object({ $case: z.literal('azureManagedIdentity'), - azureManagedIdentity: z.lazy(() => marshalAzureManagedIdentitySchema), + azureManagedIdentity: z.lazy( + () => marshalCreateAzureManagedIdentitySchema + ), }), z.object({ $case: z.literal('databricksGcpServiceAccount'), databricksGcpServiceAccount: z.lazy( - () => marshalDatabricksGcpServiceAccountSchema + () => marshalCreateDatabricksGcpServiceAccountSchema ), }), z.object({ $case: z.literal('cloudflareApiToken'), - cloudflareApiToken: z.lazy(() => marshalCloudflareApiTokenSchema), + cloudflareApiToken: z.lazy( + () => marshalCreateCloudflareApiTokenSchema + ), }), ]) .optional(), diff --git a/packages/uc/entitytagassignments/src/v1/client.ts b/packages/uc/entitytagassignments/src/v1/client.ts index 79e14b7a..b3ed3dd8 100644 --- a/packages/uc/entitytagassignments/src/v1/client.ts +++ b/packages/uc/entitytagassignments/src/v1/client.ts @@ -26,7 +26,8 @@ import type { UpdateEntityTagAssignmentRequest, } from './model'; import { - marshalEntityTagAssignmentSchema, + marshalCreateEntityTagAssignmentSchema, + marshalUpdateEntityTagAssignmentSchema, unmarshalEntityTagAssignmentSchema, unmarshalListEntityTagAssignmentsResponseSchema, } from './model'; @@ -82,7 +83,7 @@ export class EntityTagAssignmentsClient { const url = `${host}/api/2.1/unity-catalog/entity-tag-assignments`; const body = marshalRequest( req.tagAssignment, - marshalEntityTagAssignmentSchema + marshalCreateEntityTagAssignmentSchema ); let resp: EntityTagAssignment | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -254,7 +255,7 @@ export class EntityTagAssignmentsClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.tagAssignment, - marshalEntityTagAssignmentSchema + marshalUpdateEntityTagAssignmentSchema ); let resp: EntityTagAssignment | undefined; const call = async (callSignal?: AbortSignal): Promise => { diff --git a/packages/uc/entitytagassignments/src/v1/index.ts b/packages/uc/entitytagassignments/src/v1/index.ts index a7a9be2d..7a2f9c40 100755 --- a/packages/uc/entitytagassignments/src/v1/index.ts +++ b/packages/uc/entitytagassignments/src/v1/index.ts @@ -9,13 +9,15 @@ export {EntityTagAssignmentsClient} from './client'; export {TagAssignmentSourceType} from './model'; export type { + CreateEntityTagAssignment, CreateEntityTagAssignmentRequest, DeleteEntityTagAssignmentRequest, EntityTagAssignment, GetEntityTagAssignmentRequest, ListEntityTagAssignmentsRequest, ListEntityTagAssignmentsResponse, + UpdateEntityTagAssignment, UpdateEntityTagAssignmentRequest, } from './model'; -export {entityTagAssignmentFieldMask} from './model'; +export {updateEntityTagAssignmentFieldMask} from './model'; diff --git a/packages/uc/entitytagassignments/src/v1/model.ts b/packages/uc/entitytagassignments/src/v1/model.ts index cc3bc74a..b9302cff 100644 --- a/packages/uc/entitytagassignments/src/v1/model.ts +++ b/packages/uc/entitytagassignments/src/v1/model.ts @@ -19,9 +19,21 @@ export type TagAssignmentSourceType = | (typeof TagAssignmentSourceType)[keyof typeof TagAssignmentSourceType] | (string & {}); +/** Represents a tag assignment to an entity */ +export interface CreateEntityTagAssignment { + /** The fully qualified name of the entity to which the tag is assigned */ + entityName?: string | undefined; + /** The key of the tag */ + tagKey?: string | undefined; + /** The value of the tag */ + tagValue?: string | undefined; + /** The type of the entity to which the tag is assigned. */ + entityType?: string | undefined; +} + /** Request to create a new entity tag assignment */ export interface CreateEntityTagAssignmentRequest { - tagAssignment?: EntityTagAssignment | undefined; + tagAssignment?: CreateEntityTagAssignment | undefined; } /** Request to delete an entity tag assignment */ @@ -81,10 +93,22 @@ export interface ListEntityTagAssignmentsResponse { nextPageToken?: string | undefined; } +/** Represents a tag assignment to an entity */ +export interface UpdateEntityTagAssignment { + /** The fully qualified name of the entity to which the tag is assigned */ + entityName?: string | undefined; + /** The key of the tag */ + tagKey?: string | undefined; + /** The value of the tag */ + tagValue?: string | undefined; + /** The type of the entity to which the tag is assigned. */ + entityType?: string | undefined; +} + /** Request to update an entity tag assignment */ export interface UpdateEntityTagAssignmentRequest { - tagAssignment?: EntityTagAssignment | undefined; - updateMask?: FieldMask | undefined; + tagAssignment?: UpdateEntityTagAssignment | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalEntityTagAssignmentSchema: z.ZodType = @@ -124,44 +148,46 @@ export const unmarshalListEntityTagAssignmentsResponseSchema: z.ZodType ({ + entity_name: d.entityName, + tag_key: d.tagKey, + tag_value: d.tagValue, + entity_type: d.entityType, + })); + +export const marshalUpdateEntityTagAssignmentSchema: z.ZodType = z .object({ entityName: z.string().optional(), tagKey: z.string().optional(), tagValue: z.string().optional(), entityType: z.string().optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updatedBy: z.string().optional(), - sourceType: z.string().optional(), }) .transform(d => ({ entity_name: d.entityName, tag_key: d.tagKey, tag_value: d.tagValue, entity_type: d.entityType, - update_time: d.updateTime, - updated_by: d.updatedBy, - source_type: d.sourceType, })); -const entityTagAssignmentFieldMaskSchema: FieldMaskSchema = { +const updateEntityTagAssignmentFieldMaskSchema: FieldMaskSchema = { entityName: {wire: 'entity_name'}, entityType: {wire: 'entity_type'}, - sourceType: {wire: 'source_type'}, tagKey: {wire: 'tag_key'}, tagValue: {wire: 'tag_value'}, - updateTime: {wire: 'update_time'}, - updatedBy: {wire: 'updated_by'}, }; -export function entityTagAssignmentFieldMask( +export function updateEntityTagAssignmentFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - entityTagAssignmentFieldMaskSchema + updateEntityTagAssignmentFieldMaskSchema ); } diff --git a/packages/uc/externallineage/src/v1/client.ts b/packages/uc/externallineage/src/v1/client.ts index fcaf739f..3beb0391 100644 --- a/packages/uc/externallineage/src/v1/client.ts +++ b/packages/uc/externallineage/src/v1/client.ts @@ -27,10 +27,10 @@ import type { UpdateExternalLineageRelationshipRequest, } from './model'; import { - marshalCreateRequestExternalLineageSchema, + marshalCreateCreateRequestExternalLineageSchema, marshalDeleteRequestExternalLineageSchema, marshalExternalLineageRelationshipObjectSchema, - marshalUpdateRequestExternalLineageSchema, + marshalUpdateUpdateRequestExternalLineageSchema, unmarshalExternalLineageRelationshipSchema, unmarshalListExternalLineageRelationshipsResponseSchema, } from './model'; @@ -77,7 +77,7 @@ export class ExternalLineageClient { const url = `${host}/api/2.0/lineage-tracking/external-lineage`; const body = marshalRequest( req.externalLineageRelationship, - marshalCreateRequestExternalLineageSchema + marshalCreateCreateRequestExternalLineageSchema ); let resp: ExternalLineageRelationship | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -225,7 +225,7 @@ export class ExternalLineageClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.externalLineageRelationship, - marshalUpdateRequestExternalLineageSchema + marshalUpdateUpdateRequestExternalLineageSchema ); let resp: ExternalLineageRelationship | undefined; const call = async (callSignal?: AbortSignal): Promise => { diff --git a/packages/uc/externallineage/src/v1/index.ts b/packages/uc/externallineage/src/v1/index.ts index b3882e7c..f4165537 100755 --- a/packages/uc/externallineage/src/v1/index.ts +++ b/packages/uc/externallineage/src/v1/index.ts @@ -10,7 +10,14 @@ export {SystemType, Direction_LineageDirection} from './model'; export type { ColumnRelationship, + CreateColumnRelationship, + CreateCreateRequestExternalLineage, + CreateExternalLineageRelationshipExternalMetadata, + CreateExternalLineageRelationshipModelVersion, + CreateExternalLineageRelationshipObject, + CreateExternalLineageRelationshipPath, CreateExternalLineageRelationshipRequest, + CreateExternalLineageRelationshipTable, CreateRequestExternalLineage, DeleteExternalLineageRelationshipRequest, DeleteRequestExternalLineage, @@ -28,8 +35,15 @@ export type { LineageTableInfo, ListExternalLineageRelationshipsRequest, ListExternalLineageRelationshipsResponse, + UpdateColumnRelationship, + UpdateExternalLineageRelationshipExternalMetadata, + UpdateExternalLineageRelationshipModelVersion, + UpdateExternalLineageRelationshipObject, + UpdateExternalLineageRelationshipPath, UpdateExternalLineageRelationshipRequest, + UpdateExternalLineageRelationshipTable, UpdateRequestExternalLineage, + UpdateUpdateRequestExternalLineage, } from './model'; -export {updateRequestExternalLineageFieldMask} from './model'; +export {updateUpdateRequestExternalLineageFieldMask} from './model'; diff --git a/packages/uc/externallineage/src/v1/model.ts b/packages/uc/externallineage/src/v1/model.ts index 386702ef..e962c611 100755 --- a/packages/uc/externallineage/src/v1/model.ts +++ b/packages/uc/externallineage/src/v1/model.ts @@ -52,8 +52,56 @@ export interface ColumnRelationship { target?: string | undefined; } +export interface CreateColumnRelationship { + source?: string | undefined; + target?: string | undefined; +} + +export interface CreateCreateRequestExternalLineage { + /** Source object of the external lineage relationship. */ + source: CreateExternalLineageRelationshipObject; + /** Target object of the external lineage relationship. */ + target: CreateExternalLineageRelationshipObject; + /** List of column relationships between source and target objects. */ + columns?: CreateColumnRelationship[] | undefined; + /** Key-value properties associated with the external lineage relationship. */ + properties?: Record | undefined; +} + +export interface CreateExternalLineageRelationshipExternalMetadata { + name?: string | undefined; +} + +export interface CreateExternalLineageRelationshipModelVersion { + name?: string | undefined; + version?: string | undefined; +} + +export interface CreateExternalLineageRelationshipObject { + tpe?: + | {$case: 'table'; table: CreateExternalLineageRelationshipTable} + | {$case: 'path'; path: CreateExternalLineageRelationshipPath} + | { + $case: 'modelVersion'; + modelVersion: CreateExternalLineageRelationshipModelVersion; + } + | { + $case: 'externalMetadata'; + externalMetadata: CreateExternalLineageRelationshipExternalMetadata; + } + | undefined; +} + +export interface CreateExternalLineageRelationshipPath { + url?: string | undefined; +} + export interface CreateExternalLineageRelationshipRequest { - externalLineageRelationship?: CreateRequestExternalLineage | undefined; + externalLineageRelationship?: CreateCreateRequestExternalLineage | undefined; +} + +export interface CreateExternalLineageRelationshipTable { + name?: string | undefined; } export interface CreateRequestExternalLineage { @@ -220,9 +268,46 @@ export interface ListExternalLineageRelationshipsResponse { nextPageToken?: string | undefined; } +export interface UpdateColumnRelationship { + source?: string | undefined; + target?: string | undefined; +} + +export interface UpdateExternalLineageRelationshipExternalMetadata { + name?: string | undefined; +} + +export interface UpdateExternalLineageRelationshipModelVersion { + name?: string | undefined; + version?: string | undefined; +} + +export interface UpdateExternalLineageRelationshipObject { + tpe?: + | {$case: 'table'; table: UpdateExternalLineageRelationshipTable} + | {$case: 'path'; path: UpdateExternalLineageRelationshipPath} + | { + $case: 'modelVersion'; + modelVersion: UpdateExternalLineageRelationshipModelVersion; + } + | { + $case: 'externalMetadata'; + externalMetadata: UpdateExternalLineageRelationshipExternalMetadata; + } + | undefined; +} + +export interface UpdateExternalLineageRelationshipPath { + url?: string | undefined; +} + export interface UpdateExternalLineageRelationshipRequest { - externalLineageRelationship?: UpdateRequestExternalLineage | undefined; - updateMask?: FieldMask | undefined; + externalLineageRelationship?: UpdateUpdateRequestExternalLineage | undefined; + updateMask?: FieldMask | undefined; +} + +export interface UpdateExternalLineageRelationshipTable { + name?: string | undefined; } export interface UpdateRequestExternalLineage { @@ -238,6 +323,17 @@ export interface UpdateRequestExternalLineage { properties?: Record | undefined; } +export interface UpdateUpdateRequestExternalLineage { + /** Source object of the external lineage relationship. */ + source?: UpdateExternalLineageRelationshipObject | undefined; + /** Target object of the external lineage relationship. */ + target?: UpdateExternalLineageRelationshipObject | undefined; + /** List of column relationships between source and target objects. */ + columns?: UpdateColumnRelationship[] | undefined; + /** Key-value properties associated with the external lineage relationship. */ + properties?: Record | undefined; +} + export const unmarshalColumnRelationshipSchema: z.ZodType = z .object({ @@ -461,26 +557,108 @@ export const marshalColumnRelationshipSchema: z.ZodType = z target: d.target, })); -export const marshalCreateRequestExternalLineageSchema: z.ZodType = z +export const marshalCreateColumnRelationshipSchema: z.ZodType = z .object({ - id: z.string().optional(), - source: z - .lazy(() => marshalExternalLineageRelationshipObjectSchema) - .optional(), - target: z - .lazy(() => marshalExternalLineageRelationshipObjectSchema) + source: z.string().optional(), + target: z.string().optional(), + }) + .transform(d => ({ + source: d.source, + target: d.target, + })); + +export const marshalCreateCreateRequestExternalLineageSchema: z.ZodType = z + .object({ + source: z.lazy(() => marshalCreateExternalLineageRelationshipObjectSchema), + target: z.lazy(() => marshalCreateExternalLineageRelationshipObjectSchema), + columns: z + .array(z.lazy(() => marshalCreateColumnRelationshipSchema)) .optional(), - columns: z.array(z.lazy(() => marshalColumnRelationshipSchema)).optional(), properties: z.record(z.string(), z.string()).optional(), }) .transform(d => ({ - id: d.id, source: d.source, target: d.target, columns: d.columns, properties: d.properties, })); +export const marshalCreateExternalLineageRelationshipExternalMetadataSchema: z.ZodType = + z + .object({ + name: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + })); + +export const marshalCreateExternalLineageRelationshipModelVersionSchema: z.ZodType = + z + .object({ + name: z.string().optional(), + version: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + version: d.version, + })); + +export const marshalCreateExternalLineageRelationshipObjectSchema: z.ZodType = z + .object({ + tpe: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('table'), + table: z.lazy( + () => marshalCreateExternalLineageRelationshipTableSchema + ), + }), + z.object({ + $case: z.literal('path'), + path: z.lazy( + () => marshalCreateExternalLineageRelationshipPathSchema + ), + }), + z.object({ + $case: z.literal('modelVersion'), + modelVersion: z.lazy( + () => marshalCreateExternalLineageRelationshipModelVersionSchema + ), + }), + z.object({ + $case: z.literal('externalMetadata'), + externalMetadata: z.lazy( + () => marshalCreateExternalLineageRelationshipExternalMetadataSchema + ), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.tpe?.$case === 'table' && {table: d.tpe.table}), + ...(d.tpe?.$case === 'path' && {path: d.tpe.path}), + ...(d.tpe?.$case === 'modelVersion' && {model_version: d.tpe.modelVersion}), + ...(d.tpe?.$case === 'externalMetadata' && { + external_metadata: d.tpe.externalMetadata, + }), + })); + +export const marshalCreateExternalLineageRelationshipPathSchema: z.ZodType = z + .object({ + url: z.string().optional(), + }) + .transform(d => ({ + url: d.url, + })); + +export const marshalCreateExternalLineageRelationshipTableSchema: z.ZodType = z + .object({ + name: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + })); + export const marshalDeleteRequestExternalLineageSchema: z.ZodType = z .object({ id: z.string().optional(), @@ -572,83 +750,171 @@ export const marshalExternalLineageRelationshipTableSchema: z.ZodType = z name: d.name, })); -export const marshalUpdateRequestExternalLineageSchema: z.ZodType = z +export const marshalUpdateColumnRelationshipSchema: z.ZodType = z + .object({ + source: z.string().optional(), + target: z.string().optional(), + }) + .transform(d => ({ + source: d.source, + target: d.target, + })); + +export const marshalUpdateExternalLineageRelationshipExternalMetadataSchema: z.ZodType = + z + .object({ + name: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + })); + +export const marshalUpdateExternalLineageRelationshipModelVersionSchema: z.ZodType = + z + .object({ + name: z.string().optional(), + version: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + version: d.version, + })); + +export const marshalUpdateExternalLineageRelationshipObjectSchema: z.ZodType = z + .object({ + tpe: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('table'), + table: z.lazy( + () => marshalUpdateExternalLineageRelationshipTableSchema + ), + }), + z.object({ + $case: z.literal('path'), + path: z.lazy( + () => marshalUpdateExternalLineageRelationshipPathSchema + ), + }), + z.object({ + $case: z.literal('modelVersion'), + modelVersion: z.lazy( + () => marshalUpdateExternalLineageRelationshipModelVersionSchema + ), + }), + z.object({ + $case: z.literal('externalMetadata'), + externalMetadata: z.lazy( + () => marshalUpdateExternalLineageRelationshipExternalMetadataSchema + ), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.tpe?.$case === 'table' && {table: d.tpe.table}), + ...(d.tpe?.$case === 'path' && {path: d.tpe.path}), + ...(d.tpe?.$case === 'modelVersion' && {model_version: d.tpe.modelVersion}), + ...(d.tpe?.$case === 'externalMetadata' && { + external_metadata: d.tpe.externalMetadata, + }), + })); + +export const marshalUpdateExternalLineageRelationshipPathSchema: z.ZodType = z + .object({ + url: z.string().optional(), + }) + .transform(d => ({ + url: d.url, + })); + +export const marshalUpdateExternalLineageRelationshipTableSchema: z.ZodType = z + .object({ + name: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + })); + +export const marshalUpdateUpdateRequestExternalLineageSchema: z.ZodType = z .object({ - id: z.string().optional(), source: z - .lazy(() => marshalExternalLineageRelationshipObjectSchema) + .lazy(() => marshalUpdateExternalLineageRelationshipObjectSchema) .optional(), target: z - .lazy(() => marshalExternalLineageRelationshipObjectSchema) + .lazy(() => marshalUpdateExternalLineageRelationshipObjectSchema) + .optional(), + columns: z + .array(z.lazy(() => marshalUpdateColumnRelationshipSchema)) .optional(), - columns: z.array(z.lazy(() => marshalColumnRelationshipSchema)).optional(), properties: z.record(z.string(), z.string()).optional(), }) .transform(d => ({ - id: d.id, source: d.source, target: d.target, columns: d.columns, properties: d.properties, })); -const externalLineageRelationshipExternalMetadataFieldMaskSchema: FieldMaskSchema = +const updateExternalLineageRelationshipExternalMetadataFieldMaskSchema: FieldMaskSchema = { name: {wire: 'name'}, }; -const externalLineageRelationshipModelVersionFieldMaskSchema: FieldMaskSchema = +const updateExternalLineageRelationshipModelVersionFieldMaskSchema: FieldMaskSchema = { name: {wire: 'name'}, version: {wire: 'version'}, }; -const externalLineageRelationshipObjectFieldMaskSchema: FieldMaskSchema = { - externalMetadata: { - wire: 'external_metadata', - children: () => externalLineageRelationshipExternalMetadataFieldMaskSchema, - }, - modelVersion: { - wire: 'model_version', - children: () => externalLineageRelationshipModelVersionFieldMaskSchema, - }, - path: { - wire: 'path', - children: () => externalLineageRelationshipPathFieldMaskSchema, - }, - table: { - wire: 'table', - children: () => externalLineageRelationshipTableFieldMaskSchema, - }, -}; +const updateExternalLineageRelationshipObjectFieldMaskSchema: FieldMaskSchema = + { + externalMetadata: { + wire: 'external_metadata', + children: () => + updateExternalLineageRelationshipExternalMetadataFieldMaskSchema, + }, + modelVersion: { + wire: 'model_version', + children: () => + updateExternalLineageRelationshipModelVersionFieldMaskSchema, + }, + path: { + wire: 'path', + children: () => updateExternalLineageRelationshipPathFieldMaskSchema, + }, + table: { + wire: 'table', + children: () => updateExternalLineageRelationshipTableFieldMaskSchema, + }, + }; -const externalLineageRelationshipPathFieldMaskSchema: FieldMaskSchema = { +const updateExternalLineageRelationshipPathFieldMaskSchema: FieldMaskSchema = { url: {wire: 'url'}, }; -const externalLineageRelationshipTableFieldMaskSchema: FieldMaskSchema = { +const updateExternalLineageRelationshipTableFieldMaskSchema: FieldMaskSchema = { name: {wire: 'name'}, }; -const updateRequestExternalLineageFieldMaskSchema: FieldMaskSchema = { +const updateUpdateRequestExternalLineageFieldMaskSchema: FieldMaskSchema = { columns: {wire: 'columns'}, - id: {wire: 'id'}, properties: {wire: 'properties'}, source: { wire: 'source', - children: () => externalLineageRelationshipObjectFieldMaskSchema, + children: () => updateExternalLineageRelationshipObjectFieldMaskSchema, }, target: { wire: 'target', - children: () => externalLineageRelationshipObjectFieldMaskSchema, + children: () => updateExternalLineageRelationshipObjectFieldMaskSchema, }, }; -export function updateRequestExternalLineageFieldMask( +export function updateUpdateRequestExternalLineageFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - updateRequestExternalLineageFieldMaskSchema + updateUpdateRequestExternalLineageFieldMaskSchema ); } diff --git a/packages/uc/externallocations/src/v1/index.ts b/packages/uc/externallocations/src/v1/index.ts index c4dbcaef..b448b10a 100755 --- a/packages/uc/externallocations/src/v1/index.ts +++ b/packages/uc/externallocations/src/v1/index.ts @@ -11,7 +11,13 @@ export {IsolationMode, SseEncryptionAlgorithm} from './model'; export type { AwsSqsQueue, AzureQueueStorage, + CreateAwsSqsQueue, + CreateAzureQueueStorage, + CreateEncryptionDetails, CreateExternalLocationRequest, + CreateFileEventQueue, + CreateGcpPubsub, + CreateSseEncryptionDetails, DeleteExternalLocationRequest, DeleteExternalLocationResponse, EncryptionDetails, diff --git a/packages/uc/externallocations/src/v1/model.ts b/packages/uc/externallocations/src/v1/model.ts index 7be0bd8f..4babe3fe 100755 --- a/packages/uc/externallocations/src/v1/model.ts +++ b/packages/uc/externallocations/src/v1/model.ts @@ -54,6 +54,45 @@ export interface AzureQueueStorage { managedResourceId?: string | undefined; } +export interface CreateAwsSqsQueue { + /** + * The AQS queue url in the format https://sqs.{region}.amazonaws.com/{account id}/{queue name}. + * Only required for provided_sqs. + */ + queueUrl?: string | undefined; +} + +export interface CreateAzureQueueStorage { + /** + * The AQS queue url in the format https://{storage account}.queue.core.windows.net/{queue name} + * Only required for provided_aqs. + */ + queueUrl?: string | undefined; + /** + * Optional subscription id for the queue, event grid subscription, and external location storage + * account. + * Required for locations with a service principal storage credential + */ + subscriptionId?: string | undefined; + /** + * Optional resource group for the queue, event grid subscription, and external location storage + * account. + * Only required for locations with a service principal storage credential + */ + resourceGroup?: string | undefined; +} + +/** Encryption options that apply to clients connecting to cloud storage. */ +export interface CreateEncryptionDetails { + encryptionDetailsType?: + | { + $case: 'sseEncryptionDetails'; + /** Server-Side Encryption properties for clients communicating with AWS s3. */ + sseEncryptionDetails: CreateSseEncryptionDetails; + } + | undefined; +} + export interface CreateExternalLocationRequest { /** Skips validation of the storage credential associated with the external location. */ skipValidation?: boolean | undefined; @@ -73,10 +112,10 @@ export interface CreateExternalLocationRequest { */ enableFileEvents?: boolean | undefined; /** File event queue settings. If `enable_file_events` is not `false`, must be defined and have exactly one of the documented properties. */ - fileEventQueue?: FileEventQueue | undefined; + fileEventQueue?: CreateFileEventQueue | undefined; /** The owner of the external location. */ owner?: string | undefined; - encryptionDetails?: EncryptionDetails | undefined; + encryptionDetails?: CreateEncryptionDetails | undefined; /** Unique identifier of metastore hosting the external location. */ metastoreId?: string | undefined; /** Unique ID of the location's storage credential. */ @@ -102,7 +141,39 @@ export interface CreateExternalLocationRequest { * set `enable_file_events`. Use this field instead of `file_event_queue` for reading * the actual queue state. */ - effectiveFileEventQueue?: FileEventQueue | undefined; + effectiveFileEventQueue?: CreateFileEventQueue | undefined; +} + +export interface CreateFileEventQueue { + provided?: + | {$case: 'providedAqs'; providedAqs: CreateAzureQueueStorage} + | {$case: 'providedSqs'; providedSqs: CreateAwsSqsQueue} + | {$case: 'providedPubsub'; providedPubsub: CreateGcpPubsub} + | undefined; + managed?: + | {$case: 'managedAqs'; managedAqs: CreateAzureQueueStorage} + | {$case: 'managedSqs'; managedSqs: CreateAwsSqsQueue} + | {$case: 'managedPubsub'; managedPubsub: CreateGcpPubsub} + | undefined; +} + +export interface CreateGcpPubsub { + /** + * The Pub/Sub subscription name in the format projects/{project}/subscriptions/{subscription name}. + * Only required for provided_pubsub. + */ + subscriptionName?: string | undefined; +} + +/** Server-Side Encryption properties for clients communicating with AWS s3. */ +export interface CreateSseEncryptionDetails { + /** Sets the value of the 'x-amz-server-side-encryption' header in S3 request. */ + algorithm?: SseEncryptionAlgorithm | undefined; + /** + * Optional. The ARN of the SSE-KMS key used with the S3 location, when algorithm = "SSE-KMS". + * Sets the value of the 'x-amz-server-side-encryption-aws-kms-key-id' header. + */ + awsKmsKeyArn?: string | undefined; } export interface DeleteExternalLocationRequest { @@ -271,10 +342,10 @@ export interface UpdateExternalLocationRequest { */ enableFileEvents?: boolean | undefined; /** File event queue settings. If `enable_file_events` is not `false`, must be defined and have exactly one of the documented properties. */ - fileEventQueue?: FileEventQueue | undefined; + fileEventQueue?: CreateFileEventQueue | undefined; /** The owner of the external location. */ owner?: string | undefined; - encryptionDetails?: EncryptionDetails | undefined; + encryptionDetails?: CreateEncryptionDetails | undefined; /** Unique identifier of metastore hosting the external location. */ metastoreId?: string | undefined; /** Unique ID of the location's storage credential. */ @@ -300,7 +371,7 @@ export interface UpdateExternalLocationRequest { * set `enable_file_events`. Use this field instead of `file_event_queue` for reading * the actual queue state. */ - effectiveFileEventQueue?: FileEventQueue | undefined; + effectiveFileEventQueue?: CreateFileEventQueue | undefined; } export const unmarshalAwsSqsQueueSchema: z.ZodType = z @@ -468,28 +539,43 @@ export const unmarshalSseEncryptionDetailsSchema: z.ZodType ({ queue_url: d.queueUrl, - managed_resource_id: d.managedResourceId, })); -export const marshalAzureQueueStorageSchema: z.ZodType = z +export const marshalCreateAzureQueueStorageSchema: z.ZodType = z .object({ queueUrl: z.string().optional(), subscriptionId: z.string().optional(), resourceGroup: z.string().optional(), - managedResourceId: z.string().optional(), }) .transform(d => ({ queue_url: d.queueUrl, subscription_id: d.subscriptionId, resource_group: d.resourceGroup, - managed_resource_id: d.managedResourceId, + })); + +export const marshalCreateEncryptionDetailsSchema: z.ZodType = z + .object({ + encryptionDetailsType: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('sseEncryptionDetails'), + sseEncryptionDetails: z.lazy( + () => marshalCreateSseEncryptionDetailsSchema + ), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.encryptionDetailsType?.$case === 'sseEncryptionDetails' && { + sse_encryption_details: d.encryptionDetailsType.sseEncryptionDetails, + }), })); export const marshalCreateExternalLocationRequestSchema: z.ZodType = z @@ -501,9 +587,11 @@ export const marshalCreateExternalLocationRequestSchema: z.ZodType = z readOnly: z.boolean().optional(), comment: z.string().optional(), enableFileEvents: z.boolean().optional(), - fileEventQueue: z.lazy(() => marshalFileEventQueueSchema).optional(), + fileEventQueue: z.lazy(() => marshalCreateFileEventQueueSchema).optional(), owner: z.string().optional(), - encryptionDetails: z.lazy(() => marshalEncryptionDetailsSchema).optional(), + encryptionDetails: z + .lazy(() => marshalCreateEncryptionDetailsSchema) + .optional(), metastoreId: z.string().optional(), credentialId: z.string().optional(), createdAt: z.bigint().optional(), @@ -515,7 +603,7 @@ export const marshalCreateExternalLocationRequestSchema: z.ZodType = z fallback: z.boolean().optional(), effectiveEnableFileEvents: z.boolean().optional(), effectiveFileEventQueue: z - .lazy(() => marshalFileEventQueueSchema) + .lazy(() => marshalCreateFileEventQueueSchema) .optional(), }) .transform(d => ({ @@ -542,38 +630,21 @@ export const marshalCreateExternalLocationRequestSchema: z.ZodType = z effective_file_event_queue: d.effectiveFileEventQueue, })); -export const marshalEncryptionDetailsSchema: z.ZodType = z - .object({ - encryptionDetailsType: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('sseEncryptionDetails'), - sseEncryptionDetails: z.lazy(() => marshalSseEncryptionDetailsSchema), - }), - ]) - .optional(), - }) - .transform(d => ({ - ...(d.encryptionDetailsType?.$case === 'sseEncryptionDetails' && { - sse_encryption_details: d.encryptionDetailsType.sseEncryptionDetails, - }), - })); - -export const marshalFileEventQueueSchema: z.ZodType = z +export const marshalCreateFileEventQueueSchema: z.ZodType = z .object({ provided: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('providedAqs'), - providedAqs: z.lazy(() => marshalAzureQueueStorageSchema), + providedAqs: z.lazy(() => marshalCreateAzureQueueStorageSchema), }), z.object({ $case: z.literal('providedSqs'), - providedSqs: z.lazy(() => marshalAwsSqsQueueSchema), + providedSqs: z.lazy(() => marshalCreateAwsSqsQueueSchema), }), z.object({ $case: z.literal('providedPubsub'), - providedPubsub: z.lazy(() => marshalGcpPubsubSchema), + providedPubsub: z.lazy(() => marshalCreateGcpPubsubSchema), }), ]) .optional(), @@ -581,15 +652,15 @@ export const marshalFileEventQueueSchema: z.ZodType = z .discriminatedUnion('$case', [ z.object({ $case: z.literal('managedAqs'), - managedAqs: z.lazy(() => marshalAzureQueueStorageSchema), + managedAqs: z.lazy(() => marshalCreateAzureQueueStorageSchema), }), z.object({ $case: z.literal('managedSqs'), - managedSqs: z.lazy(() => marshalAwsSqsQueueSchema), + managedSqs: z.lazy(() => marshalCreateAwsSqsQueueSchema), }), z.object({ $case: z.literal('managedPubsub'), - managedPubsub: z.lazy(() => marshalGcpPubsubSchema), + managedPubsub: z.lazy(() => marshalCreateGcpPubsubSchema), }), ]) .optional(), @@ -615,17 +686,15 @@ export const marshalFileEventQueueSchema: z.ZodType = z }), })); -export const marshalGcpPubsubSchema: z.ZodType = z +export const marshalCreateGcpPubsubSchema: z.ZodType = z .object({ subscriptionName: z.string().optional(), - managedResourceId: z.string().optional(), }) .transform(d => ({ subscription_name: d.subscriptionName, - managed_resource_id: d.managedResourceId, })); -export const marshalSseEncryptionDetailsSchema: z.ZodType = z +export const marshalCreateSseEncryptionDetailsSchema: z.ZodType = z .object({ algorithm: z.string().optional(), awsKmsKeyArn: z.string().optional(), @@ -647,9 +716,11 @@ export const marshalUpdateExternalLocationRequestSchema: z.ZodType = z readOnly: z.boolean().optional(), comment: z.string().optional(), enableFileEvents: z.boolean().optional(), - fileEventQueue: z.lazy(() => marshalFileEventQueueSchema).optional(), + fileEventQueue: z.lazy(() => marshalCreateFileEventQueueSchema).optional(), owner: z.string().optional(), - encryptionDetails: z.lazy(() => marshalEncryptionDetailsSchema).optional(), + encryptionDetails: z + .lazy(() => marshalCreateEncryptionDetailsSchema) + .optional(), metastoreId: z.string().optional(), credentialId: z.string().optional(), createdAt: z.bigint().optional(), @@ -661,7 +732,7 @@ export const marshalUpdateExternalLocationRequestSchema: z.ZodType = z fallback: z.boolean().optional(), effectiveEnableFileEvents: z.boolean().optional(), effectiveFileEventQueue: z - .lazy(() => marshalFileEventQueueSchema) + .lazy(() => marshalCreateFileEventQueueSchema) .optional(), }) .transform(d => ({ diff --git a/packages/uc/externalmetadata/src/v1/client.ts b/packages/uc/externalmetadata/src/v1/client.ts index 01566387..eb1273c1 100644 --- a/packages/uc/externalmetadata/src/v1/client.ts +++ b/packages/uc/externalmetadata/src/v1/client.ts @@ -26,7 +26,8 @@ import type { UpdateExternalMetadataRequest, } from './model'; import { - marshalExternalMetadataSchema, + marshalCreateExternalMetadataSchema, + marshalUpdateExternalMetadataSchema, unmarshalExternalMetadataSchema, unmarshalListExternalMetadataResponseV2Schema, } from './model'; @@ -76,7 +77,7 @@ export class ExternalMetadataClient { const url = `${host}/api/2.0/lineage-tracking/external-metadata`; const body = marshalRequest( req.externalMetadata, - marshalExternalMetadataSchema + marshalCreateExternalMetadataSchema ); let resp: ExternalMetadata | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -240,7 +241,7 @@ export class ExternalMetadataClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.externalMetadata, - marshalExternalMetadataSchema + marshalUpdateExternalMetadataSchema ); let resp: ExternalMetadata | undefined; const call = async (callSignal?: AbortSignal): Promise => { diff --git a/packages/uc/externalmetadata/src/v1/index.ts b/packages/uc/externalmetadata/src/v1/index.ts index 61583360..ee665b27 100755 --- a/packages/uc/externalmetadata/src/v1/index.ts +++ b/packages/uc/externalmetadata/src/v1/index.ts @@ -9,13 +9,15 @@ export {ExternalMetadataClient} from './client'; export {SystemType} from './model'; export type { + CreateExternalMetadata, CreateExternalMetadataRequest, DeleteExternalMetadataRequest, ExternalMetadata, GetExternalMetadataRequest, ListExternalMetadataRequest, ListExternalMetadataResponseV2, + UpdateExternalMetadata, UpdateExternalMetadataRequest, } from './model'; -export {externalMetadataFieldMask} from './model'; +export {updateExternalMetadataFieldMask} from './model'; diff --git a/packages/uc/externalmetadata/src/v1/model.ts b/packages/uc/externalmetadata/src/v1/model.ts index a2d3bd4c..f5a64638 100755 --- a/packages/uc/externalmetadata/src/v1/model.ts +++ b/packages/uc/externalmetadata/src/v1/model.ts @@ -36,8 +36,27 @@ export type SystemType = | (typeof SystemType)[keyof typeof SystemType] | (string & {}); +export interface CreateExternalMetadata { + /** Name of the external metadata object. */ + name?: string | undefined; + /** Type of external system. */ + systemType: SystemType; + /** Type of entity within the external system. */ + entityType: string; + /** URL associated with the external metadata object. */ + url?: string | undefined; + /** User-provided free-form text description. */ + description?: string | undefined; + /** List of columns associated with the external metadata object. */ + columns?: string[] | undefined; + /** A map of key-value properties attached to the external metadata object. */ + properties?: Record | undefined; + /** Owner of the external metadata object. */ + owner?: string | undefined; +} + export interface CreateExternalMetadataRequest { - externalMetadata?: ExternalMetadata | undefined; + externalMetadata?: CreateExternalMetadata | undefined; } export interface DeleteExternalMetadataRequest { @@ -94,9 +113,28 @@ export interface ListExternalMetadataResponseV2 { nextPageToken?: string | undefined; } +export interface UpdateExternalMetadata { + /** Name of the external metadata object. */ + name?: string | undefined; + /** Type of external system. */ + systemType?: SystemType | undefined; + /** Type of entity within the external system. */ + entityType?: string | undefined; + /** URL associated with the external metadata object. */ + url?: string | undefined; + /** User-provided free-form text description. */ + description?: string | undefined; + /** List of columns associated with the external metadata object. */ + columns?: string[] | undefined; + /** A map of key-value properties attached to the external metadata object. */ + properties?: Record | undefined; + /** Owner of the external metadata object. */ + owner?: string | undefined; +} + export interface UpdateExternalMetadataRequest { - externalMetadata?: ExternalMetadata | undefined; - updateMask?: FieldMask | undefined; + externalMetadata?: UpdateExternalMetadata | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalExternalMetadataSchema: z.ZodType = z @@ -152,7 +190,29 @@ export const unmarshalListExternalMetadataResponseV2Schema: z.ZodType ({ + name: d.name, + system_type: d.systemType, + entity_type: d.entityType, + url: d.url, + description: d.description, + columns: d.columns, + properties: d.properties, + owner: d.owner, + })); + +export const marshalUpdateExternalMetadataSchema: z.ZodType = z .object({ name: z.string().optional(), systemType: z.string().optional(), @@ -162,18 +222,6 @@ export const marshalExternalMetadataSchema: z.ZodType = z columns: z.array(z.string()).optional(), properties: z.record(z.string(), z.string()).optional(), owner: z.string().optional(), - metastoreId: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - createdBy: z.string().optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updatedBy: z.string().optional(), - id: z.string().optional(), }) .transform(d => ({ name: d.name, @@ -184,36 +232,24 @@ export const marshalExternalMetadataSchema: z.ZodType = z columns: d.columns, properties: d.properties, owner: d.owner, - metastore_id: d.metastoreId, - create_time: d.createTime, - created_by: d.createdBy, - update_time: d.updateTime, - updated_by: d.updatedBy, - id: d.id, })); -const externalMetadataFieldMaskSchema: FieldMaskSchema = { +const updateExternalMetadataFieldMaskSchema: FieldMaskSchema = { columns: {wire: 'columns'}, - createTime: {wire: 'create_time'}, - createdBy: {wire: 'created_by'}, description: {wire: 'description'}, entityType: {wire: 'entity_type'}, - id: {wire: 'id'}, - metastoreId: {wire: 'metastore_id'}, name: {wire: 'name'}, owner: {wire: 'owner'}, properties: {wire: 'properties'}, systemType: {wire: 'system_type'}, - updateTime: {wire: 'update_time'}, - updatedBy: {wire: 'updated_by'}, url: {wire: 'url'}, }; -export function externalMetadataFieldMask( +export function updateExternalMetadataFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - externalMetadataFieldMaskSchema + updateExternalMetadataFieldMaskSchema ); } diff --git a/packages/uc/functions/src/v1/index.ts b/packages/uc/functions/src/v1/index.ts index ad294405..e0bce367 100755 --- a/packages/uc/functions/src/v1/index.ts +++ b/packages/uc/functions/src/v1/index.ts @@ -18,8 +18,17 @@ export { export type { ConnectionDependency, + CreateConnectionDependency, + CreateCreateFunction, + CreateCredentialDependency, + CreateDependency, + CreateDependencyList, CreateFunction, + CreateFunctionDependency, + CreateFunctionParameterInfo, + CreateFunctionParameterInfos, CreateFunctionRequest, + CreateTableDependency, CredentialDependency, DeleteFunctionRequest, DeleteFunctionResponse, diff --git a/packages/uc/functions/src/v1/model.ts b/packages/uc/functions/src/v1/model.ts index ff08e6b6..787974d4 100755 --- a/packages/uc/functions/src/v1/model.ts +++ b/packages/uc/functions/src/v1/model.ts @@ -101,6 +101,100 @@ export interface ConnectionDependency { connectionName?: string | undefined; } +/** A connection that is dependent on a SQL object. */ +export interface CreateConnectionDependency { + /** Full name of the dependent connection, in the form of __connection_name__. */ + connectionName?: string | undefined; +} + +export interface CreateCreateFunction { + /** Name of function, relative to parent schema. */ + name?: string | undefined; + /** Name of parent Catalog. */ + catalogName?: string | undefined; + /** Name of parent Schema relative to its parent Catalog. */ + schemaName?: string | undefined; + /** Function input parameters. */ + inputParams?: CreateFunctionParameterInfos | undefined; + /** Scalar function return data type. */ + dataType?: ColumnTypeName | undefined; + /** Pretty printed function data type. */ + fullDataType?: string | undefined; + /** Function language. When **EXTERNAL** is used, the language of the routine function should be specified in the **external_language** field, and the **return_params** of the function cannot be used (as **TABLE** return type is not supported), and the **sql_data_access** field must be **NO_SQL**. */ + routineBody?: FunctionInfo_RoutineBody | undefined; + /** Function body. */ + routineDefinition?: string | undefined; + /** Function parameter style. **S** is the value for SQL. */ + parameterStyle?: FunctionInfo_ParameterStyle | undefined; + /** Whether the function is deterministic. */ + isDeterministic?: boolean | undefined; + /** Function SQL data access. */ + sqlDataAccess?: FunctionInfo_SqlDataAccess | undefined; + /** Function null call. */ + isNullCall?: boolean | undefined; + /** Function security type. */ + securityType?: FunctionInfo_SecurityType | undefined; + /** Specific name of the function; Reserved for future use. */ + specificName?: string | undefined; + /** Table function return parameters. */ + returnParams?: CreateFunctionParameterInfos | undefined; + /** External function name. */ + externalName?: string | undefined; + /** External function language. */ + externalLanguage?: string | undefined; + /** List of schemes whose objects can be referenced without qualification. */ + sqlPath?: string | undefined; + /** Username of current owner of the function. */ + owner?: string | undefined; + /** User-provided free-form text description. */ + comment?: string | undefined; + /** JSON-serialized key-value pair map, encoded (escaped) as a string. */ + properties?: string | undefined; + /** function dependencies. */ + routineDependencies?: CreateDependencyList | undefined; + /** Unique identifier of parent metastore. */ + metastoreId?: string | undefined; + /** Full name of Function, in form of **catalog_name**.**schema_name**.**function_name** */ + fullName?: string | undefined; + /** Time at which this function was created, in epoch milliseconds. */ + createdAt?: bigint | undefined; + /** Username of function creator. */ + createdBy?: string | undefined; + /** Time at which this function was last modified, in epoch milliseconds. */ + updatedAt?: bigint | undefined; + /** Username of user who last modified the function. */ + updatedBy?: string | undefined; + /** Id of Function, relative to parent schema. */ + functionId?: string | undefined; + /** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */ + browseOnly?: boolean | undefined; +} + +/** A credential that is dependent on a SQL object. */ +export interface CreateCredentialDependency { + /** Full name of the dependent credential, in the form of __credential_name__. */ + credentialName?: string | undefined; +} + +/** + * A dependency of a SQL object. One of the following fields must be defined: + * __table__, __function__, __connection__, __credential__, __volume__, or __secret__. + */ +export interface CreateDependency { + value?: + | {$case: 'table'; table: CreateTableDependency} + | {$case: 'function'; function: CreateFunctionDependency} + | {$case: 'connection'; connection: CreateConnectionDependency} + | {$case: 'credential'; credential: CreateCredentialDependency} + | undefined; +} + +/** A list of dependencies. */ +export interface CreateDependencyList { + /** Array of dependencies. */ + dependencies?: CreateDependency[] | undefined; +} + export interface CreateFunction { /** Name of function, relative to parent schema. */ name?: string | undefined; @@ -164,9 +258,52 @@ export interface CreateFunction { browseOnly?: boolean | undefined; } +/** A function that is dependent on a SQL object. */ +export interface CreateFunctionDependency { + /** Full name of the dependent function, in the form of __catalog_name__.__schema_name__.__function_name__. */ + functionFullName: string; +} + +export interface CreateFunctionParameterInfo { + /** Name of Parameter. */ + name: string; + /** Full data type spec, SQL/catalogString text. */ + typeText: string; + /** Full data type spec, JSON-serialized. */ + typeJson?: string | undefined; + /** Name of type (INT, STRUCT, MAP, etc.) */ + typeName: ColumnTypeName; + /** Digits of precision; required on Create for DecimalTypes. */ + typePrecision?: number | undefined; + /** Digits to right of decimal; Required on Create for DecimalTypes. */ + typeScale?: number | undefined; + /** Format of IntervalType. */ + typeIntervalType?: string | undefined; + /** Ordinal position of column (starting at position 0). */ + position: number; + /** Function parameter mode. */ + parameterMode?: FunctionParameterMode | undefined; + /** Function parameter type. */ + parameterType?: FunctionParameterType | undefined; + /** Default value of the parameter. */ + parameterDefault?: string | undefined; + /** User-provided free-form text description. */ + comment?: string | undefined; +} + +export interface CreateFunctionParameterInfos { + parameters?: CreateFunctionParameterInfo[] | undefined; +} + export interface CreateFunctionRequest { /** Partial __FunctionInfo__ specifying the function to be created. */ - functionInfo?: CreateFunction | undefined; + functionInfo?: CreateCreateFunction | undefined; +} + +/** A table that is dependent on a SQL object. */ +export interface CreateTableDependency { + /** Full name of the dependent table, in the form of __catalog_name__.__schema_name__.__table_name__. */ + tableFullName: string; } /** A credential that is dependent on a SQL object. */ @@ -356,7 +493,7 @@ export interface UpdateFunctionRequest { /** Name of parent Schema relative to its parent Catalog. */ schemaName?: string | undefined; /** Function input parameters. */ - inputParams?: FunctionParameterInfos | undefined; + inputParams?: CreateFunctionParameterInfos | undefined; /** Scalar function return data type. */ dataType?: ColumnTypeName | undefined; /** Pretty printed function data type. */ @@ -378,7 +515,7 @@ export interface UpdateFunctionRequest { /** Specific name of the function; Reserved for future use. */ specificName?: string | undefined; /** Table function return parameters. */ - returnParams?: FunctionParameterInfos | undefined; + returnParams?: CreateFunctionParameterInfos | undefined; /** External function name. */ externalName?: string | undefined; /** External function language. */ @@ -392,7 +529,7 @@ export interface UpdateFunctionRequest { /** JSON-serialized key-value pair map, encoded (escaped) as a string. */ properties?: string | undefined; /** function dependencies. */ - routineDependencies?: DependencyList | undefined; + routineDependencies?: CreateDependencyList | undefined; /** Unique identifier of parent metastore. */ metastoreId?: string | undefined; /** Full name of Function, in form of **catalog_name**.**schema_name**.**function_name** */ @@ -608,7 +745,7 @@ export const unmarshalTableDependencySchema: z.ZodType = z tableFullName: d.table_full_name, })); -export const marshalConnectionDependencySchema: z.ZodType = z +export const marshalCreateConnectionDependencySchema: z.ZodType = z .object({ connectionName: z.string().optional(), }) @@ -616,12 +753,14 @@ export const marshalConnectionDependencySchema: z.ZodType = z connection_name: d.connectionName, })); -export const marshalCreateFunctionSchema: z.ZodType = z +export const marshalCreateCreateFunctionSchema: z.ZodType = z .object({ name: z.string().optional(), catalogName: z.string().optional(), schemaName: z.string().optional(), - inputParams: z.lazy(() => marshalFunctionParameterInfosSchema).optional(), + inputParams: z + .lazy(() => marshalCreateFunctionParameterInfosSchema) + .optional(), dataType: z.string().optional(), fullDataType: z.string().optional(), routineBody: z.string().optional(), @@ -632,14 +771,18 @@ export const marshalCreateFunctionSchema: z.ZodType = z isNullCall: z.boolean().optional(), securityType: z.string().optional(), specificName: z.string().optional(), - returnParams: z.lazy(() => marshalFunctionParameterInfosSchema).optional(), + returnParams: z + .lazy(() => marshalCreateFunctionParameterInfosSchema) + .optional(), externalName: z.string().optional(), externalLanguage: z.string().optional(), sqlPath: z.string().optional(), owner: z.string().optional(), comment: z.string().optional(), properties: z.string().optional(), - routineDependencies: z.lazy(() => marshalDependencyListSchema).optional(), + routineDependencies: z + .lazy(() => marshalCreateDependencyListSchema) + .optional(), metastoreId: z.string().optional(), fullName: z.string().optional(), createdAt: z.bigint().optional(), @@ -682,15 +825,7 @@ export const marshalCreateFunctionSchema: z.ZodType = z browse_only: d.browseOnly, })); -export const marshalCreateFunctionRequestSchema: z.ZodType = z - .object({ - functionInfo: z.lazy(() => marshalCreateFunctionSchema).optional(), - }) - .transform(d => ({ - function_info: d.functionInfo, - })); - -export const marshalCredentialDependencySchema: z.ZodType = z +export const marshalCreateCredentialDependencySchema: z.ZodType = z .object({ credentialName: z.string().optional(), }) @@ -698,25 +833,25 @@ export const marshalCredentialDependencySchema: z.ZodType = z credential_name: d.credentialName, })); -export const marshalDependencySchema: z.ZodType = z +export const marshalCreateDependencySchema: z.ZodType = z .object({ value: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('table'), - table: z.lazy(() => marshalTableDependencySchema), + table: z.lazy(() => marshalCreateTableDependencySchema), }), z.object({ $case: z.literal('function'), - function: z.lazy(() => marshalFunctionDependencySchema), + function: z.lazy(() => marshalCreateFunctionDependencySchema), }), z.object({ $case: z.literal('connection'), - connection: z.lazy(() => marshalConnectionDependencySchema), + connection: z.lazy(() => marshalCreateConnectionDependencySchema), }), z.object({ $case: z.literal('credential'), - credential: z.lazy(() => marshalCredentialDependencySchema), + credential: z.lazy(() => marshalCreateCredentialDependencySchema), }), ]) .optional(), @@ -728,32 +863,34 @@ export const marshalDependencySchema: z.ZodType = z ...(d.value?.$case === 'credential' && {credential: d.value.credential}), })); -export const marshalDependencyListSchema: z.ZodType = z +export const marshalCreateDependencyListSchema: z.ZodType = z .object({ - dependencies: z.array(z.lazy(() => marshalDependencySchema)).optional(), + dependencies: z + .array(z.lazy(() => marshalCreateDependencySchema)) + .optional(), }) .transform(d => ({ dependencies: d.dependencies, })); -export const marshalFunctionDependencySchema: z.ZodType = z +export const marshalCreateFunctionDependencySchema: z.ZodType = z .object({ - functionFullName: z.string().optional(), + functionFullName: z.string(), }) .transform(d => ({ function_full_name: d.functionFullName, })); -export const marshalFunctionParameterInfoSchema: z.ZodType = z +export const marshalCreateFunctionParameterInfoSchema: z.ZodType = z .object({ - name: z.string().optional(), - typeText: z.string().optional(), + name: z.string(), + typeText: z.string(), typeJson: z.string().optional(), - typeName: z.string().optional(), + typeName: z.string(), typePrecision: z.number().optional(), typeScale: z.number().optional(), typeIntervalType: z.string().optional(), - position: z.number().optional(), + position: z.number(), parameterMode: z.string().optional(), parameterType: z.string().optional(), parameterDefault: z.string().optional(), @@ -774,19 +911,27 @@ export const marshalFunctionParameterInfoSchema: z.ZodType = z comment: d.comment, })); -export const marshalFunctionParameterInfosSchema: z.ZodType = z +export const marshalCreateFunctionParameterInfosSchema: z.ZodType = z .object({ parameters: z - .array(z.lazy(() => marshalFunctionParameterInfoSchema)) + .array(z.lazy(() => marshalCreateFunctionParameterInfoSchema)) .optional(), }) .transform(d => ({ parameters: d.parameters, })); -export const marshalTableDependencySchema: z.ZodType = z +export const marshalCreateFunctionRequestSchema: z.ZodType = z .object({ - tableFullName: z.string().optional(), + functionInfo: z.lazy(() => marshalCreateCreateFunctionSchema).optional(), + }) + .transform(d => ({ + function_info: d.functionInfo, + })); + +export const marshalCreateTableDependencySchema: z.ZodType = z + .object({ + tableFullName: z.string(), }) .transform(d => ({ table_full_name: d.tableFullName, @@ -798,7 +943,9 @@ export const marshalUpdateFunctionRequestSchema: z.ZodType = z name: z.string().optional(), catalogName: z.string().optional(), schemaName: z.string().optional(), - inputParams: z.lazy(() => marshalFunctionParameterInfosSchema).optional(), + inputParams: z + .lazy(() => marshalCreateFunctionParameterInfosSchema) + .optional(), dataType: z.string().optional(), fullDataType: z.string().optional(), routineBody: z.string().optional(), @@ -809,14 +956,18 @@ export const marshalUpdateFunctionRequestSchema: z.ZodType = z isNullCall: z.boolean().optional(), securityType: z.string().optional(), specificName: z.string().optional(), - returnParams: z.lazy(() => marshalFunctionParameterInfosSchema).optional(), + returnParams: z + .lazy(() => marshalCreateFunctionParameterInfosSchema) + .optional(), externalName: z.string().optional(), externalLanguage: z.string().optional(), sqlPath: z.string().optional(), owner: z.string().optional(), comment: z.string().optional(), properties: z.string().optional(), - routineDependencies: z.lazy(() => marshalDependencyListSchema).optional(), + routineDependencies: z + .lazy(() => marshalCreateDependencyListSchema) + .optional(), metastoreId: z.string().optional(), fullName: z.string().optional(), createdAt: z.bigint().optional(), diff --git a/packages/uc/grants/src/v1/index.ts b/packages/uc/grants/src/v1/index.ts index 3b81017f..cc82a475 100755 --- a/packages/uc/grants/src/v1/index.ts +++ b/packages/uc/grants/src/v1/index.ts @@ -7,6 +7,7 @@ export {GrantsClient} from './client'; export type { + CreatePermissionsChange, EffectivePrivilege, EffectivePrivilegeAssignment, GetEffectivePermissionsRequest, diff --git a/packages/uc/grants/src/v1/model.ts b/packages/uc/grants/src/v1/model.ts index 8b8582ad..231276a8 100755 --- a/packages/uc/grants/src/v1/model.ts +++ b/packages/uc/grants/src/v1/model.ts @@ -2,6 +2,18 @@ import {z} from 'zod'; +export interface CreatePermissionsChange { + /** + * The principal whose privileges we are changing. + * Only one of principal or principal_id should be specified, never both at the same time. + */ + principal?: string | undefined; + /** The set of privileges to add. */ + add?: string[] | undefined; + /** The set of privileges to remove. */ + remove?: string[] | undefined; +} + export interface EffectivePrivilege { /** The privilege assigned to the principal. */ privilege?: string | undefined; @@ -122,7 +134,7 @@ export interface UpdatePermissionsRequest { /** Full name of securable. */ securableFullName?: string | undefined; /** Array of permissions change objects. */ - changes?: PermissionsChange[] | undefined; + changes?: CreatePermissionsChange[] | undefined; } export interface UpdatePermissionsResponse { @@ -204,7 +216,7 @@ export const unmarshalUpdatePermissionsResponseSchema: z.ZodType marshalPermissionsChangeSchema)).optional(), + changes: z + .array(z.lazy(() => marshalCreatePermissionsChangeSchema)) + .optional(), }) .transform(d => ({ securable_type: d.securableType, diff --git a/packages/uc/metastores/src/v1/index.ts b/packages/uc/metastores/src/v1/index.ts index 9e01207b..05b65a38 100755 --- a/packages/uc/metastores/src/v1/index.ts +++ b/packages/uc/metastores/src/v1/index.ts @@ -30,9 +30,12 @@ export type { AccountsUpdateMetastoreRequest, AccountsUpdateMetastoreResponse, CreateAccountsMetastore, + CreateCreateAccountsMetastore, + CreateMetastoreAssignment, CreateMetastoreAssignmentRequest, CreateMetastoreAssignmentResponse, CreateMetastoreRequest, + CreateUpdateAccountsMetastore, DeleteMetastoreAssignmentRequest, DeleteMetastoreAssignmentResponse, DeleteMetastoreRequest, diff --git a/packages/uc/metastores/src/v1/model.ts b/packages/uc/metastores/src/v1/model.ts index 26b2b8d9..081d1463 100755 --- a/packages/uc/metastores/src/v1/model.ts +++ b/packages/uc/metastores/src/v1/model.ts @@ -29,7 +29,7 @@ export interface AccountsCreateMetastoreAssignmentRequest { workspaceId?: bigint | undefined; /** Unity Catalog metastore ID */ metastoreId?: string | undefined; - metastoreAssignment?: MetastoreAssignment | undefined; + metastoreAssignment?: CreateMetastoreAssignment | undefined; } /** The metastore assignment was successfully created. */ @@ -40,7 +40,7 @@ export interface AccountsCreateMetastoreAssignmentResponse {} export interface AccountsCreateMetastoreRequest { /** account ID of any type. For non-E2 account types, get your account ID from the [Accounts Console](https://docs.databricks.com/administration-guide/account-settings/usage.html) */ accountId?: string | undefined; - metastoreInfo?: CreateAccountsMetastore | undefined; + metastoreInfo?: CreateCreateAccountsMetastore | undefined; } export interface AccountsCreateMetastoreResponse { @@ -134,7 +134,7 @@ export interface AccountsUpdateMetastoreAssignmentRequest { workspaceId?: bigint | undefined; /** Unity Catalog metastore ID */ metastoreId?: string | undefined; - metastoreAssignment?: MetastoreAssignment | undefined; + metastoreAssignment?: CreateMetastoreAssignment | undefined; } /** The metastore assignment was successfully updated. */ @@ -148,7 +148,7 @@ export interface AccountsUpdateMetastoreRequest { /** Unity Catalog metastore ID */ metastoreId?: string | undefined; /** Properties of the metastore to change. */ - metastoreInfo?: UpdateAccountsMetastore | undefined; + metastoreInfo?: CreateUpdateAccountsMetastore | undefined; } /** The metastore update request succeeded. */ @@ -197,6 +197,59 @@ export interface CreateAccountsMetastore { externalAccessEnabled?: boolean | undefined; } +export interface CreateCreateAccountsMetastore { + /** The user-specified name of the metastore. */ + name?: string | undefined; + /** The storage root URL for metastore */ + storageRoot?: string | undefined; + /** Unique identifier of the metastore's (Default) Data Access Configuration. */ + defaultDataAccessConfigId?: string | undefined; + /** UUID of storage credential to access the metastore storage_root. */ + storageRootCredentialId?: string | undefined; + /** The scope of Delta Sharing enabled for the metastore. */ + deltaSharingScope?: DeltaSharingScope_Enum | undefined; + /** The lifetime of delta sharing recipient token in seconds. */ + deltaSharingRecipientTokenLifetimeInSeconds?: bigint | undefined; + /** The organization name of a Delta Sharing entity, to be used in Databricks-to-Databricks Delta Sharing as the official name. */ + deltaSharingOrganizationName?: string | undefined; + /** The owner of the metastore. */ + owner?: string | undefined; + /** Privilege model version of the metastore, of the form `major.minor` (e.g., `1.0`). */ + privilegeModelVersion?: string | undefined; + /** Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). */ + region?: string | undefined; + /** Unique identifier of metastore. */ + metastoreId?: string | undefined; + /** Time at which this metastore was created, in epoch milliseconds. */ + createdAt?: bigint | undefined; + /** Username of metastore creator. */ + createdBy?: string | undefined; + /** Time at which the metastore was last modified, in epoch milliseconds. */ + updatedAt?: bigint | undefined; + /** Username of user who last modified the metastore. */ + updatedBy?: string | undefined; + /** Name of the storage credential to access the metastore storage_root. */ + storageRootCredentialName?: string | undefined; + /** Cloud vendor of the metastore home shard (e.g., `aws`, `azure`, `gcp`). */ + cloud?: string | undefined; + /** Globally unique metastore ID across clouds and regions, of the form `cloud:region:metastore_id`. */ + globalMetastoreId?: string | undefined; + /** Whether to allow non-DBR clients to directly access entities under the metastore. */ + externalAccessEnabled?: boolean | undefined; +} + +export interface CreateMetastoreAssignment { + /** The unique ID of the workspace. */ + workspaceId: bigint; + /** The unique ID of the metastore. */ + metastoreId: string; + /** + * The name of the default catalog in the metastore. This field is deprecated. + * Please use "Default Namespace API" to configure the default catalog for a workspace. + */ + defaultCatalogName?: string | undefined; +} + export interface CreateMetastoreAssignmentRequest { /** A workspace ID. */ workspaceId?: bigint | undefined; @@ -254,6 +307,47 @@ export interface CreateMetastoreRequest { externalAccessEnabled?: boolean | undefined; } +export interface CreateUpdateAccountsMetastore { + /** The user-specified name of the metastore. */ + name?: string | undefined; + /** The storage root URL for metastore */ + storageRoot?: string | undefined; + /** Unique identifier of the metastore's (Default) Data Access Configuration. */ + defaultDataAccessConfigId?: string | undefined; + /** UUID of storage credential to access the metastore storage_root. */ + storageRootCredentialId?: string | undefined; + /** The scope of Delta Sharing enabled for the metastore. */ + deltaSharingScope?: DeltaSharingScope_Enum | undefined; + /** The lifetime of delta sharing recipient token in seconds. */ + deltaSharingRecipientTokenLifetimeInSeconds?: bigint | undefined; + /** The organization name of a Delta Sharing entity, to be used in Databricks-to-Databricks Delta Sharing as the official name. */ + deltaSharingOrganizationName?: string | undefined; + /** The owner of the metastore. */ + owner?: string | undefined; + /** Privilege model version of the metastore, of the form `major.minor` (e.g., `1.0`). */ + privilegeModelVersion?: string | undefined; + /** Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). */ + region?: string | undefined; + /** Unique identifier of metastore. */ + metastoreId?: string | undefined; + /** Time at which this metastore was created, in epoch milliseconds. */ + createdAt?: bigint | undefined; + /** Username of metastore creator. */ + createdBy?: string | undefined; + /** Time at which the metastore was last modified, in epoch milliseconds. */ + updatedAt?: bigint | undefined; + /** Username of user who last modified the metastore. */ + updatedBy?: string | undefined; + /** Name of the storage credential to access the metastore storage_root. */ + storageRootCredentialName?: string | undefined; + /** Cloud vendor of the metastore home shard (e.g., `aws`, `azure`, `gcp`). */ + cloud?: string | undefined; + /** Globally unique metastore ID across clouds and regions, of the form `cloud:region:metastore_id`. */ + globalMetastoreId?: string | undefined; + /** Whether to allow non-DBR clients to directly access entities under the metastore. */ + externalAccessEnabled?: boolean | undefined; +} + export interface DeleteMetastoreAssignmentRequest { /** A workspace ID. */ workspaceId?: bigint | undefined; @@ -738,7 +832,7 @@ export const marshalAccountsCreateMetastoreAssignmentRequestSchema: z.ZodType = workspaceId: z.bigint().optional(), metastoreId: z.string().optional(), metastoreAssignment: z - .lazy(() => marshalMetastoreAssignmentSchema) + .lazy(() => marshalCreateMetastoreAssignmentSchema) .optional(), }) .transform(d => ({ @@ -752,7 +846,7 @@ export const marshalAccountsCreateMetastoreRequestSchema: z.ZodType = z .object({ accountId: z.string().optional(), metastoreInfo: z - .lazy(() => marshalCreateAccountsMetastoreSchema) + .lazy(() => marshalCreateCreateAccountsMetastoreSchema) .optional(), }) .transform(d => ({ @@ -767,7 +861,7 @@ export const marshalAccountsUpdateMetastoreAssignmentRequestSchema: z.ZodType = workspaceId: z.bigint().optional(), metastoreId: z.string().optional(), metastoreAssignment: z - .lazy(() => marshalMetastoreAssignmentSchema) + .lazy(() => marshalCreateMetastoreAssignmentSchema) .optional(), }) .transform(d => ({ @@ -782,7 +876,7 @@ export const marshalAccountsUpdateMetastoreRequestSchema: z.ZodType = z accountId: z.string().optional(), metastoreId: z.string().optional(), metastoreInfo: z - .lazy(() => marshalUpdateAccountsMetastoreSchema) + .lazy(() => marshalCreateUpdateAccountsMetastoreSchema) .optional(), }) .transform(d => ({ @@ -791,7 +885,7 @@ export const marshalAccountsUpdateMetastoreRequestSchema: z.ZodType = z metastore_info: d.metastoreInfo, })); -export const marshalCreateAccountsMetastoreSchema: z.ZodType = z +export const marshalCreateCreateAccountsMetastoreSchema: z.ZodType = z .object({ name: z.string().optional(), storageRoot: z.string().optional(), @@ -836,6 +930,18 @@ export const marshalCreateAccountsMetastoreSchema: z.ZodType = z external_access_enabled: d.externalAccessEnabled, })); +export const marshalCreateMetastoreAssignmentSchema: z.ZodType = z + .object({ + workspaceId: z.bigint(), + metastoreId: z.string(), + defaultCatalogName: z.string().optional(), + }) + .transform(d => ({ + workspace_id: d.workspaceId, + metastore_id: d.metastoreId, + default_catalog_name: d.defaultCatalogName, + })); + export const marshalCreateMetastoreAssignmentRequestSchema: z.ZodType = z .object({ workspaceId: z.bigint().optional(), @@ -893,19 +999,7 @@ export const marshalCreateMetastoreRequestSchema: z.ZodType = z external_access_enabled: d.externalAccessEnabled, })); -export const marshalMetastoreAssignmentSchema: z.ZodType = z - .object({ - workspaceId: z.bigint().optional(), - metastoreId: z.string().optional(), - defaultCatalogName: z.string().optional(), - }) - .transform(d => ({ - workspace_id: d.workspaceId, - metastore_id: d.metastoreId, - default_catalog_name: d.defaultCatalogName, - })); - -export const marshalUpdateAccountsMetastoreSchema: z.ZodType = z +export const marshalCreateUpdateAccountsMetastoreSchema: z.ZodType = z .object({ name: z.string().optional(), storageRoot: z.string().optional(), diff --git a/packages/uc/onlinetables/src/v1/client.ts b/packages/uc/onlinetables/src/v1/client.ts index e60734a8..0354c94a 100644 --- a/packages/uc/onlinetables/src/v1/client.ts +++ b/packages/uc/onlinetables/src/v1/client.ts @@ -27,7 +27,7 @@ import type { } from './model'; import { ProvisioningInfo_State, - marshalOnlineTableSchema, + marshalCreateOnlineTableSchema, unmarshalOnlineTableSchema, } from './model'; @@ -71,7 +71,7 @@ export class OnlineTablesClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.0/online-tables`; - const body = marshalRequest(req.table, marshalOnlineTableSchema); + const body = marshalRequest(req.table, marshalCreateOnlineTableSchema); let resp: OnlineTable | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/uc/onlinetables/src/v1/index.ts b/packages/uc/onlinetables/src/v1/index.ts index 6a6d9d7d..781aabad 100755 --- a/packages/uc/onlinetables/src/v1/index.ts +++ b/packages/uc/onlinetables/src/v1/index.ts @@ -10,13 +10,17 @@ export {OnlineTableState, ProvisioningInfo_State} from './model'; export type { ContinuousUpdateStatus, + CreateOnlineTable, CreateOnlineTableRequest, + CreateOnlineTableSpec, DeleteOnlineTableRequest, FailedStatus, GetOnlineTableRequest, OnlineTable, OnlineTableSpec, OnlineTableSpec_ContinuousSchedulingPolicy, + OnlineTableSpec_CreateContinuousSchedulingPolicy, + OnlineTableSpec_CreateTriggeredSchedulingPolicy, OnlineTableSpec_TriggeredSchedulingPolicy, OnlineTableStatus, PipelineProgress, diff --git a/packages/uc/onlinetables/src/v1/model.ts b/packages/uc/onlinetables/src/v1/model.ts index d697bbca..d9947cb2 100644 --- a/packages/uc/onlinetables/src/v1/model.ts +++ b/packages/uc/onlinetables/src/v1/model.ts @@ -91,10 +91,52 @@ export interface ContinuousUpdateStatus { initialPipelineSyncProgress?: PipelineProgress | undefined; } +/** Online Table information. */ +export interface CreateOnlineTable { + /** Full three-part (catalog, schema, table) name of the table. */ + name?: string | undefined; + /** Specification of the online table. */ + spec?: CreateOnlineTableSpec | undefined; +} + /** Create an online table */ export interface CreateOnlineTableRequest { /** Specification of the online table to be created. */ - table?: OnlineTable | undefined; + table?: CreateOnlineTable | undefined; +} + +/** Specification of an online table. */ +export interface CreateOnlineTableSpec { + /** Exactly one type of scheduling policy should be applied. */ + schedulingPolicy?: + | { + $case: 'runContinuously'; + /** Pipeline runs continuously after generating the initial data. */ + runContinuously: OnlineTableSpec_CreateContinuousSchedulingPolicy; + } + | { + $case: 'runTriggered'; + /** Pipeline stops after generating the initial data and can be triggered later (manually, through a cron job or through data triggers) */ + runTriggered: OnlineTableSpec_CreateTriggeredSchedulingPolicy; + } + | undefined; + /** Three-part (catalog, schema, table) name of the source Delta table. */ + sourceTableFullName?: string | undefined; + /** Primary Key columns to be used for data insert/update in the destination. */ + primaryKeyColumns?: string[] | undefined; + /** Time series key to deduplicate (tie-break) rows with the same primary key. */ + timeseriesKey?: string | undefined; + /** + * Whether to create a full-copy pipeline -- a pipeline that stops after creates a full copy of + * the source table upon initialization and does not process any change data feeds (CDFs) + * afterwards. The pipeline can still be manually triggered afterwards, but it always perform a + * full copy of the source table and there are no incremental updates. This mode is useful for + * syncing views or tables without CDFs to online tables. + * Note that the full-copy pipeline only supports "triggered" scheduling policy. + */ + performFullCopy?: boolean | undefined; + /** ID of the associated pipeline. Generated by the server - cannot be set by the caller. */ + pipelineId?: string | undefined; } /** Delete an online table. */ @@ -182,6 +224,12 @@ export interface OnlineTableSpec { // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name. export interface OnlineTableSpec_ContinuousSchedulingPolicy {} +// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name. +export interface OnlineTableSpec_CreateContinuousSchedulingPolicy {} + +// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name. +export interface OnlineTableSpec_CreateTriggeredSchedulingPolicy {} + // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name. export interface OnlineTableSpec_TriggeredSchedulingPolicy {} @@ -446,66 +494,30 @@ export const unmarshalTriggeredUpdateStatusSchema: z.ZodType d.toString()) - .optional(), - initialPipelineSyncProgress: z - .lazy(() => marshalPipelineProgressSchema) - .optional(), - }) - .transform(d => ({ - last_processed_commit_version: d.lastProcessedCommitVersion, - timestamp: d.timestamp, - initial_pipeline_sync_progress: d.initialPipelineSyncProgress, - })); - -export const marshalFailedStatusSchema: z.ZodType = z - .object({ - lastProcessedCommitVersion: z.bigint().optional(), - timestamp: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - }) - .transform(d => ({ - last_processed_commit_version: d.lastProcessedCommitVersion, - timestamp: d.timestamp, - })); - -export const marshalOnlineTableSchema: z.ZodType = z +export const marshalCreateOnlineTableSchema: z.ZodType = z .object({ name: z.string().optional(), - spec: z.lazy(() => marshalOnlineTableSpecSchema).optional(), - status: z.lazy(() => marshalOnlineTableStatusSchema).optional(), - tableServingUrl: z.string().optional(), - unityCatalogProvisioningState: z.string().optional(), + spec: z.lazy(() => marshalCreateOnlineTableSpecSchema).optional(), }) .transform(d => ({ name: d.name, spec: d.spec, - status: d.status, - table_serving_url: d.tableServingUrl, - unity_catalog_provisioning_state: d.unityCatalogProvisioningState, })); -export const marshalOnlineTableSpecSchema: z.ZodType = z +export const marshalCreateOnlineTableSpecSchema: z.ZodType = z .object({ schedulingPolicy: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('runContinuously'), runContinuously: z.lazy( - () => marshalOnlineTableSpec_ContinuousSchedulingPolicySchema + () => marshalOnlineTableSpec_CreateContinuousSchedulingPolicySchema ), }), z.object({ $case: z.literal('runTriggered'), runTriggered: z.lazy( - () => marshalOnlineTableSpec_TriggeredSchedulingPolicySchema + () => marshalOnlineTableSpec_CreateTriggeredSchedulingPolicySchema ), }), ]) @@ -531,98 +543,9 @@ export const marshalOnlineTableSpecSchema: z.ZodType = z })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalOnlineTableSpec_ContinuousSchedulingPolicySchema: z.ZodType = +export const marshalOnlineTableSpec_CreateContinuousSchedulingPolicySchema: z.ZodType = z.object({}); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalOnlineTableSpec_TriggeredSchedulingPolicySchema: z.ZodType = +export const marshalOnlineTableSpec_CreateTriggeredSchedulingPolicySchema: z.ZodType = z.object({}); - -export const marshalOnlineTableStatusSchema: z.ZodType = z - .object({ - detailedState: z.string().optional(), - message: z.string().optional(), - detailedStatus: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('provisioningStatus'), - provisioningStatus: z.lazy(() => marshalProvisioningStatusSchema), - }), - z.object({ - $case: z.literal('continuousUpdateStatus'), - continuousUpdateStatus: z.lazy( - () => marshalContinuousUpdateStatusSchema - ), - }), - z.object({ - $case: z.literal('triggeredUpdateStatus'), - triggeredUpdateStatus: z.lazy( - () => marshalTriggeredUpdateStatusSchema - ), - }), - z.object({ - $case: z.literal('failedStatus'), - failedStatus: z.lazy(() => marshalFailedStatusSchema), - }), - ]) - .optional(), - }) - .transform(d => ({ - detailed_state: d.detailedState, - message: d.message, - ...(d.detailedStatus?.$case === 'provisioningStatus' && { - provisioning_status: d.detailedStatus.provisioningStatus, - }), - ...(d.detailedStatus?.$case === 'continuousUpdateStatus' && { - continuous_update_status: d.detailedStatus.continuousUpdateStatus, - }), - ...(d.detailedStatus?.$case === 'triggeredUpdateStatus' && { - triggered_update_status: d.detailedStatus.triggeredUpdateStatus, - }), - ...(d.detailedStatus?.$case === 'failedStatus' && { - failed_status: d.detailedStatus.failedStatus, - }), - })); - -export const marshalPipelineProgressSchema: z.ZodType = z - .object({ - latestVersionCurrentlyProcessing: z.bigint().optional(), - syncedRowCount: z.bigint().optional(), - totalRowCount: z.bigint().optional(), - syncProgressCompletion: z.number().optional(), - estimatedCompletionTimeSeconds: z.number().optional(), - }) - .transform(d => ({ - latest_version_currently_processing: d.latestVersionCurrentlyProcessing, - synced_row_count: d.syncedRowCount, - total_row_count: d.totalRowCount, - sync_progress_completion: d.syncProgressCompletion, - estimated_completion_time_seconds: d.estimatedCompletionTimeSeconds, - })); - -export const marshalProvisioningStatusSchema: z.ZodType = z - .object({ - initialPipelineSyncProgress: z - .lazy(() => marshalPipelineProgressSchema) - .optional(), - }) - .transform(d => ({ - initial_pipeline_sync_progress: d.initialPipelineSyncProgress, - })); - -export const marshalTriggeredUpdateStatusSchema: z.ZodType = z - .object({ - lastProcessedCommitVersion: z.bigint().optional(), - timestamp: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - triggeredUpdateProgress: z - .lazy(() => marshalPipelineProgressSchema) - .optional(), - }) - .transform(d => ({ - last_processed_commit_version: d.lastProcessedCommitVersion, - timestamp: d.timestamp, - triggered_update_progress: d.triggeredUpdateProgress, - })); diff --git a/packages/uc/registeredmodels/src/v1/index.ts b/packages/uc/registeredmodels/src/v1/index.ts index 01cef637..44a9c88d 100755 --- a/packages/uc/registeredmodels/src/v1/index.ts +++ b/packages/uc/registeredmodels/src/v1/index.ts @@ -10,7 +10,14 @@ export {ModelVersionStatus} from './model'; export type { ConnectionDependency, + CreateConnectionDependency, + CreateCredentialDependency, + CreateDependency, + CreateDependencyList, + CreateFunctionDependency, + CreateRegisteredModelAliasInfo, CreateRegisteredModelRequest, + CreateTableDependency, CredentialDependency, DeleteModelVersionRequest, DeleteModelVersionResponse, diff --git a/packages/uc/registeredmodels/src/v1/model.ts b/packages/uc/registeredmodels/src/v1/model.ts index 2f05fbce..5f1045be 100755 --- a/packages/uc/registeredmodels/src/v1/model.ts +++ b/packages/uc/registeredmodels/src/v1/model.ts @@ -22,6 +22,58 @@ export interface ConnectionDependency { connectionName?: string | undefined; } +/** A connection that is dependent on a SQL object. */ +export interface CreateConnectionDependency { + /** Full name of the dependent connection, in the form of __connection_name__. */ + connectionName?: string | undefined; +} + +/** A credential that is dependent on a SQL object. */ +export interface CreateCredentialDependency { + /** Full name of the dependent credential, in the form of __credential_name__. */ + credentialName?: string | undefined; +} + +/** + * A dependency of a SQL object. One of the following fields must be defined: + * __table__, __function__, __connection__, __credential__, __volume__, or __secret__. + */ +export interface CreateDependency { + value?: + | {$case: 'table'; table: CreateTableDependency} + | {$case: 'function'; function: CreateFunctionDependency} + | {$case: 'connection'; connection: CreateConnectionDependency} + | {$case: 'credential'; credential: CreateCredentialDependency} + | undefined; +} + +/** A list of dependencies. */ +export interface CreateDependencyList { + /** Array of dependencies. */ + dependencies?: CreateDependency[] | undefined; +} + +/** A function that is dependent on a SQL object. */ +export interface CreateFunctionDependency { + /** Full name of the dependent function, in the form of __catalog_name__.__schema_name__.__function_name__. */ + functionFullName: string; +} + +export interface CreateRegisteredModelAliasInfo { + /** Name of the alias, e.g. 'champion' or 'latest_stable' */ + aliasName?: string | undefined; + /** Integer version number of the model version to which this alias points. */ + versionNum?: bigint | undefined; + /** The unique identifier of the alias */ + id?: string | undefined; + /** The name of the parent registered model of the model version, relative to parent schema */ + modelName?: string | undefined; + /** The name of the catalog containing the model version */ + catalogName?: string | undefined; + /** The name of the schema containing the model version, relative to parent catalog */ + schemaName?: string | undefined; +} + export interface CreateRegisteredModelRequest { /** The name of the registered model */ name?: string | undefined; @@ -48,11 +100,17 @@ export interface CreateRegisteredModelRequest { /** The identifier of the user who updated the registered model last time */ updatedBy?: string | undefined; /** List of aliases associated with the registered model */ - aliases?: RegisteredModelAliasInfo[] | undefined; + aliases?: CreateRegisteredModelAliasInfo[] | undefined; /** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */ browseOnly?: boolean | undefined; } +/** A table that is dependent on a SQL object. */ +export interface CreateTableDependency { + /** Full name of the dependent table, in the form of __catalog_name__.__schema_name__.__table_name__. */ + tableFullName: string; +} + /** A credential that is dependent on a SQL object. */ export interface CredentialDependency { /** Full name of the dependent credential, in the form of __credential_name__. */ @@ -344,7 +402,7 @@ export interface UpdateModelVersionRequest { */ runWorkspaceId?: bigint | undefined; /** Model version dependencies, for feature-store packaged models */ - modelVersionDependencies?: DependencyList | undefined; + modelVersionDependencies?: CreateDependencyList | undefined; /** * Current status of the model version. Newly created model versions start in * PENDING_REGISTRATION status, then move to READY status once the model version files are uploaded and @@ -367,7 +425,7 @@ export interface UpdateModelVersionRequest { /** The unique identifier of the model version */ id?: string | undefined; /** List of aliases associated with the model version */ - aliases?: RegisteredModelAliasInfo[] | undefined; + aliases?: CreateRegisteredModelAliasInfo[] | undefined; } export interface UpdateRegisteredModelRequest { @@ -400,7 +458,7 @@ export interface UpdateRegisteredModelRequest { /** The identifier of the user who updated the registered model last time */ updatedBy?: string | undefined; /** List of aliases associated with the registered model */ - aliases?: RegisteredModelAliasInfo[] | undefined; + aliases?: CreateRegisteredModelAliasInfo[] | undefined; /** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */ browseOnly?: boolean | undefined; } @@ -626,7 +684,7 @@ export const unmarshalTableDependencySchema: z.ZodType = z tableFullName: d.table_full_name, })); -export const marshalConnectionDependencySchema: z.ZodType = z +export const marshalCreateConnectionDependencySchema: z.ZodType = z .object({ connectionName: z.string().optional(), }) @@ -634,43 +692,7 @@ export const marshalConnectionDependencySchema: z.ZodType = z connection_name: d.connectionName, })); -export const marshalCreateRegisteredModelRequestSchema: z.ZodType = z - .object({ - name: z.string().optional(), - catalogName: z.string().optional(), - schemaName: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - storageLocation: z.string().optional(), - metastoreId: z.string().optional(), - fullName: z.string().optional(), - createdAt: z.bigint().optional(), - createdBy: z.string().optional(), - updatedAt: z.bigint().optional(), - updatedBy: z.string().optional(), - aliases: z - .array(z.lazy(() => marshalRegisteredModelAliasInfoSchema)) - .optional(), - browseOnly: z.boolean().optional(), - }) - .transform(d => ({ - name: d.name, - catalog_name: d.catalogName, - schema_name: d.schemaName, - owner: d.owner, - comment: d.comment, - storage_location: d.storageLocation, - metastore_id: d.metastoreId, - full_name: d.fullName, - created_at: d.createdAt, - created_by: d.createdBy, - updated_at: d.updatedAt, - updated_by: d.updatedBy, - aliases: d.aliases, - browse_only: d.browseOnly, - })); - -export const marshalCredentialDependencySchema: z.ZodType = z +export const marshalCreateCredentialDependencySchema: z.ZodType = z .object({ credentialName: z.string().optional(), }) @@ -678,25 +700,25 @@ export const marshalCredentialDependencySchema: z.ZodType = z credential_name: d.credentialName, })); -export const marshalDependencySchema: z.ZodType = z +export const marshalCreateDependencySchema: z.ZodType = z .object({ value: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('table'), - table: z.lazy(() => marshalTableDependencySchema), + table: z.lazy(() => marshalCreateTableDependencySchema), }), z.object({ $case: z.literal('function'), - function: z.lazy(() => marshalFunctionDependencySchema), + function: z.lazy(() => marshalCreateFunctionDependencySchema), }), z.object({ $case: z.literal('connection'), - connection: z.lazy(() => marshalConnectionDependencySchema), + connection: z.lazy(() => marshalCreateConnectionDependencySchema), }), z.object({ $case: z.literal('credential'), - credential: z.lazy(() => marshalCredentialDependencySchema), + credential: z.lazy(() => marshalCreateCredentialDependencySchema), }), ]) .optional(), @@ -708,23 +730,25 @@ export const marshalDependencySchema: z.ZodType = z ...(d.value?.$case === 'credential' && {credential: d.value.credential}), })); -export const marshalDependencyListSchema: z.ZodType = z +export const marshalCreateDependencyListSchema: z.ZodType = z .object({ - dependencies: z.array(z.lazy(() => marshalDependencySchema)).optional(), + dependencies: z + .array(z.lazy(() => marshalCreateDependencySchema)) + .optional(), }) .transform(d => ({ dependencies: d.dependencies, })); -export const marshalFunctionDependencySchema: z.ZodType = z +export const marshalCreateFunctionDependencySchema: z.ZodType = z .object({ - functionFullName: z.string().optional(), + functionFullName: z.string(), }) .transform(d => ({ function_full_name: d.functionFullName, })); -export const marshalRegisteredModelAliasInfoSchema: z.ZodType = z +export const marshalCreateRegisteredModelAliasInfoSchema: z.ZodType = z .object({ aliasName: z.string().optional(), versionNum: z.bigint().optional(), @@ -742,6 +766,50 @@ export const marshalRegisteredModelAliasInfoSchema: z.ZodType = z schema_name: d.schemaName, })); +export const marshalCreateRegisteredModelRequestSchema: z.ZodType = z + .object({ + name: z.string().optional(), + catalogName: z.string().optional(), + schemaName: z.string().optional(), + owner: z.string().optional(), + comment: z.string().optional(), + storageLocation: z.string().optional(), + metastoreId: z.string().optional(), + fullName: z.string().optional(), + createdAt: z.bigint().optional(), + createdBy: z.string().optional(), + updatedAt: z.bigint().optional(), + updatedBy: z.string().optional(), + aliases: z + .array(z.lazy(() => marshalCreateRegisteredModelAliasInfoSchema)) + .optional(), + browseOnly: z.boolean().optional(), + }) + .transform(d => ({ + name: d.name, + catalog_name: d.catalogName, + schema_name: d.schemaName, + owner: d.owner, + comment: d.comment, + storage_location: d.storageLocation, + metastore_id: d.metastoreId, + full_name: d.fullName, + created_at: d.createdAt, + created_by: d.createdBy, + updated_at: d.updatedAt, + updated_by: d.updatedBy, + aliases: d.aliases, + browse_only: d.browseOnly, + })); + +export const marshalCreateTableDependencySchema: z.ZodType = z + .object({ + tableFullName: z.string(), + }) + .transform(d => ({ + table_full_name: d.tableFullName, + })); + export const marshalSetRegisteredModelAliasRequestSchema: z.ZodType = z .object({ fullNameArg: z.string().optional(), @@ -754,14 +822,6 @@ export const marshalSetRegisteredModelAliasRequestSchema: z.ZodType = z version_num: d.versionNum, })); -export const marshalTableDependencySchema: z.ZodType = z - .object({ - tableFullName: z.string().optional(), - }) - .transform(d => ({ - table_full_name: d.tableFullName, - })); - export const marshalUpdateModelVersionRequestSchema: z.ZodType = z .object({ fullNameArg: z.string().optional(), @@ -774,7 +834,7 @@ export const marshalUpdateModelVersionRequestSchema: z.ZodType = z runId: z.string().optional(), runWorkspaceId: z.bigint().optional(), modelVersionDependencies: z - .lazy(() => marshalDependencyListSchema) + .lazy(() => marshalCreateDependencyListSchema) .optional(), status: z.string().optional(), version: z.bigint().optional(), @@ -786,7 +846,7 @@ export const marshalUpdateModelVersionRequestSchema: z.ZodType = z updatedBy: z.string().optional(), id: z.string().optional(), aliases: z - .array(z.lazy(() => marshalRegisteredModelAliasInfoSchema)) + .array(z.lazy(() => marshalCreateRegisteredModelAliasInfoSchema)) .optional(), }) .transform(d => ({ @@ -829,7 +889,7 @@ export const marshalUpdateRegisteredModelRequestSchema: z.ZodType = z updatedAt: z.bigint().optional(), updatedBy: z.string().optional(), aliases: z - .array(z.lazy(() => marshalRegisteredModelAliasInfoSchema)) + .array(z.lazy(() => marshalCreateRegisteredModelAliasInfoSchema)) .optional(), browseOnly: z.boolean().optional(), }) diff --git a/packages/uc/rfa/src/v1/client.ts b/packages/uc/rfa/src/v1/client.ts index 54b03d7d..d254ef09 100644 --- a/packages/uc/rfa/src/v1/client.ts +++ b/packages/uc/rfa/src/v1/client.ts @@ -24,8 +24,8 @@ import type { UpdateAccessRequestDestinationsRequest, } from './model'; import { - marshalAccessRequestDestinationsSchema, marshalBatchCreateAccessRequestsRequestSchema, + marshalUpdateAccessRequestDestinationsSchema, unmarshalAccessRequestDestinationsSchema, unmarshalBatchCreateAccessRequestsResponseSchema, } from './model'; @@ -167,7 +167,7 @@ export class RfaClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.accessRequestDestinations, - marshalAccessRequestDestinationsSchema + marshalUpdateAccessRequestDestinationsSchema ); let resp: AccessRequestDestinations | undefined; const call = async (callSignal?: AbortSignal): Promise => { diff --git a/packages/uc/rfa/src/v1/index.ts b/packages/uc/rfa/src/v1/index.ts index 5ed59eb5..0a41627e 100755 --- a/packages/uc/rfa/src/v1/index.ts +++ b/packages/uc/rfa/src/v1/index.ts @@ -19,12 +19,19 @@ export type { BatchCreateAccessRequestsResponse, CreateAccessRequest, CreateAccessRequestResponse, + CreateCreateAccessRequest, + CreatePrincipal, + CreateSecurable, + CreateSecurablePermissions, GetAccessRequestDestinationsRequest, NotificationDestination, Principal, Securable, SecurablePermissions, + UpdateAccessRequestDestinations, UpdateAccessRequestDestinationsRequest, + UpdateNotificationDestination, + UpdateSecurable, } from './model'; -export {accessRequestDestinationsFieldMask} from './model'; +export {updateAccessRequestDestinationsFieldMask} from './model'; diff --git a/packages/uc/rfa/src/v1/model.ts b/packages/uc/rfa/src/v1/model.ts index 049aa98b..33042796 100644 --- a/packages/uc/rfa/src/v1/model.ts +++ b/packages/uc/rfa/src/v1/model.ts @@ -96,7 +96,7 @@ export interface BatchCreateAccessRequestsRequest { * * At most 30 requests per API call. */ - requests?: CreateAccessRequest[] | undefined; + requests?: CreateCreateAccessRequest[] | undefined; } export interface BatchCreateAccessRequestsResponse { @@ -135,6 +135,65 @@ export interface CreateAccessRequestResponse { requestDestinations?: AccessRequestDestinations[] | undefined; } +export interface CreateCreateAccessRequest { + /** + * Optional. The principal this request is for. + * Empty `behalf_of` defaults to the requester's identity. + * + * Principals must be unique across the API call. + */ + behalfOf?: CreatePrincipal | undefined; + /** + * Optional. Comment associated with the request. + * + * At most 200 characters, can only contain lowercase/uppercase + * letters (a-z, A-Z), numbers (0-9), punctuation, and spaces. + */ + comment?: string | undefined; + /** + * List of securables and their corresponding requested UC privileges. + * + * At most 30 securables can be requested for a principal per batched call. + * Each securable can only be requested once per principal. + */ + securablePermissions?: CreateSecurablePermissions[] | undefined; +} + +export interface CreatePrincipal { + /** user, group or service principal ID. */ + id?: string | undefined; + principalType?: PrincipalType | undefined; +} + +/** + * Generic definition of a securable, which is uniquely defined in a metastore + * by its type and full name. + */ +export interface CreateSecurable { + /** + * Required. The type of securable (catalog/schema/table). + * Optional if resource_name is present. + */ + type?: SecurableType | undefined; + /** + * Required. The full name of the catalog/schema/table. + * Optional if resource_name is present. + */ + fullName?: string | undefined; + /** + * Optional. The name of the Share object that contains the securable when the securable is + * getting shared in D2D Delta Sharing. + */ + providerShare?: string | undefined; +} + +export interface CreateSecurablePermissions { + /** The securable for which the access request destinations are being requested. */ + securable?: CreateSecurable | undefined; + /** List of requested Unity Catalog permissions. */ + permissions?: string[] | undefined; +} + export interface GetAccessRequestDestinationsRequest { /** The type of the securable. */ securableType?: string | undefined; @@ -194,13 +253,59 @@ export interface SecurablePermissions { permissions?: string[] | undefined; } +export interface UpdateAccessRequestDestinations { + /** The access request destinations for the securable. */ + destinations?: UpdateNotificationDestination[] | undefined; + /** The securable for which the access request destinations are being modified or read. */ + securable?: UpdateSecurable | undefined; +} + export interface UpdateAccessRequestDestinationsRequest { /** * The access request destinations to assign to the securable. * For each destination, a **destination_id** and **destination_type** must be defined. */ - accessRequestDestinations?: AccessRequestDestinations | undefined; - updateMask?: FieldMask | undefined; + accessRequestDestinations?: UpdateAccessRequestDestinations | undefined; + updateMask?: FieldMask | undefined; +} + +export interface UpdateNotificationDestination { + /** + * The identifier for the destination. This is the email address for EMAIL destinations, the URL for URL destinations, + * or the unique notification destination ID for all other external destinations. + */ + destinationId?: string | undefined; + /** The type of the destination. */ + destinationType?: DestinationType | undefined; + /** + * This field is used to denote whether the destination is the email of the owner of the securable object. + * The special destination cannot be assigned to a securable and only represents the default destination of the securable. + * The securable types that support default special destinations are: "catalog", "external_location", "connection", "credential", and "metastore". + * The **destination_type** of a **special_destination** is always EMAIL. + */ + specialDestination?: SpecialDestination | undefined; +} + +/** + * Generic definition of a securable, which is uniquely defined in a metastore + * by its type and full name. + */ +export interface UpdateSecurable { + /** + * Required. The type of securable (catalog/schema/table). + * Optional if resource_name is present. + */ + type?: SecurableType | undefined; + /** + * Required. The full name of the catalog/schema/table. + * Optional if resource_name is present. + */ + fullName?: string | undefined; + /** + * Optional. The name of the Share object that contains the securable when the securable is + * getting shared in D2D Delta Sharing. + */ + providerShare?: string | undefined; } export const unmarshalAccessRequestDestinationsSchema: z.ZodType = @@ -285,42 +390,22 @@ export const unmarshalSecurableSchema: z.ZodType = z providerShare: d.provider_share, })); -export const marshalAccessRequestDestinationsSchema: z.ZodType = z - .object({ - destinations: z - .array(z.lazy(() => marshalNotificationDestinationSchema)) - .optional(), - securable: z.lazy(() => marshalSecurableSchema).optional(), - areAnyDestinationsHidden: z.boolean().optional(), - destinationSourceSecurable: z.lazy(() => marshalSecurableSchema).optional(), - securableType: z.string().optional(), - fullName: z.string().optional(), - }) - .transform(d => ({ - destinations: d.destinations, - securable: d.securable, - are_any_destinations_hidden: d.areAnyDestinationsHidden, - destination_source_securable: d.destinationSourceSecurable, - securable_type: d.securableType, - full_name: d.fullName, - })); - export const marshalBatchCreateAccessRequestsRequestSchema: z.ZodType = z .object({ requests: z - .array(z.lazy(() => marshalCreateAccessRequestSchema)) + .array(z.lazy(() => marshalCreateCreateAccessRequestSchema)) .optional(), }) .transform(d => ({ requests: d.requests, })); -export const marshalCreateAccessRequestSchema: z.ZodType = z +export const marshalCreateCreateAccessRequestSchema: z.ZodType = z .object({ - behalfOf: z.lazy(() => marshalPrincipalSchema).optional(), + behalfOf: z.lazy(() => marshalCreatePrincipalSchema).optional(), comment: z.string().optional(), securablePermissions: z - .array(z.lazy(() => marshalSecurablePermissionsSchema)) + .array(z.lazy(() => marshalCreateSecurablePermissionsSchema)) .optional(), }) .transform(d => ({ @@ -329,19 +414,7 @@ export const marshalCreateAccessRequestSchema: z.ZodType = z securable_permissions: d.securablePermissions, })); -export const marshalNotificationDestinationSchema: z.ZodType = z - .object({ - destinationId: z.string().optional(), - destinationType: z.string().optional(), - specialDestination: z.string().optional(), - }) - .transform(d => ({ - destination_id: d.destinationId, - destination_type: d.destinationType, - special_destination: d.specialDestination, - })); - -export const marshalPrincipalSchema: z.ZodType = z +export const marshalCreatePrincipalSchema: z.ZodType = z .object({ id: z.string().optional(), principalType: z.string().optional(), @@ -351,7 +424,7 @@ export const marshalPrincipalSchema: z.ZodType = z principal_type: d.principalType, })); -export const marshalSecurableSchema: z.ZodType = z +export const marshalCreateSecurableSchema: z.ZodType = z .object({ type: z.string().optional(), fullName: z.string().optional(), @@ -363,9 +436,9 @@ export const marshalSecurableSchema: z.ZodType = z provider_share: d.providerShare, })); -export const marshalSecurablePermissionsSchema: z.ZodType = z +export const marshalCreateSecurablePermissionsSchema: z.ZodType = z .object({ - securable: z.lazy(() => marshalSecurableSchema).optional(), + securable: z.lazy(() => marshalCreateSecurableSchema).optional(), permissions: z.array(z.string()).optional(), }) .transform(d => ({ @@ -373,28 +446,60 @@ export const marshalSecurablePermissionsSchema: z.ZodType = z permissions: d.permissions, })); -const accessRequestDestinationsFieldMaskSchema: FieldMaskSchema = { - areAnyDestinationsHidden: {wire: 'are_any_destinations_hidden'}, - destinationSourceSecurable: { - wire: 'destination_source_securable', - children: () => securableFieldMaskSchema, - }, +export const marshalUpdateAccessRequestDestinationsSchema: z.ZodType = z + .object({ + destinations: z + .array(z.lazy(() => marshalUpdateNotificationDestinationSchema)) + .optional(), + securable: z.lazy(() => marshalUpdateSecurableSchema).optional(), + }) + .transform(d => ({ + destinations: d.destinations, + securable: d.securable, + })); + +export const marshalUpdateNotificationDestinationSchema: z.ZodType = z + .object({ + destinationId: z.string().optional(), + destinationType: z.string().optional(), + specialDestination: z.string().optional(), + }) + .transform(d => ({ + destination_id: d.destinationId, + destination_type: d.destinationType, + special_destination: d.specialDestination, + })); + +export const marshalUpdateSecurableSchema: z.ZodType = z + .object({ + type: z.string().optional(), + fullName: z.string().optional(), + providerShare: z.string().optional(), + }) + .transform(d => ({ + type: d.type, + full_name: d.fullName, + provider_share: d.providerShare, + })); + +const updateAccessRequestDestinationsFieldMaskSchema: FieldMaskSchema = { destinations: {wire: 'destinations'}, - fullName: {wire: 'full_name'}, - securable: {wire: 'securable', children: () => securableFieldMaskSchema}, - securableType: {wire: 'securable_type'}, + securable: { + wire: 'securable', + children: () => updateSecurableFieldMaskSchema, + }, }; -export function accessRequestDestinationsFieldMask( +export function updateAccessRequestDestinationsFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - accessRequestDestinationsFieldMaskSchema + updateAccessRequestDestinationsFieldMaskSchema ); } -const securableFieldMaskSchema: FieldMaskSchema = { +const updateSecurableFieldMaskSchema: FieldMaskSchema = { fullName: {wire: 'full_name'}, providerShare: {wire: 'provider_share'}, type: {wire: 'type'}, diff --git a/packages/uc/schemas/src/v1/index.ts b/packages/uc/schemas/src/v1/index.ts index 02319f14..3a5a2ce4 100755 --- a/packages/uc/schemas/src/v1/index.ts +++ b/packages/uc/schemas/src/v1/index.ts @@ -9,6 +9,7 @@ export {SchemasClient} from './client'; export {CatalogType} from './model'; export type { + CreateEffectivePredictiveOptimizationFlag, CreateSchemaRequest, DeleteSchemaRequest, DeleteSchemaResponse, diff --git a/packages/uc/schemas/src/v1/model.ts b/packages/uc/schemas/src/v1/model.ts index 78c78c9c..9932c54a 100755 --- a/packages/uc/schemas/src/v1/model.ts +++ b/packages/uc/schemas/src/v1/model.ts @@ -16,6 +16,15 @@ export type CatalogType = | (typeof CatalogType)[keyof typeof CatalogType] | (string & {}); +export interface CreateEffectivePredictiveOptimizationFlag { + /** Whether predictive optimization should be enabled for this object and objects under it. */ + value: string; + /** The type of the object from which the flag was inherited. If there was no inheritance, this field is left blank. */ + inheritedFromType?: string | undefined; + /** The name of the object from which the flag was inherited. If there was no inheritance, this field is left blank. */ + inheritedFromName?: string | undefined; +} + export interface CreateSchemaRequest { /** Name of schema, relative to parent catalog. */ name?: string | undefined; @@ -46,7 +55,7 @@ export interface CreateSchemaRequest { /** Storage location for managed tables within schema. */ storageLocation?: string | undefined; effectivePredictiveOptimizationFlag?: - | EffectivePredictiveOptimizationFlag + | CreateEffectivePredictiveOptimizationFlag | undefined; /** The unique identifier of the schema. */ schemaId?: string | undefined; @@ -191,7 +200,7 @@ export interface UpdateSchemaRequest { /** Storage location for managed tables within schema. */ storageLocation?: string | undefined; effectivePredictiveOptimizationFlag?: - | EffectivePredictiveOptimizationFlag + | CreateEffectivePredictiveOptimizationFlag | undefined; /** The unique identifier of the schema. */ schemaId?: string | undefined; @@ -290,6 +299,19 @@ export const unmarshalSchemaInfoSchema: z.ZodType = z options: d.options, })); +export const marshalCreateEffectivePredictiveOptimizationFlagSchema: z.ZodType = + z + .object({ + value: z.string(), + inheritedFromType: z.string().optional(), + inheritedFromName: z.string().optional(), + }) + .transform(d => ({ + value: d.value, + inherited_from_type: d.inheritedFromType, + inherited_from_name: d.inheritedFromName, + })); + export const marshalCreateSchemaRequestSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -307,7 +329,7 @@ export const marshalCreateSchemaRequestSchema: z.ZodType = z catalogType: z.string().optional(), storageLocation: z.string().optional(), effectivePredictiveOptimizationFlag: z - .lazy(() => marshalEffectivePredictiveOptimizationFlagSchema) + .lazy(() => marshalCreateEffectivePredictiveOptimizationFlagSchema) .optional(), schemaId: z.string().optional(), browseOnly: z.boolean().optional(), @@ -339,18 +361,6 @@ export const marshalCreateSchemaRequestSchema: z.ZodType = z options: d.options, })); -export const marshalEffectivePredictiveOptimizationFlagSchema: z.ZodType = z - .object({ - value: z.string().optional(), - inheritedFromType: z.string().optional(), - inheritedFromName: z.string().optional(), - }) - .transform(d => ({ - value: d.value, - inherited_from_type: d.inheritedFromType, - inherited_from_name: d.inheritedFromName, - })); - export const marshalUpdateSchemaRequestSchema: z.ZodType = z .object({ fullNameArg: z.string().optional(), @@ -370,7 +380,7 @@ export const marshalUpdateSchemaRequestSchema: z.ZodType = z catalogType: z.string().optional(), storageLocation: z.string().optional(), effectivePredictiveOptimizationFlag: z - .lazy(() => marshalEffectivePredictiveOptimizationFlagSchema) + .lazy(() => marshalCreateEffectivePredictiveOptimizationFlagSchema) .optional(), schemaId: z.string().optional(), browseOnly: z.boolean().optional(), diff --git a/packages/uc/secrets/src/v1/client.ts b/packages/uc/secrets/src/v1/client.ts index 3de0397d..a5d07e86 100644 --- a/packages/uc/secrets/src/v1/client.ts +++ b/packages/uc/secrets/src/v1/client.ts @@ -26,7 +26,8 @@ import type { UpdateSecretRequest, } from './model'; import { - marshalSecretSchema, + marshalCreateSecretSchema, + marshalUpdateSecretSchema, unmarshalListSecretsResponseSchema, unmarshalSecretSchema, } from './model'; @@ -79,7 +80,7 @@ export class SecretsClient { ): Promise { const {host, workspaceId, httpClient} = await this.resolveConfig(); const url = `${host}/api/2.1/unity-catalog/secrets`; - const body = marshalRequest(req.secret, marshalSecretSchema); + const body = marshalRequest(req.secret, marshalCreateSecretSchema); let resp: Secret | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); @@ -266,7 +267,7 @@ export class SecretsClient { } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; - const body = marshalRequest(req.secret, marshalSecretSchema); + const body = marshalRequest(req.secret, marshalUpdateSecretSchema); let resp: Secret | undefined; const call = async (callSignal?: AbortSignal): Promise => { const headers = new Headers({'Content-Type': 'application/json'}); diff --git a/packages/uc/secrets/src/v1/index.ts b/packages/uc/secrets/src/v1/index.ts index 764a20f1..a4e2a37f 100755 --- a/packages/uc/secrets/src/v1/index.ts +++ b/packages/uc/secrets/src/v1/index.ts @@ -7,13 +7,15 @@ export {SecretsClient} from './client'; export type { + CreateSecret, CreateSecretRequest, DeleteSecretRequest, GetSecretRequest, ListSecretsRequest, ListSecretsResponse, Secret, + UpdateSecret, UpdateSecretRequest, } from './model'; -export {secretFieldMask} from './model'; +export {updateSecretFieldMask} from './model'; diff --git a/packages/uc/secrets/src/v1/model.ts b/packages/uc/secrets/src/v1/model.ts index 993f865e..6352b199 100644 --- a/packages/uc/secrets/src/v1/model.ts +++ b/packages/uc/secrets/src/v1/model.ts @@ -5,13 +5,47 @@ import {FieldMask} from '@databricks/sdk-core/wkt'; import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; +/** + * A secret stored in Unity Catalog. Secrets are three-level namespace objects + * (catalog.schema.secret) that securely store sensitive credential data such as + * passwords, tokens, and keys. + */ +export interface CreateSecret { + /** The name of the secret, relative to its parent schema. */ + name: string; + /** + * The owner of the secret. Defaults to the creating principal on creation. Can be updated to + * transfer ownership of the secret to another principal. + */ + owner?: string | undefined; + /** User-provided free-form text description of the secret. */ + comment?: string | undefined; + /** The name of the catalog where the schema and the secret reside. */ + catalogName: string; + /** The name of the schema where the secret resides. */ + schemaName: string; + /** + * The secret value to store. This field is input-only and is not returned in responses — use + * the **effective_value** field (via GetSecret with **include_value** set to true) to read the + * secret value. The maximum size is 60 KiB (pre-encryption). Accepted content includes + * passwords, tokens, keys, and other sensitive credential data. + */ + value: string; + /** + * User-provided expiration time of the secret. This field indicates when the secret should no + * longer be used and may be displayed as a warning in the UI. It is purely informational and + * does not trigger any automatic actions or affect the secret's lifecycle. + */ + expireTime?: Temporal.Instant | undefined; +} + /** Request message for CreateSecret. */ export interface CreateSecretRequest { /** * The secret object to create. The **name**, **catalog_name**, **schema_name**, and **value** * fields are required. */ - secret?: Secret | undefined; + secret?: CreateSecret | undefined; } /** Request message for DeleteSecret. */ @@ -89,11 +123,6 @@ export interface ListSecretsResponse { export interface Secret { /** The name of the secret, relative to its parent schema. */ name?: string | undefined; - /** - * The owner of the secret. Defaults to the creating principal on creation. Can be updated to - * transfer ownership of the secret to another principal. - */ - owner?: string | undefined; /** * The effective owner of the secret, which may differ from the directly-set **owner** due to * inheritance. @@ -117,13 +146,6 @@ export interface Secret { catalogName?: string | undefined; /** The name of the schema where the secret resides. */ schemaName?: string | undefined; - /** - * The secret value to store. This field is input-only and is not returned in responses — use - * the **effective_value** field (via GetSecret with **include_value** set to true) to read the - * secret value. The maximum size is 60 KiB (pre-encryption). Accepted content includes - * passwords, tokens, keys, and other sensitive credential data. - */ - value?: string | undefined; /** * The secret value. Only populated in responses when you have the **READ_SECRET** * privilege and **include_value** is set to true in the request. The maximum size is 60 KiB. @@ -143,6 +165,40 @@ export interface Secret { externalSecretId?: string | undefined; } +/** + * A secret stored in Unity Catalog. Secrets are three-level namespace objects + * (catalog.schema.secret) that securely store sensitive credential data such as + * passwords, tokens, and keys. + */ +export interface UpdateSecret { + /** The name of the secret, relative to its parent schema. */ + name?: string | undefined; + /** + * The owner of the secret. Defaults to the creating principal on creation. Can be updated to + * transfer ownership of the secret to another principal. + */ + owner?: string | undefined; + /** User-provided free-form text description of the secret. */ + comment?: string | undefined; + /** The name of the catalog where the schema and the secret reside. */ + catalogName?: string | undefined; + /** The name of the schema where the secret resides. */ + schemaName?: string | undefined; + /** + * The secret value to store. This field is input-only and is not returned in responses — use + * the **effective_value** field (via GetSecret with **include_value** set to true) to read the + * secret value. The maximum size is 60 KiB (pre-encryption). Accepted content includes + * passwords, tokens, keys, and other sensitive credential data. + */ + value?: string | undefined; + /** + * User-provided expiration time of the secret. This field indicates when the secret should no + * longer be used and may be displayed as a warning in the UI. It is purely informational and + * does not trigger any automatic actions or affect the secret's lifecycle. + */ + expireTime?: Temporal.Instant | undefined; +} + /** Request message for UpdateSecret. */ export interface UpdateSecretRequest { /** @@ -154,12 +210,12 @@ export interface UpdateSecretRequest { * The secret object containing the fields to update. Only fields specified in **update_mask** * will be updated. */ - secret?: Secret | undefined; + secret?: UpdateSecret | undefined; /** * The field mask specifying which fields of the secret to update. Supported fields: **value**, * **comment**, **owner**, **expire_time**. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalListSecretsResponseSchema: z.ZodType = @@ -176,7 +232,6 @@ export const unmarshalListSecretsResponseSchema: z.ZodType export const unmarshalSecretSchema: z.ZodType = z .object({ name: z.string().optional(), - owner: z.string().optional(), effective_owner: z.string().optional(), metastore_id: z.string().optional(), create_time: z @@ -193,7 +248,6 @@ export const unmarshalSecretSchema: z.ZodType = z full_name: z.string().optional(), catalog_name: z.string().optional(), schema_name: z.string().optional(), - value: z.string().optional(), effective_value: z.string().optional(), browse_only: z.boolean().optional(), expire_time: z @@ -204,7 +258,6 @@ export const unmarshalSecretSchema: z.ZodType = z }) .transform(d => ({ name: d.name, - owner: d.owner, effectiveOwner: d.effective_owner, metastoreId: d.metastore_id, createTime: d.create_time, @@ -215,82 +268,70 @@ export const unmarshalSecretSchema: z.ZodType = z fullName: d.full_name, catalogName: d.catalog_name, schemaName: d.schema_name, - value: d.value, effectiveValue: d.effective_value, browseOnly: d.browse_only, expireTime: d.expire_time, externalSecretId: d.external_secret_id, })); -export const marshalSecretSchema: z.ZodType = z +export const marshalCreateSecretSchema: z.ZodType = z .object({ - name: z.string().optional(), + name: z.string(), owner: z.string().optional(), - effectiveOwner: z.string().optional(), - metastoreId: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - createdBy: z.string().optional(), - updateTime: z + comment: z.string().optional(), + catalogName: z.string(), + schemaName: z.string(), + value: z.string(), + expireTime: z .any() .transform((d: Temporal.Instant) => d.toString()) .optional(), - updatedBy: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + owner: d.owner, + comment: d.comment, + catalog_name: d.catalogName, + schema_name: d.schemaName, + value: d.value, + expire_time: d.expireTime, + })); + +export const marshalUpdateSecretSchema: z.ZodType = z + .object({ + name: z.string().optional(), + owner: z.string().optional(), comment: z.string().optional(), - fullName: z.string().optional(), catalogName: z.string().optional(), schemaName: z.string().optional(), value: z.string().optional(), - effectiveValue: z.string().optional(), - browseOnly: z.boolean().optional(), expireTime: z .any() .transform((d: Temporal.Instant) => d.toString()) .optional(), - externalSecretId: z.string().optional(), }) .transform(d => ({ name: d.name, owner: d.owner, - effective_owner: d.effectiveOwner, - metastore_id: d.metastoreId, - create_time: d.createTime, - created_by: d.createdBy, - update_time: d.updateTime, - updated_by: d.updatedBy, comment: d.comment, - full_name: d.fullName, catalog_name: d.catalogName, schema_name: d.schemaName, value: d.value, - effective_value: d.effectiveValue, - browse_only: d.browseOnly, expire_time: d.expireTime, - external_secret_id: d.externalSecretId, })); -const secretFieldMaskSchema: FieldMaskSchema = { - browseOnly: {wire: 'browse_only'}, +const updateSecretFieldMaskSchema: FieldMaskSchema = { catalogName: {wire: 'catalog_name'}, comment: {wire: 'comment'}, - createTime: {wire: 'create_time'}, - createdBy: {wire: 'created_by'}, - effectiveOwner: {wire: 'effective_owner'}, - effectiveValue: {wire: 'effective_value'}, expireTime: {wire: 'expire_time'}, - externalSecretId: {wire: 'external_secret_id'}, - fullName: {wire: 'full_name'}, - metastoreId: {wire: 'metastore_id'}, name: {wire: 'name'}, owner: {wire: 'owner'}, schemaName: {wire: 'schema_name'}, - updateTime: {wire: 'update_time'}, - updatedBy: {wire: 'updated_by'}, value: {wire: 'value'}, }; -export function secretFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, secretFieldMaskSchema); +export function updateSecretFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, updateSecretFieldMaskSchema); } diff --git a/packages/uc/tables/src/v1/index.ts b/packages/uc/tables/src/v1/index.ts index ee2d07b4..da4ca65a 100755 --- a/packages/uc/tables/src/v1/index.ts +++ b/packages/uc/tables/src/v1/index.ts @@ -21,7 +21,27 @@ export type { ColumnInfo, ColumnMask, ConnectionDependency, + CreateColumnInfo, + CreateColumnMask, + CreateConnectionDependency, + CreateCredentialDependency, + CreateDeltaRuntimePropertiesKvPairs, + CreateDependency, + CreateDependencyList, + CreateEffectivePredictiveOptimizationFlag, + CreateEncryptionDetails, + CreateForeignKeyConstraint, + CreateFunctionDependency, + CreateNamedTableConstraint, + CreateOptionSpec, + CreatePolicyFunctionArgument, + CreatePrimaryKeyConstraint, + CreateRowFilter, + CreateSecurableKindManifest, + CreateSseEncryptionDetails, + CreateTableConstraint, CreateTableConstraintRequest, + CreateTableDependency, CreateTableRequest, CredentialDependency, DeleteTableConstraintRequest, diff --git a/packages/uc/tables/src/v1/model.ts b/packages/uc/tables/src/v1/model.ts index 779cd79b..2809a20d 100755 --- a/packages/uc/tables/src/v1/model.ts +++ b/packages/uc/tables/src/v1/model.ts @@ -325,10 +325,277 @@ export interface ConnectionDependency { connectionName?: string | undefined; } +export interface CreateColumnInfo { + /** Name of Column. */ + name?: string | undefined; + /** Full data type specification as SQL/catalogString text. */ + typeText?: string | undefined; + typeName?: ColumnTypeName | undefined; + /** Ordinal position of column (starting at position 0). */ + position?: number | undefined; + /** Digits of precision; required for DecimalTypes. */ + typePrecision?: number | undefined; + /** Digits to right of decimal; Required for DecimalTypes. */ + typeScale?: number | undefined; + /** Format of IntervalType. */ + typeIntervalType?: string | undefined; + /** Full data type specification, JSON-serialized. */ + typeJson?: string | undefined; + /** User-provided free-form text description. */ + comment?: string | undefined; + /** Whether field may be Null (default: true). */ + nullable?: boolean | undefined; + /** Partition index for column. */ + partitionIndex?: number | undefined; + mask?: CreateColumnMask | undefined; +} + +export interface CreateColumnMask { + /** The full name of the column mask SQL UDF. */ + functionName?: string | undefined; + /** + * The list of additional table columns to be passed as input to the column mask function. The + * first arg of the mask function should be of the type of the column being masked and the + * types of the rest of the args should match the types of columns in 'using_column_names'. + */ + usingColumnNames?: string[] | undefined; + /** + * The list of additional table columns or literals to be passed as additional arguments to + * a column mask function. This is the replacement of the deprecated using_column_names field and + * carries information about the types (alias or constant) of the arguments to the mask function. + */ + usingArguments?: CreatePolicyFunctionArgument[] | undefined; +} + +/** A connection that is dependent on a SQL object. */ +export interface CreateConnectionDependency { + /** Full name of the dependent connection, in the form of __connection_name__. */ + connectionName?: string | undefined; +} + +/** A credential that is dependent on a SQL object. */ +export interface CreateCredentialDependency { + /** Full name of the dependent credential, in the form of __credential_name__. */ + credentialName?: string | undefined; +} + +/** + * Properties pertaining to the current state of the delta table as given by the commit server. + * This does not contain **delta.*** (input) properties in __TableInfo.properties__. + */ +export interface CreateDeltaRuntimePropertiesKvPairs { + /** A map of key-value properties attached to the securable. */ + deltaRuntimeProperties: Record; +} + +/** + * A dependency of a SQL object. One of the following fields must be defined: + * __table__, __function__, __connection__, __credential__, __volume__, or __secret__. + */ +export interface CreateDependency { + value?: + | {$case: 'table'; table: CreateTableDependency} + | {$case: 'function'; function: CreateFunctionDependency} + | {$case: 'connection'; connection: CreateConnectionDependency} + | {$case: 'credential'; credential: CreateCredentialDependency} + | undefined; +} + +/** A list of dependencies. */ +export interface CreateDependencyList { + /** Array of dependencies. */ + dependencies?: CreateDependency[] | undefined; +} + +export interface CreateEffectivePredictiveOptimizationFlag { + /** Whether predictive optimization should be enabled for this object and objects under it. */ + value: string; + /** The type of the object from which the flag was inherited. If there was no inheritance, this field is left blank. */ + inheritedFromType?: string | undefined; + /** The name of the object from which the flag was inherited. If there was no inheritance, this field is left blank. */ + inheritedFromName?: string | undefined; +} + +/** Encryption options that apply to clients connecting to cloud storage. */ +export interface CreateEncryptionDetails { + encryptionDetailsType?: + | { + $case: 'sseEncryptionDetails'; + /** Server-Side Encryption properties for clients communicating with AWS s3. */ + sseEncryptionDetails: CreateSseEncryptionDetails; + } + | undefined; +} + +export interface CreateForeignKeyConstraint { + /** The name of the constraint. */ + name: string; + /** Column names for this constraint. */ + childColumns: string[]; + /** The full name of the parent constraint. */ + parentTable: string; + /** Column names for this constraint. */ + parentColumns: string[]; + /** True if the constraint is RELY, false or unset if NORELY. */ + rely?: boolean | undefined; +} + +/** A function that is dependent on a SQL object. */ +export interface CreateFunctionDependency { + /** Full name of the dependent function, in the form of __catalog_name__.__schema_name__.__function_name__. */ + functionFullName: string; +} + +export interface CreateNamedTableConstraint { + /** The name of the constraint. */ + name: string; +} + +/** + * Spec of an allowed option on a securable kind and its attributes. + * This is mostly used by UI to provide user friendly hints and descriptions + * in order to facilitate the securable creation process. + */ +export interface CreateOptionSpec { + /** The unique name of the option. */ + name?: string | undefined; + /** The type of the option. */ + type?: OptionSpec_OptionType | undefined; + /** The default value of the option, for example, value '443' for 'port' option. */ + defaultValue?: string | undefined; + /** + * For drop down / radio button selections, UI will want to know the possible + * input values, it can also be used by other option types to limit input selections. + */ + allowedValues?: string[] | undefined; + /** + * The hint is used on the UI to suggest what the input value + * can possibly be like, for example: example.com for 'host' option. + * Unlike default value, it will not be applied automatically without user input. + */ + hint?: string | undefined; + /** A concise user facing description of what the input value of this option should look like. */ + description?: string | undefined; + /** Is the option required. */ + isRequired?: boolean | undefined; + /** Is the option value considered secret and thus redacted on the UI. */ + isSecret?: boolean | undefined; + /** Is the option value not user settable and is thus not shown on the UI. */ + isHidden?: boolean | undefined; + /** Is the option updatable by users. */ + isUpdatable?: boolean | undefined; + /** Specifies when the option value is displayed on the UI within the OAuth flow. */ + oauthStage?: OptionSpec_OauthStage | undefined; + /** Specifies whether this option is safe to log, i.e. no sensitive information. */ + isLoggable?: boolean | undefined; + /** Indicates whether an option can be provided by users in the create/update path of an entity. */ + isCreatable?: boolean | undefined; + /** Indicates whether an option should be displayed with copy button on the UI. */ + isCopiable?: boolean | undefined; +} + +/** + * A positional argument passed to a row filter or column mask function. + * Distinguishes between column references and literals. + */ +export interface CreatePolicyFunctionArgument { + arg?: + | { + $case: 'column'; + /** A column reference. */ + column: string; + } + | { + $case: 'constant'; + /** A constant literal. */ + constant: string; + } + | undefined; +} + +export interface CreatePrimaryKeyConstraint { + /** The name of the constraint. */ + name: string; + /** Column names for this constraint. */ + childColumns: string[]; + /** Column names that represent a timeseries. */ + timeseriesColumns?: string[] | undefined; + /** True if the constraint is RELY, false or unset if NORELY. */ + rely?: boolean | undefined; +} + +export interface CreateRowFilter { + /** The full name of the row filter SQL UDF. */ + functionName: string; + /** + * The list of table columns to be passed as input to the row filter function. The column types + * should match the types of the filter function arguments. + */ + inputColumnNames: string[]; + /** + * The list of additional table columns or literals to be passed as additional arguments to + * a row filter function. This is the replacement of the deprecated input_column_names field and + * carries information about the types (alias or constant) of the arguments to the filter function. + */ + inputArguments?: CreatePolicyFunctionArgument[] | undefined; +} + +/** Manifest of a specific securable kind. */ +export interface CreateSecurableKindManifest { + /** Securable Type of the kind. */ + securableType?: SecurableType | undefined; + /** Securable kind to get manifest of. */ + securableKind?: SecurableKind | undefined; + /** Privileges that can be assigned to the securable. */ + assignablePrivileges?: string[] | undefined; + /** Detailed specs of allowed options. */ + options?: CreateOptionSpec[] | undefined; + /** A list of capabilities in the securable kind. */ + capabilities?: string[] | undefined; +} + +/** Server-Side Encryption properties for clients communicating with AWS s3. */ +export interface CreateSseEncryptionDetails { + /** Sets the value of the 'x-amz-server-side-encryption' header in S3 request. */ + algorithm?: SseEncryptionAlgorithm | undefined; + /** + * Optional. The ARN of the SSE-KMS key used with the S3 location, when algorithm = "SSE-KMS". + * Sets the value of the 'x-amz-server-side-encryption-aws-kms-key-id' header. + */ + awsKmsKeyArn?: string | undefined; +} + +/** + * A table constraint, as defined by *one* of the following fields being set: + * __primary_key_constraint__, __foreign_key_constraint__, __named_table_constraint__. + */ +export interface CreateTableConstraint { + constraint?: + | { + $case: 'primaryKeyConstraint'; + primaryKeyConstraint: CreatePrimaryKeyConstraint; + } + | { + $case: 'foreignKeyConstraint'; + foreignKeyConstraint: CreateForeignKeyConstraint; + } + | { + $case: 'namedTableConstraint'; + namedTableConstraint: CreateNamedTableConstraint; + } + | undefined; +} + export interface CreateTableConstraintRequest { /** The full name of the table referenced by the constraint. */ fullNameArg?: string | undefined; - constraint?: TableConstraint | undefined; + constraint?: CreateTableConstraint | undefined; +} + +/** A table that is dependent on a SQL object. */ +export interface CreateTableDependency { + /** Full name of the dependent table, in the form of __catalog_name__.__schema_name__.__table_name__. */ + tableFullName: string; } export interface CreateTableRequest { @@ -351,7 +618,7 @@ export interface CreateTableRequest { * - when DependencyList is not an empty list, dependencies are provided and recorded. * Note: this field is not set in the output of the __listTables__ API. */ - viewDependencies?: DependencyList | undefined; + viewDependencies?: CreateDependencyList | undefined; /** List of schemes whose objects can be referenced without qualification. */ sqlPath?: string | undefined; /** Username of current owner of table. */ @@ -361,8 +628,8 @@ export interface CreateTableRequest { /** Name of the storage credential, when a storage credential is configured for use with this table. */ storageCredentialName?: string | undefined; /** List of table constraints. Note: this field is not set in the output of the __listTables__ API. */ - tableConstraints?: TableConstraint[] | undefined; - rowFilter?: RowFilter | undefined; + tableConstraints?: CreateTableConstraint[] | undefined; + rowFilter?: CreateRowFilter | undefined; /** The pipeline ID of the table. Applicable for tables created by pipelines (Materialized View, Streaming Table, etc.). */ pipelineId?: string | undefined; enablePredictiveOptimization?: string | undefined; @@ -383,21 +650,23 @@ export interface CreateTableRequest { /** The unique identifier of the table. */ tableId?: string | undefined; /** Information pertaining to current state of the delta table. */ - deltaRuntimePropertiesKvpairs?: DeltaRuntimePropertiesKvPairs | undefined; + deltaRuntimePropertiesKvpairs?: + | CreateDeltaRuntimePropertiesKvPairs + | undefined; /** Time at which this table was deleted, in epoch milliseconds. Field is omitted if table is not deleted. */ deletedAt?: bigint | undefined; effectivePredictiveOptimizationFlag?: - | EffectivePredictiveOptimizationFlag + | CreateEffectivePredictiveOptimizationFlag | undefined; /** The AWS access point to use when accesing s3 for this external location. */ accessPoint?: string | undefined; /** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */ browseOnly?: boolean | undefined; - encryptionDetails?: EncryptionDetails | undefined; + encryptionDetails?: CreateEncryptionDetails | undefined; /** SecurableKindManifest of table, including capabilities the table has. */ - securableKindManifest?: SecurableKindManifest | undefined; + securableKindManifest?: CreateSecurableKindManifest | undefined; /** The array of __ColumnInfo__ definitions of the table's columns. */ - columns?: ColumnInfo[] | undefined; + columns?: CreateColumnInfo[] | undefined; /** A map of key-value properties attached to the securable. */ properties?: Record | undefined; } @@ -840,7 +1109,7 @@ export interface UpdateTableRequest { * - when DependencyList is not an empty list, dependencies are provided and recorded. * Note: this field is not set in the output of the __listTables__ API. */ - viewDependencies?: DependencyList | undefined; + viewDependencies?: CreateDependencyList | undefined; /** List of schemes whose objects can be referenced without qualification. */ sqlPath?: string | undefined; /** Username of current owner of table. */ @@ -850,8 +1119,8 @@ export interface UpdateTableRequest { /** Name of the storage credential, when a storage credential is configured for use with this table. */ storageCredentialName?: string | undefined; /** List of table constraints. Note: this field is not set in the output of the __listTables__ API. */ - tableConstraints?: TableConstraint[] | undefined; - rowFilter?: RowFilter | undefined; + tableConstraints?: CreateTableConstraint[] | undefined; + rowFilter?: CreateRowFilter | undefined; /** The pipeline ID of the table. Applicable for tables created by pipelines (Materialized View, Streaming Table, etc.). */ pipelineId?: string | undefined; enablePredictiveOptimization?: string | undefined; @@ -872,21 +1141,23 @@ export interface UpdateTableRequest { /** The unique identifier of the table. */ tableId?: string | undefined; /** Information pertaining to current state of the delta table. */ - deltaRuntimePropertiesKvpairs?: DeltaRuntimePropertiesKvPairs | undefined; + deltaRuntimePropertiesKvpairs?: + | CreateDeltaRuntimePropertiesKvPairs + | undefined; /** Time at which this table was deleted, in epoch milliseconds. Field is omitted if table is not deleted. */ deletedAt?: bigint | undefined; effectivePredictiveOptimizationFlag?: - | EffectivePredictiveOptimizationFlag + | CreateEffectivePredictiveOptimizationFlag | undefined; /** The AWS access point to use when accesing s3 for this external location. */ accessPoint?: string | undefined; /** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */ browseOnly?: boolean | undefined; - encryptionDetails?: EncryptionDetails | undefined; + encryptionDetails?: CreateEncryptionDetails | undefined; /** SecurableKindManifest of table, including capabilities the table has. */ - securableKindManifest?: SecurableKindManifest | undefined; + securableKindManifest?: CreateSecurableKindManifest | undefined; /** The array of __ColumnInfo__ definitions of the table's columns. */ - columns?: ColumnInfo[] | undefined; + columns?: CreateColumnInfo[] | undefined; /** A map of key-value properties attached to the securable. */ properties?: Record | undefined; } @@ -1349,7 +1620,7 @@ export const unmarshalTableSummarySchema: z.ZodType = z export const unmarshalUpdateTableResponseSchema: z.ZodType = z.object({}); -export const marshalColumnInfoSchema: z.ZodType = z +export const marshalCreateColumnInfoSchema: z.ZodType = z .object({ name: z.string().optional(), typeText: z.string().optional(), @@ -1362,7 +1633,7 @@ export const marshalColumnInfoSchema: z.ZodType = z comment: z.string().optional(), nullable: z.boolean().optional(), partitionIndex: z.number().optional(), - mask: z.lazy(() => marshalColumnMaskSchema).optional(), + mask: z.lazy(() => marshalCreateColumnMaskSchema).optional(), }) .transform(d => ({ name: d.name, @@ -1379,12 +1650,12 @@ export const marshalColumnInfoSchema: z.ZodType = z mask: d.mask, })); -export const marshalColumnMaskSchema: z.ZodType = z +export const marshalCreateColumnMaskSchema: z.ZodType = z .object({ functionName: z.string().optional(), usingColumnNames: z.array(z.string()).optional(), usingArguments: z - .array(z.lazy(() => marshalPolicyFunctionArgumentSchema)) + .array(z.lazy(() => marshalCreatePolicyFunctionArgumentSchema)) .optional(), }) .transform(d => ({ @@ -1393,7 +1664,7 @@ export const marshalColumnMaskSchema: z.ZodType = z using_arguments: d.usingArguments, })); -export const marshalConnectionDependencySchema: z.ZodType = z +export const marshalCreateConnectionDependencySchema: z.ZodType = z .object({ connectionName: z.string().optional(), }) @@ -1401,98 +1672,7 @@ export const marshalConnectionDependencySchema: z.ZodType = z connection_name: d.connectionName, })); -export const marshalCreateTableConstraintRequestSchema: z.ZodType = z - .object({ - fullNameArg: z.string().optional(), - constraint: z.lazy(() => marshalTableConstraintSchema).optional(), - }) - .transform(d => ({ - full_name_arg: d.fullNameArg, - constraint: d.constraint, - })); - -export const marshalCreateTableRequestSchema: z.ZodType = z - .object({ - name: z.string().optional(), - catalogName: z.string().optional(), - schemaName: z.string().optional(), - tableType: z.string().optional(), - dataSourceFormat: z.string().optional(), - storageLocation: z.string().optional(), - viewDefinition: z.string().optional(), - viewDependencies: z.lazy(() => marshalDependencyListSchema).optional(), - sqlPath: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - storageCredentialName: z.string().optional(), - tableConstraints: z - .array(z.lazy(() => marshalTableConstraintSchema)) - .optional(), - rowFilter: z.lazy(() => marshalRowFilterSchema).optional(), - pipelineId: z.string().optional(), - enablePredictiveOptimization: z.string().optional(), - metastoreId: z.string().optional(), - fullName: z.string().optional(), - dataAccessConfigurationId: z.string().optional(), - createdAt: z.bigint().optional(), - createdBy: z.string().optional(), - updatedAt: z.bigint().optional(), - updatedBy: z.string().optional(), - tableId: z.string().optional(), - deltaRuntimePropertiesKvpairs: z - .lazy(() => marshalDeltaRuntimePropertiesKvPairsSchema) - .optional(), - deletedAt: z.bigint().optional(), - effectivePredictiveOptimizationFlag: z - .lazy(() => marshalEffectivePredictiveOptimizationFlagSchema) - .optional(), - accessPoint: z.string().optional(), - browseOnly: z.boolean().optional(), - encryptionDetails: z.lazy(() => marshalEncryptionDetailsSchema).optional(), - securableKindManifest: z - .lazy(() => marshalSecurableKindManifestSchema) - .optional(), - columns: z.array(z.lazy(() => marshalColumnInfoSchema)).optional(), - properties: z.record(z.string(), z.string()).optional(), - }) - .transform(d => ({ - name: d.name, - catalog_name: d.catalogName, - schema_name: d.schemaName, - table_type: d.tableType, - data_source_format: d.dataSourceFormat, - storage_location: d.storageLocation, - view_definition: d.viewDefinition, - view_dependencies: d.viewDependencies, - sql_path: d.sqlPath, - owner: d.owner, - comment: d.comment, - storage_credential_name: d.storageCredentialName, - table_constraints: d.tableConstraints, - row_filter: d.rowFilter, - pipeline_id: d.pipelineId, - enable_predictive_optimization: d.enablePredictiveOptimization, - metastore_id: d.metastoreId, - full_name: d.fullName, - data_access_configuration_id: d.dataAccessConfigurationId, - created_at: d.createdAt, - created_by: d.createdBy, - updated_at: d.updatedAt, - updated_by: d.updatedBy, - table_id: d.tableId, - delta_runtime_properties_kvpairs: d.deltaRuntimePropertiesKvpairs, - deleted_at: d.deletedAt, - effective_predictive_optimization_flag: - d.effectivePredictiveOptimizationFlag, - access_point: d.accessPoint, - browse_only: d.browseOnly, - encryption_details: d.encryptionDetails, - securable_kind_manifest: d.securableKindManifest, - columns: d.columns, - properties: d.properties, - })); - -export const marshalCredentialDependencySchema: z.ZodType = z +export const marshalCreateCredentialDependencySchema: z.ZodType = z .object({ credentialName: z.string().optional(), }) @@ -1500,33 +1680,33 @@ export const marshalCredentialDependencySchema: z.ZodType = z credential_name: d.credentialName, })); -export const marshalDeltaRuntimePropertiesKvPairsSchema: z.ZodType = z +export const marshalCreateDeltaRuntimePropertiesKvPairsSchema: z.ZodType = z .object({ - deltaRuntimeProperties: z.record(z.string(), z.string()).optional(), + deltaRuntimeProperties: z.record(z.string(), z.string()), }) .transform(d => ({ delta_runtime_properties: d.deltaRuntimeProperties, })); -export const marshalDependencySchema: z.ZodType = z +export const marshalCreateDependencySchema: z.ZodType = z .object({ value: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('table'), - table: z.lazy(() => marshalTableDependencySchema), + table: z.lazy(() => marshalCreateTableDependencySchema), }), z.object({ $case: z.literal('function'), - function: z.lazy(() => marshalFunctionDependencySchema), + function: z.lazy(() => marshalCreateFunctionDependencySchema), }), z.object({ $case: z.literal('connection'), - connection: z.lazy(() => marshalConnectionDependencySchema), + connection: z.lazy(() => marshalCreateConnectionDependencySchema), }), z.object({ $case: z.literal('credential'), - credential: z.lazy(() => marshalCredentialDependencySchema), + credential: z.lazy(() => marshalCreateCredentialDependencySchema), }), ]) .optional(), @@ -1538,33 +1718,38 @@ export const marshalDependencySchema: z.ZodType = z ...(d.value?.$case === 'credential' && {credential: d.value.credential}), })); -export const marshalDependencyListSchema: z.ZodType = z +export const marshalCreateDependencyListSchema: z.ZodType = z .object({ - dependencies: z.array(z.lazy(() => marshalDependencySchema)).optional(), + dependencies: z + .array(z.lazy(() => marshalCreateDependencySchema)) + .optional(), }) .transform(d => ({ dependencies: d.dependencies, })); -export const marshalEffectivePredictiveOptimizationFlagSchema: z.ZodType = z - .object({ - value: z.string().optional(), - inheritedFromType: z.string().optional(), - inheritedFromName: z.string().optional(), - }) - .transform(d => ({ - value: d.value, - inherited_from_type: d.inheritedFromType, - inherited_from_name: d.inheritedFromName, - })); +export const marshalCreateEffectivePredictiveOptimizationFlagSchema: z.ZodType = + z + .object({ + value: z.string(), + inheritedFromType: z.string().optional(), + inheritedFromName: z.string().optional(), + }) + .transform(d => ({ + value: d.value, + inherited_from_type: d.inheritedFromType, + inherited_from_name: d.inheritedFromName, + })); -export const marshalEncryptionDetailsSchema: z.ZodType = z +export const marshalCreateEncryptionDetailsSchema: z.ZodType = z .object({ encryptionDetailsType: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('sseEncryptionDetails'), - sseEncryptionDetails: z.lazy(() => marshalSseEncryptionDetailsSchema), + sseEncryptionDetails: z.lazy( + () => marshalCreateSseEncryptionDetailsSchema + ), }), ]) .optional(), @@ -1575,12 +1760,12 @@ export const marshalEncryptionDetailsSchema: z.ZodType = z }), })); -export const marshalForeignKeyConstraintSchema: z.ZodType = z +export const marshalCreateForeignKeyConstraintSchema: z.ZodType = z .object({ - name: z.string().optional(), - childColumns: z.array(z.string()).optional(), - parentTable: z.string().optional(), - parentColumns: z.array(z.string()).optional(), + name: z.string(), + childColumns: z.array(z.string()), + parentTable: z.string(), + parentColumns: z.array(z.string()), rely: z.boolean().optional(), }) .transform(d => ({ @@ -1591,23 +1776,23 @@ export const marshalForeignKeyConstraintSchema: z.ZodType = z rely: d.rely, })); -export const marshalFunctionDependencySchema: z.ZodType = z +export const marshalCreateFunctionDependencySchema: z.ZodType = z .object({ - functionFullName: z.string().optional(), + functionFullName: z.string(), }) .transform(d => ({ function_full_name: d.functionFullName, })); -export const marshalNamedTableConstraintSchema: z.ZodType = z +export const marshalCreateNamedTableConstraintSchema: z.ZodType = z .object({ - name: z.string().optional(), + name: z.string(), }) .transform(d => ({ name: d.name, })); -export const marshalOptionSpecSchema: z.ZodType = z +export const marshalCreateOptionSpecSchema: z.ZodType = z .object({ name: z.string().optional(), type: z.string().optional(), @@ -1641,7 +1826,7 @@ export const marshalOptionSpecSchema: z.ZodType = z is_copiable: d.isCopiable, })); -export const marshalPolicyFunctionArgumentSchema: z.ZodType = z +export const marshalCreatePolicyFunctionArgumentSchema: z.ZodType = z .object({ arg: z .discriminatedUnion('$case', [ @@ -1655,10 +1840,10 @@ export const marshalPolicyFunctionArgumentSchema: z.ZodType = z ...(d.arg?.$case === 'constant' && {constant: d.arg.constant}), })); -export const marshalPrimaryKeyConstraintSchema: z.ZodType = z +export const marshalCreatePrimaryKeyConstraintSchema: z.ZodType = z .object({ - name: z.string().optional(), - childColumns: z.array(z.string()).optional(), + name: z.string(), + childColumns: z.array(z.string()), timeseriesColumns: z.array(z.string()).optional(), rely: z.boolean().optional(), }) @@ -1669,12 +1854,12 @@ export const marshalPrimaryKeyConstraintSchema: z.ZodType = z rely: d.rely, })); -export const marshalRowFilterSchema: z.ZodType = z +export const marshalCreateRowFilterSchema: z.ZodType = z .object({ - functionName: z.string().optional(), - inputColumnNames: z.array(z.string()).optional(), + functionName: z.string(), + inputColumnNames: z.array(z.string()), inputArguments: z - .array(z.lazy(() => marshalPolicyFunctionArgumentSchema)) + .array(z.lazy(() => marshalCreatePolicyFunctionArgumentSchema)) .optional(), }) .transform(d => ({ @@ -1683,12 +1868,12 @@ export const marshalRowFilterSchema: z.ZodType = z input_arguments: d.inputArguments, })); -export const marshalSecurableKindManifestSchema: z.ZodType = z +export const marshalCreateSecurableKindManifestSchema: z.ZodType = z .object({ securableType: z.string().optional(), securableKind: z.string().optional(), assignablePrivileges: z.array(z.string()).optional(), - options: z.array(z.lazy(() => marshalOptionSpecSchema)).optional(), + options: z.array(z.lazy(() => marshalCreateOptionSpecSchema)).optional(), capabilities: z.array(z.string()).optional(), }) .transform(d => ({ @@ -1699,7 +1884,7 @@ export const marshalSecurableKindManifestSchema: z.ZodType = z capabilities: d.capabilities, })); -export const marshalSseEncryptionDetailsSchema: z.ZodType = z +export const marshalCreateSseEncryptionDetailsSchema: z.ZodType = z .object({ algorithm: z.string().optional(), awsKmsKeyArn: z.string().optional(), @@ -1709,21 +1894,27 @@ export const marshalSseEncryptionDetailsSchema: z.ZodType = z aws_kms_key_arn: d.awsKmsKeyArn, })); -export const marshalTableConstraintSchema: z.ZodType = z +export const marshalCreateTableConstraintSchema: z.ZodType = z .object({ constraint: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('primaryKeyConstraint'), - primaryKeyConstraint: z.lazy(() => marshalPrimaryKeyConstraintSchema), + primaryKeyConstraint: z.lazy( + () => marshalCreatePrimaryKeyConstraintSchema + ), }), z.object({ $case: z.literal('foreignKeyConstraint'), - foreignKeyConstraint: z.lazy(() => marshalForeignKeyConstraintSchema), + foreignKeyConstraint: z.lazy( + () => marshalCreateForeignKeyConstraintSchema + ), }), z.object({ $case: z.literal('namedTableConstraint'), - namedTableConstraint: z.lazy(() => marshalNamedTableConstraintSchema), + namedTableConstraint: z.lazy( + () => marshalCreateNamedTableConstraintSchema + ), }), ]) .optional(), @@ -1740,14 +1931,109 @@ export const marshalTableConstraintSchema: z.ZodType = z }), })); -export const marshalTableDependencySchema: z.ZodType = z +export const marshalCreateTableConstraintRequestSchema: z.ZodType = z .object({ - tableFullName: z.string().optional(), + fullNameArg: z.string().optional(), + constraint: z.lazy(() => marshalCreateTableConstraintSchema).optional(), + }) + .transform(d => ({ + full_name_arg: d.fullNameArg, + constraint: d.constraint, + })); + +export const marshalCreateTableDependencySchema: z.ZodType = z + .object({ + tableFullName: z.string(), }) .transform(d => ({ table_full_name: d.tableFullName, })); +export const marshalCreateTableRequestSchema: z.ZodType = z + .object({ + name: z.string().optional(), + catalogName: z.string().optional(), + schemaName: z.string().optional(), + tableType: z.string().optional(), + dataSourceFormat: z.string().optional(), + storageLocation: z.string().optional(), + viewDefinition: z.string().optional(), + viewDependencies: z + .lazy(() => marshalCreateDependencyListSchema) + .optional(), + sqlPath: z.string().optional(), + owner: z.string().optional(), + comment: z.string().optional(), + storageCredentialName: z.string().optional(), + tableConstraints: z + .array(z.lazy(() => marshalCreateTableConstraintSchema)) + .optional(), + rowFilter: z.lazy(() => marshalCreateRowFilterSchema).optional(), + pipelineId: z.string().optional(), + enablePredictiveOptimization: z.string().optional(), + metastoreId: z.string().optional(), + fullName: z.string().optional(), + dataAccessConfigurationId: z.string().optional(), + createdAt: z.bigint().optional(), + createdBy: z.string().optional(), + updatedAt: z.bigint().optional(), + updatedBy: z.string().optional(), + tableId: z.string().optional(), + deltaRuntimePropertiesKvpairs: z + .lazy(() => marshalCreateDeltaRuntimePropertiesKvPairsSchema) + .optional(), + deletedAt: z.bigint().optional(), + effectivePredictiveOptimizationFlag: z + .lazy(() => marshalCreateEffectivePredictiveOptimizationFlagSchema) + .optional(), + accessPoint: z.string().optional(), + browseOnly: z.boolean().optional(), + encryptionDetails: z + .lazy(() => marshalCreateEncryptionDetailsSchema) + .optional(), + securableKindManifest: z + .lazy(() => marshalCreateSecurableKindManifestSchema) + .optional(), + columns: z.array(z.lazy(() => marshalCreateColumnInfoSchema)).optional(), + properties: z.record(z.string(), z.string()).optional(), + }) + .transform(d => ({ + name: d.name, + catalog_name: d.catalogName, + schema_name: d.schemaName, + table_type: d.tableType, + data_source_format: d.dataSourceFormat, + storage_location: d.storageLocation, + view_definition: d.viewDefinition, + view_dependencies: d.viewDependencies, + sql_path: d.sqlPath, + owner: d.owner, + comment: d.comment, + storage_credential_name: d.storageCredentialName, + table_constraints: d.tableConstraints, + row_filter: d.rowFilter, + pipeline_id: d.pipelineId, + enable_predictive_optimization: d.enablePredictiveOptimization, + metastore_id: d.metastoreId, + full_name: d.fullName, + data_access_configuration_id: d.dataAccessConfigurationId, + created_at: d.createdAt, + created_by: d.createdBy, + updated_at: d.updatedAt, + updated_by: d.updatedBy, + table_id: d.tableId, + delta_runtime_properties_kvpairs: d.deltaRuntimePropertiesKvpairs, + deleted_at: d.deletedAt, + effective_predictive_optimization_flag: + d.effectivePredictiveOptimizationFlag, + access_point: d.accessPoint, + browse_only: d.browseOnly, + encryption_details: d.encryptionDetails, + securable_kind_manifest: d.securableKindManifest, + columns: d.columns, + properties: d.properties, + })); + export const marshalUpdateTableRequestSchema: z.ZodType = z .object({ fullNameArg: z.string().optional(), @@ -1758,15 +2044,17 @@ export const marshalUpdateTableRequestSchema: z.ZodType = z dataSourceFormat: z.string().optional(), storageLocation: z.string().optional(), viewDefinition: z.string().optional(), - viewDependencies: z.lazy(() => marshalDependencyListSchema).optional(), + viewDependencies: z + .lazy(() => marshalCreateDependencyListSchema) + .optional(), sqlPath: z.string().optional(), owner: z.string().optional(), comment: z.string().optional(), storageCredentialName: z.string().optional(), tableConstraints: z - .array(z.lazy(() => marshalTableConstraintSchema)) + .array(z.lazy(() => marshalCreateTableConstraintSchema)) .optional(), - rowFilter: z.lazy(() => marshalRowFilterSchema).optional(), + rowFilter: z.lazy(() => marshalCreateRowFilterSchema).optional(), pipelineId: z.string().optional(), enablePredictiveOptimization: z.string().optional(), metastoreId: z.string().optional(), @@ -1778,19 +2066,21 @@ export const marshalUpdateTableRequestSchema: z.ZodType = z updatedBy: z.string().optional(), tableId: z.string().optional(), deltaRuntimePropertiesKvpairs: z - .lazy(() => marshalDeltaRuntimePropertiesKvPairsSchema) + .lazy(() => marshalCreateDeltaRuntimePropertiesKvPairsSchema) .optional(), deletedAt: z.bigint().optional(), effectivePredictiveOptimizationFlag: z - .lazy(() => marshalEffectivePredictiveOptimizationFlagSchema) + .lazy(() => marshalCreateEffectivePredictiveOptimizationFlagSchema) .optional(), accessPoint: z.string().optional(), browseOnly: z.boolean().optional(), - encryptionDetails: z.lazy(() => marshalEncryptionDetailsSchema).optional(), + encryptionDetails: z + .lazy(() => marshalCreateEncryptionDetailsSchema) + .optional(), securableKindManifest: z - .lazy(() => marshalSecurableKindManifestSchema) + .lazy(() => marshalCreateSecurableKindManifestSchema) .optional(), - columns: z.array(z.lazy(() => marshalColumnInfoSchema)).optional(), + columns: z.array(z.lazy(() => marshalCreateColumnInfoSchema)).optional(), properties: z.record(z.string(), z.string()).optional(), }) .transform(d => ({ diff --git a/packages/uc/volumes/src/v1/index.ts b/packages/uc/volumes/src/v1/index.ts index 3768fc94..b961816e 100755 --- a/packages/uc/volumes/src/v1/index.ts +++ b/packages/uc/volumes/src/v1/index.ts @@ -9,6 +9,8 @@ export {VolumesClient} from './client'; export {SseEncryptionAlgorithm, VolumeType} from './model'; export type { + CreateEncryptionDetails, + CreateSseEncryptionDetails, CreateVolumeRequest, DeleteVolumeRequest, DeleteVolumeResponse, diff --git a/packages/uc/volumes/src/v1/model.ts b/packages/uc/volumes/src/v1/model.ts index 85887aee..6ec80cea 100755 --- a/packages/uc/volumes/src/v1/model.ts +++ b/packages/uc/volumes/src/v1/model.ts @@ -21,6 +21,28 @@ export type VolumeType = | (typeof VolumeType)[keyof typeof VolumeType] | (string & {}); +/** Encryption options that apply to clients connecting to cloud storage. */ +export interface CreateEncryptionDetails { + encryptionDetailsType?: + | { + $case: 'sseEncryptionDetails'; + /** Server-Side Encryption properties for clients communicating with AWS s3. */ + sseEncryptionDetails: CreateSseEncryptionDetails; + } + | undefined; +} + +/** Server-Side Encryption properties for clients communicating with AWS s3. */ +export interface CreateSseEncryptionDetails { + /** Sets the value of the 'x-amz-server-side-encryption' header in S3 request. */ + algorithm?: SseEncryptionAlgorithm | undefined; + /** + * Optional. The ARN of the SSE-KMS key used with the S3 location, when algorithm = "SSE-KMS". + * Sets the value of the 'x-amz-server-side-encryption-aws-kms-key-id' header. + */ + awsKmsKeyArn?: string | undefined; +} + export interface CreateVolumeRequest { /** The name of the volume */ name?: string | undefined; @@ -54,7 +76,7 @@ export interface CreateVolumeRequest { updatedBy?: string | undefined; /** The AWS access point to use when accesing s3 for this external location. */ accessPoint?: string | undefined; - encryptionDetails?: EncryptionDetails | undefined; + encryptionDetails?: CreateEncryptionDetails | undefined; /** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */ browseOnly?: boolean | undefined; } @@ -165,7 +187,7 @@ export interface UpdateVolumeRequest { updatedBy?: string | undefined; /** The AWS access point to use when accesing s3 for this external location. */ accessPoint?: string | undefined; - encryptionDetails?: EncryptionDetails | undefined; + encryptionDetails?: CreateEncryptionDetails | undefined; /** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */ browseOnly?: boolean | undefined; } @@ -297,6 +319,35 @@ export const unmarshalVolumeInfoSchema: z.ZodType = z browseOnly: d.browse_only, })); +export const marshalCreateEncryptionDetailsSchema: z.ZodType = z + .object({ + encryptionDetailsType: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('sseEncryptionDetails'), + sseEncryptionDetails: z.lazy( + () => marshalCreateSseEncryptionDetailsSchema + ), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.encryptionDetailsType?.$case === 'sseEncryptionDetails' && { + sse_encryption_details: d.encryptionDetailsType.sseEncryptionDetails, + }), + })); + +export const marshalCreateSseEncryptionDetailsSchema: z.ZodType = z + .object({ + algorithm: z.string().optional(), + awsKmsKeyArn: z.string().optional(), + }) + .transform(d => ({ + algorithm: d.algorithm, + aws_kms_key_arn: d.awsKmsKeyArn, + })); + export const marshalCreateVolumeRequestSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -314,7 +365,9 @@ export const marshalCreateVolumeRequestSchema: z.ZodType = z updatedAt: z.bigint().optional(), updatedBy: z.string().optional(), accessPoint: z.string().optional(), - encryptionDetails: z.lazy(() => marshalEncryptionDetailsSchema).optional(), + encryptionDetails: z + .lazy(() => marshalCreateEncryptionDetailsSchema) + .optional(), browseOnly: z.boolean().optional(), }) .transform(d => ({ @@ -337,33 +390,6 @@ export const marshalCreateVolumeRequestSchema: z.ZodType = z browse_only: d.browseOnly, })); -export const marshalEncryptionDetailsSchema: z.ZodType = z - .object({ - encryptionDetailsType: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('sseEncryptionDetails'), - sseEncryptionDetails: z.lazy(() => marshalSseEncryptionDetailsSchema), - }), - ]) - .optional(), - }) - .transform(d => ({ - ...(d.encryptionDetailsType?.$case === 'sseEncryptionDetails' && { - sse_encryption_details: d.encryptionDetailsType.sseEncryptionDetails, - }), - })); - -export const marshalSseEncryptionDetailsSchema: z.ZodType = z - .object({ - algorithm: z.string().optional(), - awsKmsKeyArn: z.string().optional(), - }) - .transform(d => ({ - algorithm: d.algorithm, - aws_kms_key_arn: d.awsKmsKeyArn, - })); - export const marshalUpdateVolumeRequestSchema: z.ZodType = z .object({ fullNameArg: z.string().optional(), @@ -383,7 +409,9 @@ export const marshalUpdateVolumeRequestSchema: z.ZodType = z updatedAt: z.bigint().optional(), updatedBy: z.string().optional(), accessPoint: z.string().optional(), - encryptionDetails: z.lazy(() => marshalEncryptionDetailsSchema).optional(), + encryptionDetails: z + .lazy(() => marshalCreateEncryptionDetailsSchema) + .optional(), browseOnly: z.boolean().optional(), }) .transform(d => ({ diff --git a/packages/uc/workspacebindings/src/v1/index.ts b/packages/uc/workspacebindings/src/v1/index.ts index 0f261e74..87bfc7cd 100755 --- a/packages/uc/workspacebindings/src/v1/index.ts +++ b/packages/uc/workspacebindings/src/v1/index.ts @@ -9,6 +9,7 @@ export {WorkspaceBindingsClient} from './client'; export {BindingType} from './model'; export type { + CreateWorkspaceBindingInfo, GetCatalogWorkspaceBindingsRequest, GetCatalogWorkspaceBindingsResponse, GetWorkspaceBindingsRequest, diff --git a/packages/uc/workspacebindings/src/v1/model.ts b/packages/uc/workspacebindings/src/v1/model.ts index b1f16183..dcc1c054 100755 --- a/packages/uc/workspacebindings/src/v1/model.ts +++ b/packages/uc/workspacebindings/src/v1/model.ts @@ -13,6 +13,13 @@ export type BindingType = | (typeof BindingType)[keyof typeof BindingType] | (string & {}); +export interface CreateWorkspaceBindingInfo { + /** Required */ + workspaceId: bigint; + /** One of READ_WRITE/READ_ONLY. Default is READ_WRITE. */ + bindingType?: BindingType | undefined; +} + export interface GetCatalogWorkspaceBindingsRequest { /** The name of the catalog. */ catalogName?: string | undefined; @@ -74,9 +81,9 @@ export interface UpdateWorkspaceBindingsRequest { * different binding_type, adding it again with a new binding_type will update the existing * binding (e.g., from READ_WRITE to READ_ONLY). */ - add?: WorkspaceBindingInfo[] | undefined; + add?: CreateWorkspaceBindingInfo[] | undefined; /** List of workspace bindings to remove. */ - remove?: WorkspaceBindingInfo[] | undefined; + remove?: CreateWorkspaceBindingInfo[] | undefined; } /** A list of workspace IDs that are bound to the securable */ @@ -152,6 +159,16 @@ export const unmarshalWorkspaceBindingInfoSchema: z.ZodType ({ + workspace_id: d.workspaceId, + binding_type: d.bindingType, + })); + export const marshalUpdateCatalogWorkspaceBindingsRequestSchema: z.ZodType = z .object({ catalogName: z.string().optional(), @@ -168,8 +185,12 @@ export const marshalUpdateWorkspaceBindingsRequestSchema: z.ZodType = z .object({ securableType: z.string().optional(), securableFullName: z.string().optional(), - add: z.array(z.lazy(() => marshalWorkspaceBindingInfoSchema)).optional(), - remove: z.array(z.lazy(() => marshalWorkspaceBindingInfoSchema)).optional(), + add: z + .array(z.lazy(() => marshalCreateWorkspaceBindingInfoSchema)) + .optional(), + remove: z + .array(z.lazy(() => marshalCreateWorkspaceBindingInfoSchema)) + .optional(), }) .transform(d => ({ securable_type: d.securableType, @@ -177,13 +198,3 @@ export const marshalUpdateWorkspaceBindingsRequestSchema: z.ZodType = z add: d.add, remove: d.remove, })); - -export const marshalWorkspaceBindingInfoSchema: z.ZodType = z - .object({ - workspaceId: z.bigint().optional(), - bindingType: z.string().optional(), - }) - .transform(d => ({ - workspace_id: d.workspaceId, - binding_type: d.bindingType, - })); diff --git a/packages/vectorsearch/src/v1/index.ts b/packages/vectorsearch/src/v1/index.ts index 07ce6616..5b253b9a 100755 --- a/packages/vectorsearch/src/v1/index.ts +++ b/packages/vectorsearch/src/v1/index.ts @@ -18,7 +18,15 @@ export { export type { ColumnInfo, + CreateCustomTag, + CreateDeltaSyncVectorIndexSpecRequest, + CreateDirectAccessVectorIndexSpec, + CreateEmbeddingSourceColumn, + CreateEmbeddingVectorColumn, CreateEndpointRequest, + CreateMetric, + CreateMetricLabel, + CreateRerankerConfig, CreateVectorIndexRequest, CustomTag, DeleteDataVectorIndexRequest, @@ -56,6 +64,7 @@ export type { QueryVectorIndexRequest, QueryVectorIndexResponse, RerankerConfig, + RerankerConfig_CreateRerankerParameters, RerankerConfig_RerankerParameters, ResultData, ResultManifest, diff --git a/packages/vectorsearch/src/v1/model.ts b/packages/vectorsearch/src/v1/model.ts index 24ae016e..7b9da369 100755 --- a/packages/vectorsearch/src/v1/model.ts +++ b/packages/vectorsearch/src/v1/model.ts @@ -122,6 +122,80 @@ export interface ColumnInfo { typeText?: string | undefined; } +export interface CreateCustomTag { + /** Key field for an AI Search endpoint tag. */ + key: string; + /** [Optional] Value field for an AI Search endpoint tag. */ + value?: string | undefined; +} + +export interface CreateDeltaSyncVectorIndexSpecRequest { + /** The name of the source table. */ + sourceTable?: string | undefined; + /** The columns that contain the embedding source. */ + embeddingSourceColumns?: CreateEmbeddingSourceColumn[] | undefined; + /** The columns that contain the embedding vectors. */ + embeddingVectorColumns?: CreateEmbeddingVectorColumn[] | undefined; + /** + * Pipeline execution mode. + * - `TRIGGERED`: If the pipeline uses the triggered execution mode, the system stops processing after successfully refreshing the source table in the pipeline once, ensuring the table is updated based on the data available when the update started. + * - `CONTINUOUS`: If the pipeline uses continuous execution, the pipeline processes new data as it arrives in the source table to keep vector index fresh. + */ + pipelineType?: PipelineType | undefined; + /** The ID of the pipeline that is used to sync the index. */ + pipelineId?: string | undefined; + /** [Optional] Name of the Delta table to sync the vector index contents and computed embeddings to. */ + embeddingWritebackTable?: string | undefined; + /** + * [Optional] Select the columns to sync with the vector index. If you leave this field blank, all columns + * from the source table are synced with the index. The primary key column and embedding source column or + * embedding vector column are always synced. + */ + columnsToSync?: string[] | undefined; + /** + * [Optional] Alias for columns_to_sync. Select the columns to include in the vector index. + * If you leave this field blank, all columns from the source table are included. + * The primary key column and embedding source column or embedding vector column are always included. + * Only one of columns_to_sync or columns_to_index may be specified. + */ + columnsToIndex?: string[] | undefined; +} + +export interface CreateDirectAccessVectorIndexSpec { + /** The columns that contain the embedding vectors. The format should be array[double]. */ + embeddingVectorColumns?: CreateEmbeddingVectorColumn[] | undefined; + /** + * The schema of the index in JSON format. + * Supported types are `integer`, `long`, `float`, `double`, `boolean`, `string`, `date`, `timestamp`. + * Supported types for vector column: `array`, `array`,`. + */ + schemaJson?: string | undefined; + /** The columns that contain the embedding source. The format should be array[double]. */ + embeddingSourceColumns?: CreateEmbeddingSourceColumn[] | undefined; +} + +export interface CreateEmbeddingSourceColumn { + /** Name of the column */ + name?: string | undefined; + /** TODO: clean up ai gateway related code. It's deprecated on ModelServing side. */ + embeddingConfig?: + | { + $case: 'embeddingModelEndpointName'; + /** Name of the embedding model endpoint, used by default for both ingestion and querying. */ + embeddingModelEndpointName: string; + } + | undefined; + /** Name of the embedding model endpoint which, if specified, is used for querying (not ingestion). */ + modelEndpointNameForQuery?: string | undefined; +} + +export interface CreateEmbeddingVectorColumn { + /** Name of the column */ + name?: string | undefined; + /** Dimension of the embedding vector */ + embeddingDimension?: number | undefined; +} + export interface CreateEndpointRequest { /** Name of the AI Search endpoint */ name?: string | undefined; @@ -139,6 +213,35 @@ export interface CreateEndpointRequest { targetQps?: bigint | undefined; } +/** Metric specification */ +export interface CreateMetric { + /** Metric name */ + name?: string | undefined; + /** Metric labels */ + labels?: CreateMetricLabel[] | undefined; + /** Percentile for the metric */ + percentile?: number | undefined; +} + +/** Label for a metric */ +export interface CreateMetricLabel { + /** Label name */ + name?: string | undefined; + /** Label value */ + value?: string | undefined; +} + +export interface CreateRerankerConfig { + /** + * Reranker identifier: + * - When model_type=BASE/UNSPECIFIED: must be "databricks_reranker". + * - When model_type=FINETUNED: the Model Serving endpoint name hosting a finetuned reranker. + */ + model?: string | undefined; + /** Parameters that control how the reranker processes the query results. */ + parameters?: RerankerConfig_CreateRerankerParameters | undefined; +} + export interface CreateVectorIndexRequest { /** Name of the index */ name?: string | undefined; @@ -151,12 +254,12 @@ export interface CreateVectorIndexRequest { | { $case: 'directAccessIndexSpec'; /** Specification for Direct Vector Access Index. Required if `index_type` is `DIRECT_ACCESS`. */ - directAccessIndexSpec: DirectAccessVectorIndexSpec; + directAccessIndexSpec: CreateDirectAccessVectorIndexSpec; } | { $case: 'deltaSyncIndexSpec'; /** Specification for Delta Sync Index. Required if `index_type` is `DELTA_SYNC`. */ - deltaSyncIndexSpec: DeltaSyncVectorIndexSpecRequest; + deltaSyncIndexSpec: CreateDeltaSyncVectorIndexSpecRequest; } | undefined; /** The subtype of the index. Use `HYBRID` or `FULL_TEXT`. `VECTOR` is not supported. */ @@ -538,7 +641,7 @@ export interface QueryVectorIndexRequest { * The setting `columns_to_rerank` selects which columns are used for reranking. For each datapoint, the columns selected are concatenated before * being sent to the reranking model. See https://docs.databricks.com/aws/en/vector-search/query-vector-search#rerank for more information. */ - reranker?: RerankerConfig | undefined; + reranker?: CreateRerankerConfig | undefined; /** Text columns to search for `query_text`. When empty, all text columns are searched. */ queryColumns?: string[] | undefined; /** @@ -583,6 +686,11 @@ export interface RerankerConfig { parameters?: RerankerConfig_RerankerParameters | undefined; } +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export interface RerankerConfig_CreateRerankerParameters { + columnsToRerank?: string[] | undefined; +} + // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export interface RerankerConfig_RerankerParameters { columnsToRerank?: string[] | undefined; @@ -619,7 +727,7 @@ export interface RetrieveUserVisibleMetricsRequest { /** Granularity in seconds */ granularityInSeconds?: number | undefined; /** List of metrics to retrieve */ - metrics?: Metric[] | undefined; + metrics?: CreateMetric[] | undefined; /** Token for pagination */ pageToken?: string | undefined; } @@ -666,7 +774,7 @@ export interface UpdateEndpointCustomTagsRequest { /** Name of the AI Search endpoint */ name?: string | undefined; /** The new custom tags for the AI Search endpoint */ - customTags?: CustomTag[] | undefined; + customTags?: CreateCustomTag[] | undefined; } export interface UpdateEndpointCustomTagsResponse { @@ -1260,63 +1368,9 @@ export const unmarshalVectorIndexStatusSchema: z.ZodType = z indexUrl: d.index_url, })); -export const marshalCreateEndpointRequestSchema: z.ZodType = z +export const marshalCreateCustomTagSchema: z.ZodType = z .object({ - name: z.string().optional(), - endpointType: z.string().optional(), - budgetPolicyId: z.string().optional(), - usagePolicyId: z.string().optional(), - targetQps: z.bigint().optional(), - }) - .transform(d => ({ - name: d.name, - endpoint_type: d.endpointType, - budget_policy_id: d.budgetPolicyId, - usage_policy_id: d.usagePolicyId, - target_qps: d.targetQps, - })); - -export const marshalCreateVectorIndexRequestSchema: z.ZodType = z - .object({ - name: z.string().optional(), - endpointName: z.string().optional(), - primaryKey: z.string().optional(), - indexType: z.string().optional(), - indexSpec: z - .discriminatedUnion('$case', [ - z.object({ - $case: z.literal('directAccessIndexSpec'), - directAccessIndexSpec: z.lazy( - () => marshalDirectAccessVectorIndexSpecSchema - ), - }), - z.object({ - $case: z.literal('deltaSyncIndexSpec'), - deltaSyncIndexSpec: z.lazy( - () => marshalDeltaSyncVectorIndexSpecRequestSchema - ), - }), - ]) - .optional(), - indexSubtype: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - endpoint_name: d.endpointName, - primary_key: d.primaryKey, - index_type: d.indexType, - ...(d.indexSpec?.$case === 'directAccessIndexSpec' && { - direct_access_index_spec: d.indexSpec.directAccessIndexSpec, - }), - ...(d.indexSpec?.$case === 'deltaSyncIndexSpec' && { - delta_sync_index_spec: d.indexSpec.deltaSyncIndexSpec, - }), - index_subtype: d.indexSubtype, - })); - -export const marshalCustomTagSchema: z.ZodType = z - .object({ - key: z.string().optional(), + key: z.string(), value: z.string().optional(), }) .transform(d => ({ @@ -1324,14 +1378,14 @@ export const marshalCustomTagSchema: z.ZodType = z value: d.value, })); -export const marshalDeltaSyncVectorIndexSpecRequestSchema: z.ZodType = z +export const marshalCreateDeltaSyncVectorIndexSpecRequestSchema: z.ZodType = z .object({ sourceTable: z.string().optional(), embeddingSourceColumns: z - .array(z.lazy(() => marshalEmbeddingSourceColumnSchema)) + .array(z.lazy(() => marshalCreateEmbeddingSourceColumnSchema)) .optional(), embeddingVectorColumns: z - .array(z.lazy(() => marshalEmbeddingVectorColumnSchema)) + .array(z.lazy(() => marshalCreateEmbeddingVectorColumnSchema)) .optional(), pipelineType: z.string().optional(), pipelineId: z.string().optional(), @@ -1350,14 +1404,14 @@ export const marshalDeltaSyncVectorIndexSpecRequestSchema: z.ZodType = z columns_to_index: d.columnsToIndex, })); -export const marshalDirectAccessVectorIndexSpecSchema: z.ZodType = z +export const marshalCreateDirectAccessVectorIndexSpecSchema: z.ZodType = z .object({ embeddingVectorColumns: z - .array(z.lazy(() => marshalEmbeddingVectorColumnSchema)) + .array(z.lazy(() => marshalCreateEmbeddingVectorColumnSchema)) .optional(), schemaJson: z.string().optional(), embeddingSourceColumns: z - .array(z.lazy(() => marshalEmbeddingSourceColumnSchema)) + .array(z.lazy(() => marshalCreateEmbeddingSourceColumnSchema)) .optional(), }) .transform(d => ({ @@ -1366,7 +1420,7 @@ export const marshalDirectAccessVectorIndexSpecSchema: z.ZodType = z embedding_source_columns: d.embeddingSourceColumns, })); -export const marshalEmbeddingSourceColumnSchema: z.ZodType = z +export const marshalCreateEmbeddingSourceColumnSchema: z.ZodType = z .object({ name: z.string().optional(), embeddingConfig: z @@ -1388,7 +1442,7 @@ export const marshalEmbeddingSourceColumnSchema: z.ZodType = z model_endpoint_name_for_query: d.modelEndpointNameForQuery, })); -export const marshalEmbeddingVectorColumnSchema: z.ZodType = z +export const marshalCreateEmbeddingVectorColumnSchema: z.ZodType = z .object({ name: z.string().optional(), embeddingDimension: z.number().optional(), @@ -1398,10 +1452,26 @@ export const marshalEmbeddingVectorColumnSchema: z.ZodType = z embedding_dimension: d.embeddingDimension, })); -export const marshalMetricSchema: z.ZodType = z +export const marshalCreateEndpointRequestSchema: z.ZodType = z .object({ name: z.string().optional(), - labels: z.array(z.lazy(() => marshalMetricLabelSchema)).optional(), + endpointType: z.string().optional(), + budgetPolicyId: z.string().optional(), + usagePolicyId: z.string().optional(), + targetQps: z.bigint().optional(), + }) + .transform(d => ({ + name: d.name, + endpoint_type: d.endpointType, + budget_policy_id: d.budgetPolicyId, + usage_policy_id: d.usagePolicyId, + target_qps: d.targetQps, + })); + +export const marshalCreateMetricSchema: z.ZodType = z + .object({ + name: z.string().optional(), + labels: z.array(z.lazy(() => marshalCreateMetricLabelSchema)).optional(), percentile: z.number().optional(), }) .transform(d => ({ @@ -1410,7 +1480,7 @@ export const marshalMetricSchema: z.ZodType = z percentile: d.percentile, })); -export const marshalMetricLabelSchema: z.ZodType = z +export const marshalCreateMetricLabelSchema: z.ZodType = z .object({ name: z.string().optional(), value: z.string().optional(), @@ -1420,6 +1490,56 @@ export const marshalMetricLabelSchema: z.ZodType = z value: d.value, })); +export const marshalCreateRerankerConfigSchema: z.ZodType = z + .object({ + model: z.string().optional(), + parameters: z + .lazy(() => marshalRerankerConfig_CreateRerankerParametersSchema) + .optional(), + }) + .transform(d => ({ + model: d.model, + parameters: d.parameters, + })); + +export const marshalCreateVectorIndexRequestSchema: z.ZodType = z + .object({ + name: z.string().optional(), + endpointName: z.string().optional(), + primaryKey: z.string().optional(), + indexType: z.string().optional(), + indexSpec: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('directAccessIndexSpec'), + directAccessIndexSpec: z.lazy( + () => marshalCreateDirectAccessVectorIndexSpecSchema + ), + }), + z.object({ + $case: z.literal('deltaSyncIndexSpec'), + deltaSyncIndexSpec: z.lazy( + () => marshalCreateDeltaSyncVectorIndexSpecRequestSchema + ), + }), + ]) + .optional(), + indexSubtype: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + endpoint_name: d.endpointName, + primary_key: d.primaryKey, + index_type: d.indexType, + ...(d.indexSpec?.$case === 'directAccessIndexSpec' && { + direct_access_index_spec: d.indexSpec.directAccessIndexSpec, + }), + ...(d.indexSpec?.$case === 'deltaSyncIndexSpec' && { + delta_sync_index_spec: d.indexSpec.deltaSyncIndexSpec, + }), + index_subtype: d.indexSubtype, + })); + export const marshalPatchEndpointBudgetPolicyRequestSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -1463,7 +1583,7 @@ export const marshalQueryVectorIndexRequestSchema: z.ZodType = z scoreThreshold: z.number().optional(), queryType: z.string().optional(), columnsToRerank: z.array(z.string()).optional(), - reranker: z.lazy(() => marshalRerankerConfigSchema).optional(), + reranker: z.lazy(() => marshalCreateRerankerConfigSchema).optional(), queryColumns: z.array(z.string()).optional(), sortColumns: z.array(z.string()).optional(), facets: z.array(z.string()).optional(), @@ -1484,20 +1604,8 @@ export const marshalQueryVectorIndexRequestSchema: z.ZodType = z facets: d.facets, })); -export const marshalRerankerConfigSchema: z.ZodType = z - .object({ - model: z.string().optional(), - parameters: z - .lazy(() => marshalRerankerConfig_RerankerParametersSchema) - .optional(), - }) - .transform(d => ({ - model: d.model, - parameters: d.parameters, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalRerankerConfig_RerankerParametersSchema: z.ZodType = z +export const marshalRerankerConfig_CreateRerankerParametersSchema: z.ZodType = z .object({ columnsToRerank: z.array(z.string()).optional(), }) @@ -1517,7 +1625,7 @@ export const marshalRetrieveUserVisibleMetricsRequestSchema: z.ZodType = z .transform((d: Temporal.Instant) => d.toString()) .optional(), granularityInSeconds: z.number().optional(), - metrics: z.array(z.lazy(() => marshalMetricSchema)).optional(), + metrics: z.array(z.lazy(() => marshalCreateMetricSchema)).optional(), pageToken: z.string().optional(), }) .transform(d => ({ @@ -1552,7 +1660,7 @@ export const marshalSyncVectorIndexRequestSchema: z.ZodType = z export const marshalUpdateEndpointCustomTagsRequestSchema: z.ZodType = z .object({ name: z.string().optional(), - customTags: z.array(z.lazy(() => marshalCustomTagSchema)).optional(), + customTags: z.array(z.lazy(() => marshalCreateCustomTagSchema)).optional(), }) .transform(d => ({ name: d.name, diff --git a/packages/warehouses/src/v1/client.ts b/packages/warehouses/src/v1/client.ts index e78063a5..59df3665 100755 --- a/packages/warehouses/src/v1/client.ts +++ b/packages/warehouses/src/v1/client.ts @@ -49,12 +49,13 @@ import type { } from './model'; import { EndpointState, + marshalCreateDefaultWarehouseOverrideSchema, marshalCreateWarehouseRequestSchema, - marshalDefaultWarehouseOverrideSchema, marshalEditWarehouseRequestSchema, marshalSetWorkspaceWarehouseConfigRequestSchema, marshalStartRequestSchema, marshalStopRequestSchema, + marshalUpdateDefaultWarehouseOverrideSchema, unmarshalCreateWarehouseResponseSchema, unmarshalDefaultWarehouseOverrideSchema, unmarshalDeleteWarehouseResponseSchema, @@ -122,7 +123,7 @@ export class WarehousesClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.defaultWarehouseOverride, - marshalDefaultWarehouseOverrideSchema + marshalCreateDefaultWarehouseOverrideSchema ); let resp: DefaultWarehouseOverride | undefined; const call = async (callSignal?: AbortSignal): Promise => { @@ -646,7 +647,7 @@ export class WarehousesClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.defaultWarehouseOverride, - marshalDefaultWarehouseOverrideSchema + marshalUpdateDefaultWarehouseOverrideSchema ); let resp: DefaultWarehouseOverride | undefined; const call = async (callSignal?: AbortSignal): Promise => { diff --git a/packages/warehouses/src/v1/index.ts b/packages/warehouses/src/v1/index.ts index 79e7c779..36c0c9b3 100755 --- a/packages/warehouses/src/v1/index.ts +++ b/packages/warehouses/src/v1/index.ts @@ -26,9 +26,16 @@ export { export type { Channel, + CreateChannel, + CreateDefaultWarehouseOverride, CreateDefaultWarehouseOverrideRequest, + CreateEndpointConfPair, + CreateEndpointTagPair, + CreateEndpointTags, + CreateRepeatedEndpointConfPairs, CreateWarehouseRequest, CreateWarehouseResponse, + CreateWarehouseTypePair, DefaultWarehouseOverride, DeleteDefaultWarehouseOverrideRequest, DeleteWarehouseResponse, @@ -54,6 +61,7 @@ export type { StartResponse, StopResponse, TerminationReason, + UpdateDefaultWarehouseOverride, UpdateDefaultWarehouseOverrideRequest, WarehouseTypePair, DeleteWarehouseRequest, @@ -62,4 +70,4 @@ export type { StopRequest, } from './model'; -export {defaultWarehouseOverrideFieldMask} from './model'; +export {updateDefaultWarehouseOverrideFieldMask} from './model'; diff --git a/packages/warehouses/src/v1/model.ts b/packages/warehouses/src/v1/model.ts index 2567c2a0..e6a124be 100755 --- a/packages/warehouses/src/v1/model.ts +++ b/packages/warehouses/src/v1/model.ts @@ -765,6 +765,33 @@ export interface Channel { dbsqlVersion?: string | undefined; } +/** Configures the channel name and DBSQL version of the warehouse. CHANNEL_NAME_CUSTOM should be chosen only when `dbsql_version` is specified. */ +export interface CreateChannel { + name?: ChannelName | undefined; + dbsqlVersion?: string | undefined; +} + +/** + * Represents a per-user default warehouse override configuration. + * This resource allows users or administrators to customize how a user's + * default warehouse is selected for SQL operations. + * If no override exists for a user, the workspace default warehouse will be used. + */ +export interface CreateDefaultWarehouseOverride { + /** + * The resource name of the default warehouse override. + * Format: default-warehouse-overrides/{default_warehouse_override_id} + */ + name?: string | undefined; + /** The type of override behavior. */ + type: DefaultWarehouseOverrideType; + /** + * The specific warehouse ID when type is CUSTOM. + * Not set for LAST_SELECTED type. + */ + warehouseId?: string | undefined; +} + /** Request message for CreateDefaultWarehouseOverride. */ export interface CreateDefaultWarehouseOverrideRequest { /** @@ -774,7 +801,27 @@ export interface CreateDefaultWarehouseOverrideRequest { */ defaultWarehouseOverrideId?: string | undefined; /** Required. The default warehouse override to create. */ - defaultWarehouseOverride?: DefaultWarehouseOverride | undefined; + defaultWarehouseOverride?: CreateDefaultWarehouseOverride | undefined; +} + +export interface CreateEndpointConfPair { + key?: string | undefined; + value?: string | undefined; +} + +export interface CreateEndpointTagPair { + key?: string | undefined; + value?: string | undefined; +} + +export interface CreateEndpointTags { + customTags?: CreateEndpointTagPair[] | undefined; +} + +export interface CreateRepeatedEndpointConfPairs { + /** Deprecated: Use configuration_pairs */ + configPair?: CreateEndpointConfPair[] | undefined; + configurationPairs?: CreateEndpointConfPair[] | undefined; } /** Creates a new SQL warehouse. */ @@ -854,7 +901,7 @@ export interface CreateWarehouseRequest { * Supported values: * - Number of tags < 45. */ - tags?: EndpointTags | undefined; + tags?: CreateEndpointTags | undefined; /** Configurations whether the endpoint should use spot instances. */ spotInstancePolicy?: EndpointSpotInstancePolicy | undefined; /** @@ -864,7 +911,7 @@ export interface CreateWarehouseRequest { */ enablePhoton?: boolean | undefined; /** Channel Details */ - channel?: Channel | undefined; + channel?: CreateChannel | undefined; /** Configures whether the warehouse should use serverless compute */ enableServerlessCompute?: boolean | undefined; /** @@ -882,6 +929,20 @@ export interface CreateWarehouseResponse { id?: string | undefined; } +/** + * * + * Configuration values to enable or disable the access to specific warehouse + * types in the workspace. + */ +export interface CreateWarehouseTypePair { + warehouseType?: WarehouseType | undefined; + /** + * If set to false the specific warehouse type will not be allowed as a + * value for warehouse_type in CreateWarehouse and EditWarehouse + */ + enabled?: boolean | undefined; +} + /** * Represents a per-user default warehouse override configuration. * This resource allows users or administrators to customize how a user's @@ -1001,7 +1062,7 @@ export interface EditWarehouseRequest { * Supported values: * - Number of tags < 45. */ - tags?: EndpointTags | undefined; + tags?: CreateEndpointTags | undefined; /** Configurations whether the endpoint should use spot instances. */ spotInstancePolicy?: EndpointSpotInstancePolicy | undefined; /** @@ -1011,7 +1072,7 @@ export interface EditWarehouseRequest { */ enablePhoton?: boolean | undefined; /** Channel Details */ - channel?: Channel | undefined; + channel?: CreateChannel | undefined; /** Configures whether the warehouse should use serverless compute */ enableServerlessCompute?: boolean | undefined; /** @@ -1400,7 +1461,7 @@ export interface SetWorkspaceWarehouseConfigRequest { * Spark confs for external hive metastore configuration * JSON serialized size must be less than <= 512K */ - dataAccessConfig?: EndpointConfPair[] | undefined; + dataAccessConfig?: CreateEndpointConfPair[] | undefined; /** * AWS Only: The instance profile used to pass an IAM role to the SQL * warehouses. This configuration is also applied to the workspace's @@ -1408,15 +1469,15 @@ export interface SetWorkspaceWarehouseConfigRequest { */ instanceProfileArn?: string | undefined; /** Optional: Channel selection details */ - channel?: Channel | undefined; + channel?: CreateChannel | undefined; /** Deprecated: only setting this to true is allowed. */ enableServerlessCompute?: boolean | undefined; /** Deprecated: Use sql_configuration_parameters */ - globalParam?: RepeatedEndpointConfPairs | undefined; + globalParam?: CreateRepeatedEndpointConfPairs | undefined; /** Deprecated: Use sql_configuration_parameters */ - configParam?: RepeatedEndpointConfPairs | undefined; + configParam?: CreateRepeatedEndpointConfPairs | undefined; /** SQL configuration parameters */ - sqlConfigurationParameters?: RepeatedEndpointConfPairs | undefined; + sqlConfigurationParameters?: CreateRepeatedEndpointConfPairs | undefined; /** * GCP only: Google Service Account used to pass to cluster to access Google * Cloud Storage @@ -1431,7 +1492,7 @@ export interface SetWorkspaceWarehouseConfigRequest { * another type. Used by frontend to save specific type availability in the * warehouse create and edit form UI. */ - enabledWarehouseTypes?: WarehouseTypePair[] | undefined; + enabledWarehouseTypes?: CreateWarehouseTypePair[] | undefined; } // eslint-disable-next-line @typescript-eslint/no-empty-object-type @@ -1452,6 +1513,27 @@ export interface TerminationReason { parameters?: Record | undefined; } +/** + * Represents a per-user default warehouse override configuration. + * This resource allows users or administrators to customize how a user's + * default warehouse is selected for SQL operations. + * If no override exists for a user, the workspace default warehouse will be used. + */ +export interface UpdateDefaultWarehouseOverride { + /** + * The resource name of the default warehouse override. + * Format: default-warehouse-overrides/{default_warehouse_override_id} + */ + name?: string | undefined; + /** The type of override behavior. */ + type?: DefaultWarehouseOverrideType | undefined; + /** + * The specific warehouse ID when type is CUSTOM. + * Not set for LAST_SELECTED type. + */ + warehouseId?: string | undefined; +} + /** Request message for UpdateDefaultWarehouseOverride. */ export interface UpdateDefaultWarehouseOverrideRequest { /** @@ -1459,14 +1541,14 @@ export interface UpdateDefaultWarehouseOverrideRequest { * The name field must be set in the format: default-warehouse-overrides/{default_warehouse_override_id} * The default_warehouse_override_id can be a numeric user ID or the literal string "me" for the current user. */ - defaultWarehouseOverride?: DefaultWarehouseOverride | undefined; + defaultWarehouseOverride?: UpdateDefaultWarehouseOverride | undefined; /** * Required. Field mask specifying which fields to update. * Only the fields specified in the mask will be updated. * Use "*" to update all fields. * When allow_missing is true, this field is ignored and all fields are applied. */ - updateMask?: FieldMask | undefined; + updateMask?: FieldMask | undefined; /** * If set to true, and the override is not found, a new override will be created. * In this situation, `update_mask` is ignored and all fields are applied. @@ -1848,7 +1930,7 @@ export const unmarshalWarehouseTypePairSchema: z.ZodType = z enabled: d.enabled, })); -export const marshalChannelSchema: z.ZodType = z +export const marshalCreateChannelSchema: z.ZodType = z .object({ name: z.string().optional(), dbsqlVersion: z.string().optional(), @@ -1858,6 +1940,62 @@ export const marshalChannelSchema: z.ZodType = z dbsql_version: d.dbsqlVersion, })); +export const marshalCreateDefaultWarehouseOverrideSchema: z.ZodType = z + .object({ + name: z.string().optional(), + type: z.string(), + warehouseId: z.string().optional(), + }) + .transform(d => ({ + name: d.name, + type: d.type, + warehouse_id: d.warehouseId, + })); + +export const marshalCreateEndpointConfPairSchema: z.ZodType = z + .object({ + key: z.string().optional(), + value: z.string().optional(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); + +export const marshalCreateEndpointTagPairSchema: z.ZodType = z + .object({ + key: z.string().optional(), + value: z.string().optional(), + }) + .transform(d => ({ + key: d.key, + value: d.value, + })); + +export const marshalCreateEndpointTagsSchema: z.ZodType = z + .object({ + customTags: z + .array(z.lazy(() => marshalCreateEndpointTagPairSchema)) + .optional(), + }) + .transform(d => ({ + custom_tags: d.customTags, + })); + +export const marshalCreateRepeatedEndpointConfPairsSchema: z.ZodType = z + .object({ + configPair: z + .array(z.lazy(() => marshalCreateEndpointConfPairSchema)) + .optional(), + configurationPairs: z + .array(z.lazy(() => marshalCreateEndpointConfPairSchema)) + .optional(), + }) + .transform(d => ({ + config_pair: d.configPair, + configuration_pairs: d.configurationPairs, + })); + export const marshalCreateWarehouseRequestSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -1867,10 +2005,10 @@ export const marshalCreateWarehouseRequestSchema: z.ZodType = z autoStopMins: z.number().optional(), creatorName: z.string().optional(), instanceProfileArn: z.string().optional(), - tags: z.lazy(() => marshalEndpointTagsSchema).optional(), + tags: z.lazy(() => marshalCreateEndpointTagsSchema).optional(), spotInstancePolicy: z.string().optional(), enablePhoton: z.boolean().optional(), - channel: z.lazy(() => marshalChannelSchema).optional(), + channel: z.lazy(() => marshalCreateChannelSchema).optional(), enableServerlessCompute: z.boolean().optional(), warehouseType: z.string().optional(), }) @@ -1890,18 +2028,14 @@ export const marshalCreateWarehouseRequestSchema: z.ZodType = z warehouse_type: d.warehouseType, })); -export const marshalDefaultWarehouseOverrideSchema: z.ZodType = z +export const marshalCreateWarehouseTypePairSchema: z.ZodType = z .object({ - name: z.string().optional(), - defaultWarehouseOverrideId: z.string().optional(), - type: z.string().optional(), - warehouseId: z.string().optional(), + warehouseType: z.string().optional(), + enabled: z.boolean().optional(), }) .transform(d => ({ - name: d.name, - default_warehouse_override_id: d.defaultWarehouseOverrideId, - type: d.type, - warehouse_id: d.warehouseId, + warehouse_type: d.warehouseType, + enabled: d.enabled, })); export const marshalEditWarehouseRequestSchema: z.ZodType = z @@ -1914,10 +2048,10 @@ export const marshalEditWarehouseRequestSchema: z.ZodType = z autoStopMins: z.number().optional(), creatorName: z.string().optional(), instanceProfileArn: z.string().optional(), - tags: z.lazy(() => marshalEndpointTagsSchema).optional(), + tags: z.lazy(() => marshalCreateEndpointTagsSchema).optional(), spotInstancePolicy: z.string().optional(), enablePhoton: z.boolean().optional(), - channel: z.lazy(() => marshalChannelSchema).optional(), + channel: z.lazy(() => marshalCreateChannelSchema).optional(), enableServerlessCompute: z.boolean().optional(), warehouseType: z.string().optional(), }) @@ -1938,67 +2072,27 @@ export const marshalEditWarehouseRequestSchema: z.ZodType = z warehouse_type: d.warehouseType, })); -export const marshalEndpointConfPairSchema: z.ZodType = z - .object({ - key: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - -export const marshalEndpointTagPairSchema: z.ZodType = z - .object({ - key: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - -export const marshalEndpointTagsSchema: z.ZodType = z - .object({ - customTags: z.array(z.lazy(() => marshalEndpointTagPairSchema)).optional(), - }) - .transform(d => ({ - custom_tags: d.customTags, - })); - -export const marshalRepeatedEndpointConfPairsSchema: z.ZodType = z - .object({ - configPair: z.array(z.lazy(() => marshalEndpointConfPairSchema)).optional(), - configurationPairs: z - .array(z.lazy(() => marshalEndpointConfPairSchema)) - .optional(), - }) - .transform(d => ({ - config_pair: d.configPair, - configuration_pairs: d.configurationPairs, - })); - export const marshalSetWorkspaceWarehouseConfigRequestSchema: z.ZodType = z .object({ securityPolicy: z.string().optional(), dataAccessConfig: z - .array(z.lazy(() => marshalEndpointConfPairSchema)) + .array(z.lazy(() => marshalCreateEndpointConfPairSchema)) .optional(), instanceProfileArn: z.string().optional(), - channel: z.lazy(() => marshalChannelSchema).optional(), + channel: z.lazy(() => marshalCreateChannelSchema).optional(), enableServerlessCompute: z.boolean().optional(), globalParam: z - .lazy(() => marshalRepeatedEndpointConfPairsSchema) + .lazy(() => marshalCreateRepeatedEndpointConfPairsSchema) .optional(), configParam: z - .lazy(() => marshalRepeatedEndpointConfPairsSchema) + .lazy(() => marshalCreateRepeatedEndpointConfPairsSchema) .optional(), sqlConfigurationParameters: z - .lazy(() => marshalRepeatedEndpointConfPairsSchema) + .lazy(() => marshalCreateRepeatedEndpointConfPairsSchema) .optional(), googleServiceAccount: z.string().optional(), enabledWarehouseTypes: z - .array(z.lazy(() => marshalWarehouseTypePairSchema)) + .array(z.lazy(() => marshalCreateWarehouseTypePairSchema)) .optional(), }) .transform(d => ({ @@ -2014,14 +2108,16 @@ export const marshalSetWorkspaceWarehouseConfigRequestSchema: z.ZodType = z enabled_warehouse_types: d.enabledWarehouseTypes, })); -export const marshalWarehouseTypePairSchema: z.ZodType = z +export const marshalUpdateDefaultWarehouseOverrideSchema: z.ZodType = z .object({ - warehouseType: z.string().optional(), - enabled: z.boolean().optional(), + name: z.string().optional(), + type: z.string().optional(), + warehouseId: z.string().optional(), }) .transform(d => ({ - warehouse_type: d.warehouseType, - enabled: d.enabled, + name: d.name, + type: d.type, + warehouse_id: d.warehouseId, })); export const marshalStartRequestSchema: z.ZodType = z @@ -2040,18 +2136,17 @@ export const marshalStopRequestSchema: z.ZodType = z id: d.id, })); -const defaultWarehouseOverrideFieldMaskSchema: FieldMaskSchema = { - defaultWarehouseOverrideId: {wire: 'default_warehouse_override_id'}, +const updateDefaultWarehouseOverrideFieldMaskSchema: FieldMaskSchema = { name: {wire: 'name'}, type: {wire: 'type'}, warehouseId: {wire: 'warehouse_id'}, }; -export function defaultWarehouseOverrideFieldMask( +export function updateDefaultWarehouseOverrideFieldMask( ...paths: string[] -): FieldMask { - return FieldMask.build( +): FieldMask { + return FieldMask.build( paths, - defaultWarehouseOverrideFieldMaskSchema + updateDefaultWarehouseOverrideFieldMaskSchema ); } diff --git a/packages/workspaces/src/v1/client.ts b/packages/workspaces/src/v1/client.ts index 74ce269a..e927bbd2 100644 --- a/packages/workspaces/src/v1/client.ts +++ b/packages/workspaces/src/v1/client.ts @@ -32,7 +32,7 @@ import type { import { WorkspaceStatus, marshalCreateWorkspaceRequestSchema, - marshalWorkspaceSchema, + marshalUpdateWorkspaceSchema, unmarshalWorkspaceSchema, } from './model'; @@ -235,7 +235,7 @@ export class WorkspacesClient { const fullUrl = query !== '' ? `${url}?${query}` : url; const body = marshalRequest( req.customerFacingWorkspace, - marshalWorkspaceSchema + marshalUpdateWorkspaceSchema ); let resp: Workspace | undefined; const call = async (callSignal?: AbortSignal): Promise => { diff --git a/packages/workspaces/src/v1/index.ts b/packages/workspaces/src/v1/index.ts index 422f5db0..decf47f0 100755 --- a/packages/workspaces/src/v1/index.ts +++ b/packages/workspaces/src/v1/index.ts @@ -21,6 +21,10 @@ export { export type { AzureWorkspaceInfo, CloudResourceContainer, + CreateCloudResourceContainer, + CreateGcpCloudResourceContainer, + CreateGcpManagedNetworkConfig, + CreateGkeConfig, CreateWorkspaceRequest, DeleteWorkspaceRequest, GcpCloudResourceContainer, @@ -30,9 +34,16 @@ export type { GkeConfig, ListWorkspacesRequest, ListWorkspacesResponse, + UpdateCloudResourceContainer, + UpdateGcpCloudResourceContainer, + UpdateGcpCommonNetworkConfig, + UpdateGcpManagedNetworkConfig, + UpdateGkeConfig, + UpdateWorkspace, + UpdateWorkspaceNetwork, UpdateWorkspaceRequest, Workspace, WorkspaceNetwork, } from './model'; -export {workspaceFieldMask} from './model'; +export {updateWorkspaceFieldMask} from './model'; diff --git a/packages/workspaces/src/v1/model.ts b/packages/workspaces/src/v1/model.ts index 5234157f..1ace6d88 100755 --- a/packages/workspaces/src/v1/model.ts +++ b/packages/workspaces/src/v1/model.ts @@ -138,6 +138,40 @@ export interface CloudResourceContainer { | undefined; } +export interface CreateCloudResourceContainer { + cloudResourceContainer?: + | {$case: 'gcp'; gcp: CreateGcpCloudResourceContainer} + | undefined; +} + +export interface CreateGcpCloudResourceContainer { + projectId?: string | undefined; +} + +/** The network configuration for the workspace. */ +export interface CreateGcpManagedNetworkConfig { + /** + * The IP range which will be used to allocate GKE cluster nodes from. + * Note: Pods, services and master IP range must be mutually exclusive. + */ + subnetCidr?: string | undefined; + /** The IP range that will be used to allocate GKE cluster Pods from. */ + gkeClusterPodIpRange?: string | undefined; + /** The IP range that will be used to allocate GKE cluster Services from. */ + gkeClusterServiceIpRange?: string | undefined; +} + +/** The configurations of the GKE cluster used by the GCP workspace. */ +export interface CreateGkeConfig { + /** The type of network connectivity of the GKE cluster. */ + connectivityType?: GkeConnectivityType | undefined; + /** + * The IP range that will be used to allocate GKE cluster master resources from. + * This field must not be set if gke_cluster_type=PUBLIC_NODE_PUBLIC_MASTER. + */ + masterIpRange?: string | undefined; +} + export interface CreateWorkspaceRequest { accountId?: string | undefined; /** The human-readable name of the workspace. */ @@ -160,15 +194,15 @@ export interface CreateWorkspaceRequest { */ cloud?: string | undefined; pricingTier?: PricingTier | undefined; - cloudResourceContainer?: CloudResourceContainer | undefined; + cloudResourceContainer?: CreateCloudResourceContainer | undefined; /** ID of the workspace's credential configuration object. */ credentialsId?: string | undefined; /** ID of the workspace's storage configuration object. */ storageConfigurationId?: string | undefined; /** The ID of the workspace's network configuration object. To use AWS PrivateLink, this field is required. */ networkId?: string | undefined; - gcpManagedNetworkConfig?: GcpManagedNetworkConfig | undefined; - gkeConfig?: GkeConfig | undefined; + gcpManagedNetworkConfig?: CreateGcpManagedNetworkConfig | undefined; + gkeConfig?: CreateGkeConfig | undefined; /** * ID of the workspace's private access settings object. Only used for PrivateLink. You must specify this ID if you are using [AWS PrivateLink](https://aws.amazon.com/privatelink/) for either front-end (user-to-workspace connection), back-end (data plane to control plane connection), or both connection types. * Before configuring PrivateLink, read the [ article about PrivateLink](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html).", @@ -253,9 +287,153 @@ export interface ListWorkspacesResponse { workspaces?: Workspace[] | undefined; } +export interface UpdateCloudResourceContainer { + cloudResourceContainer?: + | {$case: 'gcp'; gcp: UpdateGcpCloudResourceContainer} + | undefined; +} + +export interface UpdateGcpCloudResourceContainer { + projectId?: string | undefined; +} + +/** + * The shared network config for GCP workspace. + * This object has common network configurations that are network attributions of a workspace. + * DEPRECATED. Use GkeConfig instead. + */ +export interface UpdateGcpCommonNetworkConfig { + /** The type of network connectivity of the GKE cluster. */ + gkeConnectivityType?: GkeConnectivityType | undefined; + /** + * The IP range that will be used to allocate GKE cluster master resources from. + * This field must not be set if gke_cluster_type=PUBLIC_NODE_PUBLIC_MASTER. + */ + gkeClusterMasterIpRange?: string | undefined; +} + +/** The network configuration for the workspace. */ +export interface UpdateGcpManagedNetworkConfig { + /** + * The IP range which will be used to allocate GKE cluster nodes from. + * Note: Pods, services and master IP range must be mutually exclusive. + */ + subnetCidr?: string | undefined; + /** The IP range that will be used to allocate GKE cluster Pods from. */ + gkeClusterPodIpRange?: string | undefined; + /** The IP range that will be used to allocate GKE cluster Services from. */ + gkeClusterServiceIpRange?: string | undefined; +} + +/** The configurations of the GKE cluster used by the GCP workspace. */ +export interface UpdateGkeConfig { + /** The type of network connectivity of the GKE cluster. */ + connectivityType?: GkeConnectivityType | undefined; + /** + * The IP range that will be used to allocate GKE cluster master resources from. + * This field must not be set if gke_cluster_type=PUBLIC_NODE_PUBLIC_MASTER. + */ + masterIpRange?: string | undefined; +} + +export interface UpdateWorkspace { + /** A unique integer ID for the workspace */ + workspaceId?: bigint | undefined; + /** The human-readable name of the workspace. */ + workspaceName?: string | undefined; + awsRegion?: string | undefined; + deploymentName?: string | undefined; + /** account ID. */ + accountId?: string | undefined; + /** ID of the workspace's credential configuration object. */ + credentialsId?: string | undefined; + /** ID of the workspace's storage configuration object. */ + storageConfigurationId?: string | undefined; + networkConfig?: + | { + $case: 'networkId'; + /** + * If this workspace is BYO VPC, then the network_id will be populated. If this workspace is not + * BYO VPC, then the network_id will be empty. + */ + networkId: string; + } + | { + $case: 'gcpManagedNetworkConfig'; + gcpManagedNetworkConfig: UpdateGcpManagedNetworkConfig; + } + | undefined; + /** + * ID of the workspace's private access settings object. Only used for PrivateLink. You must specify this ID if you are using [AWS PrivateLink](https://aws.amazon.com/privatelink/) for either front-end (user-to-workspace connection), back-end (data plane to control plane connection), or both connection types. + * + * Before configuring PrivateLink, read the [ article about PrivateLink](https://docs.databricks.com/administration-guide/cloud-configurations/aws/privatelink.html).", + */ + privateAccessSettingsId?: string | undefined; + /** ID of the key configuration for encrypting managed services. */ + managedServicesCustomerManagedKeyId?: string | undefined; + /** ID of the key configuration for encrypting workspace storage. */ + storageCustomerManagedKeyId?: string | undefined; + /** The Google Cloud region of the workspace data plane in your Google account (for example, `us-east4`). */ + location?: string | undefined; + /** The cloud name. This field can have values like `azure`, `gcp`. */ + cloud?: string | undefined; + /** + * The network configuration for the workspace. + * + * DEPRECATED. Use `network_id` instead. + */ + network?: UpdateWorkspaceNetwork | undefined; + gkeConfig?: UpdateGkeConfig | undefined; + cloudResourceContainer?: UpdateCloudResourceContainer | undefined; + /** + * The custom tags key-value pairing that is attached to this workspace. The key-value pair is a string of utf-8 characters. The value can be an empty string, + * with maximum length of 255 characters. The key can be of maximum length of 127 characters, and cannot be empty. + */ + customTags?: Record | undefined; + /** The object ID of network connectivity config. */ + networkConnectivityConfigId?: string | undefined; + /** + * A client owned field used to indicate the workspace status that the client expects to be in. + * For now this is only used to unblock Temporal workflow for GCP least privileged workspace. + */ + expectedWorkspaceStatus?: WorkspaceStatus | undefined; +} + +/** The network configuration for workspaces. */ +export interface UpdateWorkspaceNetwork { + network?: + | { + $case: 'gcpManagedNetworkConfig'; + /** + * The mutually exclusive network deployment modes. The option decides which network mode the + * workspace will use. + * The network config for GCP workspace with managed network. + * This object is input-only and will not be provided when listing workspaces. + */ + gcpManagedNetworkConfig: UpdateGcpManagedNetworkConfig; + } + | { + $case: 'networkId'; + /** + * The ID of the network object, if the workspace is a BYOVPC workspace. + * This should apply to workspaces on all clouds in internal services. In accounts-rest-api, user will use + * workspace.network_id for input and output instead. + * Currently (2021-06-19) the network ID is only used by GCP. + */ + networkId: string; + } + | undefined; + /** + * The shared network config for GCP workspace. + * This object has common network configurations that are network attributions of a workspace. + * This object is input-only. + */ + gcpCommonNetworkConfig?: UpdateGcpCommonNetworkConfig | undefined; +} + export interface UpdateWorkspaceRequest { - customerFacingWorkspace?: Workspace | undefined; - updateMask?: FieldMask | undefined; + customerFacingWorkspace?: UpdateWorkspace | undefined; + updateMask?: FieldMask | undefined; } export interface Workspace { @@ -532,23 +710,13 @@ export const unmarshalWorkspaceNetworkSchema: z.ZodType = z gcpCommonNetworkConfig: d.gcp_common_network_config, })); -export const marshalAzureWorkspaceInfoSchema: z.ZodType = z - .object({ - resourceGroup: z.string().optional(), - subscriptionId: z.string().optional(), - }) - .transform(d => ({ - resource_group: d.resourceGroup, - subscription_id: d.subscriptionId, - })); - -export const marshalCloudResourceContainerSchema: z.ZodType = z +export const marshalCreateCloudResourceContainerSchema: z.ZodType = z .object({ cloudResourceContainer: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('gcp'), - gcp: z.lazy(() => marshalGcpCloudResourceContainerSchema), + gcp: z.lazy(() => marshalCreateGcpCloudResourceContainerSchema), }), ]) .optional(), @@ -559,6 +727,36 @@ export const marshalCloudResourceContainerSchema: z.ZodType = z }), })); +export const marshalCreateGcpCloudResourceContainerSchema: z.ZodType = z + .object({ + projectId: z.string().optional(), + }) + .transform(d => ({ + project_id: d.projectId, + })); + +export const marshalCreateGcpManagedNetworkConfigSchema: z.ZodType = z + .object({ + subnetCidr: z.string().optional(), + gkeClusterPodIpRange: z.string().optional(), + gkeClusterServiceIpRange: z.string().optional(), + }) + .transform(d => ({ + subnet_cidr: d.subnetCidr, + gke_cluster_pod_ip_range: d.gkeClusterPodIpRange, + gke_cluster_service_ip_range: d.gkeClusterServiceIpRange, + })); + +export const marshalCreateGkeConfigSchema: z.ZodType = z + .object({ + connectivityType: z.string().optional(), + masterIpRange: z.string().optional(), + }) + .transform(d => ({ + connectivity_type: d.connectivityType, + master_ip_range: d.masterIpRange, + })); + export const marshalCreateWorkspaceRequestSchema: z.ZodType = z .object({ accountId: z.string().optional(), @@ -569,15 +767,15 @@ export const marshalCreateWorkspaceRequestSchema: z.ZodType = z cloud: z.string().optional(), pricingTier: z.string().optional(), cloudResourceContainer: z - .lazy(() => marshalCloudResourceContainerSchema) + .lazy(() => marshalCreateCloudResourceContainerSchema) .optional(), credentialsId: z.string().optional(), storageConfigurationId: z.string().optional(), networkId: z.string().optional(), gcpManagedNetworkConfig: z - .lazy(() => marshalGcpManagedNetworkConfigSchema) + .lazy(() => marshalCreateGcpManagedNetworkConfigSchema) .optional(), - gkeConfig: z.lazy(() => marshalGkeConfigSchema).optional(), + gkeConfig: z.lazy(() => marshalCreateGkeConfigSchema).optional(), privateAccessSettingsId: z.string().optional(), managedServicesCustomerManagedKeyId: z.string().optional(), storageCustomerManagedKeyId: z.string().optional(), @@ -608,7 +806,24 @@ export const marshalCreateWorkspaceRequestSchema: z.ZodType = z network_connectivity_config_id: d.networkConnectivityConfigId, })); -export const marshalGcpCloudResourceContainerSchema: z.ZodType = z +export const marshalUpdateCloudResourceContainerSchema: z.ZodType = z + .object({ + cloudResourceContainer: z + .discriminatedUnion('$case', [ + z.object({ + $case: z.literal('gcp'), + gcp: z.lazy(() => marshalUpdateGcpCloudResourceContainerSchema), + }), + ]) + .optional(), + }) + .transform(d => ({ + ...(d.cloudResourceContainer?.$case === 'gcp' && { + gcp: d.cloudResourceContainer.gcp, + }), + })); + +export const marshalUpdateGcpCloudResourceContainerSchema: z.ZodType = z .object({ projectId: z.string().optional(), }) @@ -616,7 +831,7 @@ export const marshalGcpCloudResourceContainerSchema: z.ZodType = z project_id: d.projectId, })); -export const marshalGcpCommonNetworkConfigSchema: z.ZodType = z +export const marshalUpdateGcpCommonNetworkConfigSchema: z.ZodType = z .object({ gkeConnectivityType: z.string().optional(), gkeClusterMasterIpRange: z.string().optional(), @@ -626,7 +841,7 @@ export const marshalGcpCommonNetworkConfigSchema: z.ZodType = z gke_cluster_master_ip_range: d.gkeClusterMasterIpRange, })); -export const marshalGcpManagedNetworkConfigSchema: z.ZodType = z +export const marshalUpdateGcpManagedNetworkConfigSchema: z.ZodType = z .object({ subnetCidr: z.string().optional(), gkeClusterPodIpRange: z.string().optional(), @@ -638,7 +853,7 @@ export const marshalGcpManagedNetworkConfigSchema: z.ZodType = z gke_cluster_service_ip_range: d.gkeClusterServiceIpRange, })); -export const marshalGkeConfigSchema: z.ZodType = z +export const marshalUpdateGkeConfigSchema: z.ZodType = z .object({ connectivityType: z.string().optional(), masterIpRange: z.string().optional(), @@ -648,67 +863,54 @@ export const marshalGkeConfigSchema: z.ZodType = z master_ip_range: d.masterIpRange, })); -export const marshalWorkspaceSchema: z.ZodType = z +export const marshalUpdateWorkspaceSchema: z.ZodType = z .object({ workspaceId: z.bigint().optional(), workspaceName: z.string().optional(), awsRegion: z.string().optional(), - creationTime: z.bigint().optional(), deploymentName: z.string().optional(), - workspaceStatus: z.string().optional(), accountId: z.string().optional(), credentialsId: z.string().optional(), storageConfigurationId: z.string().optional(), - workspaceStatusMessage: z.string().optional(), networkConfig: z .discriminatedUnion('$case', [ z.object({$case: z.literal('networkId'), networkId: z.string()}), z.object({ $case: z.literal('gcpManagedNetworkConfig'), gcpManagedNetworkConfig: z.lazy( - () => marshalGcpManagedNetworkConfigSchema + () => marshalUpdateGcpManagedNetworkConfigSchema ), }), ]) .optional(), - pricingTier: z.string().optional(), privateAccessSettingsId: z.string().optional(), managedServicesCustomerManagedKeyId: z.string().optional(), storageCustomerManagedKeyId: z.string().optional(), location: z.string().optional(), cloud: z.string().optional(), - network: z.lazy(() => marshalWorkspaceNetworkSchema).optional(), - azureWorkspaceInfo: z - .lazy(() => marshalAzureWorkspaceInfoSchema) - .optional(), - gkeConfig: z.lazy(() => marshalGkeConfigSchema).optional(), + network: z.lazy(() => marshalUpdateWorkspaceNetworkSchema).optional(), + gkeConfig: z.lazy(() => marshalUpdateGkeConfigSchema).optional(), cloudResourceContainer: z - .lazy(() => marshalCloudResourceContainerSchema) + .lazy(() => marshalUpdateCloudResourceContainerSchema) .optional(), customTags: z.record(z.string(), z.string()).optional(), networkConnectivityConfigId: z.string().optional(), - storageMode: z.string().optional(), - computeMode: z.string().optional(), expectedWorkspaceStatus: z.string().optional(), }) .transform(d => ({ workspace_id: d.workspaceId, workspace_name: d.workspaceName, aws_region: d.awsRegion, - creation_time: d.creationTime, deployment_name: d.deploymentName, - workspace_status: d.workspaceStatus, account_id: d.accountId, credentials_id: d.credentialsId, storage_configuration_id: d.storageConfigurationId, - workspace_status_message: d.workspaceStatusMessage, ...(d.networkConfig?.$case === 'networkId' && { network_id: d.networkConfig.networkId, }), ...(d.networkConfig?.$case === 'gcpManagedNetworkConfig' && { gcp_managed_network_config: d.networkConfig.gcpManagedNetworkConfig, }), - pricing_tier: d.pricingTier, private_access_settings_id: d.privateAccessSettingsId, managed_services_customer_managed_key_id: d.managedServicesCustomerManagedKeyId, @@ -716,31 +918,28 @@ export const marshalWorkspaceSchema: z.ZodType = z location: d.location, cloud: d.cloud, network: d.network, - azure_workspace_info: d.azureWorkspaceInfo, gke_config: d.gkeConfig, cloud_resource_container: d.cloudResourceContainer, custom_tags: d.customTags, network_connectivity_config_id: d.networkConnectivityConfigId, - storage_mode: d.storageMode, - compute_mode: d.computeMode, expected_workspace_status: d.expectedWorkspaceStatus, })); -export const marshalWorkspaceNetworkSchema: z.ZodType = z +export const marshalUpdateWorkspaceNetworkSchema: z.ZodType = z .object({ network: z .discriminatedUnion('$case', [ z.object({ $case: z.literal('gcpManagedNetworkConfig'), gcpManagedNetworkConfig: z.lazy( - () => marshalGcpManagedNetworkConfigSchema + () => marshalUpdateGcpManagedNetworkConfigSchema ), }), z.object({$case: z.literal('networkId'), networkId: z.string()}), ]) .optional(), gcpCommonNetworkConfig: z - .lazy(() => marshalGcpCommonNetworkConfigSchema) + .lazy(() => marshalUpdateGcpCommonNetworkConfigSchema) .optional(), }) .transform(d => ({ @@ -751,88 +950,87 @@ export const marshalWorkspaceNetworkSchema: z.ZodType = z gcp_common_network_config: d.gcpCommonNetworkConfig, })); -const azureWorkspaceInfoFieldMaskSchema: FieldMaskSchema = { - resourceGroup: {wire: 'resource_group'}, - subscriptionId: {wire: 'subscription_id'}, -}; - -const cloudResourceContainerFieldMaskSchema: FieldMaskSchema = { - gcp: {wire: 'gcp', children: () => gcpCloudResourceContainerFieldMaskSchema}, +const updateCloudResourceContainerFieldMaskSchema: FieldMaskSchema = { + gcp: { + wire: 'gcp', + children: () => updateGcpCloudResourceContainerFieldMaskSchema, + }, }; -const gcpCloudResourceContainerFieldMaskSchema: FieldMaskSchema = { +const updateGcpCloudResourceContainerFieldMaskSchema: FieldMaskSchema = { projectId: {wire: 'project_id'}, }; -const gcpCommonNetworkConfigFieldMaskSchema: FieldMaskSchema = { +const updateGcpCommonNetworkConfigFieldMaskSchema: FieldMaskSchema = { gkeClusterMasterIpRange: {wire: 'gke_cluster_master_ip_range'}, gkeConnectivityType: {wire: 'gke_connectivity_type'}, }; -const gcpManagedNetworkConfigFieldMaskSchema: FieldMaskSchema = { +const updateGcpManagedNetworkConfigFieldMaskSchema: FieldMaskSchema = { gkeClusterPodIpRange: {wire: 'gke_cluster_pod_ip_range'}, gkeClusterServiceIpRange: {wire: 'gke_cluster_service_ip_range'}, subnetCidr: {wire: 'subnet_cidr'}, }; -const gkeConfigFieldMaskSchema: FieldMaskSchema = { +const updateGkeConfigFieldMaskSchema: FieldMaskSchema = { connectivityType: {wire: 'connectivity_type'}, masterIpRange: {wire: 'master_ip_range'}, }; -const workspaceFieldMaskSchema: FieldMaskSchema = { +const updateWorkspaceFieldMaskSchema: FieldMaskSchema = { accountId: {wire: 'account_id'}, awsRegion: {wire: 'aws_region'}, - azureWorkspaceInfo: { - wire: 'azure_workspace_info', - children: () => azureWorkspaceInfoFieldMaskSchema, - }, cloud: {wire: 'cloud'}, cloudResourceContainer: { wire: 'cloud_resource_container', - children: () => cloudResourceContainerFieldMaskSchema, + children: () => updateCloudResourceContainerFieldMaskSchema, }, - computeMode: {wire: 'compute_mode'}, - creationTime: {wire: 'creation_time'}, credentialsId: {wire: 'credentials_id'}, customTags: {wire: 'custom_tags'}, deploymentName: {wire: 'deployment_name'}, expectedWorkspaceStatus: {wire: 'expected_workspace_status'}, gcpManagedNetworkConfig: { wire: 'gcp_managed_network_config', - children: () => gcpManagedNetworkConfigFieldMaskSchema, + children: () => updateGcpManagedNetworkConfigFieldMaskSchema, + }, + gkeConfig: { + wire: 'gke_config', + children: () => updateGkeConfigFieldMaskSchema, }, - gkeConfig: {wire: 'gke_config', children: () => gkeConfigFieldMaskSchema}, location: {wire: 'location'}, managedServicesCustomerManagedKeyId: { wire: 'managed_services_customer_managed_key_id', }, - network: {wire: 'network', children: () => workspaceNetworkFieldMaskSchema}, + network: { + wire: 'network', + children: () => updateWorkspaceNetworkFieldMaskSchema, + }, networkConnectivityConfigId: {wire: 'network_connectivity_config_id'}, networkId: {wire: 'network_id'}, - pricingTier: {wire: 'pricing_tier'}, privateAccessSettingsId: {wire: 'private_access_settings_id'}, storageConfigurationId: {wire: 'storage_configuration_id'}, storageCustomerManagedKeyId: {wire: 'storage_customer_managed_key_id'}, - storageMode: {wire: 'storage_mode'}, workspaceId: {wire: 'workspace_id'}, workspaceName: {wire: 'workspace_name'}, - workspaceStatus: {wire: 'workspace_status'}, - workspaceStatusMessage: {wire: 'workspace_status_message'}, }; -export function workspaceFieldMask(...paths: string[]): FieldMask { - return FieldMask.build(paths, workspaceFieldMaskSchema); +export function updateWorkspaceFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + updateWorkspaceFieldMaskSchema + ); } -const workspaceNetworkFieldMaskSchema: FieldMaskSchema = { +const updateWorkspaceNetworkFieldMaskSchema: FieldMaskSchema = { gcpCommonNetworkConfig: { wire: 'gcp_common_network_config', - children: () => gcpCommonNetworkConfigFieldMaskSchema, + children: () => updateGcpCommonNetworkConfigFieldMaskSchema, }, gcpManagedNetworkConfig: { wire: 'gcp_managed_network_config', - children: () => gcpManagedNetworkConfigFieldMaskSchema, + children: () => updateGcpManagedNetworkConfigFieldMaskSchema, }, networkId: {wire: 'network_id'}, };