diff --git a/.github/workflows/tagging.yml b/.github/workflows/tagging.yml index 4e4a9a52..e22f794e 100755 --- a/.github/workflows/tagging.yml +++ b/.github/workflows/tagging.yml @@ -4,12 +4,7 @@ name: tagging on: # Manual dispatch. workflow_dispatch: - inputs: - package: - description: 'Package to tag (leave empty to tag all packages with pending releases).' - required: false - type: string - default: '' + # No inputs are required for the manual dispatch. # NOTE: Temporarily disable automated releases. # @@ -66,10 +61,12 @@ jobs: env: GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} GITHUB_REPOSITORY: ${{ github.repository }} - PACKAGE: ${{ inputs.package }} - run: | - if [ -n "$PACKAGE" ]; then - uv run --locked tagging.py --package "$PACKAGE" - else - uv run --locked tagging.py - fi + run: uv run --locked tagging.py + + - name: Upload created tags artifact + if: always() + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 + with: + name: created-tags + path: created_tags.json + if-no-files-found: ignore diff --git a/README.md b/README.md index ffbaa11d..2434cba8 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,120 @@ > - **Breaking changes may occur at any time** > - **APIs are experimental and unstable** > - **Use for development and testing only** + +## Design Notes + +### FieldMask — Deferred Ergonomics Decisions + +The current `FieldMask` implementation validates paths against a per-message +schema inside `FieldMask.build`, throws on mismatch, and stores the +wire-format paths privately so `toString()` produces the server-facing +comma-separated string. Construction entry point today is a **per-message +factory function** generated alongside each message — e.g. +`alertFieldMask('displayName', 'condition.op')` — which supplies the schema +and message name and delegates to `FieldMask.build`. This section records +two refinements we've discussed but deferred; they do not change the +validation semantics, only the call-site shape. + +#### Q1 — Call-site ergonomics + +**Current (Option C, per-message factory):** + +```ts +import {alertFieldMask} from '@databricks/sdk-alerts/v1'; +const mask = alertFieldMask('displayName', 'condition.op'); +``` + +- Pros: best discoverability (auto-complete on import), single-argument call, + error messages name the target message, and users never think about + schemas or message names. +- Cons: one generated factory per message (~60+ across the SDK). Each is a + thin one-liner, but they multiply with every new message. + +**Option A — raw `FieldMask.build` at the call site:** + +```ts +import {FieldMask} from '@databricks/sdk-core/wkt'; +import {Alert, alertFieldMaskSchema} from '@databricks/sdk-alerts/v1'; + +const mask = FieldMask.build( + ['displayName', 'condition.op'], + alertFieldMaskSchema, +); +``` + +- Pros: zero helper functions anywhere. Only `FieldMask.build` exists. +- Cons: two-argument low-level call at every usage site. Users must + import the schema explicitly and know which schema pairs with which + type. + +**Option B — one generic helper in `sdk-core`:** + +```ts +import {fieldMask} from '@databricks/sdk-core/wkt'; +import {Alert} from '@databricks/sdk-alerts/v1'; + +const mask = fieldMask(Alert, 'displayName', 'condition.op'); +``` + +- Pros: a single `fieldMask(...)` replaces the ~60+ per-message factories. + `Alert` supplies both the schema and the message name as properties on + itself, so the call site stays one argument plus paths. +- Cons: requires `Alert` the import to be **both** a TypeScript type and a + runtime descriptor value on the same name. See Q2 below. + +#### Q2 — Interface + const declaration merging on the message name + +A TypeScript pattern that lets one exported identifier occupy both the +type-space and the value-space: + +```ts +// Type — describes instance shape. Zero runtime cost. +export interface Alert { + displayName?: string; + condition?: Condition; +} + +// Runtime value — carries the schema under the same name. +export const Alert: MessageDescriptor = { + fieldMaskSchema: { + displayName: {wire: 'display_name'}, + condition: {wire: 'condition', children: () => Condition.fieldMaskSchema}, + }, +}; +``` + +Usage after this change: + +```ts +const a: Alert = {displayName: 'foo'}; // Alert as a type (literal shape) +const s = Alert.fieldMaskSchema; // Alert as a value (runtime) +const mask = fieldMask(Alert, 'displayName'); // Option B unblocked +``` + +TypeScript supports this via +[declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html). +`interface X` occupies type-space, `const X` occupies value-space; they do +not collide. The same pattern shows up in `lib.dom.d.ts`, `Promise`, and +various DI libraries. + +- Pros: single import, natural `Alert.fieldMaskSchema` access, enables + Option B without asking users to remember a separate `AlertSchema` name. +- Cons: the pattern is less common in everyday TS and can surprise readers + who expect classes for anything with static-like members. The alternative + is to use a distinct name — e.g. `AlertSchema` or `AlertDescriptor` — for + the runtime value, at the cost of one extra identifier to learn per + message. + +#### Why we haven't landed Q1/Q2 yet + +Both are call-site ergonomics refactors; neither changes the validation +semantics or the per-message schema generation. We want the current +`FieldMask.build` path (validate, translate, store wire paths privately, +`toString()` joins) to settle before adjusting the call-site shape, so +the two axes of change don't churn simultaneously. When we revisit, the +likely landing is **Option B + Option Q2** together — one generic +`fieldMask()` plus the interface+const merge, which most closely matches +what similar TypeScript validation libraries (Zod, Valibot, TypeBox, etc.) +expose while staying consistent with the SDK's existing interface-first +convention for message types. diff --git a/packages/abacpolicies/src/v1/client.ts b/packages/abacpolicies/src/v1/client.ts index c4b896a9..e48468ce 100644 --- a/packages/abacpolicies/src/v1/client.ts +++ b/packages/abacpolicies/src/v1/client.ts @@ -189,7 +189,7 @@ export class Client { const url = `${this.host}/api/2.1/unity-catalog/policies/${req.onSecurableType ?? ''}/${req.onSecurableFullname ?? ''}/${req.name ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; diff --git a/packages/abacpolicies/src/v1/model.ts b/packages/abacpolicies/src/v1/model.ts index 14109f40..b44b60de 100644 --- a/packages/abacpolicies/src/v1/model.ts +++ b/packages/abacpolicies/src/v1/model.ts @@ -1,5 +1,7 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; export enum PolicyType { @@ -292,7 +294,7 @@ export interface UpdatePolicy { * Optional. The update mask field for specifying user intentions on which * fields to update in the request. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalColumnMaskOptionsSchema: z.ZodType = z @@ -474,9 +476,6 @@ export const marshalColumnTagValueExtractionSchema: z.ZodType = z tag_key: d.tagKey, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeletePolicy_ResponseSchema: z.ZodType = z.object({}); - export const marshalDenyOptionsSchema: z.ZodType = z .object({ privileges: z.array(z.string()).optional(), @@ -507,17 +506,6 @@ export const marshalGrantOptionsSchema: z.ZodType = z privileges: d.privileges, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListPolicies_ResponseSchema: z.ZodType = z - .object({ - policies: z.array(z.lazy(() => marshalPolicyInfoSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - policies: d.policies, - next_page_token: d.nextPageToken, - })); - export const marshalMatchColumnSchema: z.ZodType = z .object({ condition: z.string().optional(), @@ -603,3 +591,161 @@ export const marshalTagValueExtractionSchema: z.ZodType = z .transform(d => ({ tag_key: d.tagKey, })); + +const columnMaskOptionsFieldMaskSchema: FieldMaskSchema = { + functionName: {wire: 'function_name'}, + onColumn: {wire: 'on_column'}, + using: {wire: 'using'}, +}; + +export function columnMaskOptionsFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + columnMaskOptionsFieldMaskSchema + ); +} + +const columnTagValueExtractionFieldMaskSchema: FieldMaskSchema = { + columnAlias: {wire: 'column_alias'}, + tagKey: {wire: 'tag_key'}, +}; + +export function columnTagValueExtractionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + columnTagValueExtractionFieldMaskSchema + ); +} + +const denyOptionsFieldMaskSchema: FieldMaskSchema = { + privileges: {wire: 'privileges'}, +}; + +export function denyOptionsFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, denyOptionsFieldMaskSchema); +} + +const functionArgumentFieldMaskSchema: FieldMaskSchema = { + alias: {wire: 'alias'}, + constant: {wire: 'constant'}, + metadataExtraction: { + wire: 'metadata_extraction', + children: () => metadataExtractionExpressionFieldMaskSchema, + }, +}; + +export function functionArgumentFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + functionArgumentFieldMaskSchema + ); +} + +const grantOptionsFieldMaskSchema: FieldMaskSchema = { + privileges: {wire: 'privileges'}, +}; + +export function grantOptionsFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, grantOptionsFieldMaskSchema); +} + +const matchColumnFieldMaskSchema: FieldMaskSchema = { + alias: {wire: 'alias'}, + condition: {wire: 'condition'}, +}; + +export function matchColumnFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, matchColumnFieldMaskSchema); +} + +const metadataExtractionExpressionFieldMaskSchema: FieldMaskSchema = { + columnTagValue: { + wire: 'column_tag_value', + children: () => columnTagValueExtractionFieldMaskSchema, + }, + tagValue: { + wire: 'tag_value', + children: () => tagValueExtractionFieldMaskSchema, + }, +}; + +export function metadataExtractionExpressionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + metadataExtractionExpressionFieldMaskSchema + ); +} + +const policyInfoFieldMaskSchema: FieldMaskSchema = { + columnMask: { + wire: 'column_mask', + children: () => columnMaskOptionsFieldMaskSchema, + }, + comment: {wire: 'comment'}, + createdAt: {wire: 'created_at'}, + createdBy: {wire: 'created_by'}, + deny: {wire: 'deny', children: () => denyOptionsFieldMaskSchema}, + exceptPrincipals: {wire: 'except_principals'}, + forSecurableType: {wire: 'for_securable_type'}, + grant: {wire: 'grant', children: () => grantOptionsFieldMaskSchema}, + id: {wire: 'id'}, + matchColumns: {wire: 'match_columns'}, + name: {wire: 'name'}, + onSecurableFullname: {wire: 'on_securable_fullname'}, + onSecurableType: {wire: 'on_securable_type'}, + policyType: {wire: 'policy_type'}, + rowFilter: { + wire: 'row_filter', + children: () => rowFilterOptionsFieldMaskSchema, + }, + toPrincipals: {wire: 'to_principals'}, + updatedAt: {wire: 'updated_at'}, + updatedBy: {wire: 'updated_by'}, + useSessionIdentity: {wire: 'use_session_identity'}, + whenCondition: {wire: 'when_condition'}, +}; + +export function policyInfoFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, policyInfoFieldMaskSchema); +} + +const rowFilterOptionsFieldMaskSchema: FieldMaskSchema = { + functionName: {wire: 'function_name'}, + using: {wire: 'using'}, +}; + +export function rowFilterOptionsFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + rowFilterOptionsFieldMaskSchema + ); +} + +const tagValueExtractionFieldMaskSchema: FieldMaskSchema = { + tagKey: {wire: 'tag_key'}, +}; + +export function tagValueExtractionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + tagValueExtractionFieldMaskSchema + ); +} diff --git a/packages/accountaccesscontrol/src/v1/model.ts b/packages/accountaccesscontrol/src/v1/model.ts index b2bf51e7..c58549af 100644 --- a/packages/accountaccesscontrol/src/v1/model.ts +++ b/packages/accountaccesscontrol/src/v1/model.ts @@ -149,40 +149,6 @@ export const unmarshalRuleSetSchema: z.ZodType = z grantRules: d.grant_rules, })); -export const unmarshalRuleSetUpdateRequestSchema: z.ZodType = - z - .object({ - name: z.string().optional(), - etag: z.string().optional(), - grant_rules: z.array(z.lazy(() => unmarshalGrantRuleSchema)).optional(), - }) - .transform(d => ({ - name: d.name, - etag: d.etag, - grantRules: d.grant_rules, - })); - -export const unmarshalUpdateRuleSetRequestSchema: z.ZodType = - z - .object({ - account_id: z.string().optional(), - name: z.string().optional(), - rule_set: z.lazy(() => unmarshalRuleSetUpdateRequestSchema).optional(), - }) - .transform(d => ({ - accountId: d.account_id, - name: d.name, - ruleSet: d.rule_set, - })); - -export const marshalGetAssignableRolesForResourceResponseSchema: z.ZodType = z - .object({ - roles: z.array(z.lazy(() => marshalRoleSchema)).optional(), - }) - .transform(d => ({ - roles: d.roles, - })); - export const marshalGrantRuleSchema: z.ZodType = z .object({ principals: z.array(z.string()).optional(), @@ -193,26 +159,6 @@ export const marshalGrantRuleSchema: z.ZodType = z role: d.role, })); -export const marshalRoleSchema: z.ZodType = z - .object({ - name: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - })); - -export const marshalRuleSetSchema: 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 marshalRuleSetUpdateRequestSchema: z.ZodType = z .object({ name: z.string().optional(), diff --git a/packages/accountaccesscontrolproxy/src/v1/model.ts b/packages/accountaccesscontrolproxy/src/v1/model.ts index b2bf51e7..c58549af 100644 --- a/packages/accountaccesscontrolproxy/src/v1/model.ts +++ b/packages/accountaccesscontrolproxy/src/v1/model.ts @@ -149,40 +149,6 @@ export const unmarshalRuleSetSchema: z.ZodType = z grantRules: d.grant_rules, })); -export const unmarshalRuleSetUpdateRequestSchema: z.ZodType = - z - .object({ - name: z.string().optional(), - etag: z.string().optional(), - grant_rules: z.array(z.lazy(() => unmarshalGrantRuleSchema)).optional(), - }) - .transform(d => ({ - name: d.name, - etag: d.etag, - grantRules: d.grant_rules, - })); - -export const unmarshalUpdateRuleSetRequestSchema: z.ZodType = - z - .object({ - account_id: z.string().optional(), - name: z.string().optional(), - rule_set: z.lazy(() => unmarshalRuleSetUpdateRequestSchema).optional(), - }) - .transform(d => ({ - accountId: d.account_id, - name: d.name, - ruleSet: d.rule_set, - })); - -export const marshalGetAssignableRolesForResourceResponseSchema: z.ZodType = z - .object({ - roles: z.array(z.lazy(() => marshalRoleSchema)).optional(), - }) - .transform(d => ({ - roles: d.roles, - })); - export const marshalGrantRuleSchema: z.ZodType = z .object({ principals: z.array(z.string()).optional(), @@ -193,26 +159,6 @@ export const marshalGrantRuleSchema: z.ZodType = z role: d.role, })); -export const marshalRoleSchema: z.ZodType = z - .object({ - name: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - })); - -export const marshalRuleSetSchema: 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 marshalRuleSetUpdateRequestSchema: z.ZodType = z .object({ name: z.string().optional(), diff --git a/packages/alerts/src/v1/model.ts b/packages/alerts/src/v1/model.ts index 95df949a..11378e94 100644 --- a/packages/alerts/src/v1/model.ts +++ b/packages/alerts/src/v1/model.ts @@ -1,6 +1,8 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. import {Temporal} from '@js-temporal/polyfill'; +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; export enum AlertOperator { @@ -182,7 +184,7 @@ export interface TrashAlertRequest { export interface UpdateAlertRequest { alert?: UpdateAlertRequestAlert | undefined; - updateMask?: string | 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; @@ -311,63 +313,6 @@ export const unmarshalAlertOperandValueSchema: z.ZodType = z boolValue: d.bool_value, })); -export const unmarshalCreateAlertRequestSchema: z.ZodType = - z - .object({ - alert: z.lazy(() => unmarshalCreateAlertRequestAlertSchema).optional(), - auto_resolve_display_name: z.boolean().optional(), - }) - .transform(d => ({ - alert: d.alert, - autoResolveDisplayName: d.auto_resolve_display_name, - })); - -export const unmarshalCreateAlertRequestAlertSchema: z.ZodType = - z - .object({ - id: z.string().optional(), - display_name: z.string().optional(), - query_id: z.string().optional(), - state: z.enum(AlertState).optional(), - seconds_to_retrigger: z.number().optional(), - lifecycle_state: z.enum(LifecycleState).optional(), - trigger_time: z - .string() - .transform(s => Temporal.Instant.from(s)) - .optional(), - custom_body: z.string().optional(), - custom_subject: z.string().optional(), - condition: z.lazy(() => unmarshalAlertConditionSchema).optional(), - owner_user_name: z.string().optional(), - parent_path: z.string().optional(), - create_time: z - .string() - .transform(s => Temporal.Instant.from(s)) - .optional(), - update_time: z - .string() - .transform(s => Temporal.Instant.from(s)) - .optional(), - notify_on_ok: z.boolean().optional(), - }) - .transform(d => ({ - id: d.id, - displayName: d.display_name, - queryId: d.query_id, - state: d.state, - secondsToRetrigger: d.seconds_to_retrigger, - lifecycleState: d.lifecycle_state, - triggerTime: d.trigger_time, - customBody: d.custom_body, - customSubject: d.custom_subject, - condition: d.condition, - ownerUserName: d.owner_user_name, - parentPath: d.parent_path, - createTime: d.create_time, - updateTime: d.update_time, - notifyOnOk: d.notify_on_ok, - })); - export const unmarshalEmptySchema: z.ZodType = z.object({}); export const unmarshalListAlertsResponseSchema: z.ZodType = @@ -429,112 +374,6 @@ export const unmarshalListAlertsResponseAlertSchema: z.ZodType = - z - .object({ - alert: z.lazy(() => unmarshalUpdateAlertRequestAlertSchema).optional(), - update_mask: z.string().optional(), - id: z.string().optional(), - auto_resolve_display_name: z.boolean().optional(), - }) - .transform(d => ({ - alert: d.alert, - updateMask: d.update_mask, - id: d.id, - autoResolveDisplayName: d.auto_resolve_display_name, - })); - -export const unmarshalUpdateAlertRequestAlertSchema: z.ZodType = - z - .object({ - id: z.string().optional(), - display_name: z.string().optional(), - query_id: z.string().optional(), - state: z.enum(AlertState).optional(), - seconds_to_retrigger: z.number().optional(), - lifecycle_state: z.enum(LifecycleState).optional(), - trigger_time: z - .string() - .transform(s => Temporal.Instant.from(s)) - .optional(), - custom_body: z.string().optional(), - custom_subject: z.string().optional(), - condition: z.lazy(() => unmarshalAlertConditionSchema).optional(), - owner_user_name: z.string().optional(), - parent_path: z.string().optional(), - create_time: z - .string() - .transform(s => Temporal.Instant.from(s)) - .optional(), - update_time: z - .string() - .transform(s => Temporal.Instant.from(s)) - .optional(), - notify_on_ok: z.boolean().optional(), - }) - .transform(d => ({ - id: d.id, - displayName: d.display_name, - queryId: d.query_id, - state: d.state, - secondsToRetrigger: d.seconds_to_retrigger, - lifecycleState: d.lifecycle_state, - triggerTime: d.trigger_time, - customBody: d.custom_body, - customSubject: d.custom_subject, - condition: d.condition, - ownerUserName: d.owner_user_name, - parentPath: d.parent_path, - createTime: d.create_time, - updateTime: d.update_time, - notifyOnOk: d.notify_on_ok, - })); - -export const marshalAlertSchema: z.ZodType = z - .object({ - id: z.string().optional(), - displayName: z.string().optional(), - queryId: z.string().optional(), - state: z.enum(AlertState).optional(), - secondsToRetrigger: z.number().optional(), - lifecycleState: z.enum(LifecycleState).optional(), - triggerTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - customBody: z.string().optional(), - customSubject: z.string().optional(), - condition: z.lazy(() => marshalAlertConditionSchema).optional(), - ownerUserName: z.string().optional(), - parentPath: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - notifyOnOk: z.boolean().optional(), - }) - .transform(d => ({ - id: d.id, - display_name: d.displayName, - query_id: d.queryId, - state: d.state, - seconds_to_retrigger: d.secondsToRetrigger, - lifecycle_state: d.lifecycleState, - trigger_time: d.triggerTime, - custom_body: d.customBody, - custom_subject: d.customSubject, - condition: d.condition, - owner_user_name: d.ownerUserName, - parent_path: d.parentPath, - create_time: d.createTime, - update_time: d.updateTime, - notify_on_ok: d.notifyOnOk, - })); - export const marshalAlertConditionSchema: z.ZodType = z .object({ op: z.enum(AlertOperator).optional(), @@ -634,69 +473,13 @@ export const marshalCreateAlertRequestAlertSchema: z.ZodType = z notify_on_ok: d.notifyOnOk, })); -export const marshalEmptySchema: z.ZodType = z.object({}); - -export const marshalListAlertsResponseSchema: z.ZodType = z - .object({ - results: z - .array(z.lazy(() => marshalListAlertsResponseAlertSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - results: d.results, - next_page_token: d.nextPageToken, - })); - -export const marshalListAlertsResponseAlertSchema: z.ZodType = z - .object({ - id: z.string().optional(), - displayName: z.string().optional(), - queryId: z.string().optional(), - state: z.enum(AlertState).optional(), - secondsToRetrigger: z.number().optional(), - lifecycleState: z.enum(LifecycleState).optional(), - triggerTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - customBody: z.string().optional(), - customSubject: z.string().optional(), - condition: z.lazy(() => marshalAlertConditionSchema).optional(), - ownerUserName: z.string().optional(), - parentPath: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - notifyOnOk: z.boolean().optional(), - }) - .transform(d => ({ - id: d.id, - display_name: d.displayName, - query_id: d.queryId, - state: d.state, - seconds_to_retrigger: d.secondsToRetrigger, - lifecycle_state: d.lifecycleState, - trigger_time: d.triggerTime, - custom_body: d.customBody, - custom_subject: d.customSubject, - condition: d.condition, - owner_user_name: d.ownerUserName, - parent_path: d.parentPath, - create_time: d.createTime, - update_time: d.updateTime, - notify_on_ok: d.notifyOnOk, - })); - export const marshalUpdateAlertRequestSchema: z.ZodType = z .object({ alert: z.lazy(() => marshalUpdateAlertRequestAlertSchema).optional(), - updateMask: z.string().optional(), + updateMask: z + .any() + .transform((m: FieldMask) => m.toString()) + .optional(), id: z.string().optional(), autoResolveDisplayName: z.boolean().optional(), }) @@ -751,3 +534,82 @@ export const marshalUpdateAlertRequestAlertSchema: z.ZodType = z update_time: d.updateTime, notify_on_ok: d.notifyOnOk, })); + +const alertConditionFieldMaskSchema: FieldMaskSchema = { + emptyResultState: {wire: 'empty_result_state'}, + op: {wire: 'op'}, + operand: {wire: 'operand', children: () => alertOperandFieldMaskSchema}, + threshold: {wire: 'threshold', children: () => alertOperandFieldMaskSchema}, +}; + +export function alertConditionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, alertConditionFieldMaskSchema); +} + +const alertOperandFieldMaskSchema: FieldMaskSchema = { + column: {wire: 'column', children: () => alertOperandColumnFieldMaskSchema}, + value: {wire: 'value', children: () => alertOperandValueFieldMaskSchema}, +}; + +export function alertOperandFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, alertOperandFieldMaskSchema); +} + +const alertOperandColumnFieldMaskSchema: FieldMaskSchema = { + name: {wire: 'name'}, +}; + +export function alertOperandColumnFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + alertOperandColumnFieldMaskSchema + ); +} + +const alertOperandValueFieldMaskSchema: FieldMaskSchema = { + boolValue: {wire: 'bool_value'}, + doubleValue: {wire: 'double_value'}, + stringValue: {wire: 'string_value'}, +}; + +export function alertOperandValueFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + alertOperandValueFieldMaskSchema + ); +} + +const updateAlertRequestAlertFieldMaskSchema: FieldMaskSchema = { + condition: {wire: 'condition', children: () => alertConditionFieldMaskSchema}, + createTime: {wire: 'create_time'}, + customBody: {wire: 'custom_body'}, + customSubject: {wire: 'custom_subject'}, + displayName: {wire: 'display_name'}, + id: {wire: 'id'}, + lifecycleState: {wire: 'lifecycle_state'}, + notifyOnOk: {wire: 'notify_on_ok'}, + ownerUserName: {wire: 'owner_user_name'}, + parentPath: {wire: 'parent_path'}, + queryId: {wire: 'query_id'}, + secondsToRetrigger: {wire: 'seconds_to_retrigger'}, + state: {wire: 'state'}, + triggerTime: {wire: 'trigger_time'}, + updateTime: {wire: 'update_time'}, +}; + +export function updateAlertRequestAlertFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + updateAlertRequestAlertFieldMaskSchema + ); +} diff --git a/packages/alerts/src/v2/client.ts b/packages/alerts/src/v2/client.ts index 9b60dc21..12c4a405 100644 --- a/packages/alerts/src/v2/client.ts +++ b/packages/alerts/src/v2/client.ts @@ -183,7 +183,7 @@ export class Client { const url = `${this.host}/api/2.0/alerts/${req.alert?.id ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; diff --git a/packages/alerts/src/v2/model.ts b/packages/alerts/src/v2/model.ts index eb1974db..1fa583d5 100644 --- a/packages/alerts/src/v2/model.ts +++ b/packages/alerts/src/v2/model.ts @@ -1,6 +1,8 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. import {Temporal} from '@js-temporal/polyfill'; +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; export enum Aggregation { @@ -209,7 +211,7 @@ export interface TrashAlertRequest { export interface UpdateAlertRequest { alert?: Alert | undefined; - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalAlertSchema: z.ZodType = z @@ -528,14 +530,146 @@ export const marshalCronScheduleSchema: z.ZodType = z effective_pause_status: d.effectivePauseStatus, })); -export const marshalEmptySchema: z.ZodType = z.object({}); +const alertFieldMaskSchema: FieldMaskSchema = { + createTime: {wire: 'create_time'}, + customDescription: {wire: 'custom_description'}, + customSummary: {wire: 'custom_summary'}, + displayName: {wire: 'display_name'}, + effectiveParentPath: {wire: 'effective_parent_path'}, + effectiveRunAs: { + wire: 'effective_run_as', + children: () => alertRunAsFieldMaskSchema, + }, + evaluation: { + wire: 'evaluation', + children: () => alertEvaluationFieldMaskSchema, + }, + 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}, + runAsUserName: {wire: 'run_as_user_name'}, + schedule: {wire: 'schedule', children: () => cronScheduleFieldMaskSchema}, + updateTime: {wire: 'update_time'}, + warehouseId: {wire: 'warehouse_id'}, +}; + +export function alertFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, alertFieldMaskSchema); +} -export const marshalListAlertsResponseSchema: z.ZodType = z - .object({ - alerts: z.array(z.lazy(() => marshalAlertSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - alerts: d.alerts, - next_page_token: d.nextPageToken, - })); +const alertEvaluationFieldMaskSchema: FieldMaskSchema = { + comparisonOperator: {wire: 'comparison_operator'}, + emptyResultState: {wire: 'empty_result_state'}, + lastEvaluatedAt: {wire: 'last_evaluated_at'}, + notification: { + wire: 'notification', + children: () => alertNotificationFieldMaskSchema, + }, + source: {wire: 'source', children: () => alertOperandColumnFieldMaskSchema}, + state: {wire: 'state'}, + threshold: {wire: 'threshold', children: () => alertOperandFieldMaskSchema}, +}; + +export function alertEvaluationFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + alertEvaluationFieldMaskSchema + ); +} + +const alertNotificationFieldMaskSchema: FieldMaskSchema = { + notifyOnOk: {wire: 'notify_on_ok'}, + retriggerSeconds: {wire: 'retrigger_seconds'}, + subscriptions: {wire: 'subscriptions'}, +}; + +export function alertNotificationFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + alertNotificationFieldMaskSchema + ); +} + +const alertOperandFieldMaskSchema: FieldMaskSchema = { + column: {wire: 'column', children: () => alertOperandColumnFieldMaskSchema}, + value: {wire: 'value', children: () => alertOperandValueFieldMaskSchema}, +}; + +export function alertOperandFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, alertOperandFieldMaskSchema); +} + +const alertOperandColumnFieldMaskSchema: FieldMaskSchema = { + aggregation: {wire: 'aggregation'}, + display: {wire: 'display'}, + name: {wire: 'name'}, +}; + +export function alertOperandColumnFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + alertOperandColumnFieldMaskSchema + ); +} + +const alertOperandValueFieldMaskSchema: FieldMaskSchema = { + boolValue: {wire: 'bool_value'}, + doubleValue: {wire: 'double_value'}, + stringValue: {wire: 'string_value'}, +}; + +export function alertOperandValueFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + alertOperandValueFieldMaskSchema + ); +} + +const alertRunAsFieldMaskSchema: FieldMaskSchema = { + servicePrincipalName: {wire: 'service_principal_name'}, + userName: {wire: 'user_name'}, +}; + +export function alertRunAsFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, alertRunAsFieldMaskSchema); +} + +const alertSubscriptionFieldMaskSchema: FieldMaskSchema = { + destinationId: {wire: 'destination_id'}, + userEmail: {wire: 'user_email'}, +}; + +export function alertSubscriptionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + alertSubscriptionFieldMaskSchema + ); +} + +const cronScheduleFieldMaskSchema: FieldMaskSchema = { + effectivePauseStatus: {wire: 'effective_pause_status'}, + pauseStatus: {wire: 'pause_status'}, + quartzCronSchedule: {wire: 'quartz_cron_schedule'}, + timezoneId: {wire: 'timezone_id'}, +}; + +export function cronScheduleFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, cronScheduleFieldMaskSchema); +} diff --git a/packages/artifactallowlists/src/v1/model.ts b/packages/artifactallowlists/src/v1/model.ts index 738ed015..ce50e417 100644 --- a/packages/artifactallowlists/src/v1/model.ts +++ b/packages/artifactallowlists/src/v1/model.ts @@ -81,41 +81,6 @@ export const unmarshalArtifactMatcherSchema: z.ZodType = z matchType: d.match_type, })); -export const unmarshalSetArtifactAllowlistSchema: z.ZodType = - z - .object({ - artifact_type: z.enum(ArtifactType).optional(), - artifact_matchers: z - .array(z.lazy(() => unmarshalArtifactMatcherSchema)) - .optional(), - metastore_id: z.string().optional(), - created_by: z.string().optional(), - created_at: z.number().optional(), - }) - .transform(d => ({ - artifactType: d.artifact_type, - artifactMatchers: d.artifact_matchers, - metastoreId: d.metastore_id, - createdBy: d.created_by, - createdAt: d.created_at, - })); - -export const marshalArtifactAllowlistInfoSchema: z.ZodType = z - .object({ - artifactMatchers: z - .array(z.lazy(() => marshalArtifactMatcherSchema)) - .optional(), - metastoreId: z.string().optional(), - createdBy: z.string().optional(), - createdAt: z.number().optional(), - }) - .transform(d => ({ - artifact_matchers: d.artifactMatchers, - metastore_id: d.metastoreId, - created_by: d.createdBy, - created_at: d.createdAt, - })); - export const marshalArtifactMatcherSchema: z.ZodType = z .object({ artifact: z.string().optional(), diff --git a/packages/billableusagedownload/src/v1/model.ts b/packages/billableusagedownload/src/v1/model.ts index 9c6ac4ae..fbda5c45 100644 --- a/packages/billableusagedownload/src/v1/model.ts +++ b/packages/billableusagedownload/src/v1/model.ts @@ -40,11 +40,3 @@ export const unmarshalDownloadResponseSchema: z.ZodType = z .transform(d => ({ content: d.content, })); - -export const marshalDownloadResponseSchema: z.ZodType = z - .object({ - content: z.string().optional(), - }) - .transform(d => ({ - content: d.content, - })); diff --git a/packages/catalogs/src/v1/model.ts b/packages/catalogs/src/v1/model.ts index bfcedc77..8cff5a14 100644 --- a/packages/catalogs/src/v1/model.ts +++ b/packages/catalogs/src/v1/model.ts @@ -464,71 +464,6 @@ export const unmarshalConversionInfoSchema: z.ZodType = z state: d.state, })); -export const unmarshalCreateCatalogSchema: z.ZodType = z - .object({ - name: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - storage_root: z.string().optional(), - enable_predictive_optimization: z.string().optional(), - catalog_type: z.enum(CatalogType).optional(), - provider_name: z.string().optional(), - share_name: z.string().optional(), - connection_name: z.string().optional(), - metastore_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - storage_location: z.string().optional(), - isolation_mode: z.enum(CatalogIsolationMode).optional(), - effective_predictive_optimization_flag: z - .lazy(() => unmarshalEffectivePredictiveOptimizationFlagSchema) - .optional(), - browse_only: z.boolean().optional(), - provisioning_info: z.lazy(() => unmarshalProvisioningInfoSchema).optional(), - full_name: z.string().optional(), - securable_type: z.enum(SecurableType).optional(), - conversion_info: z.lazy(() => unmarshalConversionInfoSchema).optional(), - dr_replication_info: z - .lazy(() => unmarshalDrReplicationInfoSchema) - .optional(), - managed_encryption_settings: z - .lazy(() => unmarshalEncryptionSettingsSchema) - .optional(), - properties: z.record(z.string(), z.string()).optional(), - options: z.record(z.string(), z.string()).optional(), - }) - .transform(d => ({ - name: d.name, - owner: d.owner, - comment: d.comment, - storageRoot: d.storage_root, - enablePredictiveOptimization: d.enable_predictive_optimization, - catalogType: d.catalog_type, - providerName: d.provider_name, - shareName: d.share_name, - connectionName: d.connection_name, - metastoreId: d.metastore_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - storageLocation: d.storage_location, - isolationMode: d.isolation_mode, - effectivePredictiveOptimizationFlag: - d.effective_predictive_optimization_flag, - browseOnly: d.browse_only, - provisioningInfo: d.provisioning_info, - fullName: d.full_name, - securableType: d.securable_type, - conversionInfo: d.conversion_info, - drReplicationInfo: d.dr_replication_info, - managedEncryptionSettings: d.managed_encryption_settings, - properties: d.properties, - options: d.options, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalDeleteCatalog_ResponseSchema: z.ZodType = z.object({}); @@ -596,75 +531,6 @@ export const unmarshalProvisioningInfoSchema: z.ZodType = z state: d.state, })); -export const unmarshalUpdateCatalogSchema: z.ZodType = z - .object({ - name_arg: z.string().optional(), - new_name: z.string().optional(), - name: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - storage_root: z.string().optional(), - enable_predictive_optimization: z.string().optional(), - catalog_type: z.enum(CatalogType).optional(), - provider_name: z.string().optional(), - share_name: z.string().optional(), - connection_name: z.string().optional(), - metastore_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - storage_location: z.string().optional(), - isolation_mode: z.enum(CatalogIsolationMode).optional(), - effective_predictive_optimization_flag: z - .lazy(() => unmarshalEffectivePredictiveOptimizationFlagSchema) - .optional(), - browse_only: z.boolean().optional(), - provisioning_info: z.lazy(() => unmarshalProvisioningInfoSchema).optional(), - full_name: z.string().optional(), - securable_type: z.enum(SecurableType).optional(), - conversion_info: z.lazy(() => unmarshalConversionInfoSchema).optional(), - dr_replication_info: z - .lazy(() => unmarshalDrReplicationInfoSchema) - .optional(), - managed_encryption_settings: z - .lazy(() => unmarshalEncryptionSettingsSchema) - .optional(), - properties: z.record(z.string(), z.string()).optional(), - options: z.record(z.string(), z.string()).optional(), - }) - .transform(d => ({ - nameArg: d.name_arg, - newName: d.new_name, - name: d.name, - owner: d.owner, - comment: d.comment, - storageRoot: d.storage_root, - enablePredictiveOptimization: d.enable_predictive_optimization, - catalogType: d.catalog_type, - providerName: d.provider_name, - shareName: d.share_name, - connectionName: d.connection_name, - metastoreId: d.metastore_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - storageLocation: d.storage_location, - isolationMode: d.isolation_mode, - effectivePredictiveOptimizationFlag: - d.effective_predictive_optimization_flag, - browseOnly: d.browse_only, - provisioningInfo: d.provisioning_info, - fullName: d.full_name, - securableType: d.securable_type, - conversionInfo: d.conversion_info, - drReplicationInfo: d.dr_replication_info, - managedEncryptionSettings: d.managed_encryption_settings, - properties: d.properties, - options: d.options, - })); - export const marshalAzureEncryptionSettingsSchema: z.ZodType = z .object({ azureTenantId: z.string().optional(), @@ -677,69 +543,6 @@ export const marshalAzureEncryptionSettingsSchema: z.ZodType = z azure_cmk_managed_identity_id: d.azureCmkManagedIdentityId, })); -export const marshalCatalogInfoSchema: z.ZodType = z - .object({ - name: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - storageRoot: z.string().optional(), - enablePredictiveOptimization: z.string().optional(), - catalogType: z.enum(CatalogType).optional(), - providerName: z.string().optional(), - shareName: z.string().optional(), - connectionName: z.string().optional(), - metastoreId: z.string().optional(), - createdAt: z.number().optional(), - createdBy: z.string().optional(), - updatedAt: z.number().optional(), - updatedBy: z.string().optional(), - storageLocation: z.string().optional(), - isolationMode: z.enum(CatalogIsolationMode).optional(), - effectivePredictiveOptimizationFlag: z - .lazy(() => marshalEffectivePredictiveOptimizationFlagSchema) - .optional(), - browseOnly: z.boolean().optional(), - provisioningInfo: z.lazy(() => marshalProvisioningInfoSchema).optional(), - fullName: z.string().optional(), - securableType: z.enum(SecurableType).optional(), - conversionInfo: z.lazy(() => marshalConversionInfoSchema).optional(), - drReplicationInfo: z.lazy(() => marshalDrReplicationInfoSchema).optional(), - managedEncryptionSettings: z - .lazy(() => marshalEncryptionSettingsSchema) - .optional(), - properties: z.record(z.string(), z.string()).optional(), - options: z.record(z.string(), z.string()).optional(), - }) - .transform(d => ({ - name: d.name, - owner: d.owner, - comment: d.comment, - storage_root: d.storageRoot, - enable_predictive_optimization: d.enablePredictiveOptimization, - catalog_type: d.catalogType, - provider_name: d.providerName, - share_name: d.shareName, - connection_name: d.connectionName, - metastore_id: d.metastoreId, - created_at: d.createdAt, - created_by: d.createdBy, - updated_at: d.updatedAt, - updated_by: d.updatedBy, - storage_location: d.storageLocation, - isolation_mode: d.isolationMode, - effective_predictive_optimization_flag: - d.effectivePredictiveOptimizationFlag, - browse_only: d.browseOnly, - provisioning_info: d.provisioningInfo, - full_name: d.fullName, - securable_type: d.securableType, - conversion_info: d.conversionInfo, - dr_replication_info: d.drReplicationInfo, - managed_encryption_settings: d.managedEncryptionSettings, - properties: d.properties, - options: d.options, - })); - export const marshalConversionInfoSchema: z.ZodType = z .object({ state: z.enum(ConversionInfo_State).optional(), @@ -811,9 +614,6 @@ export const marshalCreateCatalogSchema: z.ZodType = z options: d.options, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteCatalog_ResponseSchema: z.ZodType = z.object({}); - export const marshalDrReplicationInfoSchema: z.ZodType = z .object({ status: z.enum(DrReplicationStatus).optional(), @@ -857,17 +657,6 @@ export const marshalEncryptionSettingsSchema: z.ZodType = z azure_encryption_settings: d.azureEncryptionSettings, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListCatalogs_ResponseSchema: z.ZodType = z - .object({ - catalogs: z.array(z.lazy(() => marshalCatalogInfoSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - catalogs: d.catalogs, - next_page_token: d.nextPageToken, - })); - export const marshalProvisioningInfoSchema: z.ZodType = z .object({ state: z.enum(ProvisioningInfo_State).optional(), diff --git a/packages/clusterpolicies/src/v2/model.ts b/packages/clusterpolicies/src/v2/model.ts index 75499ce5..1fd3d7ca 100644 --- a/packages/clusterpolicies/src/v2/model.ts +++ b/packages/clusterpolicies/src/v2/model.ts @@ -245,26 +245,6 @@ export interface RCranLibrary { repo?: string | undefined; } -export const unmarshalCreatePolicySchema: z.ZodType = z - .object({ - name: z.string().optional(), - definition: z.string().optional(), - description: z.string().optional(), - policy_family_id: z.string().optional(), - policy_family_definition_overrides: z.string().optional(), - max_clusters_per_user: z.number().optional(), - libraries: z.array(z.lazy(() => unmarshalLibrarySchema)).optional(), - }) - .transform(d => ({ - name: d.name, - definition: d.definition, - description: d.description, - policyFamilyId: d.policy_family_id, - policyFamilyDefinitionOverrides: d.policy_family_definition_overrides, - maxClustersPerUser: d.max_clusters_per_user, - libraries: d.libraries, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalCreatePolicy_ResponseSchema: z.ZodType = z @@ -275,40 +255,10 @@ export const unmarshalCreatePolicy_ResponseSchema: z.ZodType = z - .object({ - policy_id: z.string().optional(), - }) - .transform(d => ({ - policyId: d.policy_id, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalDeletePolicy_ResponseSchema: z.ZodType = z.object({}); -export const unmarshalEditPolicySchema: z.ZodType = z - .object({ - policy_id: z.string().optional(), - name: z.string().optional(), - definition: z.string().optional(), - description: z.string().optional(), - policy_family_id: z.string().optional(), - policy_family_definition_overrides: z.string().optional(), - max_clusters_per_user: z.number().optional(), - libraries: z.array(z.lazy(() => unmarshalLibrarySchema)).optional(), - }) - .transform(d => ({ - policyId: d.policy_id, - name: d.name, - definition: d.definition, - description: d.description, - policyFamilyId: d.policy_family_id, - policyFamilyDefinitionOverrides: d.policy_family_definition_overrides, - maxClustersPerUser: d.max_clusters_per_user, - libraries: d.libraries, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalEditPolicy_ResponseSchema: z.ZodType = z.object({}); @@ -423,15 +373,6 @@ export const marshalCreatePolicySchema: z.ZodType = z libraries: d.libraries, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCreatePolicy_ResponseSchema: z.ZodType = z - .object({ - policyId: z.string().optional(), - }) - .transform(d => ({ - policy_id: d.policyId, - })); - export const marshalDeletePolicySchema: z.ZodType = z .object({ policyId: z.string().optional(), @@ -440,9 +381,6 @@ export const marshalDeletePolicySchema: z.ZodType = z policy_id: d.policyId, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeletePolicy_ResponseSchema: z.ZodType = z.object({}); - export const marshalEditPolicySchema: z.ZodType = z .object({ policyId: z.string().optional(), @@ -465,9 +403,6 @@ export const marshalEditPolicySchema: z.ZodType = z libraries: d.libraries, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalEditPolicy_ResponseSchema: z.ZodType = z.object({}); - export const marshalLibrarySchema: z.ZodType = z .object({ jar: z.string().optional(), @@ -488,15 +423,6 @@ export const marshalLibrarySchema: z.ZodType = z requirements: d.requirements, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListPolicies_ResponseSchema: z.ZodType = z - .object({ - policies: z.array(z.lazy(() => marshalPolicySchema)).optional(), - }) - .transform(d => ({ - policies: d.policies, - })); - export const marshalMavenLibrarySchema: z.ZodType = z .object({ coordinates: z.string().optional(), @@ -509,34 +435,6 @@ export const marshalMavenLibrarySchema: z.ZodType = z exclusions: d.exclusions, })); -export const marshalPolicySchema: z.ZodType = z - .object({ - policyId: z.string().optional(), - creatorUserName: z.string().optional(), - createdAtTimestamp: z.number().optional(), - isDefault: z.boolean().optional(), - name: z.string().optional(), - definition: z.string().optional(), - description: z.string().optional(), - policyFamilyId: z.string().optional(), - policyFamilyDefinitionOverrides: z.string().optional(), - maxClustersPerUser: z.number().optional(), - libraries: z.array(z.lazy(() => marshalLibrarySchema)).optional(), - }) - .transform(d => ({ - policy_id: d.policyId, - creator_user_name: d.creatorUserName, - created_at_timestamp: d.createdAtTimestamp, - is_default: d.isDefault, - 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 marshalPythonPyPiLibrarySchema: z.ZodType = z .object({ package: z.string().optional(), diff --git a/packages/connections/src/v1/model.ts b/packages/connections/src/v1/model.ts index 00258ce6..219a6da7 100644 --- a/packages/connections/src/v1/model.ts +++ b/packages/connections/src/v1/model.ts @@ -378,56 +378,6 @@ export const unmarshalConnectionInfoSchema: z.ZodType = z properties: d.properties, })); -export const unmarshalCreateConnectionSchema: z.ZodType = z - .object({ - parent: z.string().optional(), - name: z.string().optional(), - connection_type: z.enum(ConnectionType).optional(), - owner: z.string().optional(), - read_only: z.boolean().optional(), - comment: z.string().optional(), - environment_settings: z - .lazy(() => unmarshalEnvironmentSettingsSchema) - .optional(), - full_name: z.string().optional(), - url: z.string().optional(), - credential_type: z.enum(CredentialType).optional(), - connection_id: z.string().optional(), - metastore_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - securable_type: z.enum(SecurableType).optional(), - provisioning_info: z.lazy(() => unmarshalProvisioningInfoSchema).optional(), - options: z.record(z.string(), z.string()).optional(), - secrets: z.record(z.string(), z.string()).optional(), - properties: z.record(z.string(), z.string()).optional(), - }) - .transform(d => ({ - parent: d.parent, - name: d.name, - connectionType: d.connection_type, - owner: d.owner, - readOnly: d.read_only, - comment: d.comment, - environmentSettings: d.environment_settings, - fullName: d.full_name, - url: d.url, - credentialType: d.credential_type, - connectionId: d.connection_id, - metastoreId: d.metastore_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - securableType: d.securable_type, - provisioningInfo: d.provisioning_info, - options: d.options, - secrets: d.secrets, - properties: d.properties, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalDeleteConnection_ResponseSchema: z.ZodType = z.object({}); @@ -465,106 +415,6 @@ export const unmarshalProvisioningInfoSchema: z.ZodType = z state: d.state, })); -export const unmarshalUpdateConnectionSchema: z.ZodType = z - .object({ - name_arg: z.string().optional(), - new_name: z.string().optional(), - name: z.string().optional(), - connection_type: z.enum(ConnectionType).optional(), - owner: z.string().optional(), - read_only: z.boolean().optional(), - comment: z.string().optional(), - environment_settings: z - .lazy(() => unmarshalEnvironmentSettingsSchema) - .optional(), - full_name: z.string().optional(), - url: z.string().optional(), - credential_type: z.enum(CredentialType).optional(), - connection_id: z.string().optional(), - metastore_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - securable_type: z.enum(SecurableType).optional(), - provisioning_info: z.lazy(() => unmarshalProvisioningInfoSchema).optional(), - options: z.record(z.string(), z.string()).optional(), - secrets: z.record(z.string(), z.string()).optional(), - properties: z.record(z.string(), z.string()).optional(), - }) - .transform(d => ({ - nameArg: d.name_arg, - newName: d.new_name, - name: d.name, - connectionType: d.connection_type, - owner: d.owner, - readOnly: d.read_only, - comment: d.comment, - environmentSettings: d.environment_settings, - fullName: d.full_name, - url: d.url, - credentialType: d.credential_type, - connectionId: d.connection_id, - metastoreId: d.metastore_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - securableType: d.securable_type, - provisioningInfo: d.provisioning_info, - options: d.options, - secrets: d.secrets, - properties: d.properties, - })); - -export const marshalConnectionInfoSchema: z.ZodType = z - .object({ - name: z.string().optional(), - connectionType: z.enum(ConnectionType).optional(), - owner: z.string().optional(), - readOnly: z.boolean().optional(), - comment: z.string().optional(), - environmentSettings: z - .lazy(() => marshalEnvironmentSettingsSchema) - .optional(), - fullName: z.string().optional(), - url: z.string().optional(), - credentialType: z.enum(CredentialType).optional(), - connectionId: z.string().optional(), - metastoreId: z.string().optional(), - createdAt: z.number().optional(), - createdBy: z.string().optional(), - updatedAt: z.number().optional(), - updatedBy: z.string().optional(), - securableType: z.enum(SecurableType).optional(), - provisioningInfo: z.lazy(() => marshalProvisioningInfoSchema).optional(), - options: z.record(z.string(), z.string()).optional(), - secrets: z.record(z.string(), z.string()).optional(), - properties: z.record(z.string(), z.string()).optional(), - }) - .transform(d => ({ - name: d.name, - connection_type: d.connectionType, - owner: d.owner, - read_only: d.readOnly, - comment: d.comment, - environment_settings: d.environmentSettings, - full_name: d.fullName, - url: d.url, - credential_type: d.credentialType, - connection_id: d.connectionId, - metastore_id: d.metastoreId, - created_at: d.createdAt, - created_by: d.createdBy, - updated_at: d.updatedAt, - updated_by: d.updatedBy, - securable_type: d.securableType, - provisioning_info: d.provisioningInfo, - options: d.options, - secrets: d.secrets, - properties: d.properties, - })); - export const marshalCreateConnectionSchema: z.ZodType = z .object({ parent: z.string().optional(), @@ -615,9 +465,6 @@ export const marshalCreateConnectionSchema: z.ZodType = z properties: d.properties, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteConnection_ResponseSchema: z.ZodType = z.object({}); - export const marshalEnvironmentSettingsSchema: z.ZodType = z .object({ javaDependencies: z.array(z.string()).optional(), @@ -628,17 +475,6 @@ export const marshalEnvironmentSettingsSchema: z.ZodType = z environment_version: d.environmentVersion, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListConnections_ResponseSchema: z.ZodType = z - .object({ - connections: z.array(z.lazy(() => marshalConnectionInfoSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - connections: d.connections, - next_page_token: d.nextPageToken, - })); - export const marshalProvisioningInfoSchema: z.ZodType = z .object({ state: z.enum(ProvisioningInfo_State).optional(), diff --git a/packages/core/src/wkt/fieldmask.ts b/packages/core/src/wkt/fieldmask.ts index 9e00d450..da272ae4 100644 --- a/packages/core/src/wkt/fieldmask.ts +++ b/packages/core/src/wkt/fieldmask.ts @@ -1,49 +1,7 @@ -// True if any property of T is callable, indicating a class instance (e.g. -// Temporal.Instant, Date) rather than a plain data interface. -type HasMethods = true extends { - [K in keyof T]-?: NonNullable extends (...args: never[]) => unknown - ? true - : never; -}[keyof T] - ? true - : false; - -/** - * Utility type that derives all valid dot-separated field paths from a - * TypeScript interface. Provides compile-time path validation for - * {@link FieldMask}. - * - * Recursion stops at arrays, index signatures (Record/Map), and class - * instances with methods (e.g. Temporal.Instant, Date). These are treated - * as leaf nodes. - * - * @example - * ```ts - * interface Cluster { - * name: string; - * config: {numWorkers: number; scaling: {min: number}}; - * } - * // "name" | "config" | "config.numWorkers" | "config.scaling" | "config.scaling.min" - * type ClusterPaths = FieldPaths; - * ``` - */ -export type FieldPaths = { - [K in keyof T & string]: NonNullable extends unknown[] - ? `${Prefix}${K}` // Array field — leaf, do not recurse. - : NonNullable extends Record - ? string extends keyof NonNullable - ? `${Prefix}${K}` // Index signature (Record/Map) — leaf, do not recurse. - : HasMethods> extends true - ? `${Prefix}${K}` // Class instance with methods — leaf, do not recurse. - : `${Prefix}${K}` | FieldPaths, `${Prefix}${K}.`> - : `${Prefix}${K}`; -}[keyof T & string]; - -// Remove duplicates and paths subsumed by a parent (e.g. "config" subsumes -// "config.numWorkers"). -function normalize

(paths: P[]): P[] { +// Remove duplicates and paths subsumed by a parent (e.g. "config" subsumes "config.numWorkers"). +function normalize(paths: string[]): string[] { const unique = [...new Set(paths)].sort(); - const result: P[] = []; + const result: string[] = []; for (const path of unique) { const isSubsumed = result.some(existing => path.startsWith(existing + '.')); if (!isSubsumed) { @@ -54,33 +12,78 @@ function normalize

(paths: P[]): P[] { } /** - * A type-safe field mask implementing google.protobuf.FieldMask semantics. - * Provides compile-time path validation via {@link FieldPaths}. Paths are - * always normalized: duplicates and paths subsumed by a parent are removed. - * - * @example - * ```ts - * const mask = FieldMask.of>( - * 'displayName', - * 'config.numWorkers' - * ); - * ``` + * One field entry in a {@link FieldMaskSchema}: its wire-format name and, for message-typed fields, a lazy reference to the nested message's schema. Array, map, enum, and scalar fields omit `children`. */ -export class FieldMask { - /** The list of field paths in this mask. */ - readonly paths: TPath[]; +export interface FieldMaskSchemaField { + readonly wire: string; + readonly children?: () => FieldMaskSchema; +} - private constructor(paths: TPath[]) { - this.paths = normalize(paths); +/** + * Structural description of one message's FieldMask-reachable fields. Maps each typescript field name to its wire-format name and, for message-typed fields, a lazy `() => FieldMaskSchema` reference that lets recursive and mutually-recursive messages describe themselves. + */ +export type FieldMaskSchema = Readonly>; + +// Walk a dot-separated typescript field name path against a schema, returning the equivalent wire-format path. Returns `undefined` when any segment fails: a name that isn't a field of the current message, or a non-terminal segment that doesn't reference another message. +function walkFieldMaskPath( + schema: FieldMaskSchema, + path: string +): string | undefined { + const segments = path.split('.'); + const wireSegments: string[] = []; + let current: FieldMaskSchema = schema; + for (let i = 0; i < segments.length; i++) { + const seg = segments[i]; + // Existence check before lookup: `current[seg]` is typed as FieldMaskSchemaField without noUncheckedIndexedAccess, so an undefined check downstream would be flagged "unnecessary". + if (!(seg in current)) return undefined; + const field = current[seg]; + wireSegments.push(field.wire); + if (i < segments.length - 1) { + if (field.children === undefined) return undefined; + current = field.children(); + } } + return wireSegments.join('.'); +} + +/** + * A field mask implementing google.protobuf.FieldMask semantics. + */ +export class FieldMask { + // Phantom marker: keeps `FieldMask` and `FieldMask` compile-time distinct under TypeScript's otherwise-structural typing. Never set at runtime. + declare private readonly _tag: T; - /** Create a field mask from one or more paths. */ - static of

(...paths: P[]): FieldMask

{ - return new FieldMask(paths); + // Stored post-translation, normalized wire-format paths. + private readonly paths: string[]; + + private constructor(paths: string[]) { + this.paths = paths; + } + + /** + * Build a FieldMask from typescript field name paths against the target message's schema. Validates every path by walking each segment through the schema and throws Error when any segment fails. + * + * Reserved for generated per-message factories; user code should call the factory (e.g. `alertFieldMask(...)`), which supplies the schema before delegating here. + * + * @internal + */ + static build(paths: string[], schema: FieldMaskSchema): FieldMask { + const normalized = normalize(paths); + const wire: string[] = []; + for (const p of normalized) { + const w = walkFieldMaskPath(schema, p); + if (w === undefined) { + throw new Error(`Unknown field path "${p}"`); + } + wire.push(w); + } + return new FieldMask(wire); } - /** Return a new mask with additional paths appended. */ - append(...paths: TPath[]): FieldMask { - return new FieldMask([...this.paths, ...paths]); + /** + * Serialize the mask to the wire-format string. + */ + toString(): string { + return this.paths.join(','); } } diff --git a/packages/core/src/wkt/index.ts b/packages/core/src/wkt/index.ts index 8d41d967..5d71382a 100644 --- a/packages/core/src/wkt/index.ts +++ b/packages/core/src/wkt/index.ts @@ -1,3 +1,3 @@ export {FieldMask} from './fieldmask'; -export type {FieldPaths} from './fieldmask'; +export type {FieldMaskSchema, FieldMaskSchemaField} from './fieldmask'; export type {JsonValue, JsonObject} from './value'; diff --git a/packages/core/tests/wkt/fieldmask.test.ts b/packages/core/tests/wkt/fieldmask.test.ts index 3e93698f..0dba976b 100644 --- a/packages/core/tests/wkt/fieldmask.test.ts +++ b/packages/core/tests/wkt/fieldmask.test.ts @@ -1,133 +1,120 @@ import {describe, it, expect} from 'vitest'; import {FieldMask} from '../../src/wkt'; -import type {FieldPaths} from '../../src/wkt'; +import type {FieldMaskSchema} from '../../src/wkt'; -// Simulates a class instance with methods (e.g. Temporal.Instant). -interface ClassLike { - epochMilliseconds: number; - toString(): string; -} +// Alert-like non-cyclic schema with nested Condition + Operand, used to drive FieldMask through its `@internal` build entry point. +const operandSchema: FieldMaskSchema = { + column: {wire: 'column'}, + value: {wire: 'value'}, +}; +const conditionSchema: FieldMaskSchema = { + op: {wire: 'op'}, + operand: {wire: 'operand', children: () => operandSchema}, +}; +const alertSchema: FieldMaskSchema = { + displayName: {wire: 'display_name'}, + condition: {wire: 'condition', children: () => conditionSchema}, +}; -// Test interface for FieldPaths derivation. -interface Cluster { - name: string; - displayName: string; - state: string; - config: { - numWorkers: number; - scaling: { - minReplicas: number; - maxReplicas: number; - }; - }; - tags: string[]; - labels: Record; - createTime?: ClassLike; -} +// Self-referential schema used to verify cycle-safe construction. +const nodeSchema: FieldMaskSchema = { + label: {wire: 'label'}, + child: {wire: 'child', children: () => nodeSchema}, +}; -// Verify FieldPaths derives correct paths at compile time. -type ClusterPaths = FieldPaths; -const _checkPaths: ClusterPaths[] = [ - 'name', - 'displayName', - 'state', - 'config', - 'config.numWorkers', - 'config.scaling', - 'config.scaling.minReplicas', - 'config.scaling.maxReplicas', - 'tags', - 'labels', - 'createTime', // Leaf — ClassLike has methods, so no recursion. -]; -// Suppress unused variable warning. -void _checkPaths; - -// Verify that ClassLike properties are NOT included as paths. -// If FieldPaths recursed into ClassLike, "createTime.epochMilliseconds" would -// be a valid path. This assignment must fail at compile time. -// @ts-expect-error - ClassLike is a leaf; its properties are not valid paths. -const _badPath: ClusterPaths = 'createTime.epochMilliseconds'; -void _badPath; - -describe('FieldMask', () => { - describe('of', () => { - const testCases: {name: string; input: string[]; want: string[]}[] = [ - {name: 'single path', input: ['name'], want: ['name']}, +describe('FieldMask.build', () => { + describe('valid paths translate and serialize', () => { + const cases: { + name: string; + schema: FieldMaskSchema; + input: string[]; + want: string; + }[] = [ { - name: 'multiple paths', - input: ['displayName', 'name'], - want: ['displayName', 'name'], + name: 'flat path', + schema: alertSchema, + input: ['displayName'], + want: 'display_name', }, { - name: 'deduplicates paths', - input: ['name', 'name', 'state'], - want: ['name', 'state'], + name: 'nested path', + schema: alertSchema, + input: ['condition.op'], + want: 'condition.op', }, { - name: 'removes paths subsumed by a parent', - input: ['config.numWorkers', 'config', 'name'], - want: ['config', 'name'], + name: 'deeply nested path', + schema: alertSchema, + input: ['condition.operand.column'], + want: 'condition.operand.column', }, { - name: 'removes deeply subsumed paths', - input: ['config.scaling.minReplicas', 'config.scaling', 'config'], - want: ['config'], + name: 'multiple paths joined in sorted order', + schema: alertSchema, + input: ['displayName', 'condition.op'], + want: 'condition.op,display_name', }, { - name: 'does not subsume paths sharing a prefix without a dot boundary', - input: ['foo', 'foobar'], - want: ['foo', 'foobar'], + name: 'duplicates collapse before translation', + schema: alertSchema, + input: ['displayName', 'displayName'], + want: 'display_name', + }, + { + name: 'children subsumed by a parent are dropped', + schema: alertSchema, + input: ['condition.op', 'condition'], + want: 'condition', + }, + { + name: 'empty input serializes to empty string', + schema: alertSchema, + input: [], + want: '', + }, + { + name: 'arbitrary depth through a self-cycle', + schema: nodeSchema, + input: ['child.child.child.label'], + want: 'child.child.child.label', }, - {name: 'empty mask', input: [], want: []}, ]; - it.each(testCases)('$name', ({input, want}) => { - const mask = FieldMask.of(...input); - expect(mask.paths).toStrictEqual(want); + it.each(cases)('$name', ({schema, input, want}) => { + const mask = FieldMask.build(input, schema); + expect(mask.toString()).toBe(want); }); }); - describe('append', () => { - const testCases: { + describe('invalid paths throw', () => { + const cases: { name: string; - initial: string[]; - append: string[]; - want: string[]; + schema: FieldMaskSchema; + input: string[]; + msg: string; }[] = [ { - name: 'adds new paths', - initial: ['name'], - append: ['state'], - want: ['name', 'state'], + name: 'unknown top-level field', + schema: alertSchema, + input: ['bogus'], + msg: 'Unknown field path "bogus"', }, { - name: 'deduplicates when appending existing paths', - initial: ['name', 'state'], - append: ['name'], - want: ['name', 'state'], + name: 'unknown nested field', + schema: alertSchema, + input: ['condition.bogus'], + msg: 'Unknown field path "condition.bogus"', }, { - name: 'subsumes child when parent is appended', - initial: ['config.numWorkers'], - append: ['config'], - want: ['config'], + name: 'descent past a scalar leaf', + schema: alertSchema, + input: ['displayName.nope'], + msg: 'Unknown field path "displayName.nope"', }, ]; - it.each(testCases)('$name', ({initial, append, want}) => { - const mask = FieldMask.of(...initial).append(...append); - expect(mask.paths).toStrictEqual(want); - }); - }); - - describe('type safety with FieldPaths', () => { - it('works with derived FieldPaths type', () => { - const mask = FieldMask.of>( - 'displayName', - 'config.numWorkers' - ); - expect(mask.paths).toStrictEqual(['config.numWorkers', 'displayName']); + it.each(cases)('$name', ({schema, input, msg}) => { + expect(() => FieldMask.build(input, schema)).toThrowError(msg); }); }); }); diff --git a/packages/credentials/src/v1/model.ts b/packages/credentials/src/v1/model.ts index 0309c1a0..0ca94836 100644 --- a/packages/credentials/src/v1/model.ts +++ b/packages/credentials/src/v1/model.ts @@ -961,119 +961,6 @@ export const unmarshalCloudflareApiTokenSchema: z.ZodType = accountId: d.account_id, })); -export const unmarshalCreateCredentialSchema: z.ZodType = z - .object({ - skip_validation: z.boolean().optional(), - name: z.string().optional(), - aws_iam_role: z.lazy(() => unmarshalAwsIamRoleSchema).optional(), - azure_service_principal: z - .lazy(() => unmarshalAzureServicePrincipalSchema) - .optional(), - gcp_service_account_key: z - .lazy(() => unmarshalGcpServiceAccountKeySchema) - .optional(), - azure_managed_identity: z - .lazy(() => unmarshalAzureManagedIdentitySchema) - .optional(), - databricks_gcp_service_account: z - .lazy(() => unmarshalDatabricksGcpServiceAccountSchema) - .optional(), - cloudflare_api_token: z - .lazy(() => unmarshalCloudflareApiTokenSchema) - .optional(), - comment: z.string().optional(), - read_only: z.boolean().optional(), - owner: z.string().optional(), - id: z.string().optional(), - metastore_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - used_for_managed_storage: z.boolean().optional(), - full_name: z.string().optional(), - isolation_mode: z.enum(IsolationMode).optional(), - }) - .transform(d => ({ - skipValidation: d.skip_validation, - name: d.name, - awsIamRole: d.aws_iam_role, - azureServicePrincipal: d.azure_service_principal, - gcpServiceAccountKey: d.gcp_service_account_key, - azureManagedIdentity: d.azure_managed_identity, - databricksGcpServiceAccount: d.databricks_gcp_service_account, - cloudflareApiToken: d.cloudflare_api_token, - comment: d.comment, - readOnly: d.read_only, - owner: d.owner, - id: d.id, - metastoreId: d.metastore_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - usedForManagedStorage: d.used_for_managed_storage, - fullName: d.full_name, - isolationMode: d.isolation_mode, - })); - -export const unmarshalCreateStorageCredentialSchema: z.ZodType = - z - .object({ - skip_validation: z.boolean().optional(), - name: z.string().optional(), - aws_iam_role: z.lazy(() => unmarshalAwsIamRoleSchema).optional(), - azure_service_principal: z - .lazy(() => unmarshalAzureServicePrincipalSchema) - .optional(), - gcp_service_account_key: z - .lazy(() => unmarshalGcpServiceAccountKeySchema) - .optional(), - azure_managed_identity: z - .lazy(() => unmarshalAzureManagedIdentitySchema) - .optional(), - databricks_gcp_service_account: z - .lazy(() => unmarshalDatabricksGcpServiceAccountSchema) - .optional(), - cloudflare_api_token: z - .lazy(() => unmarshalCloudflareApiTokenSchema) - .optional(), - comment: z.string().optional(), - read_only: z.boolean().optional(), - owner: z.string().optional(), - id: z.string().optional(), - metastore_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - used_for_managed_storage: z.boolean().optional(), - full_name: z.string().optional(), - isolation_mode: z.enum(IsolationMode).optional(), - }) - .transform(d => ({ - skipValidation: d.skip_validation, - name: d.name, - awsIamRole: d.aws_iam_role, - azureServicePrincipal: d.azure_service_principal, - gcpServiceAccountKey: d.gcp_service_account_key, - azureManagedIdentity: d.azure_managed_identity, - databricksGcpServiceAccount: d.databricks_gcp_service_account, - cloudflareApiToken: d.cloudflare_api_token, - comment: d.comment, - readOnly: d.read_only, - owner: d.owner, - id: d.id, - metastoreId: d.metastore_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - usedForManagedStorage: d.used_for_managed_storage, - fullName: d.full_name, - isolationMode: d.isolation_mode, - })); - export const unmarshalCredentialInfoSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -1170,19 +1057,6 @@ export const unmarshalGcpServiceAccountKeySchema: z.ZodType = - z - .object({ - url: z.string().optional(), - operation: z.enum(PathOperation).optional(), - dry_run: z.boolean().optional(), - }) - .transform(d => ({ - url: d.url, - operation: d.operation, - dryRun: d.dry_run, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalGenerateTemporaryPathCredential_ResponseSchema: z.ZodType = z @@ -1217,58 +1091,6 @@ export const unmarshalGenerateTemporaryPathCredential_ResponseSchema: z.ZodType< url: d.url, })); -export const unmarshalGenerateTemporaryServiceCredentialSchema: z.ZodType = - z - .object({ - credential_name: z.string().optional(), - azure_options: z - .lazy( - () => unmarshalGenerateTemporaryServiceCredential_AzureOptionsSchema - ) - .optional(), - gcp_options: z - .lazy( - () => unmarshalGenerateTemporaryServiceCredential_GcpOptionsSchema - ) - .optional(), - }) - .transform(d => ({ - credentialName: d.credential_name, - azureOptions: d.azure_options, - gcpOptions: d.gcp_options, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const unmarshalGenerateTemporaryServiceCredential_AzureOptionsSchema: z.ZodType = - z - .object({ - resources: z.array(z.string()).optional(), - }) - .transform(d => ({ - resources: d.resources, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const unmarshalGenerateTemporaryServiceCredential_GcpOptionsSchema: z.ZodType = - z - .object({ - scopes: z.array(z.string()).optional(), - }) - .transform(d => ({ - scopes: d.scopes, - })); - -export const unmarshalGenerateTemporaryTableCredentialSchema: z.ZodType = - z - .object({ - table_id: z.string().optional(), - operation: z.enum(TableOperation).optional(), - }) - .transform(d => ({ - tableId: d.table_id, - operation: d.operation, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalGenerateTemporaryTableCredential_ResponseSchema: z.ZodType = z @@ -1303,17 +1125,6 @@ export const unmarshalGenerateTemporaryTableCredential_ResponseSchema: z.ZodType url: d.url, })); -export const unmarshalGenerateTemporaryVolumeCredentialSchema: z.ZodType = - z - .object({ - volume_id: z.string().optional(), - operation: z.enum(VolumeOperation).optional(), - }) - .transform(d => ({ - volumeId: d.volume_id, - operation: d.operation, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalGenerateTemporaryVolumeCredential_ResponseSchema: z.ZodType = z @@ -1484,213 +1295,30 @@ export const unmarshalUcEncryptedTokenSchema: z.ZodType = z encryptedPayload: d.encrypted_payload, })); -export const unmarshalUpdateCredentialSchema: z.ZodType = z - .object({ - name_arg: z.string().optional(), - new_name: z.string().optional(), - skip_validation: z.boolean().optional(), - force: z.boolean().optional(), - name: z.string().optional(), - aws_iam_role: z.lazy(() => unmarshalAwsIamRoleSchema).optional(), - azure_service_principal: z - .lazy(() => unmarshalAzureServicePrincipalSchema) - .optional(), - gcp_service_account_key: z - .lazy(() => unmarshalGcpServiceAccountKeySchema) - .optional(), - azure_managed_identity: z - .lazy(() => unmarshalAzureManagedIdentitySchema) - .optional(), - databricks_gcp_service_account: z - .lazy(() => unmarshalDatabricksGcpServiceAccountSchema) - .optional(), - cloudflare_api_token: z - .lazy(() => unmarshalCloudflareApiTokenSchema) - .optional(), - comment: z.string().optional(), - read_only: z.boolean().optional(), - owner: z.string().optional(), - id: z.string().optional(), - metastore_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - used_for_managed_storage: z.boolean().optional(), - full_name: z.string().optional(), - isolation_mode: z.enum(IsolationMode).optional(), - }) - .transform(d => ({ - nameArg: d.name_arg, - newName: d.new_name, - skipValidation: d.skip_validation, - force: d.force, - name: d.name, - awsIamRole: d.aws_iam_role, - azureServicePrincipal: d.azure_service_principal, - gcpServiceAccountKey: d.gcp_service_account_key, - azureManagedIdentity: d.azure_managed_identity, - databricksGcpServiceAccount: d.databricks_gcp_service_account, - cloudflareApiToken: d.cloudflare_api_token, - comment: d.comment, - readOnly: d.read_only, - owner: d.owner, - id: d.id, - metastoreId: d.metastore_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - usedForManagedStorage: d.used_for_managed_storage, - fullName: d.full_name, - isolationMode: d.isolation_mode, - })); - -export const unmarshalUpdateStorageCredentialSchema: z.ZodType = - z - .object({ - name_arg: z.string().optional(), - new_name: z.string().optional(), - skip_validation: z.boolean().optional(), - force: z.boolean().optional(), - name: z.string().optional(), - aws_iam_role: z.lazy(() => unmarshalAwsIamRoleSchema).optional(), - azure_service_principal: z - .lazy(() => unmarshalAzureServicePrincipalSchema) - .optional(), - gcp_service_account_key: z - .lazy(() => unmarshalGcpServiceAccountKeySchema) - .optional(), - azure_managed_identity: z - .lazy(() => unmarshalAzureManagedIdentitySchema) - .optional(), - databricks_gcp_service_account: z - .lazy(() => unmarshalDatabricksGcpServiceAccountSchema) - .optional(), - cloudflare_api_token: z - .lazy(() => unmarshalCloudflareApiTokenSchema) - .optional(), - comment: z.string().optional(), - read_only: z.boolean().optional(), - owner: z.string().optional(), - id: z.string().optional(), - metastore_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - used_for_managed_storage: z.boolean().optional(), - full_name: z.string().optional(), - isolation_mode: z.enum(IsolationMode).optional(), - }) - .transform(d => ({ - nameArg: d.name_arg, - newName: d.new_name, - skipValidation: d.skip_validation, - force: d.force, - name: d.name, - awsIamRole: d.aws_iam_role, - azureServicePrincipal: d.azure_service_principal, - gcpServiceAccountKey: d.gcp_service_account_key, - azureManagedIdentity: d.azure_managed_identity, - databricksGcpServiceAccount: d.databricks_gcp_service_account, - cloudflareApiToken: d.cloudflare_api_token, - comment: d.comment, - readOnly: d.read_only, - owner: d.owner, - id: d.id, - metastoreId: d.metastore_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - usedForManagedStorage: d.used_for_managed_storage, - fullName: d.full_name, - isolationMode: d.isolation_mode, - })); - -export const unmarshalValidateCredentialSchema: z.ZodType = - z - .object({ - credential_name: z.string().optional(), - aws_iam_role: z.lazy(() => unmarshalAwsIamRoleSchema).optional(), - azure_managed_identity: z - .lazy(() => unmarshalAzureManagedIdentitySchema) - .optional(), - databricks_gcp_service_account: z - .lazy(() => unmarshalDatabricksGcpServiceAccountSchema) - .optional(), - external_location_name: z.string().optional(), - url: z.string().optional(), - read_only: z.boolean().optional(), - }) - .transform(d => ({ - credentialName: d.credential_name, - awsIamRole: d.aws_iam_role, - azureManagedIdentity: d.azure_managed_identity, - databricksGcpServiceAccount: d.databricks_gcp_service_account, - externalLocationName: d.external_location_name, - url: d.url, - readOnly: d.read_only, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalValidateCredential_ResponseSchema: z.ZodType = z .object({ results: z .array(z.lazy(() => unmarshalValidateCredential_ValidationResultSchema)) - .optional(), - isDir: z.boolean().optional(), - }) - .transform(d => ({ - results: d.results, - isDir: d.isDir, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const unmarshalValidateCredential_ValidationResultSchema: z.ZodType = - z - .object({ - result: z.enum(ValidateCredential_Result).optional(), - message: z.string().optional(), - }) - .transform(d => ({ - result: d.result, - message: d.message, - })); - -export const unmarshalValidateStorageCredentialSchema: z.ZodType = - z - .object({ - storage_credential_name: z.string().optional(), - aws_iam_role: z.lazy(() => unmarshalAwsIamRoleSchema).optional(), - azure_service_principal: z - .lazy(() => unmarshalAzureServicePrincipalSchema) - .optional(), - azure_managed_identity: z - .lazy(() => unmarshalAzureManagedIdentitySchema) - .optional(), - databricks_gcp_service_account: z - .lazy(() => unmarshalDatabricksGcpServiceAccountSchema) - .optional(), - cloudflare_api_token: z - .lazy(() => unmarshalCloudflareApiTokenSchema) - .optional(), - external_location_name: z.string().optional(), - url: z.string().optional(), - read_only: z.boolean().optional(), + .optional(), + isDir: z.boolean().optional(), }) .transform(d => ({ - storageCredentialName: d.storage_credential_name, - awsIamRole: d.aws_iam_role, - azureServicePrincipal: d.azure_service_principal, - azureManagedIdentity: d.azure_managed_identity, - databricksGcpServiceAccount: d.databricks_gcp_service_account, - cloudflareApiToken: d.cloudflare_api_token, - externalLocationName: d.external_location_name, - url: d.url, - readOnly: d.read_only, + results: d.results, + isDir: d.isDir, + })); + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export const unmarshalValidateCredential_ValidationResultSchema: z.ZodType = + z + .object({ + result: z.enum(ValidateCredential_Result).optional(), + message: z.string().optional(), + }) + .transform(d => ({ + result: d.result, + message: d.message, })); // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. @@ -1725,20 +1353,6 @@ export const unmarshalValidateStorageCredential_ValidationResultSchema: z.ZodTyp message: d.message, })); -export const marshalAwsCredentialsSchema: z.ZodType = z - .object({ - accessKeyId: z.string().optional(), - secretAccessKey: z.string().optional(), - sessionToken: z.string().optional(), - accessPoint: z.string().optional(), - }) - .transform(d => ({ - access_key_id: d.accessKeyId, - secret_access_key: d.secretAccessKey, - session_token: d.sessionToken, - access_point: d.accessPoint, - })); - export const marshalAwsIamRoleSchema: z.ZodType = z .object({ roleArn: z.string().optional(), @@ -1751,14 +1365,6 @@ export const marshalAwsIamRoleSchema: z.ZodType = z external_id: d.externalId, })); -export const marshalAzureActiveDirectoryTokenSchema: z.ZodType = z - .object({ - aadToken: z.string().optional(), - }) - .transform(d => ({ - aad_token: d.aadToken, - })); - export const marshalAzureManagedIdentitySchema: z.ZodType = z .object({ accessConnectorId: z.string().optional(), @@ -1783,14 +1389,6 @@ export const marshalAzureServicePrincipalSchema: z.ZodType = z client_secret: d.clientSecret, })); -export const marshalAzureUserDelegationSasSchema: z.ZodType = z - .object({ - sasToken: z.string().optional(), - }) - .transform(d => ({ - sas_token: d.sasToken, - })); - export const marshalCloudflareApiTokenSchema: z.ZodType = z .object({ accessKeyId: z.string().optional(), @@ -1915,60 +1513,6 @@ export const marshalCreateStorageCredentialSchema: z.ZodType = z isolation_mode: d.isolationMode, })); -export const marshalCredentialInfoSchema: z.ZodType = z - .object({ - name: z.string().optional(), - awsIamRole: z.lazy(() => marshalAwsIamRoleSchema).optional(), - azureServicePrincipal: z - .lazy(() => marshalAzureServicePrincipalSchema) - .optional(), - gcpServiceAccountKey: z - .lazy(() => marshalGcpServiceAccountKeySchema) - .optional(), - azureManagedIdentity: z - .lazy(() => marshalAzureManagedIdentitySchema) - .optional(), - databricksGcpServiceAccount: z - .lazy(() => marshalDatabricksGcpServiceAccountSchema) - .optional(), - 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.number().optional(), - createdBy: z.string().optional(), - updatedAt: z.number().optional(), - updatedBy: z.string().optional(), - usedForManagedStorage: z.boolean().optional(), - fullName: z.string().optional(), - isolationMode: z.enum(IsolationMode).optional(), - }) - .transform(d => ({ - name: d.name, - aws_iam_role: d.awsIamRole, - azure_service_principal: d.azureServicePrincipal, - gcp_service_account_key: d.gcpServiceAccountKey, - azure_managed_identity: d.azureManagedIdentity, - databricks_gcp_service_account: d.databricksGcpServiceAccount, - cloudflare_api_token: d.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 marshalDatabricksGcpServiceAccountSchema: z.ZodType = z .object({ email: z.string().optional(), @@ -1981,21 +1525,6 @@ export const marshalDatabricksGcpServiceAccountSchema: z.ZodType = z credential_id: d.credentialId, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteCredential_ResponseSchema: z.ZodType = z.object({}); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteStorageCredential_ResponseSchema: z.ZodType = - z.object({}); - -export const marshalGcpOauthTokenSchema: z.ZodType = z - .object({ - oauthToken: z.string().optional(), - }) - .transform(d => ({ - oauth_token: d.oauthToken, - })); - export const marshalGcpServiceAccountKeySchema: z.ZodType = z .object({ email: z.string().optional(), @@ -2020,32 +1549,6 @@ export const marshalGenerateTemporaryPathCredentialSchema: z.ZodType = z dry_run: d.dryRun, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGenerateTemporaryPathCredential_ResponseSchema: z.ZodType = - z - .object({ - awsTempCredentials: z.lazy(() => marshalAwsCredentialsSchema).optional(), - azureUserDelegationSas: z - .lazy(() => marshalAzureUserDelegationSasSchema) - .optional(), - gcpOauthToken: z.lazy(() => marshalGcpOauthTokenSchema).optional(), - azureAad: z.lazy(() => marshalAzureActiveDirectoryTokenSchema).optional(), - r2TempCredentials: z.lazy(() => marshalR2CredentialsSchema).optional(), - ucEncryptedToken: z.lazy(() => marshalUcEncryptedTokenSchema).optional(), - expirationTime: z.number().optional(), - url: z.string().optional(), - }) - .transform(d => ({ - aws_temp_credentials: d.awsTempCredentials, - azure_user_delegation_sas: d.azureUserDelegationSas, - gcp_oauth_token: d.gcpOauthToken, - azure_aad: d.azureAad, - r2_temp_credentials: d.r2TempCredentials, - uc_encrypted_token: d.ucEncryptedToken, - expiration_time: d.expirationTime, - url: d.url, - })); - export const marshalGenerateTemporaryServiceCredentialSchema: z.ZodType = z .object({ credentialName: z.string().optional(), @@ -2092,32 +1595,6 @@ export const marshalGenerateTemporaryTableCredentialSchema: z.ZodType = z operation: d.operation, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGenerateTemporaryTableCredential_ResponseSchema: z.ZodType = - z - .object({ - awsTempCredentials: z.lazy(() => marshalAwsCredentialsSchema).optional(), - azureUserDelegationSas: z - .lazy(() => marshalAzureUserDelegationSasSchema) - .optional(), - gcpOauthToken: z.lazy(() => marshalGcpOauthTokenSchema).optional(), - azureAad: z.lazy(() => marshalAzureActiveDirectoryTokenSchema).optional(), - r2TempCredentials: z.lazy(() => marshalR2CredentialsSchema).optional(), - ucEncryptedToken: z.lazy(() => marshalUcEncryptedTokenSchema).optional(), - expirationTime: z.number().optional(), - url: z.string().optional(), - }) - .transform(d => ({ - aws_temp_credentials: d.awsTempCredentials, - azure_user_delegation_sas: d.azureUserDelegationSas, - gcp_oauth_token: d.gcpOauthToken, - azure_aad: d.azureAad, - r2_temp_credentials: d.r2TempCredentials, - uc_encrypted_token: d.ucEncryptedToken, - expiration_time: d.expirationTime, - url: d.url, - })); - export const marshalGenerateTemporaryVolumeCredentialSchema: z.ZodType = z .object({ volumeId: z.string().optional(), @@ -2128,154 +1605,6 @@ export const marshalGenerateTemporaryVolumeCredentialSchema: z.ZodType = z operation: d.operation, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGenerateTemporaryVolumeCredential_ResponseSchema: z.ZodType = - z - .object({ - awsTempCredentials: z.lazy(() => marshalAwsCredentialsSchema).optional(), - azureUserDelegationSas: z - .lazy(() => marshalAzureUserDelegationSasSchema) - .optional(), - gcpOauthToken: z.lazy(() => marshalGcpOauthTokenSchema).optional(), - azureAad: z.lazy(() => marshalAzureActiveDirectoryTokenSchema).optional(), - r2TempCredentials: z.lazy(() => marshalR2CredentialsSchema).optional(), - ucEncryptedToken: z.lazy(() => marshalUcEncryptedTokenSchema).optional(), - expirationTime: z.number().optional(), - url: z.string().optional(), - }) - .transform(d => ({ - aws_temp_credentials: d.awsTempCredentials, - azure_user_delegation_sas: d.azureUserDelegationSas, - gcp_oauth_token: d.gcpOauthToken, - azure_aad: d.azureAad, - r2_temp_credentials: d.r2TempCredentials, - uc_encrypted_token: d.ucEncryptedToken, - expiration_time: d.expirationTime, - url: d.url, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListCredentials_ResponseSchema: z.ZodType = z - .object({ - credentials: z.array(z.lazy(() => marshalCredentialInfoSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - credentials: d.credentials, - next_page_token: d.nextPageToken, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListStorageCredentials_ResponseSchema: z.ZodType = z - .object({ - storageCredentials: z - .array(z.lazy(() => marshalStorageCredentialInfoSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - storage_credentials: d.storageCredentials, - next_page_token: d.nextPageToken, - })); - -export const marshalR2CredentialsSchema: z.ZodType = z - .object({ - accessKeyId: z.string().optional(), - secretAccessKey: z.string().optional(), - sessionToken: z.string().optional(), - }) - .transform(d => ({ - access_key_id: d.accessKeyId, - secret_access_key: d.secretAccessKey, - session_token: d.sessionToken, - })); - -export const marshalStorageCredentialInfoSchema: z.ZodType = z - .object({ - name: z.string().optional(), - awsIamRole: z.lazy(() => marshalAwsIamRoleSchema).optional(), - azureServicePrincipal: z - .lazy(() => marshalAzureServicePrincipalSchema) - .optional(), - gcpServiceAccountKey: z - .lazy(() => marshalGcpServiceAccountKeySchema) - .optional(), - azureManagedIdentity: z - .lazy(() => marshalAzureManagedIdentitySchema) - .optional(), - databricksGcpServiceAccount: z - .lazy(() => marshalDatabricksGcpServiceAccountSchema) - .optional(), - 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.number().optional(), - createdBy: z.string().optional(), - updatedAt: z.number().optional(), - updatedBy: z.string().optional(), - usedForManagedStorage: z.boolean().optional(), - fullName: z.string().optional(), - isolationMode: z.enum(IsolationMode).optional(), - }) - .transform(d => ({ - name: d.name, - aws_iam_role: d.awsIamRole, - azure_service_principal: d.azureServicePrincipal, - gcp_service_account_key: d.gcpServiceAccountKey, - azure_managed_identity: d.azureManagedIdentity, - databricks_gcp_service_account: d.databricksGcpServiceAccount, - cloudflare_api_token: d.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 marshalTemporaryCredentialsSchema: z.ZodType = z - .object({ - awsTempCredentials: z.lazy(() => marshalAwsCredentialsSchema).optional(), - azureUserDelegationSas: z - .lazy(() => marshalAzureUserDelegationSasSchema) - .optional(), - gcpOauthToken: z.lazy(() => marshalGcpOauthTokenSchema).optional(), - azureAad: z.lazy(() => marshalAzureActiveDirectoryTokenSchema).optional(), - r2TempCredentials: z.lazy(() => marshalR2CredentialsSchema).optional(), - ucEncryptedToken: z.lazy(() => marshalUcEncryptedTokenSchema).optional(), - expirationTime: z.number().optional(), - url: z.string().optional(), - }) - .transform(d => ({ - aws_temp_credentials: d.awsTempCredentials, - azure_user_delegation_sas: d.azureUserDelegationSas, - gcp_oauth_token: d.gcpOauthToken, - azure_aad: d.azureAad, - r2_temp_credentials: d.r2TempCredentials, - uc_encrypted_token: d.ucEncryptedToken, - expiration_time: d.expirationTime, - url: d.url, - })); - -export const marshalUcEncryptedTokenSchema: z.ZodType = z - .object({ - encryptedPayload: z.string().optional(), - }) - .transform(d => ({ - encrypted_payload: d.encryptedPayload, - })); - export const marshalUpdateCredentialSchema: z.ZodType = z .object({ nameArg: z.string().optional(), @@ -2424,30 +1753,6 @@ export const marshalValidateCredentialSchema: z.ZodType = z read_only: d.readOnly, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalValidateCredential_ResponseSchema: z.ZodType = z - .object({ - results: z - .array(z.lazy(() => marshalValidateCredential_ValidationResultSchema)) - .optional(), - isDir: z.boolean().optional(), - }) - .transform(d => ({ - results: d.results, - isDir: d.isDir, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalValidateCredential_ValidationResultSchema: z.ZodType = z - .object({ - result: z.enum(ValidateCredential_Result).optional(), - message: z.string().optional(), - }) - .transform(d => ({ - result: d.result, - message: d.message, - })); - export const marshalValidateStorageCredentialSchema: z.ZodType = z .object({ storageCredentialName: z.string().optional(), @@ -2479,32 +1784,3 @@ export const marshalValidateStorageCredentialSchema: z.ZodType = z url: d.url, read_only: d.readOnly, })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalValidateStorageCredential_ResponseSchema: z.ZodType = z - .object({ - isDir: z.boolean().optional(), - results: z - .array( - z.lazy(() => marshalValidateStorageCredential_ValidationResultSchema) - ) - .optional(), - }) - .transform(d => ({ - isDir: d.isDir, - results: d.results, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalValidateStorageCredential_ValidationResultSchema: z.ZodType = - z - .object({ - operation: z.enum(ValidateStorageCredential_FileOperation).optional(), - result: z.enum(ValidateStorageCredential_Result).optional(), - message: z.string().optional(), - }) - .transform(d => ({ - operation: d.operation, - result: d.result, - message: d.message, - })); diff --git a/packages/dataclassification/src/v1/client.ts b/packages/dataclassification/src/v1/client.ts index 927d4c78..20f2d11d 100644 --- a/packages/dataclassification/src/v1/client.ts +++ b/packages/dataclassification/src/v1/client.ts @@ -125,7 +125,7 @@ export class Client { const url = `${this.host}/api/data-classification/v1/${req.catalogConfig?.name ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; diff --git a/packages/dataclassification/src/v1/model.ts b/packages/dataclassification/src/v1/model.ts index 4edc639d..b897ff5c 100644 --- a/packages/dataclassification/src/v1/model.ts +++ b/packages/dataclassification/src/v1/model.ts @@ -1,5 +1,7 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; /** Auto-tagging mode. */ @@ -92,7 +94,7 @@ export interface UpdateCatalogConfigRequest { */ catalogConfig?: CatalogConfig | undefined; /** Field mask specifying which fields to update. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalAutoTaggingConfigSchema: z.ZodType = z @@ -173,3 +175,48 @@ export const marshalCatalogConfig_SchemaNamesSchema: z.ZodType = z .transform(d => ({ names: d.names, })); + +const autoTaggingConfigFieldMaskSchema: FieldMaskSchema = { + autoTaggingMode: {wire: 'auto_tagging_mode'}, + classificationTag: {wire: 'classification_tag'}, +}; + +export function autoTaggingConfigFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + autoTaggingConfigFieldMaskSchema + ); +} + +const catalogConfigFieldMaskSchema: FieldMaskSchema = { + autoTagConfigs: {wire: 'auto_tag_configs'}, + effectiveAutoTagConfigs: {wire: 'effective_auto_tag_configs'}, + includedSchemas: { + wire: 'included_schemas', + children: () => catalogConfig_SchemaNamesFieldMaskSchema, + }, + name: {wire: 'name'}, +}; + +export function catalogConfigFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, catalogConfigFieldMaskSchema); +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +const catalogConfig_SchemaNamesFieldMaskSchema: FieldMaskSchema = { + names: {wire: 'names'}, +}; + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export function catalogConfig_SchemaNamesFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + catalogConfig_SchemaNamesFieldMaskSchema + ); +} diff --git a/packages/dataquality/src/v1/client.ts b/packages/dataquality/src/v1/client.ts index 9c5f911c..831c92a3 100644 --- a/packages/dataquality/src/v1/client.ts +++ b/packages/dataquality/src/v1/client.ts @@ -417,7 +417,7 @@ export class Client { const url = `${this.host}/api/data-quality/v1/monitors/${req.objectType ?? ''}/${req.objectId ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; @@ -448,7 +448,7 @@ export class Client { const url = `${this.host}/api/data-quality/v1/monitors/${req.objectType ?? ''}/${req.objectId ?? ''}/refreshes/${String(req.refreshId ?? '')}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; diff --git a/packages/dataquality/src/v1/model.ts b/packages/dataquality/src/v1/model.ts index f2b0ff22..9febb253 100644 --- a/packages/dataquality/src/v1/model.ts +++ b/packages/dataquality/src/v1/model.ts @@ -1,5 +1,7 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; /** The granularity for aggregating data into time windows based on their timestamp. */ @@ -508,7 +510,7 @@ export interface UpdateMonitorRequest { * 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?: string | undefined; + updateMask?: FieldMask | undefined; } /** Request to update a refresh. */ @@ -532,7 +534,7 @@ export interface UpdateRefreshRequest { /** The refresh to update. */ refresh?: Refresh | undefined; /** The field mask to specify which fields to update. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export interface ValidityCheckConfiguration { @@ -562,19 +564,6 @@ export const unmarshalAnomalyDetectionConfigSchema: z.ZodType = - z - .object({ - object_type: z.string().optional(), - object_id: z.string().optional(), - refresh_id: z.number().optional(), - }) - .transform(d => ({ - objectType: d.object_type, - objectId: d.object_id, - refreshId: d.refresh_id, - })); - export const unmarshalCancelRefreshResponseSchema: z.ZodType = z .object({ @@ -864,14 +853,6 @@ export const marshalCancelRefreshRequestSchema: z.ZodType = z refresh_id: d.refreshId, })); -export const marshalCancelRefreshResponseSchema: z.ZodType = z - .object({ - refresh: z.lazy(() => marshalRefreshSchema).optional(), - }) - .transform(d => ({ - refresh: d.refresh, - })); - export const marshalCronScheduleSchema: z.ZodType = z .object({ quartzCronExpression: z.string().optional(), @@ -970,26 +951,6 @@ export const marshalInferenceLogConfigSchema: z.ZodType = z prediction_probability_column: d.predictionProbabilityColumn, })); -export const marshalListMonitorResponseSchema: z.ZodType = z - .object({ - monitors: z.array(z.lazy(() => marshalMonitorSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - monitors: d.monitors, - next_page_token: d.nextPageToken, - })); - -export const marshalListRefreshResponseSchema: z.ZodType = z - .object({ - refreshes: z.array(z.lazy(() => marshalRefreshSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - refreshes: d.refreshes, - next_page_token: d.nextPageToken, - })); - export const marshalMonitorSchema: z.ZodType = z .object({ objectType: z.string().optional(), @@ -1107,3 +1068,259 @@ export const marshalValidityCheckConfigurationSchema: z.ZodType = z range_validity_check: d.rangeValidityCheck, uniqueness_validity_check: d.uniquenessValidityCheck, })); + +const anomalyDetectionConfigFieldMaskSchema: FieldMaskSchema = { + anomalyDetectionWorkflowId: {wire: 'anomaly_detection_workflow_id'}, + excludedTableFullNames: {wire: 'excluded_table_full_names'}, + jobType: {wire: 'job_type'}, + publishHealthIndicator: {wire: 'publish_health_indicator'}, + validityCheckConfigurations: {wire: 'validity_check_configurations'}, +}; + +export function anomalyDetectionConfigFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + anomalyDetectionConfigFieldMaskSchema + ); +} + +const cronScheduleFieldMaskSchema: FieldMaskSchema = { + pauseStatus: {wire: 'pause_status'}, + quartzCronExpression: {wire: 'quartz_cron_expression'}, + timezoneId: {wire: 'timezone_id'}, +}; + +export function cronScheduleFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, cronScheduleFieldMaskSchema); +} + +const dataProfilingConfigFieldMaskSchema: 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, + }, + latestMonitorFailureMessage: {wire: 'latest_monitor_failure_message'}, + monitorVersion: {wire: 'monitor_version'}, + monitoredTableName: {wire: 'monitored_table_name'}, + notificationSettings: { + wire: 'notification_settings', + children: () => notificationSettingsFieldMaskSchema, + }, + outputSchemaId: {wire: 'output_schema_id'}, + profileMetricsTableName: {wire: 'profile_metrics_table_name'}, + schedule: {wire: 'schedule', children: () => cronScheduleFieldMaskSchema}, + skipBuiltinDashboard: {wire: 'skip_builtin_dashboard'}, + slicingExprs: {wire: 'slicing_exprs'}, + snapshot: {wire: 'snapshot', children: () => snapshotConfigFieldMaskSchema}, + status: {wire: 'status'}, + timeSeries: { + wire: 'time_series', + children: () => timeSeriesConfigFieldMaskSchema, + }, + warehouseId: {wire: 'warehouse_id'}, +}; + +export function dataProfilingConfigFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + dataProfilingConfigFieldMaskSchema + ); +} + +const dataProfilingCustomMetricFieldMaskSchema: FieldMaskSchema = { + definition: {wire: 'definition'}, + inputColumns: {wire: 'input_columns'}, + name: {wire: 'name'}, + outputDataType: {wire: 'output_data_type'}, + type: {wire: 'type'}, +}; + +export function dataProfilingCustomMetricFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + dataProfilingCustomMetricFieldMaskSchema + ); +} + +const inferenceLogConfigFieldMaskSchema: FieldMaskSchema = { + granularities: {wire: 'granularities'}, + labelColumn: {wire: 'label_column'}, + modelIdColumn: {wire: 'model_id_column'}, + predictionColumn: {wire: 'prediction_column'}, + predictionProbabilityColumn: {wire: 'prediction_probability_column'}, + problemType: {wire: 'problem_type'}, + timestampColumn: {wire: 'timestamp_column'}, +}; + +export function inferenceLogConfigFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + inferenceLogConfigFieldMaskSchema + ); +} + +const monitorFieldMaskSchema: FieldMaskSchema = { + anomalyDetectionConfig: { + wire: 'anomaly_detection_config', + children: () => anomalyDetectionConfigFieldMaskSchema, + }, + dataProfilingConfig: { + wire: 'data_profiling_config', + children: () => dataProfilingConfigFieldMaskSchema, + }, + objectId: {wire: 'object_id'}, + objectType: {wire: 'object_type'}, +}; + +export function monitorFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, monitorFieldMaskSchema); +} + +const notificationDestinationFieldMaskSchema: FieldMaskSchema = { + emailAddresses: {wire: 'email_addresses'}, +}; + +export function notificationDestinationFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + notificationDestinationFieldMaskSchema + ); +} + +const notificationSettingsFieldMaskSchema: FieldMaskSchema = { + onFailure: { + wire: 'on_failure', + children: () => notificationDestinationFieldMaskSchema, + }, +}; + +export function notificationSettingsFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + notificationSettingsFieldMaskSchema + ); +} + +const percentNullValidityCheckFieldMaskSchema: FieldMaskSchema = { + columnNames: {wire: 'column_names'}, + upperBound: {wire: 'upper_bound'}, +}; + +export function percentNullValidityCheckFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + percentNullValidityCheckFieldMaskSchema + ); +} + +const rangeValidityCheckFieldMaskSchema: FieldMaskSchema = { + columnNames: {wire: 'column_names'}, + lowerBound: {wire: 'lower_bound'}, + upperBound: {wire: 'upper_bound'}, +}; + +export function rangeValidityCheckFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + rangeValidityCheckFieldMaskSchema + ); +} + +const refreshFieldMaskSchema: FieldMaskSchema = { + endTimeMs: {wire: 'end_time_ms'}, + message: {wire: 'message'}, + 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); +} + +const snapshotConfigFieldMaskSchema: FieldMaskSchema = {}; + +export function snapshotConfigFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, snapshotConfigFieldMaskSchema); +} + +const timeSeriesConfigFieldMaskSchema: FieldMaskSchema = { + granularities: {wire: 'granularities'}, + timestampColumn: {wire: 'timestamp_column'}, +}; + +export function timeSeriesConfigFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + timeSeriesConfigFieldMaskSchema + ); +} + +const uniquenessValidityCheckFieldMaskSchema: FieldMaskSchema = { + columnNames: {wire: 'column_names'}, +}; + +export function uniquenessValidityCheckFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + uniquenessValidityCheckFieldMaskSchema + ); +} + +const validityCheckConfigurationFieldMaskSchema: FieldMaskSchema = { + name: {wire: 'name'}, + percentNullValidityCheck: { + wire: 'percent_null_validity_check', + children: () => percentNullValidityCheckFieldMaskSchema, + }, + rangeValidityCheck: { + wire: 'range_validity_check', + children: () => rangeValidityCheckFieldMaskSchema, + }, + uniquenessValidityCheck: { + wire: 'uniqueness_validity_check', + children: () => uniquenessValidityCheckFieldMaskSchema, + }, +}; + +export function validityCheckConfigurationFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + validityCheckConfigurationFieldMaskSchema + ); +} diff --git a/packages/entitytagassignments/src/v1/client.ts b/packages/entitytagassignments/src/v1/client.ts index 9f1138ea..ddcfffc2 100644 --- a/packages/entitytagassignments/src/v1/client.ts +++ b/packages/entitytagassignments/src/v1/client.ts @@ -220,7 +220,7 @@ export class Client { const url = `${this.host}/api/2.1/unity-catalog/entity-tag-assignments/${req.tagAssignment?.entityType ?? ''}/${req.tagAssignment?.entityName ?? ''}/tags/${req.tagAssignment?.tagKey ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; diff --git a/packages/entitytagassignments/src/v1/model.ts b/packages/entitytagassignments/src/v1/model.ts index 3eee37f2..96afb699 100644 --- a/packages/entitytagassignments/src/v1/model.ts +++ b/packages/entitytagassignments/src/v1/model.ts @@ -1,6 +1,8 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. import {Temporal} from '@js-temporal/polyfill'; +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; /** Enum representing the source type of a tag assignment */ @@ -82,7 +84,7 @@ export interface ListEntityTagAssignmentsResponse { /** Request to update an entity tag assignment */ export interface UpdateEntityTagAssignmentRequest { tagAssignment?: EntityTagAssignment | undefined; - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalEntityTagAssignmentSchema: z.ZodType = @@ -149,14 +151,22 @@ export const marshalEntityTagAssignmentSchema: z.ZodType = z inherited: d.inherited, })); -export const marshalListEntityTagAssignmentsResponseSchema: z.ZodType = z - .object({ - tagAssignments: z - .array(z.lazy(() => marshalEntityTagAssignmentSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - tag_assignments: d.tagAssignments, - next_page_token: d.nextPageToken, - })); +const entityTagAssignmentFieldMaskSchema: FieldMaskSchema = { + entityName: {wire: 'entity_name'}, + entityType: {wire: 'entity_type'}, + inherited: {wire: 'inherited'}, + sourceType: {wire: 'source_type'}, + tagKey: {wire: 'tag_key'}, + tagValue: {wire: 'tag_value'}, + updateTime: {wire: 'update_time'}, + updatedBy: {wire: 'updated_by'}, +}; + +export function entityTagAssignmentFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + entityTagAssignmentFieldMaskSchema + ); +} diff --git a/packages/environments/src/v1/client.ts b/packages/environments/src/v1/client.ts index c38238c6..3a7631ae 100644 --- a/packages/environments/src/v1/client.ts +++ b/packages/environments/src/v1/client.ts @@ -324,7 +324,7 @@ export class Client { const url = `${this.host}/api/environments/v1/${req.defaultWorkspaceBaseEnvironment?.name ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; diff --git a/packages/environments/src/v1/model.ts b/packages/environments/src/v1/model.ts index 71c09f1c..32731e77 100644 --- a/packages/environments/src/v1/model.ts +++ b/packages/environments/src/v1/model.ts @@ -1,6 +1,8 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. import {Temporal} from '@js-temporal/polyfill'; +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; /** If changed, also update estore/namespaces/defaultbaseenvironments/latest.proto */ @@ -691,7 +693,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?: string | undefined; + updateMask?: FieldMask | undefined; } /** Request message for UpdateWorkspaceBaseEnvironment. */ @@ -808,15 +810,6 @@ export const unmarshalOperationSchema: z.ZodType = z response: d.response, })); -export const unmarshalRefreshWorkspaceBaseEnvironmentRequestSchema: z.ZodType = - z - .object({ - name: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - })); - export const unmarshalWorkspaceBaseEnvironmentSchema: z.ZodType = z .object({ @@ -859,21 +852,6 @@ export const unmarshalWorkspaceBaseEnvironmentSchema: z.ZodType = z.object({}); -export const marshalDatabricksServiceExceptionWithDetailsProtoSchema: z.ZodType = - z - .object({ - errorCode: z.enum(ErrorCode).optional(), - message: z.string().optional(), - stackTrace: z.string().optional(), - details: z.array(z.record(z.string(), z.unknown())).optional(), - }) - .transform(d => ({ - error_code: d.errorCode, - message: d.message, - stack_trace: d.stackTrace, - details: d.details, - })); - export const marshalDefaultWorkspaceBaseEnvironmentSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -886,36 +864,6 @@ export const marshalDefaultWorkspaceBaseEnvironmentSchema: z.ZodType = z gpu_workspace_base_environment: d.gpuWorkspaceBaseEnvironment, })); -export const marshalListWorkspaceBaseEnvironmentsResponseSchema: z.ZodType = z - .object({ - workspaceBaseEnvironments: z - .array(z.lazy(() => marshalWorkspaceBaseEnvironmentSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - workspace_base_environments: d.workspaceBaseEnvironments, - next_page_token: d.nextPageToken, - })); - -export const marshalOperationSchema: z.ZodType = z - .object({ - name: z.string().optional(), - metadata: z.record(z.string(), z.unknown()).optional(), - done: z.boolean().optional(), - error: z - .lazy(() => marshalDatabricksServiceExceptionWithDetailsProtoSchema) - .optional(), - response: z.record(z.string(), z.unknown()).optional(), - }) - .transform(d => ({ - name: d.name, - metadata: d.metadata, - done: d.done, - error: d.error, - response: d.response, - })); - export const marshalRefreshWorkspaceBaseEnvironmentRequestSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -962,5 +910,17 @@ export const marshalWorkspaceBaseEnvironmentSchema: z.ZodType = z base_environment_provider: d.baseEnvironmentProvider, })); -export const marshalWorkspaceBaseEnvironmentOperationMetadataSchema: z.ZodType = - z.object({}); +const defaultWorkspaceBaseEnvironmentFieldMaskSchema: FieldMaskSchema = { + cpuWorkspaceBaseEnvironment: {wire: 'cpu_workspace_base_environment'}, + gpuWorkspaceBaseEnvironment: {wire: 'gpu_workspace_base_environment'}, + name: {wire: 'name'}, +}; + +export function defaultWorkspaceBaseEnvironmentFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + defaultWorkspaceBaseEnvironmentFieldMaskSchema + ); +} diff --git a/packages/externallocations/src/v1/model.ts b/packages/externallocations/src/v1/model.ts index 31bf7488..53bd508c 100644 --- a/packages/externallocations/src/v1/model.ts +++ b/packages/externallocations/src/v1/model.ts @@ -312,59 +312,6 @@ export const unmarshalAzureQueueStorageSchema: z.ZodType = z managedResourceId: d.managed_resource_id, })); -export const unmarshalCreateExternalLocationSchema: z.ZodType = - z - .object({ - skip_validation: z.boolean().optional(), - name: z.string().optional(), - url: z.string().optional(), - credential_name: z.string().optional(), - read_only: z.boolean().optional(), - comment: z.string().optional(), - enable_file_events: z.boolean().optional(), - file_event_queue: z.lazy(() => unmarshalFileEventQueueSchema).optional(), - owner: z.string().optional(), - encryption_details: z - .lazy(() => unmarshalEncryptionDetailsSchema) - .optional(), - metastore_id: z.string().optional(), - credential_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - browse_only: z.boolean().optional(), - isolation_mode: z.enum(IsolationMode).optional(), - fallback: z.boolean().optional(), - effective_enable_file_events: z.boolean().optional(), - effective_file_event_queue: z - .lazy(() => unmarshalFileEventQueueSchema) - .optional(), - }) - .transform(d => ({ - skipValidation: d.skip_validation, - name: d.name, - url: d.url, - credentialName: d.credential_name, - readOnly: d.read_only, - comment: d.comment, - enableFileEvents: d.enable_file_events, - fileEventQueue: d.file_event_queue, - owner: d.owner, - encryptionDetails: d.encryption_details, - metastoreId: d.metastore_id, - credentialId: d.credential_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - browseOnly: d.browse_only, - isolationMode: d.isolation_mode, - fallback: d.fallback, - effectiveEnableFileEvents: d.effective_enable_file_events, - effectiveFileEventQueue: d.effective_file_event_queue, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalDeleteExternalLocation_ResponseSchema: z.ZodType = z.object({}); @@ -483,65 +430,6 @@ export const unmarshalSseEncryptionDetailsSchema: z.ZodType = - z - .object({ - name_arg: z.string().optional(), - new_name: z.string().optional(), - force: z.boolean().optional(), - skip_validation: z.boolean().optional(), - name: z.string().optional(), - url: z.string().optional(), - credential_name: z.string().optional(), - read_only: z.boolean().optional(), - comment: z.string().optional(), - enable_file_events: z.boolean().optional(), - file_event_queue: z.lazy(() => unmarshalFileEventQueueSchema).optional(), - owner: z.string().optional(), - encryption_details: z - .lazy(() => unmarshalEncryptionDetailsSchema) - .optional(), - metastore_id: z.string().optional(), - credential_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - browse_only: z.boolean().optional(), - isolation_mode: z.enum(IsolationMode).optional(), - fallback: z.boolean().optional(), - effective_enable_file_events: z.boolean().optional(), - effective_file_event_queue: z - .lazy(() => unmarshalFileEventQueueSchema) - .optional(), - }) - .transform(d => ({ - nameArg: d.name_arg, - newName: d.new_name, - force: d.force, - skipValidation: d.skip_validation, - name: d.name, - url: d.url, - credentialName: d.credential_name, - readOnly: d.read_only, - comment: d.comment, - enableFileEvents: d.enable_file_events, - fileEventQueue: d.file_event_queue, - owner: d.owner, - encryptionDetails: d.encryption_details, - metastoreId: d.metastore_id, - credentialId: d.credential_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - browseOnly: d.browse_only, - isolationMode: d.isolation_mode, - fallback: d.fallback, - effectiveEnableFileEvents: d.effective_enable_file_events, - effectiveFileEventQueue: d.effective_file_event_queue, - })); - export const marshalAwsSqsQueueSchema: z.ZodType = z .object({ queueUrl: z.string().optional(), @@ -616,11 +504,6 @@ export const marshalCreateExternalLocationSchema: z.ZodType = z effective_file_event_queue: d.effectiveFileEventQueue, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteExternalLocation_ResponseSchema: z.ZodType = z.object( - {} -); - export const marshalEncryptionDetailsSchema: z.ZodType = z .object({ sseEncryptionDetails: z @@ -631,54 +514,6 @@ export const marshalEncryptionDetailsSchema: z.ZodType = z sse_encryption_details: d.sseEncryptionDetails, })); -export const marshalExternalLocationInfoSchema: z.ZodType = z - .object({ - name: z.string().optional(), - url: z.string().optional(), - credentialName: z.string().optional(), - readOnly: z.boolean().optional(), - comment: z.string().optional(), - enableFileEvents: z.boolean().optional(), - fileEventQueue: z.lazy(() => marshalFileEventQueueSchema).optional(), - owner: z.string().optional(), - encryptionDetails: z.lazy(() => marshalEncryptionDetailsSchema).optional(), - metastoreId: z.string().optional(), - credentialId: z.string().optional(), - createdAt: z.number().optional(), - createdBy: z.string().optional(), - updatedAt: z.number().optional(), - updatedBy: z.string().optional(), - browseOnly: z.boolean().optional(), - isolationMode: z.enum(IsolationMode).optional(), - fallback: z.boolean().optional(), - effectiveEnableFileEvents: z.boolean().optional(), - effectiveFileEventQueue: z - .lazy(() => marshalFileEventQueueSchema) - .optional(), - }) - .transform(d => ({ - name: d.name, - url: d.url, - credential_name: d.credentialName, - read_only: d.readOnly, - comment: d.comment, - enable_file_events: d.enableFileEvents, - file_event_queue: d.fileEventQueue, - owner: d.owner, - encryption_details: d.encryptionDetails, - metastore_id: d.metastoreId, - credential_id: d.credentialId, - created_at: d.createdAt, - created_by: d.createdBy, - updated_at: d.updatedAt, - updated_by: d.updatedBy, - browse_only: d.browseOnly, - isolation_mode: d.isolationMode, - fallback: d.fallback, - effective_enable_file_events: d.effectiveEnableFileEvents, - effective_file_event_queue: d.effectiveFileEventQueue, - })); - export const marshalFileEventQueueSchema: z.ZodType = z .object({ providedAqs: z.lazy(() => marshalAzureQueueStorageSchema).optional(), @@ -707,19 +542,6 @@ export const marshalGcpPubsubSchema: z.ZodType = z managed_resource_id: d.managedResourceId, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListExternalLocations_ResponseSchema: z.ZodType = z - .object({ - externalLocations: z - .array(z.lazy(() => marshalExternalLocationInfoSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - external_locations: d.externalLocations, - next_page_token: d.nextPageToken, - })); - export const marshalSseEncryptionDetailsSchema: z.ZodType = z .object({ algorithm: z.enum(SseEncryptionAlgorithm).optional(), diff --git a/packages/features/src/v1/client.ts b/packages/features/src/v1/client.ts index d3e38730..442f1974 100644 --- a/packages/features/src/v1/client.ts +++ b/packages/features/src/v1/client.ts @@ -489,7 +489,7 @@ export class Client { const url = `${this.host}/api/2.0/feature-engineering/features/${req.feature?.fullName ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; @@ -524,7 +524,7 @@ export class Client { const url = `${this.host}/api/2.0/feature-engineering/features/kafka-configs/${req.kafkaConfig?.name ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; @@ -555,7 +555,7 @@ export class Client { const url = `${this.host}/api/2.0/feature-engineering/materialized-features/${req.materializedFeature?.materializedFeatureId ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; diff --git a/packages/features/src/v1/model.ts b/packages/features/src/v1/model.ts index 1fe62f64..5bba1688 100644 --- a/packages/features/src/v1/model.ts +++ b/packages/features/src/v1/model.ts @@ -1,6 +1,8 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. import {Temporal} from '@js-temporal/polyfill'; +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; /** @@ -612,14 +614,14 @@ export interface UpdateFeatureRequest { /** Feature to update. */ feature?: Feature | undefined; /** The list of fields to update. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export interface UpdateKafkaConfigRequest { /** The Kafka config to update. */ kafkaConfig?: KafkaConfig | undefined; /** The list of fields to update. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export interface UpdateMaterializedFeatureRequest { @@ -629,7 +631,7 @@ export interface UpdateMaterializedFeatureRequest { * Provide the materialization feature fields which should be updated. * Currently, only the pipeline_state field can be updated. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } /** Computes the population variance. */ @@ -733,17 +735,6 @@ export const unmarshalBackfillSourceSchema: z.ZodType = z deltaTableSource: d.delta_table_source, })); -export const unmarshalBatchCreateMaterializedFeaturesRequestSchema: z.ZodType = - z - .object({ - requests: z - .array(z.lazy(() => unmarshalCreateMaterializedFeatureRequestSchema)) - .optional(), - }) - .transform(d => ({ - requests: d.requests, - })); - export const unmarshalBatchCreateMaterializedFeaturesResponseSchema: z.ZodType = z .object({ @@ -795,17 +786,6 @@ export const unmarshalCountFunctionSchema: z.ZodType = z input: d.input, })); -export const unmarshalCreateMaterializedFeatureRequestSchema: z.ZodType = - z - .object({ - materialized_feature: z - .lazy(() => unmarshalMaterializedFeatureSchema) - .optional(), - }) - .transform(d => ({ - materializedFeature: d.materialized_feature, - })); - export const unmarshalDataSourceSchema: z.ZodType = z .object({ delta_table_source: z @@ -1320,16 +1300,6 @@ export const marshalBatchCreateMaterializedFeaturesRequestSchema: z.ZodType = z requests: d.requests, })); -export const marshalBatchCreateMaterializedFeaturesResponseSchema: z.ZodType = z - .object({ - materializedFeatures: z - .array(z.lazy(() => marshalMaterializedFeatureSchema)) - .optional(), - }) - .transform(d => ({ - materialized_features: d.materializedFeatures, - })); - export const marshalColumnIdentifierSchema: z.ZodType = z .object({ variantExprPath: z.string().optional(), @@ -1567,38 +1537,6 @@ export const marshalLineageContextSchema: z.ZodType = z job_context: d.jobContext, })); -export const marshalListFeaturesResponseSchema: z.ZodType = z - .object({ - features: z.array(z.lazy(() => marshalFeatureSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - features: d.features, - next_page_token: d.nextPageToken, - })); - -export const marshalListKafkaConfigsResponseSchema: z.ZodType = z - .object({ - kafkaConfigs: z.array(z.lazy(() => marshalKafkaConfigSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - kafka_configs: d.kafkaConfigs, - next_page_token: d.nextPageToken, - })); - -export const marshalListMaterializedFeaturesResponseSchema: z.ZodType = z - .object({ - materializedFeatures: z - .array(z.lazy(() => marshalMaterializedFeatureSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - materialized_features: d.materializedFeatures, - next_page_token: d.nextPageToken, - })); - export const marshalMaterializedFeatureSchema: z.ZodType = z .object({ materializedFeatureId: z.string().optional(), @@ -1786,3 +1724,580 @@ export const marshalVarSampFunctionSchema: z.ZodType = z .transform(d => ({ input: d.input, })); + +const aggregationFunctionFieldMaskSchema: FieldMaskSchema = { + approxCountDistinct: { + wire: 'approx_count_distinct', + children: () => approxCountDistinctFunctionFieldMaskSchema, + }, + approxPercentile: { + wire: 'approx_percentile', + children: () => approxPercentileFunctionFieldMaskSchema, + }, + avg: {wire: 'avg', children: () => avgFunctionFieldMaskSchema}, + countFunction: { + wire: 'count_function', + children: () => countFunctionFieldMaskSchema, + }, + first: {wire: 'first', children: () => firstFunctionFieldMaskSchema}, + last: {wire: 'last', children: () => lastFunctionFieldMaskSchema}, + max: {wire: 'max', children: () => maxFunctionFieldMaskSchema}, + min: {wire: 'min', children: () => minFunctionFieldMaskSchema}, + stddevPop: { + wire: 'stddev_pop', + children: () => stddevPopFunctionFieldMaskSchema, + }, + stddevSamp: { + wire: 'stddev_samp', + children: () => stddevSampFunctionFieldMaskSchema, + }, + sum: {wire: 'sum', children: () => sumFunctionFieldMaskSchema}, + timeWindow: {wire: 'time_window', children: () => timeWindowFieldMaskSchema}, + varPop: {wire: 'var_pop', children: () => varPopFunctionFieldMaskSchema}, + varSamp: {wire: 'var_samp', children: () => varSampFunctionFieldMaskSchema}, +}; + +export function aggregationFunctionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + aggregationFunctionFieldMaskSchema + ); +} + +const approxCountDistinctFunctionFieldMaskSchema: FieldMaskSchema = { + input: {wire: 'input'}, + relativeSd: {wire: 'relative_sd'}, +}; + +export function approxCountDistinctFunctionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + approxCountDistinctFunctionFieldMaskSchema + ); +} + +const approxPercentileFunctionFieldMaskSchema: FieldMaskSchema = { + accuracy: {wire: 'accuracy'}, + input: {wire: 'input'}, + percentile: {wire: 'percentile'}, +}; + +export function approxPercentileFunctionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + approxPercentileFunctionFieldMaskSchema + ); +} + +const authConfigFieldMaskSchema: FieldMaskSchema = { + ucServiceCredentialName: {wire: 'uc_service_credential_name'}, +}; + +export function authConfigFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, authConfigFieldMaskSchema); +} + +const avgFunctionFieldMaskSchema: FieldMaskSchema = { + input: {wire: 'input'}, +}; + +export function avgFunctionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, avgFunctionFieldMaskSchema); +} + +const backfillSourceFieldMaskSchema: FieldMaskSchema = { + deltaTableSource: { + wire: 'delta_table_source', + children: () => deltaTableSourceFieldMaskSchema, + }, +}; + +export function backfillSourceFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, backfillSourceFieldMaskSchema); +} + +const columnIdentifierFieldMaskSchema: FieldMaskSchema = { + variantExprPath: {wire: 'variant_expr_path'}, +}; + +export function columnIdentifierFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + columnIdentifierFieldMaskSchema + ); +} + +const columnSelectionFieldMaskSchema: FieldMaskSchema = { + column: {wire: 'column'}, +}; + +export function columnSelectionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + columnSelectionFieldMaskSchema + ); +} + +const continuousWindowFieldMaskSchema: FieldMaskSchema = { + offset: {wire: 'offset'}, + windowDuration: {wire: 'window_duration'}, +}; + +export function continuousWindowFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + continuousWindowFieldMaskSchema + ); +} + +const countFunctionFieldMaskSchema: FieldMaskSchema = { + input: {wire: 'input'}, +}; + +export function countFunctionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, countFunctionFieldMaskSchema); +} + +const dataSourceFieldMaskSchema: FieldMaskSchema = { + deltaTableSource: { + wire: 'delta_table_source', + children: () => deltaTableSourceFieldMaskSchema, + }, + kafkaSource: { + wire: 'kafka_source', + children: () => kafkaSourceFieldMaskSchema, + }, + requestSource: { + wire: 'request_source', + children: () => requestSourceFieldMaskSchema, + }, +}; + +export function dataSourceFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, dataSourceFieldMaskSchema); +} + +const deltaTableSourceFieldMaskSchema: FieldMaskSchema = { + dataframeSchema: {wire: 'dataframe_schema'}, + entityColumns: {wire: 'entity_columns'}, + filterCondition: {wire: 'filter_condition'}, + fullName: {wire: 'full_name'}, + timeseriesColumn: {wire: 'timeseries_column'}, + transformationSql: {wire: 'transformation_sql'}, +}; + +export function deltaTableSourceFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + deltaTableSourceFieldMaskSchema + ); +} + +const entityColumnFieldMaskSchema: FieldMaskSchema = { + name: {wire: 'name'}, +}; + +export function entityColumnFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, entityColumnFieldMaskSchema); +} + +const featureFieldMaskSchema: FieldMaskSchema = { + description: {wire: 'description'}, + entities: {wire: 'entities'}, + filterCondition: {wire: 'filter_condition'}, + fullName: {wire: 'full_name'}, + function: {wire: 'function', children: () => functionFieldMaskSchema}, + inputs: {wire: 'inputs'}, + lineageContext: { + wire: 'lineage_context', + children: () => lineageContextFieldMaskSchema, + }, + source: {wire: 'source', children: () => dataSourceFieldMaskSchema}, + timeWindow: {wire: 'time_window', children: () => timeWindowFieldMaskSchema}, + timeseriesColumn: { + wire: 'timeseries_column', + children: () => timeseriesColumnFieldMaskSchema, + }, +}; + +export function featureFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, featureFieldMaskSchema); +} + +const fieldDefinitionFieldMaskSchema: FieldMaskSchema = { + dataType: {wire: 'data_type'}, + name: {wire: 'name'}, +}; + +export function fieldDefinitionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + fieldDefinitionFieldMaskSchema + ); +} + +const firstFunctionFieldMaskSchema: FieldMaskSchema = { + input: {wire: 'input'}, +}; + +export function firstFunctionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, firstFunctionFieldMaskSchema); +} + +const flatSchemaFieldMaskSchema: FieldMaskSchema = { + fields: {wire: 'fields'}, +}; + +export function flatSchemaFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, flatSchemaFieldMaskSchema); +} + +const functionFieldMaskSchema: FieldMaskSchema = { + aggregationFunction: { + wire: 'aggregation_function', + children: () => aggregationFunctionFieldMaskSchema, + }, + columnSelection: { + wire: 'column_selection', + children: () => columnSelectionFieldMaskSchema, + }, + extraParameters: {wire: 'extra_parameters'}, + functionType: {wire: 'function_type'}, +}; + +export function functionFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, functionFieldMaskSchema); +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +const function_ExtraParameterFieldMaskSchema: FieldMaskSchema = { + key: {wire: 'key'}, + value: {wire: 'value'}, +}; + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export function function_ExtraParameterFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + function_ExtraParameterFieldMaskSchema + ); +} + +const jobContextFieldMaskSchema: FieldMaskSchema = { + jobId: {wire: 'job_id'}, + jobRunId: {wire: 'job_run_id'}, +}; + +export function jobContextFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, jobContextFieldMaskSchema); +} + +const kafkaConfigFieldMaskSchema: FieldMaskSchema = { + authConfig: {wire: 'auth_config', children: () => authConfigFieldMaskSchema}, + backfillSource: { + wire: 'backfill_source', + children: () => backfillSourceFieldMaskSchema, + }, + bootstrapServers: {wire: 'bootstrap_servers'}, + extraOptions: {wire: 'extra_options'}, + keySchema: {wire: 'key_schema', children: () => schemaConfigFieldMaskSchema}, + name: {wire: 'name'}, + subscriptionMode: { + wire: 'subscription_mode', + children: () => subscriptionModeFieldMaskSchema, + }, + valueSchema: { + wire: 'value_schema', + children: () => schemaConfigFieldMaskSchema, + }, +}; + +export function kafkaConfigFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, kafkaConfigFieldMaskSchema); +} + +const kafkaSourceFieldMaskSchema: FieldMaskSchema = { + entityColumnIdentifiers: {wire: 'entity_column_identifiers'}, + filterCondition: {wire: 'filter_condition'}, + name: {wire: 'name'}, + timeseriesColumnIdentifier: { + wire: 'timeseries_column_identifier', + children: () => columnIdentifierFieldMaskSchema, + }, +}; + +export function kafkaSourceFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, kafkaSourceFieldMaskSchema); +} + +const lastFunctionFieldMaskSchema: FieldMaskSchema = { + input: {wire: 'input'}, +}; + +export function lastFunctionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, lastFunctionFieldMaskSchema); +} + +const lineageContextFieldMaskSchema: FieldMaskSchema = { + jobContext: {wire: 'job_context', children: () => jobContextFieldMaskSchema}, + notebookId: {wire: 'notebook_id'}, +}; + +export function lineageContextFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, lineageContextFieldMaskSchema); +} + +const materializedFeatureFieldMaskSchema: FieldMaskSchema = { + cronSchedule: {wire: 'cron_schedule'}, + 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, + }, + onlineStoreConfig: { + wire: 'online_store_config', + children: () => onlineStoreConfigFieldMaskSchema, + }, + pipelineScheduleState: {wire: 'pipeline_schedule_state'}, + tableName: {wire: 'table_name'}, +}; + +export function materializedFeatureFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + materializedFeatureFieldMaskSchema + ); +} + +const maxFunctionFieldMaskSchema: FieldMaskSchema = { + input: {wire: 'input'}, +}; + +export function maxFunctionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, maxFunctionFieldMaskSchema); +} + +const minFunctionFieldMaskSchema: FieldMaskSchema = { + input: {wire: 'input'}, +}; + +export function minFunctionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, minFunctionFieldMaskSchema); +} + +const offlineStoreConfigFieldMaskSchema: FieldMaskSchema = { + catalogName: {wire: 'catalog_name'}, + schemaName: {wire: 'schema_name'}, + tableNamePrefix: {wire: 'table_name_prefix'}, +}; + +export function offlineStoreConfigFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + offlineStoreConfigFieldMaskSchema + ); +} + +const onlineStoreConfigFieldMaskSchema: FieldMaskSchema = { + catalogName: {wire: 'catalog_name'}, + onlineStoreName: {wire: 'online_store_name'}, + schemaName: {wire: 'schema_name'}, + tableNamePrefix: {wire: 'table_name_prefix'}, +}; + +export function onlineStoreConfigFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + onlineStoreConfigFieldMaskSchema + ); +} + +const requestSourceFieldMaskSchema: FieldMaskSchema = { + flatSchema: {wire: 'flat_schema', children: () => flatSchemaFieldMaskSchema}, +}; + +export function requestSourceFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, requestSourceFieldMaskSchema); +} + +const schemaConfigFieldMaskSchema: FieldMaskSchema = { + jsonSchema: {wire: 'json_schema'}, +}; + +export function schemaConfigFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, schemaConfigFieldMaskSchema); +} + +const slidingWindowFieldMaskSchema: FieldMaskSchema = { + slideDuration: {wire: 'slide_duration'}, + windowDuration: {wire: 'window_duration'}, +}; + +export function slidingWindowFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, slidingWindowFieldMaskSchema); +} + +const stddevPopFunctionFieldMaskSchema: FieldMaskSchema = { + input: {wire: 'input'}, +}; + +export function stddevPopFunctionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + stddevPopFunctionFieldMaskSchema + ); +} + +const stddevSampFunctionFieldMaskSchema: FieldMaskSchema = { + input: {wire: 'input'}, +}; + +export function stddevSampFunctionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + stddevSampFunctionFieldMaskSchema + ); +} + +const subscriptionModeFieldMaskSchema: FieldMaskSchema = { + assign: {wire: 'assign'}, + subscribe: {wire: 'subscribe'}, + subscribePattern: {wire: 'subscribe_pattern'}, +}; + +export function subscriptionModeFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + subscriptionModeFieldMaskSchema + ); +} + +const sumFunctionFieldMaskSchema: FieldMaskSchema = { + input: {wire: 'input'}, +}; + +export function sumFunctionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, sumFunctionFieldMaskSchema); +} + +const timeWindowFieldMaskSchema: FieldMaskSchema = { + continuous: { + wire: 'continuous', + children: () => continuousWindowFieldMaskSchema, + }, + sliding: {wire: 'sliding', children: () => slidingWindowFieldMaskSchema}, + tumbling: {wire: 'tumbling', children: () => tumblingWindowFieldMaskSchema}, +}; + +export function timeWindowFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, timeWindowFieldMaskSchema); +} + +const timeseriesColumnFieldMaskSchema: FieldMaskSchema = { + name: {wire: 'name'}, +}; + +export function timeseriesColumnFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + timeseriesColumnFieldMaskSchema + ); +} + +const tumblingWindowFieldMaskSchema: FieldMaskSchema = { + windowDuration: {wire: 'window_duration'}, +}; + +export function tumblingWindowFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, tumblingWindowFieldMaskSchema); +} + +const varPopFunctionFieldMaskSchema: FieldMaskSchema = { + input: {wire: 'input'}, +}; + +export function varPopFunctionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, varPopFunctionFieldMaskSchema); +} + +const varSampFunctionFieldMaskSchema: FieldMaskSchema = { + input: {wire: 'input'}, +}; + +export function varSampFunctionFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + varSampFunctionFieldMaskSchema + ); +} diff --git a/packages/featurestore/src/v1/client.ts b/packages/featurestore/src/v1/client.ts index c85746bd..53dbd0f1 100644 --- a/packages/featurestore/src/v1/client.ts +++ b/packages/featurestore/src/v1/client.ts @@ -217,7 +217,7 @@ export class Client { const url = `${this.host}/api/2.0/feature-store/online-stores/${req.onlineStore?.name ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; diff --git a/packages/featurestore/src/v1/model.ts b/packages/featurestore/src/v1/model.ts index 54c01379..6f3e1e32 100644 --- a/packages/featurestore/src/v1/model.ts +++ b/packages/featurestore/src/v1/model.ts @@ -1,6 +1,8 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. import {Temporal} from '@js-temporal/polyfill'; +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name. @@ -121,7 +123,7 @@ export interface UpdateOnlineStoreRequest { /** Online store to update. */ onlineStore?: OnlineStore | undefined; /** The list of fields to update. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalListOnlineStoresResponseSchema: z.ZodType = @@ -160,29 +162,6 @@ export const unmarshalOnlineStoreSchema: z.ZodType = z usagePolicyId: d.usage_policy_id, })); -export const unmarshalPublishSpecSchema: z.ZodType = z - .object({ - online_store: z.string().optional(), - online_table_name: z.string().optional(), - publish_mode: z.enum(PublishSpec_PublishMode).optional(), - }) - .transform(d => ({ - onlineStore: d.online_store, - onlineTableName: d.online_table_name, - publishMode: d.publish_mode, - })); - -export const unmarshalPublishTableRequestSchema: z.ZodType = - z - .object({ - source_table_name: z.string().optional(), - publish_spec: z.lazy(() => unmarshalPublishSpecSchema).optional(), - }) - .transform(d => ({ - sourceTableName: d.source_table_name, - publishSpec: d.publish_spec, - })); - export const unmarshalPublishTableResponseSchema: z.ZodType = z .object({ @@ -194,16 +173,6 @@ export const unmarshalPublishTableResponseSchema: z.ZodType marshalOnlineStoreSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - online_stores: d.onlineStores, - next_page_token: d.nextPageToken, - })); - export const marshalOnlineStoreSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -249,12 +218,18 @@ export const marshalPublishTableRequestSchema: z.ZodType = z publish_spec: d.publishSpec, })); -export const marshalPublishTableResponseSchema: z.ZodType = z - .object({ - onlineTableName: z.string().optional(), - pipelineId: z.string().optional(), - }) - .transform(d => ({ - online_table_name: d.onlineTableName, - pipeline_id: d.pipelineId, - })); +const onlineStoreFieldMaskSchema: 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( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, onlineStoreFieldMaskSchema); +} diff --git a/packages/files/src/v2/model.ts b/packages/files/src/v2/model.ts index 869fb2a2..f1b98a42 100644 --- a/packages/files/src/v2/model.ts +++ b/packages/files/src/v2/model.ts @@ -136,45 +136,14 @@ export interface Read_Response { data?: Uint8Array | undefined; } -export const unmarshalAddBlockSchema: z.ZodType = z - .object({ - handle: z.number().optional(), - data: z - .string() - .transform(s => Uint8Array.from(atob(s), c => c.charCodeAt(0))) - .optional(), - }) - .transform(d => ({ - handle: d.handle, - data: d.data, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalAddBlock_ResponseSchema: z.ZodType = z.object({}); -export const unmarshalCloseSchema: z.ZodType = z - .object({ - handle: z.number().optional(), - }) - .transform(d => ({ - handle: d.handle, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalClose_ResponseSchema: z.ZodType = z.object({}); -export const unmarshalCreateSchema: z.ZodType = z - .object({ - path: z.string().optional(), - overwrite: z.boolean().optional(), - }) - .transform(d => ({ - path: d.path, - overwrite: d.overwrite, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalCreate_ResponseSchema: z.ZodType = z .object({ @@ -184,16 +153,6 @@ export const unmarshalCreate_ResponseSchema: z.ZodType = z handle: d.handle, })); -export const unmarshalDeleteSchema: z.ZodType = z - .object({ - path: z.string().optional(), - recursive: z.boolean().optional(), - }) - .transform(d => ({ - path: d.path, - recursive: d.recursive, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalDelete_ResponseSchema: z.ZodType = z.object({}); @@ -238,48 +197,15 @@ export const unmarshalListStatus_ResponseSchema: z.ZodType files: d.files, })); -export const unmarshalMkDirsSchema: z.ZodType = z - .object({ - path: z.string().optional(), - }) - .transform(d => ({ - path: d.path, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalMkDirs_ResponseSchema: z.ZodType = z.object({}); -export const unmarshalMoveSchema: z.ZodType = z - .object({ - source_path: z.string().optional(), - destination_path: z.string().optional(), - }) - .transform(d => ({ - sourcePath: d.source_path, - destinationPath: d.destination_path, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalMove_ResponseSchema: z.ZodType = z.object( {} ); -export const unmarshalPutSchema: z.ZodType = z - .object({ - path: z.string().optional(), - contents: z - .string() - .transform(s => Uint8Array.from(atob(s), c => c.charCodeAt(0))) - .optional(), - overwrite: z.boolean().optional(), - }) - .transform(d => ({ - path: d.path, - contents: d.contents, - overwrite: d.overwrite, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalPut_ResponseSchema: z.ZodType = z.object( {} @@ -314,9 +240,6 @@ export const marshalAddBlockSchema: z.ZodType = z data: d.data, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalAddBlock_ResponseSchema: z.ZodType = z.object({}); - export const marshalCloseSchema: z.ZodType = z .object({ handle: z.number().optional(), @@ -325,9 +248,6 @@ export const marshalCloseSchema: z.ZodType = z handle: d.handle, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalClose_ResponseSchema: z.ZodType = z.object({}); - export const marshalCreateSchema: z.ZodType = z .object({ path: z.string().optional(), @@ -338,15 +258,6 @@ export const marshalCreateSchema: z.ZodType = z overwrite: d.overwrite, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCreate_ResponseSchema: z.ZodType = z - .object({ - handle: z.number().optional(), - }) - .transform(d => ({ - handle: d.handle, - })); - export const marshalDeleteSchema: z.ZodType = z .object({ path: z.string().optional(), @@ -357,47 +268,6 @@ export const marshalDeleteSchema: z.ZodType = z recursive: d.recursive, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDelete_ResponseSchema: z.ZodType = z.object({}); - -export const marshalFileInfoSchema: z.ZodType = z - .object({ - path: z.string().optional(), - isDir: z.boolean().optional(), - fileSize: z.number().optional(), - modificationTime: z.number().optional(), - }) - .transform(d => ({ - path: d.path, - is_dir: d.isDir, - file_size: d.fileSize, - modification_time: d.modificationTime, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGetStatus_ResponseSchema: z.ZodType = z - .object({ - path: z.string().optional(), - isDir: z.boolean().optional(), - fileSize: z.number().optional(), - modificationTime: z.number().optional(), - }) - .transform(d => ({ - path: d.path, - is_dir: d.isDir, - file_size: d.fileSize, - modification_time: d.modificationTime, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListStatus_ResponseSchema: z.ZodType = z - .object({ - files: z.array(z.lazy(() => marshalFileInfoSchema)).optional(), - }) - .transform(d => ({ - files: d.files, - })); - export const marshalMkDirsSchema: z.ZodType = z .object({ path: z.string().optional(), @@ -406,9 +276,6 @@ export const marshalMkDirsSchema: z.ZodType = z path: d.path, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalMkDirs_ResponseSchema: z.ZodType = z.object({}); - export const marshalMoveSchema: z.ZodType = z .object({ sourcePath: z.string().optional(), @@ -419,9 +286,6 @@ export const marshalMoveSchema: z.ZodType = z destination_path: d.destinationPath, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalMove_ResponseSchema: z.ZodType = z.object({}); - export const marshalPutSchema: z.ZodType = z .object({ path: z.string().optional(), @@ -438,22 +302,3 @@ export const marshalPutSchema: z.ZodType = z contents: d.contents, overwrite: d.overwrite, })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalPut_ResponseSchema: z.ZodType = z.object({}); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalRead_ResponseSchema: z.ZodType = z - .object({ - bytesRead: z.number().optional(), - data: z - .any() - .transform((d: Uint8Array) => - btoa(Array.from(d, b => String.fromCharCode(b)).join('')) - ) - .optional(), - }) - .transform(d => ({ - bytes_read: d.bytesRead, - data: d.data, - })); diff --git a/packages/functions/src/v1/model.ts b/packages/functions/src/v1/model.ts index e16905c5..c29719a5 100644 --- a/packages/functions/src/v1/model.ts +++ b/packages/functions/src/v1/model.ts @@ -409,87 +409,6 @@ export const unmarshalConnectionDependencySchema: z.ZodType = z - .object({ - name: z.string().optional(), - catalog_name: z.string().optional(), - schema_name: z.string().optional(), - input_params: z - .lazy(() => unmarshalFunctionParameterInfosSchema) - .optional(), - data_type: z.enum(ColumnTypeName).optional(), - full_data_type: z.string().optional(), - routine_body: z.enum(FunctionInfo_RoutineBody).optional(), - routine_definition: z.string().optional(), - parameter_style: z.enum(FunctionInfo_ParameterStyle).optional(), - is_deterministic: z.boolean().optional(), - sql_data_access: z.enum(FunctionInfo_SqlDataAccess).optional(), - is_null_call: z.boolean().optional(), - security_type: z.enum(FunctionInfo_SecurityType).optional(), - specific_name: z.string().optional(), - return_params: z - .lazy(() => unmarshalFunctionParameterInfosSchema) - .optional(), - external_name: z.string().optional(), - external_language: z.string().optional(), - sql_path: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - properties: z.string().optional(), - routine_dependencies: z - .lazy(() => unmarshalDependencyListSchema) - .optional(), - metastore_id: z.string().optional(), - full_name: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - function_id: z.string().optional(), - browse_only: z.boolean().optional(), - }) - .transform(d => ({ - name: d.name, - catalogName: d.catalog_name, - schemaName: d.schema_name, - inputParams: d.input_params, - dataType: d.data_type, - fullDataType: d.full_data_type, - routineBody: d.routine_body, - routineDefinition: d.routine_definition, - parameterStyle: d.parameter_style, - isDeterministic: d.is_deterministic, - sqlDataAccess: d.sql_data_access, - isNullCall: d.is_null_call, - securityType: d.security_type, - specificName: d.specific_name, - returnParams: d.return_params, - externalName: d.external_name, - externalLanguage: d.external_language, - sqlPath: d.sql_path, - owner: d.owner, - comment: d.comment, - properties: d.properties, - routineDependencies: d.routine_dependencies, - metastoreId: d.metastore_id, - fullName: d.full_name, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - functionId: d.function_id, - browseOnly: d.browse_only, - })); - -export const unmarshalCreateFunctionRequestSchema: z.ZodType = - z - .object({ - function_info: z.lazy(() => unmarshalCreateFunctionSchema).optional(), - }) - .transform(d => ({ - functionInfo: d.function_info, - })); - export const unmarshalCredentialDependencySchema: z.ZodType = z .object({ @@ -680,80 +599,6 @@ export const unmarshalTableDependencySchema: z.ZodType = z tableFullName: d.table_full_name, })); -export const unmarshalUpdateFunctionSchema: z.ZodType = z - .object({ - full_name_arg: z.string().optional(), - name: z.string().optional(), - catalog_name: z.string().optional(), - schema_name: z.string().optional(), - input_params: z - .lazy(() => unmarshalFunctionParameterInfosSchema) - .optional(), - data_type: z.enum(ColumnTypeName).optional(), - full_data_type: z.string().optional(), - routine_body: z.enum(FunctionInfo_RoutineBody).optional(), - routine_definition: z.string().optional(), - parameter_style: z.enum(FunctionInfo_ParameterStyle).optional(), - is_deterministic: z.boolean().optional(), - sql_data_access: z.enum(FunctionInfo_SqlDataAccess).optional(), - is_null_call: z.boolean().optional(), - security_type: z.enum(FunctionInfo_SecurityType).optional(), - specific_name: z.string().optional(), - return_params: z - .lazy(() => unmarshalFunctionParameterInfosSchema) - .optional(), - external_name: z.string().optional(), - external_language: z.string().optional(), - sql_path: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - properties: z.string().optional(), - routine_dependencies: z - .lazy(() => unmarshalDependencyListSchema) - .optional(), - metastore_id: z.string().optional(), - full_name: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - function_id: z.string().optional(), - browse_only: z.boolean().optional(), - }) - .transform(d => ({ - fullNameArg: d.full_name_arg, - name: d.name, - catalogName: d.catalog_name, - schemaName: d.schema_name, - inputParams: d.input_params, - dataType: d.data_type, - fullDataType: d.full_data_type, - routineBody: d.routine_body, - routineDefinition: d.routine_definition, - parameterStyle: d.parameter_style, - isDeterministic: d.is_deterministic, - sqlDataAccess: d.sql_data_access, - isNullCall: d.is_null_call, - securityType: d.security_type, - specificName: d.specific_name, - returnParams: d.return_params, - externalName: d.external_name, - externalLanguage: d.external_language, - sqlPath: d.sql_path, - owner: d.owner, - comment: d.comment, - properties: d.properties, - routineDependencies: d.routine_dependencies, - metastoreId: d.metastore_id, - fullName: d.full_name, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - functionId: d.function_id, - browseOnly: d.browse_only, - })); - export const unmarshalVolumeDependencySchema: z.ZodType = z .object({ volume_full_name: z.string().optional(), @@ -852,9 +697,6 @@ export const marshalCredentialDependencySchema: z.ZodType = z credential_name: d.credentialName, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteFunction_ResponseSchema: z.ZodType = z.object({}); - export const marshalDependencySchema: z.ZodType = z .object({ table: z.lazy(() => marshalTableDependencySchema).optional(), @@ -889,72 +731,6 @@ export const marshalFunctionDependencySchema: z.ZodType = z function_full_name: d.functionFullName, })); -export const marshalFunctionInfoSchema: z.ZodType = z - .object({ - name: z.string().optional(), - catalogName: z.string().optional(), - schemaName: z.string().optional(), - inputParams: z.lazy(() => marshalFunctionParameterInfosSchema).optional(), - dataType: z.enum(ColumnTypeName).optional(), - fullDataType: z.string().optional(), - routineBody: z.enum(FunctionInfo_RoutineBody).optional(), - routineDefinition: z.string().optional(), - parameterStyle: z.enum(FunctionInfo_ParameterStyle).optional(), - isDeterministic: z.boolean().optional(), - sqlDataAccess: z.enum(FunctionInfo_SqlDataAccess).optional(), - isNullCall: z.boolean().optional(), - securityType: z.enum(FunctionInfo_SecurityType).optional(), - specificName: z.string().optional(), - returnParams: z.lazy(() => marshalFunctionParameterInfosSchema).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(), - metastoreId: z.string().optional(), - fullName: z.string().optional(), - createdAt: z.number().optional(), - createdBy: z.string().optional(), - updatedAt: z.number().optional(), - updatedBy: z.string().optional(), - functionId: z.string().optional(), - browseOnly: z.boolean().optional(), - }) - .transform(d => ({ - name: d.name, - catalog_name: d.catalogName, - schema_name: d.schemaName, - input_params: d.inputParams, - data_type: d.dataType, - full_data_type: d.fullDataType, - routine_body: d.routineBody, - routine_definition: d.routineDefinition, - parameter_style: d.parameterStyle, - is_deterministic: d.isDeterministic, - sql_data_access: d.sqlDataAccess, - is_null_call: d.isNullCall, - security_type: d.securityType, - specific_name: d.specificName, - return_params: d.returnParams, - external_name: d.externalName, - external_language: d.externalLanguage, - sql_path: d.sqlPath, - owner: d.owner, - comment: d.comment, - properties: d.properties, - routine_dependencies: d.routineDependencies, - metastore_id: d.metastoreId, - full_name: d.fullName, - created_at: d.createdAt, - created_by: d.createdBy, - updated_at: d.updatedAt, - updated_by: d.updatedBy, - function_id: d.functionId, - browse_only: d.browseOnly, - })); - export const marshalFunctionParameterInfoSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -995,17 +771,6 @@ export const marshalFunctionParameterInfosSchema: z.ZodType = z parameters: d.parameters, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListFunctions_ResponseSchema: z.ZodType = z - .object({ - functions: z.array(z.lazy(() => marshalFunctionInfoSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - functions: d.functions, - next_page_token: d.nextPageToken, - })); - export const marshalSecretDependencySchema: z.ZodType = z .object({ secretFullName: z.string().optional(), diff --git a/packages/genie/src/v1/model.ts b/packages/genie/src/v1/model.ts index b83e8f18..27ffa78d 100644 --- a/packages/genie/src/v1/model.ts +++ b/packages/genie/src/v1/model.ts @@ -1918,62 +1918,6 @@ export const unmarshalGenieConversationSummarySchema: z.ZodType = - z - .object({ - space_id: z.string().optional(), - conversation_id: z.string().optional(), - content: z.string().optional(), - }) - .transform(d => ({ - spaceId: d.space_id, - conversationId: d.conversation_id, - content: d.content, - })); - -export const unmarshalGenieCreateEvalRunRequestSchema: z.ZodType = - z - .object({ - space_id: z.string().optional(), - benchmark_question_ids: z.array(z.string()).optional(), - }) - .transform(d => ({ - spaceId: d.space_id, - benchmarkQuestionIds: d.benchmark_question_ids, - })); - -export const unmarshalGenieCreateMessageCommentRequestSchema: z.ZodType = - z - .object({ - space_id: z.string().optional(), - conversation_id: z.string().optional(), - message_id: z.string().optional(), - content: z.string().optional(), - }) - .transform(d => ({ - spaceId: d.space_id, - conversationId: d.conversation_id, - messageId: d.message_id, - content: d.content, - })); - -export const unmarshalGenieCreateSpaceRequestSchema: z.ZodType = - z - .object({ - warehouse_id: z.string().optional(), - parent_path: z.string().optional(), - serialized_space: z.string().optional(), - title: z.string().optional(), - description: z.string().optional(), - }) - .transform(d => ({ - warehouseId: d.warehouse_id, - parentPath: d.parent_path, - serializedSpace: d.serialized_space, - title: d.title, - description: d.description, - })); - export const unmarshalGenieEvalResponseSchema: z.ZodType = z .object({ response: z.string().optional(), @@ -2062,34 +2006,6 @@ export const unmarshalGenieEvalRunResponseSchema: z.ZodType = - z - .object({ - message_id: z.string().optional(), - space_id: z.string().optional(), - conversation_id: z.string().optional(), - attachment_id: z.string().optional(), - }) - .transform(d => ({ - messageId: d.message_id, - spaceId: d.space_id, - conversationId: d.conversation_id, - attachmentId: d.attachment_id, - })); - -export const unmarshalGenieExecuteMessageQueryRequestSchema: z.ZodType = - z - .object({ - message_id: z.string().optional(), - space_id: z.string().optional(), - conversation_id: z.string().optional(), - }) - .transform(d => ({ - messageId: d.message_id, - spaceId: d.space_id, - conversationId: d.conversation_id, - })); - export const unmarshalGenieFeedbackSchema: z.ZodType = z .object({ rating: z.enum(GenieFeedbackRating).optional(), @@ -2100,21 +2016,6 @@ export const unmarshalGenieFeedbackSchema: z.ZodType = z comment: d.comment, })); -export const unmarshalGenieGenerateDownloadFullQueryResultRequestSchema: z.ZodType = - z - .object({ - space_id: z.string().optional(), - conversation_id: z.string().optional(), - message_id: z.string().optional(), - attachment_id: z.string().optional(), - }) - .transform(d => ({ - spaceId: d.space_id, - conversationId: d.conversation_id, - messageId: d.message_id, - attachmentId: d.attachment_id, - })); - export const unmarshalGenieGenerateDownloadFullQueryResultResponseSchema: z.ZodType = z .object({ @@ -2330,23 +2231,6 @@ export const unmarshalGenieResultMetadataSchema: z.ZodType isTruncated: d.is_truncated, })); -export const unmarshalGenieSendMessageFeedbackRequestSchema: z.ZodType = - z - .object({ - space_id: z.string().optional(), - conversation_id: z.string().optional(), - message_id: z.string().optional(), - rating: z.enum(GenieFeedbackRating).optional(), - comment: z.string().optional(), - }) - .transform(d => ({ - spaceId: d.space_id, - conversationId: d.conversation_id, - messageId: d.message_id, - rating: d.rating, - comment: d.comment, - })); - export const unmarshalGenieSpaceSchema: z.ZodType = z .object({ space_id: z.string().optional(), @@ -2367,17 +2251,6 @@ export const unmarshalGenieSpaceSchema: z.ZodType = z etag: d.etag, })); -export const unmarshalGenieStartConversationMessageRequestSchema: z.ZodType = - z - .object({ - space_id: z.string().optional(), - content: z.string().optional(), - }) - .transform(d => ({ - spaceId: d.space_id, - content: d.content, - })); - export const unmarshalGenieStartConversationResponseSchema: z.ZodType = z .object({ @@ -2402,25 +2275,6 @@ export const unmarshalGenieSuggestedQuestionsAttachmentSchema: z.ZodType = - z - .object({ - space_id: z.string().optional(), - serialized_space: z.string().optional(), - title: z.string().optional(), - description: z.string().optional(), - warehouse_id: z.string().optional(), - etag: z.string().optional(), - }) - .transform(d => ({ - spaceId: d.space_id, - serializedSpace: d.serialized_space, - title: d.title, - description: d.description, - warehouseId: d.warehouse_id, - etag: d.etag, - })); - export const unmarshalListValueSchema: z.ZodType = z .object({ values: z.array(z.lazy(() => unmarshalValueSchema)).optional(), @@ -2637,152 +2491,6 @@ export const unmarshalVerificationMetadataSchema: z.ZodType ({ - chunk_index: d.chunkIndex, - row_offset: d.rowOffset, - row_count: d.rowCount, - byte_count: d.byteCount, - next_chunk_index: d.nextChunkIndex, - next_chunk_internal_link: d.nextChunkInternalLink, - })); - -export const marshalColumnInfoSchema: z.ZodType = z - .object({ - name: z.string().optional(), - typeText: z.string().optional(), - typeName: z.enum(ColumnTypeName).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 marshalDatabricksServiceExceptionProtoSchema: z.ZodType = z - .object({ - errorCode: z.enum(ErrorCode).optional(), - message: z.string().optional(), - stackTrace: z.string().optional(), - }) - .transform(d => ({ - error_code: d.errorCode, - message: d.message, - stack_trace: d.stackTrace, - })); - -export const marshalExternalLinkSchema: z.ZodType = z - .object({ - externalLink: z.string().optional(), - expiration: z.string().optional(), - httpHeaders: z.record(z.string(), z.string()).optional(), - chunkIndex: z.number().optional(), - rowOffset: z.number().optional(), - rowCount: z.number().optional(), - byteCount: z.number().optional(), - nextChunkIndex: z.number().optional(), - nextChunkInternalLink: z.string().optional(), - }) - .transform(d => ({ - external_link: d.externalLink, - expiration: d.expiration, - http_headers: d.httpHeaders, - chunk_index: d.chunkIndex, - row_offset: d.rowOffset, - row_count: d.rowCount, - byte_count: d.byteCount, - next_chunk_index: d.nextChunkIndex, - next_chunk_internal_link: d.nextChunkInternalLink, - })); - -export const marshalGenieAttachmentSchema: z.ZodType = z - .object({ - text: z.lazy(() => marshalTextAttachmentSchema).optional(), - query: z.lazy(() => marshalGenieQueryAttachmentSchema).optional(), - suggestedQuestions: z - .lazy(() => marshalGenieSuggestedQuestionsAttachmentSchema) - .optional(), - attachmentId: z.string().optional(), - }) - .transform(d => ({ - text: d.text, - query: d.query, - suggested_questions: d.suggestedQuestions, - attachment_id: d.attachmentId, - })); - -export const marshalGenieConversationSchema: z.ZodType = z - .object({ - id: z.string().optional(), - spaceId: z.string().optional(), - userId: z.number().optional(), - createdTimestamp: z.number().optional(), - lastUpdatedTimestamp: z.number().optional(), - title: z.string().optional(), - conversationId: z.string().optional(), - }) - .transform(d => ({ - id: d.id, - space_id: d.spaceId, - user_id: d.userId, - created_timestamp: d.createdTimestamp, - last_updated_timestamp: d.lastUpdatedTimestamp, - title: d.title, - conversation_id: d.conversationId, - })); - -export const marshalGenieConversationSummarySchema: z.ZodType = z - .object({ - conversationId: z.string().optional(), - title: z.string().optional(), - createdTimestamp: z.number().optional(), - }) - .transform(d => ({ - conversation_id: d.conversationId, - title: d.title, - created_timestamp: d.createdTimestamp, - })); - export const marshalGenieCreateConversationMessageRequestSchema: z.ZodType = z .object({ spaceId: z.string().optional(), @@ -2835,90 +2543,6 @@ export const marshalGenieCreateSpaceRequestSchema: z.ZodType = z description: d.description, })); -export const marshalGenieEvalResponseSchema: z.ZodType = z - .object({ - response: z.string().optional(), - sqlExecutionResult: z.lazy(() => marshalStatementResponseSchema).optional(), - responseType: z.enum(GenieEvalResponseType).optional(), - }) - .transform(d => ({ - response: d.response, - sql_execution_result: d.sqlExecutionResult, - response_type: d.responseType, - })); - -export const marshalGenieEvalResultSchema: z.ZodType = z - .object({ - resultId: z.string().optional(), - spaceId: z.string().optional(), - benchmarkQuestionId: z.string().optional(), - status: z.enum(EvaluationStatusType).optional(), - question: z.string().optional(), - benchmarkAnswer: z.string().optional(), - createdByUser: z.number().optional(), - }) - .transform(d => ({ - result_id: d.resultId, - space_id: d.spaceId, - benchmark_question_id: d.benchmarkQuestionId, - status: d.status, - question: d.question, - benchmark_answer: d.benchmarkAnswer, - created_by_user: d.createdByUser, - })); - -export const marshalGenieEvalResultDetailsSchema: z.ZodType = z - .object({ - resultId: z.string().optional(), - spaceId: z.string().optional(), - benchmarkQuestionId: z.string().optional(), - evalRunStatus: z.enum(EvaluationStatusType).optional(), - assessment: z.enum(GenieEvalAssessment).optional(), - manualAssessment: z.boolean().optional(), - assessmentReasons: z.array(z.enum(ScoreReason)).optional(), - actualResponse: z - .array(z.lazy(() => marshalGenieEvalResponseSchema)) - .optional(), - expectedResponse: z - .array(z.lazy(() => marshalGenieEvalResponseSchema)) - .optional(), - }) - .transform(d => ({ - result_id: d.resultId, - space_id: d.spaceId, - benchmark_question_id: d.benchmarkQuestionId, - eval_run_status: d.evalRunStatus, - assessment: d.assessment, - manual_assessment: d.manualAssessment, - assessment_reasons: d.assessmentReasons, - actual_response: d.actualResponse, - expected_response: d.expectedResponse, - })); - -export const marshalGenieEvalRunResponseSchema: z.ZodType = z - .object({ - evalRunId: z.string().optional(), - evalRunStatus: z.enum(EvaluationStatusType).optional(), - runByUser: z.number().optional(), - createdTimestamp: z.number().optional(), - numQuestions: z.number().optional(), - numCorrect: z.number().optional(), - numNeedsReview: z.number().optional(), - numDone: z.number().optional(), - lastUpdatedTimestamp: z.number().optional(), - }) - .transform(d => ({ - eval_run_id: d.evalRunId, - eval_run_status: d.evalRunStatus, - run_by_user: d.runByUser, - created_timestamp: d.createdTimestamp, - num_questions: d.numQuestions, - num_correct: d.numCorrect, - num_needs_review: d.numNeedsReview, - num_done: d.numDone, - last_updated_timestamp: d.lastUpdatedTimestamp, - })); - export const marshalGenieExecuteMessageAttachmentQueryRequestSchema: z.ZodType = z .object({ @@ -2946,16 +2570,6 @@ export const marshalGenieExecuteMessageQueryRequestSchema: z.ZodType = z conversation_id: d.conversationId, })); -export const marshalGenieFeedbackSchema: z.ZodType = z - .object({ - rating: z.enum(GenieFeedbackRating).optional(), - comment: z.string().optional(), - }) - .transform(d => ({ - rating: d.rating, - comment: d.comment, - })); - export const marshalGenieGenerateDownloadFullQueryResultRequestSchema: z.ZodType = z .object({ @@ -2971,201 +2585,6 @@ export const marshalGenieGenerateDownloadFullQueryResultRequestSchema: z.ZodType attachment_id: d.attachmentId, })); -export const marshalGenieGenerateDownloadFullQueryResultResponseSchema: z.ZodType = - z - .object({ - downloadId: z.string().optional(), - downloadIdSignature: z.string().optional(), - }) - .transform(d => ({ - download_id: d.downloadId, - download_id_signature: d.downloadIdSignature, - })); - -export const marshalGenieGetDownloadFullQueryResultResponseSchema: z.ZodType = z - .object({ - statementResponse: z.lazy(() => marshalStatementResponseSchema).optional(), - }) - .transform(d => ({ - statement_response: d.statementResponse, - })); - -export const marshalGenieGetMessageQueryResultResponseSchema: z.ZodType = z - .object({ - statementResponse: z.lazy(() => marshalStatementResponseSchema).optional(), - }) - .transform(d => ({ - statement_response: d.statementResponse, - })); - -export const marshalGenieListConversationCommentsResponseSchema: z.ZodType = z - .object({ - comments: z - .array(z.lazy(() => marshalGenieMessageCommentSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - comments: d.comments, - next_page_token: d.nextPageToken, - })); - -export const marshalGenieListConversationMessagesResponseSchema: z.ZodType = z - .object({ - messages: z.array(z.lazy(() => marshalGenieMessageSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - messages: d.messages, - next_page_token: d.nextPageToken, - })); - -export const marshalGenieListConversationsResponseSchema: z.ZodType = z - .object({ - conversations: z - .array(z.lazy(() => marshalGenieConversationSummarySchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - conversations: d.conversations, - next_page_token: d.nextPageToken, - })); - -export const marshalGenieListEvalResultsResponseSchema: z.ZodType = z - .object({ - evalResults: z.array(z.lazy(() => marshalGenieEvalResultSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - eval_results: d.evalResults, - next_page_token: d.nextPageToken, - })); - -export const marshalGenieListEvalRunsResponseSchema: z.ZodType = z - .object({ - evalRuns: z - .array(z.lazy(() => marshalGenieEvalRunResponseSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - eval_runs: d.evalRuns, - next_page_token: d.nextPageToken, - })); - -export const marshalGenieListMessageCommentsResponseSchema: z.ZodType = z - .object({ - comments: z - .array(z.lazy(() => marshalGenieMessageCommentSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - comments: d.comments, - next_page_token: d.nextPageToken, - })); - -export const marshalGenieListSpacesResponseSchema: z.ZodType = z - .object({ - spaces: z.array(z.lazy(() => marshalGenieSpaceSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - spaces: d.spaces, - next_page_token: d.nextPageToken, - })); - -export const marshalGenieMessageSchema: z.ZodType = z - .object({ - id: z.string().optional(), - spaceId: z.string().optional(), - conversationId: z.string().optional(), - userId: z.number().optional(), - createdTimestamp: z.number().optional(), - lastUpdatedTimestamp: z.number().optional(), - status: z.enum(MessageStatus_MessageStatus).optional(), - content: z.string().optional(), - attachments: z.array(z.lazy(() => marshalGenieAttachmentSchema)).optional(), - queryResult: z.lazy(() => marshalResultSchema).optional(), - error: z.lazy(() => marshalMessageErrorSchema).optional(), - messageId: z.string().optional(), - feedback: z.lazy(() => marshalGenieFeedbackSchema).optional(), - }) - .transform(d => ({ - id: d.id, - space_id: d.spaceId, - conversation_id: d.conversationId, - user_id: d.userId, - created_timestamp: d.createdTimestamp, - last_updated_timestamp: d.lastUpdatedTimestamp, - status: d.status, - content: d.content, - attachments: d.attachments, - query_result: d.queryResult, - error: d.error, - message_id: d.messageId, - feedback: d.feedback, - })); - -export const marshalGenieMessageCommentSchema: z.ZodType = z - .object({ - spaceId: z.string().optional(), - conversationId: z.string().optional(), - messageId: z.string().optional(), - messageCommentId: z.string().optional(), - userId: z.number().optional(), - content: z.string().optional(), - createdTimestamp: z.number().optional(), - }) - .transform(d => ({ - space_id: d.spaceId, - conversation_id: d.conversationId, - message_id: d.messageId, - message_comment_id: d.messageCommentId, - user_id: d.userId, - content: d.content, - created_timestamp: d.createdTimestamp, - })); - -export const marshalGenieQueryAttachmentSchema: z.ZodType = z - .object({ - title: z.string().optional(), - query: z.string().optional(), - description: z.string().optional(), - lastUpdatedTimestamp: z.number().optional(), - parameters: z - .array(z.lazy(() => marshalQueryAttachmentParameterSchema)) - .optional(), - id: z.string().optional(), - statementId: z.string().optional(), - queryResultMetadata: z - .lazy(() => marshalGenieResultMetadataSchema) - .optional(), - thoughts: z.array(z.lazy(() => marshalThoughtSchema)).optional(), - }) - .transform(d => ({ - title: d.title, - query: d.query, - description: d.description, - last_updated_timestamp: d.lastUpdatedTimestamp, - parameters: d.parameters, - id: d.id, - statement_id: d.statementId, - query_result_metadata: d.queryResultMetadata, - thoughts: d.thoughts, - })); - -export const marshalGenieResultMetadataSchema: z.ZodType = z - .object({ - rowCount: z.number().optional(), - isTruncated: z.boolean().optional(), - }) - .transform(d => ({ - row_count: d.rowCount, - is_truncated: d.isTruncated, - })); - export const marshalGenieSendMessageFeedbackRequestSchema: z.ZodType = z .object({ spaceId: z.string().optional(), @@ -3182,26 +2601,6 @@ export const marshalGenieSendMessageFeedbackRequestSchema: z.ZodType = z comment: d.comment, })); -export const marshalGenieSpaceSchema: z.ZodType = z - .object({ - spaceId: z.string().optional(), - title: z.string().optional(), - description: z.string().optional(), - warehouseId: z.string().optional(), - parentPath: z.string().optional(), - serializedSpace: z.string().optional(), - etag: z.string().optional(), - }) - .transform(d => ({ - space_id: d.spaceId, - title: d.title, - description: d.description, - warehouse_id: d.warehouseId, - parent_path: d.parentPath, - serialized_space: d.serializedSpace, - etag: d.etag, - })); - export const marshalGenieStartConversationMessageRequestSchema: z.ZodType = z .object({ spaceId: z.string().optional(), @@ -3212,28 +2611,6 @@ export const marshalGenieStartConversationMessageRequestSchema: z.ZodType = z content: d.content, })); -export const marshalGenieStartConversationResponseSchema: z.ZodType = z - .object({ - messageId: z.string().optional(), - message: z.lazy(() => marshalGenieMessageSchema).optional(), - conversationId: z.string().optional(), - conversation: z.lazy(() => marshalGenieConversationSchema).optional(), - }) - .transform(d => ({ - message_id: d.messageId, - message: d.message, - conversation_id: d.conversationId, - conversation: d.conversation, - })); - -export const marshalGenieSuggestedQuestionsAttachmentSchema: z.ZodType = z - .object({ - questions: z.array(z.string()).optional(), - }) - .transform(d => ({ - questions: d.questions, - })); - export const marshalGenieUpdateSpaceRequestSchema: z.ZodType = z .object({ spaceId: z.string().optional(), @@ -3251,211 +2628,3 @@ export const marshalGenieUpdateSpaceRequestSchema: z.ZodType = z warehouse_id: d.warehouseId, etag: d.etag, })); - -export const marshalListValueSchema: z.ZodType = z - .object({ - values: z.array(z.lazy(() => marshalValueSchema)).optional(), - }) - .transform(d => ({ - values: d.values, - })); - -export const marshalMapStringValueEntrySchema: z.ZodType = z - .object({ - key: z.string().optional(), - value: z.lazy(() => marshalValueSchema).optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - -export const marshalMessageErrorSchema: z.ZodType = z - .object({ - error: z.string().optional(), - type: z.enum(MessageError_Type).optional(), - }) - .transform(d => ({ - error: d.error, - type: d.type, - })); - -export const marshalPolicyFunctionArgumentSchema: z.ZodType = z - .object({ - column: z.string().optional(), - constant: z.string().optional(), - }) - .transform(d => ({ - column: d.column, - constant: d.constant, - })); - -export const marshalQueryAttachmentParameterSchema: z.ZodType = z - .object({ - keyword: z.string().optional(), - value: z.string().optional(), - sqlType: z.string().optional(), - }) - .transform(d => ({ - keyword: d.keyword, - value: d.value, - sql_type: d.sqlType, - })); - -export const marshalResultSchema: z.ZodType = z - .object({ - statementId: z.string().optional(), - rowCount: z.number().optional(), - isTruncated: z.boolean().optional(), - statementIdSignature: z.string().optional(), - }) - .transform(d => ({ - statement_id: d.statementId, - row_count: d.rowCount, - is_truncated: d.isTruncated, - statement_id_signature: d.statementIdSignature, - })); - -export const marshalResultDataSchema: z.ZodType = z - .object({ - externalLinks: z.array(z.lazy(() => marshalExternalLinkSchema)).optional(), - dataArray: z.array(z.lazy(() => marshalListValueSchema)).optional(), - chunkIndex: z.number().optional(), - rowOffset: z.number().optional(), - rowCount: z.number().optional(), - byteCount: z.number().optional(), - nextChunkIndex: z.number().optional(), - nextChunkInternalLink: z.string().optional(), - }) - .transform(d => ({ - external_links: d.externalLinks, - data_array: d.dataArray, - chunk_index: d.chunkIndex, - row_offset: d.rowOffset, - row_count: d.rowCount, - byte_count: d.byteCount, - next_chunk_index: d.nextChunkIndex, - next_chunk_internal_link: d.nextChunkInternalLink, - })); - -export const marshalResultManifestSchema: z.ZodType = z - .object({ - format: z.enum(Format).optional(), - schema: z.lazy(() => marshalSchemaSchema).optional(), - totalChunkCount: z.number().optional(), - chunks: z.array(z.lazy(() => marshalChunkInfoSchema)).optional(), - totalRowCount: z.number().optional(), - totalByteCount: z.number().optional(), - truncated: z.boolean().optional(), - }) - .transform(d => ({ - format: d.format, - schema: d.schema, - total_chunk_count: d.totalChunkCount, - chunks: d.chunks, - total_row_count: d.totalRowCount, - total_byte_count: d.totalByteCount, - truncated: d.truncated, - })); - -export const marshalSchemaSchema: z.ZodType = z - .object({ - columnCount: z.number().optional(), - columns: z.array(z.lazy(() => marshalColumnInfoSchema)).optional(), - }) - .transform(d => ({ - column_count: d.columnCount, - columns: d.columns, - })); - -export const marshalStatementResponseSchema: z.ZodType = z - .object({ - statementId: z.string().optional(), - status: z.lazy(() => marshalStatementStatusSchema).optional(), - manifest: z.lazy(() => marshalResultManifestSchema).optional(), - result: z.lazy(() => marshalResultDataSchema).optional(), - }) - .transform(d => ({ - statement_id: d.statementId, - status: d.status, - manifest: d.manifest, - result: d.result, - })); - -export const marshalStatementStatusSchema: z.ZodType = z - .object({ - state: z.enum(StatementStatus_State).optional(), - error: z - .lazy(() => marshalDatabricksServiceExceptionProtoSchema) - .optional(), - sqlState: z.string().optional(), - }) - .transform(d => ({ - state: d.state, - error: d.error, - sql_state: d.sqlState, - })); - -export const marshalStructSchema: z.ZodType = z - .object({ - fields: z.array(z.lazy(() => marshalMapStringValueEntrySchema)).optional(), - }) - .transform(d => ({ - fields: d.fields, - })); - -export const marshalTextAttachmentSchema: z.ZodType = z - .object({ - content: z.string().optional(), - id: z.string().optional(), - phase: z.enum(ResponsePhase).optional(), - verificationMetadata: z - .lazy(() => marshalVerificationMetadataSchema) - .optional(), - purpose: z.enum(TextAttachmentPurpose).optional(), - }) - .transform(d => ({ - content: d.content, - id: d.id, - phase: d.phase, - verification_metadata: d.verificationMetadata, - purpose: d.purpose, - })); - -export const marshalThoughtSchema: z.ZodType = z - .object({ - thoughtType: z.enum(ThoughtType).optional(), - content: z.string().optional(), - }) - .transform(d => ({ - thought_type: d.thoughtType, - content: d.content, - })); - -export const marshalValueSchema: z.ZodType = z - .object({ - nullValue: z.enum(NullValue).optional(), - numberValue: z.number().optional(), - stringValue: z.string().optional(), - boolValue: z.boolean().optional(), - structValue: z.lazy(() => marshalStructSchema).optional(), - listValue: z.lazy(() => marshalListValueSchema).optional(), - }) - .transform(d => ({ - null_value: d.nullValue, - number_value: d.numberValue, - string_value: d.stringValue, - bool_value: d.boolValue, - struct_value: d.structValue, - list_value: d.listValue, - })); - -export const marshalVerificationMetadataSchema: z.ZodType = z - .object({ - section: z.enum(VerificationSection).optional(), - index: z.number().optional(), - }) - .transform(d => ({ - section: d.section, - index: d.index, - })); diff --git a/packages/globalinitscripts/src/v2/model.ts b/packages/globalinitscripts/src/v2/model.ts index b0b8c275..ce1850c1 100644 --- a/packages/globalinitscripts/src/v2/model.ts +++ b/packages/globalinitscripts/src/v2/model.ts @@ -94,24 +94,6 @@ export interface UpdateGlobalInitScript { // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name. export interface UpdateGlobalInitScript_Response {} -export const unmarshalCreateGlobalInitScriptSchema: z.ZodType = - z - .object({ - name: z.string().optional(), - script: z - .string() - .transform(s => Uint8Array.from(atob(s), c => c.charCodeAt(0))) - .optional(), - position: z.number().optional(), - enabled: z.boolean().optional(), - }) - .transform(d => ({ - name: d.name, - script: d.script, - position: d.position, - enabled: d.enabled, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalCreateGlobalInitScript_ResponseSchema: z.ZodType = z @@ -161,26 +143,6 @@ export const unmarshalListGlobalInitScripts_ResponseSchema: z.ZodType = - z - .object({ - script_id: z.string().optional(), - name: z.string().optional(), - script: z - .string() - .transform(s => Uint8Array.from(atob(s), c => c.charCodeAt(0))) - .optional(), - position: z.number().optional(), - enabled: z.boolean().optional(), - }) - .transform(d => ({ - scriptId: d.script_id, - name: d.name, - script: d.script, - position: d.position, - enabled: d.enabled, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalUpdateGlobalInitScript_ResponseSchema: z.ZodType = z.object({}); @@ -204,53 +166,6 @@ export const marshalCreateGlobalInitScriptSchema: z.ZodType = z enabled: d.enabled, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCreateGlobalInitScript_ResponseSchema: z.ZodType = z - .object({ - scriptId: z.string().optional(), - }) - .transform(d => ({ - script_id: d.scriptId, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteGlobalInitScript_ResponseSchema: z.ZodType = z.object( - {} -); - -export const marshalGlobalInitScriptDetailsSchema: z.ZodType = z - .object({ - scriptId: z.string().optional(), - name: z.string().optional(), - position: z.number().optional(), - enabled: z.boolean().optional(), - createdBy: z.string().optional(), - createdAt: z.number().optional(), - updatedBy: z.string().optional(), - updatedAt: z.number().optional(), - }) - .transform(d => ({ - script_id: d.scriptId, - name: d.name, - position: d.position, - enabled: d.enabled, - created_by: d.createdBy, - created_at: d.createdAt, - updated_by: d.updatedBy, - updated_at: d.updatedAt, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListGlobalInitScripts_ResponseSchema: z.ZodType = z - .object({ - scripts: z - .array(z.lazy(() => marshalGlobalInitScriptDetailsSchema)) - .optional(), - }) - .transform(d => ({ - scripts: d.scripts, - })); - export const marshalUpdateGlobalInitScriptSchema: z.ZodType = z .object({ scriptId: z.string().optional(), @@ -271,8 +186,3 @@ export const marshalUpdateGlobalInitScriptSchema: z.ZodType = z position: d.position, enabled: d.enabled, })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalUpdateGlobalInitScript_ResponseSchema: z.ZodType = z.object( - {} -); diff --git a/packages/grants/src/v1/model.ts b/packages/grants/src/v1/model.ts index 68690143..54e14fba 100644 --- a/packages/grants/src/v1/model.ts +++ b/packages/grants/src/v1/model.ts @@ -289,20 +289,6 @@ export const unmarshalListPrivilegeAssignmentsResponseSchema: z.ZodType = z - .object({ - principal: z.string().optional(), - add: z.array(z.string()).optional(), - remove: z.array(z.string()).optional(), - principal_id: z.number().optional(), - }) - .transform(d => ({ - principal: d.principal, - add: d.add, - remove: d.remove, - principalId: d.principal_id, - })); - export const unmarshalPrivilegeAssignmentSchema: z.ZodType = z .object({ @@ -316,18 +302,6 @@ export const unmarshalPrivilegeAssignmentSchema: z.ZodType principalId: d.principal_id, })); -export const unmarshalUpdatePermissionsSchema: z.ZodType = z - .object({ - securable_type: z.string().optional(), - securable_full_name: z.string().optional(), - changes: z.array(z.lazy(() => unmarshalPermissionsChangeSchema)).optional(), - }) - .transform(d => ({ - securableType: d.securable_type, - securableFullName: d.securable_full_name, - changes: d.changes, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalUpdatePermissions_ResponseSchema: z.ZodType = z @@ -340,81 +314,6 @@ export const unmarshalUpdatePermissions_ResponseSchema: z.ZodType ({ - privilege: d.privilege, - inherited_from_type: d.inheritedFromType, - inherited_from_name: d.inheritedFromName, - })); - -export const marshalEffectivePrivilegeAssignmentSchema: z.ZodType = z - .object({ - principal: z.string().optional(), - privileges: z - .array(z.lazy(() => marshalEffectivePrivilegeSchema)) - .optional(), - }) - .transform(d => ({ - principal: d.principal, - privileges: d.privileges, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGetEffectivePermissions_ResponseSchema: z.ZodType = z - .object({ - nextPageToken: z.string().optional(), - privilegeAssignments: z - .array(z.lazy(() => marshalEffectivePrivilegeAssignmentSchema)) - .optional(), - }) - .transform(d => ({ - next_page_token: d.nextPageToken, - privilege_assignments: d.privilegeAssignments, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGetPermissions_ResponseSchema: z.ZodType = z - .object({ - nextPageToken: z.string().optional(), - privilegeAssignments: z - .array(z.lazy(() => marshalPrivilegeAssignmentSchema)) - .optional(), - }) - .transform(d => ({ - next_page_token: d.nextPageToken, - privilege_assignments: d.privilegeAssignments, - })); - -export const marshalListEffectivePrivilegeAssignmentsResponseSchema: z.ZodType = - z - .object({ - effectivePrivilegeAssignments: z - .array(z.lazy(() => marshalEffectivePrivilegeAssignmentSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - effective_privilege_assignments: d.effectivePrivilegeAssignments, - next_page_token: d.nextPageToken, - })); - -export const marshalListPrivilegeAssignmentsResponseSchema: z.ZodType = z - .object({ - privilegeAssignments: z - .array(z.lazy(() => marshalPrivilegeAssignmentSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - privilege_assignments: d.privilegeAssignments, - next_page_token: d.nextPageToken, - })); - export const marshalPermissionsChangeSchema: z.ZodType = z .object({ principal: z.string().optional(), @@ -429,18 +328,6 @@ export const marshalPermissionsChangeSchema: z.ZodType = z principal_id: d.principalId, })); -export const marshalPrivilegeAssignmentSchema: z.ZodType = z - .object({ - principal: z.string().optional(), - privileges: z.array(z.string()).optional(), - principalId: z.number().optional(), - }) - .transform(d => ({ - principal: d.principal, - privileges: d.privileges, - principal_id: d.principalId, - })); - export const marshalUpdatePermissionsSchema: z.ZodType = z .object({ securableType: z.string().optional(), @@ -452,14 +339,3 @@ export const marshalUpdatePermissionsSchema: z.ZodType = z securable_full_name: d.securableFullName, changes: d.changes, })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalUpdatePermissions_ResponseSchema: z.ZodType = z - .object({ - privilegeAssignments: z - .array(z.lazy(() => marshalPrivilegeAssignmentSchema)) - .optional(), - }) - .transform(d => ({ - privilege_assignments: d.privilegeAssignments, - })); diff --git a/packages/iam/src/v2/client.ts b/packages/iam/src/v2/client.ts index b93feb78..c98c4238 100644 --- a/packages/iam/src/v2/client.ts +++ b/packages/iam/src/v2/client.ts @@ -874,7 +874,7 @@ export class Client { params.append('account_id', req.accountId); } if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; @@ -905,7 +905,7 @@ export class Client { const url = `${this.host}/api/2.0/identity/groups/${String(req.internalId ?? '')}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; @@ -1246,7 +1246,7 @@ export class Client { params.append('account_id', req.accountId); } if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; @@ -1280,7 +1280,7 @@ export class Client { const url = `${this.host}/api/2.0/identity/servicePrincipals/${String(req.internalId ?? '')}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; @@ -1600,7 +1600,7 @@ export class Client { params.append('account_id', req.accountId); } if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; @@ -1631,7 +1631,7 @@ export class Client { const url = `${this.host}/api/2.0/identity/users/${String(req.internalId ?? '')}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; @@ -2074,7 +2074,7 @@ export class Client { params.append('account_id', req.accountId); } if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; @@ -2113,7 +2113,7 @@ export class Client { const url = `${this.host}/api/2.0/identity/workspaceAssignmentDetails/${String(req.principalId ?? '')}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; @@ -2171,7 +2171,7 @@ export class Client { const url = `${this.host}/api/2.0/identity/workspaceIdentityDetails/${String(req.principalId ?? '')}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; diff --git a/packages/iam/src/v2/model.ts b/packages/iam/src/v2/model.ts index 1583346b..7249c5a1 100644 --- a/packages/iam/src/v2/model.ts +++ b/packages/iam/src/v2/model.ts @@ -1,5 +1,7 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; /** The action type for an account access identity rule (currently DENY only). */ @@ -833,7 +835,7 @@ export interface UpdateGroupProxyRequest { /** Required. Group to be updated in */ group?: Group | undefined; /** Optional. The list of fields to update. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } /** TODO: Write description later when this method is implemented */ @@ -845,7 +847,7 @@ export interface UpdateGroupRequest { /** Required. Group to be updated in */ group?: Group | undefined; /** Optional. The list of fields to update. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } /** TODO: Write description later when this method is implemented */ @@ -855,7 +857,7 @@ export interface UpdateServicePrincipalProxyRequest { /** Required. Service principal to be updated in */ servicePrincipal?: ServicePrincipal | undefined; /** Optional. The list of fields to update. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } /** TODO: Write description later when this method is implemented */ @@ -867,7 +869,7 @@ export interface UpdateServicePrincipalRequest { /** Required. Service Principal to be updated in */ servicePrincipal?: ServicePrincipal | undefined; /** Optional. The list of fields to update. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } /** @@ -884,7 +886,7 @@ export interface UpdateUserProxyRequest { /** Required. User to be updated in */ user?: User | undefined; /** Optional. The list of fields to update. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } /** @@ -903,7 +905,7 @@ export interface UpdateUserRequest { /** Required. User to be updated in */ user?: User | undefined; /** Optional. The list of fields to update. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } /** Proxy request for updating a workspace assignment detail for a principal. */ @@ -913,7 +915,7 @@ export interface UpdateWorkspaceAssignmentDetailProxyRequest { /** Required. Workspace assignment detail to be updated in . */ workspaceAssignmentDetail?: WorkspaceAssignmentDetail | undefined; /** Required. The list of fields to update. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } /** TBD since the only updatable field is permissions */ @@ -927,7 +929,7 @@ export interface UpdateWorkspaceAssignmentDetailRequest { /** Required. Workspace assignment detail to be updated in . */ workspaceAssignmentDetail?: WorkspaceAssignmentDetail | undefined; /** Required. The list of fields to update. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } /** Request message for updating the workspace identity details for a principal in a workspace. */ @@ -937,7 +939,7 @@ export interface UpdateWorkspaceIdentityDetailRequest { /** Required. Workspace identity detail to be updated in . */ workspaceIdentityDetail?: WorkspaceIdentityDetail | undefined; /** Required. The list of fields to update. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } /** The details of a User resource. */ @@ -1147,26 +1149,6 @@ export const unmarshalListWorkspaceAssignmentDetailsResponseSchema: z.ZodType

  • = - z - .object({ - external_id: z.string().optional(), - }) - .transform(d => ({ - externalId: d.external_id, - })); - -export const unmarshalResolveGroupRequestSchema: z.ZodType = - z - .object({ - account_id: z.string().optional(), - external_id: z.string().optional(), - }) - .transform(d => ({ - accountId: d.account_id, - externalId: d.external_id, - })); - export const unmarshalResolveGroupResponseSchema: z.ZodType = z .object({ @@ -1176,26 +1158,6 @@ export const unmarshalResolveGroupResponseSchema: z.ZodType = - z - .object({ - external_id: z.string().optional(), - }) - .transform(d => ({ - externalId: d.external_id, - })); - -export const unmarshalResolveServicePrincipalRequestSchema: z.ZodType = - z - .object({ - account_id: z.string().optional(), - external_id: z.string().optional(), - }) - .transform(d => ({ - accountId: d.account_id, - externalId: d.external_id, - })); - export const unmarshalResolveServicePrincipalResponseSchema: z.ZodType = z .object({ @@ -1207,26 +1169,6 @@ export const unmarshalResolveServicePrincipalResponseSchema: z.ZodType = - z - .object({ - external_id: z.string().optional(), - }) - .transform(d => ({ - externalId: d.external_id, - })); - -export const unmarshalResolveUserRequestSchema: z.ZodType = - z - .object({ - account_id: z.string().optional(), - external_id: z.string().optional(), - }) - .transform(d => ({ - accountId: d.account_id, - externalId: d.external_id, - })); - export const unmarshalResolveUserResponseSchema: z.ZodType = z .object({ @@ -1397,98 +1339,6 @@ export const marshalGroupSchema: z.ZodType = z group_name: d.groupName, })); -export const marshalListAccountAccessIdentityRulesResponseSchema: z.ZodType = z - .object({ - accountAccessIdentityRules: z - .array(z.lazy(() => marshalAccountAccessIdentityRuleSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - account_access_identity_rules: d.accountAccessIdentityRules, - next_page_token: d.nextPageToken, - })); - -export const marshalListDirectGroupMembersResponseSchema: z.ZodType = z - .object({ - directGroupMembers: z - .array(z.lazy(() => marshalDirectGroupMemberSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - direct_group_members: d.directGroupMembers, - next_page_token: d.nextPageToken, - })); - -export const marshalListGroupsResponseSchema: z.ZodType = z - .object({ - groups: z.array(z.lazy(() => marshalGroupSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - groups: d.groups, - next_page_token: d.nextPageToken, - })); - -export const marshalListServicePrincipalsResponseSchema: z.ZodType = z - .object({ - servicePrincipals: z - .array(z.lazy(() => marshalServicePrincipalSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - service_principals: d.servicePrincipals, - next_page_token: d.nextPageToken, - })); - -export const marshalListTransitiveParentGroupsResponseSchema: z.ZodType = z - .object({ - transitiveParentGroups: z - .array(z.lazy(() => marshalTransitiveParentGroupSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - transitive_parent_groups: d.transitiveParentGroups, - next_page_token: d.nextPageToken, - })); - -export const marshalListUsersResponseSchema: z.ZodType = z - .object({ - users: z.array(z.lazy(() => marshalUserSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - users: d.users, - next_page_token: d.nextPageToken, - })); - -export const marshalListWorkspaceAccessDetailsResponseSchema: z.ZodType = z - .object({ - workspaceAccessDetails: z - .array(z.lazy(() => marshalWorkspaceAccessDetailSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - workspace_access_details: d.workspaceAccessDetails, - next_page_token: d.nextPageToken, - })); - -export const marshalListWorkspaceAssignmentDetailsResponseSchema: z.ZodType = z - .object({ - workspaceAssignmentDetails: z - .array(z.lazy(() => marshalWorkspaceAssignmentDetailSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - workspace_assignment_details: d.workspaceAssignmentDetails, - next_page_token: d.nextPageToken, - })); - export const marshalResolveGroupProxyRequestSchema: z.ZodType = z .object({ externalId: z.string().optional(), @@ -1507,14 +1357,6 @@ export const marshalResolveGroupRequestSchema: z.ZodType = z external_id: d.externalId, })); -export const marshalResolveGroupResponseSchema: z.ZodType = z - .object({ - group: z.lazy(() => marshalGroupSchema).optional(), - }) - .transform(d => ({ - group: d.group, - })); - export const marshalResolveServicePrincipalProxyRequestSchema: z.ZodType = z .object({ externalId: z.string().optional(), @@ -1533,14 +1375,6 @@ export const marshalResolveServicePrincipalRequestSchema: z.ZodType = z external_id: d.externalId, })); -export const marshalResolveServicePrincipalResponseSchema: z.ZodType = z - .object({ - servicePrincipal: z.lazy(() => marshalServicePrincipalSchema).optional(), - }) - .transform(d => ({ - service_principal: d.servicePrincipal, - })); - export const marshalResolveUserProxyRequestSchema: z.ZodType = z .object({ externalId: z.string().optional(), @@ -1559,14 +1393,6 @@ export const marshalResolveUserRequestSchema: z.ZodType = z external_id: d.externalId, })); -export const marshalResolveUserResponseSchema: z.ZodType = z - .object({ - user: z.lazy(() => marshalUserSchema).optional(), - }) - .transform(d => ({ - user: d.user, - })); - export const marshalServicePrincipalSchema: z.ZodType = z .object({ accountId: z.string().optional(), @@ -1585,18 +1411,6 @@ export const marshalServicePrincipalSchema: z.ZodType = z account_sp_status: d.accountSpStatus, })); -export const marshalTransitiveParentGroupSchema: z.ZodType = z - .object({ - accountId: z.string().optional(), - internalId: z.number().optional(), - externalId: z.string().optional(), - }) - .transform(d => ({ - account_id: d.accountId, - internal_id: d.internalId, - external_id: d.externalId, - })); - export const marshalUserSchema: z.ZodType = z .object({ accountId: z.string().optional(), @@ -1626,26 +1440,6 @@ export const marshalUser_NameSchema: z.ZodType = z family_name: d.familyName, })); -export const marshalWorkspaceAccessDetailSchema: z.ZodType = z - .object({ - principalId: z.number().optional(), - workspaceId: z.number().optional(), - accountId: z.string().optional(), - principalType: z.enum(PrincipalType).optional(), - accessType: z.enum(WorkspaceAccessDetail_AccessType).optional(), - status: z.enum(State).optional(), - permissions: z.array(z.enum(WorkspacePermission)).optional(), - }) - .transform(d => ({ - principal_id: d.principalId, - workspace_id: d.workspaceId, - account_id: d.accountId, - principal_type: d.principalType, - access_type: d.accessType, - status: d.status, - permissions: d.permissions, - })); - export const marshalWorkspaceAssignmentDetailSchema: z.ZodType = z .object({ principalId: z.number().optional(), @@ -1675,3 +1469,89 @@ export const marshalWorkspaceIdentityDetailSchema: z.ZodType = z workspace_identity_status: d.workspaceIdentityStatus, assignment_type: d.assignmentType, })); + +const groupFieldMaskSchema: FieldMaskSchema = { + accountId: {wire: 'account_id'}, + externalId: {wire: 'external_id'}, + groupName: {wire: 'group_name'}, + internalId: {wire: 'internal_id'}, +}; + +export function groupFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, groupFieldMaskSchema); +} + +const servicePrincipalFieldMaskSchema: FieldMaskSchema = { + accountId: {wire: 'account_id'}, + accountSpStatus: {wire: 'account_sp_status'}, + applicationId: {wire: 'application_id'}, + displayName: {wire: 'display_name'}, + externalId: {wire: 'external_id'}, + internalId: {wire: 'internal_id'}, +}; + +export function servicePrincipalFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + servicePrincipalFieldMaskSchema + ); +} + +const userFieldMaskSchema: FieldMaskSchema = { + accountId: {wire: 'account_id'}, + accountUserStatus: {wire: 'account_user_status'}, + externalId: {wire: 'external_id'}, + internalId: {wire: 'internal_id'}, + name: {wire: 'name', children: () => user_NameFieldMaskSchema}, + username: {wire: 'username'}, +}; + +export function userFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, userFieldMaskSchema); +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +const user_NameFieldMaskSchema: FieldMaskSchema = { + familyName: {wire: 'family_name'}, + givenName: {wire: 'given_name'}, +}; + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export function user_NameFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, user_NameFieldMaskSchema); +} + +const workspaceAssignmentDetailFieldMaskSchema: FieldMaskSchema = { + accountId: {wire: 'account_id'}, + entitlements: {wire: 'entitlements'}, + principalId: {wire: 'principal_id'}, + principalType: {wire: 'principal_type'}, + workspaceId: {wire: 'workspace_id'}, +}; + +export function workspaceAssignmentDetailFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + workspaceAssignmentDetailFieldMaskSchema + ); +} + +const workspaceIdentityDetailFieldMaskSchema: FieldMaskSchema = { + assignmentType: {wire: 'assignment_type'}, + principalId: {wire: 'principal_id'}, + principalType: {wire: 'principal_type'}, + workspaceIdentityStatus: {wire: 'workspace_identity_status'}, +}; + +export function workspaceIdentityDetailFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + workspaceIdentityDetailFieldMaskSchema + ); +} diff --git a/packages/instancepools/src/v2/model.ts b/packages/instancepools/src/v2/model.ts index e4499230..1f372005 100644 --- a/packages/instancepools/src/v2/model.ts +++ b/packages/instancepools/src/v2/model.ts @@ -768,58 +768,6 @@ export interface PendingInstanceError { message?: string | undefined; } -export const unmarshalCreateInstancePoolSchema: z.ZodType = - z - .object({ - instance_pool_name: z.string().optional(), - min_idle_instances: z.number().optional(), - max_capacity: z.number().optional(), - aws_attributes: z - .lazy(() => unmarshalInstancePoolAwsAttributesSchema) - .optional(), - node_type_id: z.string().optional(), - custom_tags: z.record(z.string(), z.string()).optional(), - idle_instance_autotermination_minutes: z.number().optional(), - enable_elastic_disk: z.boolean().optional(), - disk_spec: z.lazy(() => unmarshalDiskSpecSchema).optional(), - preloaded_docker_images: z - .array(z.lazy(() => unmarshalDockerImageSchema)) - .optional(), - preloaded_spark_versions: z.array(z.string()).optional(), - azure_attributes: z - .lazy(() => unmarshalInstancePoolAzureAttributesSchema) - .optional(), - gcp_attributes: z - .lazy(() => unmarshalInstancePoolGcpAttributesSchema) - .optional(), - node_type_flexibility: z - .lazy(() => unmarshalNodeTypeFlexibilitySchema) - .optional(), - enable_auto_alternate_node_types: z.boolean().optional(), - remote_disk_throughput: z.number().optional(), - total_initial_remote_disk_size: z.number().optional(), - }) - .transform(d => ({ - instancePoolName: d.instance_pool_name, - minIdleInstances: d.min_idle_instances, - maxCapacity: d.max_capacity, - awsAttributes: d.aws_attributes, - nodeTypeId: d.node_type_id, - customTags: d.custom_tags, - idleInstanceAutoterminationMinutes: - d.idle_instance_autotermination_minutes, - enableElasticDisk: d.enable_elastic_disk, - diskSpec: d.disk_spec, - preloadedDockerImages: d.preloaded_docker_images, - preloadedSparkVersions: d.preloaded_spark_versions, - azureAttributes: d.azure_attributes, - gcpAttributes: d.gcp_attributes, - nodeTypeFlexibility: d.node_type_flexibility, - enableAutoAlternateNodeTypes: d.enable_auto_alternate_node_types, - remoteDiskThroughput: d.remote_disk_throughput, - totalInitialRemoteDiskSize: d.total_initial_remote_disk_size, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalCreateInstancePool_ResponseSchema: z.ZodType = z @@ -830,15 +778,6 @@ export const unmarshalCreateInstancePool_ResponseSchema: z.ZodType = - z - .object({ - instance_pool_id: z.string().optional(), - }) - .transform(d => ({ - instancePoolId: d.instance_pool_id, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalDeleteInstancePool_ResponseSchema: z.ZodType = z.object({}); @@ -889,58 +828,6 @@ export const unmarshalDockerImageSchema: z.ZodType = z basicAuth: d.basic_auth, })); -export const unmarshalEditInstancePoolSchema: z.ZodType = z - .object({ - instance_pool_id: z.string().optional(), - instance_pool_name: z.string().optional(), - min_idle_instances: z.number().optional(), - max_capacity: z.number().optional(), - aws_attributes: z - .lazy(() => unmarshalInstancePoolAwsAttributesSchema) - .optional(), - node_type_id: z.string().optional(), - custom_tags: z.record(z.string(), z.string()).optional(), - idle_instance_autotermination_minutes: z.number().optional(), - enable_elastic_disk: z.boolean().optional(), - disk_spec: z.lazy(() => unmarshalDiskSpecSchema).optional(), - preloaded_docker_images: z - .array(z.lazy(() => unmarshalDockerImageSchema)) - .optional(), - preloaded_spark_versions: z.array(z.string()).optional(), - azure_attributes: z - .lazy(() => unmarshalInstancePoolAzureAttributesSchema) - .optional(), - gcp_attributes: z - .lazy(() => unmarshalInstancePoolGcpAttributesSchema) - .optional(), - node_type_flexibility: z - .lazy(() => unmarshalNodeTypeFlexibilitySchema) - .optional(), - enable_auto_alternate_node_types: z.boolean().optional(), - remote_disk_throughput: z.number().optional(), - total_initial_remote_disk_size: z.number().optional(), - }) - .transform(d => ({ - instancePoolId: d.instance_pool_id, - instancePoolName: d.instance_pool_name, - minIdleInstances: d.min_idle_instances, - maxCapacity: d.max_capacity, - awsAttributes: d.aws_attributes, - nodeTypeId: d.node_type_id, - customTags: d.custom_tags, - idleInstanceAutoterminationMinutes: d.idle_instance_autotermination_minutes, - enableElasticDisk: d.enable_elastic_disk, - diskSpec: d.disk_spec, - preloadedDockerImages: d.preloaded_docker_images, - preloadedSparkVersions: d.preloaded_spark_versions, - azureAttributes: d.azure_attributes, - gcpAttributes: d.gcp_attributes, - nodeTypeFlexibility: d.node_type_flexibility, - enableAutoAlternateNodeTypes: d.enable_auto_alternate_node_types, - remoteDiskThroughput: d.remote_disk_throughput, - totalInitialRemoteDiskSize: d.total_initial_remote_disk_size, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalEditInstancePool_ResponseSchema: z.ZodType = z.object({}); @@ -1216,15 +1103,6 @@ export const marshalCreateInstancePoolSchema: z.ZodType = z total_initial_remote_disk_size: d.totalInitialRemoteDiskSize, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCreateInstancePool_ResponseSchema: z.ZodType = z - .object({ - instancePoolId: z.string().optional(), - }) - .transform(d => ({ - instance_pool_id: d.instancePoolId, - })); - export const marshalDeleteInstancePoolSchema: z.ZodType = z .object({ instancePoolId: z.string().optional(), @@ -1233,9 +1111,6 @@ export const marshalDeleteInstancePoolSchema: z.ZodType = z instance_pool_id: d.instancePoolId, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteInstancePool_ResponseSchema: z.ZodType = z.object({}); - export const marshalDiskSpecSchema: z.ZodType = z .object({ diskType: z.lazy(() => marshalDiskTypeSchema).optional(), @@ -1334,130 +1209,6 @@ export const marshalEditInstancePoolSchema: z.ZodType = z total_initial_remote_disk_size: d.totalInitialRemoteDiskSize, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalEditInstancePool_ResponseSchema: z.ZodType = z.object({}); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGetInstancePool_ResponseSchema: z.ZodType = z - .object({ - stats: z.lazy(() => marshalInstancePoolStatsSchema).optional(), - status: z.lazy(() => marshalInstancePoolStatusSchema).optional(), - instancePoolId: z.string().optional(), - defaultTags: z.record(z.string(), z.string()).optional(), - state: z.enum(InstancePoolState).optional(), - instancePoolName: z.string().optional(), - minIdleInstances: z.number().optional(), - maxCapacity: z.number().optional(), - awsAttributes: z - .lazy(() => 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(), - enableAutoAlternateNodeTypes: z.boolean().optional(), - remoteDiskThroughput: z.number().optional(), - totalInitialRemoteDiskSize: z.number().optional(), - }) - .transform(d => ({ - stats: d.stats, - status: d.status, - instance_pool_id: d.instancePoolId, - default_tags: d.defaultTags, - state: d.state, - 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, - enable_auto_alternate_node_types: d.enableAutoAlternateNodeTypes, - remote_disk_throughput: d.remoteDiskThroughput, - total_initial_remote_disk_size: d.totalInitialRemoteDiskSize, - })); - -export const marshalInstancePoolAndStatsSchema: z.ZodType = z - .object({ - stats: z.lazy(() => marshalInstancePoolStatsSchema).optional(), - status: z.lazy(() => marshalInstancePoolStatusSchema).optional(), - instancePoolId: z.string().optional(), - defaultTags: z.record(z.string(), z.string()).optional(), - state: z.enum(InstancePoolState).optional(), - instancePoolName: z.string().optional(), - minIdleInstances: z.number().optional(), - maxCapacity: z.number().optional(), - awsAttributes: z - .lazy(() => 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(), - enableAutoAlternateNodeTypes: z.boolean().optional(), - remoteDiskThroughput: z.number().optional(), - totalInitialRemoteDiskSize: z.number().optional(), - }) - .transform(d => ({ - stats: d.stats, - status: d.status, - instance_pool_id: d.instancePoolId, - default_tags: d.defaultTags, - state: d.state, - 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, - enable_auto_alternate_node_types: d.enableAutoAlternateNodeTypes, - remote_disk_throughput: d.remoteDiskThroughput, - total_initial_remote_disk_size: d.totalInitialRemoteDiskSize, - })); - export const marshalInstancePoolAwsAttributesSchema: z.ZodType = z .object({ availability: z.enum(AwsAvailability).optional(), @@ -1494,41 +1245,6 @@ export const marshalInstancePoolGcpAttributesSchema: z.ZodType = z zone_id: d.zoneId, })); -export const marshalInstancePoolStatsSchema: z.ZodType = z - .object({ - usedCount: z.number().optional(), - idleCount: z.number().optional(), - pendingUsedCount: z.number().optional(), - pendingIdleCount: z.number().optional(), - }) - .transform(d => ({ - used_count: d.usedCount, - idle_count: d.idleCount, - pending_used_count: d.pendingUsedCount, - pending_idle_count: d.pendingIdleCount, - })); - -export const marshalInstancePoolStatusSchema: z.ZodType = z - .object({ - pendingInstanceErrors: z - .array(z.lazy(() => marshalPendingInstanceErrorSchema)) - .optional(), - }) - .transform(d => ({ - pending_instance_errors: d.pendingInstanceErrors, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListInstancePools_ResponseSchema: z.ZodType = z - .object({ - instancePools: z - .array(z.lazy(() => marshalInstancePoolAndStatsSchema)) - .optional(), - }) - .transform(d => ({ - instance_pools: d.instancePools, - })); - export const marshalNodeTypeFlexibilitySchema: z.ZodType = z .object({ alternateNodeTypeIds: z.array(z.string()).optional(), @@ -1536,13 +1252,3 @@ export const marshalNodeTypeFlexibilitySchema: z.ZodType = z .transform(d => ({ alternate_node_type_ids: d.alternateNodeTypeIds, })); - -export const marshalPendingInstanceErrorSchema: z.ZodType = z - .object({ - instanceId: z.string().optional(), - message: z.string().optional(), - }) - .transform(d => ({ - instance_id: d.instanceId, - message: d.message, - })); diff --git a/packages/instanceprofiles/src/v2/model.ts b/packages/instanceprofiles/src/v2/model.ts index e153148c..5c403b01 100644 --- a/packages/instanceprofiles/src/v2/model.ts +++ b/packages/instanceprofiles/src/v2/model.ts @@ -100,38 +100,10 @@ export interface RemoveInstanceProfile { // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name. export interface RemoveInstanceProfile_Response {} -export const unmarshalAddInstanceProfileSchema: z.ZodType = - z - .object({ - skip_validation: z.boolean().optional(), - instance_profile_arn: z.string().optional(), - is_meta_instance_profile: z.boolean().optional(), - iam_role_arn: z.string().optional(), - }) - .transform(d => ({ - skipValidation: d.skip_validation, - instanceProfileArn: d.instance_profile_arn, - isMetaInstanceProfile: d.is_meta_instance_profile, - iamRoleArn: d.iam_role_arn, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalAddInstanceProfile_ResponseSchema: z.ZodType = z.object({}); -export const unmarshalEditInstanceProfileSchema: z.ZodType = - z - .object({ - instance_profile_arn: z.string().optional(), - is_meta_instance_profile: z.boolean().optional(), - iam_role_arn: z.string().optional(), - }) - .transform(d => ({ - instanceProfileArn: d.instance_profile_arn, - isMetaInstanceProfile: d.is_meta_instance_profile, - iamRoleArn: d.iam_role_arn, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalEditInstanceProfile_ResponseSchema: z.ZodType = z.object({}); @@ -160,15 +132,6 @@ export const unmarshalListInstanceProfiles_ResponseSchema: z.ZodType = - z - .object({ - instance_profile_arn: z.string().optional(), - }) - .transform(d => ({ - instanceProfileArn: d.instance_profile_arn, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalRemoveInstanceProfile_ResponseSchema: z.ZodType = z.object({}); @@ -187,9 +150,6 @@ export const marshalAddInstanceProfileSchema: z.ZodType = z iam_role_arn: d.iamRoleArn, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalAddInstanceProfile_ResponseSchema: z.ZodType = z.object({}); - export const marshalEditInstanceProfileSchema: z.ZodType = z .object({ instanceProfileArn: z.string().optional(), @@ -202,34 +162,6 @@ export const marshalEditInstanceProfileSchema: z.ZodType = z iam_role_arn: d.iamRoleArn, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalEditInstanceProfile_ResponseSchema: z.ZodType = z.object( - {} -); - -export const marshalInstanceProfileSchema: z.ZodType = z - .object({ - instanceProfileArn: z.string().optional(), - isMetaInstanceProfile: z.boolean().optional(), - iamRoleArn: z.string().optional(), - }) - .transform(d => ({ - instance_profile_arn: d.instanceProfileArn, - is_meta_instance_profile: d.isMetaInstanceProfile, - iam_role_arn: d.iamRoleArn, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListInstanceProfiles_ResponseSchema: z.ZodType = z - .object({ - instanceProfiles: z - .array(z.lazy(() => marshalInstanceProfileSchema)) - .optional(), - }) - .transform(d => ({ - instance_profiles: d.instanceProfiles, - })); - export const marshalRemoveInstanceProfileSchema: z.ZodType = z .object({ instanceProfileArn: z.string().optional(), @@ -237,8 +169,3 @@ export const marshalRemoveInstanceProfileSchema: z.ZodType = z .transform(d => ({ instance_profile_arn: d.instanceProfileArn, })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalRemoveInstanceProfile_ResponseSchema: z.ZodType = z.object( - {} -); diff --git a/packages/materializedfeatures/src/v1/client.ts b/packages/materializedfeatures/src/v1/client.ts index fac8a34b..5020b623 100644 --- a/packages/materializedfeatures/src/v1/client.ts +++ b/packages/materializedfeatures/src/v1/client.ts @@ -196,7 +196,7 @@ export class Client { const url = `${this.host}/api/2.0/feature-store/feature-tables/${req.tableName ?? ''}/features/${req.featureName ?? ''}/tags/${req.featureTag?.key ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; diff --git a/packages/materializedfeatures/src/v1/model.ts b/packages/materializedfeatures/src/v1/model.ts index 6e29c771..723a3974 100644 --- a/packages/materializedfeatures/src/v1/model.ts +++ b/packages/materializedfeatures/src/v1/model.ts @@ -1,5 +1,7 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; /** Request message for CreateFeatureTag. */ @@ -93,7 +95,7 @@ export interface UpdateFeatureTagRequest { featureName?: string | undefined; featureTag?: FeatureTag | undefined; /** The list of fields to update. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalFeatureLineageSchema: z.ZodType = z @@ -169,53 +171,6 @@ export const unmarshalListFeatureTagsResponseSchema: z.ZodType marshalFeatureLineage_ModelSchema)).optional(), - featureSpecs: z - .array(z.lazy(() => marshalFeatureLineage_FeatureSpecSchema)) - .optional(), - onlineFeatures: z - .array(z.lazy(() => marshalFeatureLineage_OnlineFeatureSchema)) - .optional(), - }) - .transform(d => ({ - models: d.models, - feature_specs: d.featureSpecs, - online_features: d.onlineFeatures, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalFeatureLineage_FeatureSpecSchema: z.ZodType = z - .object({ - name: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalFeatureLineage_ModelSchema: z.ZodType = z - .object({ - name: z.string().optional(), - version: z.number().optional(), - }) - .transform(d => ({ - name: d.name, - version: d.version, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalFeatureLineage_OnlineFeatureSchema: z.ZodType = z - .object({ - featureName: z.string().optional(), - tableName: z.string().optional(), - }) - .transform(d => ({ - feature_name: d.featureName, - table_name: d.tableName, - })); - export const marshalFeatureTagSchema: z.ZodType = z .object({ key: z.string().optional(), @@ -226,12 +181,11 @@ export const marshalFeatureTagSchema: z.ZodType = z value: d.value, })); -export const marshalListFeatureTagsResponseSchema: z.ZodType = z - .object({ - featureTags: z.array(z.lazy(() => marshalFeatureTagSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - feature_tags: d.featureTags, - next_page_token: d.nextPageToken, - })); +const featureTagFieldMaskSchema: FieldMaskSchema = { + key: {wire: 'key'}, + value: {wire: 'value'}, +}; + +export function featureTagFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, featureTagFieldMaskSchema); +} diff --git a/packages/metastores/src/v1/model.ts b/packages/metastores/src/v1/model.ts index 36c4d556..b6a792d2 100644 --- a/packages/metastores/src/v1/model.ts +++ b/packages/metastores/src/v1/model.ts @@ -290,64 +290,6 @@ export interface UpdateMetastoreAssignment { // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name. export interface UpdateMetastoreAssignment_Response {} -export const unmarshalCreateMetastoreSchema: z.ZodType = z - .object({ - name: z.string().optional(), - storage_root: z.string().optional(), - default_data_access_config_id: z.string().optional(), - storage_root_credential_id: z.string().optional(), - delta_sharing_scope: z.enum(DeltaSharingScope_Enum).optional(), - delta_sharing_recipient_token_lifetime_in_seconds: z.number().optional(), - delta_sharing_organization_name: z.string().optional(), - owner: z.string().optional(), - privilege_model_version: z.string().optional(), - region: z.string().optional(), - metastore_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - storage_root_credential_name: z.string().optional(), - cloud: z.string().optional(), - global_metastore_id: z.string().optional(), - external_access_enabled: z.boolean().optional(), - }) - .transform(d => ({ - name: d.name, - storageRoot: d.storage_root, - defaultDataAccessConfigId: d.default_data_access_config_id, - storageRootCredentialId: d.storage_root_credential_id, - deltaSharingScope: d.delta_sharing_scope, - deltaSharingRecipientTokenLifetimeInSeconds: - d.delta_sharing_recipient_token_lifetime_in_seconds, - deltaSharingOrganizationName: d.delta_sharing_organization_name, - owner: d.owner, - privilegeModelVersion: d.privilege_model_version, - region: d.region, - metastoreId: d.metastore_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - storageRootCredentialName: d.storage_root_credential_name, - cloud: d.cloud, - globalMetastoreId: d.global_metastore_id, - externalAccessEnabled: d.external_access_enabled, - })); - -export const unmarshalCreateMetastoreAssignmentSchema: z.ZodType = - z - .object({ - workspace_id: z.number().optional(), - metastore_id: z.string().optional(), - default_catalog_name: z.string().optional(), - }) - .transform(d => ({ - workspaceId: d.workspace_id, - metastoreId: d.metastore_id, - defaultCatalogName: d.default_catalog_name, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalCreateMetastoreAssignment_ResponseSchema: z.ZodType = z.object({}); @@ -479,68 +421,6 @@ export const unmarshalMetastoreInfoSchema: z.ZodType = z externalAccessEnabled: d.external_access_enabled, })); -export const unmarshalUpdateMetastoreSchema: z.ZodType = z - .object({ - id: z.string().optional(), - new_name: z.string().optional(), - name: z.string().optional(), - storage_root: z.string().optional(), - default_data_access_config_id: z.string().optional(), - storage_root_credential_id: z.string().optional(), - delta_sharing_scope: z.enum(DeltaSharingScope_Enum).optional(), - delta_sharing_recipient_token_lifetime_in_seconds: z.number().optional(), - delta_sharing_organization_name: z.string().optional(), - owner: z.string().optional(), - privilege_model_version: z.string().optional(), - region: z.string().optional(), - metastore_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - storage_root_credential_name: z.string().optional(), - cloud: z.string().optional(), - global_metastore_id: z.string().optional(), - external_access_enabled: z.boolean().optional(), - }) - .transform(d => ({ - id: d.id, - newName: d.new_name, - name: d.name, - storageRoot: d.storage_root, - defaultDataAccessConfigId: d.default_data_access_config_id, - storageRootCredentialId: d.storage_root_credential_id, - deltaSharingScope: d.delta_sharing_scope, - deltaSharingRecipientTokenLifetimeInSeconds: - d.delta_sharing_recipient_token_lifetime_in_seconds, - deltaSharingOrganizationName: d.delta_sharing_organization_name, - owner: d.owner, - privilegeModelVersion: d.privilege_model_version, - region: d.region, - metastoreId: d.metastore_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - storageRootCredentialName: d.storage_root_credential_name, - cloud: d.cloud, - globalMetastoreId: d.global_metastore_id, - externalAccessEnabled: d.external_access_enabled, - })); - -export const unmarshalUpdateMetastoreAssignmentSchema: z.ZodType = - z - .object({ - workspace_id: z.number().optional(), - metastore_id: z.string().optional(), - default_catalog_name: z.string().optional(), - }) - .transform(d => ({ - workspaceId: d.workspace_id, - metastoreId: d.metastore_id, - defaultCatalogName: d.default_catalog_name, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalUpdateMetastoreAssignment_ResponseSchema: z.ZodType = z.object({}); @@ -602,131 +482,6 @@ export const marshalCreateMetastoreAssignmentSchema: z.ZodType = z default_catalog_name: d.defaultCatalogName, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCreateMetastoreAssignment_ResponseSchema: z.ZodType = - z.object({}); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteMetastore_ResponseSchema: z.ZodType = z.object({}); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteMetastoreAssignment_ResponseSchema: z.ZodType = - z.object({}); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGetMetastoreSummary_ResponseSchema: z.ZodType = z - .object({ - metastoreId: z.string().optional(), - name: z.string().optional(), - defaultDataAccessConfigId: z.string().optional(), - storageRootCredentialId: z.string().optional(), - cloud: z.string().optional(), - region: z.string().optional(), - globalMetastoreId: z.string().optional(), - storageRootCredentialName: z.string().optional(), - privilegeModelVersion: z.string().optional(), - deltaSharingScope: z.enum(DeltaSharingScope_Enum).optional(), - deltaSharingRecipientTokenLifetimeInSeconds: z.number().optional(), - deltaSharingOrganizationName: z.string().optional(), - storageRoot: z.string().optional(), - owner: z.string().optional(), - createdAt: z.number().optional(), - createdBy: z.string().optional(), - updatedAt: z.number().optional(), - updatedBy: z.string().optional(), - externalAccessEnabled: z.boolean().optional(), - }) - .transform(d => ({ - metastore_id: d.metastoreId, - name: d.name, - default_data_access_config_id: d.defaultDataAccessConfigId, - storage_root_credential_id: d.storageRootCredentialId, - cloud: d.cloud, - region: d.region, - global_metastore_id: d.globalMetastoreId, - storage_root_credential_name: d.storageRootCredentialName, - privilege_model_version: d.privilegeModelVersion, - delta_sharing_scope: d.deltaSharingScope, - delta_sharing_recipient_token_lifetime_in_seconds: - d.deltaSharingRecipientTokenLifetimeInSeconds, - delta_sharing_organization_name: d.deltaSharingOrganizationName, - storage_root: d.storageRoot, - owner: d.owner, - created_at: d.createdAt, - created_by: d.createdBy, - updated_at: d.updatedAt, - updated_by: d.updatedBy, - external_access_enabled: d.externalAccessEnabled, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListMetastores_ResponseSchema: z.ZodType = z - .object({ - metastores: z.array(z.lazy(() => marshalMetastoreInfoSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - metastores: d.metastores, - next_page_token: d.nextPageToken, - })); - -export const marshalMetastoreAssignmentSchema: z.ZodType = z - .object({ - workspaceId: z.number().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 marshalMetastoreInfoSchema: z.ZodType = z - .object({ - name: z.string().optional(), - storageRoot: z.string().optional(), - defaultDataAccessConfigId: z.string().optional(), - storageRootCredentialId: z.string().optional(), - deltaSharingScope: z.enum(DeltaSharingScope_Enum).optional(), - deltaSharingRecipientTokenLifetimeInSeconds: z.number().optional(), - deltaSharingOrganizationName: z.string().optional(), - owner: z.string().optional(), - privilegeModelVersion: z.string().optional(), - region: z.string().optional(), - metastoreId: z.string().optional(), - createdAt: z.number().optional(), - createdBy: z.string().optional(), - updatedAt: z.number().optional(), - updatedBy: z.string().optional(), - storageRootCredentialName: z.string().optional(), - cloud: z.string().optional(), - globalMetastoreId: z.string().optional(), - externalAccessEnabled: z.boolean().optional(), - }) - .transform(d => ({ - name: d.name, - storage_root: d.storageRoot, - default_data_access_config_id: d.defaultDataAccessConfigId, - storage_root_credential_id: d.storageRootCredentialId, - delta_sharing_scope: d.deltaSharingScope, - delta_sharing_recipient_token_lifetime_in_seconds: - d.deltaSharingRecipientTokenLifetimeInSeconds, - delta_sharing_organization_name: d.deltaSharingOrganizationName, - owner: d.owner, - privilege_model_version: d.privilegeModelVersion, - region: d.region, - metastore_id: d.metastoreId, - created_at: d.createdAt, - created_by: d.createdBy, - updated_at: d.updatedAt, - updated_by: d.updatedBy, - storage_root_credential_name: d.storageRootCredentialName, - cloud: d.cloud, - global_metastore_id: d.globalMetastoreId, - external_access_enabled: d.externalAccessEnabled, - })); - export const marshalUpdateMetastoreSchema: z.ZodType = z .object({ id: z.string().optional(), @@ -787,7 +542,3 @@ export const marshalUpdateMetastoreAssignmentSchema: z.ZodType = z metastore_id: d.metastoreId, default_catalog_name: d.defaultCatalogName, })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalUpdateMetastoreAssignment_ResponseSchema: z.ZodType = - z.object({}); diff --git a/packages/notificationdestinations/src/v1/model.ts b/packages/notificationdestinations/src/v1/model.ts index 977fefff..fb875916 100644 --- a/packages/notificationdestinations/src/v1/model.ts +++ b/packages/notificationdestinations/src/v1/model.ts @@ -163,17 +163,6 @@ export const unmarshalConfigSchema: z.ZodType = z microsoftTeams: d.microsoft_teams, })); -export const unmarshalCreateNotificationDestinationRequestSchema: z.ZodType = - z - .object({ - display_name: z.string().optional(), - config: z.lazy(() => unmarshalConfigSchema).optional(), - }) - .transform(d => ({ - displayName: d.display_name, - config: d.config, - })); - export const unmarshalEmailConfigSchema: z.ZodType = z .object({ addresses: z.array(z.string()).optional(), @@ -301,19 +290,6 @@ export const unmarshalSlackConfigSchema: z.ZodType = z channelIdSet: d.channel_id_set, })); -export const unmarshalUpdateNotificationDestinationRequestSchema: z.ZodType = - z - .object({ - id: z.string().optional(), - display_name: z.string().optional(), - config: z.lazy(() => unmarshalConfigSchema).optional(), - }) - .transform(d => ({ - id: d.id, - displayName: d.display_name, - config: d.config, - })); - export const marshalConfigSchema: z.ZodType = z .object({ slack: z.lazy(() => marshalSlackConfigSchema).optional(), @@ -348,8 +324,6 @@ export const marshalEmailConfigSchema: z.ZodType = z addresses: d.addresses, })); -export const marshalEmptySchema: z.ZodType = z.object({}); - export const marshalGenericWebhookConfigSchema: z.ZodType = z .object({ url: z.string().optional(), @@ -368,32 +342,6 @@ export const marshalGenericWebhookConfigSchema: z.ZodType = z password_set: d.passwordSet, })); -export const marshalListNotificationDestinationsResponseSchema: z.ZodType = z - .object({ - results: z - .array(z.lazy(() => marshalListNotificationDestinationsResultSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - results: d.results, - next_page_token: d.nextPageToken, - })); - -export const marshalListNotificationDestinationsResultSchema: z.ZodType = z - .object({ - id: z.string().optional(), - displayName: z.string().optional(), - destinationType: z.enum(DestinationType).optional(), - config: z.lazy(() => marshalConfigSchema).optional(), - }) - .transform(d => ({ - id: d.id, - display_name: d.displayName, - destination_type: d.destinationType, - config: d.config, - })); - export const marshalMicrosoftTeamsConfigSchema: z.ZodType = z .object({ url: z.string().optional(), @@ -420,20 +368,6 @@ export const marshalMicrosoftTeamsConfigSchema: z.ZodType = z tenant_id_set: d.tenantIdSet, })); -export const marshalNotificationDestinationSchema: z.ZodType = z - .object({ - id: z.string().optional(), - displayName: z.string().optional(), - destinationType: z.enum(DestinationType).optional(), - config: z.lazy(() => marshalConfigSchema).optional(), - }) - .transform(d => ({ - id: d.id, - display_name: d.displayName, - destination_type: d.destinationType, - config: d.config, - })); - export const marshalPagerdutyConfigSchema: z.ZodType = z .object({ integrationKey: z.string().optional(), diff --git a/packages/oauthcustomappintegration/src/v1/model.ts b/packages/oauthcustomappintegration/src/v1/model.ts index 24a2cad0..5e5a6e9d 100644 --- a/packages/oauthcustomappintegration/src/v1/model.ts +++ b/packages/oauthcustomappintegration/src/v1/model.ts @@ -215,44 +215,6 @@ export interface UpdatePublishedOAuthAppIntegration { // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name. export interface UpdatePublishedOAuthAppIntegration_Response {} -export const unmarshalCreateCustomOAuthAppIntegrationSchema: z.ZodType = - z - .object({ - account_id: z.string().optional(), - redirect_urls: z.array(z.string()).optional(), - name: z.string().optional(), - confidential: z.boolean().optional(), - token_access_policy: z - .lazy(() => unmarshalTokenAccessPolicySchema) - .optional(), - scopes: z.array(z.string()).optional(), - user_authorized_scopes: z.array(z.string()).optional(), - }) - .transform(d => ({ - accountId: d.account_id, - redirectUrls: d.redirect_urls, - name: d.name, - confidential: d.confidential, - tokenAccessPolicy: d.token_access_policy, - scopes: d.scopes, - userAuthorizedScopes: d.user_authorized_scopes, - })); - -export const unmarshalCreatePublishedOAuthAppIntegrationSchema: z.ZodType = - z - .object({ - account_id: z.string().optional(), - app_id: z.string().optional(), - token_access_policy: z - .lazy(() => unmarshalTokenAccessPolicySchema) - .optional(), - }) - .transform(d => ({ - accountId: d.account_id, - appId: d.app_id, - tokenAccessPolicy: d.token_access_policy, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalCreatePublishedOAuthAppIntegration_ResponseSchema: z.ZodType = z @@ -387,46 +349,10 @@ export const unmarshalTokenAccessPolicySchema: z.ZodType = z absoluteSessionLifetimeInMinutes: d.absolute_session_lifetime_in_minutes, })); -export const unmarshalUpdateCustomOAuthAppIntegrationSchema: z.ZodType = - z - .object({ - account_id: z.string().optional(), - integration_id: z.string().optional(), - redirect_urls: z.array(z.string()).optional(), - token_access_policy: z - .lazy(() => unmarshalTokenAccessPolicySchema) - .optional(), - scopes: z.array(z.string()).optional(), - user_authorized_scopes: z.array(z.string()).optional(), - }) - .transform(d => ({ - accountId: d.account_id, - integrationId: d.integration_id, - redirectUrls: d.redirect_urls, - tokenAccessPolicy: d.token_access_policy, - scopes: d.scopes, - userAuthorizedScopes: d.user_authorized_scopes, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalUpdateCustomOAuthAppIntegration_ResponseSchema: z.ZodType = z.object({}); -export const unmarshalUpdatePublishedOAuthAppIntegrationSchema: z.ZodType = - z - .object({ - account_id: z.string().optional(), - integration_id: z.string().optional(), - token_access_policy: z - .lazy(() => unmarshalTokenAccessPolicySchema) - .optional(), - }) - .transform(d => ({ - accountId: d.account_id, - integrationId: d.integration_id, - tokenAccessPolicy: d.token_access_policy, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalUpdatePublishedOAuthAppIntegration_ResponseSchema: z.ZodType = z.object({}); @@ -463,118 +389,6 @@ export const marshalCreatePublishedOAuthAppIntegrationSchema: z.ZodType = z token_access_policy: d.tokenAccessPolicy, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCreatePublishedOAuthAppIntegration_ResponseSchema: z.ZodType = - z - .object({ - integrationId: z.string().optional(), - }) - .transform(d => ({ - integration_id: d.integrationId, - })); - -export const marshalCustomOAuthAppIntegrationSchema: z.ZodType = z - .object({ - integrationId: z.string().optional(), - clientId: z.string().optional(), - redirectUrls: z.array(z.string()).optional(), - name: z.string().optional(), - confidential: z.boolean().optional(), - tokenAccessPolicy: z.lazy(() => marshalTokenAccessPolicySchema).optional(), - scopes: z.array(z.string()).optional(), - createdBy: z.number().optional(), - createTime: z.string().optional(), - creatorUsername: z.string().optional(), - userAuthorizedScopes: z.array(z.string()).optional(), - principalId: z.number().optional(), - }) - .transform(d => ({ - integration_id: d.integrationId, - client_id: d.clientId, - redirect_urls: d.redirectUrls, - name: d.name, - confidential: d.confidential, - token_access_policy: d.tokenAccessPolicy, - scopes: d.scopes, - created_by: d.createdBy, - create_time: d.createTime, - creator_username: d.creatorUsername, - user_authorized_scopes: d.userAuthorizedScopes, - principal_id: d.principalId, - })); - -export const marshalCustomOAuthAppIntegrationSecretSchema: z.ZodType = z - .object({ - integrationId: z.string().optional(), - clientId: z.string().optional(), - clientSecret: z.string().optional(), - principalId: z.number().optional(), - clientSecretExpireTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - }) - .transform(d => ({ - integration_id: d.integrationId, - client_id: d.clientId, - client_secret: d.clientSecret, - principal_id: d.principalId, - client_secret_expire_time: d.clientSecretExpireTime, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteCustomOAuthAppIntegration_ResponseSchema: z.ZodType = - z.object({}); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeletePublishedOAuthAppIntegration_ResponseSchema: z.ZodType = - z.object({}); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListCustomOAuthAppIntegrations_ResponseSchema: z.ZodType = z - .object({ - apps: z - .array(z.lazy(() => marshalCustomOAuthAppIntegrationSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - apps: d.apps, - next_page_token: d.nextPageToken, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListPublishedOAuthAppIntegrations_ResponseSchema: z.ZodType = - z - .object({ - apps: z - .array(z.lazy(() => marshalPublishedOAuthAppIntegrationSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - apps: d.apps, - next_page_token: d.nextPageToken, - })); - -export const marshalPublishedOAuthAppIntegrationSchema: z.ZodType = z - .object({ - appId: z.string().optional(), - integrationId: z.string().optional(), - name: z.string().optional(), - tokenAccessPolicy: z.lazy(() => marshalTokenAccessPolicySchema).optional(), - createdBy: z.number().optional(), - createTime: z.string().optional(), - }) - .transform(d => ({ - app_id: d.appId, - integration_id: d.integrationId, - name: d.name, - token_access_policy: d.tokenAccessPolicy, - created_by: d.createdBy, - create_time: d.createTime, - })); - export const marshalTokenAccessPolicySchema: z.ZodType = z .object({ accessTokenTtlInMinutes: z.number().optional(), @@ -607,10 +421,6 @@ export const marshalUpdateCustomOAuthAppIntegrationSchema: z.ZodType = z user_authorized_scopes: d.userAuthorizedScopes, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalUpdateCustomOAuthAppIntegration_ResponseSchema: z.ZodType = - z.object({}); - export const marshalUpdatePublishedOAuthAppIntegrationSchema: z.ZodType = z .object({ accountId: z.string().optional(), @@ -622,7 +432,3 @@ export const marshalUpdatePublishedOAuthAppIntegrationSchema: z.ZodType = z integration_id: d.integrationId, token_access_policy: d.tokenAccessPolicy, })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalUpdatePublishedOAuthAppIntegration_ResponseSchema: z.ZodType = - z.object({}); diff --git a/packages/oauthpublishedapp/src/v1/model.ts b/packages/oauthpublishedapp/src/v1/model.ts index 8134b8a2..a71a9a86 100644 --- a/packages/oauthpublishedapp/src/v1/model.ts +++ b/packages/oauthpublishedapp/src/v1/model.ts @@ -67,34 +67,3 @@ export const unmarshalPublishedOAuthAppSchema: z.ZodType = z redirectUrls: d.redirect_urls, scopes: d.scopes, })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListPublishedOAuthApps_ResponseSchema: z.ZodType = z - .object({ - apps: z.array(z.lazy(() => marshalPublishedOAuthAppSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - apps: d.apps, - next_page_token: d.nextPageToken, - })); - -export const marshalPublishedOAuthAppSchema: z.ZodType = z - .object({ - appId: z.string().optional(), - clientId: z.string().optional(), - name: z.string().optional(), - description: z.string().optional(), - isConfidentialClient: z.boolean().optional(), - redirectUrls: z.array(z.string()).optional(), - scopes: z.array(z.string()).optional(), - }) - .transform(d => ({ - app_id: d.appId, - client_id: d.clientId, - name: d.name, - description: d.description, - is_confidential_client: d.isConfidentialClient, - redirect_urls: d.redirectUrls, - scopes: d.scopes, - })); diff --git a/packages/permissions/src/v1/model.ts b/packages/permissions/src/v1/model.ts index 2e8af176..a36f0c7f 100644 --- a/packages/permissions/src/v1/model.ts +++ b/packages/permissions/src/v1/model.ts @@ -106,21 +106,6 @@ export interface UpdateObjectPermissions { accessControlList?: AccessControlRequest[] | undefined; } -export const unmarshalAccessControlRequestSchema: z.ZodType = - z - .object({ - user_name: z.string().optional(), - group_name: z.string().optional(), - service_principal_name: z.string().optional(), - permission_level: z.enum(PermissionLevel).optional(), - }) - .transform(d => ({ - userName: d.user_name, - groupName: d.group_name, - servicePrincipalName: d.service_principal_name, - permissionLevel: d.permission_level, - })); - export const unmarshalAccessControlResponseSchema: z.ZodType = z .object({ @@ -190,36 +175,6 @@ export const unmarshalPermissionsResponseSchema: z.ZodType accessControlList: d.access_control_list, })); -export const unmarshalSetObjectPermissionsSchema: z.ZodType = - z - .object({ - request_object_type: z.string().optional(), - request_object_id: z.string().optional(), - access_control_list: z - .array(z.lazy(() => unmarshalAccessControlRequestSchema)) - .optional(), - }) - .transform(d => ({ - requestObjectType: d.request_object_type, - requestObjectId: d.request_object_id, - accessControlList: d.access_control_list, - })); - -export const unmarshalUpdateObjectPermissionsSchema: z.ZodType = - z - .object({ - request_object_type: z.string().optional(), - request_object_id: z.string().optional(), - access_control_list: z - .array(z.lazy(() => unmarshalAccessControlRequestSchema)) - .optional(), - }) - .transform(d => ({ - requestObjectType: d.request_object_type, - requestObjectId: d.request_object_id, - accessControlList: d.access_control_list, - })); - export const marshalAccessControlRequestSchema: z.ZodType = z .object({ userName: z.string().optional(), @@ -234,69 +189,6 @@ export const marshalAccessControlRequestSchema: z.ZodType = z permission_level: d.permissionLevel, })); -export const marshalAccessControlResponseSchema: z.ZodType = z - .object({ - userName: z.string().optional(), - groupName: z.string().optional(), - servicePrincipalName: z.string().optional(), - displayName: z.string().optional(), - allPermissions: z.array(z.lazy(() => marshalPermissionSchema)).optional(), - }) - .transform(d => ({ - user_name: d.userName, - group_name: d.groupName, - service_principal_name: d.servicePrincipalName, - display_name: d.displayName, - all_permissions: d.allPermissions, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGetPermissionLevels_ResponseSchema: z.ZodType = z - .object({ - permissionLevels: z - .array(z.lazy(() => marshalPermissionsDescriptionSchema)) - .optional(), - }) - .transform(d => ({ - permission_levels: d.permissionLevels, - })); - -export const marshalPermissionSchema: z.ZodType = z - .object({ - permissionLevel: z.enum(PermissionLevel).optional(), - inherited: z.boolean().optional(), - inheritedFromObject: z.array(z.string()).optional(), - }) - .transform(d => ({ - permission_level: d.permissionLevel, - inherited: d.inherited, - inherited_from_object: d.inheritedFromObject, - })); - -export const marshalPermissionsDescriptionSchema: z.ZodType = z - .object({ - permissionLevel: z.enum(PermissionLevel).optional(), - description: z.string().optional(), - }) - .transform(d => ({ - permission_level: d.permissionLevel, - description: d.description, - })); - -export const marshalPermissionsResponseSchema: z.ZodType = z - .object({ - objectId: z.string().optional(), - objectType: z.string().optional(), - accessControlList: z - .array(z.lazy(() => marshalAccessControlResponseSchema)) - .optional(), - }) - .transform(d => ({ - object_id: d.objectId, - object_type: d.objectType, - access_control_list: d.accessControlList, - })); - export const marshalSetObjectPermissionsSchema: z.ZodType = z .object({ requestObjectType: z.string().optional(), diff --git a/packages/policyfamilies/src/v2/model.ts b/packages/policyfamilies/src/v2/model.ts index d13e9ee5..6eac4d0a 100644 --- a/packages/policyfamilies/src/v2/model.ts +++ b/packages/policyfamilies/src/v2/model.ts @@ -64,28 +64,3 @@ export const unmarshalPolicyFamilySchema: z.ZodType = z description: d.description, definition: d.definition, })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListPolicyFamilies_ResponseSchema: z.ZodType = z - .object({ - policyFamilies: z.array(z.lazy(() => marshalPolicyFamilySchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - policy_families: d.policyFamilies, - next_page_token: d.nextPageToken, - })); - -export const marshalPolicyFamilySchema: z.ZodType = z - .object({ - policyFamilyId: z.string().optional(), - name: z.string().optional(), - description: z.string().optional(), - definition: z.string().optional(), - }) - .transform(d => ({ - policy_family_id: d.policyFamilyId, - name: d.name, - description: d.description, - definition: d.definition, - })); diff --git a/packages/postgres/src/v1/client.ts b/packages/postgres/src/v1/client.ts index 0dead3c5..4b8641e9 100644 --- a/packages/postgres/src/v1/client.ts +++ b/packages/postgres/src/v1/client.ts @@ -1539,7 +1539,7 @@ export class Client { const url = `${this.host}/api/2.0/postgres/${req.branch?.name ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; @@ -1579,7 +1579,7 @@ export class Client { const url = `${this.host}/api/2.0/postgres/${req.database?.name ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; @@ -1619,7 +1619,7 @@ export class Client { const url = `${this.host}/api/2.0/postgres/${req.endpoint?.name ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; @@ -1659,7 +1659,7 @@ export class Client { const url = `${this.host}/api/2.0/postgres/${req.project?.name ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; @@ -1699,7 +1699,7 @@ export class Client { const url = `${this.host}/api/2.0/postgres/${req.role?.name ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; diff --git a/packages/postgres/src/v1/model.ts b/packages/postgres/src/v1/model.ts index 525afee1..4908da83 100644 --- a/packages/postgres/src/v1/model.ts +++ b/packages/postgres/src/v1/model.ts @@ -1,6 +1,8 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. import {Temporal} from '@js-temporal/polyfill'; +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; /** The compute endpoint type. Either `read_write` or `read_only`. */ @@ -2297,7 +2299,7 @@ export interface UpdateBranchRequest { */ branch?: Branch | undefined; /** The list of fields to update. If unspecified, all fields will be updated when possible. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export interface UpdateDatabaseRequest { @@ -2309,7 +2311,7 @@ export interface UpdateDatabaseRequest { */ database?: Database | undefined; /** The list of fields to update. If unspecified, all fields will be updated when possible. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export interface UpdateEndpointRequest { @@ -2321,7 +2323,7 @@ export interface UpdateEndpointRequest { */ endpoint?: Endpoint | undefined; /** The list of fields to update. If unspecified, all fields will be updated when possible. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export interface UpdateProjectRequest { @@ -2333,7 +2335,7 @@ export interface UpdateProjectRequest { */ project?: Project | undefined; /** The list of fields to update. If unspecified, all fields will be updated when possible. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export interface UpdateRoleRequest { @@ -2348,7 +2350,7 @@ export interface UpdateRoleRequest { * The list of fields to update in Postgres Role. * If unspecified, all fields will be updated when possible. */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalBranchSchema: z.ZodType = z @@ -2889,29 +2891,6 @@ export const unmarshalForwardEtlTableMappingSchema: z.ZodType = - z - .object({ - claims: z.array(z.lazy(() => unmarshalRequestedClaimsSchema)).optional(), - endpoint: z.string().optional(), - group_name: z.string().optional(), - ttl: z - .string() - .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) - .optional(), - expire_time: z - .string() - .transform(s => Temporal.Instant.from(s)) - .optional(), - }) - .transform(d => ({ - claims: d.claims, - endpoint: d.endpoint, - groupName: d.group_name, - ttl: d.ttl, - expireTime: d.expire_time, - })); - export const unmarshalInitialEndpointSpecSchema: z.ZodType = z .object({ @@ -3164,28 +3143,6 @@ export const unmarshalProjectStatusSchema: z.ZodType = z projectId: d.project_id, })); -export const unmarshalRequestedClaimsSchema: z.ZodType = z - .object({ - permission_set: z.enum(RequestedClaims_PermissionSet).optional(), - resources: z - .array(z.lazy(() => unmarshalRequestedResourceSchema)) - .optional(), - }) - .transform(d => ({ - permissionSet: d.permission_set, - resources: d.resources, - })); - -export const unmarshalRequestedResourceSchema: z.ZodType = z - .object({ - unspecified_resource_name: z.string().optional(), - table_name: z.string().optional(), - }) - .transform(d => ({ - unspecifiedResourceName: d.unspecified_resource_name, - tableName: d.table_name, - })); - export const unmarshalRoleSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -3407,24 +3364,6 @@ export const unmarshalTableSchema: z.ZodType = z tableServingUrl: d.table_serving_url, })); -export const unmarshalUndeleteBranchRequestSchema: z.ZodType = - z - .object({ - name: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - })); - -export const unmarshalUndeleteProjectRequestSchema: z.ZodType = - z - .object({ - name: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - })); - export const marshalBranchSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -3451,8 +3390,6 @@ export const marshalBranchSchema: z.ZodType = z status: d.status, })); -export const marshalBranchOperationMetadataSchema: z.ZodType = z.object({}); - export const marshalBranchSpecSchema: z.ZodType = z .object({ sourceBranch: z.string().optional(), @@ -3581,36 +3518,6 @@ export const marshalCatalog_CatalogStatusSchema: z.ZodType = z catalog_id: d.catalogId, })); -export const marshalCatalogOperationMetadataSchema: z.ZodType = z.object({}); - -export const marshalComputeInstanceSchema: z.ZodType = z - .object({ - name: z.string().optional(), - computeInstanceId: z.string().optional(), - currentState: z.enum(ComputeInstance_ComputeState).optional(), - pendingState: z.enum(ComputeInstance_ComputeState).optional(), - role: z.enum(ComputeInstance_ComputeType).optional(), - computeHost: z.string().optional(), - startTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - suspendTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - }) - .transform(d => ({ - name: d.name, - compute_instance_id: d.computeInstanceId, - current_state: d.currentState, - pending_state: d.pendingState, - role: d.role, - compute_host: d.computeHost, - start_time: d.startTime, - suspend_time: d.suspendTime, - })); - export const marshalDatabaseSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -3659,46 +3566,6 @@ export const marshalDatabase_DatabaseStatusSchema: z.ZodType = z database_id: d.databaseId, })); -export const marshalDatabaseCredentialSchema: z.ZodType = z - .object({ - token: z.string().optional(), - expireTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - }) - .transform(d => ({ - token: d.token, - expire_time: d.expireTime, - })); - -export const marshalDatabaseOperationMetadataSchema: z.ZodType = z.object({}); - -export const marshalDatabricksServiceExceptionWithDetailsProtoSchema: z.ZodType = - z - .object({ - errorCode: z.enum(ErrorCode).optional(), - message: z.string().optional(), - stackTrace: z.string().optional(), - details: z.array(z.record(z.string(), z.unknown())).optional(), - }) - .transform(d => ({ - error_code: d.errorCode, - message: d.message, - stack_trace: d.stackTrace, - details: d.details, - })); - -export const marshalDeleteForwardEtlConfigurationResponseSchema: z.ZodType = z - .object({ - deletedConfigs: z.number().optional(), - deletedMappings: z.number().optional(), - }) - .transform(d => ({ - deleted_configs: d.deletedConfigs, - deleted_mappings: d.deletedMappings, - })); - export const marshalDeltaTableSyncInfoSchema: z.ZodType = z .object({ deltaCommitVersion: z.number().optional(), @@ -3712,14 +3579,6 @@ export const marshalDeltaTableSyncInfoSchema: z.ZodType = z delta_commit_time: d.deltaCommitTime, })); -export const marshalDisableForwardEtlResponseSchema: z.ZodType = z - .object({ - disabled: z.boolean().optional(), - }) - .transform(d => ({ - disabled: d.disabled, - })); - export const marshalEndpointSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -3784,8 +3643,6 @@ export const marshalEndpointHostsSchema: z.ZodType = z read_only_pooled_host: d.readOnlyPooledHost, })); -export const marshalEndpointOperationMetadataSchema: z.ZodType = z.object({}); - export const marshalEndpointSettingsSchema: z.ZodType = z .object({ pgSettings: z.record(z.string(), z.string()).optional(), @@ -3855,96 +3712,6 @@ export const marshalEndpointStatusSchema: z.ZodType = z endpoint_id: d.endpointId, })); -export const marshalForwardEtlConfigSchema: z.ZodType = z - .object({ - workspaceId: z.number().optional(), - tenantId: z.string().optional(), - timelineId: z.string().optional(), - pgDatabaseOid: z.number().optional(), - pgSchemaOid: z.number().optional(), - ucCatalogId: z.string().optional(), - ucSchemaId: z.string().optional(), - enabled: z.boolean().optional(), - createTimeMillis: z.number().optional(), - updateTimeMillis: z.number().optional(), - }) - .transform(d => ({ - workspace_id: d.workspaceId, - tenant_id: d.tenantId, - timeline_id: d.timelineId, - pg_database_oid: d.pgDatabaseOid, - pg_schema_oid: d.pgSchemaOid, - uc_catalog_id: d.ucCatalogId, - uc_schema_id: d.ucSchemaId, - enabled: d.enabled, - create_time_millis: d.createTimeMillis, - update_time_millis: d.updateTimeMillis, - })); - -export const marshalForwardEtlDatabaseSchema: z.ZodType = z - .object({ - name: z.string().optional(), - oid: z.number().optional(), - }) - .transform(d => ({ - name: d.name, - oid: d.oid, - })); - -export const marshalForwardEtlMetadataSchema: z.ZodType = z - .object({ - databases: z - .array(z.lazy(() => marshalForwardEtlDatabaseSchema)) - .optional(), - schemas: z.array(z.lazy(() => marshalForwardEtlSchemaSchema)).optional(), - }) - .transform(d => ({ - databases: d.databases, - schemas: d.schemas, - })); - -export const marshalForwardEtlSchemaSchema: z.ZodType = z - .object({ - name: z.string().optional(), - oid: z.number().optional(), - }) - .transform(d => ({ - name: d.name, - oid: d.oid, - })); - -export const marshalForwardEtlStatusSchema: z.ZodType = z - .object({ - configurations: z - .array(z.lazy(() => marshalForwardEtlConfigSchema)) - .optional(), - tableMappings: z - .array(z.lazy(() => marshalForwardEtlTableMappingSchema)) - .optional(), - }) - .transform(d => ({ - configurations: d.configurations, - table_mappings: d.tableMappings, - })); - -export const marshalForwardEtlTableMappingSchema: z.ZodType = z - .object({ - pgTableOid: z.number().optional(), - ucTableId: z.string().optional(), - lastSyncedLsn: z.string().optional(), - pgTableName: z.string().optional(), - ucTableName: z.string().optional(), - enabled: z.boolean().optional(), - }) - .transform(d => ({ - pg_table_oid: d.pgTableOid, - uc_table_id: d.ucTableId, - last_synced_lsn: d.lastSyncedLsn, - pg_table_name: d.pgTableName, - uc_table_name: d.ucTableName, - enabled: d.enabled, - })); - export const marshalGenerateDatabaseCredentialRequestSchema: z.ZodType = z .object({ claims: z.array(z.lazy(() => marshalRequestedClaimsSchema)).optional(), @@ -3975,68 +3742,6 @@ export const marshalInitialEndpointSpecSchema: z.ZodType = z group: d.group, })); -export const marshalListBranchesResponseSchema: z.ZodType = z - .object({ - branches: z.array(z.lazy(() => marshalBranchSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - branches: d.branches, - next_page_token: d.nextPageToken, - })); - -export const marshalListComputeInstancesResponseSchema: z.ZodType = z - .object({ - computeInstances: z - .array(z.lazy(() => marshalComputeInstanceSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - compute_instances: d.computeInstances, - next_page_token: d.nextPageToken, - })); - -export const marshalListDatabasesResponseSchema: z.ZodType = z - .object({ - databases: z.array(z.lazy(() => marshalDatabaseSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - databases: d.databases, - next_page_token: d.nextPageToken, - })); - -export const marshalListEndpointsResponseSchema: z.ZodType = z - .object({ - endpoints: z.array(z.lazy(() => marshalEndpointSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - endpoints: d.endpoints, - next_page_token: d.nextPageToken, - })); - -export const marshalListProjectsResponseSchema: z.ZodType = z - .object({ - projects: z.array(z.lazy(() => marshalProjectSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - projects: d.projects, - next_page_token: d.nextPageToken, - })); - -export const marshalListRolesResponseSchema: z.ZodType = z - .object({ - roles: z.array(z.lazy(() => marshalRoleSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - roles: d.roles, - next_page_token: d.nextPageToken, - })); - export const marshalNewPipelineSpecSchema: z.ZodType = z .object({ storageCatalog: z.string().optional(), @@ -4051,24 +3756,6 @@ export const marshalNewPipelineSpecSchema: z.ZodType = z pipeline_channel: d.pipelineChannel, })); -export const marshalOperationSchema: z.ZodType = z - .object({ - name: z.string().optional(), - metadata: z.record(z.string(), z.unknown()).optional(), - done: z.boolean().optional(), - error: z - .lazy(() => marshalDatabricksServiceExceptionWithDetailsProtoSchema) - .optional(), - response: z.record(z.string(), z.unknown()).optional(), - }) - .transform(d => ({ - name: d.name, - metadata: d.metadata, - done: d.done, - error: d.error, - response: d.response, - })); - export const marshalProjectSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -4136,8 +3823,6 @@ export const marshalProjectDefaultEndpointSettingsSchema: z.ZodType = z pg_settings: d.pgSettings, })); -export const marshalProjectOperationMetadataSchema: z.ZodType = z.object({}); - export const marshalProjectSpecSchema: z.ZodType = z .object({ displayName: z.string().optional(), @@ -4300,8 +3985,6 @@ export const marshalRole_RoleStatusSchema: z.ZodType = z role_id: d.roleId, })); -export const marshalRoleOperationMetadataSchema: z.ZodType = z.object({}); - export const marshalSyncedTableSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -4382,10 +4065,6 @@ export const marshalSyncedTable_SyncedTableStatusSchema: z.ZodType = z project: d.project, })); -export const marshalSyncedTableOperationMetadataSchema: z.ZodType = z.object( - {} -); - export const marshalSyncedTablePipelineProgressSchema: z.ZodType = z .object({ latestVersionCurrentlyProcessing: z.number().optional(), @@ -4453,3 +4132,391 @@ export const marshalUndeleteProjectRequestSchema: z.ZodType = z .transform(d => ({ name: d.name, })); + +const branchFieldMaskSchema: FieldMaskSchema = { + 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'}, +}; + +export function branchSpecFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, branchSpecFieldMaskSchema); +} + +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'}, +}; + +export function branchStatusFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, branchStatusFieldMaskSchema); +} + +const databaseFieldMaskSchema: FieldMaskSchema = { + createTime: {wire: 'create_time'}, + name: {wire: 'name'}, + parent: {wire: 'parent'}, + spec: {wire: 'spec', children: () => database_DatabaseSpecFieldMaskSchema}, + status: { + wire: 'status', + children: () => database_DatabaseStatusFieldMaskSchema, + }, + updateTime: {wire: 'update_time'}, +}; + +export function databaseFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, databaseFieldMaskSchema); +} + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +const database_DatabaseSpecFieldMaskSchema: FieldMaskSchema = { + postgresDatabase: {wire: 'postgres_database'}, + role: {wire: 'role'}, +}; + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export function database_DatabaseSpecFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + database_DatabaseSpecFieldMaskSchema + ); +} + +// 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'}, +}; + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export function database_DatabaseStatusFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + database_DatabaseStatusFieldMaskSchema + ); +} + +const endpointFieldMaskSchema: FieldMaskSchema = { + createTime: {wire: 'create_time'}, + name: {wire: 'name'}, + parent: {wire: 'parent'}, + spec: {wire: 'spec', children: () => endpointSpecFieldMaskSchema}, + status: {wire: 'status', children: () => endpointStatusFieldMaskSchema}, + uid: {wire: 'uid'}, + updateTime: {wire: 'update_time'}, +}; + +export function endpointFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, endpointFieldMaskSchema); +} + +const endpointGroupSpecFieldMaskSchema: FieldMaskSchema = { + enableReadableSecondaries: {wire: 'enable_readable_secondaries'}, + max: {wire: 'max'}, + min: {wire: 'min'}, +}; + +export function endpointGroupSpecFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + endpointGroupSpecFieldMaskSchema + ); +} + +const endpointGroupStatusFieldMaskSchema: FieldMaskSchema = { + enableReadableSecondaries: {wire: 'enable_readable_secondaries'}, + max: {wire: 'max'}, + min: {wire: 'min'}, +}; + +export function endpointGroupStatusFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + endpointGroupStatusFieldMaskSchema + ); +} + +const endpointHostsFieldMaskSchema: FieldMaskSchema = { + host: {wire: 'host'}, + readOnlyHost: {wire: 'read_only_host'}, + readOnlyPooledHost: {wire: 'read_only_pooled_host'}, + readWritePooledHost: {wire: 'read_write_pooled_host'}, +}; + +export function endpointHostsFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, endpointHostsFieldMaskSchema); +} + +const endpointSettingsFieldMaskSchema: FieldMaskSchema = { + pgSettings: {wire: 'pg_settings'}, +}; + +export function endpointSettingsFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + endpointSettingsFieldMaskSchema + ); +} + +const endpointSpecFieldMaskSchema: 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}, + noSuspension: {wire: 'no_suspension'}, + settings: {wire: 'settings', children: () => endpointSettingsFieldMaskSchema}, + suspendTimeoutDuration: {wire: 'suspend_timeout_duration'}, +}; + +export function endpointSpecFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, endpointSpecFieldMaskSchema); +} + +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}, + lastActiveTime: {wire: 'last_active_time'}, + pendingState: {wire: 'pending_state'}, + settings: {wire: 'settings', children: () => endpointSettingsFieldMaskSchema}, + suspendTimeoutDuration: {wire: 'suspend_timeout_duration'}, +}; + +export function endpointStatusFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, endpointStatusFieldMaskSchema); +} + +const initialEndpointSpecFieldMaskSchema: FieldMaskSchema = { + group: {wire: 'group', children: () => endpointGroupSpecFieldMaskSchema}, +}; + +export function initialEndpointSpecFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + initialEndpointSpecFieldMaskSchema + ); +} + +const projectFieldMaskSchema: FieldMaskSchema = { + createTime: {wire: 'create_time'}, + deleteTime: {wire: 'delete_time'}, + initialEndpointSpec: { + wire: 'initial_endpoint_spec', + children: () => initialEndpointSpecFieldMaskSchema, + }, + name: {wire: 'name'}, + purgeTime: {wire: 'purge_time'}, + spec: {wire: 'spec', children: () => projectSpecFieldMaskSchema}, + status: {wire: 'status', children: () => projectStatusFieldMaskSchema}, + uid: {wire: 'uid'}, + updateTime: {wire: 'update_time'}, +}; + +export function projectFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, projectFieldMaskSchema); +} + +const projectCustomTagFieldMaskSchema: FieldMaskSchema = { + key: {wire: 'key'}, + value: {wire: 'value'}, +}; + +export function projectCustomTagFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + projectCustomTagFieldMaskSchema + ); +} + +const projectDefaultEndpointSettingsFieldMaskSchema: FieldMaskSchema = { + autoscalingLimitMaxCu: {wire: 'autoscaling_limit_max_cu'}, + autoscalingLimitMinCu: {wire: 'autoscaling_limit_min_cu'}, + noSuspension: {wire: 'no_suspension'}, + pgSettings: {wire: 'pg_settings'}, + suspendTimeoutDuration: {wire: 'suspend_timeout_duration'}, +}; + +export function projectDefaultEndpointSettingsFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + projectDefaultEndpointSettingsFieldMaskSchema + ); +} + +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'}, + workspaceKeyEncrypted: {wire: 'workspace_key_encrypted'}, +}; + +export function projectSpecFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, projectSpecFieldMaskSchema); +} + +const projectStatusFieldMaskSchema: FieldMaskSchema = { + branchLogicalSizeLimitBytes: {wire: 'branch_logical_size_limit_bytes'}, + 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, + }, + 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'}, +}; + +export function projectStatusFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, projectStatusFieldMaskSchema); +} + +const roleFieldMaskSchema: FieldMaskSchema = { + createTime: {wire: 'create_time'}, + name: {wire: 'name'}, + parent: {wire: 'parent'}, + spec: {wire: 'spec', children: () => role_RoleSpecFieldMaskSchema}, + status: {wire: 'status', children: () => role_RoleStatusFieldMaskSchema}, + updateTime: {wire: 'update_time'}, +}; + +export function roleFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, roleFieldMaskSchema); +} + +// 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. +export function role_AttributesFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + role_AttributesFieldMaskSchema + ); +} + +// 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. +export function role_RoleSpecFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, role_RoleSpecFieldMaskSchema); +} + +// 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'}, +}; + +// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. +export function role_RoleStatusFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + role_RoleStatusFieldMaskSchema + ); +} diff --git a/packages/qualitymonitor/src/v2/model.ts b/packages/qualitymonitor/src/v2/model.ts index 84494eb2..56f70048 100644 --- a/packages/qualitymonitor/src/v2/model.ts +++ b/packages/qualitymonitor/src/v2/model.ts @@ -380,18 +380,6 @@ export const marshalCustomScalarCheckSchema: z.ZodType = z thresholds: d.thresholds, })); -export const marshalListQualityMonitorResponseSchema: z.ZodType = z - .object({ - qualityMonitors: z - .array(z.lazy(() => marshalQualityMonitorSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - quality_monitors: d.qualityMonitors, - next_page_token: d.nextPageToken, - })); - export const marshalPercentNullValidityCheckSchema: z.ZodType = z .object({ columnNames: z.array(z.string()).optional(), diff --git a/packages/qualitymonitors/src/v1/model.ts b/packages/qualitymonitors/src/v1/model.ts index d5748b09..c84a1a76 100644 --- a/packages/qualitymonitors/src/v1/model.ts +++ b/packages/qualitymonitors/src/v1/model.ts @@ -461,76 +461,10 @@ export interface UpdateMonitor { monitorVersion?: number | undefined; } -export const unmarshalCancelRefreshSchema: z.ZodType = z - .object({ - full_table_name_arg: z.string().optional(), - refresh_id: z.number().optional(), - }) - .transform(d => ({ - fullTableNameArg: d.full_table_name_arg, - refreshId: d.refresh_id, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalCancelRefresh_ResponseSchema: z.ZodType = z.object({}); -export const unmarshalCreateMonitorSchema: z.ZodType = z - .object({ - full_table_name_arg: z.string().optional(), - skip_builtin_dashboard: z.boolean().optional(), - warehouse_id: z.string().optional(), - output_schema_name: z.string().optional(), - assets_dir: z.string().optional(), - inference_log: z - .lazy(() => unmarshalInferenceLogAnalysisConfigSchema) - .optional(), - time_series: z - .lazy(() => unmarshalTimeSeriesAnalysisConfigSchema) - .optional(), - snapshot: z.lazy(() => unmarshalSnapshotAnalysisConfigSchema).optional(), - slicing_exprs: z.array(z.string()).optional(), - custom_metrics: z - .array(z.lazy(() => unmarshalCustomMetricSchema)) - .optional(), - baseline_table_name: z.string().optional(), - schedule: z.lazy(() => unmarshalMonitorCronScheduleSchema).optional(), - notifications: z.lazy(() => unmarshalNotificationsSchema).optional(), - data_classification_config: z - .lazy(() => unmarshalDataClassificationConfigSchema) - .optional(), - table_name: z.string().optional(), - status: z.enum(MonitorStatus).optional(), - latest_monitor_failure_msg: z.string().optional(), - profile_metrics_table_name: z.string().optional(), - drift_metrics_table_name: z.string().optional(), - dashboard_id: z.string().optional(), - monitor_version: z.number().optional(), - }) - .transform(d => ({ - fullTableNameArg: d.full_table_name_arg, - skipBuiltinDashboard: d.skip_builtin_dashboard, - warehouseId: d.warehouse_id, - outputSchemaName: d.output_schema_name, - assetsDir: d.assets_dir, - inferenceLog: d.inference_log, - timeSeries: d.time_series, - snapshot: d.snapshot, - slicingExprs: d.slicing_exprs, - customMetrics: d.custom_metrics, - baselineTableName: d.baseline_table_name, - schedule: d.schedule, - notifications: d.notifications, - dataClassificationConfig: d.data_classification_config, - tableName: d.table_name, - status: d.status, - latestMonitorFailureMsg: d.latest_monitor_failure_msg, - profileMetricsTableName: d.profile_metrics_table_name, - driftMetricsTableName: d.drift_metrics_table_name, - dashboardId: d.dashboard_id, - monitorVersion: d.monitor_version, - })); - export const unmarshalCustomMetricSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -692,17 +626,6 @@ export const unmarshalRefreshInfoSchema: z.ZodType = z trigger: d.trigger, })); -export const unmarshalRegenerateDashboardSchema: z.ZodType = - z - .object({ - full_table_name_arg: z.string().optional(), - warehouse_id: z.string().optional(), - }) - .transform(d => ({ - fullTableNameArg: d.full_table_name_arg, - warehouseId: d.warehouse_id, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalRegenerateDashboard_ResponseSchema: z.ZodType = z @@ -715,14 +638,6 @@ export const unmarshalRegenerateDashboard_ResponseSchema: z.ZodType = z - .object({ - full_table_name_arg: z.string().optional(), - }) - .transform(d => ({ - fullTableNameArg: d.full_table_name_arg, - })); - export const unmarshalSnapshotAnalysisConfigSchema: z.ZodType = z.object({}); @@ -737,58 +652,6 @@ export const unmarshalTimeSeriesAnalysisConfigSchema: z.ZodType = z - .object({ - full_table_name_arg: z.string().optional(), - output_schema_name: z.string().optional(), - assets_dir: z.string().optional(), - inference_log: z - .lazy(() => unmarshalInferenceLogAnalysisConfigSchema) - .optional(), - time_series: z - .lazy(() => unmarshalTimeSeriesAnalysisConfigSchema) - .optional(), - snapshot: z.lazy(() => unmarshalSnapshotAnalysisConfigSchema).optional(), - slicing_exprs: z.array(z.string()).optional(), - custom_metrics: z - .array(z.lazy(() => unmarshalCustomMetricSchema)) - .optional(), - baseline_table_name: z.string().optional(), - schedule: z.lazy(() => unmarshalMonitorCronScheduleSchema).optional(), - notifications: z.lazy(() => unmarshalNotificationsSchema).optional(), - data_classification_config: z - .lazy(() => unmarshalDataClassificationConfigSchema) - .optional(), - table_name: z.string().optional(), - status: z.enum(MonitorStatus).optional(), - latest_monitor_failure_msg: z.string().optional(), - profile_metrics_table_name: z.string().optional(), - drift_metrics_table_name: z.string().optional(), - dashboard_id: z.string().optional(), - monitor_version: z.number().optional(), - }) - .transform(d => ({ - fullTableNameArg: d.full_table_name_arg, - outputSchemaName: d.output_schema_name, - assetsDir: d.assets_dir, - inferenceLog: d.inference_log, - timeSeries: d.time_series, - snapshot: d.snapshot, - slicingExprs: d.slicing_exprs, - customMetrics: d.custom_metrics, - baselineTableName: d.baseline_table_name, - schedule: d.schedule, - notifications: d.notifications, - dataClassificationConfig: d.data_classification_config, - tableName: d.table_name, - status: d.status, - latestMonitorFailureMsg: d.latest_monitor_failure_msg, - profileMetricsTableName: d.profile_metrics_table_name, - driftMetricsTableName: d.drift_metrics_table_name, - dashboardId: d.dashboard_id, - monitorVersion: d.monitor_version, - })); - export const marshalCancelRefreshSchema: z.ZodType = z .object({ fullTableNameArg: z.string().optional(), @@ -799,9 +662,6 @@ export const marshalCancelRefreshSchema: z.ZodType = z refresh_id: d.refreshId, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCancelRefresh_ResponseSchema: z.ZodType = z.object({}); - export const marshalCreateMonitorSchema: z.ZodType = z .object({ fullTableNameArg: z.string().optional(), @@ -878,55 +738,6 @@ export const marshalDataClassificationConfigSchema: z.ZodType = z enabled: d.enabled, })); -export const marshalDataMonitorInfoSchema: z.ZodType = z - .object({ - outputSchemaName: z.string().optional(), - assetsDir: z.string().optional(), - inferenceLog: z - .lazy(() => marshalInferenceLogAnalysisConfigSchema) - .optional(), - timeSeries: z.lazy(() => marshalTimeSeriesAnalysisConfigSchema).optional(), - snapshot: z.lazy(() => marshalSnapshotAnalysisConfigSchema).optional(), - slicingExprs: z.array(z.string()).optional(), - customMetrics: z.array(z.lazy(() => marshalCustomMetricSchema)).optional(), - baselineTableName: z.string().optional(), - schedule: z.lazy(() => marshalMonitorCronScheduleSchema).optional(), - notifications: z.lazy(() => marshalNotificationsSchema).optional(), - dataClassificationConfig: z - .lazy(() => marshalDataClassificationConfigSchema) - .optional(), - tableName: z.string().optional(), - status: z.enum(MonitorStatus).optional(), - latestMonitorFailureMsg: z.string().optional(), - profileMetricsTableName: z.string().optional(), - driftMetricsTableName: z.string().optional(), - dashboardId: z.string().optional(), - monitorVersion: z.number().optional(), - }) - .transform(d => ({ - output_schema_name: d.outputSchemaName, - assets_dir: d.assetsDir, - inference_log: d.inferenceLog, - time_series: d.timeSeries, - snapshot: d.snapshot, - slicing_exprs: d.slicingExprs, - custom_metrics: d.customMetrics, - baseline_table_name: d.baselineTableName, - schedule: d.schedule, - notifications: d.notifications, - data_classification_config: d.dataClassificationConfig, - table_name: d.tableName, - status: d.status, - latest_monitor_failure_msg: d.latestMonitorFailureMsg, - profile_metrics_table_name: d.profileMetricsTableName, - drift_metrics_table_name: d.driftMetricsTableName, - dashboard_id: d.dashboardId, - monitor_version: d.monitorVersion, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteMonitor_ResponseSchema: z.ZodType = z.object({}); - export const marshalDestinationSchema: z.ZodType = z .object({ emailAddresses: z.array(z.string()).optional(), @@ -955,15 +766,6 @@ export const marshalInferenceLogAnalysisConfigSchema: z.ZodType = z prediction_proba_col: d.predictionProbaCol, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListRefreshes_ResponseSchema: z.ZodType = z - .object({ - refreshes: z.array(z.lazy(() => marshalRefreshInfoSchema)).optional(), - }) - .transform(d => ({ - refreshes: d.refreshes, - })); - export const marshalMonitorCronScheduleSchema: z.ZodType = z .object({ quartzCronExpression: z.string().optional(), @@ -988,24 +790,6 @@ export const marshalNotificationsSchema: z.ZodType = z on_new_classification_tag_detected: d.onNewClassificationTagDetected, })); -export const marshalRefreshInfoSchema: z.ZodType = z - .object({ - refreshId: z.number().optional(), - state: z.enum(RefreshState).optional(), - message: z.string().optional(), - startTimeMs: z.number().optional(), - endTimeMs: z.number().optional(), - trigger: z.enum(RefreshTrigger).optional(), - }) - .transform(d => ({ - 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 marshalRegenerateDashboardSchema: z.ZodType = z .object({ fullTableNameArg: z.string().optional(), @@ -1016,17 +800,6 @@ export const marshalRegenerateDashboardSchema: z.ZodType = z warehouse_id: d.warehouseId, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalRegenerateDashboard_ResponseSchema: z.ZodType = z - .object({ - dashboardId: z.string().optional(), - parentFolder: z.string().optional(), - }) - .transform(d => ({ - dashboard_id: d.dashboardId, - parent_folder: d.parentFolder, - })); - export const marshalRunRefreshSchema: z.ZodType = z .object({ fullTableNameArg: z.string().optional(), diff --git a/packages/queries/src/v1/model.ts b/packages/queries/src/v1/model.ts index dd63bba3..105a83e9 100644 --- a/packages/queries/src/v1/model.ts +++ b/packages/queries/src/v1/model.ts @@ -1,6 +1,8 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. import {Temporal} from '@js-temporal/polyfill'; +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; export enum DatePrecision { @@ -276,7 +278,7 @@ export interface TrashQueryRequest { export interface UpdateQueryRequest { query?: UpdateQueryRequestQuery | undefined; - updateMask?: string | 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; @@ -337,66 +339,6 @@ export interface Visualization { queryId?: string | undefined; } -export const unmarshalCreateQueryRequestSchema: z.ZodType = - z - .object({ - query: z.lazy(() => unmarshalCreateQueryRequestQuerySchema).optional(), - auto_resolve_display_name: z.boolean().optional(), - }) - .transform(d => ({ - query: d.query, - autoResolveDisplayName: d.auto_resolve_display_name, - })); - -export const unmarshalCreateQueryRequestQuerySchema: z.ZodType = - z - .object({ - id: z.string().optional(), - display_name: z.string().optional(), - description: z.string().optional(), - owner_user_name: z.string().optional(), - warehouse_id: z.string().optional(), - query_text: z.string().optional(), - run_as_mode: z.enum(RunAsMode).optional(), - lifecycle_state: z.enum(LifecycleState).optional(), - last_modifier_user_name: z.string().optional(), - parent_path: z.string().optional(), - tags: z.array(z.string()).optional(), - create_time: z - .string() - .transform(s => Temporal.Instant.from(s)) - .optional(), - update_time: z - .string() - .transform(s => Temporal.Instant.from(s)) - .optional(), - parameters: z - .array(z.lazy(() => unmarshalQueryParameterSchema)) - .optional(), - apply_auto_limit: z.boolean().optional(), - catalog: z.string().optional(), - schema: z.string().optional(), - }) - .transform(d => ({ - id: d.id, - displayName: d.display_name, - description: d.description, - ownerUserName: d.owner_user_name, - warehouseId: d.warehouse_id, - queryText: d.query_text, - runAsMode: d.run_as_mode, - lifecycleState: d.lifecycle_state, - lastModifierUserName: d.last_modifier_user_name, - parentPath: d.parent_path, - tags: d.tags, - createTime: d.create_time, - updateTime: d.update_time, - parameters: d.parameters, - applyAutoLimit: d.apply_auto_limit, - catalog: d.catalog, - schema: d.schema, - })); - export const unmarshalDateRangeSchema: z.ZodType = z .object({ start: z.string().optional(), @@ -637,70 +579,6 @@ export const unmarshalTextValueSchema: z.ZodType = z value: d.value, })); -export const unmarshalUpdateQueryRequestSchema: z.ZodType = - z - .object({ - query: z.lazy(() => unmarshalUpdateQueryRequestQuerySchema).optional(), - update_mask: z.string().optional(), - id: z.string().optional(), - auto_resolve_display_name: z.boolean().optional(), - }) - .transform(d => ({ - query: d.query, - updateMask: d.update_mask, - id: d.id, - autoResolveDisplayName: d.auto_resolve_display_name, - })); - -export const unmarshalUpdateQueryRequestQuerySchema: z.ZodType = - z - .object({ - id: z.string().optional(), - display_name: z.string().optional(), - description: z.string().optional(), - owner_user_name: z.string().optional(), - warehouse_id: z.string().optional(), - query_text: z.string().optional(), - run_as_mode: z.enum(RunAsMode).optional(), - lifecycle_state: z.enum(LifecycleState).optional(), - last_modifier_user_name: z.string().optional(), - parent_path: z.string().optional(), - tags: z.array(z.string()).optional(), - create_time: z - .string() - .transform(s => Temporal.Instant.from(s)) - .optional(), - update_time: z - .string() - .transform(s => Temporal.Instant.from(s)) - .optional(), - parameters: z - .array(z.lazy(() => unmarshalQueryParameterSchema)) - .optional(), - apply_auto_limit: z.boolean().optional(), - catalog: z.string().optional(), - schema: z.string().optional(), - }) - .transform(d => ({ - id: d.id, - displayName: d.display_name, - description: d.description, - ownerUserName: d.owner_user_name, - warehouseId: d.warehouse_id, - queryText: d.query_text, - runAsMode: d.run_as_mode, - lifecycleState: d.lifecycle_state, - lastModifierUserName: d.last_modifier_user_name, - parentPath: d.parent_path, - tags: d.tags, - createTime: d.create_time, - updateTime: d.update_time, - parameters: d.parameters, - applyAutoLimit: d.apply_auto_limit, - catalog: d.catalog, - schema: d.schema, - })); - export const unmarshalVisualizationSchema: z.ZodType = z .object({ id: z.string().optional(), @@ -821,8 +699,6 @@ export const marshalDateValueSchema: z.ZodType = z precision: d.precision, })); -export const marshalEmptySchema: z.ZodType = z.object({}); - export const marshalEnumValueSchema: z.ZodType = z .object({ values: z.array(z.string()).optional(), @@ -837,74 +713,6 @@ export const marshalEnumValueSchema: z.ZodType = z multi_values_options: d.multiValuesOptions, })); -export const marshalListQueriesResponseSchema: z.ZodType = z - .object({ - results: z - .array(z.lazy(() => marshalListQueryObjectsResponseQuerySchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - results: d.results, - next_page_token: d.nextPageToken, - })); - -export const marshalListQueryObjectsResponseQuerySchema: z.ZodType = z - .object({ - id: z.string().optional(), - displayName: z.string().optional(), - description: z.string().optional(), - ownerUserName: z.string().optional(), - warehouseId: z.string().optional(), - queryText: z.string().optional(), - runAsMode: z.enum(RunAsMode).optional(), - lifecycleState: z.enum(LifecycleState).optional(), - lastModifierUserName: z.string().optional(), - parentPath: z.string().optional(), - tags: z.array(z.string()).optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - parameters: z.array(z.lazy(() => marshalQueryParameterSchema)).optional(), - applyAutoLimit: z.boolean().optional(), - catalog: z.string().optional(), - schema: z.string().optional(), - }) - .transform(d => ({ - id: d.id, - display_name: d.displayName, - description: d.description, - owner_user_name: d.ownerUserName, - warehouse_id: d.warehouseId, - query_text: d.queryText, - run_as_mode: d.runAsMode, - lifecycle_state: d.lifecycleState, - last_modifier_user_name: d.lastModifierUserName, - parent_path: d.parentPath, - tags: d.tags, - create_time: d.createTime, - update_time: d.updateTime, - parameters: d.parameters, - apply_auto_limit: d.applyAutoLimit, - catalog: d.catalog, - schema: d.schema, - })); - -export const marshalListVisualizationsForQueryResponseSchema: z.ZodType = z - .object({ - results: z.array(z.lazy(() => marshalVisualizationSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - results: d.results, - next_page_token: d.nextPageToken, - })); - export const marshalMultiValuesOptionsSchema: z.ZodType = z .object({ prefix: z.string().optional(), @@ -925,52 +733,6 @@ export const marshalNumericValueSchema: z.ZodType = z value: d.value, })); -export const marshalQuerySchema: z.ZodType = z - .object({ - id: z.string().optional(), - displayName: z.string().optional(), - description: z.string().optional(), - ownerUserName: z.string().optional(), - warehouseId: z.string().optional(), - queryText: z.string().optional(), - runAsMode: z.enum(RunAsMode).optional(), - lifecycleState: z.enum(LifecycleState).optional(), - lastModifierUserName: z.string().optional(), - parentPath: z.string().optional(), - tags: z.array(z.string()).optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - parameters: z.array(z.lazy(() => marshalQueryParameterSchema)).optional(), - applyAutoLimit: z.boolean().optional(), - catalog: z.string().optional(), - schema: z.string().optional(), - }) - .transform(d => ({ - id: d.id, - display_name: d.displayName, - description: d.description, - owner_user_name: d.ownerUserName, - warehouse_id: d.warehouseId, - query_text: d.queryText, - run_as_mode: d.runAsMode, - lifecycle_state: d.lifecycleState, - last_modifier_user_name: d.lastModifierUserName, - parent_path: d.parentPath, - tags: d.tags, - create_time: d.createTime, - update_time: d.updateTime, - parameters: d.parameters, - apply_auto_limit: d.applyAutoLimit, - catalog: d.catalog, - schema: d.schema, - })); - export const marshalQueryBackedValueSchema: z.ZodType = z .object({ values: z.array(z.string()).optional(), @@ -1018,7 +780,10 @@ export const marshalTextValueSchema: z.ZodType = z export const marshalUpdateQueryRequestSchema: z.ZodType = z .object({ query: z.lazy(() => marshalUpdateQueryRequestQuerySchema).optional(), - updateMask: z.string().optional(), + updateMask: z + .any() + .transform((m: FieldMask) => m.toString()) + .optional(), id: z.string().optional(), autoResolveDisplayName: z.boolean().optional(), }) @@ -1075,30 +840,156 @@ export const marshalUpdateQueryRequestQuerySchema: z.ZodType = z schema: d.schema, })); -export const marshalVisualizationSchema: z.ZodType = z - .object({ - id: z.string().optional(), - displayName: z.string().optional(), - type: z.string().optional(), - createTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - updateTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - serializedQueryPlan: z.string().optional(), - serializedOptions: z.string().optional(), - queryId: z.string().optional(), - }) - .transform(d => ({ - id: d.id, - display_name: d.displayName, - type: d.type, - create_time: d.createTime, - update_time: d.updateTime, - serialized_query_plan: d.serializedQueryPlan, - serialized_options: d.serializedOptions, - query_id: d.queryId, - })); +const dateRangeFieldMaskSchema: FieldMaskSchema = { + end: {wire: 'end'}, + start: {wire: 'start'}, +}; + +export function dateRangeFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, dateRangeFieldMaskSchema); +} + +const dateRangeValueFieldMaskSchema: FieldMaskSchema = { + dateRangeValue: { + wire: 'date_range_value', + children: () => dateRangeFieldMaskSchema, + }, + dynamicDateRangeValue: {wire: 'dynamic_date_range_value'}, + precision: {wire: 'precision'}, + startDayOfWeek: {wire: 'start_day_of_week'}, +}; + +export function dateRangeValueFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, dateRangeValueFieldMaskSchema); +} + +const dateValueFieldMaskSchema: FieldMaskSchema = { + dateValue: {wire: 'date_value'}, + dynamicDateValue: {wire: 'dynamic_date_value'}, + precision: {wire: 'precision'}, +}; + +export function dateValueFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, dateValueFieldMaskSchema); +} + +const enumValueFieldMaskSchema: FieldMaskSchema = { + enumOptions: {wire: 'enum_options'}, + multiValuesOptions: { + wire: 'multi_values_options', + children: () => multiValuesOptionsFieldMaskSchema, + }, + values: {wire: 'values'}, +}; + +export function enumValueFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, enumValueFieldMaskSchema); +} + +const multiValuesOptionsFieldMaskSchema: FieldMaskSchema = { + prefix: {wire: 'prefix'}, + separator: {wire: 'separator'}, + suffix: {wire: 'suffix'}, +}; + +export function multiValuesOptionsFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + multiValuesOptionsFieldMaskSchema + ); +} + +const numericValueFieldMaskSchema: FieldMaskSchema = { + value: {wire: 'value'}, +}; + +export function numericValueFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, numericValueFieldMaskSchema); +} + +const queryBackedValueFieldMaskSchema: FieldMaskSchema = { + multiValuesOptions: { + wire: 'multi_values_options', + children: () => multiValuesOptionsFieldMaskSchema, + }, + queryId: {wire: 'query_id'}, + values: {wire: 'values'}, +}; + +export function queryBackedValueFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + queryBackedValueFieldMaskSchema + ); +} + +const queryParameterFieldMaskSchema: FieldMaskSchema = { + dateRangeValue: { + wire: 'date_range_value', + children: () => dateRangeValueFieldMaskSchema, + }, + dateValue: {wire: 'date_value', children: () => dateValueFieldMaskSchema}, + enumValue: {wire: 'enum_value', children: () => enumValueFieldMaskSchema}, + name: {wire: 'name'}, + numericValue: { + wire: 'numeric_value', + children: () => numericValueFieldMaskSchema, + }, + queryBackedValue: { + wire: 'query_backed_value', + children: () => queryBackedValueFieldMaskSchema, + }, + textValue: {wire: 'text_value', children: () => textValueFieldMaskSchema}, + title: {wire: 'title'}, +}; + +export function queryParameterFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, queryParameterFieldMaskSchema); +} + +const textValueFieldMaskSchema: FieldMaskSchema = { + value: {wire: 'value'}, +}; + +export function textValueFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, textValueFieldMaskSchema); +} + +const updateQueryRequestQueryFieldMaskSchema: FieldMaskSchema = { + applyAutoLimit: {wire: 'apply_auto_limit'}, + catalog: {wire: 'catalog'}, + createTime: {wire: 'create_time'}, + description: {wire: 'description'}, + displayName: {wire: 'display_name'}, + id: {wire: 'id'}, + lastModifierUserName: {wire: 'last_modifier_user_name'}, + lifecycleState: {wire: 'lifecycle_state'}, + ownerUserName: {wire: 'owner_user_name'}, + parameters: {wire: 'parameters'}, + parentPath: {wire: 'parent_path'}, + queryText: {wire: 'query_text'}, + runAsMode: {wire: 'run_as_mode'}, + schema: {wire: 'schema'}, + tags: {wire: 'tags'}, + updateTime: {wire: 'update_time'}, + warehouseId: {wire: 'warehouse_id'}, +}; + +export function updateQueryRequestQueryFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + updateQueryRequestQueryFieldMaskSchema + ); +} diff --git a/packages/queryhistory/src/v1/model.ts b/packages/queryhistory/src/v1/model.ts index bf8a4ff7..4a2c74ed 100644 --- a/packages/queryhistory/src/v1/model.ts +++ b/packages/queryhistory/src/v1/model.ts @@ -430,22 +430,6 @@ export const unmarshalListQueries_ResponseSchema: z.ZodType = z - .object({ - query_start_time_range: z.lazy(() => unmarshalTimeRangeSchema).optional(), - user_ids: z.array(z.number()).optional(), - statuses: z.array(z.enum(QueryStatus)).optional(), - warehouse_ids: z.array(z.string()).optional(), - statement_ids: z.array(z.string()).optional(), - }) - .transform(d => ({ - queryStartTimeRange: d.query_start_time_range, - userIds: d.user_ids, - statuses: d.statuses, - warehouseIds: d.warehouse_ids, - statementIds: d.statement_ids, - })); - export const unmarshalQueryInfoSchema: z.ZodType = z .object({ query_id: z.string().optional(), @@ -603,72 +587,6 @@ export const unmarshalTaskTimeOverRangeEntrySchema: z.ZodType = z - .object({ - start_time_ms: z.number().optional(), - end_time_ms: z.number().optional(), - }) - .transform(d => ({ - startTimeMs: d.start_time_ms, - endTimeMs: d.end_time_ms, - })); - -export const marshalChannelInfoSchema: z.ZodType = z - .object({ - name: z.enum(ChannelName).optional(), - dbsqlVersion: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - dbsql_version: d.dbsqlVersion, - })); - -export const marshalExternalQuerySourceSchema: z.ZodType = z - .object({ - dashboardId: z.string().optional(), - legacyDashboardId: z.string().optional(), - alertId: z.string().optional(), - notebookId: z.string().optional(), - sqlQueryId: z.string().optional(), - jobInfo: z.lazy(() => marshalExternalQuerySource_JobInfoSchema).optional(), - genieSpaceId: z.string().optional(), - }) - .transform(d => ({ - dashboard_id: d.dashboardId, - legacy_dashboard_id: d.legacyDashboardId, - alert_id: d.alertId, - notebook_id: d.notebookId, - sql_query_id: d.sqlQueryId, - job_info: d.jobInfo, - genie_space_id: d.genieSpaceId, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalExternalQuerySource_JobInfoSchema: z.ZodType = z - .object({ - jobId: z.string().optional(), - jobRunId: z.string().optional(), - jobTaskRunId: z.string().optional(), - }) - .transform(d => ({ - job_id: d.jobId, - job_run_id: d.jobRunId, - job_task_run_id: d.jobTaskRunId, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListQueries_ResponseSchema: z.ZodType = z - .object({ - nextPageToken: z.string().optional(), - hasNextPage: z.boolean().optional(), - res: z.array(z.lazy(() => marshalQueryInfoSchema)).optional(), - }) - .transform(d => ({ - next_page_token: d.nextPageToken, - has_next_page: d.hasNextPage, - res: d.res, - })); - export const marshalQueryFilterSchema: z.ZodType = z .object({ queryStartTimeRange: z.lazy(() => marshalTimeRangeSchema).optional(), @@ -685,162 +603,6 @@ export const marshalQueryFilterSchema: z.ZodType = z statement_ids: d.statementIds, })); -export const marshalQueryInfoSchema: z.ZodType = z - .object({ - queryId: z.string().optional(), - status: z.enum(QueryStatus).optional(), - queryText: z.string().optional(), - queryStartTimeMs: z.number().optional(), - executionEndTimeMs: z.number().optional(), - queryEndTimeMs: z.number().optional(), - userId: z.number().optional(), - userName: z.string().optional(), - sparkUiUrl: z.string().optional(), - endpointId: z.string().optional(), - rowsProduced: z.number().optional(), - errorMessage: z.string().optional(), - lookupKey: z.string().optional(), - metrics: z.lazy(() => marshalQueryMetricsSchema).optional(), - executedAsUserId: z.number().optional(), - executedAsUserName: z.string().optional(), - sessionId: z.string().optional(), - isFinal: z.boolean().optional(), - channelUsed: z.lazy(() => marshalChannelInfoSchema).optional(), - plansState: z.enum(PlansState).optional(), - statementType: z.enum(QueryStatementType).optional(), - warehouseId: z.string().optional(), - duration: z.number().optional(), - clientApplication: z.string().optional(), - querySource: z.lazy(() => marshalExternalQuerySourceSchema).optional(), - cacheQueryId: z.string().optional(), - queryTags: z.array(z.lazy(() => marshalQueryTagSchema)).optional(), - }) - .transform(d => ({ - query_id: d.queryId, - status: d.status, - query_text: d.queryText, - query_start_time_ms: d.queryStartTimeMs, - execution_end_time_ms: d.executionEndTimeMs, - query_end_time_ms: d.queryEndTimeMs, - user_id: d.userId, - user_name: d.userName, - spark_ui_url: d.sparkUiUrl, - endpoint_id: d.endpointId, - rows_produced: d.rowsProduced, - error_message: d.errorMessage, - lookup_key: d.lookupKey, - metrics: d.metrics, - executed_as_user_id: d.executedAsUserId, - executed_as_user_name: d.executedAsUserName, - session_id: d.sessionId, - is_final: d.isFinal, - channel_used: d.channelUsed, - plans_state: d.plansState, - statement_type: d.statementType, - warehouse_id: d.warehouseId, - duration: d.duration, - client_application: d.clientApplication, - query_source: d.querySource, - cache_query_id: d.cacheQueryId, - query_tags: d.queryTags, - })); - -export const marshalQueryMetricsSchema: z.ZodType = z - .object({ - totalTimeMs: z.number().optional(), - readBytes: z.number().optional(), - rowsProducedCount: z.number().optional(), - compilationTimeMs: z.number().optional(), - executionTimeMs: z.number().optional(), - readRemoteBytes: z.number().optional(), - writeRemoteBytes: z.number().optional(), - readCacheBytes: z.number().optional(), - spillToDiskBytes: z.number().optional(), - taskTotalTimeMs: z.number().optional(), - readFilesCount: z.number().optional(), - readPartitionsCount: z.number().optional(), - photonTotalTimeMs: z.number().optional(), - rowsReadCount: z.number().optional(), - resultFetchTimeMs: z.number().optional(), - networkSentBytes: z.number().optional(), - resultFromCache: z.boolean().optional(), - prunedBytes: z.number().optional(), - prunedFilesCount: z.number().optional(), - provisioningQueueStartTimestamp: z.number().optional(), - overloadingQueueStartTimestamp: z.number().optional(), - queryCompilationStartTimestamp: z.number().optional(), - taskTimeOverTimeRange: z - .lazy(() => marshalTaskTimeOverRangeSchema) - .optional(), - workToBeDone: z.number().optional(), - runnableTasks: z.number().optional(), - projectedRemainingTaskTotalTimeMs: z.number().optional(), - remainingTaskCount: z.number().optional(), - projectedRemainingWallclockTimeMs: z.number().optional(), - readFilesBytes: z.number().optional(), - }) - .transform(d => ({ - total_time_ms: d.totalTimeMs, - read_bytes: d.readBytes, - rows_produced_count: d.rowsProducedCount, - compilation_time_ms: d.compilationTimeMs, - execution_time_ms: d.executionTimeMs, - read_remote_bytes: d.readRemoteBytes, - write_remote_bytes: d.writeRemoteBytes, - read_cache_bytes: d.readCacheBytes, - spill_to_disk_bytes: d.spillToDiskBytes, - task_total_time_ms: d.taskTotalTimeMs, - read_files_count: d.readFilesCount, - read_partitions_count: d.readPartitionsCount, - photon_total_time_ms: d.photonTotalTimeMs, - rows_read_count: d.rowsReadCount, - result_fetch_time_ms: d.resultFetchTimeMs, - network_sent_bytes: d.networkSentBytes, - result_from_cache: d.resultFromCache, - pruned_bytes: d.prunedBytes, - pruned_files_count: d.prunedFilesCount, - provisioning_queue_start_timestamp: d.provisioningQueueStartTimestamp, - overloading_queue_start_timestamp: d.overloadingQueueStartTimestamp, - query_compilation_start_timestamp: d.queryCompilationStartTimestamp, - task_time_over_time_range: d.taskTimeOverTimeRange, - work_to_be_done: d.workToBeDone, - runnable_tasks: d.runnableTasks, - projected_remaining_task_total_time_ms: d.projectedRemainingTaskTotalTimeMs, - remaining_task_count: d.remainingTaskCount, - projected_remaining_wallclock_time_ms: d.projectedRemainingWallclockTimeMs, - read_files_bytes: d.readFilesBytes, - })); - -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 marshalTaskTimeOverRangeSchema: z.ZodType = z - .object({ - entries: z - .array(z.lazy(() => marshalTaskTimeOverRangeEntrySchema)) - .optional(), - interval: z.number().optional(), - }) - .transform(d => ({ - entries: d.entries, - interval: d.interval, - })); - -export const marshalTaskTimeOverRangeEntrySchema: z.ZodType = z - .object({ - taskCompletedTimeMs: z.number().optional(), - }) - .transform(d => ({ - task_completed_time_ms: d.taskCompletedTimeMs, - })); - export const marshalTimeRangeSchema: z.ZodType = z .object({ startTimeMs: z.number().optional(), diff --git a/packages/registeredmodels/src/v1/model.ts b/packages/registeredmodels/src/v1/model.ts index f6aa1a67..730716bd 100644 --- a/packages/registeredmodels/src/v1/model.ts +++ b/packages/registeredmodels/src/v1/model.ts @@ -426,43 +426,6 @@ export const unmarshalConnectionDependencySchema: z.ZodType = - z - .object({ - name: z.string().optional(), - catalog_name: z.string().optional(), - schema_name: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - storage_location: z.string().optional(), - metastore_id: z.string().optional(), - full_name: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - aliases: z - .array(z.lazy(() => unmarshalRegisteredModelAliasInfoSchema)) - .optional(), - browse_only: z.boolean().optional(), - }) - .transform(d => ({ - name: d.name, - catalogName: d.catalog_name, - schemaName: d.schema_name, - owner: d.owner, - comment: d.comment, - storageLocation: d.storage_location, - metastoreId: d.metastore_id, - fullName: d.full_name, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - aliases: d.aliases, - browseOnly: d.browse_only, - })); - export const unmarshalCredentialDependencySchema: z.ZodType = z .object({ @@ -657,19 +620,6 @@ export const unmarshalSecretDependencySchema: z.ZodType = z secretFullName: d.secret_full_name, })); -export const unmarshalSetRegisteredModelAliasSchema: z.ZodType = - z - .object({ - full_name_arg: z.string().optional(), - alias_arg: z.string().optional(), - version_num: z.number().optional(), - }) - .transform(d => ({ - fullNameArg: d.full_name_arg, - aliasArg: d.alias_arg, - versionNum: d.version_num, - })); - export const unmarshalTableDependencySchema: z.ZodType = z .object({ table_full_name: z.string().optional(), @@ -678,98 +628,6 @@ export const unmarshalTableDependencySchema: z.ZodType = z tableFullName: d.table_full_name, })); -export const unmarshalUpdateModelVersionSchema: z.ZodType = - z - .object({ - full_name_arg: z.string().optional(), - version_arg: z.number().optional(), - model_name: z.string().optional(), - catalog_name: z.string().optional(), - schema_name: z.string().optional(), - source: z.string().optional(), - comment: z.string().optional(), - run_id: z.string().optional(), - run_workspace_id: z.number().optional(), - model_version_dependencies: z - .lazy(() => unmarshalDependencyListSchema) - .optional(), - status: z.enum(ModelVersionStatus).optional(), - version: z.number().optional(), - storage_location: z.string().optional(), - metastore_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - id: z.string().optional(), - aliases: z - .array(z.lazy(() => unmarshalRegisteredModelAliasInfoSchema)) - .optional(), - }) - .transform(d => ({ - fullNameArg: d.full_name_arg, - versionArg: d.version_arg, - modelName: d.model_name, - catalogName: d.catalog_name, - schemaName: d.schema_name, - source: d.source, - comment: d.comment, - runId: d.run_id, - runWorkspaceId: d.run_workspace_id, - modelVersionDependencies: d.model_version_dependencies, - status: d.status, - version: d.version, - storageLocation: d.storage_location, - metastoreId: d.metastore_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - id: d.id, - aliases: d.aliases, - })); - -export const unmarshalUpdateRegisteredModelSchema: z.ZodType = - z - .object({ - full_name_arg: z.string().optional(), - new_name: z.string().optional(), - name: z.string().optional(), - catalog_name: z.string().optional(), - schema_name: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - storage_location: z.string().optional(), - metastore_id: z.string().optional(), - full_name: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - aliases: z - .array(z.lazy(() => unmarshalRegisteredModelAliasInfoSchema)) - .optional(), - browse_only: z.boolean().optional(), - }) - .transform(d => ({ - fullNameArg: d.full_name_arg, - newName: d.new_name, - name: d.name, - catalogName: d.catalog_name, - schemaName: d.schema_name, - owner: d.owner, - comment: d.comment, - storageLocation: d.storage_location, - metastoreId: d.metastore_id, - fullName: d.full_name, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - aliases: d.aliases, - browseOnly: d.browse_only, - })); - export const unmarshalVolumeDependencySchema: z.ZodType = z .object({ volume_full_name: z.string().optional(), @@ -830,18 +688,6 @@ export const marshalCredentialDependencySchema: z.ZodType = z credential_name: d.credentialName, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteModelVersion_ResponseSchema: z.ZodType = z.object({}); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteRegisteredModel_ResponseSchema: z.ZodType = z.object( - {} -); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteRegisteredModelAlias_ResponseSchema: z.ZodType = - z.object({}); - export const marshalDependencySchema: z.ZodType = z .object({ table: z.lazy(() => marshalTableDependencySchema).optional(), @@ -876,78 +722,6 @@ export const marshalFunctionDependencySchema: z.ZodType = z function_full_name: d.functionFullName, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListModelVersions_ResponseSchema: z.ZodType = z - .object({ - modelVersions: z - .array(z.lazy(() => marshalModelVersionInfoSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - model_versions: d.modelVersions, - next_page_token: d.nextPageToken, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListRegisteredModels_ResponseSchema: z.ZodType = z - .object({ - registeredModels: z - .array(z.lazy(() => marshalRegisteredModelInfoSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - registered_models: d.registeredModels, - next_page_token: d.nextPageToken, - })); - -export const marshalModelVersionInfoSchema: z.ZodType = z - .object({ - modelName: z.string().optional(), - catalogName: z.string().optional(), - schemaName: z.string().optional(), - source: z.string().optional(), - comment: z.string().optional(), - runId: z.string().optional(), - runWorkspaceId: z.number().optional(), - modelVersionDependencies: z - .lazy(() => marshalDependencyListSchema) - .optional(), - status: z.enum(ModelVersionStatus).optional(), - version: z.number().optional(), - storageLocation: z.string().optional(), - metastoreId: z.string().optional(), - createdAt: z.number().optional(), - createdBy: z.string().optional(), - updatedAt: z.number().optional(), - updatedBy: z.string().optional(), - id: z.string().optional(), - aliases: z - .array(z.lazy(() => marshalRegisteredModelAliasInfoSchema)) - .optional(), - }) - .transform(d => ({ - model_name: d.modelName, - catalog_name: d.catalogName, - schema_name: d.schemaName, - source: d.source, - comment: d.comment, - run_id: d.runId, - run_workspace_id: d.runWorkspaceId, - model_version_dependencies: d.modelVersionDependencies, - status: d.status, - version: d.version, - storage_location: d.storageLocation, - metastore_id: d.metastoreId, - created_at: d.createdAt, - created_by: d.createdBy, - updated_at: d.updatedAt, - updated_by: d.updatedBy, - id: d.id, - aliases: d.aliases, - })); - export const marshalRegisteredModelAliasInfoSchema: z.ZodType = z .object({ aliasName: z.string().optional(), @@ -966,42 +740,6 @@ export const marshalRegisteredModelAliasInfoSchema: z.ZodType = z schema_name: d.schemaName, })); -export const marshalRegisteredModelInfoSchema: 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.number().optional(), - createdBy: z.string().optional(), - updatedAt: z.number().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 marshalSecretDependencySchema: z.ZodType = z .object({ secretFullName: z.string().optional(), diff --git a/packages/resourcequotas/src/v1/model.ts b/packages/resourcequotas/src/v1/model.ts index 2fe9c0b8..c3fd74d0 100644 --- a/packages/resourcequotas/src/v1/model.ts +++ b/packages/resourcequotas/src/v1/model.ts @@ -110,41 +110,3 @@ export const unmarshalQuotaInfoSchema: z.ZodType = z quotaLimit: d.quota_limit, lastRefreshedAt: d.last_refreshed_at, })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGetQuota_ResponseSchema: z.ZodType = z - .object({ - quotaInfo: z.lazy(() => marshalQuotaInfoSchema).optional(), - }) - .transform(d => ({ - quota_info: d.quotaInfo, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListQuotas_ResponseSchema: z.ZodType = z - .object({ - quotas: z.array(z.lazy(() => marshalQuotaInfoSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - quotas: d.quotas, - next_page_token: d.nextPageToken, - })); - -export const marshalQuotaInfoSchema: z.ZodType = z - .object({ - parentSecurableType: z.enum(SecurableType).optional(), - parentFullName: z.string().optional(), - quotaName: z.string().optional(), - quotaCount: z.number().optional(), - quotaLimit: z.number().optional(), - lastRefreshedAt: z.number().optional(), - }) - .transform(d => ({ - parent_securable_type: d.parentSecurableType, - parent_full_name: d.parentFullName, - quota_name: d.quotaName, - quota_count: d.quotaCount, - quota_limit: d.quotaLimit, - last_refreshed_at: d.lastRefreshedAt, - })); diff --git a/packages/rfa/src/v1/client.ts b/packages/rfa/src/v1/client.ts index 87d27737..bd90cd0c 100644 --- a/packages/rfa/src/v1/client.ts +++ b/packages/rfa/src/v1/client.ts @@ -129,7 +129,7 @@ export class Client { const url = `${this.host}/api/3.0/rfa/destinations`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; diff --git a/packages/rfa/src/v1/model.ts b/packages/rfa/src/v1/model.ts index 51e64a8f..e5bb5d0c 100644 --- a/packages/rfa/src/v1/model.ts +++ b/packages/rfa/src/v1/model.ts @@ -1,5 +1,7 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; export enum DestinationType { @@ -181,7 +183,7 @@ export interface UpdateAccessRequestDestinationsRequest { * For each destination, a **destination_id** and **destination_type** must be defined. */ accessRequestDestinations?: AccessRequestDestinations | undefined; - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalAccessRequestDestinationsSchema: z.ZodType = @@ -207,17 +209,6 @@ export const unmarshalAccessRequestDestinationsSchema: z.ZodType = - z - .object({ - requests: z - .array(z.lazy(() => unmarshalCreateAccessRequestSchema)) - .optional(), - }) - .transform(d => ({ - requests: d.requests, - })); - export const unmarshalBatchCreateAccessRequestsResponseSchema: z.ZodType = z .object({ @@ -229,21 +220,6 @@ export const unmarshalBatchCreateAccessRequestsResponseSchema: z.ZodType = - z - .object({ - behalf_of: z.lazy(() => unmarshalPrincipalSchema).optional(), - comment: z.string().optional(), - securable_permissions: z - .array(z.lazy(() => unmarshalSecurablePermissionsSchema)) - .optional(), - }) - .transform(d => ({ - behalfOf: d.behalf_of, - comment: d.comment, - securablePermissions: d.securable_permissions, - })); - export const unmarshalCreateAccessRequestResponseSchema: z.ZodType = z .object({ @@ -292,17 +268,6 @@ export const unmarshalSecurableSchema: z.ZodType = z providerShare: d.provider_share, })); -export const unmarshalSecurablePermissionsSchema: z.ZodType = - z - .object({ - securable: z.lazy(() => unmarshalSecurableSchema).optional(), - permissions: z.array(z.string()).optional(), - }) - .transform(d => ({ - securable: d.securable, - permissions: d.permissions, - })); - export const marshalAccessRequestDestinationsSchema: z.ZodType = z .object({ destinations: z @@ -333,16 +298,6 @@ export const marshalBatchCreateAccessRequestsRequestSchema: z.ZodType = z requests: d.requests, })); -export const marshalBatchCreateAccessRequestsResponseSchema: z.ZodType = z - .object({ - responses: z - .array(z.lazy(() => marshalCreateAccessRequestResponseSchema)) - .optional(), - }) - .transform(d => ({ - responses: d.responses, - })); - export const marshalCreateAccessRequestSchema: z.ZodType = z .object({ behalfOf: z.lazy(() => marshalPrincipalSchema).optional(), @@ -357,18 +312,6 @@ export const marshalCreateAccessRequestSchema: z.ZodType = z securable_permissions: d.securablePermissions, })); -export const marshalCreateAccessRequestResponseSchema: z.ZodType = z - .object({ - behalfOf: z.lazy(() => marshalPrincipalSchema).optional(), - requestDestinations: z - .array(z.lazy(() => marshalAccessRequestDestinationsSchema)) - .optional(), - }) - .transform(d => ({ - behalf_of: d.behalfOf, - request_destinations: d.requestDestinations, - })); - export const marshalNotificationDestinationSchema: z.ZodType = z .object({ destinationId: z.string().optional(), @@ -412,3 +355,49 @@ export const marshalSecurablePermissionsSchema: z.ZodType = z securable: d.securable, permissions: d.permissions, })); + +const accessRequestDestinationsFieldMaskSchema: FieldMaskSchema = { + areAnyDestinationsHidden: {wire: 'are_any_destinations_hidden'}, + destinationSourceSecurable: { + wire: 'destination_source_securable', + children: () => securableFieldMaskSchema, + }, + destinations: {wire: 'destinations'}, + fullName: {wire: 'full_name'}, + securable: {wire: 'securable', children: () => securableFieldMaskSchema}, + securableType: {wire: 'securable_type'}, +}; + +export function accessRequestDestinationsFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + accessRequestDestinationsFieldMaskSchema + ); +} + +const notificationDestinationFieldMaskSchema: FieldMaskSchema = { + destinationId: {wire: 'destination_id'}, + destinationType: {wire: 'destination_type'}, + specialDestination: {wire: 'special_destination'}, +}; + +export function notificationDestinationFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + notificationDestinationFieldMaskSchema + ); +} + +const securableFieldMaskSchema: FieldMaskSchema = { + fullName: {wire: 'full_name'}, + providerShare: {wire: 'provider_share'}, + type: {wire: 'type'}, +}; + +export function securableFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, securableFieldMaskSchema); +} diff --git a/packages/schemas/src/v1/model.ts b/packages/schemas/src/v1/model.ts index 088f0001..0793d94b 100644 --- a/packages/schemas/src/v1/model.ts +++ b/packages/schemas/src/v1/model.ts @@ -233,53 +233,6 @@ export interface UpdateSchema_PropertiesEntry { value?: string | undefined; } -export const unmarshalCreateSchemaSchema: z.ZodType = z - .object({ - name: z.string().optional(), - catalog_name: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - storage_root: z.string().optional(), - enable_predictive_optimization: z.string().optional(), - metastore_id: z.string().optional(), - full_name: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - catalog_type: z.enum(CatalogType).optional(), - storage_location: z.string().optional(), - effective_predictive_optimization_flag: z - .lazy(() => unmarshalEffectivePredictiveOptimizationFlagSchema) - .optional(), - schema_id: z.string().optional(), - browse_only: z.boolean().optional(), - properties: z.record(z.string(), z.string()).optional(), - options: z.record(z.string(), z.string()).optional(), - }) - .transform(d => ({ - name: d.name, - catalogName: d.catalog_name, - owner: d.owner, - comment: d.comment, - storageRoot: d.storage_root, - enablePredictiveOptimization: d.enable_predictive_optimization, - metastoreId: d.metastore_id, - fullName: d.full_name, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - catalogType: d.catalog_type, - storageLocation: d.storage_location, - effectivePredictiveOptimizationFlag: - d.effective_predictive_optimization_flag, - schemaId: d.schema_id, - browseOnly: d.browse_only, - properties: d.properties, - options: d.options, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalDeleteSchema_ResponseSchema: z.ZodType = z.object({}); @@ -356,57 +309,6 @@ export const unmarshalSchemaInfoSchema: z.ZodType = z options: d.options, })); -export const unmarshalUpdateSchemaSchema: z.ZodType = z - .object({ - full_name_arg: z.string().optional(), - new_name: z.string().optional(), - name: z.string().optional(), - catalog_name: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - storage_root: z.string().optional(), - enable_predictive_optimization: z.string().optional(), - metastore_id: z.string().optional(), - full_name: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - catalog_type: z.enum(CatalogType).optional(), - storage_location: z.string().optional(), - effective_predictive_optimization_flag: z - .lazy(() => unmarshalEffectivePredictiveOptimizationFlagSchema) - .optional(), - schema_id: z.string().optional(), - browse_only: z.boolean().optional(), - properties: z.record(z.string(), z.string()).optional(), - options: z.record(z.string(), z.string()).optional(), - }) - .transform(d => ({ - fullNameArg: d.full_name_arg, - newName: d.new_name, - name: d.name, - catalogName: d.catalog_name, - owner: d.owner, - comment: d.comment, - storageRoot: d.storage_root, - enablePredictiveOptimization: d.enable_predictive_optimization, - metastoreId: d.metastore_id, - fullName: d.full_name, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - catalogType: d.catalog_type, - storageLocation: d.storage_location, - effectivePredictiveOptimizationFlag: - d.effective_predictive_optimization_flag, - schemaId: d.schema_id, - browseOnly: d.browse_only, - properties: d.properties, - options: d.options, - })); - export const marshalCreateSchemaSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -454,9 +356,6 @@ export const marshalCreateSchemaSchema: z.ZodType = z options: d.options, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteSchema_ResponseSchema: z.ZodType = z.object({}); - export const marshalEffectivePredictiveOptimizationFlagSchema: z.ZodType = z .object({ value: z.string().optional(), @@ -469,64 +368,6 @@ export const marshalEffectivePredictiveOptimizationFlagSchema: z.ZodType = z inherited_from_name: d.inheritedFromName, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListSchemas_ResponseSchema: z.ZodType = z - .object({ - schemas: z.array(z.lazy(() => marshalSchemaInfoSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - schemas: d.schemas, - next_page_token: d.nextPageToken, - })); - -export const marshalSchemaInfoSchema: z.ZodType = z - .object({ - name: z.string().optional(), - catalogName: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - storageRoot: z.string().optional(), - enablePredictiveOptimization: z.string().optional(), - metastoreId: z.string().optional(), - fullName: z.string().optional(), - createdAt: z.number().optional(), - createdBy: z.string().optional(), - updatedAt: z.number().optional(), - updatedBy: z.string().optional(), - catalogType: z.enum(CatalogType).optional(), - storageLocation: z.string().optional(), - effectivePredictiveOptimizationFlag: z - .lazy(() => marshalEffectivePredictiveOptimizationFlagSchema) - .optional(), - schemaId: z.string().optional(), - browseOnly: z.boolean().optional(), - properties: z.record(z.string(), z.string()).optional(), - options: z.record(z.string(), z.string()).optional(), - }) - .transform(d => ({ - name: d.name, - catalog_name: d.catalogName, - owner: d.owner, - comment: d.comment, - storage_root: d.storageRoot, - enable_predictive_optimization: d.enablePredictiveOptimization, - metastore_id: d.metastoreId, - full_name: d.fullName, - created_at: d.createdAt, - created_by: d.createdBy, - updated_at: d.updatedAt, - updated_by: d.updatedBy, - catalog_type: d.catalogType, - storage_location: d.storageLocation, - effective_predictive_optimization_flag: - d.effectivePredictiveOptimizationFlag, - schema_id: d.schemaId, - browse_only: d.browseOnly, - properties: d.properties, - options: d.options, - })); - export const marshalUpdateSchemaSchema: z.ZodType = z .object({ fullNameArg: z.string().optional(), diff --git a/packages/secrets/src/v1/model.ts b/packages/secrets/src/v1/model.ts index 0f1a5df3..037c37a6 100644 --- a/packages/secrets/src/v1/model.ts +++ b/packages/secrets/src/v1/model.ts @@ -215,62 +215,18 @@ export const unmarshalAzureKeyVaultSecretScopeMetadataSchema: z.ZodType = z - .object({ - scope: z.string().optional(), - initial_manage_principal: z.string().optional(), - scope_backend_type: z.enum(ScopeBackendType).optional(), - backend_azure_keyvault: z - .lazy(() => unmarshalAzureKeyVaultSecretScopeMetadataSchema) - .optional(), - }) - .transform(d => ({ - scope: d.scope, - initialManagePrincipal: d.initial_manage_principal, - scopeBackendType: d.scope_backend_type, - backendAzureKeyvault: d.backend_azure_keyvault, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalCreateScope_ResponseSchema: z.ZodType = z.object({}); -export const unmarshalDeleteAclSchema: z.ZodType = z - .object({ - scope: z.string().optional(), - principal: z.string().optional(), - }) - .transform(d => ({ - scope: d.scope, - principal: d.principal, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalDeleteAcl_ResponseSchema: z.ZodType = z.object({}); -export const unmarshalDeleteScopeSchema: z.ZodType = z - .object({ - scope: z.string().optional(), - }) - .transform(d => ({ - scope: d.scope, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalDeleteScope_ResponseSchema: z.ZodType = z.object({}); -export const unmarshalDeleteSecretSchema: z.ZodType = z - .object({ - scope: z.string().optional(), - key: z.string().optional(), - }) - .transform(d => ({ - scope: d.scope, - key: d.key, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalDeleteSecret_ResponseSchema: z.ZodType = z.object({}); @@ -319,39 +275,10 @@ export const unmarshalListSecrets_ResponseSchema: z.ZodType = z - .object({ - scope: z.string().optional(), - principal: z.string().optional(), - permission: z.enum(AclPermission).optional(), - }) - .transform(d => ({ - scope: d.scope, - principal: d.principal, - permission: d.permission, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalPutAcl_ResponseSchema: z.ZodType = z.object({}); -export const unmarshalPutSecretSchema: z.ZodType = z - .object({ - scope: z.string().optional(), - key: z.string().optional(), - string_value: z.string().optional(), - bytes_value: z - .string() - .transform(s => Uint8Array.from(atob(s), c => c.charCodeAt(0))) - .optional(), - }) - .transform(d => ({ - scope: d.scope, - key: d.key, - stringValue: d.string_value, - bytesValue: d.bytes_value, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalPutSecret_ResponseSchema: z.ZodType = z.object({}); @@ -380,16 +307,6 @@ export const unmarshalSecretScopeSchema: z.ZodType = z keyvaultMetadata: d.keyvault_metadata, })); -export const marshalAclItemSchema: z.ZodType = z - .object({ - principal: z.string().optional(), - permission: z.enum(AclPermission).optional(), - }) - .transform(d => ({ - principal: d.principal, - permission: d.permission, - })); - export const marshalAzureKeyVaultSecretScopeMetadataSchema: z.ZodType = z .object({ resourceId: z.string().optional(), @@ -416,9 +333,6 @@ export const marshalCreateScopeSchema: z.ZodType = z backend_azure_keyvault: d.backendAzureKeyvault, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCreateScope_ResponseSchema: z.ZodType = z.object({}); - export const marshalDeleteAclSchema: z.ZodType = z .object({ scope: z.string().optional(), @@ -429,9 +343,6 @@ export const marshalDeleteAclSchema: z.ZodType = z principal: d.principal, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteAcl_ResponseSchema: z.ZodType = z.object({}); - export const marshalDeleteScopeSchema: z.ZodType = z .object({ scope: z.string().optional(), @@ -440,9 +351,6 @@ export const marshalDeleteScopeSchema: z.ZodType = z scope: d.scope, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteScope_ResponseSchema: z.ZodType = z.object({}); - export const marshalDeleteSecretSchema: z.ZodType = z .object({ scope: z.string().optional(), @@ -453,52 +361,6 @@ export const marshalDeleteSecretSchema: z.ZodType = z key: d.key, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteSecret_ResponseSchema: z.ZodType = z.object({}); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGetSecret_ResponseSchema: z.ZodType = z - .object({ - key: z.string().optional(), - value: z - .any() - .transform((d: Uint8Array) => - btoa(Array.from(d, b => String.fromCharCode(b)).join('')) - ) - .optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListAcls_ResponseSchema: z.ZodType = z - .object({ - items: z.array(z.lazy(() => marshalAclItemSchema)).optional(), - }) - .transform(d => ({ - items: d.items, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListScopes_ResponseSchema: z.ZodType = z - .object({ - scopes: z.array(z.lazy(() => marshalSecretScopeSchema)).optional(), - }) - .transform(d => ({ - scopes: d.scopes, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListSecrets_ResponseSchema: z.ZodType = z - .object({ - secrets: z.array(z.lazy(() => marshalSecretMetadataSchema)).optional(), - }) - .transform(d => ({ - secrets: d.secrets, - })); - export const marshalPutAclSchema: z.ZodType = z .object({ scope: z.string().optional(), @@ -511,9 +373,6 @@ export const marshalPutAclSchema: z.ZodType = z permission: d.permission, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalPutAcl_ResponseSchema: z.ZodType = z.object({}); - export const marshalPutSecretSchema: z.ZodType = z .object({ scope: z.string().optional(), @@ -532,30 +391,3 @@ export const marshalPutSecretSchema: z.ZodType = z string_value: d.stringValue, bytes_value: d.bytesValue, })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalPutSecret_ResponseSchema: z.ZodType = z.object({}); - -export const marshalSecretMetadataSchema: z.ZodType = z - .object({ - key: z.string().optional(), - lastUpdatedTimestamp: z.number().optional(), - }) - .transform(d => ({ - key: d.key, - last_updated_timestamp: d.lastUpdatedTimestamp, - })); - -export const marshalSecretScopeSchema: z.ZodType = z - .object({ - name: z.string().optional(), - backendType: z.enum(ScopeBackendType).optional(), - keyvaultMetadata: z - .lazy(() => marshalAzureKeyVaultSecretScopeMetadataSchema) - .optional(), - }) - .transform(d => ({ - name: d.name, - backend_type: d.backendType, - keyvault_metadata: d.keyvaultMetadata, - })); diff --git a/packages/serviceprincipalsecrets/src/v1/model.ts b/packages/serviceprincipalsecrets/src/v1/model.ts index 2599833f..97de7296 100644 --- a/packages/serviceprincipalsecrets/src/v1/model.ts +++ b/packages/serviceprincipalsecrets/src/v1/model.ts @@ -80,22 +80,6 @@ export interface ServicePrincipalSecret { expireTime?: Temporal.Instant | undefined; } -export const unmarshalCreateServicePrincipalSecretSchema: z.ZodType = - z - .object({ - account_id: z.string().optional(), - service_principal: z.string().optional(), - lifetime: z - .string() - .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) - .optional(), - }) - .transform(d => ({ - accountId: d.account_id, - servicePrincipal: d.service_principal, - lifetime: d.lifetime, - })); - export const unmarshalCreateServicePrincipalSecretResponseSchema: z.ZodType = z .object({ @@ -176,66 +160,3 @@ export const marshalCreateServicePrincipalSecretSchema: z.ZodType = z service_principal: d.servicePrincipal, lifetime: d.lifetime, })); - -export const marshalCreateServicePrincipalSecretResponseSchema: z.ZodType = z - .object({ - id: z.string().optional(), - secret: z.string().optional(), - secretHash: z.string().optional(), - createTime: z.string().optional(), - updateTime: z.string().optional(), - status: z.string().optional(), - expireTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - }) - .transform(d => ({ - id: d.id, - secret: d.secret, - secret_hash: d.secretHash, - create_time: d.createTime, - update_time: d.updateTime, - status: d.status, - expire_time: d.expireTime, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteServicePrincipalSecret_ResponseSchema: z.ZodType = - z.object({}); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListServicePrincipalSecrets_ResponseSchema: z.ZodType = z - .object({ - secrets: z - .array(z.lazy(() => marshalServicePrincipalSecretSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - secrets: d.secrets, - next_page_token: d.nextPageToken, - })); - -export const marshalServicePrincipalSecretSchema: z.ZodType = z - .object({ - id: z.string().optional(), - secret: z.string().optional(), - secretHash: z.string().optional(), - createTime: z.string().optional(), - updateTime: z.string().optional(), - status: z.string().optional(), - expireTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - }) - .transform(d => ({ - id: d.id, - secret: d.secret, - secret_hash: d.secretHash, - create_time: d.createTime, - update_time: d.updateTime, - status: d.status, - expire_time: d.expireTime, - })); diff --git a/packages/serviceprincipalsecretsproxy/src/v1/model.ts b/packages/serviceprincipalsecretsproxy/src/v1/model.ts index 2599833f..97de7296 100644 --- a/packages/serviceprincipalsecretsproxy/src/v1/model.ts +++ b/packages/serviceprincipalsecretsproxy/src/v1/model.ts @@ -80,22 +80,6 @@ export interface ServicePrincipalSecret { expireTime?: Temporal.Instant | undefined; } -export const unmarshalCreateServicePrincipalSecretSchema: z.ZodType = - z - .object({ - account_id: z.string().optional(), - service_principal: z.string().optional(), - lifetime: z - .string() - .transform(s => Temporal.Duration.from('PT' + s.toUpperCase())) - .optional(), - }) - .transform(d => ({ - accountId: d.account_id, - servicePrincipal: d.service_principal, - lifetime: d.lifetime, - })); - export const unmarshalCreateServicePrincipalSecretResponseSchema: z.ZodType = z .object({ @@ -176,66 +160,3 @@ export const marshalCreateServicePrincipalSecretSchema: z.ZodType = z service_principal: d.servicePrincipal, lifetime: d.lifetime, })); - -export const marshalCreateServicePrincipalSecretResponseSchema: z.ZodType = z - .object({ - id: z.string().optional(), - secret: z.string().optional(), - secretHash: z.string().optional(), - createTime: z.string().optional(), - updateTime: z.string().optional(), - status: z.string().optional(), - expireTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - }) - .transform(d => ({ - id: d.id, - secret: d.secret, - secret_hash: d.secretHash, - create_time: d.createTime, - update_time: d.updateTime, - status: d.status, - expire_time: d.expireTime, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteServicePrincipalSecret_ResponseSchema: z.ZodType = - z.object({}); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListServicePrincipalSecrets_ResponseSchema: z.ZodType = z - .object({ - secrets: z - .array(z.lazy(() => marshalServicePrincipalSecretSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - secrets: d.secrets, - next_page_token: d.nextPageToken, - })); - -export const marshalServicePrincipalSecretSchema: z.ZodType = z - .object({ - id: z.string().optional(), - secret: z.string().optional(), - secretHash: z.string().optional(), - createTime: z.string().optional(), - updateTime: z.string().optional(), - status: z.string().optional(), - expireTime: z - .any() - .transform((d: Temporal.Instant) => d.toString()) - .optional(), - }) - .transform(d => ({ - id: d.id, - secret: d.secret, - secret_hash: d.secretHash, - create_time: d.createTime, - update_time: d.updateTime, - status: d.status, - expire_time: d.expireTime, - })); diff --git a/packages/settings/src/v2/model.ts b/packages/settings/src/v2/model.ts index 2e6d8efa..bea01772 100644 --- a/packages/settings/src/v2/model.ts +++ b/packages/settings/src/v2/model.ts @@ -795,43 +795,6 @@ export const marshalIntegerMessageSchema: z.ZodType = z value: d.value, })); -export const marshalListAccountSettingsMetadataResponseSchema: z.ZodType = z - .object({ - settingsMetadata: z - .array(z.lazy(() => marshalSettingsMetadataSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - settings_metadata: d.settingsMetadata, - next_page_token: d.nextPageToken, - })); - -export const marshalListAccountUserPreferencesMetadataResponseSchema: z.ZodType = - z - .object({ - settingsMetadata: z - .array(z.lazy(() => marshalSettingsMetadataSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - settings_metadata: d.settingsMetadata, - next_page_token: d.nextPageToken, - })); - -export const marshalListWorkspaceSettingsMetadataResponseSchema: z.ZodType = z - .object({ - settingsMetadata: z - .array(z.lazy(() => marshalSettingsMetadataSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - settings_metadata: d.settingsMetadata, - next_page_token: d.nextPageToken, - })); - export const marshalPersonalComputeMessageSchema: z.ZodType = z .object({ value: z.enum(PersonalComputeMessage_PersonalComputeMessageEnum).optional(), @@ -915,24 +878,6 @@ export const marshalSettingSchema: z.ZodType = z effective_personal_compute: d.effectivePersonalCompute, })); -export const marshalSettingsMetadataSchema: z.ZodType = z - .object({ - name: z.string().optional(), - description: z.string().optional(), - type: z.string().optional(), - docsLink: z.string().optional(), - previewPhase: z.enum(PreviewPhase).optional(), - displayName: z.string().optional(), - }) - .transform(d => ({ - name: d.name, - description: d.description, - type: d.type, - docs_link: d.docsLink, - preview_phase: d.previewPhase, - display_name: d.displayName, - })); - export const marshalStringMessageSchema: z.ZodType = z .object({ value: z.string().optional(), diff --git a/packages/statementexecution/src/v1/model.ts b/packages/statementexecution/src/v1/model.ts index cb58e30e..4efce139 100644 --- a/packages/statementexecution/src/v1/model.ts +++ b/packages/statementexecution/src/v1/model.ts @@ -522,15 +522,6 @@ export interface StatementStatus { sqlState?: string | undefined; } -export const unmarshalCancelStatementRequestSchema: z.ZodType = - z - .object({ - statement_id: z.string().optional(), - }) - .transform(d => ({ - statementId: d.statement_id, - })); - export const unmarshalCancelStatementResponseSchema: z.ZodType = z.object({}); @@ -572,39 +563,6 @@ export const unmarshalColumnInfoSchema: z.ZodType = z typeIntervalType: d.type_interval_type, })); -export const unmarshalExecuteStatementRequestSchema: z.ZodType = - z - .object({ - statement: z.string().optional(), - warehouse_id: z.string().optional(), - catalog: z.string().optional(), - schema: z.string().optional(), - row_limit: z.number().optional(), - byte_limit: z.number().optional(), - format: z.enum(Format).optional(), - disposition: z.enum(Disposition).optional(), - wait_timeout: z.string().optional(), - on_wait_timeout: z.enum(TimeoutAction).optional(), - parameters: z - .array(z.lazy(() => unmarshalStatementParameterSchema)) - .optional(), - query_tags: z.array(z.lazy(() => unmarshalQueryTagSchema)).optional(), - }) - .transform(d => ({ - statement: d.statement, - warehouseId: d.warehouse_id, - catalog: d.catalog, - schema: d.schema, - rowLimit: d.row_limit, - byteLimit: d.byte_limit, - format: d.format, - disposition: d.disposition, - waitTimeout: d.wait_timeout, - onWaitTimeout: d.on_wait_timeout, - parameters: d.parameters, - queryTags: d.query_tags, - })); - export const unmarshalExternalLinkSchema: z.ZodType = z .object({ external_link: z.string().optional(), @@ -629,16 +587,6 @@ export const unmarshalExternalLinkSchema: z.ZodType = z nextChunkInternalLink: d.next_chunk_internal_link, })); -export const unmarshalQueryTagSchema: z.ZodType = z - .object({ - key: z.string().optional(), - value: z.string().optional(), - }) - .transform(d => ({ - key: d.key, - value: d.value, - })); - export const unmarshalResultDataSchema: z.ZodType = z .object({ external_links: z @@ -703,19 +651,6 @@ export const unmarshalServiceErrorSchema: z.ZodType = z message: d.message, })); -export const unmarshalStatementParameterSchema: 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, - })); - export const unmarshalStatementResponseSchema: z.ZodType = z .object({ statement_id: z.string().optional(), @@ -750,46 +685,6 @@ export const marshalCancelStatementRequestSchema: z.ZodType = z statement_id: d.statementId, })); -export const marshalCancelStatementResponseSchema: z.ZodType = z.object({}); - -export const marshalChunkInfoSchema: z.ZodType = z - .object({ - chunkIndex: z.number().optional(), - rowOffset: z.number().optional(), - rowCount: z.number().optional(), - byteCount: z.number().optional(), - nextChunkIndex: z.number().optional(), - nextChunkInternalLink: z.string().optional(), - }) - .transform(d => ({ - chunk_index: d.chunkIndex, - row_offset: d.rowOffset, - row_count: d.rowCount, - byte_count: d.byteCount, - next_chunk_index: d.nextChunkIndex, - next_chunk_internal_link: d.nextChunkInternalLink, - })); - -export const marshalColumnInfoSchema: z.ZodType = z - .object({ - name: z.string().optional(), - typeText: z.string().optional(), - typeName: z.enum(ColumnTypeName).optional(), - position: z.number().optional(), - typePrecision: z.number().optional(), - typeScale: z.number().optional(), - typeIntervalType: z.string().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, - })); - export const marshalExecuteStatementRequestSchema: z.ZodType = z .object({ statement: z.string().optional(), @@ -822,30 +717,6 @@ export const marshalExecuteStatementRequestSchema: z.ZodType = z query_tags: d.queryTags, })); -export const marshalExternalLinkSchema: z.ZodType = z - .object({ - externalLink: z.string().optional(), - expiration: z.string().optional(), - httpHeaders: z.record(z.string(), z.string()).optional(), - chunkIndex: z.number().optional(), - rowOffset: z.number().optional(), - rowCount: z.number().optional(), - byteCount: z.number().optional(), - nextChunkIndex: z.number().optional(), - nextChunkInternalLink: z.string().optional(), - }) - .transform(d => ({ - external_link: d.externalLink, - expiration: d.expiration, - http_headers: d.httpHeaders, - chunk_index: d.chunkIndex, - row_offset: d.rowOffset, - row_count: d.rowCount, - byte_count: d.byteCount, - next_chunk_index: d.nextChunkIndex, - next_chunk_internal_link: d.nextChunkInternalLink, - })); - export const marshalQueryTagSchema: z.ZodType = z .object({ key: z.string().optional(), @@ -856,68 +727,6 @@ export const marshalQueryTagSchema: z.ZodType = z value: d.value, })); -export const marshalResultDataSchema: z.ZodType = z - .object({ - externalLinks: z.array(z.lazy(() => marshalExternalLinkSchema)).optional(), - dataArray: z.array(z.array(jsonValueSchema)).optional(), - chunkIndex: z.number().optional(), - rowOffset: z.number().optional(), - rowCount: z.number().optional(), - byteCount: z.number().optional(), - nextChunkIndex: z.number().optional(), - nextChunkInternalLink: z.string().optional(), - }) - .transform(d => ({ - external_links: d.externalLinks, - data_array: d.dataArray, - chunk_index: d.chunkIndex, - row_offset: d.rowOffset, - row_count: d.rowCount, - byte_count: d.byteCount, - next_chunk_index: d.nextChunkIndex, - next_chunk_internal_link: d.nextChunkInternalLink, - })); - -export const marshalResultManifestSchema: z.ZodType = z - .object({ - format: z.enum(Format).optional(), - schema: z.lazy(() => marshalSchemaSchema).optional(), - totalChunkCount: z.number().optional(), - chunks: z.array(z.lazy(() => marshalChunkInfoSchema)).optional(), - totalRowCount: z.number().optional(), - totalByteCount: z.number().optional(), - truncated: z.boolean().optional(), - }) - .transform(d => ({ - format: d.format, - schema: d.schema, - total_chunk_count: d.totalChunkCount, - chunks: d.chunks, - total_row_count: d.totalRowCount, - total_byte_count: d.totalByteCount, - truncated: d.truncated, - })); - -export const marshalSchemaSchema: z.ZodType = z - .object({ - columnCount: z.number().optional(), - columns: z.array(z.lazy(() => marshalColumnInfoSchema)).optional(), - }) - .transform(d => ({ - column_count: d.columnCount, - columns: d.columns, - })); - -export const marshalServiceErrorSchema: z.ZodType = z - .object({ - errorCode: z.enum(ServiceErrorCode).optional(), - message: z.string().optional(), - }) - .transform(d => ({ - error_code: d.errorCode, - message: d.message, - })); - export const marshalStatementParameterSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -929,29 +738,3 @@ export const marshalStatementParameterSchema: z.ZodType = z value: d.value, type: d.type, })); - -export const marshalStatementResponseSchema: z.ZodType = z - .object({ - statementId: z.string().optional(), - status: z.lazy(() => marshalStatementStatusSchema).optional(), - manifest: z.lazy(() => marshalResultManifestSchema).optional(), - result: z.lazy(() => marshalResultDataSchema).optional(), - }) - .transform(d => ({ - statement_id: d.statementId, - status: d.status, - manifest: d.manifest, - result: d.result, - })); - -export const marshalStatementStatusSchema: z.ZodType = z - .object({ - state: z.enum(StatementStatus_State).optional(), - error: z.lazy(() => marshalServiceErrorSchema).optional(), - sqlState: z.string().optional(), - }) - .transform(d => ({ - state: d.state, - error: d.error, - sql_state: d.sqlState, - })); diff --git a/packages/systemschemas/src/v1/model.ts b/packages/systemschemas/src/v1/model.ts index 6b5d9256..5056561d 100644 --- a/packages/systemschemas/src/v1/model.ts +++ b/packages/systemschemas/src/v1/model.ts @@ -64,19 +64,6 @@ export interface SystemSchemaInfo { export const unmarshalDisableSystemSchema_ResponseSchema: z.ZodType = z.object({}); -export const unmarshalEnableSystemSchemaSchema: z.ZodType = - z - .object({ - schema: z.string().optional(), - metastore_id: z.string().optional(), - catalog_name: z.string().optional(), - }) - .transform(d => ({ - schema: d.schema, - metastoreId: d.metastore_id, - catalogName: d.catalog_name, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalEnableSystemSchema_ResponseSchema: z.ZodType = z.object({}); @@ -105,11 +92,6 @@ export const unmarshalSystemSchemaInfoSchema: z.ZodType = z state: d.state, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDisableSystemSchema_ResponseSchema: z.ZodType = z.object( - {} -); - export const marshalEnableSystemSchemaSchema: z.ZodType = z .object({ schema: z.string().optional(), @@ -121,27 +103,3 @@ export const marshalEnableSystemSchemaSchema: z.ZodType = z metastore_id: d.metastoreId, catalog_name: d.catalogName, })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalEnableSystemSchema_ResponseSchema: z.ZodType = z.object({}); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListSystemSchemas_ResponseSchema: z.ZodType = z - .object({ - schemas: z.array(z.lazy(() => marshalSystemSchemaInfoSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - schemas: d.schemas, - next_page_token: d.nextPageToken, - })); - -export const marshalSystemSchemaInfoSchema: z.ZodType = z - .object({ - schema: z.string(), - state: z.string(), - }) - .transform(d => ({ - schema: d.schema, - state: d.state, - })); diff --git a/packages/tables/src/v1/model.ts b/packages/tables/src/v1/model.ts index bd75f023..f4437922 100644 --- a/packages/tables/src/v1/model.ts +++ b/packages/tables/src/v1/model.ts @@ -967,100 +967,6 @@ export const unmarshalConnectionDependencySchema: z.ZodType = z - .object({ - name: z.string().optional(), - catalog_name: z.string().optional(), - schema_name: z.string().optional(), - table_type: z.enum(TableType).optional(), - data_source_format: z.enum(DataSourceFormat).optional(), - storage_location: z.string().optional(), - view_definition: z.string().optional(), - view_dependencies: z.lazy(() => unmarshalDependencyListSchema).optional(), - sql_path: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - storage_credential_name: z.string().optional(), - table_constraints: z - .array(z.lazy(() => unmarshalTableConstraintSchema)) - .optional(), - row_filter: z.lazy(() => unmarshalRowFilterSchema).optional(), - pipeline_id: z.string().optional(), - enable_predictive_optimization: z.string().optional(), - metastore_id: z.string().optional(), - full_name: z.string().optional(), - data_access_configuration_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - table_id: z.string().optional(), - delta_runtime_properties_kvpairs: z - .lazy(() => unmarshalDeltaRuntimePropertiesKvPairsSchema) - .optional(), - deleted_at: z.number().optional(), - effective_predictive_optimization_flag: z - .lazy(() => unmarshalEffectivePredictiveOptimizationFlagSchema) - .optional(), - access_point: z.string().optional(), - browse_only: z.boolean().optional(), - encryption_details: z - .lazy(() => unmarshalEncryptionDetailsSchema) - .optional(), - securable_kind_manifest: z - .lazy(() => unmarshalSecurableKindManifestSchema) - .optional(), - columns: z.array(z.lazy(() => unmarshalColumnInfoSchema)).optional(), - properties: z.record(z.string(), z.string()).optional(), - }) - .transform(d => ({ - name: d.name, - catalogName: d.catalog_name, - schemaName: d.schema_name, - tableType: d.table_type, - dataSourceFormat: d.data_source_format, - storageLocation: d.storage_location, - viewDefinition: d.view_definition, - viewDependencies: d.view_dependencies, - sqlPath: d.sql_path, - owner: d.owner, - comment: d.comment, - storageCredentialName: d.storage_credential_name, - tableConstraints: d.table_constraints, - rowFilter: d.row_filter, - pipelineId: d.pipeline_id, - enablePredictiveOptimization: d.enable_predictive_optimization, - metastoreId: d.metastore_id, - fullName: d.full_name, - dataAccessConfigurationId: d.data_access_configuration_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - tableId: d.table_id, - deltaRuntimePropertiesKvpairs: d.delta_runtime_properties_kvpairs, - deletedAt: d.deleted_at, - effectivePredictiveOptimizationFlag: - d.effective_predictive_optimization_flag, - accessPoint: d.access_point, - browseOnly: d.browse_only, - encryptionDetails: d.encryption_details, - securableKindManifest: d.securable_kind_manifest, - columns: d.columns, - properties: d.properties, - })); - -export const unmarshalCreateTableConstraintSchema: z.ZodType = - z - .object({ - full_name_arg: z.string().optional(), - constraint: z.lazy(() => unmarshalTableConstraintSchema).optional(), - }) - .transform(d => ({ - fullNameArg: d.full_name_arg, - constraint: d.constraint, - })); - export const unmarshalCredentialDependencySchema: z.ZodType = z .object({ @@ -1442,91 +1348,6 @@ export const unmarshalTableSummarySchema: z.ZodType = z securableKindManifest: d.securable_kind_manifest, })); -export const unmarshalUpdateTableSchema: z.ZodType = z - .object({ - full_name_arg: z.string().optional(), - name: z.string().optional(), - catalog_name: z.string().optional(), - schema_name: z.string().optional(), - table_type: z.enum(TableType).optional(), - data_source_format: z.enum(DataSourceFormat).optional(), - storage_location: z.string().optional(), - view_definition: z.string().optional(), - view_dependencies: z.lazy(() => unmarshalDependencyListSchema).optional(), - sql_path: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - storage_credential_name: z.string().optional(), - table_constraints: z - .array(z.lazy(() => unmarshalTableConstraintSchema)) - .optional(), - row_filter: z.lazy(() => unmarshalRowFilterSchema).optional(), - pipeline_id: z.string().optional(), - enable_predictive_optimization: z.string().optional(), - metastore_id: z.string().optional(), - full_name: z.string().optional(), - data_access_configuration_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - table_id: z.string().optional(), - delta_runtime_properties_kvpairs: z - .lazy(() => unmarshalDeltaRuntimePropertiesKvPairsSchema) - .optional(), - deleted_at: z.number().optional(), - effective_predictive_optimization_flag: z - .lazy(() => unmarshalEffectivePredictiveOptimizationFlagSchema) - .optional(), - access_point: z.string().optional(), - browse_only: z.boolean().optional(), - encryption_details: z - .lazy(() => unmarshalEncryptionDetailsSchema) - .optional(), - securable_kind_manifest: z - .lazy(() => unmarshalSecurableKindManifestSchema) - .optional(), - columns: z.array(z.lazy(() => unmarshalColumnInfoSchema)).optional(), - properties: z.record(z.string(), z.string()).optional(), - }) - .transform(d => ({ - fullNameArg: d.full_name_arg, - name: d.name, - catalogName: d.catalog_name, - schemaName: d.schema_name, - tableType: d.table_type, - dataSourceFormat: d.data_source_format, - storageLocation: d.storage_location, - viewDefinition: d.view_definition, - viewDependencies: d.view_dependencies, - sqlPath: d.sql_path, - owner: d.owner, - comment: d.comment, - storageCredentialName: d.storage_credential_name, - tableConstraints: d.table_constraints, - rowFilter: d.row_filter, - pipelineId: d.pipeline_id, - enablePredictiveOptimization: d.enable_predictive_optimization, - metastoreId: d.metastore_id, - fullName: d.full_name, - dataAccessConfigurationId: d.data_access_configuration_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - tableId: d.table_id, - deltaRuntimePropertiesKvpairs: d.delta_runtime_properties_kvpairs, - deletedAt: d.deleted_at, - effectivePredictiveOptimizationFlag: - d.effective_predictive_optimization_flag, - accessPoint: d.access_point, - browseOnly: d.browse_only, - encryptionDetails: d.encryption_details, - securableKindManifest: d.securable_kind_manifest, - columns: d.columns, - properties: d.properties, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalUpdateTable_ResponseSchema: z.ZodType = z.object({}); @@ -1700,14 +1521,6 @@ export const marshalCredentialDependencySchema: z.ZodType = z credential_name: d.credentialName, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteTable_ResponseSchema: z.ZodType = z.object({}); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteTableConstraint_ResponseSchema: z.ZodType = z.object( - {} -); - export const marshalDeltaRuntimePropertiesKvPairsSchema: z.ZodType = z .object({ deltaRuntimeProperties: z.record(z.string(), z.string()).optional(), @@ -1788,28 +1601,6 @@ export const marshalFunctionDependencySchema: z.ZodType = z function_full_name: d.functionFullName, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListTableSummaries_ResponseSchema: z.ZodType = z - .object({ - tables: z.array(z.lazy(() => marshalTableSummarySchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - tables: d.tables, - next_page_token: d.nextPageToken, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListTables_ResponseSchema: z.ZodType = z - .object({ - tables: z.array(z.lazy(() => marshalTableInfoSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - tables: d.tables, - next_page_token: d.nextPageToken, - })); - export const marshalNamedTableConstraintSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -1954,110 +1745,6 @@ export const marshalTableDependencySchema: z.ZodType = z table_full_name: d.tableFullName, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalTableExists_ResponseSchema: z.ZodType = z - .object({ - tableExists: z.boolean().optional(), - }) - .transform(d => ({ - table_exists: d.tableExists, - })); - -export const marshalTableInfoSchema: z.ZodType = z - .object({ - name: z.string().optional(), - catalogName: z.string().optional(), - schemaName: z.string().optional(), - tableType: z.enum(TableType).optional(), - dataSourceFormat: z.enum(DataSourceFormat).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.number().optional(), - createdBy: z.string().optional(), - updatedAt: z.number().optional(), - updatedBy: z.string().optional(), - tableId: z.string().optional(), - deltaRuntimePropertiesKvpairs: z - .lazy(() => marshalDeltaRuntimePropertiesKvPairsSchema) - .optional(), - deletedAt: z.number().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 marshalTableSummarySchema: z.ZodType = z - .object({ - fullName: z.string().optional(), - tableType: z.enum(TableType).optional(), - securableKindManifest: z - .lazy(() => marshalSecurableKindManifestSchema) - .optional(), - }) - .transform(d => ({ - full_name: d.fullName, - table_type: d.tableType, - securable_kind_manifest: d.securableKindManifest, - })); - export const marshalUpdateTableSchema: z.ZodType = z .object({ fullNameArg: z.string().optional(), @@ -2141,9 +1828,6 @@ export const marshalUpdateTableSchema: z.ZodType = z properties: d.properties, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalUpdateTable_ResponseSchema: z.ZodType = z.object({}); - export const marshalVolumeDependencySchema: z.ZodType = z .object({ volumeFullName: z.string().optional(), diff --git a/packages/tagassignments/src/v1/client.ts b/packages/tagassignments/src/v1/client.ts index 7d864cc8..fd5a38c3 100644 --- a/packages/tagassignments/src/v1/client.ts +++ b/packages/tagassignments/src/v1/client.ts @@ -169,7 +169,7 @@ export class Client { const url = `${this.host}/api/2.0/entity-tag-assignments/${req.tagAssignment?.entityType ?? ''}/${req.tagAssignment?.entityId ?? ''}/tags/${req.tagAssignment?.tagKey ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; diff --git a/packages/tagassignments/src/v1/model.ts b/packages/tagassignments/src/v1/model.ts index 2f36407c..52eb60a2 100644 --- a/packages/tagassignments/src/v1/model.ts +++ b/packages/tagassignments/src/v1/model.ts @@ -1,5 +1,7 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; export interface CreateTagAssignmentRequest { @@ -54,7 +56,7 @@ export interface TagAssignment { export interface UpdateTagAssignmentRequest { tagAssignment?: TagAssignment | undefined; - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalListTagAssignmentsResponseSchema: z.ZodType = @@ -84,18 +86,6 @@ export const unmarshalTagAssignmentSchema: z.ZodType = z tagValue: d.tag_value, })); -export const marshalListTagAssignmentsResponseSchema: z.ZodType = z - .object({ - tagAssignments: z - .array(z.lazy(() => marshalTagAssignmentSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - tag_assignments: d.tagAssignments, - next_page_token: d.nextPageToken, - })); - export const marshalTagAssignmentSchema: z.ZodType = z .object({ entityType: z.string().optional(), @@ -109,3 +99,16 @@ export const marshalTagAssignmentSchema: z.ZodType = z tag_key: d.tagKey, tag_value: d.tagValue, })); + +const tagAssignmentFieldMaskSchema: FieldMaskSchema = { + entityId: {wire: 'entity_id'}, + entityType: {wire: 'entity_type'}, + tagKey: {wire: 'tag_key'}, + tagValue: {wire: 'tag_value'}, +}; + +export function tagAssignmentFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, tagAssignmentFieldMaskSchema); +} diff --git a/packages/tagpolicies/src/v1/client.ts b/packages/tagpolicies/src/v1/client.ts index 758f6551..85680052 100644 --- a/packages/tagpolicies/src/v1/client.ts +++ b/packages/tagpolicies/src/v1/client.ts @@ -169,7 +169,7 @@ export class Client { const url = `${this.host}/api/2.1/tag-policies/${req.tagPolicy?.tagKey ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } const query = params.toString(); const fullUrl = query !== '' ? `${url}?${query}` : url; diff --git a/packages/tagpolicies/src/v1/model.ts b/packages/tagpolicies/src/v1/model.ts index c8a116ac..2f93e4b3 100644 --- a/packages/tagpolicies/src/v1/model.ts +++ b/packages/tagpolicies/src/v1/model.ts @@ -1,6 +1,8 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. import {Temporal} from '@js-temporal/polyfill'; +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; /** Policy that determines how to resolve conflicts when multiple upstream sources have different tag values. */ @@ -68,7 +70,7 @@ export interface TagPolicy { export interface UpdateTagPolicyRequest { tagPolicy?: TagPolicy | undefined; - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export interface Value { @@ -174,16 +176,6 @@ export const marshalDefaultValueOverridePolicySchema: z.ZodType = z default_value: d.defaultValue, })); -export const marshalListTagPoliciesResponseSchema: z.ZodType = z - .object({ - tagPolicies: z.array(z.lazy(() => marshalTagPolicySchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - tag_policies: d.tagPolicies, - next_page_token: d.nextPageToken, - })); - export const marshalPropagationConfigSchema: z.ZodType = z .object({ enabled: z.boolean().optional(), @@ -231,3 +223,75 @@ export const marshalValueSchema: z.ZodType = z .transform(d => ({ name: d.name, })); + +const conflictResolutionPolicyFieldMaskSchema: FieldMaskSchema = { + defaultValueOverride: { + wire: 'default_value_override', + children: () => defaultValueOverridePolicyFieldMaskSchema, + }, +}; + +export function conflictResolutionPolicyFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + conflictResolutionPolicyFieldMaskSchema + ); +} + +const defaultValueOverridePolicyFieldMaskSchema: FieldMaskSchema = { + defaultValue: {wire: 'default_value'}, +}; + +export function defaultValueOverridePolicyFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + defaultValueOverridePolicyFieldMaskSchema + ); +} + +const propagationConfigFieldMaskSchema: FieldMaskSchema = { + conflictResolution: { + wire: 'conflict_resolution', + children: () => conflictResolutionPolicyFieldMaskSchema, + }, + enabled: {wire: 'enabled'}, +}; + +export function propagationConfigFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + propagationConfigFieldMaskSchema + ); +} + +const tagPolicyFieldMaskSchema: FieldMaskSchema = { + accountId: {wire: 'account_id'}, + createTime: {wire: 'create_time'}, + description: {wire: 'description'}, + id: {wire: 'id'}, + propagationConfig: { + wire: 'propagation_config', + children: () => propagationConfigFieldMaskSchema, + }, + tagKey: {wire: 'tag_key'}, + updateTime: {wire: 'update_time'}, + values: {wire: 'values'}, +}; + +export function tagPolicyFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, tagPolicyFieldMaskSchema); +} + +const valueFieldMaskSchema: FieldMaskSchema = { + name: {wire: 'name'}, +}; + +export function valueFieldMask(...paths: string[]): FieldMask { + return FieldMask.build(paths, valueFieldMaskSchema); +} diff --git a/packages/tokenmanagement/src/v1/model.ts b/packages/tokenmanagement/src/v1/model.ts index 9c6dd4ea..03668bab 100644 --- a/packages/tokenmanagement/src/v1/model.ts +++ b/packages/tokenmanagement/src/v1/model.ts @@ -1,5 +1,7 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; /** @@ -116,7 +118,7 @@ export interface RevokeToken_Response {} export interface UpdateToken { token?: AdminTokenInfo | undefined; /** A list of field name under AdminTokenInfo, For example in request use {"update_mask": "comment,scopes"} */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } export const unmarshalAdminTokenInfoSchema: z.ZodType = z @@ -147,23 +149,6 @@ export const unmarshalAdminTokenInfoSchema: z.ZodType = z autoscopeState: d.autoscope_state, })); -export const unmarshalCreateOnBehalfOfTokenSchema: z.ZodType = - z - .object({ - application_id: z.string().optional(), - lifetime_seconds: z.number().optional(), - comment: z.string().optional(), - scopes: z.array(z.string()).optional(), - autoscope_enabled: z.boolean().optional(), - }) - .transform(d => ({ - applicationId: d.application_id, - lifetimeSeconds: d.lifetime_seconds, - comment: d.comment, - scopes: d.scopes, - autoscopeEnabled: d.autoscope_enabled, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalCreateOnBehalfOfToken_ResponseSchema: z.ZodType = z @@ -201,16 +186,6 @@ export const unmarshalListTokens_ResponseSchema: z.ZodType export const unmarshalRevokeToken_ResponseSchema: z.ZodType = z.object({}); -export const unmarshalUpdateTokenSchema: z.ZodType = z - .object({ - token: z.lazy(() => unmarshalAdminTokenInfoSchema).optional(), - update_mask: z.string().optional(), - }) - .transform(d => ({ - token: d.token, - updateMask: d.update_mask, - })); - export const marshalAdminTokenInfoSchema: z.ZodType = z .object({ tokenId: z.string().optional(), @@ -255,44 +230,35 @@ export const marshalCreateOnBehalfOfTokenSchema: z.ZodType = z autoscope_enabled: d.autoscopeEnabled, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCreateOnBehalfOfToken_ResponseSchema: z.ZodType = z - .object({ - tokenValue: z.string().optional(), - tokenInfo: z.lazy(() => marshalAdminTokenInfoSchema).optional(), - }) - .transform(d => ({ - token_value: d.tokenValue, - token_info: d.tokenInfo, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGetToken_ResponseSchema: z.ZodType = z - .object({ - tokenInfo: z.lazy(() => marshalAdminTokenInfoSchema).optional(), - }) - .transform(d => ({ - token_info: d.tokenInfo, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListTokens_ResponseSchema: z.ZodType = z - .object({ - tokenInfos: z.array(z.lazy(() => marshalAdminTokenInfoSchema)).optional(), - }) - .transform(d => ({ - token_infos: d.tokenInfos, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalRevokeToken_ResponseSchema: z.ZodType = z.object({}); - export const marshalUpdateTokenSchema: z.ZodType = z .object({ token: z.lazy(() => marshalAdminTokenInfoSchema).optional(), - updateMask: z.string().optional(), + updateMask: z + .any() + .transform((m: FieldMask) => m.toString()) + .optional(), }) .transform(d => ({ token: d.token, update_mask: d.updateMask, })); + +const adminTokenInfoFieldMaskSchema: FieldMaskSchema = { + autoscopeState: {wire: 'autoscope_state'}, + comment: {wire: 'comment'}, + createdById: {wire: 'created_by_id'}, + createdByUsername: {wire: 'created_by_username'}, + creationTime: {wire: 'creation_time'}, + expiryTime: {wire: 'expiry_time'}, + lastUsedDay: {wire: 'last_used_day'}, + ownerId: {wire: 'owner_id'}, + scopes: {wire: 'scopes'}, + tokenId: {wire: 'token_id'}, + workspaceId: {wire: 'workspace_id'}, +}; + +export function adminTokenInfoFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build(paths, adminTokenInfoFieldMaskSchema); +} diff --git a/packages/tokens/src/v1/model.ts b/packages/tokens/src/v1/model.ts index f4f89c9b..9e0cae36 100644 --- a/packages/tokens/src/v1/model.ts +++ b/packages/tokens/src/v1/model.ts @@ -1,5 +1,7 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; /** @@ -87,26 +89,12 @@ export interface UpdateToken { tokenId?: string | undefined; token?: PublicTokenInfo | undefined; /** A list of field name under PublicTokenInfo, For example in request use {"update_mask": "comment,scopes"} */ - updateMask?: string | undefined; + updateMask?: FieldMask | undefined; } // eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface UpdateTokenResponse {} -export const unmarshalCreateTokenSchema: z.ZodType = z - .object({ - lifetime_seconds: z.number().optional(), - comment: z.string().optional(), - scopes: z.array(z.string()).optional(), - autoscope_enabled: z.boolean().optional(), - }) - .transform(d => ({ - lifetimeSeconds: d.lifetime_seconds, - comment: d.comment, - scopes: d.scopes, - autoscopeEnabled: d.autoscope_enabled, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalCreateToken_ResponseSchema: z.ZodType = z @@ -155,30 +143,10 @@ export const unmarshalPublicTokenInfoSchema: z.ZodType = z backfillScopes: d.backfill_scopes, })); -export const unmarshalRevokeTokenSchema: z.ZodType = z - .object({ - token_id: z.string().optional(), - }) - .transform(d => ({ - tokenId: d.token_id, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalRevokeToken_ResponseSchema: z.ZodType = z.object({}); -export const unmarshalUpdateTokenSchema: z.ZodType = z - .object({ - token_id: z.string().optional(), - token: z.lazy(() => unmarshalPublicTokenInfoSchema).optional(), - update_mask: z.string().optional(), - }) - .transform(d => ({ - tokenId: d.token_id, - token: d.token, - updateMask: d.update_mask, - })); - export const unmarshalUpdateTokenResponseSchema: z.ZodType = z.object({}); @@ -196,26 +164,6 @@ export const marshalCreateTokenSchema: z.ZodType = z autoscope_enabled: d.autoscopeEnabled, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCreateToken_ResponseSchema: z.ZodType = z - .object({ - tokenValue: z.string().optional(), - tokenInfo: z.lazy(() => marshalPublicTokenInfoSchema).optional(), - }) - .transform(d => ({ - token_value: d.tokenValue, - token_info: d.tokenInfo, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListTokens_ResponseSchema: z.ZodType = z - .object({ - tokenInfos: z.array(z.lazy(() => marshalPublicTokenInfoSchema)).optional(), - }) - .transform(d => ({ - token_infos: d.tokenInfos, - })); - export const marshalPublicTokenInfoSchema: z.ZodType = z .object({ tokenId: z.string().optional(), @@ -248,14 +196,14 @@ export const marshalRevokeTokenSchema: z.ZodType = z token_id: d.tokenId, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalRevokeToken_ResponseSchema: z.ZodType = z.object({}); - export const marshalUpdateTokenSchema: z.ZodType = z .object({ tokenId: z.string().optional(), token: z.lazy(() => marshalPublicTokenInfoSchema).optional(), - updateMask: z.string().optional(), + updateMask: z + .any() + .transform((m: FieldMask) => m.toString()) + .optional(), }) .transform(d => ({ token_id: d.tokenId, @@ -263,4 +211,23 @@ export const marshalUpdateTokenSchema: z.ZodType = z update_mask: d.updateMask, })); -export const marshalUpdateTokenResponseSchema: z.ZodType = z.object({}); +const publicTokenInfoFieldMaskSchema: FieldMaskSchema = { + autoscopeState: {wire: 'autoscope_state'}, + backfillScopes: {wire: 'backfill_scopes'}, + comment: {wire: 'comment'}, + creationTime: {wire: 'creation_time'}, + expiryTime: {wire: 'expiry_time'}, + inferredScopes: {wire: 'inferred_scopes'}, + lastAccessedTime: {wire: 'last_accessed_time'}, + scopes: {wire: 'scopes'}, + tokenId: {wire: 'token_id'}, +}; + +export function publicTokenInfoFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + publicTokenInfoFieldMaskSchema + ); +} diff --git a/packages/volumes/src/v1/model.ts b/packages/volumes/src/v1/model.ts index 0c2d579b..517945e6 100644 --- a/packages/volumes/src/v1/model.ts +++ b/packages/volumes/src/v1/model.ts @@ -196,48 +196,6 @@ export interface VolumeInfo { browseOnly?: boolean | undefined; } -export const unmarshalCreateVolumeSchema: z.ZodType = z - .object({ - name: z.string().optional(), - catalog_name: z.string().optional(), - schema_name: z.string().optional(), - volume_type: z.enum(VolumeType).optional(), - storage_location: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - full_name: z.string().optional(), - volume_id: z.string().optional(), - metastore_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - access_point: z.string().optional(), - encryption_details: z - .lazy(() => unmarshalEncryptionDetailsSchema) - .optional(), - browse_only: z.boolean().optional(), - }) - .transform(d => ({ - name: d.name, - catalogName: d.catalog_name, - schemaName: d.schema_name, - volumeType: d.volume_type, - storageLocation: d.storage_location, - owner: d.owner, - comment: d.comment, - fullName: d.full_name, - volumeId: d.volume_id, - metastoreId: d.metastore_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - accessPoint: d.access_point, - encryptionDetails: d.encryption_details, - browseOnly: d.browse_only, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalDeleteVolume_ResponseSchema: z.ZodType = z.object({}); @@ -275,52 +233,6 @@ export const unmarshalSseEncryptionDetailsSchema: z.ZodType = z - .object({ - full_name_arg: z.string().optional(), - new_name: z.string().optional(), - name: z.string().optional(), - catalog_name: z.string().optional(), - schema_name: z.string().optional(), - volume_type: z.enum(VolumeType).optional(), - storage_location: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - full_name: z.string().optional(), - volume_id: z.string().optional(), - metastore_id: z.string().optional(), - created_at: z.number().optional(), - created_by: z.string().optional(), - updated_at: z.number().optional(), - updated_by: z.string().optional(), - access_point: z.string().optional(), - encryption_details: z - .lazy(() => unmarshalEncryptionDetailsSchema) - .optional(), - browse_only: z.boolean().optional(), - }) - .transform(d => ({ - fullNameArg: d.full_name_arg, - newName: d.new_name, - name: d.name, - catalogName: d.catalog_name, - schemaName: d.schema_name, - volumeType: d.volume_type, - storageLocation: d.storage_location, - owner: d.owner, - comment: d.comment, - fullName: d.full_name, - volumeId: d.volume_id, - metastoreId: d.metastore_id, - createdAt: d.created_at, - createdBy: d.created_by, - updatedAt: d.updated_at, - updatedBy: d.updated_by, - accessPoint: d.access_point, - encryptionDetails: d.encryption_details, - browseOnly: d.browse_only, - })); - export const unmarshalVolumeInfoSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -403,9 +315,6 @@ export const marshalCreateVolumeSchema: z.ZodType = z browse_only: d.browseOnly, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteVolume_ResponseSchema: z.ZodType = z.object({}); - export const marshalEncryptionDetailsSchema: z.ZodType = z .object({ sseEncryptionDetails: z @@ -416,17 +325,6 @@ export const marshalEncryptionDetailsSchema: z.ZodType = z sse_encryption_details: d.sseEncryptionDetails, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListVolumes_ResponseSchema: z.ZodType = z - .object({ - volumes: z.array(z.lazy(() => marshalVolumeInfoSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - volumes: d.volumes, - next_page_token: d.nextPageToken, - })); - export const marshalSseEncryptionDetailsSchema: z.ZodType = z .object({ algorithm: z.enum(SseEncryptionAlgorithm).optional(), @@ -480,43 +378,3 @@ export const marshalUpdateVolumeSchema: z.ZodType = z encryption_details: d.encryptionDetails, browse_only: d.browseOnly, })); - -export const marshalVolumeInfoSchema: z.ZodType = z - .object({ - name: z.string().optional(), - catalogName: z.string().optional(), - schemaName: z.string().optional(), - volumeType: z.enum(VolumeType).optional(), - storageLocation: z.string().optional(), - owner: z.string().optional(), - comment: z.string().optional(), - fullName: z.string().optional(), - volumeId: z.string().optional(), - metastoreId: z.string().optional(), - createdAt: z.number().optional(), - createdBy: z.string().optional(), - updatedAt: z.number().optional(), - updatedBy: z.string().optional(), - accessPoint: z.string().optional(), - encryptionDetails: z.lazy(() => marshalEncryptionDetailsSchema).optional(), - browseOnly: z.boolean().optional(), - }) - .transform(d => ({ - name: d.name, - catalog_name: d.catalogName, - schema_name: d.schemaName, - volume_type: d.volumeType, - storage_location: d.storageLocation, - owner: d.owner, - comment: d.comment, - full_name: d.fullName, - volume_id: d.volumeId, - metastore_id: d.metastoreId, - created_at: d.createdAt, - created_by: d.createdBy, - updated_at: d.updatedAt, - updated_by: d.updatedBy, - access_point: d.accessPoint, - encryption_details: d.encryptionDetails, - browse_only: d.browseOnly, - })); diff --git a/packages/warehouses/src/v1/client.ts b/packages/warehouses/src/v1/client.ts index eba28e40..90ce1de8 100644 --- a/packages/warehouses/src/v1/client.ts +++ b/packages/warehouses/src/v1/client.ts @@ -558,7 +558,7 @@ export class Client { const url = `${this.host}/api/warehouses/v1/${req.defaultWarehouseOverride?.name ?? ''}`; const params = new URLSearchParams(); if (req.updateMask !== undefined) { - params.append('update_mask', req.updateMask); + params.append('update_mask', req.updateMask.toString()); } if (req.allowMissing !== undefined) { params.append('allow_missing', String(req.allowMissing)); diff --git a/packages/warehouses/src/v1/model.ts b/packages/warehouses/src/v1/model.ts index ec66dbd5..5cee737f 100644 --- a/packages/warehouses/src/v1/model.ts +++ b/packages/warehouses/src/v1/model.ts @@ -1,5 +1,7 @@ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT. +import {FieldMask} from '@databricks/sdk-core/wkt'; +import type {FieldMaskSchema} from '@databricks/sdk-core/wkt'; import {z} from 'zod'; export enum ChannelName { @@ -1409,7 +1411,7 @@ export interface UpdateDefaultWarehouseOverrideRequest { * Use "*" to update all fields. * When allow_missing is true, this field is ignored and all fields are applied. */ - updateMask?: string | 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. @@ -1513,38 +1515,6 @@ export const unmarshalChannelSchema: z.ZodType = z dbsqlVersion: d.dbsql_version, })); -export const unmarshalCreateWarehouseSchema: z.ZodType = z - .object({ - name: z.string().optional(), - cluster_size: z.string().optional(), - min_num_clusters: z.number().optional(), - max_num_clusters: z.number().optional(), - auto_stop_mins: z.number().optional(), - creator_name: z.string().optional(), - instance_profile_arn: z.string().optional(), - tags: z.lazy(() => unmarshalEndpointTagsSchema).optional(), - spot_instance_policy: z.enum(EndpointSpotInstancePolicy).optional(), - enable_photon: z.boolean().optional(), - channel: z.lazy(() => unmarshalChannelSchema).optional(), - enable_serverless_compute: z.boolean().optional(), - warehouse_type: z.enum(WarehouseType).optional(), - }) - .transform(d => ({ - name: d.name, - clusterSize: d.cluster_size, - minNumClusters: d.min_num_clusters, - maxNumClusters: d.max_num_clusters, - autoStopMins: d.auto_stop_mins, - creatorName: d.creator_name, - instanceProfileArn: d.instance_profile_arn, - tags: d.tags, - spotInstancePolicy: d.spot_instance_policy, - enablePhoton: d.enable_photon, - channel: d.channel, - enableServerlessCompute: d.enable_serverless_compute, - warehouseType: d.warehouse_type, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalCreateWarehouse_ResponseSchema: z.ZodType = z @@ -1570,41 +1540,6 @@ export const unmarshalDefaultWarehouseOverrideSchema: z.ZodType = - z - .object({ - id: z.string().optional(), - name: z.string().optional(), - cluster_size: z.string().optional(), - min_num_clusters: z.number().optional(), - max_num_clusters: z.number().optional(), - auto_stop_mins: z.number().optional(), - creator_name: z.string().optional(), - instance_profile_arn: z.string().optional(), - tags: z.lazy(() => unmarshalEndpointTagsSchema).optional(), - spot_instance_policy: z.enum(EndpointSpotInstancePolicy).optional(), - enable_photon: z.boolean().optional(), - channel: z.lazy(() => unmarshalChannelSchema).optional(), - enable_serverless_compute: z.boolean().optional(), - warehouse_type: z.enum(WarehouseType).optional(), - }) - .transform(d => ({ - id: d.id, - name: d.name, - clusterSize: d.cluster_size, - minNumClusters: d.min_num_clusters, - maxNumClusters: d.max_num_clusters, - autoStopMins: d.auto_stop_mins, - creatorName: d.creator_name, - instanceProfileArn: d.instance_profile_arn, - tags: d.tags, - spotInstancePolicy: d.spot_instance_policy, - enablePhoton: d.enable_photon, - channel: d.channel, - enableServerlessCompute: d.enable_serverless_compute, - warehouseType: d.warehouse_type, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalEditWarehouseRequest_ResponseSchema: z.ZodType = z.object({}); @@ -1829,43 +1764,6 @@ export const unmarshalRepeatedEndpointConfPairsSchema: z.ZodType = - z - .object({ - security_policy: z.enum(EndpointSecurityPolicy).optional(), - data_access_config: z - .array(z.lazy(() => unmarshalEndpointConfPairSchema)) - .optional(), - instance_profile_arn: z.string().optional(), - channel: z.lazy(() => unmarshalChannelSchema).optional(), - enable_serverless_compute: z.boolean().optional(), - global_param: z - .lazy(() => unmarshalRepeatedEndpointConfPairsSchema) - .optional(), - config_param: z - .lazy(() => unmarshalRepeatedEndpointConfPairsSchema) - .optional(), - sql_configuration_parameters: z - .lazy(() => unmarshalRepeatedEndpointConfPairsSchema) - .optional(), - google_service_account: z.string().optional(), - enabled_warehouse_types: z - .array(z.lazy(() => unmarshalWarehouseTypePairSchema)) - .optional(), - }) - .transform(d => ({ - securityPolicy: d.security_policy, - dataAccessConfig: d.data_access_config, - instanceProfileArn: d.instance_profile_arn, - channel: d.channel, - enableServerlessCompute: d.enable_serverless_compute, - globalParam: d.global_param, - configParam: d.config_param, - sqlConfigurationParameters: d.sql_configuration_parameters, - googleServiceAccount: d.google_service_account, - enabledWarehouseTypes: d.enabled_warehouse_types, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalSetWorkspaceWarehouseConfigRequest_ResponseSchema: z.ZodType = z.object({}); @@ -1908,26 +1806,10 @@ export const unmarshalListWarehousesRequest_ResponseSchema: z.ZodType = z - .object({ - id: z.string().optional(), - }) - .transform(d => ({ - id: d.id, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalStartRequest_ResponseSchema: z.ZodType = z.object({}); -export const unmarshalStopRequestSchema: z.ZodType = z - .object({ - id: z.string().optional(), - }) - .transform(d => ({ - id: d.id, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalStopRequest_ResponseSchema: z.ZodType = z.object({}); @@ -1974,15 +1856,6 @@ export const marshalCreateWarehouseSchema: z.ZodType = z warehouse_type: d.warehouseType, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalCreateWarehouse_ResponseSchema: z.ZodType = z - .object({ - id: z.string().optional(), - }) - .transform(d => ({ - id: d.id, - })); - export const marshalDefaultWarehouseOverrideSchema: z.ZodType = z .object({ name: z.string().optional(), @@ -2031,11 +1904,6 @@ export const marshalEditWarehouseRequestSchema: z.ZodType = z warehouse_type: d.warehouseType, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalEditWarehouseRequest_ResponseSchema: z.ZodType = z.object( - {} -); - export const marshalEndpointConfPairSchema: z.ZodType = z .object({ key: z.string().optional(), @@ -2046,68 +1914,6 @@ export const marshalEndpointConfPairSchema: z.ZodType = z value: d.value, })); -export const marshalEndpointHealthSchema: z.ZodType = z - .object({ - status: z.enum(EndpointHealth_Status).optional(), - message: z.string().optional(), - failureReason: z.lazy(() => marshalTerminationReasonSchema).optional(), - summary: z.string().optional(), - details: z.string().optional(), - }) - .transform(d => ({ - status: d.status, - message: d.message, - failure_reason: d.failureReason, - summary: d.summary, - details: d.details, - })); - -export const marshalEndpointInfoSchema: z.ZodType = z - .object({ - id: z.string().optional(), - name: z.string().optional(), - clusterSize: z.string().optional(), - minNumClusters: z.number().optional(), - maxNumClusters: z.number().optional(), - autoStopMins: z.number().optional(), - creatorName: z.string().optional(), - instanceProfileArn: z.string().optional(), - tags: z.lazy(() => marshalEndpointTagsSchema).optional(), - spotInstancePolicy: z.enum(EndpointSpotInstancePolicy).optional(), - enablePhoton: z.boolean().optional(), - channel: z.lazy(() => marshalChannelSchema).optional(), - enableServerlessCompute: z.boolean().optional(), - warehouseType: z.enum(WarehouseType).optional(), - numClusters: z.number().optional(), - numActiveSessions: z.number().optional(), - state: z.enum(EndpointState).optional(), - jdbcUrl: z.string().optional(), - odbcParams: z.lazy(() => marshalOdbcParamsSchema).optional(), - health: z.lazy(() => marshalEndpointHealthSchema).optional(), - }) - .transform(d => ({ - id: d.id, - name: d.name, - cluster_size: d.clusterSize, - min_num_clusters: d.minNumClusters, - max_num_clusters: d.maxNumClusters, - auto_stop_mins: d.autoStopMins, - creator_name: d.creatorName, - instance_profile_arn: d.instanceProfileArn, - tags: d.tags, - spot_instance_policy: d.spotInstancePolicy, - enable_photon: d.enablePhoton, - channel: d.channel, - enable_serverless_compute: d.enableServerlessCompute, - warehouse_type: d.warehouseType, - num_clusters: d.numClusters, - num_active_sessions: d.numActiveSessions, - state: d.state, - jdbc_url: d.jdbcUrl, - odbc_params: d.odbcParams, - health: d.health, - })); - export const marshalEndpointTagPairSchema: z.ZodType = z .object({ key: z.string().optional(), @@ -2126,117 +1932,6 @@ export const marshalEndpointTagsSchema: z.ZodType = z custom_tags: d.customTags, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGetWarehouse_ResponseSchema: z.ZodType = z - .object({ - id: z.string().optional(), - name: z.string().optional(), - clusterSize: z.string().optional(), - minNumClusters: z.number().optional(), - maxNumClusters: z.number().optional(), - autoStopMins: z.number().optional(), - creatorName: z.string().optional(), - instanceProfileArn: z.string().optional(), - tags: z.lazy(() => marshalEndpointTagsSchema).optional(), - spotInstancePolicy: z.enum(EndpointSpotInstancePolicy).optional(), - enablePhoton: z.boolean().optional(), - channel: z.lazy(() => marshalChannelSchema).optional(), - enableServerlessCompute: z.boolean().optional(), - warehouseType: z.enum(WarehouseType).optional(), - numClusters: z.number().optional(), - numActiveSessions: z.number().optional(), - state: z.enum(EndpointState).optional(), - jdbcUrl: z.string().optional(), - odbcParams: z.lazy(() => marshalOdbcParamsSchema).optional(), - health: z.lazy(() => marshalEndpointHealthSchema).optional(), - }) - .transform(d => ({ - id: d.id, - name: d.name, - cluster_size: d.clusterSize, - min_num_clusters: d.minNumClusters, - max_num_clusters: d.maxNumClusters, - auto_stop_mins: d.autoStopMins, - creator_name: d.creatorName, - instance_profile_arn: d.instanceProfileArn, - tags: d.tags, - spot_instance_policy: d.spotInstancePolicy, - enable_photon: d.enablePhoton, - channel: d.channel, - enable_serverless_compute: d.enableServerlessCompute, - warehouse_type: d.warehouseType, - num_clusters: d.numClusters, - num_active_sessions: d.numActiveSessions, - state: d.state, - jdbc_url: d.jdbcUrl, - odbc_params: d.odbcParams, - health: d.health, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGetWorkspaceWarehouseConfigRequest_ResponseSchema: z.ZodType = - z - .object({ - securityPolicy: z.enum(EndpointSecurityPolicy).optional(), - dataAccessConfig: z - .array(z.lazy(() => marshalEndpointConfPairSchema)) - .optional(), - instanceProfileArn: z.string().optional(), - channel: z.lazy(() => marshalChannelSchema).optional(), - enableServerlessCompute: z.boolean().optional(), - globalParam: z - .lazy(() => marshalRepeatedEndpointConfPairsSchema) - .optional(), - configParam: z - .lazy(() => marshalRepeatedEndpointConfPairsSchema) - .optional(), - sqlConfigurationParameters: z - .lazy(() => marshalRepeatedEndpointConfPairsSchema) - .optional(), - googleServiceAccount: z.string().optional(), - enabledWarehouseTypes: z - .array(z.lazy(() => marshalWarehouseTypePairSchema)) - .optional(), - }) - .transform(d => ({ - security_policy: d.securityPolicy, - data_access_config: d.dataAccessConfig, - instance_profile_arn: d.instanceProfileArn, - channel: d.channel, - enable_serverless_compute: d.enableServerlessCompute, - global_param: d.globalParam, - config_param: d.configParam, - sql_configuration_parameters: d.sqlConfigurationParameters, - google_service_account: d.googleServiceAccount, - enabled_warehouse_types: d.enabledWarehouseTypes, - })); - -export const marshalListDefaultWarehouseOverridesResponseSchema: z.ZodType = z - .object({ - defaultWarehouseOverrides: z - .array(z.lazy(() => marshalDefaultWarehouseOverrideSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - default_warehouse_overrides: d.defaultWarehouseOverrides, - next_page_token: d.nextPageToken, - })); - -export const marshalOdbcParamsSchema: z.ZodType = z - .object({ - hostname: z.string().optional(), - path: z.string().optional(), - protocol: z.string().optional(), - port: z.number().optional(), - }) - .transform(d => ({ - hostname: d.hostname, - path: d.path, - protocol: d.protocol, - port: d.port, - })); - export const marshalRepeatedEndpointConfPairsSchema: z.ZodType = z .object({ configPair: z.array(z.lazy(() => marshalEndpointConfPairSchema)).optional(), @@ -2285,22 +1980,6 @@ export const marshalSetWorkspaceWarehouseConfigRequestSchema: z.ZodType = z enabled_warehouse_types: d.enabledWarehouseTypes, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalSetWorkspaceWarehouseConfigRequest_ResponseSchema: z.ZodType = - z.object({}); - -export const marshalTerminationReasonSchema: z.ZodType = z - .object({ - code: z.enum(TerminationCode).optional(), - type: z.enum(TerminationType).optional(), - parameters: z.record(z.string(), z.string()).optional(), - }) - .transform(d => ({ - code: d.code, - type: d.type, - parameters: d.parameters, - })); - export const marshalWarehouseTypePairSchema: z.ZodType = z .object({ warehouseType: z.enum(WarehouseType).optional(), @@ -2311,22 +1990,6 @@ export const marshalWarehouseTypePairSchema: z.ZodType = z enabled: d.enabled, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalDeleteWarehouseRequest_ResponseSchema: z.ZodType = z.object( - {} -); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListWarehousesRequest_ResponseSchema: z.ZodType = z - .object({ - warehouses: z.array(z.lazy(() => marshalEndpointInfoSchema)).optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - warehouses: d.warehouses, - next_page_token: d.nextPageToken, - })); - export const marshalStartRequestSchema: z.ZodType = z .object({ id: z.string().optional(), @@ -2335,9 +1998,6 @@ export const marshalStartRequestSchema: z.ZodType = z id: d.id, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalStartRequest_ResponseSchema: z.ZodType = z.object({}); - export const marshalStopRequestSchema: z.ZodType = z .object({ id: z.string().optional(), @@ -2346,5 +2006,18 @@ export const marshalStopRequestSchema: z.ZodType = z id: d.id, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalStopRequest_ResponseSchema: z.ZodType = z.object({}); +const defaultWarehouseOverrideFieldMaskSchema: FieldMaskSchema = { + defaultWarehouseOverrideId: {wire: 'default_warehouse_override_id'}, + name: {wire: 'name'}, + type: {wire: 'type'}, + warehouseId: {wire: 'warehouse_id'}, +}; + +export function defaultWarehouseOverrideFieldMask( + ...paths: string[] +): FieldMask { + return FieldMask.build( + paths, + defaultWarehouseOverrideFieldMaskSchema + ); +} diff --git a/packages/workspaceassignment/src/v1/model.ts b/packages/workspaceassignment/src/v1/model.ts index 6ec49387..2aa08bf5 100644 --- a/packages/workspaceassignment/src/v1/model.ts +++ b/packages/workspaceassignment/src/v1/model.ts @@ -168,21 +168,6 @@ export const unmarshalPrincipalOutputSchema: z.ZodType = z displayName: d.display_name, })); -export const unmarshalUpdateWorkspacePermissionAssignmentSchema: z.ZodType = - z - .object({ - account_id: z.string().optional(), - workspace_id: z.number().optional(), - principal_id: z.number().optional(), - permissions: z.array(z.enum(Permission)).optional(), - }) - .transform(d => ({ - accountId: d.account_id, - workspaceId: d.workspace_id, - principalId: d.principal_id, - permissions: d.permissions, - })); - export const unmarshalWorkspacePermissionAssignmentOutputSchema: z.ZodType = z .object({ @@ -196,63 +181,6 @@ export const unmarshalWorkspacePermissionAssignmentOutputSchema: z.ZodType marshalWorkspacePermissionAssignmentOutputSchema)) - .optional(), - nextPageToken: z.string().optional(), - prevPageToken: z.string().optional(), - }) - .transform(d => ({ - permission_assignments: d.permissionAssignments, - next_page_token: d.nextPageToken, - prev_page_token: d.prevPageToken, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalListWorkspacePermissions_ResponseSchema: z.ZodType = z - .object({ - permissions: z - .array(z.lazy(() => marshalPermissionOutputSchema)) - .optional(), - }) - .transform(d => ({ - permissions: d.permissions, - })); - -export const marshalPermissionOutputSchema: z.ZodType = z - .object({ - permissionLevel: z.enum(Permission).optional(), - description: z.string().optional(), - }) - .transform(d => ({ - permission_level: d.permissionLevel, - description: d.description, - })); - -export const marshalPrincipalOutputSchema: z.ZodType = z - .object({ - userName: z.string().optional(), - groupName: z.string().optional(), - servicePrincipalName: z.string().optional(), - principalId: z.number().optional(), - displayName: z.string().optional(), - }) - .transform(d => ({ - user_name: d.userName, - group_name: d.groupName, - service_principal_name: d.servicePrincipalName, - principal_id: d.principalId, - display_name: d.displayName, - })); - export const marshalUpdateWorkspacePermissionAssignmentSchema: z.ZodType = z .object({ accountId: z.string().optional(), @@ -266,15 +194,3 @@ export const marshalUpdateWorkspacePermissionAssignmentSchema: z.ZodType = z principal_id: d.principalId, permissions: d.permissions, })); - -export const marshalWorkspacePermissionAssignmentOutputSchema: z.ZodType = z - .object({ - principal: z.lazy(() => marshalPrincipalOutputSchema).optional(), - permissions: z.array(z.enum(Permission)).optional(), - error: z.string().optional(), - }) - .transform(d => ({ - principal: d.principal, - permissions: d.permissions, - error: d.error, - })); diff --git a/packages/workspacebindings/src/v1/model.ts b/packages/workspacebindings/src/v1/model.ts index 102952c3..cf8f72dc 100644 --- a/packages/workspacebindings/src/v1/model.ts +++ b/packages/workspacebindings/src/v1/model.ts @@ -116,19 +116,6 @@ export const unmarshalGetWorkspaceBindings_ResponseSchema: z.ZodType = - z - .object({ - catalog_name: z.string().optional(), - assign_workspaces: z.array(z.number()).optional(), - unassign_workspaces: z.array(z.number()).optional(), - }) - .transform(d => ({ - catalogName: d.catalog_name, - assignWorkspaces: d.assign_workspaces, - unassignWorkspaces: d.unassign_workspaces, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalUpdateCatalogWorkspaceBindings_ResponseSchema: z.ZodType = z @@ -139,25 +126,6 @@ export const unmarshalUpdateCatalogWorkspaceBindings_ResponseSchema: z.ZodType = - z - .object({ - securable_type: z.string().optional(), - securable_full_name: z.string().optional(), - add: z - .array(z.lazy(() => unmarshalWorkspaceBindingInfoSchema)) - .optional(), - remove: z - .array(z.lazy(() => unmarshalWorkspaceBindingInfoSchema)) - .optional(), - }) - .transform(d => ({ - securableType: d.securable_type, - securableFullName: d.securable_full_name, - add: d.add, - remove: d.remove, - })); - // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. export const unmarshalUpdateWorkspaceBindings_ResponseSchema: z.ZodType = z @@ -181,28 +149,6 @@ export const unmarshalWorkspaceBindingInfoSchema: z.ZodType ({ - workspaces: d.workspaces, - })); - -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalGetWorkspaceBindings_ResponseSchema: z.ZodType = z - .object({ - bindings: z - .array(z.lazy(() => marshalWorkspaceBindingInfoSchema)) - .optional(), - nextPageToken: z.string().optional(), - }) - .transform(d => ({ - bindings: d.bindings, - next_page_token: d.nextPageToken, - })); - export const marshalUpdateCatalogWorkspaceBindingsSchema: z.ZodType = z .object({ catalogName: z.string().optional(), @@ -215,15 +161,6 @@ export const marshalUpdateCatalogWorkspaceBindingsSchema: z.ZodType = z unassign_workspaces: d.unassignWorkspaces, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalUpdateCatalogWorkspaceBindings_ResponseSchema: z.ZodType = z - .object({ - workspaces: z.array(z.number()).optional(), - }) - .transform(d => ({ - workspaces: d.workspaces, - })); - export const marshalUpdateWorkspaceBindingsSchema: z.ZodType = z .object({ securableType: z.string().optional(), @@ -238,17 +175,6 @@ export const marshalUpdateWorkspaceBindingsSchema: z.ZodType = z remove: d.remove, })); -// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name. -export const marshalUpdateWorkspaceBindings_ResponseSchema: z.ZodType = z - .object({ - bindings: z - .array(z.lazy(() => marshalWorkspaceBindingInfoSchema)) - .optional(), - }) - .transform(d => ({ - bindings: d.bindings, - })); - export const marshalWorkspaceBindingInfoSchema: z.ZodType = z .object({ workspaceId: z.number().optional(), diff --git a/tagging.py b/tagging.py index 56e57781..79f2894c 100755 --- a/tagging.py +++ b/tagging.py @@ -18,6 +18,7 @@ CHANGELOG_FILE_NAME = "CHANGELOG.md" PACKAGE_FILE_NAME = ".package.json" CODEGEN_FILE_NAME = ".codegen.json" +CREATED_TAGS_FILE_NAME = "created_tags.json" """ This script tags the release of the SDKs using a combination of the GitHub API and Git commands. It reads the local repository to determine necessary changes, updates changelogs, and creates tags. @@ -467,9 +468,29 @@ def update_changelogs(packages: List[Package]) -> List[TagInfo]: def push_tags(tag_infos: List[TagInfo]) -> None: """ Creates and pushes tags to the repository. + + As a side effect, writes the names of successfully created tags to + ``./created_tags.json`` so that workflows triggering this script can + discover what was produced (the GitHub Actions workflow uploads this + file as the ``created-tags`` artifact). + + Schema: + {"tags": ["service-a/v1.2.3", "service-b/v0.4.0"]} + + The manifest is written even if tag creation fails partway through: + tags that succeeded before the failure are flushed before the + exception is re-raised, so recovery-mode runs still surface their + output. """ - for tag_info in tag_infos: - gh.tag(tag_info.tag_name(), tag_info.content) + created: List[str] = [] + try: + for tag_info in tag_infos: + gh.tag(tag_info.tag_name(), tag_info.content) + created.append(tag_info.tag_name()) + finally: + manifest_path = os.path.join(os.getcwd(), CREATED_TAGS_FILE_NAME) + with open(manifest_path, "w") as f: + json.dump({"tags": created}, f) def run_command(command: List[str]) -> str: