From d317cc3ce80866cd56923c6900b9bc4f3dea62d2 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Wed, 21 Oct 2026 13:17:38 +0200 Subject: [PATCH 1/5] Generate typed walkers for the required and enum field validators Replace the generated pattern tables, matched against every node of the dynamic configuration with a trie, by generated walkers that descend only along the patterns' paths of the typed configuration. Null, zero, pure-reference values and locations still come from the dyn.Value at each node (walk_node.go), so the diagnostics are unchanged. Slice of #7098. Co-authored-by: Isaac --- .agents/rules/auto-generated-files.md | 4 +- .agents/skills/bump-sdk/SKILL.md | 2 +- Taskfile.yml | 6 +- bundle/config/validate/.gitattributes | 1 + bundle/config/validate/enum.go | 72 +- bundle/config/validate/enum_walk.go | 2658 +++++++++++ bundle/config/validate/required.go | 50 +- bundle/config/validate/required_walk.go | 4046 +++++++++++++++++ bundle/config/validate/walk_node.go | 152 + bundle/config/validate/walk_test.go | 151 + bundle/internal/bundletest/benchmark_test.go | 31 - bundle/internal/validation/enum.go | 150 +- .../validation/generated/.gitattributes | 1 - .../validation/generated/enum_fields.go | 322 -- .../validation/generated/required_fields.go | 400 -- bundle/internal/validation/main.go | 12 +- bundle/internal/validation/required.go | 181 +- bundle/internal/validation/walker.go | 489 ++ 18 files changed, 7531 insertions(+), 1197 deletions(-) create mode 100644 bundle/config/validate/.gitattributes create mode 100644 bundle/config/validate/enum_walk.go create mode 100644 bundle/config/validate/required_walk.go create mode 100644 bundle/config/validate/walk_node.go create mode 100644 bundle/config/validate/walk_test.go delete mode 100644 bundle/internal/validation/generated/.gitattributes delete mode 100644 bundle/internal/validation/generated/enum_fields.go delete mode 100644 bundle/internal/validation/generated/required_fields.go create mode 100644 bundle/internal/validation/walker.go diff --git a/.agents/rules/auto-generated-files.md b/.agents/rules/auto-generated-files.md index 6d29f4f55f9..d59f3d1470a 100644 --- a/.agents/rules/auto-generated-files.md +++ b/.agents/rules/auto-generated-files.md @@ -14,7 +14,7 @@ globs: - "internal/genkit/tagging.py" - "internal/mocks/**/*.go" - "bundle/direct/dresources/configs/*.generated.yml" - - "bundle/internal/validation/generated/*.go" + - "bundle/config/validate/*_walk.go" - "bundle/schema/jsonschema.json" - "python/databricks/bundles/version.py" - "python/databricks/bundles/*/__init__.py" @@ -33,7 +33,7 @@ paths: - "internal/genkit/tagging.py" - "internal/mocks/**/*.go" - "bundle/direct/dresources/configs/*.generated.yml" - - "bundle/internal/validation/generated/*.go" + - "bundle/config/validate/*_walk.go" - "bundle/schema/jsonschema.json" - "python/databricks/bundles/version.py" - "python/databricks/bundles/*/__init__.py" diff --git a/.agents/skills/bump-sdk/SKILL.md b/.agents/skills/bump-sdk/SKILL.md index 4f257c10b4b..2bd35224982 100644 --- a/.agents/skills/bump-sdk/SKILL.md +++ b/.agents/skills/bump-sdk/SKILL.md @@ -9,7 +9,7 @@ allowed-tools: Read, Edit, Write, Bash, Glob, Grep, WebFetch, AskUserQuestion The SDK version lives in `go.mod` (`github.com/databricks/databricks-sdk-go`) and the pinned spec SHA lives in `.codegen/_openapi_sha`. These two move as a pair; everything else in this skill is regenerated from them or is fallout you fix by hand. -Do not hand-edit generated files (`.codegen/cli.json`, `cmd/workspace/*`, `cmd/account/*`, `bundle/schema/jsonschema.json`, `bundle/internal/validation/generated/*`, `bundle/direct/dresources/configs/*.generated.yml`, `python/databricks/bundles/**`); regenerate them. +Do not hand-edit generated files (`.codegen/cli.json`, `cmd/workspace/*`, `cmd/account/*`, `bundle/schema/jsonschema.json`, `bundle/config/validate/*_walk.go`, `bundle/direct/dresources/configs/*.generated.yml`, `python/databricks/bundles/**`); regenerate them. The Python tasks (`pydabs-*`, and the `pydabs-codegen` step inside `generate-check`) all run through `uv`. If one fails because `uv` is missing or because the host's `python3` is too old (e.g. 3.9), install `uv` (`curl -LsSf https://astral.sh/uv/install.sh | sh`) rather than touching the system Python: `uv run` provisions the interpreter each package pins (`>=3.10`, and `==3.13.*` under `python/codegen/`) and downloads it if needed. Do not chase the system Python version. The acceptance goldens are the exception: they need CI's `uv` index, see step 4. diff --git a/Taskfile.yml b/Taskfile.yml index b41178fbe61..f05e9731c8b 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1008,7 +1008,7 @@ tasks: - "go run ./bundle/internal/schema ./bundle/internal/schema ./bundle/schema/jsonschema.json .codegen/cli.json" generate-validation: - desc: Generate enum and required field validation code + desc: Generate the walkers of the enum and required field validators sources: - "**/*.go" - exclude: "**/*_test.go" @@ -1016,9 +1016,9 @@ tasks: - go.sum - "{{.EMBED_SOURCES}}" generates: - - bundle/internal/validation/generated/**/*.go + - bundle/config/validate/*_walk.go cmds: - - "sh -c 'go run ./bundle/internal/validation/. && gofmt -w -s ./bundle/internal/validation/generated'" + - "sh -c 'go run ./bundle/internal/validation/. && gofmt -w -s ./bundle/config/validate/required_walk.go ./bundle/config/validate/enum_walk.go'" generate-direct: desc: Generate direct engine config (apitypes + resources) diff --git a/bundle/config/validate/.gitattributes b/bundle/config/validate/.gitattributes new file mode 100644 index 00000000000..aa33ca924e6 --- /dev/null +++ b/bundle/config/validate/.gitattributes @@ -0,0 +1 @@ +*_walk.go linguist-generated=true diff --git a/bundle/config/validate/enum.go b/bundle/config/validate/enum.go index 2ce99ea1d19..8173cc806ec 100644 --- a/bundle/config/validate/enum.go +++ b/bundle/config/validate/enum.go @@ -7,10 +7,7 @@ import ( "slices" "github.com/databricks/cli/bundle" - "github.com/databricks/cli/bundle/internal/validation/generated" "github.com/databricks/cli/libs/diag" - "github.com/databricks/cli/libs/dyn" - "github.com/databricks/cli/libs/dyn/dynvar" ) type enum struct{} @@ -23,66 +20,17 @@ func (f *enum) Name() string { return "validate:enum" } +// Apply reports enum fields with invalid values. The walker is generated (enum_walk.go) +// by bundle/internal/validation. func (f *enum) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnostics { - diags := diag.Diagnostics{} - - // Generate prefix tree for all enum fields. - trie := &dyn.TrieNode{} - for k := range generated.EnumFields { - pattern, err := dyn.NewPatternFromString(k) - if err != nil { - return diag.FromErr(fmt.Errorf("invalid pattern %q for enum field validation: %w", k, err)) - } - - err = trie.Insert(pattern) - if err != nil { - return diag.FromErr(fmt.Errorf("failed to insert pattern %q into trie: %w", k, err)) - } - } - - err := dyn.WalkReadOnly(b.Config.Value(), func(p dyn.Path, v dyn.Value) error { - // If the path is not found in the prefix tree, we do not need to validate any enum - // fields in it. - pattern, ok := trie.SearchPath(p) - if !ok { - return nil - } - - // Get the string value for comparison - strValue, ok := v.AsString() - if !ok { - return nil - } - - // Skip validation for values containing variable references (e.g. - // ${resources.jobs.my_job.id}) since they are not yet resolved. - if dynvar.ContainsVariableReference(strValue) { - return nil - } - - // Get valid values for this pattern - validValues := generated.EnumFields[pattern.String()] - - // Check if the value is in the list of valid enum values - validValue := slices.Contains(validValues, strValue) - - if !validValue { - // p is a slice of path components. We need to clone it before using it in diagnostics - // since the WalkReadOnly function will mutate it while walking the config tree. - - diags = diags.Append(diag.Diagnostic{ - Severity: diag.Warning, - Summary: fmt.Sprintf("invalid value %q for enum field. Valid values are %v", strValue, validValues), - Locations: v.Locations(), - Paths: dyn.ToStructPaths(p), - }) - } - - return nil - }) - if err != nil { - return diag.FromErr(err) - } + w := &walker{diags: diag.Diagnostics{}} + n := rootNode(b.Config.Value()) + enumConfigRoot(w, &n, &b.Config) + diags := w.diags + + // Start from the order of a walk of the configuration tree, so that the sort + // below breaks ties between diagnostics as it did with that walk. + sortByWalkOrder(b.Config.Value(), diags) // Sort diagnostics to make them deterministic slices.SortFunc(diags, func(a, b diag.Diagnostic) int { diff --git a/bundle/config/validate/enum_walk.go b/bundle/config/validate/enum_walk.go new file mode 100644 index 00000000000..fbcba206aa4 --- /dev/null +++ b/bundle/config/validate/enum_walk.go @@ -0,0 +1,2658 @@ +// Code generated by bundle/internal/validation. DO NOT EDIT. + +// enumConfigRoot reports the enum fields with invalid values. + +package validate + +import ( + "github.com/databricks/cli/bundle/config" + "github.com/databricks/cli/bundle/config/resources" + "github.com/databricks/cli/bundle/config/variable" + "github.com/databricks/databricks-sdk-go/service/apps" + "github.com/databricks/databricks-sdk-go/service/catalog" + "github.com/databricks/databricks-sdk-go/service/compute" + "github.com/databricks/databricks-sdk-go/service/database" + "github.com/databricks/databricks-sdk-go/service/jobs" + "github.com/databricks/databricks-sdk-go/service/ml" + "github.com/databricks/databricks-sdk-go/service/pipelines" + "github.com/databricks/databricks-sdk-go/service/postgres" + "github.com/databricks/databricks-sdk-go/service/serving" + "github.com/databricks/databricks-sdk-go/service/sql" + "github.com/databricks/databricks-sdk-go/service/vectorsearch" +) + +var enumValues0 = []string{"bash", "sh", "cmd"} + +var enumValues1 = []string{"whl", "jar", "tgz"} + +var enumValues2 = []string{"CAN_ATTACH_TO", "CAN_BIND", "CAN_CREATE", "CAN_CREATE_APP", "CAN_EDIT", "CAN_EDIT_METADATA", "CAN_MANAGE", "CAN_MANAGE_PRODUCTION_VERSIONS", "CAN_MANAGE_RUN", "CAN_MANAGE_STAGING_VERSIONS", "CAN_MONITOR", "CAN_MONITOR_ONLY", "CAN_QUERY", "CAN_READ", "CAN_RESTART", "CAN_RUN", "CAN_USE", "CAN_VIEW", "CAN_VIEW_METADATA", "IS_OWNER"} + +var enumValues3 = []string{"complex"} + +var enumValues4 = []string{"HTML", "MARKDOWN"} + +var enumValues5 = []string{"ACTIVE", "DELETED"} + +var enumValues6 = []string{"LARGE", "MEDIUM", "XLARGE"} + +var enumValues7 = []string{"DATA_SECURITY_MODE_AUTO", "DATA_SECURITY_MODE_DEDICATED", "DATA_SECURITY_MODE_STANDARD", "LEGACY_PASSTHROUGH", "LEGACY_SINGLE_USER", "LEGACY_SINGLE_USER_STANDARD", "LEGACY_TABLE_ACL", "NONE", "SINGLE_USER", "USER_ISOLATION"} + +var enumValues8 = []string{"DEPENDENCY_MODE_AUTO", "DEPENDENCY_MODE_CLUSTER_LIBRARIES", "DEPENDENCY_MODE_ENVIRONMENTS"} + +var enumValues9 = []string{"CLASSIC_PREVIEW"} + +var enumValues10 = []string{"NULL", "PHOTON", "STANDARD"} + +var enumValues11 = []string{"ACTIVE", "TRASHED"} + +var enumValues12 = []string{"AVAILABLE", "DELETING", "FAILING_OVER", "STARTING", "STOPPED", "UPDATING"} + +var enumValues13 = []string{"PERFORMANCE_OPTIMIZED", "STANDARD"} + +var enumValues14 = []string{"EDITABLE", "UI_LOCKED"} + +var enumValues15 = []string{"MULTI_TASK", "SINGLE_TASK"} + +var enumValues16 = []string{"ENDPOINT_TYPE_READ_ONLY", "ENDPOINT_TYPE_READ_WRITE"} + +var enumValues17 = []string{"LAKEBASE_OAUTH_V1", "NO_LOGIN", "PG_PASSWORD_SCRAM_SHA_256"} + +var enumValues18 = []string{"GROUP", "SERVICE_PRINCIPAL", "USER"} + +var enumValues19 = []string{"DATABRICKS_SUPERUSER"} + +var enumValues20 = []string{"CONTINUOUS", "SNAPSHOT", "TRIGGERED"} + +var enumValues21 = []string{"AZURE_KEYVAULT", "DATABRICKS"} + +var enumValues22 = []string{"COST_OPTIMIZED", "POLICY_UNSPECIFIED", "RELIABILITY_OPTIMIZED"} + +var enumValues23 = []string{"CLASSIC", "PRO", "TYPE_UNSPECIFIED"} + +var enumValues24 = []string{"ACTIVE", "DEGRADED", "DELETING", "FAILED", "PROVISIONING", "UPDATING"} + +var enumValues25 = []string{"STANDARD", "STORAGE_OPTIMIZED"} + +var enumValues26 = []string{"FULL_TEXT", "HYBRID", "VECTOR"} + +var enumValues27 = []string{"DELTA_SYNC", "DIRECT_ACCESS"} + +var enumValues28 = []string{"EXTERNAL", "MANAGED"} + +var enumValues29 = []string{"EQUAL", "GREATER_THAN", "GREATER_THAN_OR_EQUAL", "IS_NOT_NULL", "IS_NULL", "LESS_THAN", "LESS_THAN_OR_EQUAL", "NOT_EQUAL"} + +var enumValues30 = []string{"ERROR", "OK", "TRIGGERED", "UNKNOWN"} + +var enumValues31 = []string{"PAUSED", "UNPAUSED"} + +var enumValues32 = []string{"AUTO_SYNC", "SNAPSHOT"} + +var enumValues33 = []string{"CRASHED", "DEPLOYING", "RUNNING", "UNAVAILABLE"} + +var enumValues34 = []string{"ACTIVE", "DELETING", "ERROR", "STARTING", "STOPPED", "STOPPING", "UPDATING"} + +var enumValues35 = []string{"CAN_MANAGE", "CAN_USE"} + +var enumValues36 = []string{"ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "BROWSE", "CREATE", "CREATE_CATALOG", "CREATE_CLEAN_ROOM", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FOREIGN_SECURABLE", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "EXECUTE_CLEAN_ROOM_TASK", "EXTERNAL_USE_LOCATION", "EXTERNAL_USE_SCHEMA", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "MODIFY_CLEAN_ROOM", "READ_FILES", "READ_METADATA", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"} + +var enumValues37 = []string{"CAN_USE"} + +var enumValues38 = []string{"ON_DEMAND", "SPOT", "SPOT_WITH_FALLBACK"} + +var enumValues39 = []string{"GENERAL_PURPOSE_SSD", "THROUGHPUT_OPTIMIZED_HDD"} + +var enumValues40 = []string{"ON_DEMAND_AZURE", "SPOT_AZURE", "SPOT_WITH_FALLBACK_AZURE"} + +var enumValues41 = []string{"ON_DEMAND_GCP", "PREEMPTIBLE_GCP", "PREEMPTIBLE_WITH_FALLBACK_GCP"} + +var enumValues42 = []string{"CONFIDENTIAL_COMPUTE_TYPE_NONE", "SEV_SNP"} + +var enumValues43 = []string{"CAN_ATTACH_TO", "CAN_MANAGE", "CAN_RESTART"} + +var enumValues44 = []string{"CAN_EDIT", "CAN_MANAGE", "CAN_READ"} + +var enumValues45 = []string{"APPROX_COUNT_DISTINCT", "APPROX_PERCENTILE", "AVG", "COUNT", "FIRST", "FUNCTION_TYPE_UNSPECIFIED", "LAST", "MAX", "MIN", "STDDEV_POP", "STDDEV_SAMP", "SUM", "VAR_POP", "VAR_SAMP"} + +var enumValues46 = []string{"ON_DEMAND", "SPOT"} + +var enumValues47 = []string{"ON_DEMAND_AZURE", "SPOT_AZURE"} + +var enumValues48 = []string{"CAN_ATTACH_TO", "CAN_MANAGE"} + +var enumValues49 = []string{"NEVER", "ON_FAILURE"} + +var enumValues50 = []string{"BUNDLE", "SYSTEM_MANAGED"} + +var enumValues51 = []string{"awsCodeCommit", "azureDevOpsServices", "bitbucketCloud", "bitbucketServer", "gitHub", "gitHubEnterprise", "gitLab", "gitLabEnterpriseEdition"} + +var enumValues52 = []string{"CAN_MANAGE", "CAN_MANAGE_RUN", "CAN_VIEW", "IS_OWNER"} + +var enumValues53 = []string{"ALL_DONE", "ALL_FAILED", "ALL_SUCCESS", "AT_LEAST_ONE_FAILED", "AT_LEAST_ONE_SUCCESS", "NONE_FAILED"} + +var enumValues54 = []string{"EXTERNAL_MODEL_PROVIDER_TYPE_AMAZON_BEDROCK", "EXTERNAL_MODEL_PROVIDER_TYPE_ANTHROPIC", "EXTERNAL_MODEL_PROVIDER_TYPE_AZURE_OPENAI", "EXTERNAL_MODEL_PROVIDER_TYPE_BEDROCK_MANTLE", "EXTERNAL_MODEL_PROVIDER_TYPE_CUSTOM", "EXTERNAL_MODEL_PROVIDER_TYPE_GEMINI_ENTERPRISE", "EXTERNAL_MODEL_PROVIDER_TYPE_MICROSOFT_FOUNDRY", "EXTERNAL_MODEL_PROVIDER_TYPE_OPENAI"} + +var enumValues55 = []string{"CAN_MANAGE", "CAN_QUERY", "CAN_VIEW"} + +var enumValues56 = []string{"endpoint", "user"} + +var enumValues57 = []string{"minute"} + +var enumValues58 = []string{"TELEMETRY_FEATURE_INFERENCE_TABLE", "TELEMETRY_FEATURE_LOGS", "TELEMETRY_FEATURE_METRICS", "TELEMETRY_FEATURE_TRACES"} + +var enumValues59 = []string{"CAN_EDIT", "CAN_MANAGE", "CAN_MANAGE_PRODUCTION_VERSIONS", "CAN_MANAGE_STAGING_VERSIONS", "CAN_READ"} + +var enumValues60 = []string{"BUNDLE"} + +var enumValues61 = []string{"CDC", "QUERY_BASED"} + +var enumValues62 = []string{"BIGQUERY", "CONFLUENCE", "DYNAMICS365", "FOREIGN_CATALOG", "GA4_RAW_DATA", "GOOGLE_DRIVE", "JIRA", "MANAGED_POSTGRESQL", "META_MARKETING", "MYSQL", "NETSUITE", "ORACLE", "POSTGRESQL", "RABBITMQ", "SALESFORCE", "SERVICENOW", "SHAREPOINT", "SMARTSHEET", "SQLSERVER", "TERADATA", "TIKTOK_ADS", "WORKDAY_RAAS", "ZENDESK"} + +var enumValues63 = []string{"CAN_MANAGE", "CAN_RUN", "CAN_VIEW", "IS_OWNER"} + +var enumValues64 = []string{"FRIDAY", "MONDAY", "SATURDAY", "SUNDAY", "THURSDAY", "TUESDAY", "WEDNESDAY"} + +var enumValues65 = []string{"STORED_GENERATED"} + +var enumValues66 = []string{"CURRENT", "PREVIEW"} + +var enumValues67 = []string{"PG_SPECIFIC_TYPE_HALFVEC", "PG_SPECIFIC_TYPE_VARCHAR", "PG_SPECIFIC_TYPE_VECTOR"} + +var enumValues68 = []string{"CUSTOM_METRIC_TYPE_AGGREGATE", "CUSTOM_METRIC_TYPE_DERIVED", "CUSTOM_METRIC_TYPE_DRIFT"} + +var enumValues69 = []string{"PROBLEM_TYPE_CLASSIFICATION", "PROBLEM_TYPE_REGRESSION"} + +var enumValues70 = []string{"PAUSED", "UNPAUSED", "UNSPECIFIED"} + +var enumValues71 = []string{"READ", "WRITE", "MANAGE"} + +var enumValues72 = []string{"CHANNEL_NAME_CURRENT", "CHANNEL_NAME_CUSTOM", "CHANNEL_NAME_PREVIEW", "CHANNEL_NAME_PREVIOUS"} + +var enumValues73 = []string{"CAN_MANAGE", "CAN_MONITOR", "CAN_USE", "CAN_VIEW", "IS_OWNER"} + +var enumValues74 = []string{"SYNCED_TABLED_OFFLINE", "SYNCED_TABLE_OFFLINE_FAILED", "SYNCED_TABLE_ONLINE", "SYNCED_TABLE_ONLINE_CONTINUOUS_UPDATE", "SYNCED_TABLE_ONLINE_NO_PENDING_UPDATE", "SYNCED_TABLE_ONLINE_PIPELINE_FAILED", "SYNCED_TABLE_ONLINE_TRIGGERED_UPDATE", "SYNCED_TABLE_ONLINE_UPDATING_PIPELINE_RESOURCES", "SYNCED_TABLE_PROVISIONING", "SYNCED_TABLE_PROVISIONING_INITIAL_SNAPSHOT", "SYNCED_TABLE_PROVISIONING_PIPELINE_RESOURCES"} + +var enumValues75 = []string{"CAN_CREATE", "CAN_MANAGE", "CAN_USE"} + +var enumValues76 = []string{"CONTINUOUS", "TRIGGERED"} + +var enumValues77 = []string{"AVG", "COUNT", "COUNT_DISTINCT", "MAX", "MEDIAN", "MIN", "STDDEV", "SUM"} + +var enumValues78 = []string{"CANCELLED", "FAILED", "IN_PROGRESS", "SUCCEEDED"} + +var enumValues79 = []string{"CAN_CONNECT_AND_CREATE"} + +var enumValues80 = []string{"CAN_EDIT", "CAN_MANAGE", "CAN_RUN", "CAN_VIEW"} + +var enumValues81 = []string{"MANAGE", "READ", "WRITE"} + +var enumValues82 = []string{"CAN_MANAGE", "CAN_USE", "IS_OWNER"} + +var enumValues83 = []string{"EXECUTE", "MODIFY", "READ_VOLUME", "SELECT", "USE_CONNECTION", "WRITE_VOLUME"} + +var enumValues84 = []string{"CONNECTION", "FUNCTION", "MODEL_SERVICE", "TABLE", "VOLUME"} + +var enumValues85 = []string{"AWS_SSE_KMS", "AWS_SSE_S3"} + +var enumValues86 = []string{"PREMIUM_LRS", "STANDARD_LRS"} + +var enumValues87 = []string{"DISCONNECTED", "NOT_SYNCED"} + +var enumValues88 = []string{"RUN_DURATION_SECONDS", "STREAMING_BACKLOG_BYTES", "STREAMING_BACKLOG_FILES", "STREAMING_BACKLOG_RECORDS", "STREAMING_BACKLOG_SECONDS"} + +var enumValues89 = []string{"GREATER_THAN"} + +var enumValues90 = []string{"QUERY_RETURNS_ROWS", "RESULT_VALUE_CHANGES"} + +var enumValues91 = []string{"BEST_EFFORT", "CRITICAL", "NORMAL"} + +var enumValues92 = []string{"GPU_1xA10", "GPU_1xH100", "GPU_8xB300", "GPU_8xH100"} + +var enumValues93 = []string{"EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL", "LESS_THAN", "LESS_THAN_OR_EQUAL", "NOT_EQUAL"} + +var enumValues94 = []string{"GIT", "WORKSPACE"} + +var enumValues95 = []string{"MODEL_ALIAS_SET", "MODEL_CREATED", "MODEL_VERSION_READY"} + +var enumValues96 = []string{"DAYS", "HOURS", "MINUTES", "WEEKS"} + +var enumValues97 = []string{"ALL_UPDATED", "ANY_UPDATED"} + +var enumValues98 = []string{"RATE_LIMIT_KEY_SERVICE", "RATE_LIMIT_KEY_SERVICE_PRINCIPAL", "RATE_LIMIT_KEY_USER", "RATE_LIMIT_KEY_USER_DEFAULT", "RATE_LIMIT_KEY_USER_GROUP"} + +var enumValues99 = []string{"RATE_LIMIT_RENEWAL_PERIOD_HOUR", "RATE_LIMIT_RENEWAL_PERIOD_MINUTE"} + +var enumValues100 = []string{"endpoint", "service_principal", "user", "user_group"} + +var enumValues101 = []string{"CPU", "CPU_LARGE", "CPU_MEDIUM", "GPU_LARGE", "GPU_MEDIUM", "GPU_SMALL", "GPU_XLARGE", "GPU_XLARGE_8", "MULTIGPU_MEDIUM"} + +var enumValues102 = []string{"ENHANCED", "LEGACY"} + +var enumValues103 = []string{"APPEND_ONLY", "SCD_TYPE_1", "SCD_TYPE_2"} + +var enumValues104 = []string{"OAUTH", "PAT"} + +var enumValues105 = []string{"DIRECT_QUERY", "DUAL", "IMPORT"} + +var enumValues106 = []string{"DESTINATION_TYPE_EXTERNAL_FOUNDATION_MODEL", "DESTINATION_TYPE_PAY_PER_TOKEN_FOUNDATION_MODEL", "DESTINATION_TYPE_PROVISIONED_THROUGHPUT_FOUNDATION_MODEL"} + +var enumValues107 = []string{"ai21labs", "amazon-bedrock", "anthropic", "cohere", "custom", "databricks-model-serving", "google-cloud-vertex-ai", "openai", "palm"} + +var enumValues108 = []string{"PROVISIONING_PHASE_INDEX_SCAN", "PROVISIONING_PHASE_INDEX_SORT", "PROVISIONING_PHASE_MAIN"} + +var enumValues109 = []string{"BINARY", "BOOLEAN", "DATE", "DECIMAL", "DOUBLE", "FLOAT", "INTEGER", "LONG", "SHORT", "STRING", "TIMESTAMP"} + +var enumValues110 = []string{"BLOCK", "MASK", "NONE"} + +var enumValues111 = []string{"ai21labs", "amazon", "anthropic", "cohere"} + +var enumValues112 = []string{"FILE", "FILE_METADATA", "PERMISSION"} + +var enumValues113 = []string{"ALL", "INLINE_ONLY", "NONE", "NON_INLINE_ONLY"} + +var enumValues114 = []string{"TEXT_HTML", "TEXT_PLAIN"} + +var enumValues115 = []string{"FILE", "FILE_METADATA", "LIST", "PERMISSION"} + +var enumValues116 = []string{"AUCTION_AD", "AUCTION_ADGROUP", "AUCTION_ADVERTISER", "AUCTION_CAMPAIGN"} + +var enumValues117 = []string{"AUDIENCE", "BASIC", "BUSINESS_CENTER", "DSA", "GMV_MAX", "PLAYABLE_AD"} + +var enumValues118 = []string{"AVRO", "JSON", "PROTOBUF", "STRING"} + +var enumValues119 = []string{"AVRO", "BINARYFILE", "CSV", "EXCEL", "JSON", "ORC", "PARQUET", "XML"} + +var enumValues120 = []string{"ADD_NEW_COLUMNS", "ADD_NEW_COLUMNS_WITH_TYPE_WIDENING", "FAIL_ON_NEW_COLUMNS", "NONE", "RESCUE"} + +var enumValues121 = []string{"CAMPAIGN", "CAMPAIGN_GROUP", "CREATIVE"} + +var enumValues122 = []string{"ANALYTICS", "ATTRIBUTED_REVENUE_METRICS", "STATISTICS"} + +var enumValues123 = []string{"ALL", "DAILY", "MONTHLY", "YEARLY"} + +var enumValues124 = []string{"FAILFAST", "PERMISSIVE"} + +func enumConfigRoot(w *walker, n *node, v *config.Root) { + if v == nil { + v = &config.Root{} + } + if len(v.Artifacts) > 0 { + c := n.child("artifacts") + for k0, x0 := range v.Artifacts { + e := c.child(k0) + enumConfigArtifact(w, &e, x0) + } + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesPermission(w, &e, &v.Permissions[i0]) + } + } + if c := n.child("resources"); c.exists() { + enumConfigResources(w, &c, &v.Resources) + } + if len(v.Variables) > 0 { + c := n.child("variables") + for k0, x0 := range v.Variables { + e := c.child(k0) + enumVariableVariable(w, &e, x0) + } + } +} + +func enumConfigArtifact(w *walker, n *node, v *config.Artifact) { + if v == nil { + v = &config.Artifact{} + } + w.enumField(n, "executable", string(v.Executable), enumValues0) + w.enumField(n, "type", string(v.Type), enumValues1) +} + +func enumResourcesPermission(w *walker, n *node, v *resources.Permission) { + if v == nil { + v = &resources.Permission{} + } + w.enumField(n, "level", string(v.Level), enumValues2) +} + +func enumConfigResources(w *walker, n *node, v *config.Resources) { + if v == nil { + v = &config.Resources{} + } + if len(v.Alerts) > 0 { + c := n.child("alerts") + for k0, x0 := range v.Alerts { + e := c.child(k0) + enumResourcesAlert(w, &e, x0) + } + } + if len(v.Apps) > 0 { + c := n.child("apps") + for k0, x0 := range v.Apps { + e := c.child(k0) + enumResourcesApp(w, &e, x0) + } + } + if len(v.Catalogs) > 0 { + c := n.child("catalogs") + for k0, x0 := range v.Catalogs { + e := c.child(k0) + enumResourcesCatalog(w, &e, x0) + } + } + if len(v.ClusterPolicies) > 0 { + c := n.child("cluster_policies") + for k0, x0 := range v.ClusterPolicies { + e := c.child(k0) + enumResourcesClusterPolicy(w, &e, x0) + } + } + if len(v.Clusters) > 0 { + c := n.child("clusters") + for k0, x0 := range v.Clusters { + e := c.child(k0) + enumResourcesCluster(w, &e, x0) + } + } + if len(v.Dashboards) > 0 { + c := n.child("dashboards") + for k0, x0 := range v.Dashboards { + e := c.child(k0) + enumResourcesDashboard(w, &e, x0) + } + } + if len(v.DatabaseInstances) > 0 { + c := n.child("database_instances") + for k0, x0 := range v.DatabaseInstances { + e := c.child(k0) + enumResourcesDatabaseInstance(w, &e, x0) + } + } + if len(v.Experiments) > 0 { + c := n.child("experiments") + for k0, x0 := range v.Experiments { + e := c.child(k0) + enumResourcesMlflowExperiment(w, &e, x0) + } + } + if len(v.ExternalLocations) > 0 { + c := n.child("external_locations") + for k0, x0 := range v.ExternalLocations { + e := c.child(k0) + enumResourcesExternalLocation(w, &e, x0) + } + } + if len(v.Features) > 0 { + c := n.child("features") + for k0, x0 := range v.Features { + e := c.child(k0) + enumResourcesFeature(w, &e, x0) + } + } + if len(v.GenieSpaces) > 0 { + c := n.child("genie_spaces") + for k0, x0 := range v.GenieSpaces { + e := c.child(k0) + enumResourcesGenieSpace(w, &e, x0) + } + } + if len(v.InstancePools) > 0 { + c := n.child("instance_pools") + for k0, x0 := range v.InstancePools { + e := c.child(k0) + enumResourcesInstancePool(w, &e, x0) + } + } + if len(v.JobRuns) > 0 { + c := n.child("job_runs") + for k0, x0 := range v.JobRuns { + e := c.child(k0) + enumResourcesJobRun(w, &e, x0) + } + } + if len(v.Jobs) > 0 { + c := n.child("jobs") + for k0, x0 := range v.Jobs { + e := c.child(k0) + enumResourcesJob(w, &e, x0) + } + } + if len(v.McpServices) > 0 { + c := n.child("mcp_services") + for k0, x0 := range v.McpServices { + e := c.child(k0) + enumResourcesMcpService(w, &e, x0) + } + } + if len(v.ModelProviderServices) > 0 { + c := n.child("model_provider_services") + for k0, x0 := range v.ModelProviderServices { + e := c.child(k0) + enumResourcesModelProviderService(w, &e, x0) + } + } + if len(v.ModelServices) > 0 { + c := n.child("model_services") + for k0, x0 := range v.ModelServices { + e := c.child(k0) + enumResourcesModelService(w, &e, x0) + } + } + if len(v.ModelServingEndpoints) > 0 { + c := n.child("model_serving_endpoints") + for k0, x0 := range v.ModelServingEndpoints { + e := c.child(k0) + enumResourcesModelServingEndpoint(w, &e, x0) + } + } + if len(v.Models) > 0 { + c := n.child("models") + for k0, x0 := range v.Models { + e := c.child(k0) + enumResourcesMlflowModel(w, &e, x0) + } + } + if len(v.Pipelines) > 0 { + c := n.child("pipelines") + for k0, x0 := range v.Pipelines { + e := c.child(k0) + enumResourcesPipeline(w, &e, x0) + } + } + if len(v.PostgresEndpoints) > 0 { + c := n.child("postgres_endpoints") + for k0, x0 := range v.PostgresEndpoints { + e := c.child(k0) + enumResourcesPostgresEndpoint(w, &e, x0) + } + } + if len(v.PostgresProjects) > 0 { + c := n.child("postgres_projects") + for k0, x0 := range v.PostgresProjects { + e := c.child(k0) + enumResourcesPostgresProject(w, &e, x0) + } + } + if len(v.PostgresRoles) > 0 { + c := n.child("postgres_roles") + for k0, x0 := range v.PostgresRoles { + e := c.child(k0) + enumResourcesPostgresRole(w, &e, x0) + } + } + if len(v.PostgresSnapshotSchedules) > 0 { + c := n.child("postgres_snapshot_schedules") + for k0, x0 := range v.PostgresSnapshotSchedules { + e := c.child(k0) + enumResourcesPostgresSnapshotSchedule(w, &e, x0) + } + } + if len(v.PostgresSyncedTables) > 0 { + c := n.child("postgres_synced_tables") + for k0, x0 := range v.PostgresSyncedTables { + e := c.child(k0) + enumResourcesPostgresSyncedTable(w, &e, x0) + } + } + if len(v.QualityMonitors) > 0 { + c := n.child("quality_monitors") + for k0, x0 := range v.QualityMonitors { + e := c.child(k0) + enumResourcesQualityMonitor(w, &e, x0) + } + } + if len(v.RegisteredModels) > 0 { + c := n.child("registered_models") + for k0, x0 := range v.RegisteredModels { + e := c.child(k0) + enumResourcesRegisteredModel(w, &e, x0) + } + } + if len(v.Schemas) > 0 { + c := n.child("schemas") + for k0, x0 := range v.Schemas { + e := c.child(k0) + enumResourcesSchema(w, &e, x0) + } + } + if len(v.SecretScopes) > 0 { + c := n.child("secret_scopes") + for k0, x0 := range v.SecretScopes { + e := c.child(k0) + enumResourcesSecretScope(w, &e, x0) + } + } + if len(v.Secrets) > 0 { + c := n.child("secrets") + for k0, x0 := range v.Secrets { + e := c.child(k0) + enumResourcesSecret(w, &e, x0) + } + } + if len(v.SqlWarehouses) > 0 { + c := n.child("sql_warehouses") + for k0, x0 := range v.SqlWarehouses { + e := c.child(k0) + enumResourcesSqlWarehouse(w, &e, x0) + } + } + if len(v.SyncedDatabaseTables) > 0 { + c := n.child("synced_database_tables") + for k0, x0 := range v.SyncedDatabaseTables { + e := c.child(k0) + enumResourcesSyncedDatabaseTable(w, &e, x0) + } + } + if len(v.VectorSearchEndpoints) > 0 { + c := n.child("vector_search_endpoints") + for k0, x0 := range v.VectorSearchEndpoints { + e := c.child(k0) + enumResourcesVectorSearchEndpoint(w, &e, x0) + } + } + if len(v.VectorSearchIndexes) > 0 { + c := n.child("vector_search_indexes") + for k0, x0 := range v.VectorSearchIndexes { + e := c.child(k0) + enumResourcesVectorSearchIndex(w, &e, x0) + } + } + if len(v.Volumes) > 0 { + c := n.child("volumes") + for k0, x0 := range v.Volumes { + e := c.child(k0) + enumResourcesVolume(w, &e, x0) + } + } +} + +func enumVariableVariable(w *walker, n *node, v *variable.Variable) { + if v == nil { + v = &variable.Variable{} + } + w.enumField(n, "type", string(v.Type), enumValues3) +} + +func enumResourcesAlert(w *walker, n *node, v *resources.Alert) { + if v == nil { + v = &resources.Alert{} + } + w.enumField(n, "custom_template_format", string(v.AlertV2.CustomTemplateFormat), enumValues4) + if c := n.child("evaluation"); c.exists() { + enumSqlAlertV2Evaluation(w, &c, &v.AlertV2.Evaluation) + } + w.enumField(n, "lifecycle_state", string(v.AlertV2.LifecycleState), enumValues5) + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesPermission(w, &e, &v.Permissions[i0]) + } + } + if c := n.child("schedule"); c.exists() { + enumSqlCronSchedule(w, &c, &v.AlertV2.Schedule) + } +} + +func enumResourcesApp(w *walker, n *node, v *resources.App) { + if v == nil { + v = &resources.App{} + } + if c := n.child("active_deployment"); c.exists() { + enumAppsAppDeployment(w, &c, v.App.ActiveDeployment) + } + if c := n.child("app_status"); c.exists() { + enumAppsApplicationStatus(w, &c, v.App.AppStatus) + } + w.enumField(n, "compute_size", string(v.App.ComputeSize), enumValues6) + if c := n.child("compute_status"); c.exists() { + enumAppsComputeStatus(w, &c, v.App.ComputeStatus) + } + if c := n.child("pending_deployment"); c.exists() { + enumAppsAppDeployment(w, &c, v.App.PendingDeployment) + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesAppPermission(w, &e, &v.Permissions[i0]) + } + } + if len(v.App.Resources) > 0 { + c := n.child("resources") + for i0 := range v.App.Resources { + e := c.elem(i0) + enumAppsAppResource(w, &e, &v.App.Resources[i0]) + } + } +} + +func enumResourcesCatalog(w *walker, n *node, v *resources.Catalog) { + if v == nil { + v = &resources.Catalog{} + } + if len(v.Grants) > 0 { + c := n.child("grants") + for i0 := range v.Grants { + e := c.elem(i0) + enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i0]) + } + } +} + +func enumResourcesClusterPolicy(w *walker, n *node, v *resources.ClusterPolicy) { + if v == nil { + v = &resources.ClusterPolicy{} + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesClusterPolicyPermission(w, &e, &v.Permissions[i0]) + } + } +} + +func enumResourcesCluster(w *walker, n *node, v *resources.Cluster) { + if v == nil { + v = &resources.Cluster{} + } + if c := n.child("aws_attributes"); c.exists() { + enumComputeAwsAttributes(w, &c, v.ClusterSpec.AwsAttributes) + } + if c := n.child("azure_attributes"); c.exists() { + enumComputeAzureAttributes(w, &c, v.ClusterSpec.AzureAttributes) + } + w.enumField(n, "data_security_mode", string(v.ClusterSpec.DataSecurityMode), enumValues7) + w.enumField(n, "dependency_mode", string(v.ClusterSpec.DependencyMode), enumValues8) + if c := n.child("gcp_attributes"); c.exists() { + enumComputeGcpAttributes(w, &c, v.ClusterSpec.GcpAttributes) + } + w.enumField(n, "kind", string(v.ClusterSpec.Kind), enumValues9) + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesClusterPermission(w, &e, &v.Permissions[i0]) + } + } + w.enumField(n, "runtime_engine", string(v.ClusterSpec.RuntimeEngine), enumValues10) +} + +func enumResourcesDashboard(w *walker, n *node, v *resources.Dashboard) { + if v == nil { + v = &resources.Dashboard{} + } + w.enumField(n, "lifecycle_state", string(v.DashboardConfig.LifecycleState), enumValues11) + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesPermission(w, &e, &v.Permissions[i0]) + } + } +} + +func enumResourcesDatabaseInstance(w *walker, n *node, v *resources.DatabaseInstance) { + if v == nil { + v = &resources.DatabaseInstance{} + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesPermission(w, &e, &v.Permissions[i0]) + } + } + w.enumField(n, "state", string(v.DatabaseInstance.State), enumValues12) +} + +func enumResourcesMlflowExperiment(w *walker, n *node, v *resources.MlflowExperiment) { + if v == nil { + v = &resources.MlflowExperiment{} + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesMlflowExperimentPermission(w, &e, &v.Permissions[i0]) + } + } +} + +func enumResourcesExternalLocation(w *walker, n *node, v *resources.ExternalLocation) { + if v == nil { + v = &resources.ExternalLocation{} + } + if c := n.child("encryption_details"); c.exists() { + enumCatalogEncryptionDetails(w, &c, v.CreateExternalLocation.EncryptionDetails) + } + if len(v.Grants) > 0 { + c := n.child("grants") + for i0 := range v.Grants { + e := c.elem(i0) + enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i0]) + } + } +} + +func enumResourcesFeature(w *walker, n *node, v *resources.Feature) { + if v == nil { + v = &resources.Feature{} + } + if c := n.child("function"); c.exists() { + enumMlFunction(w, &c, &v.Feature.Function) + } + if c := n.child("source"); c.exists() { + enumMlDataSource(w, &c, &v.Feature.Source) + } +} + +func enumResourcesGenieSpace(w *walker, n *node, v *resources.GenieSpace) { + if v == nil { + v = &resources.GenieSpace{} + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesPermission(w, &e, &v.Permissions[i0]) + } + } +} + +func enumResourcesInstancePool(w *walker, n *node, v *resources.InstancePool) { + if v == nil { + v = &resources.InstancePool{} + } + if c := n.child("aws_attributes"); c.exists() { + enumComputeInstancePoolAwsAttributes(w, &c, v.CreateInstancePool.AwsAttributes) + } + if c := n.child("azure_attributes"); c.exists() { + enumComputeInstancePoolAzureAttributes(w, &c, v.CreateInstancePool.AzureAttributes) + } + if c := n.child("disk_spec"); c.exists() { + enumComputeDiskSpec(w, &c, v.CreateInstancePool.DiskSpec) + } + if c := n.child("gcp_attributes"); c.exists() { + enumComputeInstancePoolGcpAttributes(w, &c, v.CreateInstancePool.GcpAttributes) + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesInstancePoolPermission(w, &e, &v.Permissions[i0]) + } + } +} + +func enumResourcesJobRun(w *walker, n *node, v *resources.JobRun) { + if v == nil { + v = &resources.JobRun{} + } + w.enumField(n, "performance_target", string(v.RunNow.PerformanceTarget), enumValues13) +} + +func enumResourcesJob(w *walker, n *node, v *resources.Job) { + if v == nil { + v = &resources.Job{} + } + if c := n.child("continuous"); c.exists() { + enumJobsContinuous(w, &c, v.JobSettings.Continuous) + } + if c := n.child("deployment"); c.exists() { + enumJobsJobDeployment(w, &c, v.JobSettings.Deployment) + } + w.enumField(n, "edit_mode", string(v.JobSettings.EditMode), enumValues14) + w.enumField(n, "format", string(v.JobSettings.Format), enumValues15) + if c := n.child("git_source"); c.exists() { + enumJobsGitSource(w, &c, v.JobSettings.GitSource) + } + if c := n.child("health"); c.exists() { + enumJobsJobsHealthRules(w, &c, v.JobSettings.Health) + } + if len(v.JobSettings.JobClusters) > 0 { + c := n.child("job_clusters") + for i0 := range v.JobSettings.JobClusters { + e := c.elem(i0) + enumJobsJobCluster(w, &e, &v.JobSettings.JobClusters[i0]) + } + } + w.enumField(n, "performance_target", string(v.JobSettings.PerformanceTarget), enumValues13) + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesJobPermission(w, &e, &v.Permissions[i0]) + } + } + if c := n.child("schedule"); c.exists() { + enumJobsCronSchedule(w, &c, v.JobSettings.Schedule) + } + if len(v.JobSettings.Tasks) > 0 { + c := n.child("tasks") + for i0 := range v.JobSettings.Tasks { + e := c.elem(i0) + enumJobsTask(w, &e, &v.JobSettings.Tasks[i0]) + } + } + if c := n.child("trigger"); c.exists() { + enumJobsTriggerSettings(w, &c, v.JobSettings.Trigger) + } + if len(v.JobSettings.Triggers) > 0 { + c := n.child("triggers") + for i0 := range v.JobSettings.Triggers { + e := c.elem(i0) + enumJobsTriggerConfiguration(w, &e, &v.JobSettings.Triggers[i0]) + } + } +} + +func enumResourcesMcpService(w *walker, n *node, v *resources.McpService) { + if v == nil { + v = &resources.McpService{} + } + if c := n.child("config"); c.exists() { + enumCatalogMcpServiceConfig(w, &c, v.McpServiceConfig.Config) + } + if len(v.Grants) > 0 { + c := n.child("grants") + for i0 := range v.Grants { + e := c.elem(i0) + enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i0]) + } + } +} + +func enumResourcesModelProviderService(w *walker, n *node, v *resources.ModelProviderService) { + if v == nil { + v = &resources.ModelProviderService{} + } + if c := n.child("config"); c.exists() { + enumCatalogModelProviderServiceConfig(w, &c, v.ModelProviderServiceConfig.Config) + } + if len(v.Grants) > 0 { + c := n.child("grants") + for i0 := range v.Grants { + e := c.elem(i0) + enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i0]) + } + } +} + +func enumResourcesModelService(w *walker, n *node, v *resources.ModelService) { + if v == nil { + v = &resources.ModelService{} + } + if c := n.child("config"); c.exists() { + enumCatalogModelServiceConfig(w, &c, v.ModelServiceConfig.Config) + } + if len(v.Grants) > 0 { + c := n.child("grants") + for i0 := range v.Grants { + e := c.elem(i0) + enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i0]) + } + } +} + +func enumResourcesModelServingEndpoint(w *walker, n *node, v *resources.ModelServingEndpoint) { + if v == nil { + v = &resources.ModelServingEndpoint{} + } + if c := n.child("ai_gateway"); c.exists() { + enumServingAiGatewayConfig(w, &c, v.CreateServingEndpoint.AiGateway) + } + if c := n.child("config"); c.exists() { + enumServingEndpointCoreConfigInput(w, &c, v.CreateServingEndpoint.Config) + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesModelServingEndpointPermission(w, &e, &v.Permissions[i0]) + } + } + if len(v.CreateServingEndpoint.RateLimits) > 0 { + c := n.child("rate_limits") + for i0 := range v.CreateServingEndpoint.RateLimits { + e := c.elem(i0) + enumServingRateLimit(w, &e, &v.CreateServingEndpoint.RateLimits[i0]) + } + } + if c := n.child("telemetry_config"); c.exists() { + enumServingTelemetryConfig(w, &c, v.CreateServingEndpoint.TelemetryConfig) + } +} + +func enumResourcesMlflowModel(w *walker, n *node, v *resources.MlflowModel) { + if v == nil { + v = &resources.MlflowModel{} + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesMlflowModelPermission(w, &e, &v.Permissions[i0]) + } + } +} + +func enumResourcesPipeline(w *walker, n *node, v *resources.Pipeline) { + if v == nil { + v = &resources.Pipeline{} + } + if len(v.CreatePipeline.Clusters) > 0 { + c := n.child("clusters") + for i0 := range v.CreatePipeline.Clusters { + e := c.elem(i0) + enumPipelinesPipelineCluster(w, &e, &v.CreatePipeline.Clusters[i0]) + } + } + if c := n.child("deployment"); c.exists() { + enumPipelinesPipelineDeployment(w, &c, v.CreatePipeline.Deployment) + } + if c := n.child("ingestion_definition"); c.exists() { + enumPipelinesIngestionPipelineDefinition(w, &c, v.CreatePipeline.IngestionDefinition) + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesPipelinePermission(w, &e, &v.Permissions[i0]) + } + } + if c := n.child("restart_window"); c.exists() { + enumPipelinesRestartWindow(w, &c, v.CreatePipeline.RestartWindow) + } +} + +func enumResourcesPostgresEndpoint(w *walker, n *node, v *resources.PostgresEndpoint) { + if v == nil { + v = &resources.PostgresEndpoint{} + } + w.enumField(n, "endpoint_type", string(v.PostgresEndpointConfig.EndpointSpec.EndpointType), enumValues16) +} + +func enumResourcesPostgresProject(w *walker, n *node, v *resources.PostgresProject) { + if v == nil { + v = &resources.PostgresProject{} + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesPermission(w, &e, &v.Permissions[i0]) + } + } +} + +func enumResourcesPostgresRole(w *walker, n *node, v *resources.PostgresRole) { + if v == nil { + v = &resources.PostgresRole{} + } + w.enumField(n, "auth_method", string(v.PostgresRoleConfig.RoleRoleSpec.AuthMethod), enumValues17) + w.enumField(n, "identity_type", string(v.PostgresRoleConfig.RoleRoleSpec.IdentityType), enumValues18) + if len(v.PostgresRoleConfig.RoleRoleSpec.MembershipRoles) > 0 { + c := n.child("membership_roles") + for i0 := range v.PostgresRoleConfig.RoleRoleSpec.MembershipRoles { + e := c.elem(i0) + w.enumElem(&e, string(v.PostgresRoleConfig.RoleRoleSpec.MembershipRoles[i0]), enumValues19) + } + } +} + +func enumResourcesPostgresSnapshotSchedule(w *walker, n *node, v *resources.PostgresSnapshotSchedule) { + if v == nil { + v = &resources.PostgresSnapshotSchedule{} + } + if len(v.PostgresSnapshotScheduleConfig.Schedule) > 0 { + c := n.child("schedule") + for i0 := range v.PostgresSnapshotScheduleConfig.Schedule { + e := c.elem(i0) + enumPostgresScheduleCadence(w, &e, &v.PostgresSnapshotScheduleConfig.Schedule[i0]) + } + } +} + +func enumResourcesPostgresSyncedTable(w *walker, n *node, v *resources.PostgresSyncedTable) { + if v == nil { + v = &resources.PostgresSyncedTable{} + } + if len(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExtraColumns) > 0 { + c := n.child("extra_columns") + for i0 := range v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExtraColumns { + e := c.elem(i0) + enumPostgresSyncedTableSyncedTableSpecExtraColumn(w, &e, &v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExtraColumns[i0]) + } + } + if c := n.child("new_pipeline_spec"); c.exists() { + enumPostgresNewPipelineSpec(w, &c, v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.NewPipelineSpec) + } + w.enumField(n, "scheduling_policy", string(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.SchedulingPolicy), enumValues20) + if len(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides) > 0 { + c := n.child("type_overrides") + for i0 := range v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides { + e := c.elem(i0) + enumPostgresSyncedTableSyncedTableSpecTypeOverride(w, &e, &v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides[i0]) + } + } +} + +func enumResourcesQualityMonitor(w *walker, n *node, v *resources.QualityMonitor) { + if v == nil { + v = &resources.QualityMonitor{} + } + if len(v.CreateMonitor.CustomMetrics) > 0 { + c := n.child("custom_metrics") + for i0 := range v.CreateMonitor.CustomMetrics { + e := c.elem(i0) + enumCatalogMonitorMetric(w, &e, &v.CreateMonitor.CustomMetrics[i0]) + } + } + if c := n.child("inference_log"); c.exists() { + enumCatalogMonitorInferenceLog(w, &c, v.CreateMonitor.InferenceLog) + } + if c := n.child("schedule"); c.exists() { + enumCatalogMonitorCronSchedule(w, &c, v.CreateMonitor.Schedule) + } +} + +func enumResourcesRegisteredModel(w *walker, n *node, v *resources.RegisteredModel) { + if v == nil { + v = &resources.RegisteredModel{} + } + if len(v.Grants) > 0 { + c := n.child("grants") + for i0 := range v.Grants { + e := c.elem(i0) + enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i0]) + } + } +} + +func enumResourcesSchema(w *walker, n *node, v *resources.Schema) { + if v == nil { + v = &resources.Schema{} + } + if len(v.Grants) > 0 { + c := n.child("grants") + for i0 := range v.Grants { + e := c.elem(i0) + enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i0]) + } + } +} + +func enumResourcesSecretScope(w *walker, n *node, v *resources.SecretScope) { + if v == nil { + v = &resources.SecretScope{} + } + w.enumField(n, "backend_type", string(v.BackendType), enumValues21) + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesSecretScopePermission(w, &e, &v.Permissions[i0]) + } + } +} + +func enumResourcesSecret(w *walker, n *node, v *resources.Secret) { + if v == nil { + v = &resources.Secret{} + } + if len(v.Grants) > 0 { + c := n.child("grants") + for i0 := range v.Grants { + e := c.elem(i0) + enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i0]) + } + } +} + +func enumResourcesSqlWarehouse(w *walker, n *node, v *resources.SqlWarehouse) { + if v == nil { + v = &resources.SqlWarehouse{} + } + if c := n.child("channel"); c.exists() { + enumSqlChannel(w, &c, v.CreateWarehouseRequest.Channel) + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesSqlWarehousePermission(w, &e, &v.Permissions[i0]) + } + } + w.enumField(n, "spot_instance_policy", string(v.CreateWarehouseRequest.SpotInstancePolicy), enumValues22) + w.enumField(n, "warehouse_type", string(v.CreateWarehouseRequest.WarehouseType), enumValues23) +} + +func enumResourcesSyncedDatabaseTable(w *walker, n *node, v *resources.SyncedDatabaseTable) { + if v == nil { + v = &resources.SyncedDatabaseTable{} + } + if c := n.child("data_synchronization_status"); c.exists() { + enumDatabaseSyncedTableStatus(w, &c, v.SyncedDatabaseTable.DataSynchronizationStatus) + } + if c := n.child("spec"); c.exists() { + enumDatabaseSyncedTableSpec(w, &c, v.SyncedDatabaseTable.Spec) + } + w.enumField(n, "unity_catalog_provisioning_state", string(v.SyncedDatabaseTable.UnityCatalogProvisioningState), enumValues24) +} + +func enumResourcesVectorSearchEndpoint(w *walker, n *node, v *resources.VectorSearchEndpoint) { + if v == nil { + v = &resources.VectorSearchEndpoint{} + } + w.enumField(n, "endpoint_type", string(v.CreateEndpoint.EndpointType), enumValues25) + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + enumResourcesVectorSearchEndpointPermission(w, &e, &v.Permissions[i0]) + } + } +} + +func enumResourcesVectorSearchIndex(w *walker, n *node, v *resources.VectorSearchIndex) { + if v == nil { + v = &resources.VectorSearchIndex{} + } + if c := n.child("delta_sync_index_spec"); c.exists() { + enumVectorsearchDeltaSyncVectorIndexSpecRequest(w, &c, v.CreateVectorIndexRequest.DeltaSyncIndexSpec) + } + if len(v.Grants) > 0 { + c := n.child("grants") + for i0 := range v.Grants { + e := c.elem(i0) + enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i0]) + } + } + w.enumField(n, "index_subtype", string(v.CreateVectorIndexRequest.IndexSubtype), enumValues26) + w.enumField(n, "index_type", string(v.CreateVectorIndexRequest.IndexType), enumValues27) +} + +func enumResourcesVolume(w *walker, n *node, v *resources.Volume) { + if v == nil { + v = &resources.Volume{} + } + if len(v.Grants) > 0 { + c := n.child("grants") + for i0 := range v.Grants { + e := c.elem(i0) + enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i0]) + } + } + w.enumField(n, "volume_type", string(v.CreateVolumeRequestContent.VolumeType), enumValues28) +} + +func enumSqlAlertV2Evaluation(w *walker, n *node, v *sql.AlertV2Evaluation) { + if v == nil { + v = &sql.AlertV2Evaluation{} + } + w.enumField(n, "comparison_operator", string(v.ComparisonOperator), enumValues29) + w.enumField(n, "empty_result_state", string(v.EmptyResultState), enumValues30) + if c := n.child("source"); c.exists() { + enumSqlAlertV2OperandColumn(w, &c, &v.Source) + } + w.enumField(n, "state", string(v.State), enumValues30) + if c := n.child("threshold"); c.exists() { + enumSqlAlertV2Operand(w, &c, v.Threshold) + } +} + +func enumSqlCronSchedule(w *walker, n *node, v *sql.CronSchedule) { + if v == nil { + v = &sql.CronSchedule{} + } + w.enumField(n, "pause_status", string(v.PauseStatus), enumValues31) +} + +func enumAppsAppDeployment(w *walker, n *node, v *apps.AppDeployment) { + if v == nil { + v = &apps.AppDeployment{} + } + w.enumField(n, "mode", string(v.Mode), enumValues32) + if c := n.child("status"); c.exists() { + enumAppsAppDeploymentStatus(w, &c, v.Status) + } +} + +func enumAppsApplicationStatus(w *walker, n *node, v *apps.ApplicationStatus) { + if v == nil { + v = &apps.ApplicationStatus{} + } + w.enumField(n, "state", string(v.State), enumValues33) +} + +func enumAppsComputeStatus(w *walker, n *node, v *apps.ComputeStatus) { + if v == nil { + v = &apps.ComputeStatus{} + } + w.enumField(n, "state", string(v.State), enumValues34) +} + +func enumResourcesAppPermission(w *walker, n *node, v *resources.AppPermission) { + if v == nil { + v = &resources.AppPermission{} + } + w.enumField(n, "level", string(v.Level), enumValues35) +} + +func enumAppsAppResource(w *walker, n *node, v *apps.AppResource) { + if v == nil { + v = &apps.AppResource{} + } + if c := n.child("app"); c.exists() { + enumAppsAppResourceApp(w, &c, v.App) + } + if c := n.child("database"); c.exists() { + enumAppsAppResourceDatabase(w, &c, v.Database) + } + if c := n.child("experiment"); c.exists() { + enumAppsAppResourceExperiment(w, &c, v.Experiment) + } + if c := n.child("genie_space"); c.exists() { + enumAppsAppResourceGenieSpace(w, &c, v.GenieSpace) + } + if c := n.child("job"); c.exists() { + enumAppsAppResourceJob(w, &c, v.Job) + } + if c := n.child("postgres"); c.exists() { + enumAppsAppResourcePostgres(w, &c, v.Postgres) + } + if c := n.child("secret"); c.exists() { + enumAppsAppResourceSecret(w, &c, v.Secret) + } + if c := n.child("serving_endpoint"); c.exists() { + enumAppsAppResourceServingEndpoint(w, &c, v.ServingEndpoint) + } + if c := n.child("sql_warehouse"); c.exists() { + enumAppsAppResourceSqlWarehouse(w, &c, v.SqlWarehouse) + } + if c := n.child("uc_securable"); c.exists() { + enumAppsAppResourceUcSecurable(w, &c, v.UcSecurable) + } +} + +func enumCatalogPrivilegeAssignment(w *walker, n *node, v *catalog.PrivilegeAssignment) { + if v == nil { + v = &catalog.PrivilegeAssignment{} + } + if len(v.Privileges) > 0 { + c := n.child("privileges") + for i0 := range v.Privileges { + e := c.elem(i0) + w.enumElem(&e, string(v.Privileges[i0]), enumValues36) + } + } +} + +func enumResourcesClusterPolicyPermission(w *walker, n *node, v *resources.ClusterPolicyPermission) { + if v == nil { + v = &resources.ClusterPolicyPermission{} + } + w.enumField(n, "level", string(v.Level), enumValues37) +} + +func enumComputeAwsAttributes(w *walker, n *node, v *compute.AwsAttributes) { + if v == nil { + v = &compute.AwsAttributes{} + } + w.enumField(n, "availability", string(v.Availability), enumValues38) + w.enumField(n, "ebs_volume_type", string(v.EbsVolumeType), enumValues39) +} + +func enumComputeAzureAttributes(w *walker, n *node, v *compute.AzureAttributes) { + if v == nil { + v = &compute.AzureAttributes{} + } + w.enumField(n, "availability", string(v.Availability), enumValues40) +} + +func enumComputeGcpAttributes(w *walker, n *node, v *compute.GcpAttributes) { + if v == nil { + v = &compute.GcpAttributes{} + } + w.enumField(n, "availability", string(v.Availability), enumValues41) + w.enumField(n, "confidential_compute_type", string(v.ConfidentialComputeType), enumValues42) +} + +func enumResourcesClusterPermission(w *walker, n *node, v *resources.ClusterPermission) { + if v == nil { + v = &resources.ClusterPermission{} + } + w.enumField(n, "level", string(v.Level), enumValues43) +} + +func enumResourcesMlflowExperimentPermission(w *walker, n *node, v *resources.MlflowExperimentPermission) { + if v == nil { + v = &resources.MlflowExperimentPermission{} + } + w.enumField(n, "level", string(v.Level), enumValues44) +} + +func enumCatalogEncryptionDetails(w *walker, n *node, v *catalog.EncryptionDetails) { + if v == nil { + v = &catalog.EncryptionDetails{} + } + if c := n.child("sse_encryption_details"); c.exists() { + enumCatalogSseEncryptionDetails(w, &c, v.SseEncryptionDetails) + } +} + +func enumMlFunction(w *walker, n *node, v *ml.Function) { + if v == nil { + v = &ml.Function{} + } + w.enumField(n, "function_type", string(v.FunctionType), enumValues45) +} + +func enumMlDataSource(w *walker, n *node, v *ml.DataSource) { + if v == nil { + v = &ml.DataSource{} + } + if c := n.child("request_source"); c.exists() { + enumMlRequestSource(w, &c, v.RequestSource) + } +} + +func enumComputeInstancePoolAwsAttributes(w *walker, n *node, v *compute.InstancePoolAwsAttributes) { + if v == nil { + v = &compute.InstancePoolAwsAttributes{} + } + w.enumField(n, "availability", string(v.Availability), enumValues46) +} + +func enumComputeInstancePoolAzureAttributes(w *walker, n *node, v *compute.InstancePoolAzureAttributes) { + if v == nil { + v = &compute.InstancePoolAzureAttributes{} + } + w.enumField(n, "availability", string(v.Availability), enumValues47) +} + +func enumComputeDiskSpec(w *walker, n *node, v *compute.DiskSpec) { + if v == nil { + v = &compute.DiskSpec{} + } + if c := n.child("disk_type"); c.exists() { + enumComputeDiskType(w, &c, v.DiskType) + } +} + +func enumComputeInstancePoolGcpAttributes(w *walker, n *node, v *compute.InstancePoolGcpAttributes) { + if v == nil { + v = &compute.InstancePoolGcpAttributes{} + } + w.enumField(n, "gcp_availability", string(v.GcpAvailability), enumValues41) +} + +func enumResourcesInstancePoolPermission(w *walker, n *node, v *resources.InstancePoolPermission) { + if v == nil { + v = &resources.InstancePoolPermission{} + } + w.enumField(n, "level", string(v.Level), enumValues48) +} + +func enumJobsContinuous(w *walker, n *node, v *jobs.Continuous) { + if v == nil { + v = &jobs.Continuous{} + } + if c := n.child("maintenance_window"); c.exists() { + enumJobsMaintenanceWindow(w, &c, v.MaintenanceWindow) + } + w.enumField(n, "pause_status", string(v.PauseStatus), enumValues31) + w.enumField(n, "task_retry_mode", string(v.TaskRetryMode), enumValues49) +} + +func enumJobsJobDeployment(w *walker, n *node, v *jobs.JobDeployment) { + if v == nil { + v = &jobs.JobDeployment{} + } + w.enumField(n, "kind", string(v.Kind), enumValues50) +} + +func enumJobsGitSource(w *walker, n *node, v *jobs.GitSource) { + if v == nil { + v = &jobs.GitSource{} + } + w.enumField(n, "git_provider", string(v.GitProvider), enumValues51) + if c := n.child("job_source"); c.exists() { + enumJobsJobSource(w, &c, v.JobSource) + } +} + +func enumJobsJobsHealthRules(w *walker, n *node, v *jobs.JobsHealthRules) { + if v == nil { + v = &jobs.JobsHealthRules{} + } + if len(v.Rules) > 0 { + c := n.child("rules") + for i0 := range v.Rules { + e := c.elem(i0) + enumJobsJobsHealthRule(w, &e, &v.Rules[i0]) + } + } +} + +func enumJobsJobCluster(w *walker, n *node, v *jobs.JobCluster) { + if v == nil { + v = &jobs.JobCluster{} + } + if c := n.child("new_cluster"); c.exists() { + enumComputeClusterSpec(w, &c, v.NewCluster) + } +} + +func enumResourcesJobPermission(w *walker, n *node, v *resources.JobPermission) { + if v == nil { + v = &resources.JobPermission{} + } + w.enumField(n, "level", string(v.Level), enumValues52) +} + +func enumJobsCronSchedule(w *walker, n *node, v *jobs.CronSchedule) { + if v == nil { + v = &jobs.CronSchedule{} + } + w.enumField(n, "pause_status", string(v.PauseStatus), enumValues31) + if c := n.child("sql_condition"); c.exists() { + enumJobsSqlConditionConfiguration(w, &c, v.SqlCondition) + } +} + +func enumJobsTask(w *walker, n *node, v *jobs.Task) { + if v == nil { + v = &jobs.Task{} + } + if c := n.child("ai_runtime_task"); c.exists() { + enumJobsAiRuntimeTask(w, &c, v.AiRuntimeTask) + } + if c := n.child("compute"); c.exists() { + enumJobsCompute(w, &c, v.Compute) + } + if c := n.child("condition_task"); c.exists() { + enumJobsConditionTask(w, &c, v.ConditionTask) + } + if c := n.child("dbt_task"); c.exists() { + enumJobsDbtTask(w, &c, v.DbtTask) + } + if c := n.child("for_each_task"); c.exists() { + enumJobsForEachTask(w, &c, v.ForEachTask) + } + if c := n.child("gen_ai_compute_task"); c.exists() { + enumJobsGenAiComputeTask(w, &c, v.GenAiComputeTask) + } + if c := n.child("health"); c.exists() { + enumJobsJobsHealthRules(w, &c, v.Health) + } + if c := n.child("new_cluster"); c.exists() { + enumComputeClusterSpec(w, &c, v.NewCluster) + } + if c := n.child("notebook_task"); c.exists() { + enumJobsNotebookTask(w, &c, v.NotebookTask) + } + if c := n.child("power_bi_task"); c.exists() { + enumJobsPowerBiTask(w, &c, v.PowerBiTask) + } + w.enumField(n, "run_if", string(v.RunIf), enumValues53) + if c := n.child("spark_python_task"); c.exists() { + enumJobsSparkPythonTask(w, &c, v.SparkPythonTask) + } + if c := n.child("sql_task"); c.exists() { + enumJobsSqlTask(w, &c, v.SqlTask) + } +} + +func enumJobsTriggerSettings(w *walker, n *node, v *jobs.TriggerSettings) { + if v == nil { + v = &jobs.TriggerSettings{} + } + if c := n.child("model"); c.exists() { + enumJobsModelTriggerConfiguration(w, &c, v.Model) + } + w.enumField(n, "pause_status", string(v.PauseStatus), enumValues31) + if c := n.child("periodic"); c.exists() { + enumJobsPeriodicTriggerConfiguration(w, &c, v.Periodic) + } + if c := n.child("sql_condition"); c.exists() { + enumJobsSqlConditionConfiguration(w, &c, v.SqlCondition) + } + if c := n.child("table_update"); c.exists() { + enumJobsTableUpdateTriggerConfiguration(w, &c, v.TableUpdate) + } +} + +func enumJobsTriggerConfiguration(w *walker, n *node, v *jobs.TriggerConfiguration) { + if v == nil { + v = &jobs.TriggerConfiguration{} + } + if c := n.child("continuous"); c.exists() { + enumJobsContinuousTriggerConfiguration(w, &c, v.Continuous) + } + if c := n.child("model"); c.exists() { + enumJobsModelTriggerConfiguration(w, &c, v.Model) + } + w.enumField(n, "pause_status", string(v.PauseStatus), enumValues31) + if c := n.child("periodic"); c.exists() { + enumJobsPeriodicTriggerConfiguration(w, &c, v.Periodic) + } + if c := n.child("sql_condition"); c.exists() { + enumJobsSqlConditionConfiguration(w, &c, v.SqlCondition) + } + if c := n.child("table_update"); c.exists() { + enumJobsTableUpdateTriggerConfiguration(w, &c, v.TableUpdate) + } +} + +func enumCatalogMcpServiceConfig(w *walker, n *node, v *catalog.McpServiceConfig) { + if v == nil { + v = &catalog.McpServiceConfig{} + } + if len(v.RateLimits) > 0 { + c := n.child("rate_limits") + for i0 := range v.RateLimits { + e := c.elem(i0) + enumCatalogRateLimit(w, &e, &v.RateLimits[i0]) + } + } +} + +func enumCatalogModelProviderServiceConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfig{} + } + w.enumField(n, "provider_type", string(v.ProviderType), enumValues54) + if len(v.RateLimits) > 0 { + c := n.child("rate_limits") + for i0 := range v.RateLimits { + e := c.elem(i0) + enumCatalogRateLimit(w, &e, &v.RateLimits[i0]) + } + } +} + +func enumCatalogModelServiceConfig(w *walker, n *node, v *catalog.ModelServiceConfig) { + if v == nil { + v = &catalog.ModelServiceConfig{} + } + if len(v.RateLimits) > 0 { + c := n.child("rate_limits") + for i0 := range v.RateLimits { + e := c.elem(i0) + enumCatalogRateLimit(w, &e, &v.RateLimits[i0]) + } + } + if c := n.child("routing"); c.exists() { + enumCatalogModelServiceConfigRoutingConfig(w, &c, v.Routing) + } +} + +func enumServingAiGatewayConfig(w *walker, n *node, v *serving.AiGatewayConfig) { + if v == nil { + v = &serving.AiGatewayConfig{} + } + if c := n.child("guardrails"); c.exists() { + enumServingAiGatewayGuardrails(w, &c, v.Guardrails) + } + if len(v.RateLimits) > 0 { + c := n.child("rate_limits") + for i0 := range v.RateLimits { + e := c.elem(i0) + enumServingAiGatewayRateLimit(w, &e, &v.RateLimits[i0]) + } + } +} + +func enumServingEndpointCoreConfigInput(w *walker, n *node, v *serving.EndpointCoreConfigInput) { + if v == nil { + v = &serving.EndpointCoreConfigInput{} + } + if len(v.ServedEntities) > 0 { + c := n.child("served_entities") + for i0 := range v.ServedEntities { + e := c.elem(i0) + enumServingServedEntityInput(w, &e, &v.ServedEntities[i0]) + } + } + if len(v.ServedModels) > 0 { + c := n.child("served_models") + for i0 := range v.ServedModels { + e := c.elem(i0) + enumServingServedModelInput(w, &e, &v.ServedModels[i0]) + } + } +} + +func enumResourcesModelServingEndpointPermission(w *walker, n *node, v *resources.ModelServingEndpointPermission) { + if v == nil { + v = &resources.ModelServingEndpointPermission{} + } + w.enumField(n, "level", string(v.Level), enumValues55) +} + +func enumServingRateLimit(w *walker, n *node, v *serving.RateLimit) { + if v == nil { + v = &serving.RateLimit{} + } + w.enumField(n, "key", string(v.Key), enumValues56) + w.enumField(n, "renewal_period", string(v.RenewalPeriod), enumValues57) +} + +func enumServingTelemetryConfig(w *walker, n *node, v *serving.TelemetryConfig) { + if v == nil { + v = &serving.TelemetryConfig{} + } + if len(v.EnabledTelemetryFeatures) > 0 { + c := n.child("enabled_telemetry_features") + for i0 := range v.EnabledTelemetryFeatures { + e := c.elem(i0) + w.enumElem(&e, string(v.EnabledTelemetryFeatures[i0]), enumValues58) + } + } +} + +func enumResourcesMlflowModelPermission(w *walker, n *node, v *resources.MlflowModelPermission) { + if v == nil { + v = &resources.MlflowModelPermission{} + } + w.enumField(n, "level", string(v.Level), enumValues59) +} + +func enumPipelinesPipelineCluster(w *walker, n *node, v *pipelines.PipelineCluster) { + if v == nil { + v = &pipelines.PipelineCluster{} + } + if c := n.child("autoscale"); c.exists() { + enumPipelinesPipelineClusterAutoscale(w, &c, v.Autoscale) + } + if c := n.child("aws_attributes"); c.exists() { + enumComputeAwsAttributes(w, &c, v.AwsAttributes) + } + if c := n.child("azure_attributes"); c.exists() { + enumComputeAzureAttributes(w, &c, v.AzureAttributes) + } + if c := n.child("gcp_attributes"); c.exists() { + enumComputeGcpAttributes(w, &c, v.GcpAttributes) + } +} + +func enumPipelinesPipelineDeployment(w *walker, n *node, v *pipelines.PipelineDeployment) { + if v == nil { + v = &pipelines.PipelineDeployment{} + } + w.enumField(n, "kind", string(v.Kind), enumValues60) +} + +func enumPipelinesIngestionPipelineDefinition(w *walker, n *node, v *pipelines.IngestionPipelineDefinition) { + if v == nil { + v = &pipelines.IngestionPipelineDefinition{} + } + w.enumField(n, "connector_type", string(v.ConnectorType), enumValues61) + if c := n.child("full_refresh_window"); c.exists() { + enumPipelinesOperationTimeWindow(w, &c, v.FullRefreshWindow) + } + if len(v.Objects) > 0 { + c := n.child("objects") + for i0 := range v.Objects { + e := c.elem(i0) + enumPipelinesIngestionConfig(w, &e, &v.Objects[i0]) + } + } + w.enumField(n, "source_type", string(v.SourceType), enumValues62) + if c := n.child("table_configuration"); c.exists() { + enumPipelinesTableSpecificConfig(w, &c, v.TableConfiguration) + } +} + +func enumResourcesPipelinePermission(w *walker, n *node, v *resources.PipelinePermission) { + if v == nil { + v = &resources.PipelinePermission{} + } + w.enumField(n, "level", string(v.Level), enumValues63) +} + +func enumPipelinesRestartWindow(w *walker, n *node, v *pipelines.RestartWindow) { + if v == nil { + v = &pipelines.RestartWindow{} + } + if len(v.DaysOfWeek) > 0 { + c := n.child("days_of_week") + for i0 := range v.DaysOfWeek { + e := c.elem(i0) + w.enumElem(&e, string(v.DaysOfWeek[i0]), enumValues64) + } + } +} + +func enumPostgresScheduleCadence(w *walker, n *node, v *postgres.ScheduleCadence) { + if v == nil { + v = &postgres.ScheduleCadence{} + } + if c := n.child("weekly_schedule"); c.exists() { + enumPostgresWeeklySchedule(w, &c, v.WeeklySchedule) + } +} + +func enumPostgresSyncedTableSyncedTableSpecExtraColumn(w *walker, n *node, v *postgres.SyncedTableSyncedTableSpecExtraColumn) { + if v == nil { + v = &postgres.SyncedTableSyncedTableSpecExtraColumn{} + } + w.enumField(n, "maintenance", string(v.Maintenance), enumValues65) +} + +func enumPostgresNewPipelineSpec(w *walker, n *node, v *postgres.NewPipelineSpec) { + if v == nil { + v = &postgres.NewPipelineSpec{} + } + w.enumField(n, "pipeline_channel", string(v.PipelineChannel), enumValues66) +} + +func enumPostgresSyncedTableSyncedTableSpecTypeOverride(w *walker, n *node, v *postgres.SyncedTableSyncedTableSpecTypeOverride) { + if v == nil { + v = &postgres.SyncedTableSyncedTableSpecTypeOverride{} + } + w.enumField(n, "pg_type", string(v.PgType), enumValues67) +} + +func enumCatalogMonitorMetric(w *walker, n *node, v *catalog.MonitorMetric) { + if v == nil { + v = &catalog.MonitorMetric{} + } + w.enumField(n, "type", string(v.Type), enumValues68) +} + +func enumCatalogMonitorInferenceLog(w *walker, n *node, v *catalog.MonitorInferenceLog) { + if v == nil { + v = &catalog.MonitorInferenceLog{} + } + w.enumField(n, "problem_type", string(v.ProblemType), enumValues69) +} + +func enumCatalogMonitorCronSchedule(w *walker, n *node, v *catalog.MonitorCronSchedule) { + if v == nil { + v = &catalog.MonitorCronSchedule{} + } + w.enumField(n, "pause_status", string(v.PauseStatus), enumValues70) +} + +func enumResourcesSecretScopePermission(w *walker, n *node, v *resources.SecretScopePermission) { + if v == nil { + v = &resources.SecretScopePermission{} + } + w.enumField(n, "level", string(v.Level), enumValues71) +} + +func enumSqlChannel(w *walker, n *node, v *sql.Channel) { + if v == nil { + v = &sql.Channel{} + } + w.enumField(n, "name", string(v.Name), enumValues72) +} + +func enumResourcesSqlWarehousePermission(w *walker, n *node, v *resources.SqlWarehousePermission) { + if v == nil { + v = &resources.SqlWarehousePermission{} + } + w.enumField(n, "level", string(v.Level), enumValues73) +} + +func enumDatabaseSyncedTableStatus(w *walker, n *node, v *database.SyncedTableStatus) { + if v == nil { + v = &database.SyncedTableStatus{} + } + if c := n.child("continuous_update_status"); c.exists() { + enumDatabaseSyncedTableContinuousUpdateStatus(w, &c, v.ContinuousUpdateStatus) + } + w.enumField(n, "detailed_state", string(v.DetailedState), enumValues74) + if c := n.child("provisioning_status"); c.exists() { + enumDatabaseSyncedTableProvisioningStatus(w, &c, v.ProvisioningStatus) + } + if c := n.child("triggered_update_status"); c.exists() { + enumDatabaseSyncedTableTriggeredUpdateStatus(w, &c, v.TriggeredUpdateStatus) + } +} + +func enumDatabaseSyncedTableSpec(w *walker, n *node, v *database.SyncedTableSpec) { + if v == nil { + v = &database.SyncedTableSpec{} + } + w.enumField(n, "scheduling_policy", string(v.SchedulingPolicy), enumValues20) + if len(v.TypeOverrides) > 0 { + c := n.child("type_overrides") + for i0 := range v.TypeOverrides { + e := c.elem(i0) + enumDatabaseSyncedTableSpecTypeOverride(w, &e, &v.TypeOverrides[i0]) + } + } +} + +func enumResourcesVectorSearchEndpointPermission(w *walker, n *node, v *resources.VectorSearchEndpointPermission) { + if v == nil { + v = &resources.VectorSearchEndpointPermission{} + } + w.enumField(n, "level", string(v.Level), enumValues75) +} + +func enumVectorsearchDeltaSyncVectorIndexSpecRequest(w *walker, n *node, v *vectorsearch.DeltaSyncVectorIndexSpecRequest) { + if v == nil { + v = &vectorsearch.DeltaSyncVectorIndexSpecRequest{} + } + w.enumField(n, "pipeline_type", string(v.PipelineType), enumValues76) +} + +func enumSqlAlertV2OperandColumn(w *walker, n *node, v *sql.AlertV2OperandColumn) { + if v == nil { + v = &sql.AlertV2OperandColumn{} + } + w.enumField(n, "aggregation", string(v.Aggregation), enumValues77) +} + +func enumSqlAlertV2Operand(w *walker, n *node, v *sql.AlertV2Operand) { + if v == nil { + v = &sql.AlertV2Operand{} + } + if c := n.child("column"); c.exists() { + enumSqlAlertV2OperandColumn2(w, &c, v.Column) + } +} + +func enumAppsAppDeploymentStatus(w *walker, n *node, v *apps.AppDeploymentStatus) { + if v == nil { + v = &apps.AppDeploymentStatus{} + } + w.enumField(n, "state", string(v.State), enumValues78) +} + +func enumAppsAppResourceApp(w *walker, n *node, v *apps.AppResourceApp) { + if v == nil { + v = &apps.AppResourceApp{} + } + w.enumField(n, "permission", string(v.Permission), enumValues37) +} + +func enumAppsAppResourceDatabase(w *walker, n *node, v *apps.AppResourceDatabase) { + if v == nil { + v = &apps.AppResourceDatabase{} + } + w.enumField(n, "permission", string(v.Permission), enumValues79) +} + +func enumAppsAppResourceExperiment(w *walker, n *node, v *apps.AppResourceExperiment) { + if v == nil { + v = &apps.AppResourceExperiment{} + } + w.enumField(n, "permission", string(v.Permission), enumValues44) +} + +func enumAppsAppResourceGenieSpace(w *walker, n *node, v *apps.AppResourceGenieSpace) { + if v == nil { + v = &apps.AppResourceGenieSpace{} + } + w.enumField(n, "permission", string(v.Permission), enumValues80) +} + +func enumAppsAppResourceJob(w *walker, n *node, v *apps.AppResourceJob) { + if v == nil { + v = &apps.AppResourceJob{} + } + w.enumField(n, "permission", string(v.Permission), enumValues52) +} + +func enumAppsAppResourcePostgres(w *walker, n *node, v *apps.AppResourcePostgres) { + if v == nil { + v = &apps.AppResourcePostgres{} + } + w.enumField(n, "permission", string(v.Permission), enumValues79) +} + +func enumAppsAppResourceSecret(w *walker, n *node, v *apps.AppResourceSecret) { + if v == nil { + v = &apps.AppResourceSecret{} + } + w.enumField(n, "permission", string(v.Permission), enumValues81) +} + +func enumAppsAppResourceServingEndpoint(w *walker, n *node, v *apps.AppResourceServingEndpoint) { + if v == nil { + v = &apps.AppResourceServingEndpoint{} + } + w.enumField(n, "permission", string(v.Permission), enumValues55) +} + +func enumAppsAppResourceSqlWarehouse(w *walker, n *node, v *apps.AppResourceSqlWarehouse) { + if v == nil { + v = &apps.AppResourceSqlWarehouse{} + } + w.enumField(n, "permission", string(v.Permission), enumValues82) +} + +func enumAppsAppResourceUcSecurable(w *walker, n *node, v *apps.AppResourceUcSecurable) { + if v == nil { + v = &apps.AppResourceUcSecurable{} + } + w.enumField(n, "permission", string(v.Permission), enumValues83) + w.enumField(n, "securable_type", string(v.SecurableType), enumValues84) +} + +func enumCatalogSseEncryptionDetails(w *walker, n *node, v *catalog.SseEncryptionDetails) { + if v == nil { + v = &catalog.SseEncryptionDetails{} + } + w.enumField(n, "algorithm", string(v.Algorithm), enumValues85) +} + +func enumMlRequestSource(w *walker, n *node, v *ml.RequestSource) { + if v == nil { + v = &ml.RequestSource{} + } + if c := n.child("flat_schema"); c.exists() { + enumMlFlatSchema(w, &c, v.FlatSchema) + } +} + +func enumComputeDiskType(w *walker, n *node, v *compute.DiskType) { + if v == nil { + v = &compute.DiskType{} + } + w.enumField(n, "azure_disk_volume_type", string(v.AzureDiskVolumeType), enumValues86) + w.enumField(n, "ebs_volume_type", string(v.EbsVolumeType), enumValues39) +} + +func enumJobsMaintenanceWindow(w *walker, n *node, v *jobs.MaintenanceWindow) { + if v == nil { + v = &jobs.MaintenanceWindow{} + } + w.enumField(n, "day_of_week", string(v.DayOfWeek), enumValues64) +} + +func enumJobsJobSource(w *walker, n *node, v *jobs.JobSource) { + if v == nil { + v = &jobs.JobSource{} + } + w.enumField(n, "dirty_state", string(v.DirtyState), enumValues87) +} + +func enumJobsJobsHealthRule(w *walker, n *node, v *jobs.JobsHealthRule) { + if v == nil { + v = &jobs.JobsHealthRule{} + } + w.enumField(n, "metric", string(v.Metric), enumValues88) + w.enumField(n, "op", string(v.Op), enumValues89) +} + +func enumComputeClusterSpec(w *walker, n *node, v *compute.ClusterSpec) { + if v == nil { + v = &compute.ClusterSpec{} + } + if c := n.child("aws_attributes"); c.exists() { + enumComputeAwsAttributes(w, &c, v.AwsAttributes) + } + if c := n.child("azure_attributes"); c.exists() { + enumComputeAzureAttributes(w, &c, v.AzureAttributes) + } + w.enumField(n, "data_security_mode", string(v.DataSecurityMode), enumValues7) + w.enumField(n, "dependency_mode", string(v.DependencyMode), enumValues8) + if c := n.child("gcp_attributes"); c.exists() { + enumComputeGcpAttributes(w, &c, v.GcpAttributes) + } + w.enumField(n, "kind", string(v.Kind), enumValues9) + w.enumField(n, "runtime_engine", string(v.RuntimeEngine), enumValues10) +} + +func enumJobsSqlConditionConfiguration(w *walker, n *node, v *jobs.SqlConditionConfiguration) { + if v == nil { + v = &jobs.SqlConditionConfiguration{} + } + w.enumField(n, "trigger_mode", string(v.TriggerMode), enumValues90) +} + +func enumJobsAiRuntimeTask(w *walker, n *node, v *jobs.AiRuntimeTask) { + if v == nil { + v = &jobs.AiRuntimeTask{} + } + if len(v.Deployments) > 0 { + c := n.child("deployments") + for i0 := range v.Deployments { + e := c.elem(i0) + enumJobsDeploymentSpec(w, &e, &v.Deployments[i0]) + } + } + w.enumField(n, "priority_class", string(v.PriorityClass), enumValues91) +} + +func enumJobsCompute(w *walker, n *node, v *jobs.Compute) { + if v == nil { + v = &jobs.Compute{} + } + w.enumField(n, "hardware_accelerator", string(v.HardwareAccelerator), enumValues92) +} + +func enumJobsConditionTask(w *walker, n *node, v *jobs.ConditionTask) { + if v == nil { + v = &jobs.ConditionTask{} + } + w.enumField(n, "op", string(v.Op), enumValues93) +} + +func enumJobsDbtTask(w *walker, n *node, v *jobs.DbtTask) { + if v == nil { + v = &jobs.DbtTask{} + } + w.enumField(n, "source", string(v.Source), enumValues94) +} + +func enumJobsForEachTask(w *walker, n *node, v *jobs.ForEachTask) { + if v == nil { + v = &jobs.ForEachTask{} + } + if c := n.child("task"); c.exists() { + enumJobsTask2(w, &c, &v.Task) + } +} + +func enumJobsGenAiComputeTask(w *walker, n *node, v *jobs.GenAiComputeTask) { + if v == nil { + v = &jobs.GenAiComputeTask{} + } + w.enumField(n, "source", string(v.Source), enumValues94) +} + +func enumJobsNotebookTask(w *walker, n *node, v *jobs.NotebookTask) { + if v == nil { + v = &jobs.NotebookTask{} + } + w.enumField(n, "source", string(v.Source), enumValues94) +} + +func enumJobsPowerBiTask(w *walker, n *node, v *jobs.PowerBiTask) { + if v == nil { + v = &jobs.PowerBiTask{} + } + if c := n.child("power_bi_model"); c.exists() { + enumJobsPowerBiModel(w, &c, v.PowerBiModel) + } + if len(v.Tables) > 0 { + c := n.child("tables") + for i0 := range v.Tables { + e := c.elem(i0) + enumJobsPowerBiTable(w, &e, &v.Tables[i0]) + } + } +} + +func enumJobsSparkPythonTask(w *walker, n *node, v *jobs.SparkPythonTask) { + if v == nil { + v = &jobs.SparkPythonTask{} + } + w.enumField(n, "source", string(v.Source), enumValues94) +} + +func enumJobsSqlTask(w *walker, n *node, v *jobs.SqlTask) { + if v == nil { + v = &jobs.SqlTask{} + } + if c := n.child("file"); c.exists() { + enumJobsSqlTaskFile(w, &c, v.File) + } +} + +func enumJobsModelTriggerConfiguration(w *walker, n *node, v *jobs.ModelTriggerConfiguration) { + if v == nil { + v = &jobs.ModelTriggerConfiguration{} + } + w.enumField(n, "condition", string(v.Condition), enumValues95) +} + +func enumJobsPeriodicTriggerConfiguration(w *walker, n *node, v *jobs.PeriodicTriggerConfiguration) { + if v == nil { + v = &jobs.PeriodicTriggerConfiguration{} + } + w.enumField(n, "unit", string(v.Unit), enumValues96) +} + +func enumJobsTableUpdateTriggerConfiguration(w *walker, n *node, v *jobs.TableUpdateTriggerConfiguration) { + if v == nil { + v = &jobs.TableUpdateTriggerConfiguration{} + } + w.enumField(n, "condition", string(v.Condition), enumValues97) +} + +func enumJobsContinuousTriggerConfiguration(w *walker, n *node, v *jobs.ContinuousTriggerConfiguration) { + if v == nil { + v = &jobs.ContinuousTriggerConfiguration{} + } + if c := n.child("maintenance_window"); c.exists() { + enumJobsMaintenanceWindow(w, &c, v.MaintenanceWindow) + } + w.enumField(n, "task_retry_mode", string(v.TaskRetryMode), enumValues49) +} + +func enumCatalogRateLimit(w *walker, n *node, v *catalog.RateLimit) { + if v == nil { + v = &catalog.RateLimit{} + } + w.enumField(n, "key", string(v.Key), enumValues98) + w.enumField(n, "renewal_period", string(v.RenewalPeriod), enumValues99) +} + +func enumCatalogModelServiceConfigRoutingConfig(w *walker, n *node, v *catalog.ModelServiceConfigRoutingConfig) { + if v == nil { + v = &catalog.ModelServiceConfigRoutingConfig{} + } + if len(v.Destinations) > 0 { + c := n.child("destinations") + for i0 := range v.Destinations { + e := c.elem(i0) + enumCatalogModelServiceConfigDestinationConfig(w, &e, &v.Destinations[i0]) + } + } + if c := n.child("fallback"); c.exists() { + enumCatalogModelServiceConfigFallbackConfig(w, &c, v.Fallback) + } +} + +func enumServingAiGatewayGuardrails(w *walker, n *node, v *serving.AiGatewayGuardrails) { + if v == nil { + v = &serving.AiGatewayGuardrails{} + } + if c := n.child("input"); c.exists() { + enumServingAiGatewayGuardrailParameters(w, &c, v.Input) + } + if c := n.child("output"); c.exists() { + enumServingAiGatewayGuardrailParameters(w, &c, v.Output) + } +} + +func enumServingAiGatewayRateLimit(w *walker, n *node, v *serving.AiGatewayRateLimit) { + if v == nil { + v = &serving.AiGatewayRateLimit{} + } + w.enumField(n, "key", string(v.Key), enumValues100) + w.enumField(n, "renewal_period", string(v.RenewalPeriod), enumValues57) +} + +func enumServingServedEntityInput(w *walker, n *node, v *serving.ServedEntityInput) { + if v == nil { + v = &serving.ServedEntityInput{} + } + if c := n.child("external_model"); c.exists() { + enumServingExternalModel(w, &c, v.ExternalModel) + } + w.enumField(n, "workload_type", string(v.WorkloadType), enumValues101) +} + +func enumServingServedModelInput(w *walker, n *node, v *serving.ServedModelInput) { + if v == nil { + v = &serving.ServedModelInput{} + } + w.enumField(n, "workload_type", string(v.WorkloadType), enumValues101) +} + +func enumPipelinesPipelineClusterAutoscale(w *walker, n *node, v *pipelines.PipelineClusterAutoscale) { + if v == nil { + v = &pipelines.PipelineClusterAutoscale{} + } + w.enumField(n, "mode", string(v.Mode), enumValues102) +} + +func enumPipelinesOperationTimeWindow(w *walker, n *node, v *pipelines.OperationTimeWindow) { + if v == nil { + v = &pipelines.OperationTimeWindow{} + } + if len(v.DaysOfWeek) > 0 { + c := n.child("days_of_week") + for i0 := range v.DaysOfWeek { + e := c.elem(i0) + w.enumElem(&e, string(v.DaysOfWeek[i0]), enumValues64) + } + } +} + +func enumPipelinesIngestionConfig(w *walker, n *node, v *pipelines.IngestionConfig) { + if v == nil { + v = &pipelines.IngestionConfig{} + } + if c := n.child("report"); c.exists() { + enumPipelinesReportSpec(w, &c, v.Report) + } + if c := n.child("schema"); c.exists() { + enumPipelinesSchemaSpec(w, &c, v.Schema) + } + if c := n.child("table"); c.exists() { + enumPipelinesTableSpec(w, &c, v.Table) + } +} + +func enumPipelinesTableSpecificConfig(w *walker, n *node, v *pipelines.TableSpecificConfig) { + if v == nil { + v = &pipelines.TableSpecificConfig{} + } + w.enumField(n, "scd_type", string(v.ScdType), enumValues103) +} + +func enumPostgresWeeklySchedule(w *walker, n *node, v *postgres.WeeklySchedule) { + if v == nil { + v = &postgres.WeeklySchedule{} + } + w.enumField(n, "day_of_week", string(v.DayOfWeek), enumValues64) +} + +func enumDatabaseSyncedTableContinuousUpdateStatus(w *walker, n *node, v *database.SyncedTableContinuousUpdateStatus) { + if v == nil { + v = &database.SyncedTableContinuousUpdateStatus{} + } + if c := n.child("initial_pipeline_sync_progress"); c.exists() { + enumDatabaseSyncedTablePipelineProgress(w, &c, v.InitialPipelineSyncProgress) + } +} + +func enumDatabaseSyncedTableProvisioningStatus(w *walker, n *node, v *database.SyncedTableProvisioningStatus) { + if v == nil { + v = &database.SyncedTableProvisioningStatus{} + } + if c := n.child("initial_pipeline_sync_progress"); c.exists() { + enumDatabaseSyncedTablePipelineProgress(w, &c, v.InitialPipelineSyncProgress) + } +} + +func enumDatabaseSyncedTableTriggeredUpdateStatus(w *walker, n *node, v *database.SyncedTableTriggeredUpdateStatus) { + if v == nil { + v = &database.SyncedTableTriggeredUpdateStatus{} + } + if c := n.child("triggered_update_progress"); c.exists() { + enumDatabaseSyncedTablePipelineProgress(w, &c, v.TriggeredUpdateProgress) + } +} + +func enumDatabaseSyncedTableSpecTypeOverride(w *walker, n *node, v *database.SyncedTableSpecTypeOverride) { + if v == nil { + v = &database.SyncedTableSpecTypeOverride{} + } + w.enumField(n, "pg_type", string(v.PgType), enumValues67) +} + +func enumSqlAlertV2OperandColumn2(w *walker, n *node, v *sql.AlertV2OperandColumn) { + if v == nil { + v = &sql.AlertV2OperandColumn{} + } + w.enumField(n, "aggregation", string(v.Aggregation), enumValues77) +} + +func enumMlFlatSchema(w *walker, n *node, v *ml.FlatSchema) { + if v == nil { + v = &ml.FlatSchema{} + } + if len(v.Fields) > 0 { + c := n.child("fields") + for i0 := range v.Fields { + e := c.elem(i0) + enumMlFieldDefinition(w, &e, &v.Fields[i0]) + } + } +} + +func enumJobsDeploymentSpec(w *walker, n *node, v *jobs.DeploymentSpec) { + if v == nil { + v = &jobs.DeploymentSpec{} + } + if c := n.child("compute"); c.exists() { + enumJobsComputeSpec(w, &c, &v.Compute) + } +} + +func enumJobsTask2(w *walker, n *node, v *jobs.Task) { + if v == nil { + v = &jobs.Task{} + } + if c := n.child("ai_runtime_task"); c.exists() { + enumJobsAiRuntimeTask(w, &c, v.AiRuntimeTask) + } + if c := n.child("compute"); c.exists() { + enumJobsCompute(w, &c, v.Compute) + } + if c := n.child("condition_task"); c.exists() { + enumJobsConditionTask(w, &c, v.ConditionTask) + } + if c := n.child("dbt_task"); c.exists() { + enumJobsDbtTask(w, &c, v.DbtTask) + } + if c := n.child("gen_ai_compute_task"); c.exists() { + enumJobsGenAiComputeTask(w, &c, v.GenAiComputeTask) + } + if c := n.child("health"); c.exists() { + enumJobsJobsHealthRules(w, &c, v.Health) + } + if c := n.child("new_cluster"); c.exists() { + enumComputeClusterSpec(w, &c, v.NewCluster) + } + if c := n.child("notebook_task"); c.exists() { + enumJobsNotebookTask(w, &c, v.NotebookTask) + } + if c := n.child("power_bi_task"); c.exists() { + enumJobsPowerBiTask(w, &c, v.PowerBiTask) + } + w.enumField(n, "run_if", string(v.RunIf), enumValues53) + if c := n.child("spark_python_task"); c.exists() { + enumJobsSparkPythonTask(w, &c, v.SparkPythonTask) + } + if c := n.child("sql_task"); c.exists() { + enumJobsSqlTask(w, &c, v.SqlTask) + } +} + +func enumJobsPowerBiModel(w *walker, n *node, v *jobs.PowerBiModel) { + if v == nil { + v = &jobs.PowerBiModel{} + } + w.enumField(n, "authentication_method", string(v.AuthenticationMethod), enumValues104) + w.enumField(n, "storage_mode", string(v.StorageMode), enumValues105) +} + +func enumJobsPowerBiTable(w *walker, n *node, v *jobs.PowerBiTable) { + if v == nil { + v = &jobs.PowerBiTable{} + } + w.enumField(n, "storage_mode", string(v.StorageMode), enumValues105) +} + +func enumJobsSqlTaskFile(w *walker, n *node, v *jobs.SqlTaskFile) { + if v == nil { + v = &jobs.SqlTaskFile{} + } + w.enumField(n, "source", string(v.Source), enumValues94) +} + +func enumCatalogModelServiceConfigDestinationConfig(w *walker, n *node, v *catalog.ModelServiceConfigDestinationConfig) { + if v == nil { + v = &catalog.ModelServiceConfigDestinationConfig{} + } + w.enumField(n, "destination_type", string(v.DestinationType), enumValues106) +} + +func enumCatalogModelServiceConfigFallbackConfig(w *walker, n *node, v *catalog.ModelServiceConfigFallbackConfig) { + if v == nil { + v = &catalog.ModelServiceConfigFallbackConfig{} + } + if len(v.Destinations) > 0 { + c := n.child("destinations") + for i0 := range v.Destinations { + e := c.elem(i0) + enumCatalogModelServiceConfigDestinationConfig(w, &e, &v.Destinations[i0]) + } + } +} + +func enumServingAiGatewayGuardrailParameters(w *walker, n *node, v *serving.AiGatewayGuardrailParameters) { + if v == nil { + v = &serving.AiGatewayGuardrailParameters{} + } + if c := n.child("pii"); c.exists() { + enumServingAiGatewayGuardrailPiiBehavior(w, &c, v.Pii) + } +} + +func enumServingExternalModel(w *walker, n *node, v *serving.ExternalModel) { + if v == nil { + v = &serving.ExternalModel{} + } + if c := n.child("amazon_bedrock_config"); c.exists() { + enumServingAmazonBedrockConfig(w, &c, v.AmazonBedrockConfig) + } + w.enumField(n, "provider", string(v.Provider), enumValues107) +} + +func enumPipelinesReportSpec(w *walker, n *node, v *pipelines.ReportSpec) { + if v == nil { + v = &pipelines.ReportSpec{} + } + if c := n.child("table_configuration"); c.exists() { + enumPipelinesTableSpecificConfig(w, &c, v.TableConfiguration) + } +} + +func enumPipelinesSchemaSpec(w *walker, n *node, v *pipelines.SchemaSpec) { + if v == nil { + v = &pipelines.SchemaSpec{} + } + if c := n.child("connector_options"); c.exists() { + enumPipelinesConnectorOptions(w, &c, v.ConnectorOptions) + } + if c := n.child("fanout_options"); c.exists() { + enumPipelinesIngestionPipelineDefinitionFanoutOptions(w, &c, v.FanoutOptions) + } + if c := n.child("table_configuration"); c.exists() { + enumPipelinesTableSpecificConfig(w, &c, v.TableConfiguration) + } +} + +func enumPipelinesTableSpec(w *walker, n *node, v *pipelines.TableSpec) { + if v == nil { + v = &pipelines.TableSpec{} + } + if c := n.child("connector_options"); c.exists() { + enumPipelinesConnectorOptions(w, &c, v.ConnectorOptions) + } + if c := n.child("table_configuration"); c.exists() { + enumPipelinesTableSpecificConfig(w, &c, v.TableConfiguration) + } +} + +func enumDatabaseSyncedTablePipelineProgress(w *walker, n *node, v *database.SyncedTablePipelineProgress) { + if v == nil { + v = &database.SyncedTablePipelineProgress{} + } + w.enumField(n, "provisioning_phase", string(v.ProvisioningPhase), enumValues108) +} + +func enumMlFieldDefinition(w *walker, n *node, v *ml.FieldDefinition) { + if v == nil { + v = &ml.FieldDefinition{} + } + w.enumField(n, "data_type", string(v.DataType), enumValues109) +} + +func enumJobsComputeSpec(w *walker, n *node, v *jobs.ComputeSpec) { + if v == nil { + v = &jobs.ComputeSpec{} + } + w.enumField(n, "accelerator_type", string(v.AcceleratorType), enumValues92) +} + +func enumServingAiGatewayGuardrailPiiBehavior(w *walker, n *node, v *serving.AiGatewayGuardrailPiiBehavior) { + if v == nil { + v = &serving.AiGatewayGuardrailPiiBehavior{} + } + w.enumField(n, "behavior", string(v.Behavior), enumValues110) +} + +func enumServingAmazonBedrockConfig(w *walker, n *node, v *serving.AmazonBedrockConfig) { + if v == nil { + v = &serving.AmazonBedrockConfig{} + } + w.enumField(n, "bedrock_provider", string(v.BedrockProvider), enumValues111) +} + +func enumPipelinesConnectorOptions(w *walker, n *node, v *pipelines.ConnectorOptions) { + if v == nil { + v = &pipelines.ConnectorOptions{} + } + if c := n.child("gdrive_options"); c.exists() { + enumPipelinesGoogleDriveOptions(w, &c, v.GdriveOptions) + } + if c := n.child("kafka_options"); c.exists() { + enumPipelinesKafkaOptions(w, &c, v.KafkaOptions) + } + if c := n.child("linkedin_ads_options"); c.exists() { + enumPipelinesLinkedInAdsOptions(w, &c, v.LinkedinAdsOptions) + } + if c := n.child("outlook_options"); c.exists() { + enumPipelinesOutlookOptions(w, &c, v.OutlookOptions) + } + if c := n.child("sharepoint_options"); c.exists() { + enumPipelinesSharepointOptions(w, &c, v.SharepointOptions) + } + if c := n.child("tiktok_ads_options"); c.exists() { + enumPipelinesTikTokAdsOptions(w, &c, v.TiktokAdsOptions) + } +} + +func enumPipelinesIngestionPipelineDefinitionFanoutOptions(w *walker, n *node, v *pipelines.IngestionPipelineDefinitionFanoutOptions) { + if v == nil { + v = &pipelines.IngestionPipelineDefinitionFanoutOptions{} + } + if len(v.Transforms) > 0 { + c := n.child("transforms") + for i0 := range v.Transforms { + e := c.elem(i0) + enumPipelinesTransformer(w, &e, &v.Transforms[i0]) + } + } +} + +func enumPipelinesGoogleDriveOptions(w *walker, n *node, v *pipelines.GoogleDriveOptions) { + if v == nil { + v = &pipelines.GoogleDriveOptions{} + } + w.enumField(n, "entity_type", string(v.EntityType), enumValues112) + if c := n.child("file_ingestion_options"); c.exists() { + enumPipelinesFileIngestionOptions(w, &c, v.FileIngestionOptions) + } +} + +func enumPipelinesKafkaOptions(w *walker, n *node, v *pipelines.KafkaOptions) { + if v == nil { + v = &pipelines.KafkaOptions{} + } + if c := n.child("key_transformer"); c.exists() { + enumPipelinesTransformer2(w, &c, v.KeyTransformer) + } + if c := n.child("value_transformer"); c.exists() { + enumPipelinesTransformer2(w, &c, v.ValueTransformer) + } +} + +func enumPipelinesLinkedInAdsOptions(w *walker, n *node, v *pipelines.LinkedInAdsOptions) { + if v == nil { + v = &pipelines.LinkedInAdsOptions{} + } + if c := n.child("custom_report_options"); c.exists() { + enumPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptions(w, &c, v.CustomReportOptions) + } +} + +func enumPipelinesOutlookOptions(w *walker, n *node, v *pipelines.OutlookOptions) { + if v == nil { + v = &pipelines.OutlookOptions{} + } + w.enumField(n, "attachment_mode", string(v.AttachmentMode), enumValues113) + w.enumField(n, "body_format", string(v.BodyFormat), enumValues114) +} + +func enumPipelinesSharepointOptions(w *walker, n *node, v *pipelines.SharepointOptions) { + if v == nil { + v = &pipelines.SharepointOptions{} + } + w.enumField(n, "entity_type", string(v.EntityType), enumValues115) + if c := n.child("file_ingestion_options"); c.exists() { + enumPipelinesFileIngestionOptions(w, &c, v.FileIngestionOptions) + } +} + +func enumPipelinesTikTokAdsOptions(w *walker, n *node, v *pipelines.TikTokAdsOptions) { + if v == nil { + v = &pipelines.TikTokAdsOptions{} + } + if c := n.child("custom_report_options"); c.exists() { + enumPipelinesTikTokAdsOptionsTikTokAdsCustomReportOptions(w, &c, v.CustomReportOptions) + } + w.enumField(n, "data_level", string(v.DataLevel), enumValues116) + w.enumField(n, "report_type", string(v.ReportType), enumValues117) +} + +func enumPipelinesTransformer(w *walker, n *node, v *pipelines.Transformer) { + if v == nil { + v = &pipelines.Transformer{} + } + if c := n.child("avro_options"); c.exists() { + enumPipelinesAvroTransformerOptions(w, &c, v.AvroOptions) + } + w.enumField(n, "format", string(v.Format), enumValues118) + if c := n.child("json_options"); c.exists() { + enumPipelinesJsonTransformerOptions(w, &c, v.JsonOptions) + } + if c := n.child("protobuf_options"); c.exists() { + enumPipelinesProtobufTransformerOptions(w, &c, v.ProtobufOptions) + } +} + +func enumPipelinesFileIngestionOptions(w *walker, n *node, v *pipelines.FileIngestionOptions) { + if v == nil { + v = &pipelines.FileIngestionOptions{} + } + w.enumField(n, "format", string(v.Format), enumValues119) + w.enumField(n, "schema_evolution_mode", string(v.SchemaEvolutionMode), enumValues120) +} + +func enumPipelinesTransformer2(w *walker, n *node, v *pipelines.Transformer) { + if v == nil { + v = &pipelines.Transformer{} + } + if c := n.child("avro_options"); c.exists() { + enumPipelinesAvroTransformerOptions(w, &c, v.AvroOptions) + } + w.enumField(n, "format", string(v.Format), enumValues118) + if c := n.child("json_options"); c.exists() { + enumPipelinesJsonTransformerOptions(w, &c, v.JsonOptions) + } + if c := n.child("protobuf_options"); c.exists() { + enumPipelinesProtobufTransformerOptions(w, &c, v.ProtobufOptions) + } +} + +func enumPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptions(w *walker, n *node, v *pipelines.LinkedInAdsOptionsLinkedInAdsCustomReportOptions) { + if v == nil { + v = &pipelines.LinkedInAdsOptionsLinkedInAdsCustomReportOptions{} + } + if len(v.EntityGranularity) > 0 { + c := n.child("entity_granularity") + for i0 := range v.EntityGranularity { + e := c.elem(i0) + w.enumElem(&e, string(v.EntityGranularity[i0]), enumValues121) + } + } + w.enumField(n, "finder", string(v.Finder), enumValues122) + w.enumField(n, "time_granularity", string(v.TimeGranularity), enumValues123) +} + +func enumPipelinesTikTokAdsOptionsTikTokAdsCustomReportOptions(w *walker, n *node, v *pipelines.TikTokAdsOptionsTikTokAdsCustomReportOptions) { + if v == nil { + v = &pipelines.TikTokAdsOptionsTikTokAdsCustomReportOptions{} + } + w.enumField(n, "data_level", string(v.DataLevel), enumValues116) + w.enumField(n, "report_type", string(v.ReportType), enumValues117) +} + +func enumPipelinesAvroTransformerOptions(w *walker, n *node, v *pipelines.AvroTransformerOptions) { + if v == nil { + v = &pipelines.AvroTransformerOptions{} + } + w.enumField(n, "parse_mode", string(v.ParseMode), enumValues124) +} + +func enumPipelinesJsonTransformerOptions(w *walker, n *node, v *pipelines.JsonTransformerOptions) { + if v == nil { + v = &pipelines.JsonTransformerOptions{} + } + w.enumField(n, "schema_evolution_mode", string(v.SchemaEvolutionMode), enumValues120) +} + +func enumPipelinesProtobufTransformerOptions(w *walker, n *node, v *pipelines.ProtobufTransformerOptions) { + if v == nil { + v = &pipelines.ProtobufTransformerOptions{} + } + w.enumField(n, "parse_mode", string(v.ParseMode), enumValues124) +} diff --git a/bundle/config/validate/required.go b/bundle/config/validate/required.go index 9e3274b6f00..d8892de4f6b 100644 --- a/bundle/config/validate/required.go +++ b/bundle/config/validate/required.go @@ -8,7 +8,6 @@ import ( "strings" "github.com/databricks/cli/bundle" - "github.com/databricks/cli/bundle/internal/validation/generated" "github.com/databricks/cli/libs/diag" "github.com/databricks/cli/libs/dyn" "github.com/databricks/cli/libs/structs/structpath" @@ -25,52 +24,15 @@ func (f *required) Name() string { } // Warn for missing fields, based on annotations in the Go SDK / OpenAPI spec. +// The walker is generated (required_walk.go) by bundle/internal/validation. func warnForMissingFields(ctx context.Context, b *bundle.Bundle) diag.Diagnostics { - diags := diag.Diagnostics{} - - // Generate prefix tree for all required fields. - trie := &dyn.TrieNode{} - for k := range generated.RequiredFields { - pattern, err := dyn.NewPatternFromString(k) - if err != nil { - return diag.FromErr(fmt.Errorf("invalid pattern %q for required field validation: %w", k, err)) - } + w := &walker{diags: diag.Diagnostics{}} + n := rootNode(b.Config.Value()) + requiredConfigRoot(w, &n, &b.Config) - err = trie.Insert(pattern) - if err != nil { - return diag.FromErr(fmt.Errorf("failed to insert pattern %q into trie: %w", k, err)) - } - } + sortDiagnostics(w.diags) - err := dyn.WalkReadOnly(b.Config.Value(), func(p dyn.Path, v dyn.Value) error { - // If the path is not found in the prefix tree, we do not need to validate any required - // fields in it. - pattern, ok := trie.SearchPath(p) - if !ok { - return nil - } - - fields := generated.RequiredFields[pattern.String()] - for _, field := range fields { - vv := v.Get(field) - if vv.Kind() == dyn.KindInvalid || vv.Kind() == dyn.KindNil { - diags = diags.Append(diag.Diagnostic{ - Severity: diag.Warning, - Summary: fmt.Sprintf("required field %q is not set", field), - Locations: v.Locations(), - Paths: dyn.ToStructPaths(p), - }) - } - } - return nil - }) - if err != nil { - return diag.FromErr(err) - } - - sortDiagnostics(diags) - - return diags + return w.diags } // sortDiagnostics orders diagnostics deterministically, since they are collected diff --git a/bundle/config/validate/required_walk.go b/bundle/config/validate/required_walk.go new file mode 100644 index 00000000000..14b5850d23b --- /dev/null +++ b/bundle/config/validate/required_walk.go @@ -0,0 +1,4046 @@ +// Code generated by bundle/internal/validation. DO NOT EDIT. + +// requiredConfigRoot reports the required fields that are not set. + +package validate + +import ( + "github.com/databricks/cli/bundle/config" + "github.com/databricks/cli/bundle/config/resources" + "github.com/databricks/databricks-sdk-go/service/apps" + "github.com/databricks/databricks-sdk-go/service/catalog" + "github.com/databricks/databricks-sdk-go/service/compute" + "github.com/databricks/databricks-sdk-go/service/database" + "github.com/databricks/databricks-sdk-go/service/jobs" + "github.com/databricks/databricks-sdk-go/service/ml" + "github.com/databricks/databricks-sdk-go/service/pipelines" + "github.com/databricks/databricks-sdk-go/service/postgres" + "github.com/databricks/databricks-sdk-go/service/serving" + "github.com/databricks/databricks-sdk-go/service/sql" + "github.com/databricks/databricks-sdk-go/service/workspace" +) + +func requiredConfigRoot(w *walker, n *node, v *config.Root) { + if v == nil { + v = &config.Root{} + } + if len(v.Artifacts) > 0 { + c := n.child("artifacts") + for k0, x0 := range v.Artifacts { + e := c.child(k0) + requiredConfigArtifact(w, &e, x0) + } + } + if c := n.child("bundle"); c.exists() { + requiredConfigBundle(w, &c, &v.Bundle) + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesPermission(w, &e, &v.Permissions[i0]) + } + } + if c := n.child("resources"); c.exists() { + requiredConfigResources(w, &c, &v.Resources) + } + if len(v.Scripts) > 0 { + c := n.child("scripts") + for k0, x0 := range v.Scripts { + e := c.child(k0) + requiredConfigScript(w, &e, &x0) + } + } +} + +func requiredConfigArtifact(w *walker, n *node, v *config.Artifact) { + if v == nil { + v = &config.Artifact{} + } + if len(v.Files) > 0 { + c := n.child("files") + for i0 := range v.Files { + e := c.elem(i0) + requiredConfigArtifactFile(w, &e, &v.Files[i0]) + } + } +} + +func requiredConfigBundle(w *walker, n *node, v *config.Bundle) { + if v == nil { + v = &config.Bundle{} + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } +} + +func requiredResourcesPermission(w *walker, n *node, v *resources.Permission) { + if v == nil { + v = &resources.Permission{} + } + if !(v.Level != "") && !n.has("level") { + w.missing(n, "level") + } +} + +func requiredConfigResources(w *walker, n *node, v *config.Resources) { + if v == nil { + v = &config.Resources{} + } + if len(v.Alerts) > 0 { + c := n.child("alerts") + for k0, x0 := range v.Alerts { + e := c.child(k0) + requiredResourcesAlert(w, &e, x0) + } + } + if len(v.Apps) > 0 { + c := n.child("apps") + for k0, x0 := range v.Apps { + e := c.child(k0) + requiredResourcesApp(w, &e, x0) + } + } + if len(v.Catalogs) > 0 { + c := n.child("catalogs") + for k0, x0 := range v.Catalogs { + e := c.child(k0) + requiredResourcesCatalog(w, &e, x0) + } + } + if len(v.ClusterPolicies) > 0 { + c := n.child("cluster_policies") + for k0, x0 := range v.ClusterPolicies { + e := c.child(k0) + requiredResourcesClusterPolicy(w, &e, x0) + } + } + if len(v.Clusters) > 0 { + c := n.child("clusters") + for k0, x0 := range v.Clusters { + e := c.child(k0) + requiredResourcesCluster(w, &e, x0) + } + } + if len(v.Dashboards) > 0 { + c := n.child("dashboards") + for k0, x0 := range v.Dashboards { + e := c.child(k0) + requiredResourcesDashboard(w, &e, x0) + } + } + if len(v.DatabaseCatalogs) > 0 { + c := n.child("database_catalogs") + for k0, x0 := range v.DatabaseCatalogs { + e := c.child(k0) + requiredResourcesDatabaseCatalog(w, &e, x0) + } + } + if len(v.DatabaseInstances) > 0 { + c := n.child("database_instances") + for k0, x0 := range v.DatabaseInstances { + e := c.child(k0) + requiredResourcesDatabaseInstance(w, &e, x0) + } + } + if len(v.Experiments) > 0 { + c := n.child("experiments") + for k0, x0 := range v.Experiments { + e := c.child(k0) + requiredResourcesMlflowExperiment(w, &e, x0) + } + } + if len(v.ExternalLocations) > 0 { + c := n.child("external_locations") + for k0, x0 := range v.ExternalLocations { + e := c.child(k0) + requiredResourcesExternalLocation(w, &e, x0) + } + } + if len(v.Features) > 0 { + c := n.child("features") + for k0, x0 := range v.Features { + e := c.child(k0) + requiredResourcesFeature(w, &e, x0) + } + } + if len(v.GenieSpaces) > 0 { + c := n.child("genie_spaces") + for k0, x0 := range v.GenieSpaces { + e := c.child(k0) + requiredResourcesGenieSpace(w, &e, x0) + } + } + if len(v.InstancePools) > 0 { + c := n.child("instance_pools") + for k0, x0 := range v.InstancePools { + e := c.child(k0) + requiredResourcesInstancePool(w, &e, x0) + } + } + if len(v.JobRuns) > 0 { + c := n.child("job_runs") + for k0, x0 := range v.JobRuns { + e := c.child(k0) + requiredResourcesJobRun(w, &e, x0) + } + } + if len(v.Jobs) > 0 { + c := n.child("jobs") + for k0, x0 := range v.Jobs { + e := c.child(k0) + requiredResourcesJob(w, &e, x0) + } + } + if len(v.McpServices) > 0 { + c := n.child("mcp_services") + for k0, x0 := range v.McpServices { + e := c.child(k0) + requiredResourcesMcpService(w, &e, x0) + } + } + if len(v.ModelProviderServices) > 0 { + c := n.child("model_provider_services") + for k0, x0 := range v.ModelProviderServices { + e := c.child(k0) + requiredResourcesModelProviderService(w, &e, x0) + } + } + if len(v.ModelServices) > 0 { + c := n.child("model_services") + for k0, x0 := range v.ModelServices { + e := c.child(k0) + requiredResourcesModelService(w, &e, x0) + } + } + if len(v.ModelServingEndpoints) > 0 { + c := n.child("model_serving_endpoints") + for k0, x0 := range v.ModelServingEndpoints { + e := c.child(k0) + requiredResourcesModelServingEndpoint(w, &e, x0) + } + } + if len(v.Models) > 0 { + c := n.child("models") + for k0, x0 := range v.Models { + e := c.child(k0) + requiredResourcesMlflowModel(w, &e, x0) + } + } + if len(v.Pipelines) > 0 { + c := n.child("pipelines") + for k0, x0 := range v.Pipelines { + e := c.child(k0) + requiredResourcesPipeline(w, &e, x0) + } + } + if len(v.PostgresBranches) > 0 { + c := n.child("postgres_branches") + for k0, x0 := range v.PostgresBranches { + e := c.child(k0) + requiredResourcesPostgresBranch(w, &e, x0) + } + } + if len(v.PostgresCatalogs) > 0 { + c := n.child("postgres_catalogs") + for k0, x0 := range v.PostgresCatalogs { + e := c.child(k0) + requiredResourcesPostgresCatalog(w, &e, x0) + } + } + if len(v.PostgresDatabases) > 0 { + c := n.child("postgres_databases") + for k0, x0 := range v.PostgresDatabases { + e := c.child(k0) + requiredResourcesPostgresDatabase(w, &e, x0) + } + } + if len(v.PostgresEndpoints) > 0 { + c := n.child("postgres_endpoints") + for k0, x0 := range v.PostgresEndpoints { + e := c.child(k0) + requiredResourcesPostgresEndpoint(w, &e, x0) + } + } + if len(v.PostgresProjects) > 0 { + c := n.child("postgres_projects") + for k0, x0 := range v.PostgresProjects { + e := c.child(k0) + requiredResourcesPostgresProject(w, &e, x0) + } + } + if len(v.PostgresRoles) > 0 { + c := n.child("postgres_roles") + for k0, x0 := range v.PostgresRoles { + e := c.child(k0) + requiredResourcesPostgresRole(w, &e, x0) + } + } + if len(v.PostgresSnapshotSchedules) > 0 { + c := n.child("postgres_snapshot_schedules") + for k0, x0 := range v.PostgresSnapshotSchedules { + e := c.child(k0) + requiredResourcesPostgresSnapshotSchedule(w, &e, x0) + } + } + if len(v.PostgresSyncedTables) > 0 { + c := n.child("postgres_synced_tables") + for k0, x0 := range v.PostgresSyncedTables { + e := c.child(k0) + requiredResourcesPostgresSyncedTable(w, &e, x0) + } + } + if len(v.QualityMonitors) > 0 { + c := n.child("quality_monitors") + for k0, x0 := range v.QualityMonitors { + e := c.child(k0) + requiredResourcesQualityMonitor(w, &e, x0) + } + } + if len(v.Schemas) > 0 { + c := n.child("schemas") + for k0, x0 := range v.Schemas { + e := c.child(k0) + requiredResourcesSchema(w, &e, x0) + } + } + if len(v.SecretScopes) > 0 { + c := n.child("secret_scopes") + for k0, x0 := range v.SecretScopes { + e := c.child(k0) + requiredResourcesSecretScope(w, &e, x0) + } + } + if len(v.Secrets) > 0 { + c := n.child("secrets") + for k0, x0 := range v.Secrets { + e := c.child(k0) + requiredResourcesSecret(w, &e, x0) + } + } + if len(v.SqlWarehouses) > 0 { + c := n.child("sql_warehouses") + for k0, x0 := range v.SqlWarehouses { + e := c.child(k0) + requiredResourcesSqlWarehouse(w, &e, x0) + } + } + if len(v.SyncedDatabaseTables) > 0 { + c := n.child("synced_database_tables") + for k0, x0 := range v.SyncedDatabaseTables { + e := c.child(k0) + requiredResourcesSyncedDatabaseTable(w, &e, x0) + } + } + if len(v.VectorSearchEndpoints) > 0 { + c := n.child("vector_search_endpoints") + for k0, x0 := range v.VectorSearchEndpoints { + e := c.child(k0) + requiredResourcesVectorSearchEndpoint(w, &e, x0) + } + } + if len(v.VectorSearchIndexes) > 0 { + c := n.child("vector_search_indexes") + for k0, x0 := range v.VectorSearchIndexes { + e := c.child(k0) + requiredResourcesVectorSearchIndex(w, &e, x0) + } + } + if len(v.Volumes) > 0 { + c := n.child("volumes") + for k0, x0 := range v.Volumes { + e := c.child(k0) + requiredResourcesVolume(w, &e, x0) + } + } +} + +func requiredConfigScript(w *walker, n *node, v *config.Script) { + if v == nil { + v = &config.Script{} + } + if !(v.Content != "") && !n.has("content") { + w.missing(n, "content") + } +} + +func requiredConfigArtifactFile(w *walker, n *node, v *config.ArtifactFile) { + if v == nil { + v = &config.ArtifactFile{} + } + if !(v.Source != "") && !n.has("source") { + w.missing(n, "source") + } +} + +func requiredResourcesAlert(w *walker, n *node, v *resources.Alert) { + if v == nil { + v = &resources.Alert{} + } + if !(v.AlertV2.DisplayName != "") && !n.has("display_name") { + w.missing(n, "display_name") + } + if !n.has("evaluation") { + w.missing(n, "evaluation") + } + if !(v.AlertV2.QueryText != "") && !n.has("query_text") { + w.missing(n, "query_text") + } + if !n.has("schedule") { + w.missing(n, "schedule") + } + if !(v.AlertV2.WarehouseId != "") && !n.has("warehouse_id") { + w.missing(n, "warehouse_id") + } + if c := n.child("evaluation"); c.exists() { + requiredSqlAlertV2Evaluation(w, &c, &v.AlertV2.Evaluation) + } + if len(v.AlertV2.Parameters) > 0 { + c := n.child("parameters") + for i0 := range v.AlertV2.Parameters { + e := c.elem(i0) + requiredSqlAlertStatementParameter(w, &e, &v.AlertV2.Parameters[i0]) + } + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesPermission(w, &e, &v.Permissions[i0]) + } + } + if c := n.child("schedule"); c.exists() { + requiredSqlCronSchedule(w, &c, &v.AlertV2.Schedule) + } +} + +func requiredResourcesApp(w *walker, n *node, v *resources.App) { + if v == nil { + v = &resources.App{} + } + if !(v.App.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if c := n.child("active_deployment"); c.exists() { + requiredAppsAppDeployment(w, &c, v.App.ActiveDeployment) + } + if c := n.child("config"); c.exists() { + requiredResourcesAppConfig(w, &c, v.Config) + } + if c := n.child("default_git_source"); c.exists() { + requiredAppsGitSource(w, &c, v.App.DefaultGitSource) + } + if c := n.child("git_repository"); c.exists() { + requiredAppsGitRepository(w, &c, v.App.GitRepository) + } + if c := n.child("git_source"); c.exists() { + requiredAppsGitSource(w, &c, v.App.GitSource) + } + if c := n.child("pending_deployment"); c.exists() { + requiredAppsAppDeployment(w, &c, v.App.PendingDeployment) + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesAppPermission(w, &e, &v.Permissions[i0]) + } + } + if len(v.App.Resources) > 0 { + c := n.child("resources") + for i0 := range v.App.Resources { + e := c.elem(i0) + requiredAppsAppResource(w, &e, &v.App.Resources[i0]) + } + } + if len(v.App.TelemetryExportDestinations) > 0 { + c := n.child("telemetry_export_destinations") + for i0 := range v.App.TelemetryExportDestinations { + e := c.elem(i0) + requiredAppsTelemetryExportDestination(w, &e, &v.App.TelemetryExportDestinations[i0]) + } + } +} + +func requiredResourcesCatalog(w *walker, n *node, v *resources.Catalog) { + if v == nil { + v = &resources.Catalog{} + } + if !(v.CreateCatalog.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if c := n.child("managed_encryption_settings"); c.exists() { + requiredCatalogEncryptionSettings(w, &c, v.CreateCatalog.ManagedEncryptionSettings) + } +} + +func requiredResourcesClusterPolicy(w *walker, n *node, v *resources.ClusterPolicy) { + if v == nil { + v = &resources.ClusterPolicy{} + } + if len(v.CreatePolicy.Libraries) > 0 { + c := n.child("libraries") + for i0 := range v.CreatePolicy.Libraries { + e := c.elem(i0) + requiredComputeLibrary(w, &e, &v.CreatePolicy.Libraries[i0]) + } + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesClusterPolicyPermission(w, &e, &v.Permissions[i0]) + } + } +} + +func requiredResourcesCluster(w *walker, n *node, v *resources.Cluster) { + if v == nil { + v = &resources.Cluster{} + } + if c := n.child("cluster_log_conf"); c.exists() { + requiredComputeClusterLogConf(w, &c, v.ClusterSpec.ClusterLogConf) + } + if len(v.ClusterSpec.InitScripts) > 0 { + c := n.child("init_scripts") + for i0 := range v.ClusterSpec.InitScripts { + e := c.elem(i0) + requiredComputeInitScriptInfo(w, &e, &v.ClusterSpec.InitScripts[i0]) + } + } + if len(v.Libraries) > 0 { + c := n.child("libraries") + for i0 := range v.Libraries { + e := c.elem(i0) + requiredComputeLibrary(w, &e, &v.Libraries[i0]) + } + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesClusterPermission(w, &e, &v.Permissions[i0]) + } + } + if c := n.child("workload_type"); c.exists() { + requiredComputeWorkloadType(w, &c, v.ClusterSpec.WorkloadType) + } +} + +func requiredResourcesDashboard(w *walker, n *node, v *resources.Dashboard) { + if v == nil { + v = &resources.Dashboard{} + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesPermission(w, &e, &v.Permissions[i0]) + } + } +} + +func requiredResourcesDatabaseCatalog(w *walker, n *node, v *resources.DatabaseCatalog) { + if v == nil { + v = &resources.DatabaseCatalog{} + } + if !(v.DatabaseCatalog.DatabaseInstanceName != "") && !n.has("database_instance_name") { + w.missing(n, "database_instance_name") + } + if !(v.DatabaseCatalog.DatabaseName != "") && !n.has("database_name") { + w.missing(n, "database_name") + } + if !(v.DatabaseCatalog.Name != "") && !n.has("name") { + w.missing(n, "name") + } +} + +func requiredResourcesDatabaseInstance(w *walker, n *node, v *resources.DatabaseInstance) { + if v == nil { + v = &resources.DatabaseInstance{} + } + if !(v.DatabaseInstance.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesPermission(w, &e, &v.Permissions[i0]) + } + } +} + +func requiredResourcesMlflowExperiment(w *walker, n *node, v *resources.MlflowExperiment) { + if v == nil { + v = &resources.MlflowExperiment{} + } + if !(v.CreateExperiment.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesMlflowExperimentPermission(w, &e, &v.Permissions[i0]) + } + } + if c := n.child("trace_location"); c.exists() { + requiredMlExperimentTraceLocation(w, &c, v.CreateExperiment.TraceLocation) + } +} + +func requiredResourcesExternalLocation(w *walker, n *node, v *resources.ExternalLocation) { + if v == nil { + v = &resources.ExternalLocation{} + } + if !(v.CreateExternalLocation.CredentialName != "") && !n.has("credential_name") { + w.missing(n, "credential_name") + } + if !(v.CreateExternalLocation.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if !(v.CreateExternalLocation.Url != "") && !n.has("url") { + w.missing(n, "url") + } +} + +func requiredResourcesFeature(w *walker, n *node, v *resources.Feature) { + if v == nil { + v = &resources.Feature{} + } + if !(v.Feature.FullName != "") && !n.has("full_name") { + w.missing(n, "full_name") + } + if !n.has("function") { + w.missing(n, "function") + } + if !n.has("source") { + w.missing(n, "source") + } + if len(v.Feature.Entities) > 0 { + c := n.child("entities") + for i0 := range v.Feature.Entities { + e := c.elem(i0) + requiredMlEntityColumn(w, &e, &v.Feature.Entities[i0]) + } + } + if c := n.child("function"); c.exists() { + requiredMlFunction(w, &c, &v.Feature.Function) + } + if c := n.child("source"); c.exists() { + requiredMlDataSource(w, &c, &v.Feature.Source) + } + if c := n.child("time_window"); c.exists() { + requiredMlTimeWindow(w, &c, v.Feature.TimeWindow) + } + if c := n.child("timeseries_column"); c.exists() { + requiredMlTimeseriesColumn(w, &c, v.Feature.TimeseriesColumn) + } +} + +func requiredResourcesGenieSpace(w *walker, n *node, v *resources.GenieSpace) { + if v == nil { + v = &resources.GenieSpace{} + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesPermission(w, &e, &v.Permissions[i0]) + } + } +} + +func requiredResourcesInstancePool(w *walker, n *node, v *resources.InstancePool) { + if v == nil { + v = &resources.InstancePool{} + } + if !(v.CreateInstancePool.InstancePoolName != "") && !n.has("instance_pool_name") { + w.missing(n, "instance_pool_name") + } + if !(v.CreateInstancePool.NodeTypeId != "") && !n.has("node_type_id") { + w.missing(n, "node_type_id") + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesInstancePoolPermission(w, &e, &v.Permissions[i0]) + } + } +} + +func requiredResourcesJobRun(w *walker, n *node, v *resources.JobRun) { + if v == nil { + v = &resources.JobRun{} + } + if !(v.RunNow.JobId != 0) && !n.has("job_id") { + w.missing(n, "job_id") + } + if c := n.child("queue"); c.exists() { + requiredJobsQueueSettings(w, &c, v.RunNow.Queue) + } +} + +func requiredResourcesJob(w *walker, n *node, v *resources.Job) { + if v == nil { + v = &resources.Job{} + } + if c := n.child("continuous"); c.exists() { + requiredJobsContinuous(w, &c, v.JobSettings.Continuous) + } + if c := n.child("deployment"); c.exists() { + requiredJobsJobDeployment(w, &c, v.JobSettings.Deployment) + } + if len(v.JobSettings.EnvironmentVariables) > 0 { + c := n.child("environment_variables") + for i0 := range v.JobSettings.EnvironmentVariables { + e := c.elem(i0) + requiredJobsJobEnvironmentVariables(w, &e, &v.JobSettings.EnvironmentVariables[i0]) + } + } + if len(v.JobSettings.Environments) > 0 { + c := n.child("environments") + for i0 := range v.JobSettings.Environments { + e := c.elem(i0) + requiredJobsJobEnvironment(w, &e, &v.JobSettings.Environments[i0]) + } + } + if c := n.child("git_source"); c.exists() { + requiredJobsGitSource(w, &c, v.JobSettings.GitSource) + } + if c := n.child("health"); c.exists() { + requiredJobsJobsHealthRules(w, &c, v.JobSettings.Health) + } + if len(v.JobSettings.JobClusters) > 0 { + c := n.child("job_clusters") + for i0 := range v.JobSettings.JobClusters { + e := c.elem(i0) + requiredJobsJobCluster(w, &e, &v.JobSettings.JobClusters[i0]) + } + } + if len(v.JobSettings.Parameters) > 0 { + c := n.child("parameters") + for i0 := range v.JobSettings.Parameters { + e := c.elem(i0) + requiredJobsJobParameterDefinition(w, &e, &v.JobSettings.Parameters[i0]) + } + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesJobPermission(w, &e, &v.Permissions[i0]) + } + } + if c := n.child("queue"); c.exists() { + requiredJobsQueueSettings(w, &c, v.JobSettings.Queue) + } + if c := n.child("schedule"); c.exists() { + requiredJobsCronSchedule(w, &c, v.JobSettings.Schedule) + } + if len(v.JobSettings.Tasks) > 0 { + c := n.child("tasks") + for i0 := range v.JobSettings.Tasks { + e := c.elem(i0) + requiredJobsTask(w, &e, &v.JobSettings.Tasks[i0]) + } + } + if c := n.child("trigger"); c.exists() { + requiredJobsTriggerSettings(w, &c, v.JobSettings.Trigger) + } + if len(v.JobSettings.Triggers) > 0 { + c := n.child("triggers") + for i0 := range v.JobSettings.Triggers { + e := c.elem(i0) + requiredJobsTriggerConfiguration(w, &e, &v.JobSettings.Triggers[i0]) + } + } + if c := n.child("webhook_notifications"); c.exists() { + requiredJobsWebhookNotifications(w, &c, v.JobSettings.WebhookNotifications) + } +} + +func requiredResourcesMcpService(w *walker, n *node, v *resources.McpService) { + if v == nil { + v = &resources.McpService{} + } + if !(v.McpServiceConfig.Parent != "") && !n.has("parent") { + w.missing(n, "parent") + } + if !(v.McpServiceConfig.McpServiceId != "") && !n.has("mcp_service_id") { + w.missing(n, "mcp_service_id") + } + if c := n.child("config"); c.exists() { + requiredCatalogMcpServiceConfig(w, &c, v.McpServiceConfig.Config) + } +} + +func requiredResourcesModelProviderService(w *walker, n *node, v *resources.ModelProviderService) { + if v == nil { + v = &resources.ModelProviderService{} + } + if !(v.ModelProviderServiceConfig.Parent != "") && !n.has("parent") { + w.missing(n, "parent") + } + if !(v.ModelProviderServiceConfig.ModelProviderServiceId != "") && !n.has("model_provider_service_id") { + w.missing(n, "model_provider_service_id") + } + if c := n.child("config"); c.exists() { + requiredCatalogModelProviderServiceConfig(w, &c, v.ModelProviderServiceConfig.Config) + } +} + +func requiredResourcesModelService(w *walker, n *node, v *resources.ModelService) { + if v == nil { + v = &resources.ModelService{} + } + if !(v.ModelServiceConfig.Parent != "") && !n.has("parent") { + w.missing(n, "parent") + } + if !(v.ModelServiceConfig.ModelServiceId != "") && !n.has("model_service_id") { + w.missing(n, "model_service_id") + } + if c := n.child("config"); c.exists() { + requiredCatalogModelServiceConfig(w, &c, v.ModelServiceConfig.Config) + } +} + +func requiredResourcesModelServingEndpoint(w *walker, n *node, v *resources.ModelServingEndpoint) { + if v == nil { + v = &resources.ModelServingEndpoint{} + } + if !(v.CreateServingEndpoint.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if c := n.child("ai_gateway"); c.exists() { + requiredServingAiGatewayConfig(w, &c, v.CreateServingEndpoint.AiGateway) + } + if c := n.child("config"); c.exists() { + requiredServingEndpointCoreConfigInput(w, &c, v.CreateServingEndpoint.Config) + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesModelServingEndpointPermission(w, &e, &v.Permissions[i0]) + } + } + if len(v.CreateServingEndpoint.RateLimits) > 0 { + c := n.child("rate_limits") + for i0 := range v.CreateServingEndpoint.RateLimits { + e := c.elem(i0) + requiredServingRateLimit(w, &e, &v.CreateServingEndpoint.RateLimits[i0]) + } + } + if len(v.CreateServingEndpoint.Tags) > 0 { + c := n.child("tags") + for i0 := range v.CreateServingEndpoint.Tags { + e := c.elem(i0) + requiredServingEndpointTag(w, &e, &v.CreateServingEndpoint.Tags[i0]) + } + } +} + +func requiredResourcesMlflowModel(w *walker, n *node, v *resources.MlflowModel) { + if v == nil { + v = &resources.MlflowModel{} + } + if !(v.CreateModelRequest.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesMlflowModelPermission(w, &e, &v.Permissions[i0]) + } + } +} + +func requiredResourcesPipeline(w *walker, n *node, v *resources.Pipeline) { + if v == nil { + v = &resources.Pipeline{} + } + if len(v.CreatePipeline.Clusters) > 0 { + c := n.child("clusters") + for i0 := range v.CreatePipeline.Clusters { + e := c.elem(i0) + requiredPipelinesPipelineCluster(w, &e, &v.CreatePipeline.Clusters[i0]) + } + } + if c := n.child("deployment"); c.exists() { + requiredPipelinesPipelineDeployment(w, &c, v.CreatePipeline.Deployment) + } + if c := n.child("gateway_definition"); c.exists() { + requiredPipelinesIngestionGatewayPipelineDefinition(w, &c, v.CreatePipeline.GatewayDefinition) + } + if c := n.child("ingestion_definition"); c.exists() { + requiredPipelinesIngestionPipelineDefinition(w, &c, v.CreatePipeline.IngestionDefinition) + } + if len(v.CreatePipeline.Libraries) > 0 { + c := n.child("libraries") + for i0 := range v.CreatePipeline.Libraries { + e := c.elem(i0) + requiredPipelinesPipelineLibrary(w, &e, &v.CreatePipeline.Libraries[i0]) + } + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesPipelinePermission(w, &e, &v.Permissions[i0]) + } + } + if c := n.child("restart_window"); c.exists() { + requiredPipelinesRestartWindow(w, &c, v.CreatePipeline.RestartWindow) + } +} + +func requiredResourcesPostgresBranch(w *walker, n *node, v *resources.PostgresBranch) { + if v == nil { + v = &resources.PostgresBranch{} + } + if !(v.PostgresBranchConfig.BranchId != "") && !n.has("branch_id") { + w.missing(n, "branch_id") + } + if !(v.PostgresBranchConfig.Parent != "") && !n.has("parent") { + w.missing(n, "parent") + } +} + +func requiredResourcesPostgresCatalog(w *walker, n *node, v *resources.PostgresCatalog) { + if v == nil { + v = &resources.PostgresCatalog{} + } + if !(v.PostgresCatalogConfig.CatalogCatalogSpec.PostgresDatabase != "") && !n.has("postgres_database") { + w.missing(n, "postgres_database") + } + if !(v.PostgresCatalogConfig.CatalogId != "") && !n.has("catalog_id") { + w.missing(n, "catalog_id") + } +} + +func requiredResourcesPostgresDatabase(w *walker, n *node, v *resources.PostgresDatabase) { + if v == nil { + v = &resources.PostgresDatabase{} + } + if !(v.PostgresDatabaseConfig.DatabaseDatabaseSpec.Role != "") && !n.has("role") { + w.missing(n, "role") + } + if !(v.PostgresDatabaseConfig.DatabaseId != "") && !n.has("database_id") { + w.missing(n, "database_id") + } + if !(v.PostgresDatabaseConfig.Parent != "") && !n.has("parent") { + w.missing(n, "parent") + } +} + +func requiredResourcesPostgresEndpoint(w *walker, n *node, v *resources.PostgresEndpoint) { + if v == nil { + v = &resources.PostgresEndpoint{} + } + if !(v.PostgresEndpointConfig.EndpointSpec.EndpointType != "") && !n.has("endpoint_type") { + w.missing(n, "endpoint_type") + } + if !(v.PostgresEndpointConfig.EndpointId != "") && !n.has("endpoint_id") { + w.missing(n, "endpoint_id") + } + if !(v.PostgresEndpointConfig.Parent != "") && !n.has("parent") { + w.missing(n, "parent") + } + if c := n.child("group"); c.exists() { + requiredPostgresEndpointGroupSpec(w, &c, v.PostgresEndpointConfig.EndpointSpec.Group) + } +} + +func requiredResourcesPostgresProject(w *walker, n *node, v *resources.PostgresProject) { + if v == nil { + v = &resources.PostgresProject{} + } + if !(v.PostgresProjectConfig.ProjectId != "") && !n.has("project_id") { + w.missing(n, "project_id") + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesPermission(w, &e, &v.Permissions[i0]) + } + } +} + +func requiredResourcesPostgresRole(w *walker, n *node, v *resources.PostgresRole) { + if v == nil { + v = &resources.PostgresRole{} + } + if !(v.PostgresRoleConfig.RoleId != "") && !n.has("role_id") { + w.missing(n, "role_id") + } + if !(v.PostgresRoleConfig.Parent != "") && !n.has("parent") { + w.missing(n, "parent") + } +} + +func requiredResourcesPostgresSnapshotSchedule(w *walker, n *node, v *resources.PostgresSnapshotSchedule) { + if v == nil { + v = &resources.PostgresSnapshotSchedule{} + } + if !(v.PostgresSnapshotScheduleConfig.Branch != "") && !n.has("branch") { + w.missing(n, "branch") + } + if len(v.PostgresSnapshotScheduleConfig.Schedule) > 0 { + c := n.child("schedule") + for i0 := range v.PostgresSnapshotScheduleConfig.Schedule { + e := c.elem(i0) + requiredPostgresScheduleCadence(w, &e, &v.PostgresSnapshotScheduleConfig.Schedule[i0]) + } + } +} + +func requiredResourcesPostgresSyncedTable(w *walker, n *node, v *resources.PostgresSyncedTable) { + if v == nil { + v = &resources.PostgresSyncedTable{} + } + if !(v.PostgresSyncedTableConfig.SyncedTableId != "") && !n.has("synced_table_id") { + w.missing(n, "synced_table_id") + } + if len(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExtraColumns) > 0 { + c := n.child("extra_columns") + for i0 := range v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExtraColumns { + e := c.elem(i0) + requiredPostgresSyncedTableSyncedTableSpecExtraColumn(w, &e, &v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExtraColumns[i0]) + } + } + if len(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides) > 0 { + c := n.child("type_overrides") + for i0 := range v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides { + e := c.elem(i0) + requiredPostgresSyncedTableSyncedTableSpecTypeOverride(w, &e, &v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides[i0]) + } + } +} + +func requiredResourcesQualityMonitor(w *walker, n *node, v *resources.QualityMonitor) { + if v == nil { + v = &resources.QualityMonitor{} + } + if !(v.CreateMonitor.AssetsDir != "") && !n.has("assets_dir") { + w.missing(n, "assets_dir") + } + if !(v.CreateMonitor.OutputSchemaName != "") && !n.has("output_schema_name") { + w.missing(n, "output_schema_name") + } + if !(v.TableName != "") && !n.has("table_name") { + w.missing(n, "table_name") + } + if len(v.CreateMonitor.CustomMetrics) > 0 { + c := n.child("custom_metrics") + for i0 := range v.CreateMonitor.CustomMetrics { + e := c.elem(i0) + requiredCatalogMonitorMetric(w, &e, &v.CreateMonitor.CustomMetrics[i0]) + } + } + if c := n.child("inference_log"); c.exists() { + requiredCatalogMonitorInferenceLog(w, &c, v.CreateMonitor.InferenceLog) + } + if c := n.child("schedule"); c.exists() { + requiredCatalogMonitorCronSchedule(w, &c, v.CreateMonitor.Schedule) + } + if c := n.child("time_series"); c.exists() { + requiredCatalogMonitorTimeSeries(w, &c, v.CreateMonitor.TimeSeries) + } +} + +func requiredResourcesSchema(w *walker, n *node, v *resources.Schema) { + if v == nil { + v = &resources.Schema{} + } + if !(v.CreateSchema.CatalogName != "") && !n.has("catalog_name") { + w.missing(n, "catalog_name") + } + if !(v.CreateSchema.Name != "") && !n.has("name") { + w.missing(n, "name") + } +} + +func requiredResourcesSecretScope(w *walker, n *node, v *resources.SecretScope) { + if v == nil { + v = &resources.SecretScope{} + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if c := n.child("keyvault_metadata"); c.exists() { + requiredWorkspaceAzureKeyVaultSecretScopeMetadata(w, &c, v.KeyvaultMetadata) + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesSecretScopePermission(w, &e, &v.Permissions[i0]) + } + } +} + +func requiredResourcesSecret(w *walker, n *node, v *resources.Secret) { + if v == nil { + v = &resources.Secret{} + } + if !(v.Secret.CatalogName != "") && !n.has("catalog_name") { + w.missing(n, "catalog_name") + } + if !(v.Secret.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if !(v.Secret.SchemaName != "") && !n.has("schema_name") { + w.missing(n, "schema_name") + } + if !(v.Secret.Value != "") && !n.has("value") { + w.missing(n, "value") + } +} + +func requiredResourcesSqlWarehouse(w *walker, n *node, v *resources.SqlWarehouse) { + if v == nil { + v = &resources.SqlWarehouse{} + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesSqlWarehousePermission(w, &e, &v.Permissions[i0]) + } + } +} + +func requiredResourcesSyncedDatabaseTable(w *walker, n *node, v *resources.SyncedDatabaseTable) { + if v == nil { + v = &resources.SyncedDatabaseTable{} + } + if !(v.SyncedDatabaseTable.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if c := n.child("spec"); c.exists() { + requiredDatabaseSyncedTableSpec(w, &c, v.SyncedDatabaseTable.Spec) + } +} + +func requiredResourcesVectorSearchEndpoint(w *walker, n *node, v *resources.VectorSearchEndpoint) { + if v == nil { + v = &resources.VectorSearchEndpoint{} + } + if !(v.CreateEndpoint.EndpointType != "") && !n.has("endpoint_type") { + w.missing(n, "endpoint_type") + } + if !(v.CreateEndpoint.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if len(v.Permissions) > 0 { + c := n.child("permissions") + for i0 := range v.Permissions { + e := c.elem(i0) + requiredResourcesVectorSearchEndpointPermission(w, &e, &v.Permissions[i0]) + } + } +} + +func requiredResourcesVectorSearchIndex(w *walker, n *node, v *resources.VectorSearchIndex) { + if v == nil { + v = &resources.VectorSearchIndex{} + } + if !(v.CreateVectorIndexRequest.EndpointName != "") && !n.has("endpoint_name") { + w.missing(n, "endpoint_name") + } + if !(v.CreateVectorIndexRequest.IndexType != "") && !n.has("index_type") { + w.missing(n, "index_type") + } + if !(v.CreateVectorIndexRequest.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if !(v.CreateVectorIndexRequest.PrimaryKey != "") && !n.has("primary_key") { + w.missing(n, "primary_key") + } +} + +func requiredResourcesVolume(w *walker, n *node, v *resources.Volume) { + if v == nil { + v = &resources.Volume{} + } + if !(v.CreateVolumeRequestContent.CatalogName != "") && !n.has("catalog_name") { + w.missing(n, "catalog_name") + } + if !(v.CreateVolumeRequestContent.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if !(v.CreateVolumeRequestContent.SchemaName != "") && !n.has("schema_name") { + w.missing(n, "schema_name") + } + if !(v.CreateVolumeRequestContent.VolumeType != "") && !n.has("volume_type") { + w.missing(n, "volume_type") + } +} + +func requiredSqlAlertV2Evaluation(w *walker, n *node, v *sql.AlertV2Evaluation) { + if v == nil { + v = &sql.AlertV2Evaluation{} + } + if !(v.ComparisonOperator != "") && !n.has("comparison_operator") { + w.missing(n, "comparison_operator") + } + if !n.has("source") { + w.missing(n, "source") + } + if c := n.child("source"); c.exists() { + requiredSqlAlertV2OperandColumn(w, &c, &v.Source) + } + if c := n.child("threshold"); c.exists() { + requiredSqlAlertV2Operand(w, &c, v.Threshold) + } +} + +func requiredSqlAlertStatementParameter(w *walker, n *node, v *sql.AlertStatementParameter) { + if v == nil { + v = &sql.AlertStatementParameter{} + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } +} + +func requiredSqlCronSchedule(w *walker, n *node, v *sql.CronSchedule) { + if v == nil { + v = &sql.CronSchedule{} + } + if !(v.QuartzCronSchedule != "") && !n.has("quartz_cron_schedule") { + w.missing(n, "quartz_cron_schedule") + } + if !(v.TimezoneId != "") && !n.has("timezone_id") { + w.missing(n, "timezone_id") + } +} + +func requiredAppsAppDeployment(w *walker, n *node, v *apps.AppDeployment) { + if v == nil { + v = &apps.AppDeployment{} + } + if c := n.child("git_source"); c.exists() { + requiredAppsGitSource(w, &c, v.GitSource) + } +} + +func requiredResourcesAppConfig(w *walker, n *node, v *resources.AppConfig) { + if v == nil { + v = &resources.AppConfig{} + } + if len(v.Env) > 0 { + c := n.child("env") + for i0 := range v.Env { + e := c.elem(i0) + requiredResourcesAppEnvVar(w, &e, &v.Env[i0]) + } + } +} + +func requiredAppsGitSource(w *walker, n *node, v *apps.GitSource) { + if v == nil { + v = &apps.GitSource{} + } + if c := n.child("git_repository"); c.exists() { + requiredAppsGitRepository(w, &c, v.GitRepository) + } +} + +func requiredAppsGitRepository(w *walker, n *node, v *apps.GitRepository) { + if v == nil { + v = &apps.GitRepository{} + } + if !(v.Provider != "") && !n.has("provider") { + w.missing(n, "provider") + } + if !(v.Url != "") && !n.has("url") { + w.missing(n, "url") + } +} + +func requiredResourcesAppPermission(w *walker, n *node, v *resources.AppPermission) { + if v == nil { + v = &resources.AppPermission{} + } + if !(v.Level != "") && !n.has("level") { + w.missing(n, "level") + } +} + +func requiredAppsAppResource(w *walker, n *node, v *apps.AppResource) { + if v == nil { + v = &apps.AppResource{} + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if c := n.child("database"); c.exists() { + requiredAppsAppResourceDatabase(w, &c, v.Database) + } + if c := n.child("experiment"); c.exists() { + requiredAppsAppResourceExperiment(w, &c, v.Experiment) + } + if c := n.child("genie_space"); c.exists() { + requiredAppsAppResourceGenieSpace(w, &c, v.GenieSpace) + } + if c := n.child("job"); c.exists() { + requiredAppsAppResourceJob(w, &c, v.Job) + } + if c := n.child("secret"); c.exists() { + requiredAppsAppResourceSecret(w, &c, v.Secret) + } + if c := n.child("serving_endpoint"); c.exists() { + requiredAppsAppResourceServingEndpoint(w, &c, v.ServingEndpoint) + } + if c := n.child("sql_warehouse"); c.exists() { + requiredAppsAppResourceSqlWarehouse(w, &c, v.SqlWarehouse) + } + if c := n.child("uc_securable"); c.exists() { + requiredAppsAppResourceUcSecurable(w, &c, v.UcSecurable) + } +} + +func requiredAppsTelemetryExportDestination(w *walker, n *node, v *apps.TelemetryExportDestination) { + if v == nil { + v = &apps.TelemetryExportDestination{} + } + if c := n.child("unity_catalog"); c.exists() { + requiredAppsUnityCatalog(w, &c, v.UnityCatalog) + } +} + +func requiredCatalogEncryptionSettings(w *walker, n *node, v *catalog.EncryptionSettings) { + if v == nil { + v = &catalog.EncryptionSettings{} + } + if c := n.child("azure_encryption_settings"); c.exists() { + requiredCatalogAzureEncryptionSettings(w, &c, v.AzureEncryptionSettings) + } +} + +func requiredComputeLibrary(w *walker, n *node, v *compute.Library) { + if v == nil { + v = &compute.Library{} + } + if c := n.child("cran"); c.exists() { + requiredComputeRCranLibrary(w, &c, v.Cran) + } + if c := n.child("maven"); c.exists() { + requiredComputeMavenLibrary(w, &c, v.Maven) + } + if c := n.child("pypi"); c.exists() { + requiredComputePythonPyPiLibrary(w, &c, v.Pypi) + } +} + +func requiredResourcesClusterPolicyPermission(w *walker, n *node, v *resources.ClusterPolicyPermission) { + if v == nil { + v = &resources.ClusterPolicyPermission{} + } + if !(v.Level != "") && !n.has("level") { + w.missing(n, "level") + } +} + +func requiredComputeClusterLogConf(w *walker, n *node, v *compute.ClusterLogConf) { + if v == nil { + v = &compute.ClusterLogConf{} + } + if c := n.child("dbfs"); c.exists() { + requiredComputeDbfsStorageInfo(w, &c, v.Dbfs) + } + if c := n.child("s3"); c.exists() { + requiredComputeS3StorageInfo(w, &c, v.S3) + } + if c := n.child("volumes"); c.exists() { + requiredComputeVolumesStorageInfo(w, &c, v.Volumes) + } +} + +func requiredComputeInitScriptInfo(w *walker, n *node, v *compute.InitScriptInfo) { + if v == nil { + v = &compute.InitScriptInfo{} + } + if c := n.child("abfss"); c.exists() { + requiredComputeAdlsgen2Info(w, &c, v.Abfss) + } + if c := n.child("dbfs"); c.exists() { + requiredComputeDbfsStorageInfo(w, &c, v.Dbfs) + } + if c := n.child("file"); c.exists() { + requiredComputeLocalFileInfo(w, &c, v.File) + } + if c := n.child("gcs"); c.exists() { + requiredComputeGcsStorageInfo(w, &c, v.Gcs) + } + if c := n.child("s3"); c.exists() { + requiredComputeS3StorageInfo(w, &c, v.S3) + } + if c := n.child("volumes"); c.exists() { + requiredComputeVolumesStorageInfo(w, &c, v.Volumes) + } + if c := n.child("workspace"); c.exists() { + requiredComputeWorkspaceStorageInfo(w, &c, v.Workspace) + } +} + +func requiredResourcesClusterPermission(w *walker, n *node, v *resources.ClusterPermission) { + if v == nil { + v = &resources.ClusterPermission{} + } + if !(v.Level != "") && !n.has("level") { + w.missing(n, "level") + } +} + +func requiredComputeWorkloadType(w *walker, n *node, v *compute.WorkloadType) { + if v == nil { + v = &compute.WorkloadType{} + } + if !n.has("clients") { + w.missing(n, "clients") + } +} + +func requiredResourcesMlflowExperimentPermission(w *walker, n *node, v *resources.MlflowExperimentPermission) { + if v == nil { + v = &resources.MlflowExperimentPermission{} + } + if !(v.Level != "") && !n.has("level") { + w.missing(n, "level") + } +} + +func requiredMlExperimentTraceLocation(w *walker, n *node, v *ml.ExperimentTraceLocation) { + if v == nil { + v = &ml.ExperimentTraceLocation{} + } + if c := n.child("uc_trace_location"); c.exists() { + requiredMlUcTraceLocation(w, &c, v.UcTraceLocation) + } +} + +func requiredMlEntityColumn(w *walker, n *node, v *ml.EntityColumn) { + if v == nil { + v = &ml.EntityColumn{} + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } +} + +func requiredMlFunction(w *walker, n *node, v *ml.Function) { + if v == nil { + v = &ml.Function{} + } + if c := n.child("aggregation_function"); c.exists() { + requiredMlAggregationFunction(w, &c, v.AggregationFunction) + } + if c := n.child("column_selection"); c.exists() { + requiredMlColumnSelection(w, &c, v.ColumnSelection) + } + if c := n.child("custom_udf"); c.exists() { + requiredMlCustomUdf(w, &c, v.CustomUdf) + } + if len(v.ExtraParameters) > 0 { + c := n.child("extra_parameters") + for i0 := range v.ExtraParameters { + e := c.elem(i0) + requiredMlFunctionExtraParameter(w, &e, &v.ExtraParameters[i0]) + } + } +} + +func requiredMlDataSource(w *walker, n *node, v *ml.DataSource) { + if v == nil { + v = &ml.DataSource{} + } + if c := n.child("delta_table_source"); c.exists() { + requiredMlDeltaTableSource(w, &c, v.DeltaTableSource) + } + if c := n.child("feature_view_source"); c.exists() { + requiredMlFeatureViewSource(w, &c, v.FeatureViewSource) + } + if c := n.child("kafka_source"); c.exists() { + requiredMlKafkaSource(w, &c, v.KafkaSource) + } + if c := n.child("request_source"); c.exists() { + requiredMlRequestSource(w, &c, v.RequestSource) + } + if c := n.child("stream_source"); c.exists() { + requiredMlStreamSource(w, &c, v.StreamSource) + } +} + +func requiredMlTimeWindow(w *walker, n *node, v *ml.TimeWindow) { + if v == nil { + v = &ml.TimeWindow{} + } + if c := n.child("continuous"); c.exists() { + requiredMlContinuousWindow(w, &c, v.Continuous) + } + if c := n.child("sliding"); c.exists() { + requiredMlSlidingWindow(w, &c, v.Sliding) + } + if c := n.child("tumbling"); c.exists() { + requiredMlTumblingWindow(w, &c, v.Tumbling) + } +} + +func requiredMlTimeseriesColumn(w *walker, n *node, v *ml.TimeseriesColumn) { + if v == nil { + v = &ml.TimeseriesColumn{} + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } +} + +func requiredResourcesInstancePoolPermission(w *walker, n *node, v *resources.InstancePoolPermission) { + if v == nil { + v = &resources.InstancePoolPermission{} + } + if !(v.Level != "") && !n.has("level") { + w.missing(n, "level") + } +} + +func requiredJobsQueueSettings(w *walker, n *node, v *jobs.QueueSettings) { + if v == nil { + v = &jobs.QueueSettings{} + } + if !(v.Enabled) && !n.has("enabled") { + w.missing(n, "enabled") + } +} + +func requiredJobsContinuous(w *walker, n *node, v *jobs.Continuous) { + if v == nil { + v = &jobs.Continuous{} + } + if c := n.child("maintenance_window"); c.exists() { + requiredJobsMaintenanceWindow(w, &c, v.MaintenanceWindow) + } +} + +func requiredJobsJobDeployment(w *walker, n *node, v *jobs.JobDeployment) { + if v == nil { + v = &jobs.JobDeployment{} + } + if !(v.Kind != "") && !n.has("kind") { + w.missing(n, "kind") + } +} + +func requiredJobsJobEnvironmentVariables(w *walker, n *node, v *jobs.JobEnvironmentVariables) { + if v == nil { + v = &jobs.JobEnvironmentVariables{} + } + if !(v.EnvironmentVariablesKey != "") && !n.has("environment_variables_key") { + w.missing(n, "environment_variables_key") + } +} + +func requiredJobsJobEnvironment(w *walker, n *node, v *jobs.JobEnvironment) { + if v == nil { + v = &jobs.JobEnvironment{} + } + if !(v.EnvironmentKey != "") && !n.has("environment_key") { + w.missing(n, "environment_key") + } +} + +func requiredJobsGitSource(w *walker, n *node, v *jobs.GitSource) { + if v == nil { + v = &jobs.GitSource{} + } + if !(v.GitProvider != "") && !n.has("git_provider") { + w.missing(n, "git_provider") + } + if !(v.GitUrl != "") && !n.has("git_url") { + w.missing(n, "git_url") + } + if c := n.child("job_source"); c.exists() { + requiredJobsJobSource(w, &c, v.JobSource) + } +} + +func requiredJobsJobsHealthRules(w *walker, n *node, v *jobs.JobsHealthRules) { + if v == nil { + v = &jobs.JobsHealthRules{} + } + if len(v.Rules) > 0 { + c := n.child("rules") + for i0 := range v.Rules { + e := c.elem(i0) + requiredJobsJobsHealthRule(w, &e, &v.Rules[i0]) + } + } +} + +func requiredJobsJobCluster(w *walker, n *node, v *jobs.JobCluster) { + if v == nil { + v = &jobs.JobCluster{} + } + if !(v.JobClusterKey != "") && !n.has("job_cluster_key") { + w.missing(n, "job_cluster_key") + } + if c := n.child("new_cluster"); c.exists() { + requiredComputeClusterSpec(w, &c, v.NewCluster) + } +} + +func requiredJobsJobParameterDefinition(w *walker, n *node, v *jobs.JobParameterDefinition) { + if v == nil { + v = &jobs.JobParameterDefinition{} + } + if !(v.Default != "") && !n.has("default") { + w.missing(n, "default") + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } +} + +func requiredResourcesJobPermission(w *walker, n *node, v *resources.JobPermission) { + if v == nil { + v = &resources.JobPermission{} + } + if !(v.Level != "") && !n.has("level") { + w.missing(n, "level") + } +} + +func requiredJobsCronSchedule(w *walker, n *node, v *jobs.CronSchedule) { + if v == nil { + v = &jobs.CronSchedule{} + } + if !(v.QuartzCronExpression != "") && !n.has("quartz_cron_expression") { + w.missing(n, "quartz_cron_expression") + } + if !(v.TimezoneId != "") && !n.has("timezone_id") { + w.missing(n, "timezone_id") + } + if c := n.child("sql_condition"); c.exists() { + requiredJobsSqlConditionConfiguration(w, &c, v.SqlCondition) + } +} + +func requiredJobsTask(w *walker, n *node, v *jobs.Task) { + if v == nil { + v = &jobs.Task{} + } + if !(v.TaskKey != "") && !n.has("task_key") { + w.missing(n, "task_key") + } + if c := n.child("ai_runtime_task"); c.exists() { + requiredJobsAiRuntimeTask(w, &c, v.AiRuntimeTask) + } + if c := n.child("clean_rooms_notebook_task"); c.exists() { + requiredJobsCleanRoomsNotebookTask(w, &c, v.CleanRoomsNotebookTask) + } + if c := n.child("condition_task"); c.exists() { + requiredJobsConditionTask(w, &c, v.ConditionTask) + } + if c := n.child("dbt_task"); c.exists() { + requiredJobsDbtTask(w, &c, v.DbtTask) + } + if len(v.DependsOn) > 0 { + c := n.child("depends_on") + for i0 := range v.DependsOn { + e := c.elem(i0) + requiredJobsTaskDependency(w, &e, &v.DependsOn[i0]) + } + } + if c := n.child("for_each_task"); c.exists() { + requiredJobsForEachTask(w, &c, v.ForEachTask) + } + if c := n.child("gen_ai_compute_task"); c.exists() { + requiredJobsGenAiComputeTask(w, &c, v.GenAiComputeTask) + } + if c := n.child("health"); c.exists() { + requiredJobsJobsHealthRules(w, &c, v.Health) + } + if len(v.Libraries) > 0 { + c := n.child("libraries") + for i0 := range v.Libraries { + e := c.elem(i0) + requiredComputeLibrary(w, &e, &v.Libraries[i0]) + } + } + if c := n.child("new_cluster"); c.exists() { + requiredComputeClusterSpec(w, &c, v.NewCluster) + } + if c := n.child("notebook_task"); c.exists() { + requiredJobsNotebookTask(w, &c, v.NotebookTask) + } + if c := n.child("pipeline_task"); c.exists() { + requiredJobsPipelineTask(w, &c, v.PipelineTask) + } + if c := n.child("python_wheel_task"); c.exists() { + requiredJobsPythonWheelTask(w, &c, v.PythonWheelTask) + } + if c := n.child("run_job_task"); c.exists() { + requiredJobsRunJobTask(w, &c, v.RunJobTask) + } + if c := n.child("spark_python_task"); c.exists() { + requiredJobsSparkPythonTask(w, &c, v.SparkPythonTask) + } + if c := n.child("sql_task"); c.exists() { + requiredJobsSqlTask(w, &c, v.SqlTask) + } + if c := n.child("webhook_notifications"); c.exists() { + requiredJobsWebhookNotifications(w, &c, v.WebhookNotifications) + } +} + +func requiredJobsTriggerSettings(w *walker, n *node, v *jobs.TriggerSettings) { + if v == nil { + v = &jobs.TriggerSettings{} + } + if c := n.child("file_arrival"); c.exists() { + requiredJobsFileArrivalTriggerConfiguration(w, &c, v.FileArrival) + } + if c := n.child("model"); c.exists() { + requiredJobsModelTriggerConfiguration(w, &c, v.Model) + } + if c := n.child("periodic"); c.exists() { + requiredJobsPeriodicTriggerConfiguration(w, &c, v.Periodic) + } + if c := n.child("sql_condition"); c.exists() { + requiredJobsSqlConditionConfiguration(w, &c, v.SqlCondition) + } + if c := n.child("table_update"); c.exists() { + requiredJobsTableUpdateTriggerConfiguration(w, &c, v.TableUpdate) + } +} + +func requiredJobsTriggerConfiguration(w *walker, n *node, v *jobs.TriggerConfiguration) { + if v == nil { + v = &jobs.TriggerConfiguration{} + } + if c := n.child("continuous"); c.exists() { + requiredJobsContinuousTriggerConfiguration(w, &c, v.Continuous) + } + if c := n.child("file_arrival"); c.exists() { + requiredJobsFileArrivalTriggerConfiguration(w, &c, v.FileArrival) + } + if c := n.child("model"); c.exists() { + requiredJobsModelTriggerConfiguration(w, &c, v.Model) + } + if c := n.child("periodic"); c.exists() { + requiredJobsPeriodicTriggerConfiguration(w, &c, v.Periodic) + } + if c := n.child("schedule"); c.exists() { + requiredJobsCronTriggerConfiguration(w, &c, v.Schedule) + } + if c := n.child("sql_condition"); c.exists() { + requiredJobsSqlConditionConfiguration(w, &c, v.SqlCondition) + } + if c := n.child("table_update"); c.exists() { + requiredJobsTableUpdateTriggerConfiguration(w, &c, v.TableUpdate) + } +} + +func requiredJobsWebhookNotifications(w *walker, n *node, v *jobs.WebhookNotifications) { + if v == nil { + v = &jobs.WebhookNotifications{} + } + if len(v.OnDurationWarningThresholdExceeded) > 0 { + c := n.child("on_duration_warning_threshold_exceeded") + for i0 := range v.OnDurationWarningThresholdExceeded { + e := c.elem(i0) + requiredJobsWebhook(w, &e, &v.OnDurationWarningThresholdExceeded[i0]) + } + } + if len(v.OnFailure) > 0 { + c := n.child("on_failure") + for i0 := range v.OnFailure { + e := c.elem(i0) + requiredJobsWebhook(w, &e, &v.OnFailure[i0]) + } + } + if len(v.OnMaintenanceComplete) > 0 { + c := n.child("on_maintenance_complete") + for i0 := range v.OnMaintenanceComplete { + e := c.elem(i0) + requiredJobsWebhook(w, &e, &v.OnMaintenanceComplete[i0]) + } + } + if len(v.OnMaintenanceStart) > 0 { + c := n.child("on_maintenance_start") + for i0 := range v.OnMaintenanceStart { + e := c.elem(i0) + requiredJobsWebhook(w, &e, &v.OnMaintenanceStart[i0]) + } + } + if len(v.OnStart) > 0 { + c := n.child("on_start") + for i0 := range v.OnStart { + e := c.elem(i0) + requiredJobsWebhook(w, &e, &v.OnStart[i0]) + } + } + if len(v.OnStreamingBacklogExceeded) > 0 { + c := n.child("on_streaming_backlog_exceeded") + for i0 := range v.OnStreamingBacklogExceeded { + e := c.elem(i0) + requiredJobsWebhook(w, &e, &v.OnStreamingBacklogExceeded[i0]) + } + } + if len(v.OnSuccess) > 0 { + c := n.child("on_success") + for i0 := range v.OnSuccess { + e := c.elem(i0) + requiredJobsWebhook(w, &e, &v.OnSuccess[i0]) + } + } +} + +func requiredCatalogMcpServiceConfig(w *walker, n *node, v *catalog.McpServiceConfig) { + if v == nil { + v = &catalog.McpServiceConfig{} + } + if len(v.RateLimits) > 0 { + c := n.child("rate_limits") + for i0 := range v.RateLimits { + e := c.elem(i0) + requiredCatalogRateLimit(w, &e, &v.RateLimits[i0]) + } + } + if c := n.child("source_connection"); c.exists() { + requiredCatalogMcpServiceConfigSourceConnection(w, &c, v.SourceConnection) + } +} + +func requiredCatalogModelProviderServiceConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfig{} + } + if c := n.child("amazon_bedrock"); c.exists() { + requiredCatalogModelProviderServiceConfigAmazonBedrockProviderConfig(w, &c, v.AmazonBedrock) + } + if c := n.child("anthropic"); c.exists() { + requiredCatalogModelProviderServiceConfigAnthropicProviderConfig(w, &c, v.Anthropic) + } + if c := n.child("azure_openai"); c.exists() { + requiredCatalogModelProviderServiceConfigAzureOpenAiProviderConfig(w, &c, v.AzureOpenai) + } + if c := n.child("bedrock_mantle"); c.exists() { + requiredCatalogModelProviderServiceConfigAmazonBedrockProviderConfig(w, &c, v.BedrockMantle) + } + if c := n.child("custom"); c.exists() { + requiredCatalogModelProviderServiceConfigCustomProviderConfig(w, &c, v.Custom) + } + if c := n.child("gemini_enterprise"); c.exists() { + requiredCatalogModelProviderServiceConfigGeminiEnterpriseProviderConfig(w, &c, v.GeminiEnterprise) + } + if c := n.child("inference_table"); c.exists() { + requiredCatalogInferenceTableConfig(w, &c, v.InferenceTable) + } + if c := n.child("microsoft_foundry"); c.exists() { + requiredCatalogModelProviderServiceConfigMicrosoftFoundryProviderConfig(w, &c, v.MicrosoftFoundry) + } + if c := n.child("openai"); c.exists() { + requiredCatalogModelProviderServiceConfigOpenAiProviderConfig(w, &c, v.Openai) + } + if len(v.RateLimits) > 0 { + c := n.child("rate_limits") + for i0 := range v.RateLimits { + e := c.elem(i0) + requiredCatalogRateLimit(w, &e, &v.RateLimits[i0]) + } + } + if len(v.Targets) > 0 { + c := n.child("targets") + for i0 := range v.Targets { + e := c.elem(i0) + requiredCatalogModelProviderServiceConfigModelTargetConfig(w, &e, &v.Targets[i0]) + } + } +} + +func requiredCatalogModelServiceConfig(w *walker, n *node, v *catalog.ModelServiceConfig) { + if v == nil { + v = &catalog.ModelServiceConfig{} + } + if c := n.child("inference_table"); c.exists() { + requiredCatalogInferenceTableConfig(w, &c, v.InferenceTable) + } + if len(v.RateLimits) > 0 { + c := n.child("rate_limits") + for i0 := range v.RateLimits { + e := c.elem(i0) + requiredCatalogRateLimit(w, &e, &v.RateLimits[i0]) + } + } + if c := n.child("routing"); c.exists() { + requiredCatalogModelServiceConfigRoutingConfig(w, &c, v.Routing) + } +} + +func requiredServingAiGatewayConfig(w *walker, n *node, v *serving.AiGatewayConfig) { + if v == nil { + v = &serving.AiGatewayConfig{} + } + if c := n.child("fallback_config"); c.exists() { + requiredServingFallbackConfig(w, &c, v.FallbackConfig) + } + if len(v.RateLimits) > 0 { + c := n.child("rate_limits") + for i0 := range v.RateLimits { + e := c.elem(i0) + requiredServingAiGatewayRateLimit(w, &e, &v.RateLimits[i0]) + } + } +} + +func requiredServingEndpointCoreConfigInput(w *walker, n *node, v *serving.EndpointCoreConfigInput) { + if v == nil { + v = &serving.EndpointCoreConfigInput{} + } + if len(v.ServedEntities) > 0 { + c := n.child("served_entities") + for i0 := range v.ServedEntities { + e := c.elem(i0) + requiredServingServedEntityInput(w, &e, &v.ServedEntities[i0]) + } + } + if len(v.ServedModels) > 0 { + c := n.child("served_models") + for i0 := range v.ServedModels { + e := c.elem(i0) + requiredServingServedModelInput(w, &e, &v.ServedModels[i0]) + } + } + if c := n.child("traffic_config"); c.exists() { + requiredServingTrafficConfig(w, &c, v.TrafficConfig) + } +} + +func requiredResourcesModelServingEndpointPermission(w *walker, n *node, v *resources.ModelServingEndpointPermission) { + if v == nil { + v = &resources.ModelServingEndpointPermission{} + } + if !(v.Level != "") && !n.has("level") { + w.missing(n, "level") + } +} + +func requiredServingRateLimit(w *walker, n *node, v *serving.RateLimit) { + if v == nil { + v = &serving.RateLimit{} + } + if !(v.Calls != 0) && !n.has("calls") { + w.missing(n, "calls") + } + if !(v.RenewalPeriod != "") && !n.has("renewal_period") { + w.missing(n, "renewal_period") + } +} + +func requiredServingEndpointTag(w *walker, n *node, v *serving.EndpointTag) { + if v == nil { + v = &serving.EndpointTag{} + } + if !(v.Key != "") && !n.has("key") { + w.missing(n, "key") + } +} + +func requiredResourcesMlflowModelPermission(w *walker, n *node, v *resources.MlflowModelPermission) { + if v == nil { + v = &resources.MlflowModelPermission{} + } + if !(v.Level != "") && !n.has("level") { + w.missing(n, "level") + } +} + +func requiredPipelinesPipelineCluster(w *walker, n *node, v *pipelines.PipelineCluster) { + if v == nil { + v = &pipelines.PipelineCluster{} + } + if c := n.child("autoscale"); c.exists() { + requiredPipelinesPipelineClusterAutoscale(w, &c, v.Autoscale) + } + if c := n.child("cluster_log_conf"); c.exists() { + requiredComputeClusterLogConf(w, &c, v.ClusterLogConf) + } + if len(v.InitScripts) > 0 { + c := n.child("init_scripts") + for i0 := range v.InitScripts { + e := c.elem(i0) + requiredComputeInitScriptInfo(w, &e, &v.InitScripts[i0]) + } + } +} + +func requiredPipelinesPipelineDeployment(w *walker, n *node, v *pipelines.PipelineDeployment) { + if v == nil { + v = &pipelines.PipelineDeployment{} + } + if !(v.Kind != "") && !n.has("kind") { + w.missing(n, "kind") + } +} + +func requiredPipelinesIngestionGatewayPipelineDefinition(w *walker, n *node, v *pipelines.IngestionGatewayPipelineDefinition) { + if v == nil { + v = &pipelines.IngestionGatewayPipelineDefinition{} + } + if !(v.ConnectionName != "") && !n.has("connection_name") { + w.missing(n, "connection_name") + } + if !(v.GatewayStorageCatalog != "") && !n.has("gateway_storage_catalog") { + w.missing(n, "gateway_storage_catalog") + } + if !(v.GatewayStorageSchema != "") && !n.has("gateway_storage_schema") { + w.missing(n, "gateway_storage_schema") + } +} + +func requiredPipelinesIngestionPipelineDefinition(w *walker, n *node, v *pipelines.IngestionPipelineDefinition) { + if v == nil { + v = &pipelines.IngestionPipelineDefinition{} + } + if c := n.child("data_staging_options"); c.exists() { + requiredPipelinesDataStagingOptions(w, &c, v.DataStagingOptions) + } + if c := n.child("full_refresh_window"); c.exists() { + requiredPipelinesOperationTimeWindow(w, &c, v.FullRefreshWindow) + } + if len(v.Objects) > 0 { + c := n.child("objects") + for i0 := range v.Objects { + e := c.elem(i0) + requiredPipelinesIngestionConfig(w, &e, &v.Objects[i0]) + } + } + if c := n.child("table_configuration"); c.exists() { + requiredPipelinesTableSpecificConfig(w, &c, v.TableConfiguration) + } +} + +func requiredPipelinesPipelineLibrary(w *walker, n *node, v *pipelines.PipelineLibrary) { + if v == nil { + v = &pipelines.PipelineLibrary{} + } + if c := n.child("maven"); c.exists() { + requiredComputeMavenLibrary(w, &c, v.Maven) + } +} + +func requiredResourcesPipelinePermission(w *walker, n *node, v *resources.PipelinePermission) { + if v == nil { + v = &resources.PipelinePermission{} + } + if !(v.Level != "") && !n.has("level") { + w.missing(n, "level") + } +} + +func requiredPipelinesRestartWindow(w *walker, n *node, v *pipelines.RestartWindow) { + if v == nil { + v = &pipelines.RestartWindow{} + } + if !(v.StartHour != 0) && !n.has("start_hour") { + w.missing(n, "start_hour") + } +} + +func requiredPostgresEndpointGroupSpec(w *walker, n *node, v *postgres.EndpointGroupSpec) { + if v == nil { + v = &postgres.EndpointGroupSpec{} + } + if !(v.Max != 0) && !n.has("max") { + w.missing(n, "max") + } + if !(v.Min != 0) && !n.has("min") { + w.missing(n, "min") + } +} + +func requiredPostgresScheduleCadence(w *walker, n *node, v *postgres.ScheduleCadence) { + if v == nil { + v = &postgres.ScheduleCadence{} + } + if !n.has("retention") { + w.missing(n, "retention") + } + if c := n.child("monthly_schedule"); c.exists() { + requiredPostgresMonthlySchedule(w, &c, v.MonthlySchedule) + } + if c := n.child("weekly_schedule"); c.exists() { + requiredPostgresWeeklySchedule(w, &c, v.WeeklySchedule) + } +} + +func requiredPostgresSyncedTableSyncedTableSpecExtraColumn(w *walker, n *node, v *postgres.SyncedTableSyncedTableSpecExtraColumn) { + if v == nil { + v = &postgres.SyncedTableSyncedTableSpecExtraColumn{} + } + if !(v.ColumnName != "") && !n.has("column_name") { + w.missing(n, "column_name") + } + if !(v.ColumnType != "") && !n.has("column_type") { + w.missing(n, "column_type") + } +} + +func requiredPostgresSyncedTableSyncedTableSpecTypeOverride(w *walker, n *node, v *postgres.SyncedTableSyncedTableSpecTypeOverride) { + if v == nil { + v = &postgres.SyncedTableSyncedTableSpecTypeOverride{} + } + if !(v.ColumnName != "") && !n.has("column_name") { + w.missing(n, "column_name") + } + if !(v.PgType != "") && !n.has("pg_type") { + w.missing(n, "pg_type") + } +} + +func requiredCatalogMonitorMetric(w *walker, n *node, v *catalog.MonitorMetric) { + if v == nil { + v = &catalog.MonitorMetric{} + } + if !(v.Definition != "") && !n.has("definition") { + w.missing(n, "definition") + } + if !(v.InputColumns != nil) && !n.has("input_columns") { + w.missing(n, "input_columns") + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if !(v.OutputDataType != "") && !n.has("output_data_type") { + w.missing(n, "output_data_type") + } + if !(v.Type != "") && !n.has("type") { + w.missing(n, "type") + } +} + +func requiredCatalogMonitorInferenceLog(w *walker, n *node, v *catalog.MonitorInferenceLog) { + if v == nil { + v = &catalog.MonitorInferenceLog{} + } + if !(v.Granularities != nil) && !n.has("granularities") { + w.missing(n, "granularities") + } + if !(v.ModelIdCol != "") && !n.has("model_id_col") { + w.missing(n, "model_id_col") + } + if !(v.PredictionCol != "") && !n.has("prediction_col") { + w.missing(n, "prediction_col") + } + if !(v.ProblemType != "") && !n.has("problem_type") { + w.missing(n, "problem_type") + } + if !(v.TimestampCol != "") && !n.has("timestamp_col") { + w.missing(n, "timestamp_col") + } +} + +func requiredCatalogMonitorCronSchedule(w *walker, n *node, v *catalog.MonitorCronSchedule) { + if v == nil { + v = &catalog.MonitorCronSchedule{} + } + if !(v.QuartzCronExpression != "") && !n.has("quartz_cron_expression") { + w.missing(n, "quartz_cron_expression") + } + if !(v.TimezoneId != "") && !n.has("timezone_id") { + w.missing(n, "timezone_id") + } +} + +func requiredCatalogMonitorTimeSeries(w *walker, n *node, v *catalog.MonitorTimeSeries) { + if v == nil { + v = &catalog.MonitorTimeSeries{} + } + if !(v.Granularities != nil) && !n.has("granularities") { + w.missing(n, "granularities") + } + if !(v.TimestampCol != "") && !n.has("timestamp_col") { + w.missing(n, "timestamp_col") + } +} + +func requiredWorkspaceAzureKeyVaultSecretScopeMetadata(w *walker, n *node, v *workspace.AzureKeyVaultSecretScopeMetadata) { + if v == nil { + v = &workspace.AzureKeyVaultSecretScopeMetadata{} + } + if !(v.DnsName != "") && !n.has("dns_name") { + w.missing(n, "dns_name") + } + if !(v.ResourceId != "") && !n.has("resource_id") { + w.missing(n, "resource_id") + } +} + +func requiredResourcesSecretScopePermission(w *walker, n *node, v *resources.SecretScopePermission) { + if v == nil { + v = &resources.SecretScopePermission{} + } + if !(v.Level != "") && !n.has("level") { + w.missing(n, "level") + } +} + +func requiredResourcesSqlWarehousePermission(w *walker, n *node, v *resources.SqlWarehousePermission) { + if v == nil { + v = &resources.SqlWarehousePermission{} + } + if !(v.Level != "") && !n.has("level") { + w.missing(n, "level") + } +} + +func requiredDatabaseSyncedTableSpec(w *walker, n *node, v *database.SyncedTableSpec) { + if v == nil { + v = &database.SyncedTableSpec{} + } + if len(v.TypeOverrides) > 0 { + c := n.child("type_overrides") + for i0 := range v.TypeOverrides { + e := c.elem(i0) + requiredDatabaseSyncedTableSpecTypeOverride(w, &e, &v.TypeOverrides[i0]) + } + } +} + +func requiredResourcesVectorSearchEndpointPermission(w *walker, n *node, v *resources.VectorSearchEndpointPermission) { + if v == nil { + v = &resources.VectorSearchEndpointPermission{} + } + if !(v.Level != "") && !n.has("level") { + w.missing(n, "level") + } +} + +func requiredSqlAlertV2OperandColumn(w *walker, n *node, v *sql.AlertV2OperandColumn) { + if v == nil { + v = &sql.AlertV2OperandColumn{} + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } +} + +func requiredSqlAlertV2Operand(w *walker, n *node, v *sql.AlertV2Operand) { + if v == nil { + v = &sql.AlertV2Operand{} + } + if c := n.child("column"); c.exists() { + requiredSqlAlertV2OperandColumn2(w, &c, v.Column) + } +} + +func requiredResourcesAppEnvVar(w *walker, n *node, v *resources.AppEnvVar) { + if v == nil { + v = &resources.AppEnvVar{} + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } +} + +func requiredAppsAppResourceDatabase(w *walker, n *node, v *apps.AppResourceDatabase) { + if v == nil { + v = &apps.AppResourceDatabase{} + } + if !(v.DatabaseName != "") && !n.has("database_name") { + w.missing(n, "database_name") + } + if !(v.InstanceName != "") && !n.has("instance_name") { + w.missing(n, "instance_name") + } + if !(v.Permission != "") && !n.has("permission") { + w.missing(n, "permission") + } +} + +func requiredAppsAppResourceExperiment(w *walker, n *node, v *apps.AppResourceExperiment) { + if v == nil { + v = &apps.AppResourceExperiment{} + } + if !(v.ExperimentId != "") && !n.has("experiment_id") { + w.missing(n, "experiment_id") + } + if !(v.Permission != "") && !n.has("permission") { + w.missing(n, "permission") + } +} + +func requiredAppsAppResourceGenieSpace(w *walker, n *node, v *apps.AppResourceGenieSpace) { + if v == nil { + v = &apps.AppResourceGenieSpace{} + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if !(v.Permission != "") && !n.has("permission") { + w.missing(n, "permission") + } + if !(v.SpaceId != "") && !n.has("space_id") { + w.missing(n, "space_id") + } +} + +func requiredAppsAppResourceJob(w *walker, n *node, v *apps.AppResourceJob) { + if v == nil { + v = &apps.AppResourceJob{} + } + if !(v.Id != "") && !n.has("id") { + w.missing(n, "id") + } + if !(v.Permission != "") && !n.has("permission") { + w.missing(n, "permission") + } +} + +func requiredAppsAppResourceSecret(w *walker, n *node, v *apps.AppResourceSecret) { + if v == nil { + v = &apps.AppResourceSecret{} + } + if !(v.Key != "") && !n.has("key") { + w.missing(n, "key") + } + if !(v.Permission != "") && !n.has("permission") { + w.missing(n, "permission") + } + if !(v.Scope != "") && !n.has("scope") { + w.missing(n, "scope") + } +} + +func requiredAppsAppResourceServingEndpoint(w *walker, n *node, v *apps.AppResourceServingEndpoint) { + if v == nil { + v = &apps.AppResourceServingEndpoint{} + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if !(v.Permission != "") && !n.has("permission") { + w.missing(n, "permission") + } +} + +func requiredAppsAppResourceSqlWarehouse(w *walker, n *node, v *apps.AppResourceSqlWarehouse) { + if v == nil { + v = &apps.AppResourceSqlWarehouse{} + } + if !(v.Id != "") && !n.has("id") { + w.missing(n, "id") + } + if !(v.Permission != "") && !n.has("permission") { + w.missing(n, "permission") + } +} + +func requiredAppsAppResourceUcSecurable(w *walker, n *node, v *apps.AppResourceUcSecurable) { + if v == nil { + v = &apps.AppResourceUcSecurable{} + } + if !(v.Permission != "") && !n.has("permission") { + w.missing(n, "permission") + } + if !(v.SecurableFullName != "") && !n.has("securable_full_name") { + w.missing(n, "securable_full_name") + } + if !(v.SecurableType != "") && !n.has("securable_type") { + w.missing(n, "securable_type") + } +} + +func requiredAppsUnityCatalog(w *walker, n *node, v *apps.UnityCatalog) { + if v == nil { + v = &apps.UnityCatalog{} + } + if !(v.LogsTable != "") && !n.has("logs_table") { + w.missing(n, "logs_table") + } + if !(v.MetricsTable != "") && !n.has("metrics_table") { + w.missing(n, "metrics_table") + } + if !(v.TracesTable != "") && !n.has("traces_table") { + w.missing(n, "traces_table") + } +} + +func requiredCatalogAzureEncryptionSettings(w *walker, n *node, v *catalog.AzureEncryptionSettings) { + if v == nil { + v = &catalog.AzureEncryptionSettings{} + } + if !(v.AzureTenantId != "") && !n.has("azure_tenant_id") { + w.missing(n, "azure_tenant_id") + } +} + +func requiredComputeRCranLibrary(w *walker, n *node, v *compute.RCranLibrary) { + if v == nil { + v = &compute.RCranLibrary{} + } + if !(v.Package != "") && !n.has("package") { + w.missing(n, "package") + } +} + +func requiredComputeMavenLibrary(w *walker, n *node, v *compute.MavenLibrary) { + if v == nil { + v = &compute.MavenLibrary{} + } + if !(v.Coordinates != "") && !n.has("coordinates") { + w.missing(n, "coordinates") + } +} + +func requiredComputePythonPyPiLibrary(w *walker, n *node, v *compute.PythonPyPiLibrary) { + if v == nil { + v = &compute.PythonPyPiLibrary{} + } + if !(v.Package != "") && !n.has("package") { + w.missing(n, "package") + } +} + +func requiredComputeDbfsStorageInfo(w *walker, n *node, v *compute.DbfsStorageInfo) { + if v == nil { + v = &compute.DbfsStorageInfo{} + } + if !(v.Destination != "") && !n.has("destination") { + w.missing(n, "destination") + } +} + +func requiredComputeS3StorageInfo(w *walker, n *node, v *compute.S3StorageInfo) { + if v == nil { + v = &compute.S3StorageInfo{} + } + if !(v.Destination != "") && !n.has("destination") { + w.missing(n, "destination") + } +} + +func requiredComputeVolumesStorageInfo(w *walker, n *node, v *compute.VolumesStorageInfo) { + if v == nil { + v = &compute.VolumesStorageInfo{} + } + if !(v.Destination != "") && !n.has("destination") { + w.missing(n, "destination") + } +} + +func requiredComputeAdlsgen2Info(w *walker, n *node, v *compute.Adlsgen2Info) { + if v == nil { + v = &compute.Adlsgen2Info{} + } + if !(v.Destination != "") && !n.has("destination") { + w.missing(n, "destination") + } +} + +func requiredComputeLocalFileInfo(w *walker, n *node, v *compute.LocalFileInfo) { + if v == nil { + v = &compute.LocalFileInfo{} + } + if !(v.Destination != "") && !n.has("destination") { + w.missing(n, "destination") + } +} + +func requiredComputeGcsStorageInfo(w *walker, n *node, v *compute.GcsStorageInfo) { + if v == nil { + v = &compute.GcsStorageInfo{} + } + if !(v.Destination != "") && !n.has("destination") { + w.missing(n, "destination") + } +} + +func requiredComputeWorkspaceStorageInfo(w *walker, n *node, v *compute.WorkspaceStorageInfo) { + if v == nil { + v = &compute.WorkspaceStorageInfo{} + } + if !(v.Destination != "") && !n.has("destination") { + w.missing(n, "destination") + } +} + +func requiredMlUcTraceLocation(w *walker, n *node, v *ml.UcTraceLocation) { + if v == nil { + v = &ml.UcTraceLocation{} + } + if !(v.Catalog != "") && !n.has("catalog") { + w.missing(n, "catalog") + } + if !(v.Schema != "") && !n.has("schema") { + w.missing(n, "schema") + } +} + +func requiredMlAggregationFunction(w *walker, n *node, v *ml.AggregationFunction) { + if v == nil { + v = &ml.AggregationFunction{} + } + if c := n.child("approx_count_distinct"); c.exists() { + requiredMlApproxCountDistinctFunction(w, &c, v.ApproxCountDistinct) + } + if c := n.child("approx_percentile"); c.exists() { + requiredMlApproxPercentileFunction(w, &c, v.ApproxPercentile) + } + if c := n.child("avg"); c.exists() { + requiredMlAvgFunction(w, &c, v.Avg) + } + if c := n.child("count_function"); c.exists() { + requiredMlCountFunction(w, &c, v.CountFunction) + } + if c := n.child("first"); c.exists() { + requiredMlFirstFunction(w, &c, v.First) + } + if c := n.child("first_distinct"); c.exists() { + requiredMlFirstDistinctFunction(w, &c, v.FirstDistinct) + } + if c := n.child("first_n"); c.exists() { + requiredMlFirstNFunction(w, &c, v.FirstN) + } + if c := n.child("last"); c.exists() { + requiredMlLastFunction(w, &c, v.Last) + } + if c := n.child("last_distinct"); c.exists() { + requiredMlLastDistinctFunction(w, &c, v.LastDistinct) + } + if c := n.child("last_n"); c.exists() { + requiredMlLastNFunction(w, &c, v.LastN) + } + if c := n.child("max"); c.exists() { + requiredMlMaxFunction(w, &c, v.Max) + } + if c := n.child("min"); c.exists() { + requiredMlMinFunction(w, &c, v.Min) + } + if c := n.child("stddev_pop"); c.exists() { + requiredMlStddevPopFunction(w, &c, v.StddevPop) + } + if c := n.child("stddev_samp"); c.exists() { + requiredMlStddevSampFunction(w, &c, v.StddevSamp) + } + if c := n.child("sum"); c.exists() { + requiredMlSumFunction(w, &c, v.Sum) + } + if c := n.child("time_window"); c.exists() { + requiredMlTimeWindow(w, &c, v.TimeWindow) + } + if c := n.child("var_pop"); c.exists() { + requiredMlVarPopFunction(w, &c, v.VarPop) + } + if c := n.child("var_samp"); c.exists() { + requiredMlVarSampFunction(w, &c, v.VarSamp) + } +} + +func requiredMlColumnSelection(w *walker, n *node, v *ml.ColumnSelection) { + if v == nil { + v = &ml.ColumnSelection{} + } + if !(v.Column != "") && !n.has("column") { + w.missing(n, "column") + } +} + +func requiredMlCustomUdf(w *walker, n *node, v *ml.CustomUdf) { + if v == nil { + v = &ml.CustomUdf{} + } + if !(v.FunctionPath != "") && !n.has("function_path") { + w.missing(n, "function_path") + } + if len(v.InputBindings) > 0 { + c := n.child("input_bindings") + for i0 := range v.InputBindings { + e := c.elem(i0) + requiredMlInputBinding(w, &e, &v.InputBindings[i0]) + } + } +} + +func requiredMlFunctionExtraParameter(w *walker, n *node, v *ml.FunctionExtraParameter) { + if v == nil { + v = &ml.FunctionExtraParameter{} + } + if !(v.Key != "") && !n.has("key") { + w.missing(n, "key") + } + if !(v.Value != "") && !n.has("value") { + w.missing(n, "value") + } +} + +func requiredMlDeltaTableSource(w *walker, n *node, v *ml.DeltaTableSource) { + if v == nil { + v = &ml.DeltaTableSource{} + } + if !(v.FullName != "") && !n.has("full_name") { + w.missing(n, "full_name") + } +} + +func requiredMlFeatureViewSource(w *walker, n *node, v *ml.FeatureViewSource) { + if v == nil { + v = &ml.FeatureViewSource{} + } + if len(v.FeatureReferences) > 0 { + c := n.child("feature_references") + for i0 := range v.FeatureReferences { + e := c.elem(i0) + requiredMlFeatureReference(w, &e, &v.FeatureReferences[i0]) + } + } +} + +func requiredMlKafkaSource(w *walker, n *node, v *ml.KafkaSource) { + if v == nil { + v = &ml.KafkaSource{} + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if len(v.EntityColumnIdentifiers) > 0 { + c := n.child("entity_column_identifiers") + for i0 := range v.EntityColumnIdentifiers { + e := c.elem(i0) + requiredMlColumnIdentifier(w, &e, &v.EntityColumnIdentifiers[i0]) + } + } + if c := n.child("timeseries_column_identifier"); c.exists() { + requiredMlColumnIdentifier2(w, &c, v.TimeseriesColumnIdentifier) + } +} + +func requiredMlRequestSource(w *walker, n *node, v *ml.RequestSource) { + if v == nil { + v = &ml.RequestSource{} + } + if c := n.child("flat_schema"); c.exists() { + requiredMlFlatSchema(w, &c, v.FlatSchema) + } +} + +func requiredMlStreamSource(w *walker, n *node, v *ml.StreamSource) { + if v == nil { + v = &ml.StreamSource{} + } + if !(v.FullName != "") && !n.has("full_name") { + w.missing(n, "full_name") + } +} + +func requiredMlContinuousWindow(w *walker, n *node, v *ml.ContinuousWindow) { + if v == nil { + v = &ml.ContinuousWindow{} + } + if !(v.WindowDuration != "") && !n.has("window_duration") { + w.missing(n, "window_duration") + } +} + +func requiredMlSlidingWindow(w *walker, n *node, v *ml.SlidingWindow) { + if v == nil { + v = &ml.SlidingWindow{} + } + if !(v.SlideDuration != "") && !n.has("slide_duration") { + w.missing(n, "slide_duration") + } +} + +func requiredMlTumblingWindow(w *walker, n *node, v *ml.TumblingWindow) { + if v == nil { + v = &ml.TumblingWindow{} + } + if !(v.WindowDuration != "") && !n.has("window_duration") { + w.missing(n, "window_duration") + } +} + +func requiredJobsMaintenanceWindow(w *walker, n *node, v *jobs.MaintenanceWindow) { + if v == nil { + v = &jobs.MaintenanceWindow{} + } + if !(v.DayOfWeek != "") && !n.has("day_of_week") { + w.missing(n, "day_of_week") + } + if !(v.StartHour != 0) && !n.has("start_hour") { + w.missing(n, "start_hour") + } + if !(v.TimezoneId != "") && !n.has("timezone_id") { + w.missing(n, "timezone_id") + } +} + +func requiredJobsJobSource(w *walker, n *node, v *jobs.JobSource) { + if v == nil { + v = &jobs.JobSource{} + } + if !(v.ImportFromGitBranch != "") && !n.has("import_from_git_branch") { + w.missing(n, "import_from_git_branch") + } + if !(v.JobConfigPath != "") && !n.has("job_config_path") { + w.missing(n, "job_config_path") + } +} + +func requiredJobsJobsHealthRule(w *walker, n *node, v *jobs.JobsHealthRule) { + if v == nil { + v = &jobs.JobsHealthRule{} + } + if !(v.Metric != "") && !n.has("metric") { + w.missing(n, "metric") + } + if !(v.Op != "") && !n.has("op") { + w.missing(n, "op") + } + if !(v.Value != 0) && !n.has("value") { + w.missing(n, "value") + } +} + +func requiredComputeClusterSpec(w *walker, n *node, v *compute.ClusterSpec) { + if v == nil { + v = &compute.ClusterSpec{} + } + if c := n.child("cluster_log_conf"); c.exists() { + requiredComputeClusterLogConf(w, &c, v.ClusterLogConf) + } + if len(v.InitScripts) > 0 { + c := n.child("init_scripts") + for i0 := range v.InitScripts { + e := c.elem(i0) + requiredComputeInitScriptInfo(w, &e, &v.InitScripts[i0]) + } + } + if c := n.child("workload_type"); c.exists() { + requiredComputeWorkloadType(w, &c, v.WorkloadType) + } +} + +func requiredJobsSqlConditionConfiguration(w *walker, n *node, v *jobs.SqlConditionConfiguration) { + if v == nil { + v = &jobs.SqlConditionConfiguration{} + } + if !(v.SqlQueryId != "") && !n.has("sql_query_id") { + w.missing(n, "sql_query_id") + } + if !(v.WarehouseId != "") && !n.has("warehouse_id") { + w.missing(n, "warehouse_id") + } +} + +func requiredJobsAiRuntimeTask(w *walker, n *node, v *jobs.AiRuntimeTask) { + if v == nil { + v = &jobs.AiRuntimeTask{} + } + if !(v.Deployments != nil) && !n.has("deployments") { + w.missing(n, "deployments") + } + if !(v.Experiment != "") && !n.has("experiment") { + w.missing(n, "experiment") + } + if len(v.Deployments) > 0 { + c := n.child("deployments") + for i0 := range v.Deployments { + e := c.elem(i0) + requiredJobsDeploymentSpec(w, &e, &v.Deployments[i0]) + } + } +} + +func requiredJobsCleanRoomsNotebookTask(w *walker, n *node, v *jobs.CleanRoomsNotebookTask) { + if v == nil { + v = &jobs.CleanRoomsNotebookTask{} + } + if !(v.CleanRoomName != "") && !n.has("clean_room_name") { + w.missing(n, "clean_room_name") + } + if !(v.NotebookName != "") && !n.has("notebook_name") { + w.missing(n, "notebook_name") + } +} + +func requiredJobsConditionTask(w *walker, n *node, v *jobs.ConditionTask) { + if v == nil { + v = &jobs.ConditionTask{} + } + if !(v.Left != "") && !n.has("left") { + w.missing(n, "left") + } + if !(v.Op != "") && !n.has("op") { + w.missing(n, "op") + } + if !(v.Right != "") && !n.has("right") { + w.missing(n, "right") + } +} + +func requiredJobsDbtTask(w *walker, n *node, v *jobs.DbtTask) { + if v == nil { + v = &jobs.DbtTask{} + } + if !(v.Commands != nil) && !n.has("commands") { + w.missing(n, "commands") + } +} + +func requiredJobsTaskDependency(w *walker, n *node, v *jobs.TaskDependency) { + if v == nil { + v = &jobs.TaskDependency{} + } + if !(v.TaskKey != "") && !n.has("task_key") { + w.missing(n, "task_key") + } +} + +func requiredJobsForEachTask(w *walker, n *node, v *jobs.ForEachTask) { + if v == nil { + v = &jobs.ForEachTask{} + } + if !(v.Inputs != "") && !n.has("inputs") { + w.missing(n, "inputs") + } + if !n.has("task") { + w.missing(n, "task") + } + if c := n.child("task"); c.exists() { + requiredJobsTask2(w, &c, &v.Task) + } +} + +func requiredJobsGenAiComputeTask(w *walker, n *node, v *jobs.GenAiComputeTask) { + if v == nil { + v = &jobs.GenAiComputeTask{} + } + if !(v.DlRuntimeImage != "") && !n.has("dl_runtime_image") { + w.missing(n, "dl_runtime_image") + } + if c := n.child("compute"); c.exists() { + requiredJobsComputeConfig(w, &c, v.Compute) + } +} + +func requiredJobsNotebookTask(w *walker, n *node, v *jobs.NotebookTask) { + if v == nil { + v = &jobs.NotebookTask{} + } + if !(v.NotebookPath != "") && !n.has("notebook_path") { + w.missing(n, "notebook_path") + } +} + +func requiredJobsPipelineTask(w *walker, n *node, v *jobs.PipelineTask) { + if v == nil { + v = &jobs.PipelineTask{} + } + if !(v.PipelineId != "") && !n.has("pipeline_id") { + w.missing(n, "pipeline_id") + } +} + +func requiredJobsPythonWheelTask(w *walker, n *node, v *jobs.PythonWheelTask) { + if v == nil { + v = &jobs.PythonWheelTask{} + } + if !(v.EntryPoint != "") && !n.has("entry_point") { + w.missing(n, "entry_point") + } + if !(v.PackageName != "") && !n.has("package_name") { + w.missing(n, "package_name") + } +} + +func requiredJobsRunJobTask(w *walker, n *node, v *jobs.RunJobTask) { + if v == nil { + v = &jobs.RunJobTask{} + } + if !(v.JobId != 0) && !n.has("job_id") { + w.missing(n, "job_id") + } +} + +func requiredJobsSparkPythonTask(w *walker, n *node, v *jobs.SparkPythonTask) { + if v == nil { + v = &jobs.SparkPythonTask{} + } + if !(v.PythonFile != "") && !n.has("python_file") { + w.missing(n, "python_file") + } +} + +func requiredJobsSqlTask(w *walker, n *node, v *jobs.SqlTask) { + if v == nil { + v = &jobs.SqlTask{} + } + if !(v.WarehouseId != "") && !n.has("warehouse_id") { + w.missing(n, "warehouse_id") + } + if c := n.child("alert"); c.exists() { + requiredJobsSqlTaskAlert(w, &c, v.Alert) + } + if c := n.child("dashboard"); c.exists() { + requiredJobsSqlTaskDashboard(w, &c, v.Dashboard) + } + if c := n.child("file"); c.exists() { + requiredJobsSqlTaskFile(w, &c, v.File) + } + if c := n.child("query"); c.exists() { + requiredJobsSqlTaskQuery(w, &c, v.Query) + } +} + +func requiredJobsFileArrivalTriggerConfiguration(w *walker, n *node, v *jobs.FileArrivalTriggerConfiguration) { + if v == nil { + v = &jobs.FileArrivalTriggerConfiguration{} + } + if !(v.Url != "") && !n.has("url") { + w.missing(n, "url") + } +} + +func requiredJobsModelTriggerConfiguration(w *walker, n *node, v *jobs.ModelTriggerConfiguration) { + if v == nil { + v = &jobs.ModelTriggerConfiguration{} + } + if !(v.Condition != "") && !n.has("condition") { + w.missing(n, "condition") + } +} + +func requiredJobsPeriodicTriggerConfiguration(w *walker, n *node, v *jobs.PeriodicTriggerConfiguration) { + if v == nil { + v = &jobs.PeriodicTriggerConfiguration{} + } + if !(v.Interval != 0) && !n.has("interval") { + w.missing(n, "interval") + } + if !(v.Unit != "") && !n.has("unit") { + w.missing(n, "unit") + } +} + +func requiredJobsTableUpdateTriggerConfiguration(w *walker, n *node, v *jobs.TableUpdateTriggerConfiguration) { + if v == nil { + v = &jobs.TableUpdateTriggerConfiguration{} + } + if !(v.TableNames != nil) && !n.has("table_names") { + w.missing(n, "table_names") + } +} + +func requiredJobsContinuousTriggerConfiguration(w *walker, n *node, v *jobs.ContinuousTriggerConfiguration) { + if v == nil { + v = &jobs.ContinuousTriggerConfiguration{} + } + if c := n.child("maintenance_window"); c.exists() { + requiredJobsMaintenanceWindow(w, &c, v.MaintenanceWindow) + } +} + +func requiredJobsCronTriggerConfiguration(w *walker, n *node, v *jobs.CronTriggerConfiguration) { + if v == nil { + v = &jobs.CronTriggerConfiguration{} + } + if !(v.QuartzCronExpression != "") && !n.has("quartz_cron_expression") { + w.missing(n, "quartz_cron_expression") + } + if !(v.TimezoneId != "") && !n.has("timezone_id") { + w.missing(n, "timezone_id") + } +} + +func requiredJobsWebhook(w *walker, n *node, v *jobs.Webhook) { + if v == nil { + v = &jobs.Webhook{} + } + if !(v.Id != "") && !n.has("id") { + w.missing(n, "id") + } +} + +func requiredCatalogRateLimit(w *walker, n *node, v *catalog.RateLimit) { + if v == nil { + v = &catalog.RateLimit{} + } + if !(v.Key != "") && !n.has("key") { + w.missing(n, "key") + } + if !(v.RenewalPeriod != "") && !n.has("renewal_period") { + w.missing(n, "renewal_period") + } +} + +func requiredCatalogMcpServiceConfigSourceConnection(w *walker, n *node, v *catalog.McpServiceConfigSourceConnection) { + if v == nil { + v = &catalog.McpServiceConfigSourceConnection{} + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } +} + +func requiredCatalogModelProviderServiceConfigAmazonBedrockProviderConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfigAmazonBedrockProviderConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfigAmazonBedrockProviderConfig{} + } + if c := n.child("direct"); c.exists() { + requiredCatalogModelProviderServiceConfigAmazonBedrockProviderDirectConfig(w, &c, v.Direct) + } +} + +func requiredCatalogModelProviderServiceConfigAnthropicProviderConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfigAnthropicProviderConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfigAnthropicProviderConfig{} + } + if c := n.child("direct"); c.exists() { + requiredCatalogModelProviderServiceConfigAnthropicProviderDirectConfig(w, &c, v.Direct) + } +} + +func requiredCatalogModelProviderServiceConfigAzureOpenAiProviderConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfigAzureOpenAiProviderConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfigAzureOpenAiProviderConfig{} + } + if c := n.child("direct"); c.exists() { + requiredCatalogModelProviderServiceConfigAzureOpenAiProviderDirectConfig(w, &c, v.Direct) + } +} + +func requiredCatalogModelProviderServiceConfigCustomProviderConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfigCustomProviderConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfigCustomProviderConfig{} + } + if c := n.child("direct"); c.exists() { + requiredCatalogModelProviderServiceConfigCustomProviderDirectConfig(w, &c, v.Direct) + } +} + +func requiredCatalogModelProviderServiceConfigGeminiEnterpriseProviderConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfigGeminiEnterpriseProviderConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfigGeminiEnterpriseProviderConfig{} + } + if c := n.child("direct"); c.exists() { + requiredCatalogModelProviderServiceConfigGeminiEnterpriseProviderDirectConfig(w, &c, v.Direct) + } +} + +func requiredCatalogInferenceTableConfig(w *walker, n *node, v *catalog.InferenceTableConfig) { + if v == nil { + v = &catalog.InferenceTableConfig{} + } + if !(v.Parent != "") && !n.has("parent") { + w.missing(n, "parent") + } +} + +func requiredCatalogModelProviderServiceConfigMicrosoftFoundryProviderConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfigMicrosoftFoundryProviderConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfigMicrosoftFoundryProviderConfig{} + } + if c := n.child("direct"); c.exists() { + requiredCatalogModelProviderServiceConfigMicrosoftFoundryProviderDirectConfig(w, &c, v.Direct) + } +} + +func requiredCatalogModelProviderServiceConfigOpenAiProviderConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfigOpenAiProviderConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfigOpenAiProviderConfig{} + } + if c := n.child("direct"); c.exists() { + requiredCatalogModelProviderServiceConfigOpenAiProviderDirectConfig(w, &c, v.Direct) + } +} + +func requiredCatalogModelProviderServiceConfigModelTargetConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfigModelTargetConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfigModelTargetConfig{} + } + if !(v.Model != "") && !n.has("model") { + w.missing(n, "model") + } +} + +func requiredCatalogModelServiceConfigRoutingConfig(w *walker, n *node, v *catalog.ModelServiceConfigRoutingConfig) { + if v == nil { + v = &catalog.ModelServiceConfigRoutingConfig{} + } + if len(v.Destinations) > 0 { + c := n.child("destinations") + for i0 := range v.Destinations { + e := c.elem(i0) + requiredCatalogModelServiceConfigDestinationConfig(w, &e, &v.Destinations[i0]) + } + } + if c := n.child("fallback"); c.exists() { + requiredCatalogModelServiceConfigFallbackConfig(w, &c, v.Fallback) + } +} + +func requiredServingFallbackConfig(w *walker, n *node, v *serving.FallbackConfig) { + if v == nil { + v = &serving.FallbackConfig{} + } + if !(v.Enabled) && !n.has("enabled") { + w.missing(n, "enabled") + } +} + +func requiredServingAiGatewayRateLimit(w *walker, n *node, v *serving.AiGatewayRateLimit) { + if v == nil { + v = &serving.AiGatewayRateLimit{} + } + if !(v.RenewalPeriod != "") && !n.has("renewal_period") { + w.missing(n, "renewal_period") + } +} + +func requiredServingServedEntityInput(w *walker, n *node, v *serving.ServedEntityInput) { + if v == nil { + v = &serving.ServedEntityInput{} + } + if c := n.child("external_model"); c.exists() { + requiredServingExternalModel(w, &c, v.ExternalModel) + } +} + +func requiredServingServedModelInput(w *walker, n *node, v *serving.ServedModelInput) { + if v == nil { + v = &serving.ServedModelInput{} + } + if !(v.ModelName != "") && !n.has("model_name") { + w.missing(n, "model_name") + } + if !(v.ModelVersion != "") && !n.has("model_version") { + w.missing(n, "model_version") + } + if !(v.ScaleToZeroEnabled) && !n.has("scale_to_zero_enabled") { + w.missing(n, "scale_to_zero_enabled") + } +} + +func requiredServingTrafficConfig(w *walker, n *node, v *serving.TrafficConfig) { + if v == nil { + v = &serving.TrafficConfig{} + } + if len(v.Routes) > 0 { + c := n.child("routes") + for i0 := range v.Routes { + e := c.elem(i0) + requiredServingRoute(w, &e, &v.Routes[i0]) + } + } +} + +func requiredPipelinesPipelineClusterAutoscale(w *walker, n *node, v *pipelines.PipelineClusterAutoscale) { + if v == nil { + v = &pipelines.PipelineClusterAutoscale{} + } + if !(v.MaxWorkers != 0) && !n.has("max_workers") { + w.missing(n, "max_workers") + } + if !(v.MinWorkers != 0) && !n.has("min_workers") { + w.missing(n, "min_workers") + } +} + +func requiredPipelinesDataStagingOptions(w *walker, n *node, v *pipelines.DataStagingOptions) { + if v == nil { + v = &pipelines.DataStagingOptions{} + } + if !(v.CatalogName != "") && !n.has("catalog_name") { + w.missing(n, "catalog_name") + } + if !(v.SchemaName != "") && !n.has("schema_name") { + w.missing(n, "schema_name") + } +} + +func requiredPipelinesOperationTimeWindow(w *walker, n *node, v *pipelines.OperationTimeWindow) { + if v == nil { + v = &pipelines.OperationTimeWindow{} + } + if !(v.StartHour != 0) && !n.has("start_hour") { + w.missing(n, "start_hour") + } +} + +func requiredPipelinesIngestionConfig(w *walker, n *node, v *pipelines.IngestionConfig) { + if v == nil { + v = &pipelines.IngestionConfig{} + } + if c := n.child("report"); c.exists() { + requiredPipelinesReportSpec(w, &c, v.Report) + } + if c := n.child("schema"); c.exists() { + requiredPipelinesSchemaSpec(w, &c, v.Schema) + } + if c := n.child("table"); c.exists() { + requiredPipelinesTableSpec(w, &c, v.Table) + } +} + +func requiredPipelinesTableSpecificConfig(w *walker, n *node, v *pipelines.TableSpecificConfig) { + if v == nil { + v = &pipelines.TableSpecificConfig{} + } + if c := n.child("auto_full_refresh_policy"); c.exists() { + requiredPipelinesAutoFullRefreshPolicy(w, &c, v.AutoFullRefreshPolicy) + } +} + +func requiredPostgresMonthlySchedule(w *walker, n *node, v *postgres.MonthlySchedule) { + if v == nil { + v = &postgres.MonthlySchedule{} + } + if !(v.Day != 0) && !n.has("day") { + w.missing(n, "day") + } +} + +func requiredPostgresWeeklySchedule(w *walker, n *node, v *postgres.WeeklySchedule) { + if v == nil { + v = &postgres.WeeklySchedule{} + } + if !(v.DayOfWeek != "") && !n.has("day_of_week") { + w.missing(n, "day_of_week") + } +} + +func requiredDatabaseSyncedTableSpecTypeOverride(w *walker, n *node, v *database.SyncedTableSpecTypeOverride) { + if v == nil { + v = &database.SyncedTableSpecTypeOverride{} + } + if !(v.ColumnName != "") && !n.has("column_name") { + w.missing(n, "column_name") + } + if !(v.PgType != "") && !n.has("pg_type") { + w.missing(n, "pg_type") + } +} + +func requiredSqlAlertV2OperandColumn2(w *walker, n *node, v *sql.AlertV2OperandColumn) { + if v == nil { + v = &sql.AlertV2OperandColumn{} + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } +} + +func requiredMlApproxCountDistinctFunction(w *walker, n *node, v *ml.ApproxCountDistinctFunction) { + if v == nil { + v = &ml.ApproxCountDistinctFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } +} + +func requiredMlApproxPercentileFunction(w *walker, n *node, v *ml.ApproxPercentileFunction) { + if v == nil { + v = &ml.ApproxPercentileFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } + if !(v.Percentile != 0) && !n.has("percentile") { + w.missing(n, "percentile") + } +} + +func requiredMlAvgFunction(w *walker, n *node, v *ml.AvgFunction) { + if v == nil { + v = &ml.AvgFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } +} + +func requiredMlCountFunction(w *walker, n *node, v *ml.CountFunction) { + if v == nil { + v = &ml.CountFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } +} + +func requiredMlFirstFunction(w *walker, n *node, v *ml.FirstFunction) { + if v == nil { + v = &ml.FirstFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } +} + +func requiredMlFirstDistinctFunction(w *walker, n *node, v *ml.FirstDistinctFunction) { + if v == nil { + v = &ml.FirstDistinctFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } + if !(v.N != 0) && !n.has("n") { + w.missing(n, "n") + } +} + +func requiredMlFirstNFunction(w *walker, n *node, v *ml.FirstNFunction) { + if v == nil { + v = &ml.FirstNFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } + if !(v.N != 0) && !n.has("n") { + w.missing(n, "n") + } +} + +func requiredMlLastFunction(w *walker, n *node, v *ml.LastFunction) { + if v == nil { + v = &ml.LastFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } +} + +func requiredMlLastDistinctFunction(w *walker, n *node, v *ml.LastDistinctFunction) { + if v == nil { + v = &ml.LastDistinctFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } + if !(v.N != 0) && !n.has("n") { + w.missing(n, "n") + } +} + +func requiredMlLastNFunction(w *walker, n *node, v *ml.LastNFunction) { + if v == nil { + v = &ml.LastNFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } + if !(v.N != 0) && !n.has("n") { + w.missing(n, "n") + } +} + +func requiredMlMaxFunction(w *walker, n *node, v *ml.MaxFunction) { + if v == nil { + v = &ml.MaxFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } +} + +func requiredMlMinFunction(w *walker, n *node, v *ml.MinFunction) { + if v == nil { + v = &ml.MinFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } +} + +func requiredMlStddevPopFunction(w *walker, n *node, v *ml.StddevPopFunction) { + if v == nil { + v = &ml.StddevPopFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } +} + +func requiredMlStddevSampFunction(w *walker, n *node, v *ml.StddevSampFunction) { + if v == nil { + v = &ml.StddevSampFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } +} + +func requiredMlSumFunction(w *walker, n *node, v *ml.SumFunction) { + if v == nil { + v = &ml.SumFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } +} + +func requiredMlVarPopFunction(w *walker, n *node, v *ml.VarPopFunction) { + if v == nil { + v = &ml.VarPopFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } +} + +func requiredMlVarSampFunction(w *walker, n *node, v *ml.VarSampFunction) { + if v == nil { + v = &ml.VarSampFunction{} + } + if !(v.Input != "") && !n.has("input") { + w.missing(n, "input") + } +} + +func requiredMlInputBinding(w *walker, n *node, v *ml.InputBinding) { + if v == nil { + v = &ml.InputBinding{} + } + if !(v.Column != "") && !n.has("column") { + w.missing(n, "column") + } + if !(v.Parameter != "") && !n.has("parameter") { + w.missing(n, "parameter") + } +} + +func requiredMlFeatureReference(w *walker, n *node, v *ml.FeatureReference) { + if v == nil { + v = &ml.FeatureReference{} + } + if !(v.Feature != "") && !n.has("feature") { + w.missing(n, "feature") + } +} + +func requiredMlColumnIdentifier(w *walker, n *node, v *ml.ColumnIdentifier) { + if v == nil { + v = &ml.ColumnIdentifier{} + } + if !(v.VariantExprPath != "") && !n.has("variant_expr_path") { + w.missing(n, "variant_expr_path") + } +} + +func requiredMlColumnIdentifier2(w *walker, n *node, v *ml.ColumnIdentifier) { + if v == nil { + v = &ml.ColumnIdentifier{} + } + if !(v.VariantExprPath != "") && !n.has("variant_expr_path") { + w.missing(n, "variant_expr_path") + } +} + +func requiredMlFlatSchema(w *walker, n *node, v *ml.FlatSchema) { + if v == nil { + v = &ml.FlatSchema{} + } + if !(v.Fields != nil) && !n.has("fields") { + w.missing(n, "fields") + } + if len(v.Fields) > 0 { + c := n.child("fields") + for i0 := range v.Fields { + e := c.elem(i0) + requiredMlFieldDefinition(w, &e, &v.Fields[i0]) + } + } +} + +func requiredJobsDeploymentSpec(w *walker, n *node, v *jobs.DeploymentSpec) { + if v == nil { + v = &jobs.DeploymentSpec{} + } + if !n.has("compute") { + w.missing(n, "compute") + } + if c := n.child("compute"); c.exists() { + requiredJobsComputeSpec(w, &c, &v.Compute) + } +} + +func requiredJobsTask2(w *walker, n *node, v *jobs.Task) { + if v == nil { + v = &jobs.Task{} + } + if !(v.TaskKey != "") && !n.has("task_key") { + w.missing(n, "task_key") + } + if c := n.child("ai_runtime_task"); c.exists() { + requiredJobsAiRuntimeTask(w, &c, v.AiRuntimeTask) + } + if c := n.child("clean_rooms_notebook_task"); c.exists() { + requiredJobsCleanRoomsNotebookTask(w, &c, v.CleanRoomsNotebookTask) + } + if c := n.child("condition_task"); c.exists() { + requiredJobsConditionTask(w, &c, v.ConditionTask) + } + if c := n.child("dbt_task"); c.exists() { + requiredJobsDbtTask(w, &c, v.DbtTask) + } + if len(v.DependsOn) > 0 { + c := n.child("depends_on") + for i0 := range v.DependsOn { + e := c.elem(i0) + requiredJobsTaskDependency(w, &e, &v.DependsOn[i0]) + } + } + if c := n.child("for_each_task"); c.exists() { + requiredJobsForEachTask2(w, &c, v.ForEachTask) + } + if c := n.child("gen_ai_compute_task"); c.exists() { + requiredJobsGenAiComputeTask(w, &c, v.GenAiComputeTask) + } + if c := n.child("health"); c.exists() { + requiredJobsJobsHealthRules(w, &c, v.Health) + } + if len(v.Libraries) > 0 { + c := n.child("libraries") + for i0 := range v.Libraries { + e := c.elem(i0) + requiredComputeLibrary(w, &e, &v.Libraries[i0]) + } + } + if c := n.child("new_cluster"); c.exists() { + requiredComputeClusterSpec(w, &c, v.NewCluster) + } + if c := n.child("notebook_task"); c.exists() { + requiredJobsNotebookTask(w, &c, v.NotebookTask) + } + if c := n.child("pipeline_task"); c.exists() { + requiredJobsPipelineTask(w, &c, v.PipelineTask) + } + if c := n.child("python_wheel_task"); c.exists() { + requiredJobsPythonWheelTask(w, &c, v.PythonWheelTask) + } + if c := n.child("run_job_task"); c.exists() { + requiredJobsRunJobTask(w, &c, v.RunJobTask) + } + if c := n.child("spark_python_task"); c.exists() { + requiredJobsSparkPythonTask(w, &c, v.SparkPythonTask) + } + if c := n.child("sql_task"); c.exists() { + requiredJobsSqlTask(w, &c, v.SqlTask) + } + if c := n.child("webhook_notifications"); c.exists() { + requiredJobsWebhookNotifications(w, &c, v.WebhookNotifications) + } +} + +func requiredJobsComputeConfig(w *walker, n *node, v *jobs.ComputeConfig) { + if v == nil { + v = &jobs.ComputeConfig{} + } + if !(v.NumGpus != 0) && !n.has("num_gpus") { + w.missing(n, "num_gpus") + } +} + +func requiredJobsSqlTaskAlert(w *walker, n *node, v *jobs.SqlTaskAlert) { + if v == nil { + v = &jobs.SqlTaskAlert{} + } + if !(v.AlertId != "") && !n.has("alert_id") { + w.missing(n, "alert_id") + } +} + +func requiredJobsSqlTaskDashboard(w *walker, n *node, v *jobs.SqlTaskDashboard) { + if v == nil { + v = &jobs.SqlTaskDashboard{} + } + if !(v.DashboardId != "") && !n.has("dashboard_id") { + w.missing(n, "dashboard_id") + } +} + +func requiredJobsSqlTaskFile(w *walker, n *node, v *jobs.SqlTaskFile) { + if v == nil { + v = &jobs.SqlTaskFile{} + } + if !(v.Path != "") && !n.has("path") { + w.missing(n, "path") + } +} + +func requiredJobsSqlTaskQuery(w *walker, n *node, v *jobs.SqlTaskQuery) { + if v == nil { + v = &jobs.SqlTaskQuery{} + } + if !(v.QueryId != "") && !n.has("query_id") { + w.missing(n, "query_id") + } +} + +func requiredCatalogModelProviderServiceConfigAmazonBedrockProviderDirectConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfigAmazonBedrockProviderDirectConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfigAmazonBedrockProviderDirectConfig{} + } + if c := n.child("aws_access_key"); c.exists() { + requiredCatalogModelProviderServiceConfigAwsAccessKey(w, &c, v.AwsAccessKey) + } + if c := n.child("service_credential"); c.exists() { + requiredCatalogModelProviderServiceConfigServiceCredential(w, &c, v.ServiceCredential) + } +} + +func requiredCatalogModelProviderServiceConfigAnthropicProviderDirectConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfigAnthropicProviderDirectConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfigAnthropicProviderDirectConfig{} + } + if c := n.child("api_key"); c.exists() { + requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, v.ApiKey) + } +} + +func requiredCatalogModelProviderServiceConfigAzureOpenAiProviderDirectConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfigAzureOpenAiProviderDirectConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfigAzureOpenAiProviderDirectConfig{} + } + if c := n.child("api_key"); c.exists() { + requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, v.ApiKey) + } + if c := n.child("entra_service_principal"); c.exists() { + requiredCatalogModelProviderServiceConfigEntraServicePrincipal(w, &c, v.EntraServicePrincipal) + } + if c := n.child("service_credential"); c.exists() { + requiredCatalogModelProviderServiceConfigServiceCredential(w, &c, v.ServiceCredential) + } +} + +func requiredCatalogModelProviderServiceConfigCustomProviderDirectConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfigCustomProviderDirectConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfigCustomProviderDirectConfig{} + } + if c := n.child("api_key"); c.exists() { + requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, v.ApiKey) + } + if c := n.child("header_auth"); c.exists() { + requiredCatalogModelProviderServiceConfigCustomProviderApiKeyHeaderAuth(w, &c, v.HeaderAuth) + } +} + +func requiredCatalogModelProviderServiceConfigGeminiEnterpriseProviderDirectConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfigGeminiEnterpriseProviderDirectConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfigGeminiEnterpriseProviderDirectConfig{} + } + if c := n.child("api_key"); c.exists() { + requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, v.ApiKey) + } + if c := n.child("service_credential"); c.exists() { + requiredCatalogModelProviderServiceConfigServiceCredential(w, &c, v.ServiceCredential) + } +} + +func requiredCatalogModelProviderServiceConfigMicrosoftFoundryProviderDirectConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfigMicrosoftFoundryProviderDirectConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfigMicrosoftFoundryProviderDirectConfig{} + } + if c := n.child("api_key"); c.exists() { + requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, v.ApiKey) + } + if c := n.child("entra_service_principal"); c.exists() { + requiredCatalogModelProviderServiceConfigEntraServicePrincipal(w, &c, v.EntraServicePrincipal) + } + if c := n.child("service_credential"); c.exists() { + requiredCatalogModelProviderServiceConfigServiceCredential(w, &c, v.ServiceCredential) + } +} + +func requiredCatalogModelProviderServiceConfigOpenAiProviderDirectConfig(w *walker, n *node, v *catalog.ModelProviderServiceConfigOpenAiProviderDirectConfig) { + if v == nil { + v = &catalog.ModelProviderServiceConfigOpenAiProviderDirectConfig{} + } + if c := n.child("api_key"); c.exists() { + requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, v.ApiKey) + } +} + +func requiredCatalogModelServiceConfigDestinationConfig(w *walker, n *node, v *catalog.ModelServiceConfigDestinationConfig) { + if v == nil { + v = &catalog.ModelServiceConfigDestinationConfig{} + } + if !(v.DestinationType != "") && !n.has("destination_type") { + w.missing(n, "destination_type") + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if c := n.child("external_model_config"); c.exists() { + requiredCatalogModelServiceConfigExternalModelConfig(w, &c, v.ExternalModelConfig) + } + if c := n.child("pay_per_token_config"); c.exists() { + requiredCatalogModelServiceConfigPayPerTokenConfig(w, &c, v.PayPerTokenConfig) + } + if c := n.child("provisioned_throughput_config"); c.exists() { + requiredCatalogModelServiceConfigProvisionedThroughputConfig(w, &c, v.ProvisionedThroughputConfig) + } +} + +func requiredCatalogModelServiceConfigFallbackConfig(w *walker, n *node, v *catalog.ModelServiceConfigFallbackConfig) { + if v == nil { + v = &catalog.ModelServiceConfigFallbackConfig{} + } + if len(v.Destinations) > 0 { + c := n.child("destinations") + for i0 := range v.Destinations { + e := c.elem(i0) + requiredCatalogModelServiceConfigDestinationConfig(w, &e, &v.Destinations[i0]) + } + } +} + +func requiredServingExternalModel(w *walker, n *node, v *serving.ExternalModel) { + if v == nil { + v = &serving.ExternalModel{} + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } + if !(v.Provider != "") && !n.has("provider") { + w.missing(n, "provider") + } + if !(v.Task != "") && !n.has("task") { + w.missing(n, "task") + } + if c := n.child("amazon_bedrock_config"); c.exists() { + requiredServingAmazonBedrockConfig(w, &c, v.AmazonBedrockConfig) + } + if c := n.child("custom_provider_config"); c.exists() { + requiredServingCustomProviderConfig(w, &c, v.CustomProviderConfig) + } + if c := n.child("databricks_model_serving_config"); c.exists() { + requiredServingDatabricksModelServingConfig(w, &c, v.DatabricksModelServingConfig) + } + if c := n.child("google_cloud_vertex_ai_config"); c.exists() { + requiredServingGoogleCloudVertexAiConfig(w, &c, v.GoogleCloudVertexAiConfig) + } +} + +func requiredServingRoute(w *walker, n *node, v *serving.Route) { + if v == nil { + v = &serving.Route{} + } + if !(v.TrafficPercentage != 0) && !n.has("traffic_percentage") { + w.missing(n, "traffic_percentage") + } +} + +func requiredPipelinesReportSpec(w *walker, n *node, v *pipelines.ReportSpec) { + if v == nil { + v = &pipelines.ReportSpec{} + } + if !(v.DestinationCatalog != "") && !n.has("destination_catalog") { + w.missing(n, "destination_catalog") + } + if !(v.DestinationSchema != "") && !n.has("destination_schema") { + w.missing(n, "destination_schema") + } + if !(v.SourceUrl != "") && !n.has("source_url") { + w.missing(n, "source_url") + } + if c := n.child("table_configuration"); c.exists() { + requiredPipelinesTableSpecificConfig(w, &c, v.TableConfiguration) + } +} + +func requiredPipelinesSchemaSpec(w *walker, n *node, v *pipelines.SchemaSpec) { + if v == nil { + v = &pipelines.SchemaSpec{} + } + if !(v.DestinationCatalog != "") && !n.has("destination_catalog") { + w.missing(n, "destination_catalog") + } + if !(v.DestinationSchema != "") && !n.has("destination_schema") { + w.missing(n, "destination_schema") + } + if c := n.child("connector_options"); c.exists() { + requiredPipelinesConnectorOptions(w, &c, v.ConnectorOptions) + } + if c := n.child("table_configuration"); c.exists() { + requiredPipelinesTableSpecificConfig(w, &c, v.TableConfiguration) + } +} + +func requiredPipelinesTableSpec(w *walker, n *node, v *pipelines.TableSpec) { + if v == nil { + v = &pipelines.TableSpec{} + } + if !(v.DestinationCatalog != "") && !n.has("destination_catalog") { + w.missing(n, "destination_catalog") + } + if !(v.DestinationSchema != "") && !n.has("destination_schema") { + w.missing(n, "destination_schema") + } + if c := n.child("connector_options"); c.exists() { + requiredPipelinesConnectorOptions(w, &c, v.ConnectorOptions) + } + if c := n.child("table_configuration"); c.exists() { + requiredPipelinesTableSpecificConfig(w, &c, v.TableConfiguration) + } +} + +func requiredPipelinesAutoFullRefreshPolicy(w *walker, n *node, v *pipelines.AutoFullRefreshPolicy) { + if v == nil { + v = &pipelines.AutoFullRefreshPolicy{} + } + if !(v.Enabled) && !n.has("enabled") { + w.missing(n, "enabled") + } +} + +func requiredMlFieldDefinition(w *walker, n *node, v *ml.FieldDefinition) { + if v == nil { + v = &ml.FieldDefinition{} + } + if !(v.DataType != "") && !n.has("data_type") { + w.missing(n, "data_type") + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } +} + +func requiredJobsComputeSpec(w *walker, n *node, v *jobs.ComputeSpec) { + if v == nil { + v = &jobs.ComputeSpec{} + } + if !(v.AcceleratorCount != 0) && !n.has("accelerator_count") { + w.missing(n, "accelerator_count") + } + if !(v.AcceleratorType != "") && !n.has("accelerator_type") { + w.missing(n, "accelerator_type") + } +} + +func requiredJobsForEachTask2(w *walker, n *node, v *jobs.ForEachTask) { + if v == nil { + v = &jobs.ForEachTask{} + } + if !(v.Inputs != "") && !n.has("inputs") { + w.missing(n, "inputs") + } + if !n.has("task") { + w.missing(n, "task") + } +} + +func requiredCatalogModelProviderServiceConfigAwsAccessKey(w *walker, n *node, v *catalog.ModelProviderServiceConfigAwsAccessKey) { + if v == nil { + v = &catalog.ModelProviderServiceConfigAwsAccessKey{} + } + if c := n.child("secret_access_key"); c.exists() { + requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, v.SecretAccessKey) + } +} + +func requiredCatalogModelProviderServiceConfigServiceCredential(w *walker, n *node, v *catalog.ModelProviderServiceConfigServiceCredential) { + if v == nil { + v = &catalog.ModelProviderServiceConfigServiceCredential{} + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } +} + +func requiredCatalogModelProviderServiceConfigProviderSecret(w *walker, n *node, v *catalog.ModelProviderServiceConfigProviderSecret) { + if v == nil { + v = &catalog.ModelProviderServiceConfigProviderSecret{} + } + if c := n.child("secret_reference"); c.exists() { + requiredCatalogModelProviderServiceConfigSecretReference(w, &c, v.SecretReference) + } +} + +func requiredCatalogModelProviderServiceConfigEntraServicePrincipal(w *walker, n *node, v *catalog.ModelProviderServiceConfigEntraServicePrincipal) { + if v == nil { + v = &catalog.ModelProviderServiceConfigEntraServicePrincipal{} + } + if c := n.child("client_secret"); c.exists() { + requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, v.ClientSecret) + } +} + +func requiredCatalogModelProviderServiceConfigCustomProviderApiKeyHeaderAuth(w *walker, n *node, v *catalog.ModelProviderServiceConfigCustomProviderApiKeyHeaderAuth) { + if v == nil { + v = &catalog.ModelProviderServiceConfigCustomProviderApiKeyHeaderAuth{} + } + if c := n.child("api_key_value"); c.exists() { + requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, v.ApiKeyValue) + } +} + +func requiredCatalogModelServiceConfigExternalModelConfig(w *walker, n *node, v *catalog.ModelServiceConfigExternalModelConfig) { + if v == nil { + v = &catalog.ModelServiceConfigExternalModelConfig{} + } + if !(v.ModelProviderService != "") && !n.has("model_provider_service") { + w.missing(n, "model_provider_service") + } + if !n.has("target") { + w.missing(n, "target") + } + if c := n.child("target"); c.exists() { + requiredCatalogModelProviderServiceConfigModelTargetConfig(w, &c, &v.Target) + } +} + +func requiredCatalogModelServiceConfigPayPerTokenConfig(w *walker, n *node, v *catalog.ModelServiceConfigPayPerTokenConfig) { + if v == nil { + v = &catalog.ModelServiceConfigPayPerTokenConfig{} + } + if !(v.Model != "") && !n.has("model") { + w.missing(n, "model") + } +} + +func requiredCatalogModelServiceConfigProvisionedThroughputConfig(w *walker, n *node, v *catalog.ModelServiceConfigProvisionedThroughputConfig) { + if v == nil { + v = &catalog.ModelServiceConfigProvisionedThroughputConfig{} + } + if !(v.ModelServingEndpoint != "") && !n.has("model_serving_endpoint") { + w.missing(n, "model_serving_endpoint") + } +} + +func requiredServingAmazonBedrockConfig(w *walker, n *node, v *serving.AmazonBedrockConfig) { + if v == nil { + v = &serving.AmazonBedrockConfig{} + } + if !(v.AwsRegion != "") && !n.has("aws_region") { + w.missing(n, "aws_region") + } + if !(v.BedrockProvider != "") && !n.has("bedrock_provider") { + w.missing(n, "bedrock_provider") + } +} + +func requiredServingCustomProviderConfig(w *walker, n *node, v *serving.CustomProviderConfig) { + if v == nil { + v = &serving.CustomProviderConfig{} + } + if !(v.CustomProviderUrl != "") && !n.has("custom_provider_url") { + w.missing(n, "custom_provider_url") + } + if c := n.child("api_key_auth"); c.exists() { + requiredServingApiKeyAuth(w, &c, v.ApiKeyAuth) + } +} + +func requiredServingDatabricksModelServingConfig(w *walker, n *node, v *serving.DatabricksModelServingConfig) { + if v == nil { + v = &serving.DatabricksModelServingConfig{} + } + if !(v.DatabricksWorkspaceUrl != "") && !n.has("databricks_workspace_url") { + w.missing(n, "databricks_workspace_url") + } +} + +func requiredServingGoogleCloudVertexAiConfig(w *walker, n *node, v *serving.GoogleCloudVertexAiConfig) { + if v == nil { + v = &serving.GoogleCloudVertexAiConfig{} + } + if !(v.ProjectId != "") && !n.has("project_id") { + w.missing(n, "project_id") + } + if !(v.Region != "") && !n.has("region") { + w.missing(n, "region") + } +} + +func requiredPipelinesConnectorOptions(w *walker, n *node, v *pipelines.ConnectorOptions) { + if v == nil { + v = &pipelines.ConnectorOptions{} + } + if c := n.child("google_ads_options"); c.exists() { + requiredPipelinesGoogleAdsOptions(w, &c, v.GoogleAdsOptions) + } + if c := n.child("linkedin_ads_options"); c.exists() { + requiredPipelinesLinkedInAdsOptions(w, &c, v.LinkedinAdsOptions) + } + if c := n.child("rabbitmq_options"); c.exists() { + requiredPipelinesRabbitmqOptions(w, &c, v.RabbitmqOptions) + } +} + +func requiredCatalogModelProviderServiceConfigSecretReference(w *walker, n *node, v *catalog.ModelProviderServiceConfigSecretReference) { + if v == nil { + v = &catalog.ModelProviderServiceConfigSecretReference{} + } + if !(v.Name != "") && !n.has("name") { + w.missing(n, "name") + } +} + +func requiredServingApiKeyAuth(w *walker, n *node, v *serving.ApiKeyAuth) { + if v == nil { + v = &serving.ApiKeyAuth{} + } + if !(v.Key != "") && !n.has("key") { + w.missing(n, "key") + } +} + +func requiredPipelinesGoogleAdsOptions(w *walker, n *node, v *pipelines.GoogleAdsOptions) { + if v == nil { + v = &pipelines.GoogleAdsOptions{} + } + if !(v.ManagerAccountId != "") && !n.has("manager_account_id") { + w.missing(n, "manager_account_id") + } + if c := n.child("custom_report_options"); c.exists() { + requiredPipelinesGoogleAdsCustomReportOptions(w, &c, v.CustomReportOptions) + } +} + +func requiredPipelinesLinkedInAdsOptions(w *walker, n *node, v *pipelines.LinkedInAdsOptions) { + if v == nil { + v = &pipelines.LinkedInAdsOptions{} + } + if c := n.child("custom_report_options"); c.exists() { + requiredPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptions(w, &c, v.CustomReportOptions) + } +} + +func requiredPipelinesRabbitmqOptions(w *walker, n *node, v *pipelines.RabbitmqOptions) { + if v == nil { + v = &pipelines.RabbitmqOptions{} + } + if !(v.Queue != "") && !n.has("queue") { + w.missing(n, "queue") + } +} + +func requiredPipelinesGoogleAdsCustomReportOptions(w *walker, n *node, v *pipelines.GoogleAdsCustomReportOptions) { + if v == nil { + v = &pipelines.GoogleAdsCustomReportOptions{} + } + if !(v.Resource != "") && !n.has("resource") { + w.missing(n, "resource") + } +} + +func requiredPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptions(w *walker, n *node, v *pipelines.LinkedInAdsOptionsLinkedInAdsCustomReportOptions) { + if v == nil { + v = &pipelines.LinkedInAdsOptionsLinkedInAdsCustomReportOptions{} + } + if !(v.Finder != "") && !n.has("finder") { + w.missing(n, "finder") + } +} diff --git a/bundle/config/validate/walk_node.go b/bundle/config/validate/walk_node.go new file mode 100644 index 00000000000..bcf8d75824a --- /dev/null +++ b/bundle/config/validate/walk_node.go @@ -0,0 +1,152 @@ +package validate + +import ( + "fmt" + "slices" + + "github.com/databricks/cli/libs/diag" + "github.com/databricks/cli/libs/dyn" + "github.com/databricks/cli/libs/dyn/dynvar" + "github.com/databricks/cli/libs/structs/structpath" +) + +// This file is the bridge between the generated typed walkers (required_walk.go, +// enum_walk.go) and the dynamic configuration. The typed configuration cannot tell an +// unset field from one that is null, set to its zero value or to a pure variable +// reference, and it has no locations, so a node follows the [dyn.Value] at its path +// for those. The typed configuration is derived from the dynamic one after every +// mutation, so the two agree. Replace the node once the configuration no longer uses +// dyn. + +// node is a position in the configuration visited by a generated walker. Nodes live +// on the stack and link to their parent; the path is only built for a diagnostic. +type node struct { + parent *node + key string + index int // -1 for a key, -2 for the root + v dyn.Value +} + +func rootNode(v dyn.Value) node { + return node{index: -2, v: v} +} + +// child returns the node of the key k of n. +func (n *node) child(k string) node { + return node{parent: n, key: k, index: -1, v: n.v.Get(k)} +} + +// elem returns the node of element i of n. +func (n *node) elem(i int) node { + return node{parent: n, index: i, v: n.v.Index(i)} +} + +// exists reports whether the configuration has a value (possibly null) at n. +func (n *node) exists() bool { + return n.v.IsValid() +} + +// has reports whether the key k of n is set to a value that is not null. +func (n *node) has(k string) bool { + kind := n.v.Get(k).Kind() + return kind != dyn.KindInvalid && kind != dyn.KindNil +} + +func (n *node) path() *structpath.PathNode { + switch n.index { + case -2: + return nil + case -1: + return structpath.NewStringKey(n.parent.path(), n.key) + default: + return structpath.NewIndex(n.parent.path(), n.index) + } +} + +// walker holds the diagnostics of a generated walk. +type walker struct { + diags diag.Diagnostics +} + +// missing reports that the required field of n is not set. +func (w *walker) missing(n *node, field string) { + w.diags = append(w.diags, diag.Diagnostic{ + Severity: diag.Warning, + Summary: fmt.Sprintf("required field %q is not set", field), + Locations: n.v.Locations(), + Paths: []*structpath.PathNode{n.path()}, + }) +} + +// enumField checks the enum field k of n, whose typed value is s. +func (w *walker) enumField(n *node, k, s string, valid []string) { + if s != "" && slices.Contains(valid, s) { + return + } + c := n.child(k) + w.enumValue(&c, valid) +} + +// enumElem checks the enum element n, whose typed value is s. +func (w *walker) enumElem(n *node, s string, valid []string) { + if s != "" && slices.Contains(valid, s) { + return + } + w.enumValue(n, valid) +} + +// enumValue reports the value of n if it is a string that is not one of valid. Values +// with variable references are not resolved yet and are skipped. +func (w *walker) enumValue(n *node, valid []string) { + s, ok := n.v.AsString() + if !ok || dynvar.ContainsVariableReference(s) || slices.Contains(valid, s) { + return + } + w.diags = append(w.diags, diag.Diagnostic{ + Severity: diag.Warning, + Summary: fmt.Sprintf("invalid value %q for enum field. Valid values are %v", s, valid), + Locations: n.v.Locations(), + Paths: []*structpath.PathNode{n.path()}, + }) +} + +// sortByWalkOrder orders diagnostics with one path each in the order [dyn.WalkReadOnly] +// visits their paths in root, which the walkers do not follow. +func sortByWalkOrder(root dyn.Value, diags diag.Diagnostics) { + type item struct { + pos []int + d diag.Diagnostic + } + items := make([]item, len(diags)) + for i, d := range diags { + items[i] = item{walkPosition(root, d.Paths[0]), d} + } + slices.SortStableFunc(items, func(a, b item) int { + return slices.Compare(a.pos, b.pos) + }) + for i := range items { + diags[i] = items[i].d + } +} + +// walkPosition returns the position of each component of path p in root: the index of +// a key among the keys of its map, or the index of an element. +func walkPosition(root dyn.Value, p *structpath.PathNode) []int { + v := root + var pos []int + for _, c := range p.AsSlice() { + if i, ok := c.Index(); ok { + pos = append(pos, i) + v = v.Index(i) + continue + } + k, _ := c.StringKey() + m, _ := v.AsMap() + i := slices.IndexFunc(m.Pairs(), func(pair dyn.Pair) bool { + return pair.Key.MustString() == k + }) + pos = append(pos, i) + v = v.Get(k) + } + return pos +} diff --git a/bundle/config/validate/walk_test.go b/bundle/config/validate/walk_test.go new file mode 100644 index 00000000000..380f4bce11e --- /dev/null +++ b/bundle/config/validate/walk_test.go @@ -0,0 +1,151 @@ +package validate + +import ( + "fmt" + "testing" + + "github.com/databricks/cli/bundle" + "github.com/databricks/cli/bundle/config" + "github.com/databricks/cli/libs/diag" + "github.com/databricks/cli/libs/dyn" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func loadBundle(t *testing.T, yaml string) *bundle.Bundle { + root, diags := config.LoadFromBytes("databricks.yml", []byte(yaml)) + require.Empty(t, diags) + return &bundle.Bundle{Config: *root} +} + +// summarize renders diagnostics as "summary at path (line)". +func summarize(diags diag.Diagnostics) []string { + var out []string + for _, d := range diags { + line := 0 + if len(d.Locations) > 0 { + line = d.Locations[0].Line + } + out = append(out, fmt.Sprintf("%s at %s (%d)", d.Summary, d.Paths[0], line)) + } + return out +} + +func TestRequiredWalkNestedTasks(t *testing.T) { + b := loadBundle(t, ` +bundle: + name: test-bundle +resources: + jobs: + job: + tasks: + - task_key: outer + for_each_task: + inputs: "[1, 2]" + task: + notebook_task: {} + - depends_on: + - outcome: "true" + task_key: "" +`) + diags := bundle.Apply(t.Context(), b, Required()) + assert.Equal(t, []string{ + `required field "notebook_path" is not set at resources.jobs.job.tasks[0].for_each_task.task.notebook_task (12)`, + `required field "task_key" is not set at resources.jobs.job.tasks[0].for_each_task.task (12)`, + `required field "task_key" is not set at resources.jobs.job.tasks[1].depends_on[0] (14)`, + }, summarize(diags)) +} + +func TestRequiredWalkSetValues(t *testing.T) { + // A pure reference and an explicit zero value set a field; null does not. + b := loadBundle(t, ` +bundle: + name: test-bundle +variables: + threshold: + default: 10 +resources: + jobs: + job: + health: + rules: + - metric: RUN_DURATION_SECONDS + op: GREATER_THAN + value: ${var.threshold} + - metric: RUN_DURATION_SECONDS + op: GREATER_THAN + value: 0 + tasks: + - task_key: run + run_job_task: + - task_key: dbt + dbt_task: + commands: null +`) + diags := bundle.Apply(t.Context(), b, Required()) + assert.Equal(t, []string{ + `required field "commands" is not set at resources.jobs.job.tasks[1].dbt_task (23)`, + `required field "job_id" is not set at resources.jobs.job.tasks[0].run_job_task (20)`, + }, summarize(diags)) +} + +func TestEnumWalk(t *testing.T) { + b := loadBundle(t, ` +bundle: + name: test-bundle +resources: + jobs: + job: + tasks: + - task_key: a + run_if: SOMETIMES + notebook_task: + notebook_path: ./nb.py + source: ${var.source} + - task_key: b + run_if: ALL_DONE +`) + diags := bundle.Apply(t.Context(), b, Enum()) + assert.Equal(t, []string{ + `invalid value "SOMETIMES" for enum field. Valid values are [ALL_DONE ALL_FAILED ALL_SUCCESS AT_LEAST_ONE_FAILED AT_LEAST_ONE_SUCCESS NONE_FAILED] at resources.jobs.job.tasks[0].run_if (9)`, + }, summarize(diags)) +} + +func TestEnumWalkKeepsWalkOrderForTies(t *testing.T) { + // Values without a location tie in the sort; they keep the order of the + // configuration, not that of the walk over the typed maps. + b := loadBundle(t, ` +bundle: + name: test-bundle +resources: + jobs: + zeta: + tasks: + - task_key: a + run_if: SOMETIMES + alpha: + tasks: + - task_key: a + run_if: SOMETIMES + mid: + tasks: + - task_key: a + run_if: SOMETIMES +`) + err := b.Config.Mutate(func(v dyn.Value) (dyn.Value, error) { + return dyn.MapByPattern(v, dyn.NewPattern(dyn.Key("resources"), dyn.Key("jobs"), dyn.AnyKey(), dyn.Key("tasks"), dyn.AnyIndex(), dyn.Key("run_if")), func(_ dyn.Path, v dyn.Value) (dyn.Value, error) { + return dyn.V(v.MustString()), nil + }) + }) + require.NoError(t, err) + diags := bundle.Apply(t.Context(), b, Enum()) + var paths []string + for _, d := range diags { + paths = append(paths, d.Paths[0].String()) + } + assert.Equal(t, []string{ + "resources.jobs.zeta.tasks[0].run_if", + "resources.jobs.alpha.tasks[0].run_if", + "resources.jobs.mid.tasks[0].run_if", + }, paths) +} diff --git a/bundle/internal/bundletest/benchmark_test.go b/bundle/internal/bundletest/benchmark_test.go index 75b121e095b..05999daf6fb 100644 --- a/bundle/internal/bundletest/benchmark_test.go +++ b/bundle/internal/bundletest/benchmark_test.go @@ -3,7 +3,6 @@ package bundletest import ( "testing" - "github.com/databricks/cli/bundle/internal/validation/generated" "github.com/databricks/cli/libs/dyn" "github.com/stretchr/testify/assert" ) @@ -31,33 +30,3 @@ func BenchmarkWalk(b *testing.B) { assert.NoError(b, err) } } - -// This took 49 microseconds to run on 6th Aug 2025. -func BenchmarkEnumPrefixTree(b *testing.B) { - for b.Loop() { - // Generate prefix tree for all enum fields. - trie := &dyn.TrieNode{} - for k := range generated.EnumFields { - pattern, err := dyn.NewPatternFromString(k) - assert.NoError(b, err) - - err = trie.Insert(pattern) - assert.NoError(b, err) - } - } -} - -// This took 15 microseconds to run on 6th Aug 2025. -func BenchmarkRequiredPrefixTree(b *testing.B) { - for b.Loop() { - // Generate prefix tree for all required fields. - trie := &dyn.TrieNode{} - for k := range generated.RequiredFields { - pattern, err := dyn.NewPatternFromString(k) - assert.NoError(b, err) - - err = trie.Insert(pattern) - assert.NoError(b, err) - } - } -} diff --git a/bundle/internal/validation/enum.go b/bundle/internal/validation/enum.go index df58193c898..e3abcd72940 100644 --- a/bundle/internal/validation/enum.go +++ b/bundle/internal/validation/enum.go @@ -1,34 +1,15 @@ package main import ( - "bytes" - "cmp" "errors" "fmt" - "go/format" - "maps" - "os" - "path/filepath" "reflect" - "slices" - "text/template" - "github.com/databricks/cli/bundle/config" "github.com/databricks/cli/libs/structs/structpath" "github.com/databricks/cli/libs/structs/structtag" "github.com/databricks/cli/libs/structs/structwalk" ) -type EnumPatternInfo struct { - // The pattern for which the enum values in Values are applicable. - // This is a string representation of [dyn.Pattern]. - Pattern string - - // List of valid enum values for the pattern. This field will be a string of the - // form `{value1, value2, ...}` representing a Go slice literal. - Values string -} - // isEnumType checks if a type is an enum (string type with a Values() method) func isEnumType(typ reflect.Type) bool { // Must be a string type @@ -109,8 +90,9 @@ func getEnumValues(typ reflect.Type) ([]string, error) { return enumStrings, nil } -// extractEnumFields walks through a struct type and extracts enum field patterns -func extractEnumFields(typ reflect.Type) ([]EnumPatternInfo, error) { +// extractEnumFields walks through a struct type and returns the valid values of the +// enum fields by their pattern. +func extractEnumFields(typ reflect.Type) (map[string][]string, error) { fieldsByPattern := make(map[string][]string) err := structwalk.WalkType(typ, func(path *structpath.PatternNode, fieldType reflect.Type, field *reflect.StructField) bool { @@ -140,129 +122,5 @@ func extractEnumFields(typ reflect.Type) ([]EnumPatternInfo, error) { return true }) - return buildEnumPatternInfos(fieldsByPattern), err -} - -// buildEnumPatternInfos converts the field map to EnumPatternInfo slice -func buildEnumPatternInfos(fieldsByPattern map[string][]string) []EnumPatternInfo { - patterns := make([]EnumPatternInfo, 0, len(fieldsByPattern)) - - for pattern, values := range fieldsByPattern { - patterns = append(patterns, EnumPatternInfo{ - Pattern: pattern, - Values: formatSliceToString(values), - }) - } - - return patterns -} - -// groupPatternsByKey groups patterns by their logical grouping key -func groupPatternsByKeyEnum(patterns []EnumPatternInfo) map[string][]EnumPatternInfo { - groupedPatterns := make(map[string][]EnumPatternInfo) - - for _, pattern := range patterns { - key := getGroupingKey(pattern.Pattern) - groupedPatterns[key] = append(groupedPatterns[key], pattern) - } - - return groupedPatterns -} - -func filterTargetsAndEnvironmentsEnum(patterns map[string][]EnumPatternInfo) map[string][]EnumPatternInfo { - filtered := make(map[string][]EnumPatternInfo) - for key, patterns := range patterns { - if key == "targets" || key == "environments" { - continue - } - filtered[key] = patterns - } - return filtered -} - -// sortGroupedPatterns sorts patterns within each group and returns them as a sorted slice -func sortGroupedPatternsEnum(groupedPatterns map[string][]EnumPatternInfo) [][]EnumPatternInfo { - // Get sorted group keys - groupKeys := slices.Sorted(maps.Keys(groupedPatterns)) - - // Build sorted result - result := make([][]EnumPatternInfo, 0, len(groupKeys)) - for _, key := range groupKeys { - patterns := groupedPatterns[key] - - // Sort patterns within each group by pattern - slices.SortFunc(patterns, func(a, b EnumPatternInfo) int { - return cmp.Compare(a.Pattern, b.Pattern) - }) - - result = append(result, patterns) - } - - return result -} - -// enumFields returns grouped enum field patterns for validation -func enumFields() ([][]EnumPatternInfo, error) { - patterns, err := extractEnumFields(reflect.TypeFor[config.Root]()) - if err != nil { - return nil, err - } - groupedPatterns := groupPatternsByKeyEnum(patterns) - filteredPatterns := filterTargetsAndEnvironmentsEnum(groupedPatterns) - return sortGroupedPatternsEnum(filteredPatterns), nil -} - -// Generate creates a Go source file with enum field validation rules -func generateEnumFields(outPath string) error { - enumFields, err := enumFields() - if err != nil { - return fmt.Errorf("failed to generate enum fields: %w", err) - } - - // Ensure output directory exists - if err := os.MkdirAll(outPath, 0o755); err != nil { - return fmt.Errorf("failed to create output directory: %w", err) - } - - // Parse and execute template - tmpl, err := template.New("enum_validation").Parse(enumValidationTemplate) - if err != nil { - return fmt.Errorf("failed to parse template: %w", err) - } - - var generatedCode bytes.Buffer - if err := tmpl.Execute(&generatedCode, enumFields); err != nil { - return fmt.Errorf("failed to execute template: %w", err) - } - - // Format the generated source with gofmt-equivalent rules so minor template - // whitespace changes don't create noisy diffs in the checked-in artifacts. - formatted, err := format.Source(generatedCode.Bytes()) - if err != nil { - return fmt.Errorf("failed to format generated code: %w", err) - } - - // Write generated code to file - filePath := filepath.Join(outPath, "enum_fields.go") - if err := os.WriteFile(filePath, formatted, 0o644); err != nil { - return fmt.Errorf("failed to write generated code: %w", err) - } - - return nil -} - -// enumValidationTemplate is the Go text template for generating the enum validation map -const enumValidationTemplate = `package generated - -// THIS FILE IS AUTOGENERATED. -// DO NOT EDIT THIS FILE DIRECTLY. - -// EnumFields maps [dyn.Pattern] to valid enum values they should have. -var EnumFields = map[string][]string{ -{{- range . }} -{{- range . }} - "{{ .Pattern }}": {{ .Values }}, -{{- end }} -{{ end -}} + return fieldsByPattern, err } -` diff --git a/bundle/internal/validation/generated/.gitattributes b/bundle/internal/validation/generated/.gitattributes deleted file mode 100644 index 80ff44c834c..00000000000 --- a/bundle/internal/validation/generated/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.go linguist-generated=true diff --git a/bundle/internal/validation/generated/enum_fields.go b/bundle/internal/validation/generated/enum_fields.go deleted file mode 100644 index e67e605689d..00000000000 --- a/bundle/internal/validation/generated/enum_fields.go +++ /dev/null @@ -1,322 +0,0 @@ -package generated - -// THIS FILE IS AUTOGENERATED. -// DO NOT EDIT THIS FILE DIRECTLY. - -// EnumFields maps [dyn.Pattern] to valid enum values they should have. -var EnumFields = map[string][]string{ - "artifacts.*.executable": {"bash", "sh", "cmd"}, - "artifacts.*.type": {"whl", "jar", "tgz"}, - - "permissions[*].level": {"CAN_ATTACH_TO", "CAN_BIND", "CAN_CREATE", "CAN_CREATE_APP", "CAN_EDIT", "CAN_EDIT_METADATA", "CAN_MANAGE", "CAN_MANAGE_PRODUCTION_VERSIONS", "CAN_MANAGE_RUN", "CAN_MANAGE_STAGING_VERSIONS", "CAN_MONITOR", "CAN_MONITOR_ONLY", "CAN_QUERY", "CAN_READ", "CAN_RESTART", "CAN_RUN", "CAN_USE", "CAN_VIEW", "CAN_VIEW_METADATA", "IS_OWNER"}, - - "resources.alerts.*.custom_template_format": {"HTML", "MARKDOWN"}, - "resources.alerts.*.evaluation.comparison_operator": {"EQUAL", "GREATER_THAN", "GREATER_THAN_OR_EQUAL", "IS_NOT_NULL", "IS_NULL", "LESS_THAN", "LESS_THAN_OR_EQUAL", "NOT_EQUAL"}, - "resources.alerts.*.evaluation.empty_result_state": {"ERROR", "OK", "TRIGGERED", "UNKNOWN"}, - "resources.alerts.*.evaluation.source.aggregation": {"AVG", "COUNT", "COUNT_DISTINCT", "MAX", "MEDIAN", "MIN", "STDDEV", "SUM"}, - "resources.alerts.*.evaluation.state": {"ERROR", "OK", "TRIGGERED", "UNKNOWN"}, - "resources.alerts.*.evaluation.threshold.column.aggregation": {"AVG", "COUNT", "COUNT_DISTINCT", "MAX", "MEDIAN", "MIN", "STDDEV", "SUM"}, - "resources.alerts.*.lifecycle_state": {"ACTIVE", "DELETED"}, - "resources.alerts.*.permissions[*].level": {"CAN_ATTACH_TO", "CAN_BIND", "CAN_CREATE", "CAN_CREATE_APP", "CAN_EDIT", "CAN_EDIT_METADATA", "CAN_MANAGE", "CAN_MANAGE_PRODUCTION_VERSIONS", "CAN_MANAGE_RUN", "CAN_MANAGE_STAGING_VERSIONS", "CAN_MONITOR", "CAN_MONITOR_ONLY", "CAN_QUERY", "CAN_READ", "CAN_RESTART", "CAN_RUN", "CAN_USE", "CAN_VIEW", "CAN_VIEW_METADATA", "IS_OWNER"}, - "resources.alerts.*.schedule.pause_status": {"PAUSED", "UNPAUSED"}, - - "resources.apps.*.active_deployment.mode": {"AUTO_SYNC", "SNAPSHOT"}, - "resources.apps.*.active_deployment.status.state": {"CANCELLED", "FAILED", "IN_PROGRESS", "SUCCEEDED"}, - "resources.apps.*.app_status.state": {"CRASHED", "DEPLOYING", "RUNNING", "UNAVAILABLE"}, - "resources.apps.*.compute_size": {"LARGE", "MEDIUM", "XLARGE"}, - "resources.apps.*.compute_status.state": {"ACTIVE", "DELETING", "ERROR", "STARTING", "STOPPED", "STOPPING", "UPDATING"}, - "resources.apps.*.pending_deployment.mode": {"AUTO_SYNC", "SNAPSHOT"}, - "resources.apps.*.pending_deployment.status.state": {"CANCELLED", "FAILED", "IN_PROGRESS", "SUCCEEDED"}, - "resources.apps.*.permissions[*].level": {"CAN_MANAGE", "CAN_USE"}, - "resources.apps.*.resources[*].app.permission": {"CAN_USE"}, - "resources.apps.*.resources[*].database.permission": {"CAN_CONNECT_AND_CREATE"}, - "resources.apps.*.resources[*].experiment.permission": {"CAN_EDIT", "CAN_MANAGE", "CAN_READ"}, - "resources.apps.*.resources[*].genie_space.permission": {"CAN_EDIT", "CAN_MANAGE", "CAN_RUN", "CAN_VIEW"}, - "resources.apps.*.resources[*].job.permission": {"CAN_MANAGE", "CAN_MANAGE_RUN", "CAN_VIEW", "IS_OWNER"}, - "resources.apps.*.resources[*].postgres.permission": {"CAN_CONNECT_AND_CREATE"}, - "resources.apps.*.resources[*].secret.permission": {"MANAGE", "READ", "WRITE"}, - "resources.apps.*.resources[*].serving_endpoint.permission": {"CAN_MANAGE", "CAN_QUERY", "CAN_VIEW"}, - "resources.apps.*.resources[*].sql_warehouse.permission": {"CAN_MANAGE", "CAN_USE", "IS_OWNER"}, - "resources.apps.*.resources[*].uc_securable.permission": {"EXECUTE", "MODIFY", "READ_VOLUME", "SELECT", "USE_CONNECTION", "WRITE_VOLUME"}, - "resources.apps.*.resources[*].uc_securable.securable_type": {"CONNECTION", "FUNCTION", "MODEL_SERVICE", "TABLE", "VOLUME"}, - - "resources.catalogs.*.grants[*].privileges[*]": {"ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "BROWSE", "CREATE", "CREATE_CATALOG", "CREATE_CLEAN_ROOM", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FOREIGN_SECURABLE", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "EXECUTE_CLEAN_ROOM_TASK", "EXTERNAL_USE_LOCATION", "EXTERNAL_USE_SCHEMA", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "MODIFY_CLEAN_ROOM", "READ_FILES", "READ_METADATA", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"}, - - "resources.cluster_policies.*.permissions[*].level": {"CAN_USE"}, - - "resources.clusters.*.aws_attributes.availability": {"ON_DEMAND", "SPOT", "SPOT_WITH_FALLBACK"}, - "resources.clusters.*.aws_attributes.ebs_volume_type": {"GENERAL_PURPOSE_SSD", "THROUGHPUT_OPTIMIZED_HDD"}, - "resources.clusters.*.azure_attributes.availability": {"ON_DEMAND_AZURE", "SPOT_AZURE", "SPOT_WITH_FALLBACK_AZURE"}, - "resources.clusters.*.data_security_mode": {"DATA_SECURITY_MODE_AUTO", "DATA_SECURITY_MODE_DEDICATED", "DATA_SECURITY_MODE_STANDARD", "LEGACY_PASSTHROUGH", "LEGACY_SINGLE_USER", "LEGACY_SINGLE_USER_STANDARD", "LEGACY_TABLE_ACL", "NONE", "SINGLE_USER", "USER_ISOLATION"}, - "resources.clusters.*.dependency_mode": {"DEPENDENCY_MODE_AUTO", "DEPENDENCY_MODE_CLUSTER_LIBRARIES", "DEPENDENCY_MODE_ENVIRONMENTS"}, - "resources.clusters.*.gcp_attributes.availability": {"ON_DEMAND_GCP", "PREEMPTIBLE_GCP", "PREEMPTIBLE_WITH_FALLBACK_GCP"}, - "resources.clusters.*.gcp_attributes.confidential_compute_type": {"CONFIDENTIAL_COMPUTE_TYPE_NONE", "SEV_SNP"}, - "resources.clusters.*.kind": {"CLASSIC_PREVIEW"}, - "resources.clusters.*.permissions[*].level": {"CAN_ATTACH_TO", "CAN_MANAGE", "CAN_RESTART"}, - "resources.clusters.*.runtime_engine": {"NULL", "PHOTON", "STANDARD"}, - - "resources.dashboards.*.lifecycle_state": {"ACTIVE", "TRASHED"}, - "resources.dashboards.*.permissions[*].level": {"CAN_ATTACH_TO", "CAN_BIND", "CAN_CREATE", "CAN_CREATE_APP", "CAN_EDIT", "CAN_EDIT_METADATA", "CAN_MANAGE", "CAN_MANAGE_PRODUCTION_VERSIONS", "CAN_MANAGE_RUN", "CAN_MANAGE_STAGING_VERSIONS", "CAN_MONITOR", "CAN_MONITOR_ONLY", "CAN_QUERY", "CAN_READ", "CAN_RESTART", "CAN_RUN", "CAN_USE", "CAN_VIEW", "CAN_VIEW_METADATA", "IS_OWNER"}, - - "resources.database_instances.*.permissions[*].level": {"CAN_ATTACH_TO", "CAN_BIND", "CAN_CREATE", "CAN_CREATE_APP", "CAN_EDIT", "CAN_EDIT_METADATA", "CAN_MANAGE", "CAN_MANAGE_PRODUCTION_VERSIONS", "CAN_MANAGE_RUN", "CAN_MANAGE_STAGING_VERSIONS", "CAN_MONITOR", "CAN_MONITOR_ONLY", "CAN_QUERY", "CAN_READ", "CAN_RESTART", "CAN_RUN", "CAN_USE", "CAN_VIEW", "CAN_VIEW_METADATA", "IS_OWNER"}, - "resources.database_instances.*.state": {"AVAILABLE", "DELETING", "FAILING_OVER", "STARTING", "STOPPED", "UPDATING"}, - - "resources.experiments.*.permissions[*].level": {"CAN_EDIT", "CAN_MANAGE", "CAN_READ"}, - - "resources.external_locations.*.encryption_details.sse_encryption_details.algorithm": {"AWS_SSE_KMS", "AWS_SSE_S3"}, - "resources.external_locations.*.grants[*].privileges[*]": {"ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "BROWSE", "CREATE", "CREATE_CATALOG", "CREATE_CLEAN_ROOM", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FOREIGN_SECURABLE", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "EXECUTE_CLEAN_ROOM_TASK", "EXTERNAL_USE_LOCATION", "EXTERNAL_USE_SCHEMA", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "MODIFY_CLEAN_ROOM", "READ_FILES", "READ_METADATA", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"}, - - "resources.features.*.function.function_type": {"APPROX_COUNT_DISTINCT", "APPROX_PERCENTILE", "AVG", "COUNT", "FIRST", "FUNCTION_TYPE_UNSPECIFIED", "LAST", "MAX", "MIN", "STDDEV_POP", "STDDEV_SAMP", "SUM", "VAR_POP", "VAR_SAMP"}, - "resources.features.*.source.request_source.flat_schema.fields[*].data_type": {"BINARY", "BOOLEAN", "DATE", "DECIMAL", "DOUBLE", "FLOAT", "INTEGER", "LONG", "SHORT", "STRING", "TIMESTAMP"}, - "resources.features.*.source.sdp_source.pipeline_state": {"ERROR", "PENDING", "RESOLVED"}, - - "resources.genie_spaces.*.permissions[*].level": {"CAN_ATTACH_TO", "CAN_BIND", "CAN_CREATE", "CAN_CREATE_APP", "CAN_EDIT", "CAN_EDIT_METADATA", "CAN_MANAGE", "CAN_MANAGE_PRODUCTION_VERSIONS", "CAN_MANAGE_RUN", "CAN_MANAGE_STAGING_VERSIONS", "CAN_MONITOR", "CAN_MONITOR_ONLY", "CAN_QUERY", "CAN_READ", "CAN_RESTART", "CAN_RUN", "CAN_USE", "CAN_VIEW", "CAN_VIEW_METADATA", "IS_OWNER"}, - - "resources.instance_pools.*.aws_attributes.availability": {"ON_DEMAND", "SPOT"}, - "resources.instance_pools.*.azure_attributes.availability": {"ON_DEMAND_AZURE", "SPOT_AZURE"}, - "resources.instance_pools.*.disk_spec.disk_type.azure_disk_volume_type": {"PREMIUM_LRS", "STANDARD_LRS"}, - "resources.instance_pools.*.disk_spec.disk_type.ebs_volume_type": {"GENERAL_PURPOSE_SSD", "THROUGHPUT_OPTIMIZED_HDD"}, - "resources.instance_pools.*.gcp_attributes.gcp_availability": {"ON_DEMAND_GCP", "PREEMPTIBLE_GCP", "PREEMPTIBLE_WITH_FALLBACK_GCP"}, - "resources.instance_pools.*.permissions[*].level": {"CAN_ATTACH_TO", "CAN_MANAGE"}, - - "resources.job_runs.*.performance_target": {"PERFORMANCE_OPTIMIZED", "STANDARD"}, - - "resources.jobs.*.continuous.maintenance_window.day_of_week": {"FRIDAY", "MONDAY", "SATURDAY", "SUNDAY", "THURSDAY", "TUESDAY", "WEDNESDAY"}, - "resources.jobs.*.continuous.pause_status": {"PAUSED", "UNPAUSED"}, - "resources.jobs.*.continuous.task_retry_mode": {"NEVER", "ON_FAILURE"}, - "resources.jobs.*.deployment.kind": {"BUNDLE", "SYSTEM_MANAGED"}, - "resources.jobs.*.edit_mode": {"EDITABLE", "UI_LOCKED"}, - "resources.jobs.*.format": {"MULTI_TASK", "SINGLE_TASK"}, - "resources.jobs.*.git_source.git_provider": {"awsCodeCommit", "azureDevOpsServices", "bitbucketCloud", "bitbucketServer", "gitHub", "gitHubEnterprise", "gitLab", "gitLabEnterpriseEdition"}, - "resources.jobs.*.git_source.job_source.dirty_state": {"DISCONNECTED", "NOT_SYNCED"}, - "resources.jobs.*.health.rules[*].metric": {"RUN_DURATION_SECONDS", "STREAMING_BACKLOG_BYTES", "STREAMING_BACKLOG_FILES", "STREAMING_BACKLOG_RECORDS", "STREAMING_BACKLOG_SECONDS"}, - "resources.jobs.*.health.rules[*].op": {"GREATER_THAN"}, - "resources.jobs.*.job_clusters[*].new_cluster.aws_attributes.availability": {"ON_DEMAND", "SPOT", "SPOT_WITH_FALLBACK"}, - "resources.jobs.*.job_clusters[*].new_cluster.aws_attributes.ebs_volume_type": {"GENERAL_PURPOSE_SSD", "THROUGHPUT_OPTIMIZED_HDD"}, - "resources.jobs.*.job_clusters[*].new_cluster.azure_attributes.availability": {"ON_DEMAND_AZURE", "SPOT_AZURE", "SPOT_WITH_FALLBACK_AZURE"}, - "resources.jobs.*.job_clusters[*].new_cluster.data_security_mode": {"DATA_SECURITY_MODE_AUTO", "DATA_SECURITY_MODE_DEDICATED", "DATA_SECURITY_MODE_STANDARD", "LEGACY_PASSTHROUGH", "LEGACY_SINGLE_USER", "LEGACY_SINGLE_USER_STANDARD", "LEGACY_TABLE_ACL", "NONE", "SINGLE_USER", "USER_ISOLATION"}, - "resources.jobs.*.job_clusters[*].new_cluster.dependency_mode": {"DEPENDENCY_MODE_AUTO", "DEPENDENCY_MODE_CLUSTER_LIBRARIES", "DEPENDENCY_MODE_ENVIRONMENTS"}, - "resources.jobs.*.job_clusters[*].new_cluster.gcp_attributes.availability": {"ON_DEMAND_GCP", "PREEMPTIBLE_GCP", "PREEMPTIBLE_WITH_FALLBACK_GCP"}, - "resources.jobs.*.job_clusters[*].new_cluster.gcp_attributes.confidential_compute_type": {"CONFIDENTIAL_COMPUTE_TYPE_NONE", "SEV_SNP"}, - "resources.jobs.*.job_clusters[*].new_cluster.kind": {"CLASSIC_PREVIEW"}, - "resources.jobs.*.job_clusters[*].new_cluster.runtime_engine": {"NULL", "PHOTON", "STANDARD"}, - "resources.jobs.*.performance_target": {"PERFORMANCE_OPTIMIZED", "STANDARD"}, - "resources.jobs.*.permissions[*].level": {"CAN_MANAGE", "CAN_MANAGE_RUN", "CAN_VIEW", "IS_OWNER"}, - "resources.jobs.*.schedule.pause_status": {"PAUSED", "UNPAUSED"}, - "resources.jobs.*.schedule.sql_condition.trigger_mode": {"QUERY_RETURNS_ROWS", "RESULT_VALUE_CHANGES"}, - "resources.jobs.*.tasks[*].ai_runtime_task.deployments[*].compute.accelerator_type": {"GPU_1xA10", "GPU_1xH100", "GPU_8xB300", "GPU_8xH100"}, - "resources.jobs.*.tasks[*].ai_runtime_task.priority_class": {"BEST_EFFORT", "CRITICAL", "NORMAL"}, - "resources.jobs.*.tasks[*].compute.hardware_accelerator": {"GPU_1xA10", "GPU_1xH100", "GPU_8xB300", "GPU_8xH100"}, - "resources.jobs.*.tasks[*].condition_task.op": {"EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL", "LESS_THAN", "LESS_THAN_OR_EQUAL", "NOT_EQUAL"}, - "resources.jobs.*.tasks[*].dashboard_task.subscription.attachment.data_attachment.file_format": {"FILE_FORMAT_CSV", "FILE_FORMAT_EXCEL", "FILE_FORMAT_TSV"}, - "resources.jobs.*.tasks[*].dashboard_task.subscription.attachment.page_attachment.page_selection": {"PAGE_SELECTION_ALL", "PAGE_SELECTION_SUBSET"}, - "resources.jobs.*.tasks[*].dbt_task.source": {"GIT", "WORKSPACE"}, - "resources.jobs.*.tasks[*].for_each_task.task.ai_runtime_task.deployments[*].compute.accelerator_type": {"GPU_1xA10", "GPU_1xH100", "GPU_8xB300", "GPU_8xH100"}, - "resources.jobs.*.tasks[*].for_each_task.task.ai_runtime_task.priority_class": {"BEST_EFFORT", "CRITICAL", "NORMAL"}, - "resources.jobs.*.tasks[*].for_each_task.task.compute.hardware_accelerator": {"GPU_1xA10", "GPU_1xH100", "GPU_8xB300", "GPU_8xH100"}, - "resources.jobs.*.tasks[*].for_each_task.task.condition_task.op": {"EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL", "LESS_THAN", "LESS_THAN_OR_EQUAL", "NOT_EQUAL"}, - "resources.jobs.*.tasks[*].for_each_task.task.dashboard_task.subscription.attachment.data_attachment.file_format": {"FILE_FORMAT_CSV", "FILE_FORMAT_EXCEL", "FILE_FORMAT_TSV"}, - "resources.jobs.*.tasks[*].for_each_task.task.dashboard_task.subscription.attachment.page_attachment.page_selection": {"PAGE_SELECTION_ALL", "PAGE_SELECTION_SUBSET"}, - "resources.jobs.*.tasks[*].for_each_task.task.dbt_task.source": {"GIT", "WORKSPACE"}, - "resources.jobs.*.tasks[*].for_each_task.task.gen_ai_compute_task.source": {"GIT", "WORKSPACE"}, - "resources.jobs.*.tasks[*].for_each_task.task.health.rules[*].metric": {"RUN_DURATION_SECONDS", "STREAMING_BACKLOG_BYTES", "STREAMING_BACKLOG_FILES", "STREAMING_BACKLOG_RECORDS", "STREAMING_BACKLOG_SECONDS"}, - "resources.jobs.*.tasks[*].for_each_task.task.health.rules[*].op": {"GREATER_THAN"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.aws_attributes.availability": {"ON_DEMAND", "SPOT", "SPOT_WITH_FALLBACK"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.aws_attributes.ebs_volume_type": {"GENERAL_PURPOSE_SSD", "THROUGHPUT_OPTIMIZED_HDD"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.azure_attributes.availability": {"ON_DEMAND_AZURE", "SPOT_AZURE", "SPOT_WITH_FALLBACK_AZURE"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.data_security_mode": {"DATA_SECURITY_MODE_AUTO", "DATA_SECURITY_MODE_DEDICATED", "DATA_SECURITY_MODE_STANDARD", "LEGACY_PASSTHROUGH", "LEGACY_SINGLE_USER", "LEGACY_SINGLE_USER_STANDARD", "LEGACY_TABLE_ACL", "NONE", "SINGLE_USER", "USER_ISOLATION"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.dependency_mode": {"DEPENDENCY_MODE_AUTO", "DEPENDENCY_MODE_CLUSTER_LIBRARIES", "DEPENDENCY_MODE_ENVIRONMENTS"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.gcp_attributes.availability": {"ON_DEMAND_GCP", "PREEMPTIBLE_GCP", "PREEMPTIBLE_WITH_FALLBACK_GCP"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.gcp_attributes.confidential_compute_type": {"CONFIDENTIAL_COMPUTE_TYPE_NONE", "SEV_SNP"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.kind": {"CLASSIC_PREVIEW"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.runtime_engine": {"NULL", "PHOTON", "STANDARD"}, - "resources.jobs.*.tasks[*].for_each_task.task.notebook_task.source": {"GIT", "WORKSPACE"}, - "resources.jobs.*.tasks[*].for_each_task.task.power_bi_task.power_bi_model.authentication_method": {"OAUTH", "PAT"}, - "resources.jobs.*.tasks[*].for_each_task.task.power_bi_task.power_bi_model.storage_mode": {"DIRECT_QUERY", "DUAL", "IMPORT"}, - "resources.jobs.*.tasks[*].for_each_task.task.power_bi_task.tables[*].storage_mode": {"DIRECT_QUERY", "DUAL", "IMPORT"}, - "resources.jobs.*.tasks[*].for_each_task.task.run_if": {"ALL_DONE", "ALL_FAILED", "ALL_SUCCESS", "AT_LEAST_ONE_FAILED", "AT_LEAST_ONE_SUCCESS", "NONE_FAILED"}, - "resources.jobs.*.tasks[*].for_each_task.task.spark_python_task.source": {"GIT", "WORKSPACE"}, - "resources.jobs.*.tasks[*].for_each_task.task.sql_task.file.source": {"GIT", "WORKSPACE"}, - "resources.jobs.*.tasks[*].gen_ai_compute_task.source": {"GIT", "WORKSPACE"}, - "resources.jobs.*.tasks[*].health.rules[*].metric": {"RUN_DURATION_SECONDS", "STREAMING_BACKLOG_BYTES", "STREAMING_BACKLOG_FILES", "STREAMING_BACKLOG_RECORDS", "STREAMING_BACKLOG_SECONDS"}, - "resources.jobs.*.tasks[*].health.rules[*].op": {"GREATER_THAN"}, - "resources.jobs.*.tasks[*].new_cluster.aws_attributes.availability": {"ON_DEMAND", "SPOT", "SPOT_WITH_FALLBACK"}, - "resources.jobs.*.tasks[*].new_cluster.aws_attributes.ebs_volume_type": {"GENERAL_PURPOSE_SSD", "THROUGHPUT_OPTIMIZED_HDD"}, - "resources.jobs.*.tasks[*].new_cluster.azure_attributes.availability": {"ON_DEMAND_AZURE", "SPOT_AZURE", "SPOT_WITH_FALLBACK_AZURE"}, - "resources.jobs.*.tasks[*].new_cluster.data_security_mode": {"DATA_SECURITY_MODE_AUTO", "DATA_SECURITY_MODE_DEDICATED", "DATA_SECURITY_MODE_STANDARD", "LEGACY_PASSTHROUGH", "LEGACY_SINGLE_USER", "LEGACY_SINGLE_USER_STANDARD", "LEGACY_TABLE_ACL", "NONE", "SINGLE_USER", "USER_ISOLATION"}, - "resources.jobs.*.tasks[*].new_cluster.dependency_mode": {"DEPENDENCY_MODE_AUTO", "DEPENDENCY_MODE_CLUSTER_LIBRARIES", "DEPENDENCY_MODE_ENVIRONMENTS"}, - "resources.jobs.*.tasks[*].new_cluster.gcp_attributes.availability": {"ON_DEMAND_GCP", "PREEMPTIBLE_GCP", "PREEMPTIBLE_WITH_FALLBACK_GCP"}, - "resources.jobs.*.tasks[*].new_cluster.gcp_attributes.confidential_compute_type": {"CONFIDENTIAL_COMPUTE_TYPE_NONE", "SEV_SNP"}, - "resources.jobs.*.tasks[*].new_cluster.kind": {"CLASSIC_PREVIEW"}, - "resources.jobs.*.tasks[*].new_cluster.runtime_engine": {"NULL", "PHOTON", "STANDARD"}, - "resources.jobs.*.tasks[*].notebook_task.source": {"GIT", "WORKSPACE"}, - "resources.jobs.*.tasks[*].power_bi_task.power_bi_model.authentication_method": {"OAUTH", "PAT"}, - "resources.jobs.*.tasks[*].power_bi_task.power_bi_model.storage_mode": {"DIRECT_QUERY", "DUAL", "IMPORT"}, - "resources.jobs.*.tasks[*].power_bi_task.tables[*].storage_mode": {"DIRECT_QUERY", "DUAL", "IMPORT"}, - "resources.jobs.*.tasks[*].run_if": {"ALL_DONE", "ALL_FAILED", "ALL_SUCCESS", "AT_LEAST_ONE_FAILED", "AT_LEAST_ONE_SUCCESS", "NONE_FAILED"}, - "resources.jobs.*.tasks[*].spark_python_task.source": {"GIT", "WORKSPACE"}, - "resources.jobs.*.tasks[*].sql_task.file.source": {"GIT", "WORKSPACE"}, - "resources.jobs.*.trigger.model.condition": {"MODEL_ALIAS_SET", "MODEL_CREATED", "MODEL_VERSION_READY"}, - "resources.jobs.*.trigger.pause_status": {"PAUSED", "UNPAUSED"}, - "resources.jobs.*.trigger.periodic.unit": {"DAYS", "HOURS", "MINUTES", "WEEKS"}, - "resources.jobs.*.trigger.sql_condition.trigger_mode": {"QUERY_RETURNS_ROWS", "RESULT_VALUE_CHANGES"}, - "resources.jobs.*.trigger.table_update.condition": {"ALL_UPDATED", "ANY_UPDATED"}, - "resources.jobs.*.triggers[*].continuous.maintenance_window.day_of_week": {"FRIDAY", "MONDAY", "SATURDAY", "SUNDAY", "THURSDAY", "TUESDAY", "WEDNESDAY"}, - "resources.jobs.*.triggers[*].continuous.task_retry_mode": {"NEVER", "ON_FAILURE"}, - "resources.jobs.*.triggers[*].model.condition": {"MODEL_ALIAS_SET", "MODEL_CREATED", "MODEL_VERSION_READY"}, - "resources.jobs.*.triggers[*].pause_status": {"PAUSED", "UNPAUSED"}, - "resources.jobs.*.triggers[*].periodic.unit": {"DAYS", "HOURS", "MINUTES", "WEEKS"}, - "resources.jobs.*.triggers[*].sql_condition.trigger_mode": {"QUERY_RETURNS_ROWS", "RESULT_VALUE_CHANGES"}, - "resources.jobs.*.triggers[*].table_update.condition": {"ALL_UPDATED", "ANY_UPDATED"}, - - "resources.mcp_services.*.config.rate_limits[*].key": {"RATE_LIMIT_KEY_SERVICE", "RATE_LIMIT_KEY_SERVICE_PRINCIPAL", "RATE_LIMIT_KEY_USER", "RATE_LIMIT_KEY_USER_DEFAULT", "RATE_LIMIT_KEY_USER_GROUP"}, - "resources.mcp_services.*.config.rate_limits[*].renewal_period": {"RATE_LIMIT_RENEWAL_PERIOD_HOUR", "RATE_LIMIT_RENEWAL_PERIOD_MINUTE"}, - "resources.mcp_services.*.grants[*].privileges[*]": {"ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "BROWSE", "CREATE", "CREATE_CATALOG", "CREATE_CLEAN_ROOM", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FOREIGN_SECURABLE", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "EXECUTE_CLEAN_ROOM_TASK", "EXTERNAL_USE_LOCATION", "EXTERNAL_USE_SCHEMA", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "MODIFY_CLEAN_ROOM", "READ_FILES", "READ_METADATA", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"}, - - "resources.model_provider_services.*.config.provider_type": {"EXTERNAL_MODEL_PROVIDER_TYPE_AMAZON_BEDROCK", "EXTERNAL_MODEL_PROVIDER_TYPE_ANTHROPIC", "EXTERNAL_MODEL_PROVIDER_TYPE_AZURE_OPENAI", "EXTERNAL_MODEL_PROVIDER_TYPE_BEDROCK_MANTLE", "EXTERNAL_MODEL_PROVIDER_TYPE_CUSTOM", "EXTERNAL_MODEL_PROVIDER_TYPE_GEMINI_ENTERPRISE", "EXTERNAL_MODEL_PROVIDER_TYPE_MICROSOFT_FOUNDRY", "EXTERNAL_MODEL_PROVIDER_TYPE_OPENAI"}, - "resources.model_provider_services.*.config.rate_limits[*].key": {"RATE_LIMIT_KEY_SERVICE", "RATE_LIMIT_KEY_SERVICE_PRINCIPAL", "RATE_LIMIT_KEY_USER", "RATE_LIMIT_KEY_USER_DEFAULT", "RATE_LIMIT_KEY_USER_GROUP"}, - "resources.model_provider_services.*.config.rate_limits[*].renewal_period": {"RATE_LIMIT_RENEWAL_PERIOD_HOUR", "RATE_LIMIT_RENEWAL_PERIOD_MINUTE"}, - "resources.model_provider_services.*.grants[*].privileges[*]": {"ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "BROWSE", "CREATE", "CREATE_CATALOG", "CREATE_CLEAN_ROOM", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FOREIGN_SECURABLE", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "EXECUTE_CLEAN_ROOM_TASK", "EXTERNAL_USE_LOCATION", "EXTERNAL_USE_SCHEMA", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "MODIFY_CLEAN_ROOM", "READ_FILES", "READ_METADATA", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"}, - - "resources.model_services.*.config.rate_limits[*].key": {"RATE_LIMIT_KEY_SERVICE", "RATE_LIMIT_KEY_SERVICE_PRINCIPAL", "RATE_LIMIT_KEY_USER", "RATE_LIMIT_KEY_USER_DEFAULT", "RATE_LIMIT_KEY_USER_GROUP"}, - "resources.model_services.*.config.rate_limits[*].renewal_period": {"RATE_LIMIT_RENEWAL_PERIOD_HOUR", "RATE_LIMIT_RENEWAL_PERIOD_MINUTE"}, - "resources.model_services.*.config.routing.destinations[*].destination_type": {"DESTINATION_TYPE_EXTERNAL_FOUNDATION_MODEL", "DESTINATION_TYPE_PAY_PER_TOKEN_FOUNDATION_MODEL", "DESTINATION_TYPE_PROVISIONED_THROUGHPUT_FOUNDATION_MODEL"}, - "resources.model_services.*.config.routing.fallback.destinations[*].destination_type": {"DESTINATION_TYPE_EXTERNAL_FOUNDATION_MODEL", "DESTINATION_TYPE_PAY_PER_TOKEN_FOUNDATION_MODEL", "DESTINATION_TYPE_PROVISIONED_THROUGHPUT_FOUNDATION_MODEL"}, - "resources.model_services.*.grants[*].privileges[*]": {"ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "BROWSE", "CREATE", "CREATE_CATALOG", "CREATE_CLEAN_ROOM", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FOREIGN_SECURABLE", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "EXECUTE_CLEAN_ROOM_TASK", "EXTERNAL_USE_LOCATION", "EXTERNAL_USE_SCHEMA", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "MODIFY_CLEAN_ROOM", "READ_FILES", "READ_METADATA", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"}, - - "resources.model_serving_endpoints.*.ai_gateway.guardrails.input.pii.behavior": {"BLOCK", "MASK", "NONE"}, - "resources.model_serving_endpoints.*.ai_gateway.guardrails.output.pii.behavior": {"BLOCK", "MASK", "NONE"}, - "resources.model_serving_endpoints.*.ai_gateway.rate_limits[*].key": {"endpoint", "service_principal", "user", "user_group"}, - "resources.model_serving_endpoints.*.ai_gateway.rate_limits[*].renewal_period": {"minute"}, - "resources.model_serving_endpoints.*.config.served_entities[*].external_model.amazon_bedrock_config.bedrock_provider": {"ai21labs", "amazon", "anthropic", "cohere"}, - "resources.model_serving_endpoints.*.config.served_entities[*].external_model.provider": {"ai21labs", "amazon-bedrock", "anthropic", "cohere", "custom", "databricks-model-serving", "google-cloud-vertex-ai", "openai", "palm"}, - "resources.model_serving_endpoints.*.config.served_entities[*].workload_type": {"CPU", "CPU_LARGE", "CPU_MEDIUM", "GPU_LARGE", "GPU_MEDIUM", "GPU_SMALL", "GPU_XLARGE", "GPU_XLARGE_8", "MULTIGPU_MEDIUM"}, - "resources.model_serving_endpoints.*.config.served_models[*].workload_type": {"CPU", "CPU_LARGE", "CPU_MEDIUM", "GPU_LARGE", "GPU_MEDIUM", "GPU_SMALL", "GPU_XLARGE", "GPU_XLARGE_8", "MULTIGPU_MEDIUM"}, - "resources.model_serving_endpoints.*.permissions[*].level": {"CAN_MANAGE", "CAN_QUERY", "CAN_VIEW"}, - "resources.model_serving_endpoints.*.rate_limits[*].key": {"endpoint", "user"}, - "resources.model_serving_endpoints.*.rate_limits[*].renewal_period": {"minute"}, - "resources.model_serving_endpoints.*.telemetry_config.enabled_telemetry_features[*]": {"TELEMETRY_FEATURE_INFERENCE_TABLE", "TELEMETRY_FEATURE_LOGS", "TELEMETRY_FEATURE_METRICS", "TELEMETRY_FEATURE_TRACES"}, - - "resources.models.*.permissions[*].level": {"CAN_EDIT", "CAN_MANAGE", "CAN_MANAGE_PRODUCTION_VERSIONS", "CAN_MANAGE_STAGING_VERSIONS", "CAN_READ"}, - - "resources.pipelines.*.clusters[*].autoscale.mode": {"ENHANCED", "LEGACY"}, - "resources.pipelines.*.clusters[*].aws_attributes.availability": {"ON_DEMAND", "SPOT", "SPOT_WITH_FALLBACK"}, - "resources.pipelines.*.clusters[*].aws_attributes.ebs_volume_type": {"GENERAL_PURPOSE_SSD", "THROUGHPUT_OPTIMIZED_HDD"}, - "resources.pipelines.*.clusters[*].azure_attributes.availability": {"ON_DEMAND_AZURE", "SPOT_AZURE", "SPOT_WITH_FALLBACK_AZURE"}, - "resources.pipelines.*.clusters[*].gcp_attributes.availability": {"ON_DEMAND_GCP", "PREEMPTIBLE_GCP", "PREEMPTIBLE_WITH_FALLBACK_GCP"}, - "resources.pipelines.*.clusters[*].gcp_attributes.confidential_compute_type": {"CONFIDENTIAL_COMPUTE_TYPE_NONE", "SEV_SNP"}, - "resources.pipelines.*.deployment.kind": {"BUNDLE"}, - "resources.pipelines.*.ingestion_definition.connector_type": {"CDC", "QUERY_BASED"}, - "resources.pipelines.*.ingestion_definition.full_refresh_window.days_of_week[*]": {"FRIDAY", "MONDAY", "SATURDAY", "SUNDAY", "THURSDAY", "TUESDAY", "WEDNESDAY"}, - "resources.pipelines.*.ingestion_definition.objects[*].report.table_configuration.scd_type": {"APPEND_ONLY", "SCD_TYPE_1", "SCD_TYPE_2"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.gdrive_options.entity_type": {"FILE", "FILE_METADATA", "PERMISSION"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.gdrive_options.file_ingestion_options.format": {"AVRO", "BINARYFILE", "CSV", "EXCEL", "JSON", "ORC", "PARQUET", "XML"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.gdrive_options.file_ingestion_options.schema_evolution_mode": {"ADD_NEW_COLUMNS", "ADD_NEW_COLUMNS_WITH_TYPE_WIDENING", "FAIL_ON_NEW_COLUMNS", "NONE", "RESCUE"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.kafka_options.key_transformer.avro_options.parse_mode": {"FAILFAST", "PERMISSIVE"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.kafka_options.key_transformer.format": {"AVRO", "JSON", "PROTOBUF", "STRING"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.kafka_options.key_transformer.json_options.schema_evolution_mode": {"ADD_NEW_COLUMNS", "ADD_NEW_COLUMNS_WITH_TYPE_WIDENING", "FAIL_ON_NEW_COLUMNS", "NONE", "RESCUE"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.kafka_options.key_transformer.protobuf_options.parse_mode": {"FAILFAST", "PERMISSIVE"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.kafka_options.value_transformer.avro_options.parse_mode": {"FAILFAST", "PERMISSIVE"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.kafka_options.value_transformer.format": {"AVRO", "JSON", "PROTOBUF", "STRING"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.kafka_options.value_transformer.json_options.schema_evolution_mode": {"ADD_NEW_COLUMNS", "ADD_NEW_COLUMNS_WITH_TYPE_WIDENING", "FAIL_ON_NEW_COLUMNS", "NONE", "RESCUE"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.kafka_options.value_transformer.protobuf_options.parse_mode": {"FAILFAST", "PERMISSIVE"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.linkedin_ads_options.custom_report_options.entity_granularity[*]": {"CAMPAIGN", "CAMPAIGN_GROUP", "CREATIVE"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.linkedin_ads_options.custom_report_options.finder": {"ANALYTICS", "ATTRIBUTED_REVENUE_METRICS", "STATISTICS"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.linkedin_ads_options.custom_report_options.time_granularity": {"ALL", "DAILY", "MONTHLY", "YEARLY"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.outlook_options.attachment_mode": {"ALL", "INLINE_ONLY", "NONE", "NON_INLINE_ONLY"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.outlook_options.body_format": {"TEXT_HTML", "TEXT_PLAIN"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.sharepoint_options.entity_type": {"FILE", "FILE_METADATA", "LIST", "PERMISSION"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.sharepoint_options.file_ingestion_options.format": {"AVRO", "BINARYFILE", "CSV", "EXCEL", "JSON", "ORC", "PARQUET", "XML"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.sharepoint_options.file_ingestion_options.schema_evolution_mode": {"ADD_NEW_COLUMNS", "ADD_NEW_COLUMNS_WITH_TYPE_WIDENING", "FAIL_ON_NEW_COLUMNS", "NONE", "RESCUE"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.tiktok_ads_options.custom_report_options.data_level": {"AUCTION_AD", "AUCTION_ADGROUP", "AUCTION_ADVERTISER", "AUCTION_CAMPAIGN"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.tiktok_ads_options.custom_report_options.report_type": {"AUDIENCE", "BASIC", "BUSINESS_CENTER", "DSA", "GMV_MAX", "PLAYABLE_AD"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.tiktok_ads_options.data_level": {"AUCTION_AD", "AUCTION_ADGROUP", "AUCTION_ADVERTISER", "AUCTION_CAMPAIGN"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.tiktok_ads_options.report_type": {"AUDIENCE", "BASIC", "BUSINESS_CENTER", "DSA", "GMV_MAX", "PLAYABLE_AD"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.fanout_options.transforms[*].avro_options.parse_mode": {"FAILFAST", "PERMISSIVE"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.fanout_options.transforms[*].format": {"AVRO", "JSON", "PROTOBUF", "STRING"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.fanout_options.transforms[*].json_options.schema_evolution_mode": {"ADD_NEW_COLUMNS", "ADD_NEW_COLUMNS_WITH_TYPE_WIDENING", "FAIL_ON_NEW_COLUMNS", "NONE", "RESCUE"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.fanout_options.transforms[*].protobuf_options.parse_mode": {"FAILFAST", "PERMISSIVE"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.table_configuration.scd_type": {"APPEND_ONLY", "SCD_TYPE_1", "SCD_TYPE_2"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.gdrive_options.entity_type": {"FILE", "FILE_METADATA", "PERMISSION"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.gdrive_options.file_ingestion_options.format": {"AVRO", "BINARYFILE", "CSV", "EXCEL", "JSON", "ORC", "PARQUET", "XML"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.gdrive_options.file_ingestion_options.schema_evolution_mode": {"ADD_NEW_COLUMNS", "ADD_NEW_COLUMNS_WITH_TYPE_WIDENING", "FAIL_ON_NEW_COLUMNS", "NONE", "RESCUE"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.kafka_options.key_transformer.avro_options.parse_mode": {"FAILFAST", "PERMISSIVE"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.kafka_options.key_transformer.format": {"AVRO", "JSON", "PROTOBUF", "STRING"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.kafka_options.key_transformer.json_options.schema_evolution_mode": {"ADD_NEW_COLUMNS", "ADD_NEW_COLUMNS_WITH_TYPE_WIDENING", "FAIL_ON_NEW_COLUMNS", "NONE", "RESCUE"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.kafka_options.key_transformer.protobuf_options.parse_mode": {"FAILFAST", "PERMISSIVE"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.kafka_options.value_transformer.avro_options.parse_mode": {"FAILFAST", "PERMISSIVE"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.kafka_options.value_transformer.format": {"AVRO", "JSON", "PROTOBUF", "STRING"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.kafka_options.value_transformer.json_options.schema_evolution_mode": {"ADD_NEW_COLUMNS", "ADD_NEW_COLUMNS_WITH_TYPE_WIDENING", "FAIL_ON_NEW_COLUMNS", "NONE", "RESCUE"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.kafka_options.value_transformer.protobuf_options.parse_mode": {"FAILFAST", "PERMISSIVE"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.linkedin_ads_options.custom_report_options.entity_granularity[*]": {"CAMPAIGN", "CAMPAIGN_GROUP", "CREATIVE"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.linkedin_ads_options.custom_report_options.finder": {"ANALYTICS", "ATTRIBUTED_REVENUE_METRICS", "STATISTICS"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.linkedin_ads_options.custom_report_options.time_granularity": {"ALL", "DAILY", "MONTHLY", "YEARLY"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.outlook_options.attachment_mode": {"ALL", "INLINE_ONLY", "NONE", "NON_INLINE_ONLY"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.outlook_options.body_format": {"TEXT_HTML", "TEXT_PLAIN"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.sharepoint_options.entity_type": {"FILE", "FILE_METADATA", "LIST", "PERMISSION"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.sharepoint_options.file_ingestion_options.format": {"AVRO", "BINARYFILE", "CSV", "EXCEL", "JSON", "ORC", "PARQUET", "XML"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.sharepoint_options.file_ingestion_options.schema_evolution_mode": {"ADD_NEW_COLUMNS", "ADD_NEW_COLUMNS_WITH_TYPE_WIDENING", "FAIL_ON_NEW_COLUMNS", "NONE", "RESCUE"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.tiktok_ads_options.custom_report_options.data_level": {"AUCTION_AD", "AUCTION_ADGROUP", "AUCTION_ADVERTISER", "AUCTION_CAMPAIGN"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.tiktok_ads_options.custom_report_options.report_type": {"AUDIENCE", "BASIC", "BUSINESS_CENTER", "DSA", "GMV_MAX", "PLAYABLE_AD"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.tiktok_ads_options.data_level": {"AUCTION_AD", "AUCTION_ADGROUP", "AUCTION_ADVERTISER", "AUCTION_CAMPAIGN"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.tiktok_ads_options.report_type": {"AUDIENCE", "BASIC", "BUSINESS_CENTER", "DSA", "GMV_MAX", "PLAYABLE_AD"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.table_configuration.scd_type": {"APPEND_ONLY", "SCD_TYPE_1", "SCD_TYPE_2"}, - "resources.pipelines.*.ingestion_definition.source_type": {"BIGQUERY", "CONFLUENCE", "DYNAMICS365", "FOREIGN_CATALOG", "GA4_RAW_DATA", "GOOGLE_DRIVE", "JIRA", "MANAGED_POSTGRESQL", "META_MARKETING", "MYSQL", "NETSUITE", "ORACLE", "POSTGRESQL", "RABBITMQ", "SALESFORCE", "SERVICENOW", "SHAREPOINT", "SMARTSHEET", "SQLSERVER", "TERADATA", "TIKTOK_ADS", "WORKDAY_RAAS", "ZENDESK"}, - "resources.pipelines.*.ingestion_definition.table_configuration.scd_type": {"APPEND_ONLY", "SCD_TYPE_1", "SCD_TYPE_2"}, - "resources.pipelines.*.permissions[*].level": {"CAN_MANAGE", "CAN_RUN", "CAN_VIEW", "IS_OWNER"}, - "resources.pipelines.*.restart_window.days_of_week[*]": {"FRIDAY", "MONDAY", "SATURDAY", "SUNDAY", "THURSDAY", "TUESDAY", "WEDNESDAY"}, - - "resources.postgres_endpoints.*.endpoint_type": {"ENDPOINT_TYPE_READ_ONLY", "ENDPOINT_TYPE_READ_WRITE"}, - - "resources.postgres_projects.*.permissions[*].level": {"CAN_ATTACH_TO", "CAN_BIND", "CAN_CREATE", "CAN_CREATE_APP", "CAN_EDIT", "CAN_EDIT_METADATA", "CAN_MANAGE", "CAN_MANAGE_PRODUCTION_VERSIONS", "CAN_MANAGE_RUN", "CAN_MANAGE_STAGING_VERSIONS", "CAN_MONITOR", "CAN_MONITOR_ONLY", "CAN_QUERY", "CAN_READ", "CAN_RESTART", "CAN_RUN", "CAN_USE", "CAN_VIEW", "CAN_VIEW_METADATA", "IS_OWNER"}, - - "resources.postgres_roles.*.auth_method": {"LAKEBASE_OAUTH_V1", "NO_LOGIN", "PG_PASSWORD_SCRAM_SHA_256"}, - "resources.postgres_roles.*.identity_type": {"GROUP", "SERVICE_PRINCIPAL", "USER"}, - "resources.postgres_roles.*.membership_roles[*]": {"DATABRICKS_SUPERUSER"}, - - "resources.postgres_snapshot_schedules.*.schedule[*].weekly_schedule.day_of_week": {"FRIDAY", "MONDAY", "SATURDAY", "SUNDAY", "THURSDAY", "TUESDAY", "WEDNESDAY"}, - - "resources.postgres_synced_tables.*.extra_columns[*].maintenance": {"STORED_GENERATED"}, - "resources.postgres_synced_tables.*.new_pipeline_spec.pipeline_channel": {"CURRENT", "PREVIEW"}, - "resources.postgres_synced_tables.*.scheduling_policy": {"CONTINUOUS", "SNAPSHOT", "TRIGGERED"}, - "resources.postgres_synced_tables.*.type_overrides[*].pg_type": {"PG_SPECIFIC_TYPE_HALFVEC", "PG_SPECIFIC_TYPE_VARCHAR", "PG_SPECIFIC_TYPE_VECTOR"}, - - "resources.quality_monitors.*.custom_metrics[*].type": {"CUSTOM_METRIC_TYPE_AGGREGATE", "CUSTOM_METRIC_TYPE_DERIVED", "CUSTOM_METRIC_TYPE_DRIFT"}, - "resources.quality_monitors.*.inference_log.problem_type": {"PROBLEM_TYPE_CLASSIFICATION", "PROBLEM_TYPE_REGRESSION"}, - "resources.quality_monitors.*.schedule.pause_status": {"PAUSED", "UNPAUSED", "UNSPECIFIED"}, - - "resources.registered_models.*.grants[*].privileges[*]": {"ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "BROWSE", "CREATE", "CREATE_CATALOG", "CREATE_CLEAN_ROOM", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FOREIGN_SECURABLE", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "EXECUTE_CLEAN_ROOM_TASK", "EXTERNAL_USE_LOCATION", "EXTERNAL_USE_SCHEMA", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "MODIFY_CLEAN_ROOM", "READ_FILES", "READ_METADATA", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"}, - - "resources.schemas.*.grants[*].privileges[*]": {"ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "BROWSE", "CREATE", "CREATE_CATALOG", "CREATE_CLEAN_ROOM", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FOREIGN_SECURABLE", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "EXECUTE_CLEAN_ROOM_TASK", "EXTERNAL_USE_LOCATION", "EXTERNAL_USE_SCHEMA", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "MODIFY_CLEAN_ROOM", "READ_FILES", "READ_METADATA", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"}, - - "resources.secret_scopes.*.backend_type": {"AZURE_KEYVAULT", "DATABRICKS"}, - "resources.secret_scopes.*.permissions[*].level": {"READ", "WRITE", "MANAGE"}, - - "resources.secrets.*.grants[*].privileges[*]": {"ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "BROWSE", "CREATE", "CREATE_CATALOG", "CREATE_CLEAN_ROOM", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FOREIGN_SECURABLE", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "EXECUTE_CLEAN_ROOM_TASK", "EXTERNAL_USE_LOCATION", "EXTERNAL_USE_SCHEMA", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "MODIFY_CLEAN_ROOM", "READ_FILES", "READ_METADATA", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"}, - - "resources.sql_warehouses.*.channel.name": {"CHANNEL_NAME_CURRENT", "CHANNEL_NAME_CUSTOM", "CHANNEL_NAME_PREVIEW", "CHANNEL_NAME_PREVIOUS"}, - "resources.sql_warehouses.*.permissions[*].level": {"CAN_MANAGE", "CAN_MONITOR", "CAN_USE", "CAN_VIEW", "IS_OWNER"}, - "resources.sql_warehouses.*.spot_instance_policy": {"COST_OPTIMIZED", "POLICY_UNSPECIFIED", "RELIABILITY_OPTIMIZED"}, - "resources.sql_warehouses.*.warehouse_type": {"CLASSIC", "PRO", "REALTIME", "TYPE_UNSPECIFIED"}, - - "resources.synced_database_tables.*.data_synchronization_status.continuous_update_status.initial_pipeline_sync_progress.provisioning_phase": {"PROVISIONING_PHASE_INDEX_SCAN", "PROVISIONING_PHASE_INDEX_SORT", "PROVISIONING_PHASE_MAIN"}, - "resources.synced_database_tables.*.data_synchronization_status.detailed_state": {"SYNCED_TABLED_OFFLINE", "SYNCED_TABLE_OFFLINE_FAILED", "SYNCED_TABLE_ONLINE", "SYNCED_TABLE_ONLINE_CONTINUOUS_UPDATE", "SYNCED_TABLE_ONLINE_NO_PENDING_UPDATE", "SYNCED_TABLE_ONLINE_PIPELINE_FAILED", "SYNCED_TABLE_ONLINE_TRIGGERED_UPDATE", "SYNCED_TABLE_ONLINE_UPDATING_PIPELINE_RESOURCES", "SYNCED_TABLE_PROVISIONING", "SYNCED_TABLE_PROVISIONING_INITIAL_SNAPSHOT", "SYNCED_TABLE_PROVISIONING_PIPELINE_RESOURCES"}, - "resources.synced_database_tables.*.data_synchronization_status.provisioning_status.initial_pipeline_sync_progress.provisioning_phase": {"PROVISIONING_PHASE_INDEX_SCAN", "PROVISIONING_PHASE_INDEX_SORT", "PROVISIONING_PHASE_MAIN"}, - "resources.synced_database_tables.*.data_synchronization_status.triggered_update_status.triggered_update_progress.provisioning_phase": {"PROVISIONING_PHASE_INDEX_SCAN", "PROVISIONING_PHASE_INDEX_SORT", "PROVISIONING_PHASE_MAIN"}, - "resources.synced_database_tables.*.spec.scheduling_policy": {"CONTINUOUS", "SNAPSHOT", "TRIGGERED"}, - "resources.synced_database_tables.*.spec.type_overrides[*].pg_type": {"PG_SPECIFIC_TYPE_HALFVEC", "PG_SPECIFIC_TYPE_VARCHAR", "PG_SPECIFIC_TYPE_VECTOR"}, - "resources.synced_database_tables.*.unity_catalog_provisioning_state": {"ACTIVE", "DEGRADED", "DELETING", "FAILED", "PROVISIONING", "UPDATING"}, - - "resources.vector_search_endpoints.*.endpoint_type": {"STANDARD", "STORAGE_OPTIMIZED"}, - "resources.vector_search_endpoints.*.permissions[*].level": {"CAN_CREATE", "CAN_MANAGE", "CAN_USE"}, - - "resources.vector_search_indexes.*.delta_sync_index_spec.pipeline_type": {"CONTINUOUS", "TRIGGERED"}, - "resources.vector_search_indexes.*.grants[*].privileges[*]": {"ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "BROWSE", "CREATE", "CREATE_CATALOG", "CREATE_CLEAN_ROOM", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FOREIGN_SECURABLE", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "EXECUTE_CLEAN_ROOM_TASK", "EXTERNAL_USE_LOCATION", "EXTERNAL_USE_SCHEMA", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "MODIFY_CLEAN_ROOM", "READ_FILES", "READ_METADATA", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"}, - "resources.vector_search_indexes.*.index_subtype": {"FULL_TEXT", "HYBRID", "VECTOR"}, - "resources.vector_search_indexes.*.index_type": {"DELTA_SYNC", "DIRECT_ACCESS"}, - - "resources.volumes.*.grants[*].privileges[*]": {"ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "BROWSE", "CREATE", "CREATE_CATALOG", "CREATE_CLEAN_ROOM", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FOREIGN_SECURABLE", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "EXECUTE_CLEAN_ROOM_TASK", "EXTERNAL_USE_LOCATION", "EXTERNAL_USE_SCHEMA", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "MODIFY_CLEAN_ROOM", "READ_FILES", "READ_METADATA", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"}, - "resources.volumes.*.volume_type": {"EXTERNAL", "MANAGED"}, - - "variables.*.type": {"complex"}, -} diff --git a/bundle/internal/validation/generated/required_fields.go b/bundle/internal/validation/generated/required_fields.go deleted file mode 100644 index f43a07dddce..00000000000 --- a/bundle/internal/validation/generated/required_fields.go +++ /dev/null @@ -1,400 +0,0 @@ -package generated - -// THIS FILE IS AUTOGENERATED. -// DO NOT EDIT THIS FILE DIRECTLY. - -// RequiredFields maps [dyn.Pattern] to required fields they should have. -var RequiredFields = map[string][]string{ - "artifacts.*.files[*]": {"source"}, - - "bundle": {"name"}, - - "permissions[*]": {"level"}, - - "resources.alerts.*": {"display_name", "evaluation", "query_text", "schedule", "warehouse_id"}, - "resources.alerts.*.evaluation": {"comparison_operator", "source"}, - "resources.alerts.*.evaluation.source": {"name"}, - "resources.alerts.*.evaluation.threshold.column": {"name"}, - "resources.alerts.*.parameters[*]": {"name"}, - "resources.alerts.*.permissions[*]": {"level"}, - "resources.alerts.*.schedule": {"quartz_cron_schedule", "timezone_id"}, - - "resources.apps.*": {"name"}, - "resources.apps.*.active_deployment.git_source.git_repository": {"provider", "url"}, - "resources.apps.*.config.env[*]": {"name"}, - "resources.apps.*.default_git_source.git_repository": {"provider", "url"}, - "resources.apps.*.git_repository": {"provider", "url"}, - "resources.apps.*.git_source.git_repository": {"provider", "url"}, - "resources.apps.*.pending_deployment.git_source.git_repository": {"provider", "url"}, - "resources.apps.*.permissions[*]": {"level"}, - "resources.apps.*.resources[*]": {"name"}, - "resources.apps.*.resources[*].database": {"database_name", "instance_name", "permission"}, - "resources.apps.*.resources[*].experiment": {"experiment_id", "permission"}, - "resources.apps.*.resources[*].genie_space": {"name", "permission", "space_id"}, - "resources.apps.*.resources[*].job": {"id", "permission"}, - "resources.apps.*.resources[*].secret": {"key", "permission", "scope"}, - "resources.apps.*.resources[*].serving_endpoint": {"name", "permission"}, - "resources.apps.*.resources[*].sql_warehouse": {"id", "permission"}, - "resources.apps.*.resources[*].uc_securable": {"permission", "securable_full_name", "securable_type"}, - "resources.apps.*.telemetry_export_destinations[*].unity_catalog": {"logs_table", "metrics_table", "traces_table"}, - - "resources.catalogs.*": {"name"}, - "resources.catalogs.*.managed_encryption_settings.azure_encryption_settings": {"azure_tenant_id"}, - - "resources.cluster_policies.*.libraries[*].cran": {"package"}, - "resources.cluster_policies.*.libraries[*].maven": {"coordinates"}, - "resources.cluster_policies.*.libraries[*].pypi": {"package"}, - "resources.cluster_policies.*.permissions[*]": {"level"}, - - "resources.clusters.*.cluster_log_conf.dbfs": {"destination"}, - "resources.clusters.*.cluster_log_conf.s3": {"destination"}, - "resources.clusters.*.cluster_log_conf.volumes": {"destination"}, - "resources.clusters.*.init_scripts[*].abfss": {"destination"}, - "resources.clusters.*.init_scripts[*].dbfs": {"destination"}, - "resources.clusters.*.init_scripts[*].file": {"destination"}, - "resources.clusters.*.init_scripts[*].gcs": {"destination"}, - "resources.clusters.*.init_scripts[*].s3": {"destination"}, - "resources.clusters.*.init_scripts[*].volumes": {"destination"}, - "resources.clusters.*.init_scripts[*].workspace": {"destination"}, - "resources.clusters.*.libraries[*].cran": {"package"}, - "resources.clusters.*.libraries[*].maven": {"coordinates"}, - "resources.clusters.*.libraries[*].pypi": {"package"}, - "resources.clusters.*.permissions[*]": {"level"}, - "resources.clusters.*.workload_type": {"clients"}, - - "resources.dashboards.*.permissions[*]": {"level"}, - - "resources.database_catalogs.*": {"database_instance_name", "database_name", "name"}, - - "resources.database_instances.*": {"name"}, - "resources.database_instances.*.permissions[*]": {"level"}, - - "resources.experiments.*": {"name"}, - "resources.experiments.*.permissions[*]": {"level"}, - "resources.experiments.*.trace_location.uc_trace_location": {"catalog", "schema"}, - - "resources.external_locations.*": {"credential_name", "name", "url"}, - - "resources.features.*": {"full_name", "function", "source"}, - "resources.features.*.entities[*]": {"name"}, - "resources.features.*.function.aggregation_function.approx_count_distinct": {"input"}, - "resources.features.*.function.aggregation_function.approx_percentile": {"input", "percentile"}, - "resources.features.*.function.aggregation_function.avg": {"input"}, - "resources.features.*.function.aggregation_function.count_function": {"input"}, - "resources.features.*.function.aggregation_function.first": {"input"}, - "resources.features.*.function.aggregation_function.first_distinct": {"input", "n"}, - "resources.features.*.function.aggregation_function.first_n": {"input", "n"}, - "resources.features.*.function.aggregation_function.last": {"input"}, - "resources.features.*.function.aggregation_function.last_distinct": {"input", "n"}, - "resources.features.*.function.aggregation_function.last_n": {"input", "n"}, - "resources.features.*.function.aggregation_function.max": {"input"}, - "resources.features.*.function.aggregation_function.min": {"input"}, - "resources.features.*.function.aggregation_function.stddev_pop": {"input"}, - "resources.features.*.function.aggregation_function.stddev_samp": {"input"}, - "resources.features.*.function.aggregation_function.sum": {"input"}, - "resources.features.*.function.aggregation_function.time_window.continuous": {"window_duration"}, - "resources.features.*.function.aggregation_function.time_window.sliding": {"slide_duration"}, - "resources.features.*.function.aggregation_function.time_window.tumbling": {"window_duration"}, - "resources.features.*.function.aggregation_function.var_pop": {"input"}, - "resources.features.*.function.aggregation_function.var_samp": {"input"}, - "resources.features.*.function.column_selection": {"column"}, - "resources.features.*.function.custom_udf": {"function_path"}, - "resources.features.*.function.custom_udf.input_bindings[*]": {"column", "parameter"}, - "resources.features.*.function.extra_parameters[*]": {"key", "value"}, - "resources.features.*.source.delta_table_source": {"full_name"}, - "resources.features.*.source.feature_view_source.feature_references[*]": {"feature"}, - "resources.features.*.source.kafka_source": {"name"}, - "resources.features.*.source.kafka_source.entity_column_identifiers[*]": {"variant_expr_path"}, - "resources.features.*.source.kafka_source.timeseries_column_identifier": {"variant_expr_path"}, - "resources.features.*.source.request_source.flat_schema": {"fields"}, - "resources.features.*.source.request_source.flat_schema.fields[*]": {"data_type", "name"}, - "resources.features.*.source.stream_source": {"full_name"}, - "resources.features.*.time_window.continuous": {"window_duration"}, - "resources.features.*.time_window.sliding": {"slide_duration"}, - "resources.features.*.time_window.tumbling": {"window_duration"}, - "resources.features.*.timeseries_column": {"name"}, - - "resources.genie_spaces.*.permissions[*]": {"level"}, - - "resources.instance_pools.*": {"instance_pool_name", "node_type_id"}, - "resources.instance_pools.*.permissions[*]": {"level"}, - - "resources.job_runs.*": {"job_id"}, - "resources.job_runs.*.queue": {"enabled"}, - - "resources.jobs.*.continuous.maintenance_window": {"day_of_week", "start_hour", "timezone_id"}, - "resources.jobs.*.deployment": {"kind"}, - "resources.jobs.*.environment_variables[*]": {"environment_variables_key"}, - "resources.jobs.*.environments[*]": {"environment_key"}, - "resources.jobs.*.git_source": {"git_provider", "git_url"}, - "resources.jobs.*.git_source.job_source": {"import_from_git_branch", "job_config_path"}, - "resources.jobs.*.health.rules[*]": {"metric", "op", "value"}, - "resources.jobs.*.job_clusters[*]": {"job_cluster_key"}, - "resources.jobs.*.job_clusters[*].new_cluster.cluster_log_conf.dbfs": {"destination"}, - "resources.jobs.*.job_clusters[*].new_cluster.cluster_log_conf.s3": {"destination"}, - "resources.jobs.*.job_clusters[*].new_cluster.cluster_log_conf.volumes": {"destination"}, - "resources.jobs.*.job_clusters[*].new_cluster.init_scripts[*].abfss": {"destination"}, - "resources.jobs.*.job_clusters[*].new_cluster.init_scripts[*].dbfs": {"destination"}, - "resources.jobs.*.job_clusters[*].new_cluster.init_scripts[*].file": {"destination"}, - "resources.jobs.*.job_clusters[*].new_cluster.init_scripts[*].gcs": {"destination"}, - "resources.jobs.*.job_clusters[*].new_cluster.init_scripts[*].s3": {"destination"}, - "resources.jobs.*.job_clusters[*].new_cluster.init_scripts[*].volumes": {"destination"}, - "resources.jobs.*.job_clusters[*].new_cluster.init_scripts[*].workspace": {"destination"}, - "resources.jobs.*.job_clusters[*].new_cluster.workload_type": {"clients"}, - "resources.jobs.*.parameters[*]": {"default", "name"}, - "resources.jobs.*.permissions[*]": {"level"}, - "resources.jobs.*.queue": {"enabled"}, - "resources.jobs.*.schedule": {"quartz_cron_expression", "timezone_id"}, - "resources.jobs.*.schedule.sql_condition": {"sql_query_id", "warehouse_id"}, - "resources.jobs.*.tasks[*]": {"task_key"}, - "resources.jobs.*.tasks[*].ai_runtime_task": {"deployments", "experiment"}, - "resources.jobs.*.tasks[*].ai_runtime_task.deployments[*]": {"compute"}, - "resources.jobs.*.tasks[*].ai_runtime_task.deployments[*].compute": {"accelerator_count", "accelerator_type"}, - "resources.jobs.*.tasks[*].clean_rooms_notebook_task": {"clean_room_name", "notebook_name"}, - "resources.jobs.*.tasks[*].condition_task": {"left", "op", "right"}, - "resources.jobs.*.tasks[*].dashboard_task.subscription.attachment.data_attachment": {"file_format", "widgets"}, - "resources.jobs.*.tasks[*].dashboard_task.subscription.attachment.data_attachment.widgets[*]": {"page_id", "widget_id"}, - "resources.jobs.*.tasks[*].dbt_task": {"commands"}, - "resources.jobs.*.tasks[*].depends_on[*]": {"task_key"}, - "resources.jobs.*.tasks[*].for_each_task": {"inputs", "task"}, - "resources.jobs.*.tasks[*].for_each_task.task": {"task_key"}, - "resources.jobs.*.tasks[*].for_each_task.task.ai_runtime_task": {"deployments", "experiment"}, - "resources.jobs.*.tasks[*].for_each_task.task.ai_runtime_task.deployments[*]": {"compute"}, - "resources.jobs.*.tasks[*].for_each_task.task.ai_runtime_task.deployments[*].compute": {"accelerator_count", "accelerator_type"}, - "resources.jobs.*.tasks[*].for_each_task.task.clean_rooms_notebook_task": {"clean_room_name", "notebook_name"}, - "resources.jobs.*.tasks[*].for_each_task.task.condition_task": {"left", "op", "right"}, - "resources.jobs.*.tasks[*].for_each_task.task.dashboard_task.subscription.attachment.data_attachment": {"file_format", "widgets"}, - "resources.jobs.*.tasks[*].for_each_task.task.dashboard_task.subscription.attachment.data_attachment.widgets[*]": {"page_id", "widget_id"}, - "resources.jobs.*.tasks[*].for_each_task.task.dbt_task": {"commands"}, - "resources.jobs.*.tasks[*].for_each_task.task.depends_on[*]": {"task_key"}, - "resources.jobs.*.tasks[*].for_each_task.task.for_each_task": {"inputs", "task"}, - "resources.jobs.*.tasks[*].for_each_task.task.gen_ai_compute_task": {"dl_runtime_image"}, - "resources.jobs.*.tasks[*].for_each_task.task.gen_ai_compute_task.compute": {"num_gpus"}, - "resources.jobs.*.tasks[*].for_each_task.task.health.rules[*]": {"metric", "op", "value"}, - "resources.jobs.*.tasks[*].for_each_task.task.libraries[*].cran": {"package"}, - "resources.jobs.*.tasks[*].for_each_task.task.libraries[*].maven": {"coordinates"}, - "resources.jobs.*.tasks[*].for_each_task.task.libraries[*].pypi": {"package"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.cluster_log_conf.dbfs": {"destination"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.cluster_log_conf.s3": {"destination"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.cluster_log_conf.volumes": {"destination"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.init_scripts[*].abfss": {"destination"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.init_scripts[*].dbfs": {"destination"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.init_scripts[*].file": {"destination"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.init_scripts[*].gcs": {"destination"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.init_scripts[*].s3": {"destination"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.init_scripts[*].volumes": {"destination"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.init_scripts[*].workspace": {"destination"}, - "resources.jobs.*.tasks[*].for_each_task.task.new_cluster.workload_type": {"clients"}, - "resources.jobs.*.tasks[*].for_each_task.task.notebook_task": {"notebook_path"}, - "resources.jobs.*.tasks[*].for_each_task.task.pipeline_task": {"pipeline_id"}, - "resources.jobs.*.tasks[*].for_each_task.task.python_wheel_task": {"entry_point", "package_name"}, - "resources.jobs.*.tasks[*].for_each_task.task.run_job_task": {"job_id"}, - "resources.jobs.*.tasks[*].for_each_task.task.spark_python_task": {"python_file"}, - "resources.jobs.*.tasks[*].for_each_task.task.sql_task": {"warehouse_id"}, - "resources.jobs.*.tasks[*].for_each_task.task.sql_task.alert": {"alert_id"}, - "resources.jobs.*.tasks[*].for_each_task.task.sql_task.dashboard": {"dashboard_id"}, - "resources.jobs.*.tasks[*].for_each_task.task.sql_task.file": {"path"}, - "resources.jobs.*.tasks[*].for_each_task.task.sql_task.query": {"query_id"}, - "resources.jobs.*.tasks[*].for_each_task.task.webhook_notifications.on_duration_warning_threshold_exceeded[*]": {"id"}, - "resources.jobs.*.tasks[*].for_each_task.task.webhook_notifications.on_failure[*]": {"id"}, - "resources.jobs.*.tasks[*].for_each_task.task.webhook_notifications.on_maintenance_complete[*]": {"id"}, - "resources.jobs.*.tasks[*].for_each_task.task.webhook_notifications.on_maintenance_start[*]": {"id"}, - "resources.jobs.*.tasks[*].for_each_task.task.webhook_notifications.on_start[*]": {"id"}, - "resources.jobs.*.tasks[*].for_each_task.task.webhook_notifications.on_streaming_backlog_exceeded[*]": {"id"}, - "resources.jobs.*.tasks[*].for_each_task.task.webhook_notifications.on_success[*]": {"id"}, - "resources.jobs.*.tasks[*].gen_ai_compute_task": {"dl_runtime_image"}, - "resources.jobs.*.tasks[*].gen_ai_compute_task.compute": {"num_gpus"}, - "resources.jobs.*.tasks[*].health.rules[*]": {"metric", "op", "value"}, - "resources.jobs.*.tasks[*].libraries[*].cran": {"package"}, - "resources.jobs.*.tasks[*].libraries[*].maven": {"coordinates"}, - "resources.jobs.*.tasks[*].libraries[*].pypi": {"package"}, - "resources.jobs.*.tasks[*].new_cluster.cluster_log_conf.dbfs": {"destination"}, - "resources.jobs.*.tasks[*].new_cluster.cluster_log_conf.s3": {"destination"}, - "resources.jobs.*.tasks[*].new_cluster.cluster_log_conf.volumes": {"destination"}, - "resources.jobs.*.tasks[*].new_cluster.init_scripts[*].abfss": {"destination"}, - "resources.jobs.*.tasks[*].new_cluster.init_scripts[*].dbfs": {"destination"}, - "resources.jobs.*.tasks[*].new_cluster.init_scripts[*].file": {"destination"}, - "resources.jobs.*.tasks[*].new_cluster.init_scripts[*].gcs": {"destination"}, - "resources.jobs.*.tasks[*].new_cluster.init_scripts[*].s3": {"destination"}, - "resources.jobs.*.tasks[*].new_cluster.init_scripts[*].volumes": {"destination"}, - "resources.jobs.*.tasks[*].new_cluster.init_scripts[*].workspace": {"destination"}, - "resources.jobs.*.tasks[*].new_cluster.workload_type": {"clients"}, - "resources.jobs.*.tasks[*].notebook_task": {"notebook_path"}, - "resources.jobs.*.tasks[*].pipeline_task": {"pipeline_id"}, - "resources.jobs.*.tasks[*].python_wheel_task": {"entry_point", "package_name"}, - "resources.jobs.*.tasks[*].run_job_task": {"job_id"}, - "resources.jobs.*.tasks[*].spark_python_task": {"python_file"}, - "resources.jobs.*.tasks[*].sql_task": {"warehouse_id"}, - "resources.jobs.*.tasks[*].sql_task.alert": {"alert_id"}, - "resources.jobs.*.tasks[*].sql_task.dashboard": {"dashboard_id"}, - "resources.jobs.*.tasks[*].sql_task.file": {"path"}, - "resources.jobs.*.tasks[*].sql_task.query": {"query_id"}, - "resources.jobs.*.tasks[*].webhook_notifications.on_duration_warning_threshold_exceeded[*]": {"id"}, - "resources.jobs.*.tasks[*].webhook_notifications.on_failure[*]": {"id"}, - "resources.jobs.*.tasks[*].webhook_notifications.on_maintenance_complete[*]": {"id"}, - "resources.jobs.*.tasks[*].webhook_notifications.on_maintenance_start[*]": {"id"}, - "resources.jobs.*.tasks[*].webhook_notifications.on_start[*]": {"id"}, - "resources.jobs.*.tasks[*].webhook_notifications.on_streaming_backlog_exceeded[*]": {"id"}, - "resources.jobs.*.tasks[*].webhook_notifications.on_success[*]": {"id"}, - "resources.jobs.*.trigger.file_arrival": {"url"}, - "resources.jobs.*.trigger.model": {"condition"}, - "resources.jobs.*.trigger.periodic": {"interval", "unit"}, - "resources.jobs.*.trigger.sql_condition": {"sql_query_id", "warehouse_id"}, - "resources.jobs.*.trigger.table_update": {"table_names"}, - "resources.jobs.*.triggers[*].continuous.maintenance_window": {"day_of_week", "start_hour", "timezone_id"}, - "resources.jobs.*.triggers[*].file_arrival": {"url"}, - "resources.jobs.*.triggers[*].model": {"condition"}, - "resources.jobs.*.triggers[*].periodic": {"interval", "unit"}, - "resources.jobs.*.triggers[*].schedule": {"quartz_cron_expression", "timezone_id"}, - "resources.jobs.*.triggers[*].sql_condition": {"sql_query_id", "warehouse_id"}, - "resources.jobs.*.triggers[*].table_update": {"table_names"}, - "resources.jobs.*.webhook_notifications.on_duration_warning_threshold_exceeded[*]": {"id"}, - "resources.jobs.*.webhook_notifications.on_failure[*]": {"id"}, - "resources.jobs.*.webhook_notifications.on_maintenance_complete[*]": {"id"}, - "resources.jobs.*.webhook_notifications.on_maintenance_start[*]": {"id"}, - "resources.jobs.*.webhook_notifications.on_start[*]": {"id"}, - "resources.jobs.*.webhook_notifications.on_streaming_backlog_exceeded[*]": {"id"}, - "resources.jobs.*.webhook_notifications.on_success[*]": {"id"}, - - "resources.mcp_services.*": {"parent", "mcp_service_id"}, - "resources.mcp_services.*.config.rate_limits[*]": {"key", "renewal_period"}, - "resources.mcp_services.*.config.source_connection": {"name"}, - - "resources.model_provider_services.*": {"parent", "model_provider_service_id"}, - "resources.model_provider_services.*.config.amazon_bedrock.direct.aws_access_key.secret_access_key.secret_reference": {"name"}, - "resources.model_provider_services.*.config.amazon_bedrock.direct.service_credential": {"name"}, - "resources.model_provider_services.*.config.anthropic.direct.api_key.secret_reference": {"name"}, - "resources.model_provider_services.*.config.azure_openai.direct.api_key.secret_reference": {"name"}, - "resources.model_provider_services.*.config.azure_openai.direct.entra_service_principal.client_secret.secret_reference": {"name"}, - "resources.model_provider_services.*.config.azure_openai.direct.service_credential": {"name"}, - "resources.model_provider_services.*.config.bedrock_mantle.direct.aws_access_key.secret_access_key.secret_reference": {"name"}, - "resources.model_provider_services.*.config.bedrock_mantle.direct.service_credential": {"name"}, - "resources.model_provider_services.*.config.custom.direct.api_key.secret_reference": {"name"}, - "resources.model_provider_services.*.config.custom.direct.header_auth.api_key_value.secret_reference": {"name"}, - "resources.model_provider_services.*.config.gemini_enterprise.direct.api_key.secret_reference": {"name"}, - "resources.model_provider_services.*.config.gemini_enterprise.direct.service_credential": {"name"}, - "resources.model_provider_services.*.config.inference_table": {"parent"}, - "resources.model_provider_services.*.config.microsoft_foundry.direct.api_key.secret_reference": {"name"}, - "resources.model_provider_services.*.config.microsoft_foundry.direct.entra_service_principal.client_secret.secret_reference": {"name"}, - "resources.model_provider_services.*.config.microsoft_foundry.direct.service_credential": {"name"}, - "resources.model_provider_services.*.config.openai.direct.api_key.secret_reference": {"name"}, - "resources.model_provider_services.*.config.rate_limits[*]": {"key", "renewal_period"}, - "resources.model_provider_services.*.config.targets[*]": {"model"}, - - "resources.model_services.*": {"parent", "model_service_id"}, - "resources.model_services.*.config.inference_table": {"parent"}, - "resources.model_services.*.config.rate_limits[*]": {"key", "renewal_period"}, - "resources.model_services.*.config.routing.destinations[*]": {"destination_type", "name"}, - "resources.model_services.*.config.routing.destinations[*].external_model_config": {"model_provider_service", "target"}, - "resources.model_services.*.config.routing.destinations[*].external_model_config.target": {"model"}, - "resources.model_services.*.config.routing.destinations[*].pay_per_token_config": {"model"}, - "resources.model_services.*.config.routing.destinations[*].provisioned_throughput_config": {"model_serving_endpoint"}, - "resources.model_services.*.config.routing.fallback.destinations[*]": {"destination_type", "name"}, - "resources.model_services.*.config.routing.fallback.destinations[*].external_model_config": {"model_provider_service", "target"}, - "resources.model_services.*.config.routing.fallback.destinations[*].external_model_config.target": {"model"}, - "resources.model_services.*.config.routing.fallback.destinations[*].pay_per_token_config": {"model"}, - "resources.model_services.*.config.routing.fallback.destinations[*].provisioned_throughput_config": {"model_serving_endpoint"}, - - "resources.model_serving_endpoints.*": {"name"}, - "resources.model_serving_endpoints.*.ai_gateway.fallback_config": {"enabled"}, - "resources.model_serving_endpoints.*.ai_gateway.rate_limits[*]": {"renewal_period"}, - "resources.model_serving_endpoints.*.config.served_entities[*].external_model": {"name", "provider", "task"}, - "resources.model_serving_endpoints.*.config.served_entities[*].external_model.amazon_bedrock_config": {"aws_region", "bedrock_provider"}, - "resources.model_serving_endpoints.*.config.served_entities[*].external_model.custom_provider_config": {"custom_provider_url"}, - "resources.model_serving_endpoints.*.config.served_entities[*].external_model.custom_provider_config.api_key_auth": {"key"}, - "resources.model_serving_endpoints.*.config.served_entities[*].external_model.databricks_model_serving_config": {"databricks_workspace_url"}, - "resources.model_serving_endpoints.*.config.served_entities[*].external_model.google_cloud_vertex_ai_config": {"project_id", "region"}, - "resources.model_serving_endpoints.*.config.served_models[*]": {"model_name", "model_version", "scale_to_zero_enabled"}, - "resources.model_serving_endpoints.*.config.traffic_config.routes[*]": {"traffic_percentage"}, - "resources.model_serving_endpoints.*.permissions[*]": {"level"}, - "resources.model_serving_endpoints.*.rate_limits[*]": {"calls", "renewal_period"}, - "resources.model_serving_endpoints.*.tags[*]": {"key"}, - - "resources.models.*": {"name"}, - "resources.models.*.permissions[*]": {"level"}, - - "resources.pipelines.*.clusters[*].autoscale": {"max_workers", "min_workers"}, - "resources.pipelines.*.clusters[*].cluster_log_conf.dbfs": {"destination"}, - "resources.pipelines.*.clusters[*].cluster_log_conf.s3": {"destination"}, - "resources.pipelines.*.clusters[*].cluster_log_conf.volumes": {"destination"}, - "resources.pipelines.*.clusters[*].init_scripts[*].abfss": {"destination"}, - "resources.pipelines.*.clusters[*].init_scripts[*].dbfs": {"destination"}, - "resources.pipelines.*.clusters[*].init_scripts[*].file": {"destination"}, - "resources.pipelines.*.clusters[*].init_scripts[*].gcs": {"destination"}, - "resources.pipelines.*.clusters[*].init_scripts[*].s3": {"destination"}, - "resources.pipelines.*.clusters[*].init_scripts[*].volumes": {"destination"}, - "resources.pipelines.*.clusters[*].init_scripts[*].workspace": {"destination"}, - "resources.pipelines.*.deployment": {"kind"}, - "resources.pipelines.*.gateway_definition": {"connection_name", "gateway_storage_catalog", "gateway_storage_schema"}, - "resources.pipelines.*.ingestion_definition.data_staging_options": {"catalog_name", "schema_name"}, - "resources.pipelines.*.ingestion_definition.full_refresh_window": {"start_hour"}, - "resources.pipelines.*.ingestion_definition.objects[*].report": {"destination_catalog", "destination_schema", "source_url"}, - "resources.pipelines.*.ingestion_definition.objects[*].report.table_configuration.auto_full_refresh_policy": {"enabled"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema": {"destination_catalog", "destination_schema"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.google_ads_options": {"manager_account_id"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.google_ads_options.custom_report_options": {"resource"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.linkedin_ads_options.custom_report_options": {"finder"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.connector_options.rabbitmq_options": {"queue"}, - "resources.pipelines.*.ingestion_definition.objects[*].schema.table_configuration.auto_full_refresh_policy": {"enabled"}, - "resources.pipelines.*.ingestion_definition.objects[*].table": {"destination_catalog", "destination_schema"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.google_ads_options": {"manager_account_id"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.google_ads_options.custom_report_options": {"resource"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.linkedin_ads_options.custom_report_options": {"finder"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.connector_options.rabbitmq_options": {"queue"}, - "resources.pipelines.*.ingestion_definition.objects[*].table.table_configuration.auto_full_refresh_policy": {"enabled"}, - "resources.pipelines.*.ingestion_definition.table_configuration.auto_full_refresh_policy": {"enabled"}, - "resources.pipelines.*.libraries[*].maven": {"coordinates"}, - "resources.pipelines.*.permissions[*]": {"level"}, - "resources.pipelines.*.restart_window": {"start_hour"}, - - "resources.postgres_branches.*": {"branch_id", "parent"}, - - "resources.postgres_catalogs.*": {"postgres_database", "catalog_id"}, - - "resources.postgres_databases.*": {"role", "database_id", "parent"}, - - "resources.postgres_endpoints.*": {"endpoint_type", "endpoint_id", "parent"}, - "resources.postgres_endpoints.*.group": {"max", "min"}, - - "resources.postgres_projects.*": {"project_id"}, - "resources.postgres_projects.*.permissions[*]": {"level"}, - - "resources.postgres_roles.*": {"role_id", "parent"}, - - "resources.postgres_snapshot_schedules.*": {"branch"}, - "resources.postgres_snapshot_schedules.*.schedule[*]": {"retention"}, - "resources.postgres_snapshot_schedules.*.schedule[*].monthly_schedule": {"day"}, - "resources.postgres_snapshot_schedules.*.schedule[*].weekly_schedule": {"day_of_week"}, - - "resources.postgres_synced_tables.*": {"synced_table_id"}, - "resources.postgres_synced_tables.*.extra_columns[*]": {"column_name", "column_type"}, - "resources.postgres_synced_tables.*.type_overrides[*]": {"column_name", "pg_type"}, - - "resources.quality_monitors.*": {"assets_dir", "output_schema_name", "table_name"}, - "resources.quality_monitors.*.custom_metrics[*]": {"definition", "input_columns", "name", "output_data_type", "type"}, - "resources.quality_monitors.*.inference_log": {"granularities", "model_id_col", "prediction_col", "problem_type", "timestamp_col"}, - "resources.quality_monitors.*.schedule": {"quartz_cron_expression", "timezone_id"}, - "resources.quality_monitors.*.time_series": {"granularities", "timestamp_col"}, - - "resources.schemas.*": {"catalog_name", "name"}, - - "resources.secret_scopes.*": {"name"}, - "resources.secret_scopes.*.keyvault_metadata": {"dns_name", "resource_id"}, - "resources.secret_scopes.*.permissions[*]": {"level"}, - - "resources.secrets.*": {"catalog_name", "name", "schema_name", "value"}, - - "resources.sql_warehouses.*.permissions[*]": {"level"}, - - "resources.synced_database_tables.*": {"name"}, - "resources.synced_database_tables.*.spec.type_overrides[*]": {"column_name", "pg_type"}, - - "resources.vector_search_endpoints.*": {"endpoint_type", "name"}, - "resources.vector_search_endpoints.*.permissions[*]": {"level"}, - - "resources.vector_search_indexes.*": {"endpoint_name", "index_type", "name", "primary_key"}, - - "resources.volumes.*": {"catalog_name", "name", "schema_name", "volume_type"}, - - "scripts.*": {"content"}, -} diff --git a/bundle/internal/validation/main.go b/bundle/internal/validation/main.go index ce07aede5da..bd35dfcd06d 100644 --- a/bundle/internal/validation/main.go +++ b/bundle/internal/validation/main.go @@ -4,15 +4,11 @@ import ( "log" ) -// This package is meant to be run from the root of the CLI repo. +// This package is meant to be run from the root of the CLI repo. It generates the +// typed walkers of the required and enum field validators. func main() { - err := generateRequiredFields("bundle/internal/validation/generated") + err := generateWalkers("bundle/config/validate") if err != nil { - log.Fatalf("Error generating required fields: %v", err) - } - - err = generateEnumFields("bundle/internal/validation/generated") - if err != nil { - log.Fatalf("Error generating enum fields: %v", err) + log.Fatalf("Error generating walkers: %v", err) } } diff --git a/bundle/internal/validation/required.go b/bundle/internal/validation/required.go index 045ac32257a..f8ed375224c 100644 --- a/bundle/internal/validation/required.go +++ b/bundle/internal/validation/required.go @@ -1,52 +1,16 @@ package main import ( - "bytes" - "cmp" - "fmt" - "go/format" - "maps" - "os" - "path/filepath" "reflect" - "slices" - "strings" - "text/template" - "github.com/databricks/cli/bundle/config" "github.com/databricks/cli/libs/structs/structpath" "github.com/databricks/cli/libs/structs/structtag" "github.com/databricks/cli/libs/structs/structwalk" ) -type RequiredPatternInfo struct { - // The pattern for which the fields in Required are applicable. - // This is a string representation of [dyn.Pattern]. - Parent string - - // List of required fields that should be set for every path in the - // config tree that matches the pattern. This field will be a string of the - // form `{field1, field2, ...}`. - RequiredFields string -} - -// formatSliceToString formats a list of values into string of the form `{value1, value2, ...}` -// representing a Go slice literal. -func formatSliceToString(values []string) string { - if len(values) == 0 { - return "{}" - } - - var quoted []string - for _, value := range values { - quoted = append(quoted, fmt.Sprintf("%q", value)) - } - - return "{" + strings.Join(quoted, ", ") + "}" -} - -// extractRequiredFields walks through a struct type and extracts required field patterns -func extractRequiredFields(typ reflect.Type) ([]RequiredPatternInfo, error) { +// extractRequiredFields walks through a struct type and returns the required fields +// (JSON names, in declaration order) by the pattern of their parent. +func extractRequiredFields(typ reflect.Type) (map[string][]string, error) { fieldsByPattern := make(map[string][]string) err := structwalk.WalkType(typ, func(path *structpath.PatternNode, _ reflect.Type, field *reflect.StructField) bool { @@ -83,142 +47,5 @@ func extractRequiredFields(typ reflect.Type) ([]RequiredPatternInfo, error) { return true }) - return buildPatternInfos(fieldsByPattern), err -} - -// buildPatternInfos converts the field map to PatternInfo slice -func buildPatternInfos(fieldsByPattern map[string][]string) []RequiredPatternInfo { - patterns := make([]RequiredPatternInfo, 0, len(fieldsByPattern)) - - for parentPath, fields := range fieldsByPattern { - patterns = append(patterns, RequiredPatternInfo{ - Parent: parentPath, - RequiredFields: formatSliceToString(fields), - }) - } - - return patterns -} - -// getGroupingKey determines the grouping key for organizing patterns -func getGroupingKey(pattern string) string { - parts := strings.Split(pattern, ".") - - // Group resources by their resource type (e.g., "resources.jobs") - if parts[0] == "resources" && len(parts) > 1 { - return parts[0] + "." + parts[1] - } - - // Use the top level key for other fields - return parts[0] -} - -// groupPatternsByKey groups patterns by their logical grouping key -func groupPatternsByKey(patterns []RequiredPatternInfo) map[string][]RequiredPatternInfo { - groupedPatterns := make(map[string][]RequiredPatternInfo) - - for _, pattern := range patterns { - key := getGroupingKey(pattern.Parent) - groupedPatterns[key] = append(groupedPatterns[key], pattern) - } - - return groupedPatterns -} - -func filterTargetsAndEnvironments(patterns map[string][]RequiredPatternInfo) map[string][]RequiredPatternInfo { - filtered := make(map[string][]RequiredPatternInfo) - for key, patterns := range patterns { - if key == "targets" || key == "environments" { - continue - } - filtered[key] = patterns - } - return filtered -} - -// sortGroupedPatterns sorts patterns within each group and returns them as a sorted slice -func sortGroupedPatterns(groupedPatterns map[string][]RequiredPatternInfo) [][]RequiredPatternInfo { - // Get sorted group keys - groupKeys := slices.Sorted(maps.Keys(groupedPatterns)) - - // Build sorted result - result := make([][]RequiredPatternInfo, 0, len(groupKeys)) - for _, key := range groupKeys { - patterns := groupedPatterns[key] - - // Sort patterns within each group by parent path - slices.SortFunc(patterns, func(a, b RequiredPatternInfo) int { - return cmp.Compare(a.Parent, b.Parent) - }) - - result = append(result, patterns) - } - - return result -} - -// RequiredFields returns grouped required field patterns for validation -func requiredFields() ([][]RequiredPatternInfo, error) { - patterns, err := extractRequiredFields(reflect.TypeFor[config.Root]()) - if err != nil { - return nil, err - } - groupedPatterns := groupPatternsByKey(patterns) - filteredPatterns := filterTargetsAndEnvironments(groupedPatterns) - return sortGroupedPatterns(filteredPatterns), nil -} - -// Generate creates a Go source file with required field validation rules -func generateRequiredFields(outPath string) error { - requiredFields, err := requiredFields() - if err != nil { - return fmt.Errorf("failed to generate required fields: %w", err) - } - - // Ensure output directory exists - if err := os.MkdirAll(outPath, 0o755); err != nil { - return fmt.Errorf("failed to create output directory: %w", err) - } - - // Parse and execute template - tmpl, err := template.New("validation").Parse(validationTemplate) - if err != nil { - return fmt.Errorf("failed to parse template: %w", err) - } - - var generatedCode bytes.Buffer - if err := tmpl.Execute(&generatedCode, requiredFields); err != nil { - return fmt.Errorf("failed to execute template: %w", err) - } - - // Format the generated source with gofmt-equivalent rules so minor template - // whitespace changes don't create noisy diffs in the checked-in artifacts. - formatted, err := format.Source(generatedCode.Bytes()) - if err != nil { - return fmt.Errorf("failed to format generated code: %w", err) - } - - // Write generated code to file - filePath := filepath.Join(outPath, "required_fields.go") - if err := os.WriteFile(filePath, formatted, 0o644); err != nil { - return fmt.Errorf("failed to write generated code: %w", err) - } - - return nil -} - -// validationTemplate is the Go text template for generating the validation map -const validationTemplate = `package generated - -// THIS FILE IS AUTOGENERATED. -// DO NOT EDIT THIS FILE DIRECTLY. - -// RequiredFields maps [dyn.Pattern] to required fields they should have. -var RequiredFields = map[string][]string{ -{{- range . }} -{{- range . }} - "{{ .Parent }}": {{ .RequiredFields }}, -{{- end }} -{{ end -}} + return fieldsByPattern, err } -` diff --git a/bundle/internal/validation/walker.go b/bundle/internal/validation/walker.go new file mode 100644 index 00000000000..a97198d291a --- /dev/null +++ b/bundle/internal/validation/walker.go @@ -0,0 +1,489 @@ +package main + +import ( + "bytes" + "cmp" + "fmt" + "go/format" + "os" + "path" + "reflect" + "slices" + "strconv" + "strings" + + "github.com/databricks/cli/bundle/config" + "github.com/databricks/cli/libs/structs/structpath" + "github.com/databricks/cli/libs/structs/structtag" +) + +// The walkers generated here replace matching every node of the configuration against +// the required and enum field patterns: they descend only along the patterns' paths +// of the typed configuration, with plain field access, and check the fields of each +// node on the way. +// +// The typed configuration cannot tell an unset field from one set to its zero value, +// null or a pure variable reference, and it has no locations. The generated code +// asks the node (bundle/config/validate/walk_node.go) for those. + +// tnode is a node of the tree of pattern paths, rooted at config.Root. +type tnode struct { + typ reflect.Type // the declared type of the value at this node + required []string // required fields (JSON names) of the struct at this node + enum []string // valid values if the value at this node is an enum + children map[string]*tnode + sig string +} + +func newTnode(typ reflect.Type) *tnode { + return &tnode{typ: typ, children: map[string]*tnode{}} +} + +// insert adds the path of pattern p to the tree and returns its node. +func (t *tnode) insert(p string) (*tnode, error) { + pattern, err := structpath.ParsePattern(p) + if err != nil { + return nil, err + } + n := t + for _, c := range pattern.AsSlice() { + var key string + var next reflect.Type + elem := deref(n.typ) + switch { + case c.DotStar(): + if elem.Kind() != reflect.Map { + return nil, fmt.Errorf("%s: .* on %s", p, elem) + } + key = "*" + next = elem.Elem() + case c.BracketStar(): + if elem.Kind() != reflect.Slice { + return nil, fmt.Errorf("%s: [*] on %s", p, elem) + } + key = "[*]" + next = elem.Elem() + default: + k, ok := c.StringKey() + if !ok || elem.Kind() != reflect.Struct { + return nil, fmt.Errorf("%s: unsupported component %s on %s", p, c, elem) + } + index, ok := fieldIndex(elem, k) + if !ok { + return nil, fmt.Errorf("%s: no field %q in %s", p, k, elem) + } + key = k + next = elem.FieldByIndex(index).Type + } + child, ok := n.children[key] + if !ok { + child = newTnode(next) + n.children[key] = child + } + n = child + } + return n, nil +} + +// fieldIndex returns the index path of the field with JSON name key in struct st, as +// [convert.ToTyped] resolves it: fields of embedded structs are promoted, and a field +// of an outer struct takes precedence. +func fieldIndex(st reflect.Type, key string) ([]int, bool) { + queue := [][]int{{}} + for i := 0; i < len(queue); i++ { + prefix := queue[i] + typ := st + if len(prefix) > 0 { + typ = deref(st.FieldByIndex(prefix).Type) + } + for j := range typ.NumField() { + sf := typ.Field(j) + index := append(slices.Clone(prefix), j) + if sf.Anonymous { + queue = append(queue, index) + continue + } + if !sf.IsExported() { + continue + } + if structtag.JSONTag(sf.Tag.Get("json")).Name() == key { + return index, true + } + } + } + return nil, false +} + +func deref(t reflect.Type) reflect.Type { + for t.Kind() == reflect.Pointer { + t = t.Elem() + } + return t +} + +// signature identifies the code generated for the subtree, so equal subtrees share it. +func (t *tnode) signature() string { + if t.sig != "" { + return t.sig + } + var b strings.Builder + fmt.Fprintf(&b, "%s|r=%v|e=%v|", t.typ, t.required, t.enum) + for _, k := range sortedKeys(t.children) { + fmt.Fprintf(&b, "%s{%s}", k, t.children[k].signature()) + } + t.sig = b.String() + return t.sig +} + +func sortedKeys[V any](m map[string]V) []string { + keys := make([]string, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + slices.Sort(keys) + return keys +} + +// gen generates the walker for one tree. +type gen struct { + prefix string // function name prefix, e.g. "required" + imports map[string]string + aliases map[string]bool + funcs map[string]string // signature -> function name + names map[string]int + enums map[string]string // joined values -> variable name + out bytes.Buffer + pending []*tnode +} + +func newGen(prefix string) *gen { + return &gen{ + prefix: prefix, + imports: map[string]string{}, + aliases: map[string]bool{"slices": true, "dyn": true}, + funcs: map[string]string{}, + names: map[string]int{}, + enums: map[string]string{}, + } +} + +// typeName returns the Go name of the named type t, importing its package. +func (g *gen) typeName(t reflect.Type) string { + if t.PkgPath() == "" { + return t.String() + } + alias, ok := g.imports[t.PkgPath()] + if !ok { + alias = path.Base(t.PkgPath()) + for i := 2; g.aliases[alias]; i++ { + alias = path.Base(t.PkgPath()) + strconv.Itoa(i) + } + g.aliases[alias] = true + g.imports[t.PkgPath()] = alias + } + return alias + "." + t.Name() +} + +// funcFor returns the name of the function walking struct node t. +func (g *gen) funcFor(t *tnode) string { + sig := t.signature() + if name, ok := g.funcs[sig]; ok { + return name + } + st := deref(t.typ) + base := g.prefix + capitalize(path.Base(st.PkgPath())) + st.Name() + g.names[base]++ + name := base + if g.names[base] > 1 { + name = base + strconv.Itoa(g.names[base]) + } + g.funcs[sig] = name + g.pending = append(g.pending, t) + return name +} + +func capitalize(s string) string { + if s == "" { + return s + } + return strings.ToUpper(s[:1]) + s[1:] +} + +func (g *gen) enumVar(values []string) string { + key := strings.Join(values, "\x00") + if name, ok := g.enums[key]; ok { + return name + } + name := fmt.Sprintf("%sValues%d", g.prefix, len(g.enums)) + g.enums[key] = name + return name +} + +// field is the field with JSON name key of the struct v points to. +type field struct { + key string + typ reflect.Type + expr string // selector of the field + guards []string // nil checks of the embedded pointers on the way +} + +func structField(st reflect.Type, key string) (field, bool) { + index, ok := fieldIndex(st, key) + if !ok { + return field{}, false + } + f := field{key: key, expr: "v"} + t := st + for i, x := range index { + sf := deref(t).Field(x) + f.expr += "." + sf.Name + if i < len(index)-1 && sf.Type.Kind() == reflect.Pointer { + f.guards = append(f.guards, f.expr+" != nil") + } + t = sf.Type + } + f.typ = t + return f, true +} + +func (f field) guarded(cond string) string { + if len(f.guards) == 0 { + return cond + } + return strings.Join(f.guards, " && ") + " && " + cond +} + +// typedSet returns the condition under which the typed value shows the field is set, +// or "" if it cannot (a struct is never nil). A field that is not set by this +// condition can still be set to its zero value, so the node is asked. +func (f field) typedSet() string { + switch f.typ.Kind() { + case reflect.String: + return f.guarded(f.expr + ` != ""`) + case reflect.Pointer, reflect.Slice, reflect.Map, reflect.Interface: + return f.guarded(f.expr + " != nil") + case reflect.Bool: + return f.guarded(f.expr) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, + reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, + reflect.Float32, reflect.Float64: + return f.guarded(f.expr + " != 0") + default: + return "" + } +} + +// emitStruct writes the function walking struct node t. +func (g *gen) emitStruct(t *tnode) error { + st := deref(t.typ) + if st.Kind() != reflect.Struct { + return fmt.Errorf("%s is not a struct", st) + } + name := g.typeName(st) + fmt.Fprintf(&g.out, "\nfunc %s(w *walker, n *node, v *%s) {\n", g.funcFor(t), name) + // The value is null or a pure variable reference. + fmt.Fprintf(&g.out, "\tif v == nil {\n\t\tv = &%s{}\n\t}\n", name) + for _, k := range t.required { + cond := "" + if f, ok := structField(st, k); ok { + cond = f.typedSet() + } + if cond == "" { + fmt.Fprintf(&g.out, "\tif !n.has(%q) {\n\t\tw.missing(n, %q)\n\t}\n", k, k) + } else { + fmt.Fprintf(&g.out, "\tif !(%s) && !n.has(%q) {\n\t\tw.missing(n, %q)\n\t}\n", cond, k, k) + } + } + for _, k := range sortedKeys(t.children) { + f, ok := structField(st, k) + if !ok { + return fmt.Errorf("no field %q in %s", k, st) + } + if err := g.emitField(f, t.children[k]); err != nil { + return err + } + } + fmt.Fprintf(&g.out, "}\n") + return nil +} + +// emitField writes the code visiting the field f of the struct v (node n). +func (g *gen) emitField(f field, child *tnode) error { + if len(f.guards) > 0 { + fmt.Fprintf(&g.out, "\tif %s {\n", strings.Join(f.guards, " && ")) + } + switch { + case child.enum != nil: + if f.typ.Kind() != reflect.String { + return fmt.Errorf("enum field %q of type %s", f.key, f.typ) + } + fmt.Fprintf(&g.out, "\tw.enumField(n, %q, string(%s), %s)\n", f.key, f.expr, g.enumVar(child.enum)) + case f.typ.Kind() == reflect.Pointer: + fmt.Fprintf(&g.out, "\tif c := n.child(%q); c.exists() {\n\t\t%s(w, &c, %s)\n\t}\n", f.key, g.funcFor(child), f.expr) + case f.typ.Kind() == reflect.Struct: + fmt.Fprintf(&g.out, "\tif c := n.child(%q); c.exists() {\n\t\t%s(w, &c, &%s)\n\t}\n", f.key, g.funcFor(child), f.expr) + case f.typ.Kind() == reflect.Slice || f.typ.Kind() == reflect.Map: + fmt.Fprintf(&g.out, "\tif len(%s) > 0 {\n\t\tc := n.child(%q)\n", f.expr, f.key) + if err := g.emitContainer("\t\t", f.expr, f.typ, child, 0); err != nil { + return err + } + fmt.Fprintf(&g.out, "\t}\n") + default: + return fmt.Errorf("unsupported field %q of type %s", f.key, f.typ) + } + if len(f.guards) > 0 { + fmt.Fprintf(&g.out, "\t}\n") + } + return nil +} + +// emitContainer writes the loop over the slice or map expr (node c) and its elements. +func (g *gen) emitContainer(indent, expr string, typ reflect.Type, t *tnode, depth int) error { + if len(t.children) != 1 { + return fmt.Errorf("container %s needs exactly one wildcard child", typ) + } + var elem *tnode + for _, c := range t.children { + elem = c + } + if typ.Kind() == reflect.Slice { + i := fmt.Sprintf("i%d", depth) + fmt.Fprintf(&g.out, "%sfor %s := range %s {\n%s\te := c.elem(%s)\n", indent, i, expr, indent, i) + if err := g.emitElem(indent+"\t", expr+"["+i+"]", typ.Elem(), elem, depth); err != nil { + return err + } + } else { + k, x := fmt.Sprintf("k%d", depth), fmt.Sprintf("x%d", depth) + key := k + if typ.Key() != reflect.TypeFor[string]() { + key = "string(" + k + ")" + } + fmt.Fprintf(&g.out, "%sfor %s, %s := range %s {\n%s\te := c.child(%s)\n", indent, k, x, expr, indent, key) + if err := g.emitElem(indent+"\t", x, typ.Elem(), elem, depth); err != nil { + return err + } + } + fmt.Fprintf(&g.out, "%s}\n", indent) + return nil +} + +// emitElem writes the code visiting the element expr (node e) of type typ. +func (g *gen) emitElem(indent, expr string, typ reflect.Type, t *tnode, depth int) error { + switch { + case t.enum != nil: + if typ.Kind() != reflect.String { + return fmt.Errorf("enum element of type %s", typ) + } + fmt.Fprintf(&g.out, "%sw.enumElem(&e, string(%s), %s)\n", indent, expr, g.enumVar(t.enum)) + case typ.Kind() == reflect.Pointer: + fmt.Fprintf(&g.out, "%s%s(w, &e, %s)\n", indent, g.funcFor(t), expr) + case typ.Kind() == reflect.Struct: + fmt.Fprintf(&g.out, "%s%s(w, &e, &%s)\n", indent, g.funcFor(t), expr) + case typ.Kind() == reflect.Slice || typ.Kind() == reflect.Map: + fmt.Fprintf(&g.out, "%s{\n%s\tc := e\n", indent, indent) + if err := g.emitContainer(indent+"\t", expr, typ, t, depth+1); err != nil { + return err + } + fmt.Fprintf(&g.out, "%s}\n", indent) + default: + return fmt.Errorf("unsupported element type %s", typ) + } + return nil +} + +// generateWalker writes the walker of the required fields (by parent pattern) and the +// enum values (by field pattern) to file. The entry point is ConfigRoot. +func generateWalker(file, prefix, doc string, required, enums map[string][]string) error { + root := newTnode(reflect.TypeFor[config.Root]()) + for _, p := range sortedKeys(required) { + n, err := root.insert(p) + if err != nil { + return err + } + n.required = required[p] + } + for _, p := range sortedKeys(enums) { + n, err := root.insert(p) + if err != nil { + return err + } + n.enum = enums[p] + } + + g := newGen(prefix) + g.funcFor(root) + for len(g.pending) > 0 { + t := g.pending[0] + g.pending = g.pending[1:] + if err := g.emitStruct(t); err != nil { + return err + } + } + + var src bytes.Buffer + fmt.Fprintf(&src, "// Code generated by bundle/internal/validation. DO NOT EDIT.\n\n// %s\n\npackage validate\n\nimport (\n", doc) + paths := make([]string, 0, len(g.imports)) + for p := range g.imports { + paths = append(paths, p) + } + slices.Sort(paths) + for _, p := range paths { + if path.Base(p) == g.imports[p] { + fmt.Fprintf(&src, "\t%q\n", p) + } else { + fmt.Fprintf(&src, "\t%s %q\n", g.imports[p], p) + } + } + fmt.Fprintf(&src, ")\n") + keys := make([]string, 0, len(g.enums)) + for k := range g.enums { + keys = append(keys, k) + } + slices.SortFunc(keys, func(a, b string) int { + return cmp.Or(cmp.Compare(len(g.enums[a]), len(g.enums[b])), cmp.Compare(g.enums[a], g.enums[b])) + }) + for _, k := range keys { + var quoted []string + for value := range strings.SplitSeq(k, "\x00") { + quoted = append(quoted, strconv.Quote(value)) + } + fmt.Fprintf(&src, "\nvar %s = []string{%s}\n", g.enums[k], strings.Join(quoted, ", ")) + } + src.Write(g.out.Bytes()) + + formatted, err := format.Source(src.Bytes()) + if err != nil { + return fmt.Errorf("failed to format %s: %w", file, err) + } + return os.WriteFile(file, formatted, 0o644) +} + +// withoutTargets drops the patterns under targets and environments: they are merged +// into the root before validation. +func withoutTargets(patterns map[string][]string) map[string][]string { + out := map[string][]string{} + for p, v := range patterns { + top, _, _ := strings.Cut(p, ".") + if top == "targets" || top == "environments" { + continue + } + out[p] = v + } + return out +} + +func generateWalkers(dir string) error { + required, err := extractRequiredFields(reflect.TypeFor[config.Root]()) + if err != nil { + return fmt.Errorf("failed to extract required fields: %w", err) + } + enums, err := extractEnumFields(reflect.TypeFor[config.Root]()) + if err != nil { + return fmt.Errorf("failed to extract enum fields: %w", err) + } + err = generateWalker(dir+"/required_walk.go", "required", "requiredConfigRoot reports the required fields that are not set.", withoutTargets(required), nil) + if err != nil { + return err + } + return generateWalker(dir+"/enum_walk.go", "enum", "enumConfigRoot reports the enum fields with invalid values.", nil, withoutTargets(enums)) +} From e5b9aa2c936d540a039dcb6f50a670c025ffd44e Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Wed, 21 Oct 2026 15:48:57 +0200 Subject: [PATCH 2/5] Name the generated enum value variables after the enum type Co-authored-by: Isaac --- bundle/config/validate/enum_walk.go | 604 ++++++++++++++------------- bundle/internal/validation/walker.go | 60 ++- 2 files changed, 355 insertions(+), 309 deletions(-) diff --git a/bundle/config/validate/enum_walk.go b/bundle/config/validate/enum_walk.go index fbcba206aa4..9951960a6bf 100644 --- a/bundle/config/validate/enum_walk.go +++ b/bundle/config/validate/enum_walk.go @@ -21,255 +21,283 @@ import ( "github.com/databricks/databricks-sdk-go/service/vectorsearch" ) -var enumValues0 = []string{"bash", "sh", "cmd"} +var enumValuesAppsAppDeploymentMode = []string{"AUTO_SYNC", "SNAPSHOT"} -var enumValues1 = []string{"whl", "jar", "tgz"} +var enumValuesAppsAppDeploymentState = []string{"CANCELLED", "FAILED", "IN_PROGRESS", "SUCCEEDED"} -var enumValues2 = []string{"CAN_ATTACH_TO", "CAN_BIND", "CAN_CREATE", "CAN_CREATE_APP", "CAN_EDIT", "CAN_EDIT_METADATA", "CAN_MANAGE", "CAN_MANAGE_PRODUCTION_VERSIONS", "CAN_MANAGE_RUN", "CAN_MANAGE_STAGING_VERSIONS", "CAN_MONITOR", "CAN_MONITOR_ONLY", "CAN_QUERY", "CAN_READ", "CAN_RESTART", "CAN_RUN", "CAN_USE", "CAN_VIEW", "CAN_VIEW_METADATA", "IS_OWNER"} +var enumValuesAppsAppPermissionLevel = []string{"CAN_MANAGE", "CAN_USE"} -var enumValues3 = []string{"complex"} +var enumValuesAppsAppResourceAppAppPermission = []string{"CAN_USE"} -var enumValues4 = []string{"HTML", "MARKDOWN"} +var enumValuesAppsAppResourceDatabaseDatabasePermission = []string{"CAN_CONNECT_AND_CREATE"} -var enumValues5 = []string{"ACTIVE", "DELETED"} +var enumValuesAppsAppResourceExperimentExperimentPermission = []string{"CAN_EDIT", "CAN_MANAGE", "CAN_READ"} -var enumValues6 = []string{"LARGE", "MEDIUM", "XLARGE"} +var enumValuesAppsAppResourceGenieSpaceGenieSpacePermission = []string{"CAN_EDIT", "CAN_MANAGE", "CAN_RUN", "CAN_VIEW"} -var enumValues7 = []string{"DATA_SECURITY_MODE_AUTO", "DATA_SECURITY_MODE_DEDICATED", "DATA_SECURITY_MODE_STANDARD", "LEGACY_PASSTHROUGH", "LEGACY_SINGLE_USER", "LEGACY_SINGLE_USER_STANDARD", "LEGACY_TABLE_ACL", "NONE", "SINGLE_USER", "USER_ISOLATION"} +var enumValuesAppsAppResourceJobJobPermission = []string{"CAN_MANAGE", "CAN_MANAGE_RUN", "CAN_VIEW", "IS_OWNER"} -var enumValues8 = []string{"DEPENDENCY_MODE_AUTO", "DEPENDENCY_MODE_CLUSTER_LIBRARIES", "DEPENDENCY_MODE_ENVIRONMENTS"} +var enumValuesAppsAppResourcePostgresPostgresPermission = []string{"CAN_CONNECT_AND_CREATE"} -var enumValues9 = []string{"CLASSIC_PREVIEW"} +var enumValuesAppsAppResourceSecretSecretPermission = []string{"MANAGE", "READ", "WRITE"} -var enumValues10 = []string{"NULL", "PHOTON", "STANDARD"} +var enumValuesAppsAppResourceServingEndpointServingEndpointPermission = []string{"CAN_MANAGE", "CAN_QUERY", "CAN_VIEW"} -var enumValues11 = []string{"ACTIVE", "TRASHED"} +var enumValuesAppsAppResourceSqlWarehouseSqlWarehousePermission = []string{"CAN_MANAGE", "CAN_USE", "IS_OWNER"} -var enumValues12 = []string{"AVAILABLE", "DELETING", "FAILING_OVER", "STARTING", "STOPPED", "UPDATING"} +var enumValuesAppsAppResourceUcSecurableUcSecurablePermission = []string{"EXECUTE", "MODIFY", "READ_VOLUME", "SELECT", "USE_CONNECTION", "WRITE_VOLUME"} -var enumValues13 = []string{"PERFORMANCE_OPTIMIZED", "STANDARD"} +var enumValuesAppsAppResourceUcSecurableUcSecurableType = []string{"CONNECTION", "FUNCTION", "MODEL_SERVICE", "TABLE", "VOLUME"} -var enumValues14 = []string{"EDITABLE", "UI_LOCKED"} +var enumValuesAppsApplicationState = []string{"CRASHED", "DEPLOYING", "RUNNING", "UNAVAILABLE"} -var enumValues15 = []string{"MULTI_TASK", "SINGLE_TASK"} +var enumValuesAppsComputeSize = []string{"LARGE", "MEDIUM", "XLARGE"} -var enumValues16 = []string{"ENDPOINT_TYPE_READ_ONLY", "ENDPOINT_TYPE_READ_WRITE"} +var enumValuesAppsComputeState = []string{"ACTIVE", "DELETING", "ERROR", "STARTING", "STOPPED", "STOPPING", "UPDATING"} -var enumValues17 = []string{"LAKEBASE_OAUTH_V1", "NO_LOGIN", "PG_PASSWORD_SCRAM_SHA_256"} +var enumValuesCatalogModelProviderServiceConfigExternalModelProviderType = []string{"EXTERNAL_MODEL_PROVIDER_TYPE_AMAZON_BEDROCK", "EXTERNAL_MODEL_PROVIDER_TYPE_ANTHROPIC", "EXTERNAL_MODEL_PROVIDER_TYPE_AZURE_OPENAI", "EXTERNAL_MODEL_PROVIDER_TYPE_BEDROCK_MANTLE", "EXTERNAL_MODEL_PROVIDER_TYPE_CUSTOM", "EXTERNAL_MODEL_PROVIDER_TYPE_GEMINI_ENTERPRISE", "EXTERNAL_MODEL_PROVIDER_TYPE_MICROSOFT_FOUNDRY", "EXTERNAL_MODEL_PROVIDER_TYPE_OPENAI"} -var enumValues18 = []string{"GROUP", "SERVICE_PRINCIPAL", "USER"} +var enumValuesCatalogModelServiceConfigDestinationConfigDestinationType = []string{"DESTINATION_TYPE_EXTERNAL_FOUNDATION_MODEL", "DESTINATION_TYPE_PAY_PER_TOKEN_FOUNDATION_MODEL", "DESTINATION_TYPE_PROVISIONED_THROUGHPUT_FOUNDATION_MODEL"} -var enumValues19 = []string{"DATABRICKS_SUPERUSER"} +var enumValuesCatalogMonitorCronSchedulePauseStatus = []string{"PAUSED", "UNPAUSED", "UNSPECIFIED"} -var enumValues20 = []string{"CONTINUOUS", "SNAPSHOT", "TRIGGERED"} +var enumValuesCatalogMonitorInferenceLogProblemType = []string{"PROBLEM_TYPE_CLASSIFICATION", "PROBLEM_TYPE_REGRESSION"} -var enumValues21 = []string{"AZURE_KEYVAULT", "DATABRICKS"} +var enumValuesCatalogMonitorMetricType = []string{"CUSTOM_METRIC_TYPE_AGGREGATE", "CUSTOM_METRIC_TYPE_DERIVED", "CUSTOM_METRIC_TYPE_DRIFT"} -var enumValues22 = []string{"COST_OPTIMIZED", "POLICY_UNSPECIFIED", "RELIABILITY_OPTIMIZED"} +var enumValuesCatalogPrivilege = []string{"ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "BROWSE", "CREATE", "CREATE_CATALOG", "CREATE_CLEAN_ROOM", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FOREIGN_SECURABLE", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "EXECUTE_CLEAN_ROOM_TASK", "EXTERNAL_USE_LOCATION", "EXTERNAL_USE_SCHEMA", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "MODIFY_CLEAN_ROOM", "READ_FILES", "READ_METADATA", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"} -var enumValues23 = []string{"CLASSIC", "PRO", "TYPE_UNSPECIFIED"} +var enumValuesCatalogRateLimitRateLimitKey = []string{"RATE_LIMIT_KEY_SERVICE", "RATE_LIMIT_KEY_SERVICE_PRINCIPAL", "RATE_LIMIT_KEY_USER", "RATE_LIMIT_KEY_USER_DEFAULT", "RATE_LIMIT_KEY_USER_GROUP"} -var enumValues24 = []string{"ACTIVE", "DEGRADED", "DELETING", "FAILED", "PROVISIONING", "UPDATING"} +var enumValuesCatalogRateLimitRateLimitRenewalPeriod = []string{"RATE_LIMIT_RENEWAL_PERIOD_HOUR", "RATE_LIMIT_RENEWAL_PERIOD_MINUTE"} -var enumValues25 = []string{"STANDARD", "STORAGE_OPTIMIZED"} +var enumValuesCatalogSseEncryptionDetailsAlgorithm = []string{"AWS_SSE_KMS", "AWS_SSE_S3"} -var enumValues26 = []string{"FULL_TEXT", "HYBRID", "VECTOR"} +var enumValuesCatalogVolumeType = []string{"EXTERNAL", "MANAGED"} -var enumValues27 = []string{"DELTA_SYNC", "DIRECT_ACCESS"} +var enumValuesComputeAwsAvailability = []string{"ON_DEMAND", "SPOT", "SPOT_WITH_FALLBACK"} -var enumValues28 = []string{"EXTERNAL", "MANAGED"} +var enumValuesComputeAzureAvailability = []string{"ON_DEMAND_AZURE", "SPOT_AZURE", "SPOT_WITH_FALLBACK_AZURE"} -var enumValues29 = []string{"EQUAL", "GREATER_THAN", "GREATER_THAN_OR_EQUAL", "IS_NOT_NULL", "IS_NULL", "LESS_THAN", "LESS_THAN_OR_EQUAL", "NOT_EQUAL"} +var enumValuesComputeClusterPermissionLevel = []string{"CAN_ATTACH_TO", "CAN_MANAGE", "CAN_RESTART"} -var enumValues30 = []string{"ERROR", "OK", "TRIGGERED", "UNKNOWN"} +var enumValuesComputeClusterPolicyPermissionLevel = []string{"CAN_USE"} -var enumValues31 = []string{"PAUSED", "UNPAUSED"} +var enumValuesComputeConfidentialComputeType = []string{"CONFIDENTIAL_COMPUTE_TYPE_NONE", "SEV_SNP"} -var enumValues32 = []string{"AUTO_SYNC", "SNAPSHOT"} +var enumValuesComputeDataSecurityMode = []string{"DATA_SECURITY_MODE_AUTO", "DATA_SECURITY_MODE_DEDICATED", "DATA_SECURITY_MODE_STANDARD", "LEGACY_PASSTHROUGH", "LEGACY_SINGLE_USER", "LEGACY_SINGLE_USER_STANDARD", "LEGACY_TABLE_ACL", "NONE", "SINGLE_USER", "USER_ISOLATION"} -var enumValues33 = []string{"CRASHED", "DEPLOYING", "RUNNING", "UNAVAILABLE"} +var enumValuesComputeDependencyMode = []string{"DEPENDENCY_MODE_AUTO", "DEPENDENCY_MODE_CLUSTER_LIBRARIES", "DEPENDENCY_MODE_ENVIRONMENTS"} -var enumValues34 = []string{"ACTIVE", "DELETING", "ERROR", "STARTING", "STOPPED", "STOPPING", "UPDATING"} +var enumValuesComputeDiskTypeAzureDiskVolumeType = []string{"PREMIUM_LRS", "STANDARD_LRS"} -var enumValues35 = []string{"CAN_MANAGE", "CAN_USE"} +var enumValuesComputeDiskTypeEbsVolumeType = []string{"GENERAL_PURPOSE_SSD", "THROUGHPUT_OPTIMIZED_HDD"} -var enumValues36 = []string{"ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "BROWSE", "CREATE", "CREATE_CATALOG", "CREATE_CLEAN_ROOM", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FOREIGN_SECURABLE", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "EXECUTE_CLEAN_ROOM_TASK", "EXTERNAL_USE_LOCATION", "EXTERNAL_USE_SCHEMA", "MANAGE", "MANAGE_ALLOWLIST", "MODIFY", "MODIFY_CLEAN_ROOM", "READ_FILES", "READ_METADATA", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"} +var enumValuesComputeEbsVolumeType = []string{"GENERAL_PURPOSE_SSD", "THROUGHPUT_OPTIMIZED_HDD"} -var enumValues37 = []string{"CAN_USE"} +var enumValuesComputeGcpAvailability = []string{"ON_DEMAND_GCP", "PREEMPTIBLE_GCP", "PREEMPTIBLE_WITH_FALLBACK_GCP"} -var enumValues38 = []string{"ON_DEMAND", "SPOT", "SPOT_WITH_FALLBACK"} +var enumValuesComputeHardwareAcceleratorType = []string{"GPU_1xA10", "GPU_1xH100", "GPU_8xB300", "GPU_8xH100"} -var enumValues39 = []string{"GENERAL_PURPOSE_SSD", "THROUGHPUT_OPTIMIZED_HDD"} +var enumValuesComputeInstancePoolAwsAttributesAvailability = []string{"ON_DEMAND", "SPOT"} -var enumValues40 = []string{"ON_DEMAND_AZURE", "SPOT_AZURE", "SPOT_WITH_FALLBACK_AZURE"} +var enumValuesComputeInstancePoolAzureAttributesAvailability = []string{"ON_DEMAND_AZURE", "SPOT_AZURE"} -var enumValues41 = []string{"ON_DEMAND_GCP", "PREEMPTIBLE_GCP", "PREEMPTIBLE_WITH_FALLBACK_GCP"} +var enumValuesComputeInstancePoolPermissionLevel = []string{"CAN_ATTACH_TO", "CAN_MANAGE"} -var enumValues42 = []string{"CONFIDENTIAL_COMPUTE_TYPE_NONE", "SEV_SNP"} +var enumValuesComputeKind = []string{"CLASSIC_PREVIEW"} -var enumValues43 = []string{"CAN_ATTACH_TO", "CAN_MANAGE", "CAN_RESTART"} +var enumValuesComputeRuntimeEngine = []string{"NULL", "PHOTON", "STANDARD"} -var enumValues44 = []string{"CAN_EDIT", "CAN_MANAGE", "CAN_READ"} +var enumValuesConfigArtifactType = []string{"whl", "jar", "tgz"} -var enumValues45 = []string{"APPROX_COUNT_DISTINCT", "APPROX_PERCENTILE", "AVG", "COUNT", "FIRST", "FUNCTION_TYPE_UNSPECIFIED", "LAST", "MAX", "MIN", "STDDEV_POP", "STDDEV_SAMP", "SUM", "VAR_POP", "VAR_SAMP"} +var enumValuesDashboardsLifecycleState = []string{"ACTIVE", "TRASHED"} -var enumValues46 = []string{"ON_DEMAND", "SPOT"} +var enumValuesDatabaseDatabaseInstanceState = []string{"AVAILABLE", "DELETING", "FAILING_OVER", "STARTING", "STOPPED", "UPDATING"} -var enumValues47 = []string{"ON_DEMAND_AZURE", "SPOT_AZURE"} +var enumValuesDatabaseProvisioningInfoState = []string{"ACTIVE", "DEGRADED", "DELETING", "FAILED", "PROVISIONING", "UPDATING"} -var enumValues48 = []string{"CAN_ATTACH_TO", "CAN_MANAGE"} +var enumValuesDatabaseProvisioningPhase = []string{"PROVISIONING_PHASE_INDEX_SCAN", "PROVISIONING_PHASE_INDEX_SORT", "PROVISIONING_PHASE_MAIN"} -var enumValues49 = []string{"NEVER", "ON_FAILURE"} +var enumValuesDatabaseSyncedTableSchedulingPolicy = []string{"CONTINUOUS", "SNAPSHOT", "TRIGGERED"} -var enumValues50 = []string{"BUNDLE", "SYSTEM_MANAGED"} +var enumValuesDatabaseSyncedTableSpecPgSpecificType = []string{"PG_SPECIFIC_TYPE_HALFVEC", "PG_SPECIFIC_TYPE_VARCHAR", "PG_SPECIFIC_TYPE_VECTOR"} -var enumValues51 = []string{"awsCodeCommit", "azureDevOpsServices", "bitbucketCloud", "bitbucketServer", "gitHub", "gitHubEnterprise", "gitLab", "gitLabEnterpriseEdition"} +var enumValuesDatabaseSyncedTableState = []string{"SYNCED_TABLED_OFFLINE", "SYNCED_TABLE_OFFLINE_FAILED", "SYNCED_TABLE_ONLINE", "SYNCED_TABLE_ONLINE_CONTINUOUS_UPDATE", "SYNCED_TABLE_ONLINE_NO_PENDING_UPDATE", "SYNCED_TABLE_ONLINE_PIPELINE_FAILED", "SYNCED_TABLE_ONLINE_TRIGGERED_UPDATE", "SYNCED_TABLE_ONLINE_UPDATING_PIPELINE_RESOURCES", "SYNCED_TABLE_PROVISIONING", "SYNCED_TABLE_PROVISIONING_INITIAL_SNAPSHOT", "SYNCED_TABLE_PROVISIONING_PIPELINE_RESOURCES"} -var enumValues52 = []string{"CAN_MANAGE", "CAN_MANAGE_RUN", "CAN_VIEW", "IS_OWNER"} +var enumValuesExecExecutableType = []string{"bash", "sh", "cmd"} -var enumValues53 = []string{"ALL_DONE", "ALL_FAILED", "ALL_SUCCESS", "AT_LEAST_ONE_FAILED", "AT_LEAST_ONE_SUCCESS", "NONE_FAILED"} +var enumValuesIamPermissionLevel = []string{"CAN_ATTACH_TO", "CAN_BIND", "CAN_CREATE", "CAN_CREATE_APP", "CAN_EDIT", "CAN_EDIT_METADATA", "CAN_MANAGE", "CAN_MANAGE_PRODUCTION_VERSIONS", "CAN_MANAGE_RUN", "CAN_MANAGE_STAGING_VERSIONS", "CAN_MONITOR", "CAN_MONITOR_ONLY", "CAN_QUERY", "CAN_READ", "CAN_RESTART", "CAN_RUN", "CAN_USE", "CAN_VIEW", "CAN_VIEW_METADATA", "IS_OWNER"} -var enumValues54 = []string{"EXTERNAL_MODEL_PROVIDER_TYPE_AMAZON_BEDROCK", "EXTERNAL_MODEL_PROVIDER_TYPE_ANTHROPIC", "EXTERNAL_MODEL_PROVIDER_TYPE_AZURE_OPENAI", "EXTERNAL_MODEL_PROVIDER_TYPE_BEDROCK_MANTLE", "EXTERNAL_MODEL_PROVIDER_TYPE_CUSTOM", "EXTERNAL_MODEL_PROVIDER_TYPE_GEMINI_ENTERPRISE", "EXTERNAL_MODEL_PROVIDER_TYPE_MICROSOFT_FOUNDRY", "EXTERNAL_MODEL_PROVIDER_TYPE_OPENAI"} +var enumValuesJobsAiRuntimeTaskPriorityClass = []string{"BEST_EFFORT", "CRITICAL", "NORMAL"} -var enumValues55 = []string{"CAN_MANAGE", "CAN_QUERY", "CAN_VIEW"} +var enumValuesJobsAuthenticationMethod = []string{"OAUTH", "PAT"} -var enumValues56 = []string{"endpoint", "user"} +var enumValuesJobsComputeSpecAcceleratorType = []string{"GPU_1xA10", "GPU_1xH100", "GPU_8xB300", "GPU_8xH100"} -var enumValues57 = []string{"minute"} +var enumValuesJobsCondition = []string{"ALL_UPDATED", "ANY_UPDATED"} -var enumValues58 = []string{"TELEMETRY_FEATURE_INFERENCE_TABLE", "TELEMETRY_FEATURE_LOGS", "TELEMETRY_FEATURE_METRICS", "TELEMETRY_FEATURE_TRACES"} +var enumValuesJobsConditionTaskOp = []string{"EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL", "LESS_THAN", "LESS_THAN_OR_EQUAL", "NOT_EQUAL"} -var enumValues59 = []string{"CAN_EDIT", "CAN_MANAGE", "CAN_MANAGE_PRODUCTION_VERSIONS", "CAN_MANAGE_STAGING_VERSIONS", "CAN_READ"} +var enumValuesJobsDayOfWeek = []string{"FRIDAY", "MONDAY", "SATURDAY", "SUNDAY", "THURSDAY", "TUESDAY", "WEDNESDAY"} -var enumValues60 = []string{"BUNDLE"} +var enumValuesJobsFormat = []string{"MULTI_TASK", "SINGLE_TASK"} -var enumValues61 = []string{"CDC", "QUERY_BASED"} +var enumValuesJobsGitProvider = []string{"awsCodeCommit", "azureDevOpsServices", "bitbucketCloud", "bitbucketServer", "gitHub", "gitHubEnterprise", "gitLab", "gitLabEnterpriseEdition"} -var enumValues62 = []string{"BIGQUERY", "CONFLUENCE", "DYNAMICS365", "FOREIGN_CATALOG", "GA4_RAW_DATA", "GOOGLE_DRIVE", "JIRA", "MANAGED_POSTGRESQL", "META_MARKETING", "MYSQL", "NETSUITE", "ORACLE", "POSTGRESQL", "RABBITMQ", "SALESFORCE", "SERVICENOW", "SHAREPOINT", "SMARTSHEET", "SQLSERVER", "TERADATA", "TIKTOK_ADS", "WORKDAY_RAAS", "ZENDESK"} +var enumValuesJobsJobDeploymentKind = []string{"BUNDLE", "SYSTEM_MANAGED"} -var enumValues63 = []string{"CAN_MANAGE", "CAN_RUN", "CAN_VIEW", "IS_OWNER"} +var enumValuesJobsJobEditMode = []string{"EDITABLE", "UI_LOCKED"} -var enumValues64 = []string{"FRIDAY", "MONDAY", "SATURDAY", "SUNDAY", "THURSDAY", "TUESDAY", "WEDNESDAY"} +var enumValuesJobsJobPermissionLevel = []string{"CAN_MANAGE", "CAN_MANAGE_RUN", "CAN_VIEW", "IS_OWNER"} -var enumValues65 = []string{"STORED_GENERATED"} +var enumValuesJobsJobSourceDirtyState = []string{"DISCONNECTED", "NOT_SYNCED"} -var enumValues66 = []string{"CURRENT", "PREVIEW"} +var enumValuesJobsJobsHealthMetric = []string{"RUN_DURATION_SECONDS", "STREAMING_BACKLOG_BYTES", "STREAMING_BACKLOG_FILES", "STREAMING_BACKLOG_RECORDS", "STREAMING_BACKLOG_SECONDS"} -var enumValues67 = []string{"PG_SPECIFIC_TYPE_HALFVEC", "PG_SPECIFIC_TYPE_VARCHAR", "PG_SPECIFIC_TYPE_VECTOR"} +var enumValuesJobsJobsHealthOperator = []string{"GREATER_THAN"} -var enumValues68 = []string{"CUSTOM_METRIC_TYPE_AGGREGATE", "CUSTOM_METRIC_TYPE_DERIVED", "CUSTOM_METRIC_TYPE_DRIFT"} +var enumValuesJobsModelTriggerConfigurationCondition = []string{"MODEL_ALIAS_SET", "MODEL_CREATED", "MODEL_VERSION_READY"} -var enumValues69 = []string{"PROBLEM_TYPE_CLASSIFICATION", "PROBLEM_TYPE_REGRESSION"} +var enumValuesJobsPauseStatus = []string{"PAUSED", "UNPAUSED"} -var enumValues70 = []string{"PAUSED", "UNPAUSED", "UNSPECIFIED"} +var enumValuesJobsPerformanceTarget = []string{"PERFORMANCE_OPTIMIZED", "STANDARD"} -var enumValues71 = []string{"READ", "WRITE", "MANAGE"} +var enumValuesJobsPeriodicTriggerConfigurationTimeUnit = []string{"DAYS", "HOURS", "MINUTES", "WEEKS"} -var enumValues72 = []string{"CHANNEL_NAME_CURRENT", "CHANNEL_NAME_CUSTOM", "CHANNEL_NAME_PREVIEW", "CHANNEL_NAME_PREVIOUS"} +var enumValuesJobsRunIf = []string{"ALL_DONE", "ALL_FAILED", "ALL_SUCCESS", "AT_LEAST_ONE_FAILED", "AT_LEAST_ONE_SUCCESS", "NONE_FAILED"} -var enumValues73 = []string{"CAN_MANAGE", "CAN_MONITOR", "CAN_USE", "CAN_VIEW", "IS_OWNER"} +var enumValuesJobsSource = []string{"GIT", "WORKSPACE"} -var enumValues74 = []string{"SYNCED_TABLED_OFFLINE", "SYNCED_TABLE_OFFLINE_FAILED", "SYNCED_TABLE_ONLINE", "SYNCED_TABLE_ONLINE_CONTINUOUS_UPDATE", "SYNCED_TABLE_ONLINE_NO_PENDING_UPDATE", "SYNCED_TABLE_ONLINE_PIPELINE_FAILED", "SYNCED_TABLE_ONLINE_TRIGGERED_UPDATE", "SYNCED_TABLE_ONLINE_UPDATING_PIPELINE_RESOURCES", "SYNCED_TABLE_PROVISIONING", "SYNCED_TABLE_PROVISIONING_INITIAL_SNAPSHOT", "SYNCED_TABLE_PROVISIONING_PIPELINE_RESOURCES"} +var enumValuesJobsSqlConditionTriggerMode = []string{"QUERY_RETURNS_ROWS", "RESULT_VALUE_CHANGES"} -var enumValues75 = []string{"CAN_CREATE", "CAN_MANAGE", "CAN_USE"} +var enumValuesJobsStorageMode = []string{"DIRECT_QUERY", "DUAL", "IMPORT"} -var enumValues76 = []string{"CONTINUOUS", "TRIGGERED"} +var enumValuesJobsTaskRetryMode = []string{"NEVER", "ON_FAILURE"} -var enumValues77 = []string{"AVG", "COUNT", "COUNT_DISTINCT", "MAX", "MEDIAN", "MIN", "STDDEV", "SUM"} +var enumValuesMlExperimentPermissionLevel = []string{"CAN_EDIT", "CAN_MANAGE", "CAN_READ"} -var enumValues78 = []string{"CANCELLED", "FAILED", "IN_PROGRESS", "SUCCEEDED"} +var enumValuesMlFunctionFunctionType = []string{"APPROX_COUNT_DISTINCT", "APPROX_PERCENTILE", "AVG", "COUNT", "FIRST", "FUNCTION_TYPE_UNSPECIFIED", "LAST", "MAX", "MIN", "STDDEV_POP", "STDDEV_SAMP", "SUM", "VAR_POP", "VAR_SAMP"} -var enumValues79 = []string{"CAN_CONNECT_AND_CREATE"} +var enumValuesMlRegisteredModelPermissionLevel = []string{"CAN_EDIT", "CAN_MANAGE", "CAN_MANAGE_PRODUCTION_VERSIONS", "CAN_MANAGE_STAGING_VERSIONS", "CAN_READ"} -var enumValues80 = []string{"CAN_EDIT", "CAN_MANAGE", "CAN_RUN", "CAN_VIEW"} +var enumValuesMlScalarDataType = []string{"BINARY", "BOOLEAN", "DATE", "DECIMAL", "DOUBLE", "FLOAT", "INTEGER", "LONG", "SHORT", "STRING", "TIMESTAMP"} -var enumValues81 = []string{"MANAGE", "READ", "WRITE"} +var enumValuesPipelinesConnectorType = []string{"CDC", "QUERY_BASED"} -var enumValues82 = []string{"CAN_MANAGE", "CAN_USE", "IS_OWNER"} +var enumValuesPipelinesDayOfWeek = []string{"FRIDAY", "MONDAY", "SATURDAY", "SUNDAY", "THURSDAY", "TUESDAY", "WEDNESDAY"} -var enumValues83 = []string{"EXECUTE", "MODIFY", "READ_VOLUME", "SELECT", "USE_CONNECTION", "WRITE_VOLUME"} +var enumValuesPipelinesDeploymentKind = []string{"BUNDLE"} -var enumValues84 = []string{"CONNECTION", "FUNCTION", "MODEL_SERVICE", "TABLE", "VOLUME"} +var enumValuesPipelinesFileIngestionOptionsFileFormat = []string{"AVRO", "BINARYFILE", "CSV", "EXCEL", "JSON", "ORC", "PARQUET", "XML"} -var enumValues85 = []string{"AWS_SSE_KMS", "AWS_SSE_S3"} +var enumValuesPipelinesFileIngestionOptionsSchemaEvolutionMode = []string{"ADD_NEW_COLUMNS", "ADD_NEW_COLUMNS_WITH_TYPE_WIDENING", "FAIL_ON_NEW_COLUMNS", "NONE", "RESCUE"} -var enumValues86 = []string{"PREMIUM_LRS", "STANDARD_LRS"} +var enumValuesPipelinesGoogleDriveOptionsGoogleDriveEntityType = []string{"FILE", "FILE_METADATA", "PERMISSION"} -var enumValues87 = []string{"DISCONNECTED", "NOT_SYNCED"} +var enumValuesPipelinesIngestionSourceType = []string{"BIGQUERY", "CONFLUENCE", "DYNAMICS365", "FOREIGN_CATALOG", "GA4_RAW_DATA", "GOOGLE_DRIVE", "JIRA", "MANAGED_POSTGRESQL", "META_MARKETING", "MYSQL", "NETSUITE", "ORACLE", "POSTGRESQL", "RABBITMQ", "SALESFORCE", "SERVICENOW", "SHAREPOINT", "SMARTSHEET", "SQLSERVER", "TERADATA", "TIKTOK_ADS", "WORKDAY_RAAS", "ZENDESK"} -var enumValues88 = []string{"RUN_DURATION_SECONDS", "STREAMING_BACKLOG_BYTES", "STREAMING_BACKLOG_FILES", "STREAMING_BACKLOG_RECORDS", "STREAMING_BACKLOG_SECONDS"} +var enumValuesPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptionsLinkedInAdsEntityGranularity = []string{"CAMPAIGN", "CAMPAIGN_GROUP", "CREATIVE"} -var enumValues89 = []string{"GREATER_THAN"} +var enumValuesPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptionsLinkedInAdsFinder = []string{"ANALYTICS", "ATTRIBUTED_REVENUE_METRICS", "STATISTICS"} -var enumValues90 = []string{"QUERY_RETURNS_ROWS", "RESULT_VALUE_CHANGES"} +var enumValuesPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptionsLinkedInAdsTimeGranularity = []string{"ALL", "DAILY", "MONTHLY", "YEARLY"} -var enumValues91 = []string{"BEST_EFFORT", "CRITICAL", "NORMAL"} +var enumValuesPipelinesOutlookAttachmentMode = []string{"ALL", "INLINE_ONLY", "NONE", "NON_INLINE_ONLY"} -var enumValues92 = []string{"GPU_1xA10", "GPU_1xH100", "GPU_8xB300", "GPU_8xH100"} +var enumValuesPipelinesOutlookBodyFormat = []string{"TEXT_HTML", "TEXT_PLAIN"} -var enumValues93 = []string{"EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL", "LESS_THAN", "LESS_THAN_OR_EQUAL", "NOT_EQUAL"} +var enumValuesPipelinesParseMode = []string{"FAILFAST", "PERMISSIVE"} -var enumValues94 = []string{"GIT", "WORKSPACE"} +var enumValuesPipelinesPipelineClusterAutoscaleMode = []string{"ENHANCED", "LEGACY"} -var enumValues95 = []string{"MODEL_ALIAS_SET", "MODEL_CREATED", "MODEL_VERSION_READY"} +var enumValuesPipelinesPipelinePermissionLevel = []string{"CAN_MANAGE", "CAN_RUN", "CAN_VIEW", "IS_OWNER"} -var enumValues96 = []string{"DAYS", "HOURS", "MINUTES", "WEEKS"} +var enumValuesPipelinesSharepointOptionsSharepointEntityType = []string{"FILE", "FILE_METADATA", "LIST", "PERMISSION"} -var enumValues97 = []string{"ALL_UPDATED", "ANY_UPDATED"} +var enumValuesPipelinesTableSpecificConfigScdType = []string{"APPEND_ONLY", "SCD_TYPE_1", "SCD_TYPE_2"} -var enumValues98 = []string{"RATE_LIMIT_KEY_SERVICE", "RATE_LIMIT_KEY_SERVICE_PRINCIPAL", "RATE_LIMIT_KEY_USER", "RATE_LIMIT_KEY_USER_DEFAULT", "RATE_LIMIT_KEY_USER_GROUP"} +var enumValuesPipelinesTikTokAdsOptionsTikTokDataLevel = []string{"AUCTION_AD", "AUCTION_ADGROUP", "AUCTION_ADVERTISER", "AUCTION_CAMPAIGN"} -var enumValues99 = []string{"RATE_LIMIT_RENEWAL_PERIOD_HOUR", "RATE_LIMIT_RENEWAL_PERIOD_MINUTE"} +var enumValuesPipelinesTikTokAdsOptionsTikTokReportType = []string{"AUDIENCE", "BASIC", "BUSINESS_CENTER", "DSA", "GMV_MAX", "PLAYABLE_AD"} -var enumValues100 = []string{"endpoint", "service_principal", "user", "user_group"} +var enumValuesPipelinesTransformerFormat = []string{"AVRO", "JSON", "PROTOBUF", "STRING"} -var enumValues101 = []string{"CPU", "CPU_LARGE", "CPU_MEDIUM", "GPU_LARGE", "GPU_MEDIUM", "GPU_SMALL", "GPU_XLARGE", "GPU_XLARGE_8", "MULTIGPU_MEDIUM"} +var enumValuesPostgresDayOfWeek = []string{"FRIDAY", "MONDAY", "SATURDAY", "SUNDAY", "THURSDAY", "TUESDAY", "WEDNESDAY"} -var enumValues102 = []string{"ENHANCED", "LEGACY"} +var enumValuesPostgresEndpointType = []string{"ENDPOINT_TYPE_READ_ONLY", "ENDPOINT_TYPE_READ_WRITE"} -var enumValues103 = []string{"APPEND_ONLY", "SCD_TYPE_1", "SCD_TYPE_2"} +var enumValuesPostgresNewPipelineSpecPipelineChannel = []string{"CURRENT", "PREVIEW"} -var enumValues104 = []string{"OAUTH", "PAT"} +var enumValuesPostgresRoleAuthMethod = []string{"LAKEBASE_OAUTH_V1", "NO_LOGIN", "PG_PASSWORD_SCRAM_SHA_256"} -var enumValues105 = []string{"DIRECT_QUERY", "DUAL", "IMPORT"} +var enumValuesPostgresRoleIdentityType = []string{"GROUP", "SERVICE_PRINCIPAL", "USER"} -var enumValues106 = []string{"DESTINATION_TYPE_EXTERNAL_FOUNDATION_MODEL", "DESTINATION_TYPE_PAY_PER_TOKEN_FOUNDATION_MODEL", "DESTINATION_TYPE_PROVISIONED_THROUGHPUT_FOUNDATION_MODEL"} +var enumValuesPostgresRoleMembershipRole = []string{"DATABRICKS_SUPERUSER"} -var enumValues107 = []string{"ai21labs", "amazon-bedrock", "anthropic", "cohere", "custom", "databricks-model-serving", "google-cloud-vertex-ai", "openai", "palm"} +var enumValuesPostgresSyncedTableSyncedTableSpecExtraColumnMaintenance = []string{"STORED_GENERATED"} -var enumValues108 = []string{"PROVISIONING_PHASE_INDEX_SCAN", "PROVISIONING_PHASE_INDEX_SORT", "PROVISIONING_PHASE_MAIN"} +var enumValuesPostgresSyncedTableSyncedTableSpecPgSpecificType = []string{"PG_SPECIFIC_TYPE_HALFVEC", "PG_SPECIFIC_TYPE_VARCHAR", "PG_SPECIFIC_TYPE_VECTOR"} -var enumValues109 = []string{"BINARY", "BOOLEAN", "DATE", "DECIMAL", "DOUBLE", "FLOAT", "INTEGER", "LONG", "SHORT", "STRING", "TIMESTAMP"} +var enumValuesPostgresSyncedTableSyncedTableSpecSyncedTableSchedulingPolicy = []string{"CONTINUOUS", "SNAPSHOT", "TRIGGERED"} -var enumValues110 = []string{"BLOCK", "MASK", "NONE"} +var enumValuesResourcesSecretScopePermissionLevel = []string{"READ", "WRITE", "MANAGE"} -var enumValues111 = []string{"ai21labs", "amazon", "anthropic", "cohere"} +var enumValuesServingAiGatewayGuardrailPiiBehaviorBehavior = []string{"BLOCK", "MASK", "NONE"} -var enumValues112 = []string{"FILE", "FILE_METADATA", "PERMISSION"} +var enumValuesServingAiGatewayRateLimitKey = []string{"endpoint", "service_principal", "user", "user_group"} -var enumValues113 = []string{"ALL", "INLINE_ONLY", "NONE", "NON_INLINE_ONLY"} +var enumValuesServingAiGatewayRateLimitRenewalPeriod = []string{"minute"} -var enumValues114 = []string{"TEXT_HTML", "TEXT_PLAIN"} +var enumValuesServingAmazonBedrockConfigBedrockProvider = []string{"ai21labs", "amazon", "anthropic", "cohere"} -var enumValues115 = []string{"FILE", "FILE_METADATA", "LIST", "PERMISSION"} +var enumValuesServingExternalModelProvider = []string{"ai21labs", "amazon-bedrock", "anthropic", "cohere", "custom", "databricks-model-serving", "google-cloud-vertex-ai", "openai", "palm"} -var enumValues116 = []string{"AUCTION_AD", "AUCTION_ADGROUP", "AUCTION_ADVERTISER", "AUCTION_CAMPAIGN"} +var enumValuesServingRateLimitKey = []string{"endpoint", "user"} -var enumValues117 = []string{"AUDIENCE", "BASIC", "BUSINESS_CENTER", "DSA", "GMV_MAX", "PLAYABLE_AD"} +var enumValuesServingRateLimitRenewalPeriod = []string{"minute"} -var enumValues118 = []string{"AVRO", "JSON", "PROTOBUF", "STRING"} +var enumValuesServingServedModelInputWorkloadType = []string{"CPU", "CPU_LARGE", "CPU_MEDIUM", "GPU_LARGE", "GPU_MEDIUM", "GPU_SMALL", "GPU_XLARGE", "GPU_XLARGE_8", "MULTIGPU_MEDIUM"} -var enumValues119 = []string{"AVRO", "BINARYFILE", "CSV", "EXCEL", "JSON", "ORC", "PARQUET", "XML"} +var enumValuesServingServingEndpointPermissionLevel = []string{"CAN_MANAGE", "CAN_QUERY", "CAN_VIEW"} -var enumValues120 = []string{"ADD_NEW_COLUMNS", "ADD_NEW_COLUMNS_WITH_TYPE_WIDENING", "FAIL_ON_NEW_COLUMNS", "NONE", "RESCUE"} +var enumValuesServingServingModelWorkloadType = []string{"CPU", "CPU_LARGE", "CPU_MEDIUM", "GPU_LARGE", "GPU_MEDIUM", "GPU_SMALL", "GPU_XLARGE", "GPU_XLARGE_8", "MULTIGPU_MEDIUM"} -var enumValues121 = []string{"CAMPAIGN", "CAMPAIGN_GROUP", "CREATIVE"} +var enumValuesServingTelemetryFeature = []string{"TELEMETRY_FEATURE_INFERENCE_TABLE", "TELEMETRY_FEATURE_LOGS", "TELEMETRY_FEATURE_METRICS", "TELEMETRY_FEATURE_TRACES"} -var enumValues122 = []string{"ANALYTICS", "ATTRIBUTED_REVENUE_METRICS", "STATISTICS"} +var enumValuesSqlAggregation = []string{"AVG", "COUNT", "COUNT_DISTINCT", "MAX", "MEDIAN", "MIN", "STDDEV", "SUM"} -var enumValues123 = []string{"ALL", "DAILY", "MONTHLY", "YEARLY"} +var enumValuesSqlAlertEvaluationState = []string{"ERROR", "OK", "TRIGGERED", "UNKNOWN"} -var enumValues124 = []string{"FAILFAST", "PERMISSIVE"} +var enumValuesSqlAlertLifecycleState = []string{"ACTIVE", "DELETED"} + +var enumValuesSqlChannelName = []string{"CHANNEL_NAME_CURRENT", "CHANNEL_NAME_CUSTOM", "CHANNEL_NAME_PREVIEW", "CHANNEL_NAME_PREVIOUS"} + +var enumValuesSqlComparisonOperator = []string{"EQUAL", "GREATER_THAN", "GREATER_THAN_OR_EQUAL", "IS_NOT_NULL", "IS_NULL", "LESS_THAN", "LESS_THAN_OR_EQUAL", "NOT_EQUAL"} + +var enumValuesSqlCreateWarehouseRequestWarehouseType = []string{"CLASSIC", "PRO", "TYPE_UNSPECIFIED"} + +var enumValuesSqlCustomTemplateFormat = []string{"HTML", "MARKDOWN"} + +var enumValuesSqlSchedulePauseStatus = []string{"PAUSED", "UNPAUSED"} + +var enumValuesSqlSpotInstancePolicy = []string{"COST_OPTIMIZED", "POLICY_UNSPECIFIED", "RELIABILITY_OPTIMIZED"} + +var enumValuesSqlWarehousePermissionLevel = []string{"CAN_MANAGE", "CAN_MONITOR", "CAN_USE", "CAN_VIEW", "IS_OWNER"} + +var enumValuesVariableVariableType = []string{"complex"} + +var enumValuesVectorsearchEndpointType = []string{"STANDARD", "STORAGE_OPTIMIZED"} + +var enumValuesVectorsearchIndexSubtype = []string{"FULL_TEXT", "HYBRID", "VECTOR"} + +var enumValuesVectorsearchPipelineType = []string{"CONTINUOUS", "TRIGGERED"} + +var enumValuesVectorsearchVectorIndexType = []string{"DELTA_SYNC", "DIRECT_ACCESS"} + +var enumValuesVectorsearchVectorSearchEndpointPermissionLevel = []string{"CAN_CREATE", "CAN_MANAGE", "CAN_USE"} + +var enumValuesWorkspaceScopeBackendType = []string{"AZURE_KEYVAULT", "DATABRICKS"} func enumConfigRoot(w *walker, n *node, v *config.Root) { if v == nil { @@ -305,15 +333,15 @@ func enumConfigArtifact(w *walker, n *node, v *config.Artifact) { if v == nil { v = &config.Artifact{} } - w.enumField(n, "executable", string(v.Executable), enumValues0) - w.enumField(n, "type", string(v.Type), enumValues1) + w.enumField(n, "executable", string(v.Executable), enumValuesExecExecutableType) + w.enumField(n, "type", string(v.Type), enumValuesConfigArtifactType) } func enumResourcesPermission(w *walker, n *node, v *resources.Permission) { if v == nil { v = &resources.Permission{} } - w.enumField(n, "level", string(v.Level), enumValues2) + w.enumField(n, "level", string(v.Level), enumValuesIamPermissionLevel) } func enumConfigResources(w *walker, n *node, v *config.Resources) { @@ -571,18 +599,18 @@ func enumVariableVariable(w *walker, n *node, v *variable.Variable) { if v == nil { v = &variable.Variable{} } - w.enumField(n, "type", string(v.Type), enumValues3) + w.enumField(n, "type", string(v.Type), enumValuesVariableVariableType) } func enumResourcesAlert(w *walker, n *node, v *resources.Alert) { if v == nil { v = &resources.Alert{} } - w.enumField(n, "custom_template_format", string(v.AlertV2.CustomTemplateFormat), enumValues4) + w.enumField(n, "custom_template_format", string(v.AlertV2.CustomTemplateFormat), enumValuesSqlCustomTemplateFormat) if c := n.child("evaluation"); c.exists() { enumSqlAlertV2Evaluation(w, &c, &v.AlertV2.Evaluation) } - w.enumField(n, "lifecycle_state", string(v.AlertV2.LifecycleState), enumValues5) + w.enumField(n, "lifecycle_state", string(v.AlertV2.LifecycleState), enumValuesSqlAlertLifecycleState) if len(v.Permissions) > 0 { c := n.child("permissions") for i0 := range v.Permissions { @@ -605,7 +633,7 @@ func enumResourcesApp(w *walker, n *node, v *resources.App) { if c := n.child("app_status"); c.exists() { enumAppsApplicationStatus(w, &c, v.App.AppStatus) } - w.enumField(n, "compute_size", string(v.App.ComputeSize), enumValues6) + w.enumField(n, "compute_size", string(v.App.ComputeSize), enumValuesAppsComputeSize) if c := n.child("compute_status"); c.exists() { enumAppsComputeStatus(w, &c, v.App.ComputeStatus) } @@ -664,12 +692,12 @@ func enumResourcesCluster(w *walker, n *node, v *resources.Cluster) { if c := n.child("azure_attributes"); c.exists() { enumComputeAzureAttributes(w, &c, v.ClusterSpec.AzureAttributes) } - w.enumField(n, "data_security_mode", string(v.ClusterSpec.DataSecurityMode), enumValues7) - w.enumField(n, "dependency_mode", string(v.ClusterSpec.DependencyMode), enumValues8) + w.enumField(n, "data_security_mode", string(v.ClusterSpec.DataSecurityMode), enumValuesComputeDataSecurityMode) + w.enumField(n, "dependency_mode", string(v.ClusterSpec.DependencyMode), enumValuesComputeDependencyMode) if c := n.child("gcp_attributes"); c.exists() { enumComputeGcpAttributes(w, &c, v.ClusterSpec.GcpAttributes) } - w.enumField(n, "kind", string(v.ClusterSpec.Kind), enumValues9) + w.enumField(n, "kind", string(v.ClusterSpec.Kind), enumValuesComputeKind) if len(v.Permissions) > 0 { c := n.child("permissions") for i0 := range v.Permissions { @@ -677,14 +705,14 @@ func enumResourcesCluster(w *walker, n *node, v *resources.Cluster) { enumResourcesClusterPermission(w, &e, &v.Permissions[i0]) } } - w.enumField(n, "runtime_engine", string(v.ClusterSpec.RuntimeEngine), enumValues10) + w.enumField(n, "runtime_engine", string(v.ClusterSpec.RuntimeEngine), enumValuesComputeRuntimeEngine) } func enumResourcesDashboard(w *walker, n *node, v *resources.Dashboard) { if v == nil { v = &resources.Dashboard{} } - w.enumField(n, "lifecycle_state", string(v.DashboardConfig.LifecycleState), enumValues11) + w.enumField(n, "lifecycle_state", string(v.DashboardConfig.LifecycleState), enumValuesDashboardsLifecycleState) if len(v.Permissions) > 0 { c := n.child("permissions") for i0 := range v.Permissions { @@ -705,7 +733,7 @@ func enumResourcesDatabaseInstance(w *walker, n *node, v *resources.DatabaseInst enumResourcesPermission(w, &e, &v.Permissions[i0]) } } - w.enumField(n, "state", string(v.DatabaseInstance.State), enumValues12) + w.enumField(n, "state", string(v.DatabaseInstance.State), enumValuesDatabaseDatabaseInstanceState) } func enumResourcesMlflowExperiment(w *walker, n *node, v *resources.MlflowExperiment) { @@ -791,7 +819,7 @@ func enumResourcesJobRun(w *walker, n *node, v *resources.JobRun) { if v == nil { v = &resources.JobRun{} } - w.enumField(n, "performance_target", string(v.RunNow.PerformanceTarget), enumValues13) + w.enumField(n, "performance_target", string(v.RunNow.PerformanceTarget), enumValuesJobsPerformanceTarget) } func enumResourcesJob(w *walker, n *node, v *resources.Job) { @@ -804,8 +832,8 @@ func enumResourcesJob(w *walker, n *node, v *resources.Job) { if c := n.child("deployment"); c.exists() { enumJobsJobDeployment(w, &c, v.JobSettings.Deployment) } - w.enumField(n, "edit_mode", string(v.JobSettings.EditMode), enumValues14) - w.enumField(n, "format", string(v.JobSettings.Format), enumValues15) + w.enumField(n, "edit_mode", string(v.JobSettings.EditMode), enumValuesJobsJobEditMode) + w.enumField(n, "format", string(v.JobSettings.Format), enumValuesJobsFormat) if c := n.child("git_source"); c.exists() { enumJobsGitSource(w, &c, v.JobSettings.GitSource) } @@ -819,7 +847,7 @@ func enumResourcesJob(w *walker, n *node, v *resources.Job) { enumJobsJobCluster(w, &e, &v.JobSettings.JobClusters[i0]) } } - w.enumField(n, "performance_target", string(v.JobSettings.PerformanceTarget), enumValues13) + w.enumField(n, "performance_target", string(v.JobSettings.PerformanceTarget), enumValuesJobsPerformanceTarget) if len(v.Permissions) > 0 { c := n.child("permissions") for i0 := range v.Permissions { @@ -972,7 +1000,7 @@ func enumResourcesPostgresEndpoint(w *walker, n *node, v *resources.PostgresEndp if v == nil { v = &resources.PostgresEndpoint{} } - w.enumField(n, "endpoint_type", string(v.PostgresEndpointConfig.EndpointSpec.EndpointType), enumValues16) + w.enumField(n, "endpoint_type", string(v.PostgresEndpointConfig.EndpointSpec.EndpointType), enumValuesPostgresEndpointType) } func enumResourcesPostgresProject(w *walker, n *node, v *resources.PostgresProject) { @@ -992,13 +1020,13 @@ func enumResourcesPostgresRole(w *walker, n *node, v *resources.PostgresRole) { if v == nil { v = &resources.PostgresRole{} } - w.enumField(n, "auth_method", string(v.PostgresRoleConfig.RoleRoleSpec.AuthMethod), enumValues17) - w.enumField(n, "identity_type", string(v.PostgresRoleConfig.RoleRoleSpec.IdentityType), enumValues18) + w.enumField(n, "auth_method", string(v.PostgresRoleConfig.RoleRoleSpec.AuthMethod), enumValuesPostgresRoleAuthMethod) + w.enumField(n, "identity_type", string(v.PostgresRoleConfig.RoleRoleSpec.IdentityType), enumValuesPostgresRoleIdentityType) if len(v.PostgresRoleConfig.RoleRoleSpec.MembershipRoles) > 0 { c := n.child("membership_roles") for i0 := range v.PostgresRoleConfig.RoleRoleSpec.MembershipRoles { e := c.elem(i0) - w.enumElem(&e, string(v.PostgresRoleConfig.RoleRoleSpec.MembershipRoles[i0]), enumValues19) + w.enumElem(&e, string(v.PostgresRoleConfig.RoleRoleSpec.MembershipRoles[i0]), enumValuesPostgresRoleMembershipRole) } } } @@ -1030,7 +1058,7 @@ func enumResourcesPostgresSyncedTable(w *walker, n *node, v *resources.PostgresS if c := n.child("new_pipeline_spec"); c.exists() { enumPostgresNewPipelineSpec(w, &c, v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.NewPipelineSpec) } - w.enumField(n, "scheduling_policy", string(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.SchedulingPolicy), enumValues20) + w.enumField(n, "scheduling_policy", string(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.SchedulingPolicy), enumValuesPostgresSyncedTableSyncedTableSpecSyncedTableSchedulingPolicy) if len(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides) > 0 { c := n.child("type_overrides") for i0 := range v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides { @@ -1089,7 +1117,7 @@ func enumResourcesSecretScope(w *walker, n *node, v *resources.SecretScope) { if v == nil { v = &resources.SecretScope{} } - w.enumField(n, "backend_type", string(v.BackendType), enumValues21) + w.enumField(n, "backend_type", string(v.BackendType), enumValuesWorkspaceScopeBackendType) if len(v.Permissions) > 0 { c := n.child("permissions") for i0 := range v.Permissions { @@ -1126,8 +1154,8 @@ func enumResourcesSqlWarehouse(w *walker, n *node, v *resources.SqlWarehouse) { enumResourcesSqlWarehousePermission(w, &e, &v.Permissions[i0]) } } - w.enumField(n, "spot_instance_policy", string(v.CreateWarehouseRequest.SpotInstancePolicy), enumValues22) - w.enumField(n, "warehouse_type", string(v.CreateWarehouseRequest.WarehouseType), enumValues23) + w.enumField(n, "spot_instance_policy", string(v.CreateWarehouseRequest.SpotInstancePolicy), enumValuesSqlSpotInstancePolicy) + w.enumField(n, "warehouse_type", string(v.CreateWarehouseRequest.WarehouseType), enumValuesSqlCreateWarehouseRequestWarehouseType) } func enumResourcesSyncedDatabaseTable(w *walker, n *node, v *resources.SyncedDatabaseTable) { @@ -1140,14 +1168,14 @@ func enumResourcesSyncedDatabaseTable(w *walker, n *node, v *resources.SyncedDat if c := n.child("spec"); c.exists() { enumDatabaseSyncedTableSpec(w, &c, v.SyncedDatabaseTable.Spec) } - w.enumField(n, "unity_catalog_provisioning_state", string(v.SyncedDatabaseTable.UnityCatalogProvisioningState), enumValues24) + w.enumField(n, "unity_catalog_provisioning_state", string(v.SyncedDatabaseTable.UnityCatalogProvisioningState), enumValuesDatabaseProvisioningInfoState) } func enumResourcesVectorSearchEndpoint(w *walker, n *node, v *resources.VectorSearchEndpoint) { if v == nil { v = &resources.VectorSearchEndpoint{} } - w.enumField(n, "endpoint_type", string(v.CreateEndpoint.EndpointType), enumValues25) + w.enumField(n, "endpoint_type", string(v.CreateEndpoint.EndpointType), enumValuesVectorsearchEndpointType) if len(v.Permissions) > 0 { c := n.child("permissions") for i0 := range v.Permissions { @@ -1171,8 +1199,8 @@ func enumResourcesVectorSearchIndex(w *walker, n *node, v *resources.VectorSearc enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i0]) } } - w.enumField(n, "index_subtype", string(v.CreateVectorIndexRequest.IndexSubtype), enumValues26) - w.enumField(n, "index_type", string(v.CreateVectorIndexRequest.IndexType), enumValues27) + w.enumField(n, "index_subtype", string(v.CreateVectorIndexRequest.IndexSubtype), enumValuesVectorsearchIndexSubtype) + w.enumField(n, "index_type", string(v.CreateVectorIndexRequest.IndexType), enumValuesVectorsearchVectorIndexType) } func enumResourcesVolume(w *walker, n *node, v *resources.Volume) { @@ -1186,19 +1214,19 @@ func enumResourcesVolume(w *walker, n *node, v *resources.Volume) { enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i0]) } } - w.enumField(n, "volume_type", string(v.CreateVolumeRequestContent.VolumeType), enumValues28) + w.enumField(n, "volume_type", string(v.CreateVolumeRequestContent.VolumeType), enumValuesCatalogVolumeType) } func enumSqlAlertV2Evaluation(w *walker, n *node, v *sql.AlertV2Evaluation) { if v == nil { v = &sql.AlertV2Evaluation{} } - w.enumField(n, "comparison_operator", string(v.ComparisonOperator), enumValues29) - w.enumField(n, "empty_result_state", string(v.EmptyResultState), enumValues30) + w.enumField(n, "comparison_operator", string(v.ComparisonOperator), enumValuesSqlComparisonOperator) + w.enumField(n, "empty_result_state", string(v.EmptyResultState), enumValuesSqlAlertEvaluationState) if c := n.child("source"); c.exists() { enumSqlAlertV2OperandColumn(w, &c, &v.Source) } - w.enumField(n, "state", string(v.State), enumValues30) + w.enumField(n, "state", string(v.State), enumValuesSqlAlertEvaluationState) if c := n.child("threshold"); c.exists() { enumSqlAlertV2Operand(w, &c, v.Threshold) } @@ -1208,14 +1236,14 @@ func enumSqlCronSchedule(w *walker, n *node, v *sql.CronSchedule) { if v == nil { v = &sql.CronSchedule{} } - w.enumField(n, "pause_status", string(v.PauseStatus), enumValues31) + w.enumField(n, "pause_status", string(v.PauseStatus), enumValuesSqlSchedulePauseStatus) } func enumAppsAppDeployment(w *walker, n *node, v *apps.AppDeployment) { if v == nil { v = &apps.AppDeployment{} } - w.enumField(n, "mode", string(v.Mode), enumValues32) + w.enumField(n, "mode", string(v.Mode), enumValuesAppsAppDeploymentMode) if c := n.child("status"); c.exists() { enumAppsAppDeploymentStatus(w, &c, v.Status) } @@ -1225,21 +1253,21 @@ func enumAppsApplicationStatus(w *walker, n *node, v *apps.ApplicationStatus) { if v == nil { v = &apps.ApplicationStatus{} } - w.enumField(n, "state", string(v.State), enumValues33) + w.enumField(n, "state", string(v.State), enumValuesAppsApplicationState) } func enumAppsComputeStatus(w *walker, n *node, v *apps.ComputeStatus) { if v == nil { v = &apps.ComputeStatus{} } - w.enumField(n, "state", string(v.State), enumValues34) + w.enumField(n, "state", string(v.State), enumValuesAppsComputeState) } func enumResourcesAppPermission(w *walker, n *node, v *resources.AppPermission) { if v == nil { v = &resources.AppPermission{} } - w.enumField(n, "level", string(v.Level), enumValues35) + w.enumField(n, "level", string(v.Level), enumValuesAppsAppPermissionLevel) } func enumAppsAppResource(w *walker, n *node, v *apps.AppResource) { @@ -1286,7 +1314,7 @@ func enumCatalogPrivilegeAssignment(w *walker, n *node, v *catalog.PrivilegeAssi c := n.child("privileges") for i0 := range v.Privileges { e := c.elem(i0) - w.enumElem(&e, string(v.Privileges[i0]), enumValues36) + w.enumElem(&e, string(v.Privileges[i0]), enumValuesCatalogPrivilege) } } } @@ -1295,44 +1323,44 @@ func enumResourcesClusterPolicyPermission(w *walker, n *node, v *resources.Clust if v == nil { v = &resources.ClusterPolicyPermission{} } - w.enumField(n, "level", string(v.Level), enumValues37) + w.enumField(n, "level", string(v.Level), enumValuesComputeClusterPolicyPermissionLevel) } func enumComputeAwsAttributes(w *walker, n *node, v *compute.AwsAttributes) { if v == nil { v = &compute.AwsAttributes{} } - w.enumField(n, "availability", string(v.Availability), enumValues38) - w.enumField(n, "ebs_volume_type", string(v.EbsVolumeType), enumValues39) + w.enumField(n, "availability", string(v.Availability), enumValuesComputeAwsAvailability) + w.enumField(n, "ebs_volume_type", string(v.EbsVolumeType), enumValuesComputeEbsVolumeType) } func enumComputeAzureAttributes(w *walker, n *node, v *compute.AzureAttributes) { if v == nil { v = &compute.AzureAttributes{} } - w.enumField(n, "availability", string(v.Availability), enumValues40) + w.enumField(n, "availability", string(v.Availability), enumValuesComputeAzureAvailability) } func enumComputeGcpAttributes(w *walker, n *node, v *compute.GcpAttributes) { if v == nil { v = &compute.GcpAttributes{} } - w.enumField(n, "availability", string(v.Availability), enumValues41) - w.enumField(n, "confidential_compute_type", string(v.ConfidentialComputeType), enumValues42) + w.enumField(n, "availability", string(v.Availability), enumValuesComputeGcpAvailability) + w.enumField(n, "confidential_compute_type", string(v.ConfidentialComputeType), enumValuesComputeConfidentialComputeType) } func enumResourcesClusterPermission(w *walker, n *node, v *resources.ClusterPermission) { if v == nil { v = &resources.ClusterPermission{} } - w.enumField(n, "level", string(v.Level), enumValues43) + w.enumField(n, "level", string(v.Level), enumValuesComputeClusterPermissionLevel) } func enumResourcesMlflowExperimentPermission(w *walker, n *node, v *resources.MlflowExperimentPermission) { if v == nil { v = &resources.MlflowExperimentPermission{} } - w.enumField(n, "level", string(v.Level), enumValues44) + w.enumField(n, "level", string(v.Level), enumValuesMlExperimentPermissionLevel) } func enumCatalogEncryptionDetails(w *walker, n *node, v *catalog.EncryptionDetails) { @@ -1348,7 +1376,7 @@ func enumMlFunction(w *walker, n *node, v *ml.Function) { if v == nil { v = &ml.Function{} } - w.enumField(n, "function_type", string(v.FunctionType), enumValues45) + w.enumField(n, "function_type", string(v.FunctionType), enumValuesMlFunctionFunctionType) } func enumMlDataSource(w *walker, n *node, v *ml.DataSource) { @@ -1364,14 +1392,14 @@ func enumComputeInstancePoolAwsAttributes(w *walker, n *node, v *compute.Instanc if v == nil { v = &compute.InstancePoolAwsAttributes{} } - w.enumField(n, "availability", string(v.Availability), enumValues46) + w.enumField(n, "availability", string(v.Availability), enumValuesComputeInstancePoolAwsAttributesAvailability) } func enumComputeInstancePoolAzureAttributes(w *walker, n *node, v *compute.InstancePoolAzureAttributes) { if v == nil { v = &compute.InstancePoolAzureAttributes{} } - w.enumField(n, "availability", string(v.Availability), enumValues47) + w.enumField(n, "availability", string(v.Availability), enumValuesComputeInstancePoolAzureAttributesAvailability) } func enumComputeDiskSpec(w *walker, n *node, v *compute.DiskSpec) { @@ -1387,14 +1415,14 @@ func enumComputeInstancePoolGcpAttributes(w *walker, n *node, v *compute.Instanc if v == nil { v = &compute.InstancePoolGcpAttributes{} } - w.enumField(n, "gcp_availability", string(v.GcpAvailability), enumValues41) + w.enumField(n, "gcp_availability", string(v.GcpAvailability), enumValuesComputeGcpAvailability) } func enumResourcesInstancePoolPermission(w *walker, n *node, v *resources.InstancePoolPermission) { if v == nil { v = &resources.InstancePoolPermission{} } - w.enumField(n, "level", string(v.Level), enumValues48) + w.enumField(n, "level", string(v.Level), enumValuesComputeInstancePoolPermissionLevel) } func enumJobsContinuous(w *walker, n *node, v *jobs.Continuous) { @@ -1404,22 +1432,22 @@ func enumJobsContinuous(w *walker, n *node, v *jobs.Continuous) { if c := n.child("maintenance_window"); c.exists() { enumJobsMaintenanceWindow(w, &c, v.MaintenanceWindow) } - w.enumField(n, "pause_status", string(v.PauseStatus), enumValues31) - w.enumField(n, "task_retry_mode", string(v.TaskRetryMode), enumValues49) + w.enumField(n, "pause_status", string(v.PauseStatus), enumValuesJobsPauseStatus) + w.enumField(n, "task_retry_mode", string(v.TaskRetryMode), enumValuesJobsTaskRetryMode) } func enumJobsJobDeployment(w *walker, n *node, v *jobs.JobDeployment) { if v == nil { v = &jobs.JobDeployment{} } - w.enumField(n, "kind", string(v.Kind), enumValues50) + w.enumField(n, "kind", string(v.Kind), enumValuesJobsJobDeploymentKind) } func enumJobsGitSource(w *walker, n *node, v *jobs.GitSource) { if v == nil { v = &jobs.GitSource{} } - w.enumField(n, "git_provider", string(v.GitProvider), enumValues51) + w.enumField(n, "git_provider", string(v.GitProvider), enumValuesJobsGitProvider) if c := n.child("job_source"); c.exists() { enumJobsJobSource(w, &c, v.JobSource) } @@ -1451,14 +1479,14 @@ func enumResourcesJobPermission(w *walker, n *node, v *resources.JobPermission) if v == nil { v = &resources.JobPermission{} } - w.enumField(n, "level", string(v.Level), enumValues52) + w.enumField(n, "level", string(v.Level), enumValuesJobsJobPermissionLevel) } func enumJobsCronSchedule(w *walker, n *node, v *jobs.CronSchedule) { if v == nil { v = &jobs.CronSchedule{} } - w.enumField(n, "pause_status", string(v.PauseStatus), enumValues31) + w.enumField(n, "pause_status", string(v.PauseStatus), enumValuesJobsPauseStatus) if c := n.child("sql_condition"); c.exists() { enumJobsSqlConditionConfiguration(w, &c, v.SqlCondition) } @@ -1498,7 +1526,7 @@ func enumJobsTask(w *walker, n *node, v *jobs.Task) { if c := n.child("power_bi_task"); c.exists() { enumJobsPowerBiTask(w, &c, v.PowerBiTask) } - w.enumField(n, "run_if", string(v.RunIf), enumValues53) + w.enumField(n, "run_if", string(v.RunIf), enumValuesJobsRunIf) if c := n.child("spark_python_task"); c.exists() { enumJobsSparkPythonTask(w, &c, v.SparkPythonTask) } @@ -1514,7 +1542,7 @@ func enumJobsTriggerSettings(w *walker, n *node, v *jobs.TriggerSettings) { if c := n.child("model"); c.exists() { enumJobsModelTriggerConfiguration(w, &c, v.Model) } - w.enumField(n, "pause_status", string(v.PauseStatus), enumValues31) + w.enumField(n, "pause_status", string(v.PauseStatus), enumValuesJobsPauseStatus) if c := n.child("periodic"); c.exists() { enumJobsPeriodicTriggerConfiguration(w, &c, v.Periodic) } @@ -1536,7 +1564,7 @@ func enumJobsTriggerConfiguration(w *walker, n *node, v *jobs.TriggerConfigurati if c := n.child("model"); c.exists() { enumJobsModelTriggerConfiguration(w, &c, v.Model) } - w.enumField(n, "pause_status", string(v.PauseStatus), enumValues31) + w.enumField(n, "pause_status", string(v.PauseStatus), enumValuesJobsPauseStatus) if c := n.child("periodic"); c.exists() { enumJobsPeriodicTriggerConfiguration(w, &c, v.Periodic) } @@ -1565,7 +1593,7 @@ func enumCatalogModelProviderServiceConfig(w *walker, n *node, v *catalog.ModelP if v == nil { v = &catalog.ModelProviderServiceConfig{} } - w.enumField(n, "provider_type", string(v.ProviderType), enumValues54) + w.enumField(n, "provider_type", string(v.ProviderType), enumValuesCatalogModelProviderServiceConfigExternalModelProviderType) if len(v.RateLimits) > 0 { c := n.child("rate_limits") for i0 := range v.RateLimits { @@ -1631,15 +1659,15 @@ func enumResourcesModelServingEndpointPermission(w *walker, n *node, v *resource if v == nil { v = &resources.ModelServingEndpointPermission{} } - w.enumField(n, "level", string(v.Level), enumValues55) + w.enumField(n, "level", string(v.Level), enumValuesServingServingEndpointPermissionLevel) } func enumServingRateLimit(w *walker, n *node, v *serving.RateLimit) { if v == nil { v = &serving.RateLimit{} } - w.enumField(n, "key", string(v.Key), enumValues56) - w.enumField(n, "renewal_period", string(v.RenewalPeriod), enumValues57) + w.enumField(n, "key", string(v.Key), enumValuesServingRateLimitKey) + w.enumField(n, "renewal_period", string(v.RenewalPeriod), enumValuesServingRateLimitRenewalPeriod) } func enumServingTelemetryConfig(w *walker, n *node, v *serving.TelemetryConfig) { @@ -1650,7 +1678,7 @@ func enumServingTelemetryConfig(w *walker, n *node, v *serving.TelemetryConfig) c := n.child("enabled_telemetry_features") for i0 := range v.EnabledTelemetryFeatures { e := c.elem(i0) - w.enumElem(&e, string(v.EnabledTelemetryFeatures[i0]), enumValues58) + w.enumElem(&e, string(v.EnabledTelemetryFeatures[i0]), enumValuesServingTelemetryFeature) } } } @@ -1659,7 +1687,7 @@ func enumResourcesMlflowModelPermission(w *walker, n *node, v *resources.MlflowM if v == nil { v = &resources.MlflowModelPermission{} } - w.enumField(n, "level", string(v.Level), enumValues59) + w.enumField(n, "level", string(v.Level), enumValuesMlRegisteredModelPermissionLevel) } func enumPipelinesPipelineCluster(w *walker, n *node, v *pipelines.PipelineCluster) { @@ -1684,14 +1712,14 @@ func enumPipelinesPipelineDeployment(w *walker, n *node, v *pipelines.PipelineDe if v == nil { v = &pipelines.PipelineDeployment{} } - w.enumField(n, "kind", string(v.Kind), enumValues60) + w.enumField(n, "kind", string(v.Kind), enumValuesPipelinesDeploymentKind) } func enumPipelinesIngestionPipelineDefinition(w *walker, n *node, v *pipelines.IngestionPipelineDefinition) { if v == nil { v = &pipelines.IngestionPipelineDefinition{} } - w.enumField(n, "connector_type", string(v.ConnectorType), enumValues61) + w.enumField(n, "connector_type", string(v.ConnectorType), enumValuesPipelinesConnectorType) if c := n.child("full_refresh_window"); c.exists() { enumPipelinesOperationTimeWindow(w, &c, v.FullRefreshWindow) } @@ -1702,7 +1730,7 @@ func enumPipelinesIngestionPipelineDefinition(w *walker, n *node, v *pipelines.I enumPipelinesIngestionConfig(w, &e, &v.Objects[i0]) } } - w.enumField(n, "source_type", string(v.SourceType), enumValues62) + w.enumField(n, "source_type", string(v.SourceType), enumValuesPipelinesIngestionSourceType) if c := n.child("table_configuration"); c.exists() { enumPipelinesTableSpecificConfig(w, &c, v.TableConfiguration) } @@ -1712,7 +1740,7 @@ func enumResourcesPipelinePermission(w *walker, n *node, v *resources.PipelinePe if v == nil { v = &resources.PipelinePermission{} } - w.enumField(n, "level", string(v.Level), enumValues63) + w.enumField(n, "level", string(v.Level), enumValuesPipelinesPipelinePermissionLevel) } func enumPipelinesRestartWindow(w *walker, n *node, v *pipelines.RestartWindow) { @@ -1723,7 +1751,7 @@ func enumPipelinesRestartWindow(w *walker, n *node, v *pipelines.RestartWindow) c := n.child("days_of_week") for i0 := range v.DaysOfWeek { e := c.elem(i0) - w.enumElem(&e, string(v.DaysOfWeek[i0]), enumValues64) + w.enumElem(&e, string(v.DaysOfWeek[i0]), enumValuesPipelinesDayOfWeek) } } } @@ -1741,63 +1769,63 @@ func enumPostgresSyncedTableSyncedTableSpecExtraColumn(w *walker, n *node, v *po if v == nil { v = &postgres.SyncedTableSyncedTableSpecExtraColumn{} } - w.enumField(n, "maintenance", string(v.Maintenance), enumValues65) + w.enumField(n, "maintenance", string(v.Maintenance), enumValuesPostgresSyncedTableSyncedTableSpecExtraColumnMaintenance) } func enumPostgresNewPipelineSpec(w *walker, n *node, v *postgres.NewPipelineSpec) { if v == nil { v = &postgres.NewPipelineSpec{} } - w.enumField(n, "pipeline_channel", string(v.PipelineChannel), enumValues66) + w.enumField(n, "pipeline_channel", string(v.PipelineChannel), enumValuesPostgresNewPipelineSpecPipelineChannel) } func enumPostgresSyncedTableSyncedTableSpecTypeOverride(w *walker, n *node, v *postgres.SyncedTableSyncedTableSpecTypeOverride) { if v == nil { v = &postgres.SyncedTableSyncedTableSpecTypeOverride{} } - w.enumField(n, "pg_type", string(v.PgType), enumValues67) + w.enumField(n, "pg_type", string(v.PgType), enumValuesPostgresSyncedTableSyncedTableSpecPgSpecificType) } func enumCatalogMonitorMetric(w *walker, n *node, v *catalog.MonitorMetric) { if v == nil { v = &catalog.MonitorMetric{} } - w.enumField(n, "type", string(v.Type), enumValues68) + w.enumField(n, "type", string(v.Type), enumValuesCatalogMonitorMetricType) } func enumCatalogMonitorInferenceLog(w *walker, n *node, v *catalog.MonitorInferenceLog) { if v == nil { v = &catalog.MonitorInferenceLog{} } - w.enumField(n, "problem_type", string(v.ProblemType), enumValues69) + w.enumField(n, "problem_type", string(v.ProblemType), enumValuesCatalogMonitorInferenceLogProblemType) } func enumCatalogMonitorCronSchedule(w *walker, n *node, v *catalog.MonitorCronSchedule) { if v == nil { v = &catalog.MonitorCronSchedule{} } - w.enumField(n, "pause_status", string(v.PauseStatus), enumValues70) + w.enumField(n, "pause_status", string(v.PauseStatus), enumValuesCatalogMonitorCronSchedulePauseStatus) } func enumResourcesSecretScopePermission(w *walker, n *node, v *resources.SecretScopePermission) { if v == nil { v = &resources.SecretScopePermission{} } - w.enumField(n, "level", string(v.Level), enumValues71) + w.enumField(n, "level", string(v.Level), enumValuesResourcesSecretScopePermissionLevel) } func enumSqlChannel(w *walker, n *node, v *sql.Channel) { if v == nil { v = &sql.Channel{} } - w.enumField(n, "name", string(v.Name), enumValues72) + w.enumField(n, "name", string(v.Name), enumValuesSqlChannelName) } func enumResourcesSqlWarehousePermission(w *walker, n *node, v *resources.SqlWarehousePermission) { if v == nil { v = &resources.SqlWarehousePermission{} } - w.enumField(n, "level", string(v.Level), enumValues73) + w.enumField(n, "level", string(v.Level), enumValuesSqlWarehousePermissionLevel) } func enumDatabaseSyncedTableStatus(w *walker, n *node, v *database.SyncedTableStatus) { @@ -1807,7 +1835,7 @@ func enumDatabaseSyncedTableStatus(w *walker, n *node, v *database.SyncedTableSt if c := n.child("continuous_update_status"); c.exists() { enumDatabaseSyncedTableContinuousUpdateStatus(w, &c, v.ContinuousUpdateStatus) } - w.enumField(n, "detailed_state", string(v.DetailedState), enumValues74) + w.enumField(n, "detailed_state", string(v.DetailedState), enumValuesDatabaseSyncedTableState) if c := n.child("provisioning_status"); c.exists() { enumDatabaseSyncedTableProvisioningStatus(w, &c, v.ProvisioningStatus) } @@ -1820,7 +1848,7 @@ func enumDatabaseSyncedTableSpec(w *walker, n *node, v *database.SyncedTableSpec if v == nil { v = &database.SyncedTableSpec{} } - w.enumField(n, "scheduling_policy", string(v.SchedulingPolicy), enumValues20) + w.enumField(n, "scheduling_policy", string(v.SchedulingPolicy), enumValuesDatabaseSyncedTableSchedulingPolicy) if len(v.TypeOverrides) > 0 { c := n.child("type_overrides") for i0 := range v.TypeOverrides { @@ -1834,21 +1862,21 @@ func enumResourcesVectorSearchEndpointPermission(w *walker, n *node, v *resource if v == nil { v = &resources.VectorSearchEndpointPermission{} } - w.enumField(n, "level", string(v.Level), enumValues75) + w.enumField(n, "level", string(v.Level), enumValuesVectorsearchVectorSearchEndpointPermissionLevel) } func enumVectorsearchDeltaSyncVectorIndexSpecRequest(w *walker, n *node, v *vectorsearch.DeltaSyncVectorIndexSpecRequest) { if v == nil { v = &vectorsearch.DeltaSyncVectorIndexSpecRequest{} } - w.enumField(n, "pipeline_type", string(v.PipelineType), enumValues76) + w.enumField(n, "pipeline_type", string(v.PipelineType), enumValuesVectorsearchPipelineType) } func enumSqlAlertV2OperandColumn(w *walker, n *node, v *sql.AlertV2OperandColumn) { if v == nil { v = &sql.AlertV2OperandColumn{} } - w.enumField(n, "aggregation", string(v.Aggregation), enumValues77) + w.enumField(n, "aggregation", string(v.Aggregation), enumValuesSqlAggregation) } func enumSqlAlertV2Operand(w *walker, n *node, v *sql.AlertV2Operand) { @@ -1864,85 +1892,85 @@ func enumAppsAppDeploymentStatus(w *walker, n *node, v *apps.AppDeploymentStatus if v == nil { v = &apps.AppDeploymentStatus{} } - w.enumField(n, "state", string(v.State), enumValues78) + w.enumField(n, "state", string(v.State), enumValuesAppsAppDeploymentState) } func enumAppsAppResourceApp(w *walker, n *node, v *apps.AppResourceApp) { if v == nil { v = &apps.AppResourceApp{} } - w.enumField(n, "permission", string(v.Permission), enumValues37) + w.enumField(n, "permission", string(v.Permission), enumValuesAppsAppResourceAppAppPermission) } func enumAppsAppResourceDatabase(w *walker, n *node, v *apps.AppResourceDatabase) { if v == nil { v = &apps.AppResourceDatabase{} } - w.enumField(n, "permission", string(v.Permission), enumValues79) + w.enumField(n, "permission", string(v.Permission), enumValuesAppsAppResourceDatabaseDatabasePermission) } func enumAppsAppResourceExperiment(w *walker, n *node, v *apps.AppResourceExperiment) { if v == nil { v = &apps.AppResourceExperiment{} } - w.enumField(n, "permission", string(v.Permission), enumValues44) + w.enumField(n, "permission", string(v.Permission), enumValuesAppsAppResourceExperimentExperimentPermission) } func enumAppsAppResourceGenieSpace(w *walker, n *node, v *apps.AppResourceGenieSpace) { if v == nil { v = &apps.AppResourceGenieSpace{} } - w.enumField(n, "permission", string(v.Permission), enumValues80) + w.enumField(n, "permission", string(v.Permission), enumValuesAppsAppResourceGenieSpaceGenieSpacePermission) } func enumAppsAppResourceJob(w *walker, n *node, v *apps.AppResourceJob) { if v == nil { v = &apps.AppResourceJob{} } - w.enumField(n, "permission", string(v.Permission), enumValues52) + w.enumField(n, "permission", string(v.Permission), enumValuesAppsAppResourceJobJobPermission) } func enumAppsAppResourcePostgres(w *walker, n *node, v *apps.AppResourcePostgres) { if v == nil { v = &apps.AppResourcePostgres{} } - w.enumField(n, "permission", string(v.Permission), enumValues79) + w.enumField(n, "permission", string(v.Permission), enumValuesAppsAppResourcePostgresPostgresPermission) } func enumAppsAppResourceSecret(w *walker, n *node, v *apps.AppResourceSecret) { if v == nil { v = &apps.AppResourceSecret{} } - w.enumField(n, "permission", string(v.Permission), enumValues81) + w.enumField(n, "permission", string(v.Permission), enumValuesAppsAppResourceSecretSecretPermission) } func enumAppsAppResourceServingEndpoint(w *walker, n *node, v *apps.AppResourceServingEndpoint) { if v == nil { v = &apps.AppResourceServingEndpoint{} } - w.enumField(n, "permission", string(v.Permission), enumValues55) + w.enumField(n, "permission", string(v.Permission), enumValuesAppsAppResourceServingEndpointServingEndpointPermission) } func enumAppsAppResourceSqlWarehouse(w *walker, n *node, v *apps.AppResourceSqlWarehouse) { if v == nil { v = &apps.AppResourceSqlWarehouse{} } - w.enumField(n, "permission", string(v.Permission), enumValues82) + w.enumField(n, "permission", string(v.Permission), enumValuesAppsAppResourceSqlWarehouseSqlWarehousePermission) } func enumAppsAppResourceUcSecurable(w *walker, n *node, v *apps.AppResourceUcSecurable) { if v == nil { v = &apps.AppResourceUcSecurable{} } - w.enumField(n, "permission", string(v.Permission), enumValues83) - w.enumField(n, "securable_type", string(v.SecurableType), enumValues84) + w.enumField(n, "permission", string(v.Permission), enumValuesAppsAppResourceUcSecurableUcSecurablePermission) + w.enumField(n, "securable_type", string(v.SecurableType), enumValuesAppsAppResourceUcSecurableUcSecurableType) } func enumCatalogSseEncryptionDetails(w *walker, n *node, v *catalog.SseEncryptionDetails) { if v == nil { v = &catalog.SseEncryptionDetails{} } - w.enumField(n, "algorithm", string(v.Algorithm), enumValues85) + w.enumField(n, "algorithm", string(v.Algorithm), enumValuesCatalogSseEncryptionDetailsAlgorithm) } func enumMlRequestSource(w *walker, n *node, v *ml.RequestSource) { @@ -1958,30 +1986,30 @@ func enumComputeDiskType(w *walker, n *node, v *compute.DiskType) { if v == nil { v = &compute.DiskType{} } - w.enumField(n, "azure_disk_volume_type", string(v.AzureDiskVolumeType), enumValues86) - w.enumField(n, "ebs_volume_type", string(v.EbsVolumeType), enumValues39) + w.enumField(n, "azure_disk_volume_type", string(v.AzureDiskVolumeType), enumValuesComputeDiskTypeAzureDiskVolumeType) + w.enumField(n, "ebs_volume_type", string(v.EbsVolumeType), enumValuesComputeDiskTypeEbsVolumeType) } func enumJobsMaintenanceWindow(w *walker, n *node, v *jobs.MaintenanceWindow) { if v == nil { v = &jobs.MaintenanceWindow{} } - w.enumField(n, "day_of_week", string(v.DayOfWeek), enumValues64) + w.enumField(n, "day_of_week", string(v.DayOfWeek), enumValuesJobsDayOfWeek) } func enumJobsJobSource(w *walker, n *node, v *jobs.JobSource) { if v == nil { v = &jobs.JobSource{} } - w.enumField(n, "dirty_state", string(v.DirtyState), enumValues87) + w.enumField(n, "dirty_state", string(v.DirtyState), enumValuesJobsJobSourceDirtyState) } func enumJobsJobsHealthRule(w *walker, n *node, v *jobs.JobsHealthRule) { if v == nil { v = &jobs.JobsHealthRule{} } - w.enumField(n, "metric", string(v.Metric), enumValues88) - w.enumField(n, "op", string(v.Op), enumValues89) + w.enumField(n, "metric", string(v.Metric), enumValuesJobsJobsHealthMetric) + w.enumField(n, "op", string(v.Op), enumValuesJobsJobsHealthOperator) } func enumComputeClusterSpec(w *walker, n *node, v *compute.ClusterSpec) { @@ -1994,20 +2022,20 @@ func enumComputeClusterSpec(w *walker, n *node, v *compute.ClusterSpec) { if c := n.child("azure_attributes"); c.exists() { enumComputeAzureAttributes(w, &c, v.AzureAttributes) } - w.enumField(n, "data_security_mode", string(v.DataSecurityMode), enumValues7) - w.enumField(n, "dependency_mode", string(v.DependencyMode), enumValues8) + w.enumField(n, "data_security_mode", string(v.DataSecurityMode), enumValuesComputeDataSecurityMode) + w.enumField(n, "dependency_mode", string(v.DependencyMode), enumValuesComputeDependencyMode) if c := n.child("gcp_attributes"); c.exists() { enumComputeGcpAttributes(w, &c, v.GcpAttributes) } - w.enumField(n, "kind", string(v.Kind), enumValues9) - w.enumField(n, "runtime_engine", string(v.RuntimeEngine), enumValues10) + w.enumField(n, "kind", string(v.Kind), enumValuesComputeKind) + w.enumField(n, "runtime_engine", string(v.RuntimeEngine), enumValuesComputeRuntimeEngine) } func enumJobsSqlConditionConfiguration(w *walker, n *node, v *jobs.SqlConditionConfiguration) { if v == nil { v = &jobs.SqlConditionConfiguration{} } - w.enumField(n, "trigger_mode", string(v.TriggerMode), enumValues90) + w.enumField(n, "trigger_mode", string(v.TriggerMode), enumValuesJobsSqlConditionTriggerMode) } func enumJobsAiRuntimeTask(w *walker, n *node, v *jobs.AiRuntimeTask) { @@ -2021,28 +2049,28 @@ func enumJobsAiRuntimeTask(w *walker, n *node, v *jobs.AiRuntimeTask) { enumJobsDeploymentSpec(w, &e, &v.Deployments[i0]) } } - w.enumField(n, "priority_class", string(v.PriorityClass), enumValues91) + w.enumField(n, "priority_class", string(v.PriorityClass), enumValuesJobsAiRuntimeTaskPriorityClass) } func enumJobsCompute(w *walker, n *node, v *jobs.Compute) { if v == nil { v = &jobs.Compute{} } - w.enumField(n, "hardware_accelerator", string(v.HardwareAccelerator), enumValues92) + w.enumField(n, "hardware_accelerator", string(v.HardwareAccelerator), enumValuesComputeHardwareAcceleratorType) } func enumJobsConditionTask(w *walker, n *node, v *jobs.ConditionTask) { if v == nil { v = &jobs.ConditionTask{} } - w.enumField(n, "op", string(v.Op), enumValues93) + w.enumField(n, "op", string(v.Op), enumValuesJobsConditionTaskOp) } func enumJobsDbtTask(w *walker, n *node, v *jobs.DbtTask) { if v == nil { v = &jobs.DbtTask{} } - w.enumField(n, "source", string(v.Source), enumValues94) + w.enumField(n, "source", string(v.Source), enumValuesJobsSource) } func enumJobsForEachTask(w *walker, n *node, v *jobs.ForEachTask) { @@ -2058,14 +2086,14 @@ func enumJobsGenAiComputeTask(w *walker, n *node, v *jobs.GenAiComputeTask) { if v == nil { v = &jobs.GenAiComputeTask{} } - w.enumField(n, "source", string(v.Source), enumValues94) + w.enumField(n, "source", string(v.Source), enumValuesJobsSource) } func enumJobsNotebookTask(w *walker, n *node, v *jobs.NotebookTask) { if v == nil { v = &jobs.NotebookTask{} } - w.enumField(n, "source", string(v.Source), enumValues94) + w.enumField(n, "source", string(v.Source), enumValuesJobsSource) } func enumJobsPowerBiTask(w *walker, n *node, v *jobs.PowerBiTask) { @@ -2088,7 +2116,7 @@ func enumJobsSparkPythonTask(w *walker, n *node, v *jobs.SparkPythonTask) { if v == nil { v = &jobs.SparkPythonTask{} } - w.enumField(n, "source", string(v.Source), enumValues94) + w.enumField(n, "source", string(v.Source), enumValuesJobsSource) } func enumJobsSqlTask(w *walker, n *node, v *jobs.SqlTask) { @@ -2104,21 +2132,21 @@ func enumJobsModelTriggerConfiguration(w *walker, n *node, v *jobs.ModelTriggerC if v == nil { v = &jobs.ModelTriggerConfiguration{} } - w.enumField(n, "condition", string(v.Condition), enumValues95) + w.enumField(n, "condition", string(v.Condition), enumValuesJobsModelTriggerConfigurationCondition) } func enumJobsPeriodicTriggerConfiguration(w *walker, n *node, v *jobs.PeriodicTriggerConfiguration) { if v == nil { v = &jobs.PeriodicTriggerConfiguration{} } - w.enumField(n, "unit", string(v.Unit), enumValues96) + w.enumField(n, "unit", string(v.Unit), enumValuesJobsPeriodicTriggerConfigurationTimeUnit) } func enumJobsTableUpdateTriggerConfiguration(w *walker, n *node, v *jobs.TableUpdateTriggerConfiguration) { if v == nil { v = &jobs.TableUpdateTriggerConfiguration{} } - w.enumField(n, "condition", string(v.Condition), enumValues97) + w.enumField(n, "condition", string(v.Condition), enumValuesJobsCondition) } func enumJobsContinuousTriggerConfiguration(w *walker, n *node, v *jobs.ContinuousTriggerConfiguration) { @@ -2128,15 +2156,15 @@ func enumJobsContinuousTriggerConfiguration(w *walker, n *node, v *jobs.Continuo if c := n.child("maintenance_window"); c.exists() { enumJobsMaintenanceWindow(w, &c, v.MaintenanceWindow) } - w.enumField(n, "task_retry_mode", string(v.TaskRetryMode), enumValues49) + w.enumField(n, "task_retry_mode", string(v.TaskRetryMode), enumValuesJobsTaskRetryMode) } func enumCatalogRateLimit(w *walker, n *node, v *catalog.RateLimit) { if v == nil { v = &catalog.RateLimit{} } - w.enumField(n, "key", string(v.Key), enumValues98) - w.enumField(n, "renewal_period", string(v.RenewalPeriod), enumValues99) + w.enumField(n, "key", string(v.Key), enumValuesCatalogRateLimitRateLimitKey) + w.enumField(n, "renewal_period", string(v.RenewalPeriod), enumValuesCatalogRateLimitRateLimitRenewalPeriod) } func enumCatalogModelServiceConfigRoutingConfig(w *walker, n *node, v *catalog.ModelServiceConfigRoutingConfig) { @@ -2171,8 +2199,8 @@ func enumServingAiGatewayRateLimit(w *walker, n *node, v *serving.AiGatewayRateL if v == nil { v = &serving.AiGatewayRateLimit{} } - w.enumField(n, "key", string(v.Key), enumValues100) - w.enumField(n, "renewal_period", string(v.RenewalPeriod), enumValues57) + w.enumField(n, "key", string(v.Key), enumValuesServingAiGatewayRateLimitKey) + w.enumField(n, "renewal_period", string(v.RenewalPeriod), enumValuesServingAiGatewayRateLimitRenewalPeriod) } func enumServingServedEntityInput(w *walker, n *node, v *serving.ServedEntityInput) { @@ -2182,21 +2210,21 @@ func enumServingServedEntityInput(w *walker, n *node, v *serving.ServedEntityInp if c := n.child("external_model"); c.exists() { enumServingExternalModel(w, &c, v.ExternalModel) } - w.enumField(n, "workload_type", string(v.WorkloadType), enumValues101) + w.enumField(n, "workload_type", string(v.WorkloadType), enumValuesServingServingModelWorkloadType) } func enumServingServedModelInput(w *walker, n *node, v *serving.ServedModelInput) { if v == nil { v = &serving.ServedModelInput{} } - w.enumField(n, "workload_type", string(v.WorkloadType), enumValues101) + w.enumField(n, "workload_type", string(v.WorkloadType), enumValuesServingServedModelInputWorkloadType) } func enumPipelinesPipelineClusterAutoscale(w *walker, n *node, v *pipelines.PipelineClusterAutoscale) { if v == nil { v = &pipelines.PipelineClusterAutoscale{} } - w.enumField(n, "mode", string(v.Mode), enumValues102) + w.enumField(n, "mode", string(v.Mode), enumValuesPipelinesPipelineClusterAutoscaleMode) } func enumPipelinesOperationTimeWindow(w *walker, n *node, v *pipelines.OperationTimeWindow) { @@ -2207,7 +2235,7 @@ func enumPipelinesOperationTimeWindow(w *walker, n *node, v *pipelines.Operation c := n.child("days_of_week") for i0 := range v.DaysOfWeek { e := c.elem(i0) - w.enumElem(&e, string(v.DaysOfWeek[i0]), enumValues64) + w.enumElem(&e, string(v.DaysOfWeek[i0]), enumValuesPipelinesDayOfWeek) } } } @@ -2231,14 +2259,14 @@ func enumPipelinesTableSpecificConfig(w *walker, n *node, v *pipelines.TableSpec if v == nil { v = &pipelines.TableSpecificConfig{} } - w.enumField(n, "scd_type", string(v.ScdType), enumValues103) + w.enumField(n, "scd_type", string(v.ScdType), enumValuesPipelinesTableSpecificConfigScdType) } func enumPostgresWeeklySchedule(w *walker, n *node, v *postgres.WeeklySchedule) { if v == nil { v = &postgres.WeeklySchedule{} } - w.enumField(n, "day_of_week", string(v.DayOfWeek), enumValues64) + w.enumField(n, "day_of_week", string(v.DayOfWeek), enumValuesPostgresDayOfWeek) } func enumDatabaseSyncedTableContinuousUpdateStatus(w *walker, n *node, v *database.SyncedTableContinuousUpdateStatus) { @@ -2272,14 +2300,14 @@ func enumDatabaseSyncedTableSpecTypeOverride(w *walker, n *node, v *database.Syn if v == nil { v = &database.SyncedTableSpecTypeOverride{} } - w.enumField(n, "pg_type", string(v.PgType), enumValues67) + w.enumField(n, "pg_type", string(v.PgType), enumValuesDatabaseSyncedTableSpecPgSpecificType) } func enumSqlAlertV2OperandColumn2(w *walker, n *node, v *sql.AlertV2OperandColumn) { if v == nil { v = &sql.AlertV2OperandColumn{} } - w.enumField(n, "aggregation", string(v.Aggregation), enumValues77) + w.enumField(n, "aggregation", string(v.Aggregation), enumValuesSqlAggregation) } func enumMlFlatSchema(w *walker, n *node, v *ml.FlatSchema) { @@ -2335,7 +2363,7 @@ func enumJobsTask2(w *walker, n *node, v *jobs.Task) { if c := n.child("power_bi_task"); c.exists() { enumJobsPowerBiTask(w, &c, v.PowerBiTask) } - w.enumField(n, "run_if", string(v.RunIf), enumValues53) + w.enumField(n, "run_if", string(v.RunIf), enumValuesJobsRunIf) if c := n.child("spark_python_task"); c.exists() { enumJobsSparkPythonTask(w, &c, v.SparkPythonTask) } @@ -2348,29 +2376,29 @@ func enumJobsPowerBiModel(w *walker, n *node, v *jobs.PowerBiModel) { if v == nil { v = &jobs.PowerBiModel{} } - w.enumField(n, "authentication_method", string(v.AuthenticationMethod), enumValues104) - w.enumField(n, "storage_mode", string(v.StorageMode), enumValues105) + w.enumField(n, "authentication_method", string(v.AuthenticationMethod), enumValuesJobsAuthenticationMethod) + w.enumField(n, "storage_mode", string(v.StorageMode), enumValuesJobsStorageMode) } func enumJobsPowerBiTable(w *walker, n *node, v *jobs.PowerBiTable) { if v == nil { v = &jobs.PowerBiTable{} } - w.enumField(n, "storage_mode", string(v.StorageMode), enumValues105) + w.enumField(n, "storage_mode", string(v.StorageMode), enumValuesJobsStorageMode) } func enumJobsSqlTaskFile(w *walker, n *node, v *jobs.SqlTaskFile) { if v == nil { v = &jobs.SqlTaskFile{} } - w.enumField(n, "source", string(v.Source), enumValues94) + w.enumField(n, "source", string(v.Source), enumValuesJobsSource) } func enumCatalogModelServiceConfigDestinationConfig(w *walker, n *node, v *catalog.ModelServiceConfigDestinationConfig) { if v == nil { v = &catalog.ModelServiceConfigDestinationConfig{} } - w.enumField(n, "destination_type", string(v.DestinationType), enumValues106) + w.enumField(n, "destination_type", string(v.DestinationType), enumValuesCatalogModelServiceConfigDestinationConfigDestinationType) } func enumCatalogModelServiceConfigFallbackConfig(w *walker, n *node, v *catalog.ModelServiceConfigFallbackConfig) { @@ -2402,7 +2430,7 @@ func enumServingExternalModel(w *walker, n *node, v *serving.ExternalModel) { if c := n.child("amazon_bedrock_config"); c.exists() { enumServingAmazonBedrockConfig(w, &c, v.AmazonBedrockConfig) } - w.enumField(n, "provider", string(v.Provider), enumValues107) + w.enumField(n, "provider", string(v.Provider), enumValuesServingExternalModelProvider) } func enumPipelinesReportSpec(w *walker, n *node, v *pipelines.ReportSpec) { @@ -2445,35 +2473,35 @@ func enumDatabaseSyncedTablePipelineProgress(w *walker, n *node, v *database.Syn if v == nil { v = &database.SyncedTablePipelineProgress{} } - w.enumField(n, "provisioning_phase", string(v.ProvisioningPhase), enumValues108) + w.enumField(n, "provisioning_phase", string(v.ProvisioningPhase), enumValuesDatabaseProvisioningPhase) } func enumMlFieldDefinition(w *walker, n *node, v *ml.FieldDefinition) { if v == nil { v = &ml.FieldDefinition{} } - w.enumField(n, "data_type", string(v.DataType), enumValues109) + w.enumField(n, "data_type", string(v.DataType), enumValuesMlScalarDataType) } func enumJobsComputeSpec(w *walker, n *node, v *jobs.ComputeSpec) { if v == nil { v = &jobs.ComputeSpec{} } - w.enumField(n, "accelerator_type", string(v.AcceleratorType), enumValues92) + w.enumField(n, "accelerator_type", string(v.AcceleratorType), enumValuesJobsComputeSpecAcceleratorType) } func enumServingAiGatewayGuardrailPiiBehavior(w *walker, n *node, v *serving.AiGatewayGuardrailPiiBehavior) { if v == nil { v = &serving.AiGatewayGuardrailPiiBehavior{} } - w.enumField(n, "behavior", string(v.Behavior), enumValues110) + w.enumField(n, "behavior", string(v.Behavior), enumValuesServingAiGatewayGuardrailPiiBehaviorBehavior) } func enumServingAmazonBedrockConfig(w *walker, n *node, v *serving.AmazonBedrockConfig) { if v == nil { v = &serving.AmazonBedrockConfig{} } - w.enumField(n, "bedrock_provider", string(v.BedrockProvider), enumValues111) + w.enumField(n, "bedrock_provider", string(v.BedrockProvider), enumValuesServingAmazonBedrockConfigBedrockProvider) } func enumPipelinesConnectorOptions(w *walker, n *node, v *pipelines.ConnectorOptions) { @@ -2517,7 +2545,7 @@ func enumPipelinesGoogleDriveOptions(w *walker, n *node, v *pipelines.GoogleDriv if v == nil { v = &pipelines.GoogleDriveOptions{} } - w.enumField(n, "entity_type", string(v.EntityType), enumValues112) + w.enumField(n, "entity_type", string(v.EntityType), enumValuesPipelinesGoogleDriveOptionsGoogleDriveEntityType) if c := n.child("file_ingestion_options"); c.exists() { enumPipelinesFileIngestionOptions(w, &c, v.FileIngestionOptions) } @@ -2548,15 +2576,15 @@ func enumPipelinesOutlookOptions(w *walker, n *node, v *pipelines.OutlookOptions if v == nil { v = &pipelines.OutlookOptions{} } - w.enumField(n, "attachment_mode", string(v.AttachmentMode), enumValues113) - w.enumField(n, "body_format", string(v.BodyFormat), enumValues114) + w.enumField(n, "attachment_mode", string(v.AttachmentMode), enumValuesPipelinesOutlookAttachmentMode) + w.enumField(n, "body_format", string(v.BodyFormat), enumValuesPipelinesOutlookBodyFormat) } func enumPipelinesSharepointOptions(w *walker, n *node, v *pipelines.SharepointOptions) { if v == nil { v = &pipelines.SharepointOptions{} } - w.enumField(n, "entity_type", string(v.EntityType), enumValues115) + w.enumField(n, "entity_type", string(v.EntityType), enumValuesPipelinesSharepointOptionsSharepointEntityType) if c := n.child("file_ingestion_options"); c.exists() { enumPipelinesFileIngestionOptions(w, &c, v.FileIngestionOptions) } @@ -2569,8 +2597,8 @@ func enumPipelinesTikTokAdsOptions(w *walker, n *node, v *pipelines.TikTokAdsOpt if c := n.child("custom_report_options"); c.exists() { enumPipelinesTikTokAdsOptionsTikTokAdsCustomReportOptions(w, &c, v.CustomReportOptions) } - w.enumField(n, "data_level", string(v.DataLevel), enumValues116) - w.enumField(n, "report_type", string(v.ReportType), enumValues117) + w.enumField(n, "data_level", string(v.DataLevel), enumValuesPipelinesTikTokAdsOptionsTikTokDataLevel) + w.enumField(n, "report_type", string(v.ReportType), enumValuesPipelinesTikTokAdsOptionsTikTokReportType) } func enumPipelinesTransformer(w *walker, n *node, v *pipelines.Transformer) { @@ -2580,7 +2608,7 @@ func enumPipelinesTransformer(w *walker, n *node, v *pipelines.Transformer) { if c := n.child("avro_options"); c.exists() { enumPipelinesAvroTransformerOptions(w, &c, v.AvroOptions) } - w.enumField(n, "format", string(v.Format), enumValues118) + w.enumField(n, "format", string(v.Format), enumValuesPipelinesTransformerFormat) if c := n.child("json_options"); c.exists() { enumPipelinesJsonTransformerOptions(w, &c, v.JsonOptions) } @@ -2593,8 +2621,8 @@ func enumPipelinesFileIngestionOptions(w *walker, n *node, v *pipelines.FileInge if v == nil { v = &pipelines.FileIngestionOptions{} } - w.enumField(n, "format", string(v.Format), enumValues119) - w.enumField(n, "schema_evolution_mode", string(v.SchemaEvolutionMode), enumValues120) + w.enumField(n, "format", string(v.Format), enumValuesPipelinesFileIngestionOptionsFileFormat) + w.enumField(n, "schema_evolution_mode", string(v.SchemaEvolutionMode), enumValuesPipelinesFileIngestionOptionsSchemaEvolutionMode) } func enumPipelinesTransformer2(w *walker, n *node, v *pipelines.Transformer) { @@ -2604,7 +2632,7 @@ func enumPipelinesTransformer2(w *walker, n *node, v *pipelines.Transformer) { if c := n.child("avro_options"); c.exists() { enumPipelinesAvroTransformerOptions(w, &c, v.AvroOptions) } - w.enumField(n, "format", string(v.Format), enumValues118) + w.enumField(n, "format", string(v.Format), enumValuesPipelinesTransformerFormat) if c := n.child("json_options"); c.exists() { enumPipelinesJsonTransformerOptions(w, &c, v.JsonOptions) } @@ -2621,38 +2649,38 @@ func enumPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptions(w *walker, n c := n.child("entity_granularity") for i0 := range v.EntityGranularity { e := c.elem(i0) - w.enumElem(&e, string(v.EntityGranularity[i0]), enumValues121) + w.enumElem(&e, string(v.EntityGranularity[i0]), enumValuesPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptionsLinkedInAdsEntityGranularity) } } - w.enumField(n, "finder", string(v.Finder), enumValues122) - w.enumField(n, "time_granularity", string(v.TimeGranularity), enumValues123) + w.enumField(n, "finder", string(v.Finder), enumValuesPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptionsLinkedInAdsFinder) + w.enumField(n, "time_granularity", string(v.TimeGranularity), enumValuesPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptionsLinkedInAdsTimeGranularity) } func enumPipelinesTikTokAdsOptionsTikTokAdsCustomReportOptions(w *walker, n *node, v *pipelines.TikTokAdsOptionsTikTokAdsCustomReportOptions) { if v == nil { v = &pipelines.TikTokAdsOptionsTikTokAdsCustomReportOptions{} } - w.enumField(n, "data_level", string(v.DataLevel), enumValues116) - w.enumField(n, "report_type", string(v.ReportType), enumValues117) + w.enumField(n, "data_level", string(v.DataLevel), enumValuesPipelinesTikTokAdsOptionsTikTokDataLevel) + w.enumField(n, "report_type", string(v.ReportType), enumValuesPipelinesTikTokAdsOptionsTikTokReportType) } func enumPipelinesAvroTransformerOptions(w *walker, n *node, v *pipelines.AvroTransformerOptions) { if v == nil { v = &pipelines.AvroTransformerOptions{} } - w.enumField(n, "parse_mode", string(v.ParseMode), enumValues124) + w.enumField(n, "parse_mode", string(v.ParseMode), enumValuesPipelinesParseMode) } func enumPipelinesJsonTransformerOptions(w *walker, n *node, v *pipelines.JsonTransformerOptions) { if v == nil { v = &pipelines.JsonTransformerOptions{} } - w.enumField(n, "schema_evolution_mode", string(v.SchemaEvolutionMode), enumValues120) + w.enumField(n, "schema_evolution_mode", string(v.SchemaEvolutionMode), enumValuesPipelinesFileIngestionOptionsSchemaEvolutionMode) } func enumPipelinesProtobufTransformerOptions(w *walker, n *node, v *pipelines.ProtobufTransformerOptions) { if v == nil { v = &pipelines.ProtobufTransformerOptions{} } - w.enumField(n, "parse_mode", string(v.ParseMode), enumValues124) + w.enumField(n, "parse_mode", string(v.ParseMode), enumValuesPipelinesParseMode) } diff --git a/bundle/internal/validation/walker.go b/bundle/internal/validation/walker.go index a97198d291a..7feab31638d 100644 --- a/bundle/internal/validation/walker.go +++ b/bundle/internal/validation/walker.go @@ -5,6 +5,7 @@ import ( "cmp" "fmt" "go/format" + "maps" "os" "path" "reflect" @@ -151,7 +152,7 @@ type gen struct { aliases map[string]bool funcs map[string]string // signature -> function name names map[string]int - enums map[string]string // joined values -> variable name + enums map[reflect.Type]enumVar // enum type -> its valid values out bytes.Buffer pending []*tnode } @@ -163,7 +164,7 @@ func newGen(prefix string) *gen { aliases: map[string]bool{"slices": true, "dyn": true}, funcs: map[string]string{}, names: map[string]int{}, - enums: map[string]string{}, + enums: map[reflect.Type]enumVar{}, } } @@ -209,14 +210,29 @@ func capitalize(s string) string { return strings.ToUpper(s[:1]) + s[1:] } -func (g *gen) enumVar(values []string) string { - key := strings.Join(values, "\x00") - if name, ok := g.enums[key]; ok { - return name +// enumVar is the variable holding the valid values of an enum type. +type enumVar struct { + name string + values []string +} + +// enumVarFor returns the name of the variable holding the valid values of the enum type +// typ, e.g. enumValuesPostgresPipelineChannel for postgres.PipelineChannel. +func (g *gen) enumVarFor(typ reflect.Type, values []string) (string, error) { + if v, ok := g.enums[typ]; ok { + if !slices.Equal(v.values, values) { + return "", fmt.Errorf("enum type %s has different valid values at different paths", typ) + } + return v.name, nil } - name := fmt.Sprintf("%sValues%d", g.prefix, len(g.enums)) - g.enums[key] = name - return name + base := g.prefix + "Values" + capitalize(path.Base(typ.PkgPath())) + typ.Name() + g.names[base]++ + name := base + if g.names[base] > 1 { + name = base + strconv.Itoa(g.names[base]) + } + g.enums[typ] = enumVar{name: name, values: values} + return name, nil } // field is the field with JSON name key of the struct v points to. @@ -317,7 +333,11 @@ func (g *gen) emitField(f field, child *tnode) error { if f.typ.Kind() != reflect.String { return fmt.Errorf("enum field %q of type %s", f.key, f.typ) } - fmt.Fprintf(&g.out, "\tw.enumField(n, %q, string(%s), %s)\n", f.key, f.expr, g.enumVar(child.enum)) + values, err := g.enumVarFor(f.typ, child.enum) + if err != nil { + return err + } + fmt.Fprintf(&g.out, "\tw.enumField(n, %q, string(%s), %s)\n", f.key, f.expr, values) case f.typ.Kind() == reflect.Pointer: fmt.Fprintf(&g.out, "\tif c := n.child(%q); c.exists() {\n\t\t%s(w, &c, %s)\n\t}\n", f.key, g.funcFor(child), f.expr) case f.typ.Kind() == reflect.Struct: @@ -374,7 +394,11 @@ func (g *gen) emitElem(indent, expr string, typ reflect.Type, t *tnode, depth in if typ.Kind() != reflect.String { return fmt.Errorf("enum element of type %s", typ) } - fmt.Fprintf(&g.out, "%sw.enumElem(&e, string(%s), %s)\n", indent, expr, g.enumVar(t.enum)) + values, err := g.enumVarFor(typ, t.enum) + if err != nil { + return err + } + fmt.Fprintf(&g.out, "%sw.enumElem(&e, string(%s), %s)\n", indent, expr, values) case typ.Kind() == reflect.Pointer: fmt.Fprintf(&g.out, "%s%s(w, &e, %s)\n", indent, g.funcFor(t), expr) case typ.Kind() == reflect.Struct: @@ -435,19 +459,13 @@ func generateWalker(file, prefix, doc string, required, enums map[string][]strin } } fmt.Fprintf(&src, ")\n") - keys := make([]string, 0, len(g.enums)) - for k := range g.enums { - keys = append(keys, k) - } - slices.SortFunc(keys, func(a, b string) int { - return cmp.Or(cmp.Compare(len(g.enums[a]), len(g.enums[b])), cmp.Compare(g.enums[a], g.enums[b])) - }) - for _, k := range keys { + vars := slices.SortedFunc(maps.Values(g.enums), func(a, b enumVar) int { return cmp.Compare(a.name, b.name) }) + for _, e := range vars { var quoted []string - for value := range strings.SplitSeq(k, "\x00") { + for _, value := range e.values { quoted = append(quoted, strconv.Quote(value)) } - fmt.Fprintf(&src, "\nvar %s = []string{%s}\n", g.enums[k], strings.Join(quoted, ", ")) + fmt.Fprintf(&src, "\nvar %s = []string{%s}\n", e.name, strings.Join(quoted, ", ")) } src.Write(g.out.Bytes()) From 0dadc3f29a0ed25cc7b85509bf4d592215f01328 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Wed, 21 Oct 2026 16:08:51 +0200 Subject: [PATCH 3/5] Regenerate the walkers after rebasing on the SDK update and the features resource Co-authored-by: Isaac --- bundle/config/validate/enum_walk.go | 56 +++++++++++++++++++++- bundle/config/validate/required_walk.go | 64 +++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 1 deletion(-) diff --git a/bundle/config/validate/enum_walk.go b/bundle/config/validate/enum_walk.go index 9951960a6bf..8358bb1d239 100644 --- a/bundle/config/validate/enum_walk.go +++ b/bundle/config/validate/enum_walk.go @@ -173,6 +173,10 @@ var enumValuesJobsSqlConditionTriggerMode = []string{"QUERY_RETURNS_ROWS", "RESU var enumValuesJobsStorageMode = []string{"DIRECT_QUERY", "DUAL", "IMPORT"} +var enumValuesJobsSubscriptionAttachmentDataAttachmentFileFormat = []string{"FILE_FORMAT_CSV", "FILE_FORMAT_EXCEL", "FILE_FORMAT_TSV"} + +var enumValuesJobsSubscriptionAttachmentPageAttachmentPageSelection = []string{"PAGE_SELECTION_ALL", "PAGE_SELECTION_SUBSET"} + var enumValuesJobsTaskRetryMode = []string{"NEVER", "ON_FAILURE"} var enumValuesMlExperimentPermissionLevel = []string{"CAN_EDIT", "CAN_MANAGE", "CAN_READ"} @@ -275,7 +279,7 @@ var enumValuesSqlChannelName = []string{"CHANNEL_NAME_CURRENT", "CHANNEL_NAME_CU var enumValuesSqlComparisonOperator = []string{"EQUAL", "GREATER_THAN", "GREATER_THAN_OR_EQUAL", "IS_NOT_NULL", "IS_NULL", "LESS_THAN", "LESS_THAN_OR_EQUAL", "NOT_EQUAL"} -var enumValuesSqlCreateWarehouseRequestWarehouseType = []string{"CLASSIC", "PRO", "TYPE_UNSPECIFIED"} +var enumValuesSqlCreateWarehouseRequestWarehouseType = []string{"CLASSIC", "PRO", "REALTIME", "TYPE_UNSPECIFIED"} var enumValuesSqlCustomTemplateFormat = []string{"HTML", "MARKDOWN"} @@ -1505,6 +1509,9 @@ func enumJobsTask(w *walker, n *node, v *jobs.Task) { if c := n.child("condition_task"); c.exists() { enumJobsConditionTask(w, &c, v.ConditionTask) } + if c := n.child("dashboard_task"); c.exists() { + enumJobsDashboardTask(w, &c, v.DashboardTask) + } if c := n.child("dbt_task"); c.exists() { enumJobsDbtTask(w, &c, v.DbtTask) } @@ -2066,6 +2073,15 @@ func enumJobsConditionTask(w *walker, n *node, v *jobs.ConditionTask) { w.enumField(n, "op", string(v.Op), enumValuesJobsConditionTaskOp) } +func enumJobsDashboardTask(w *walker, n *node, v *jobs.DashboardTask) { + if v == nil { + v = &jobs.DashboardTask{} + } + if c := n.child("subscription"); c.exists() { + enumJobsSubscription(w, &c, v.Subscription) + } +} + func enumJobsDbtTask(w *walker, n *node, v *jobs.DbtTask) { if v == nil { v = &jobs.DbtTask{} @@ -2332,6 +2348,15 @@ func enumJobsDeploymentSpec(w *walker, n *node, v *jobs.DeploymentSpec) { } } +func enumJobsSubscription(w *walker, n *node, v *jobs.Subscription) { + if v == nil { + v = &jobs.Subscription{} + } + if c := n.child("attachment"); c.exists() { + enumJobsSubscriptionAttachment(w, &c, v.Attachment) + } +} + func enumJobsTask2(w *walker, n *node, v *jobs.Task) { if v == nil { v = &jobs.Task{} @@ -2345,6 +2370,9 @@ func enumJobsTask2(w *walker, n *node, v *jobs.Task) { if c := n.child("condition_task"); c.exists() { enumJobsConditionTask(w, &c, v.ConditionTask) } + if c := n.child("dashboard_task"); c.exists() { + enumJobsDashboardTask(w, &c, v.DashboardTask) + } if c := n.child("dbt_task"); c.exists() { enumJobsDbtTask(w, &c, v.DbtTask) } @@ -2490,6 +2518,18 @@ func enumJobsComputeSpec(w *walker, n *node, v *jobs.ComputeSpec) { w.enumField(n, "accelerator_type", string(v.AcceleratorType), enumValuesJobsComputeSpecAcceleratorType) } +func enumJobsSubscriptionAttachment(w *walker, n *node, v *jobs.SubscriptionAttachment) { + if v == nil { + v = &jobs.SubscriptionAttachment{} + } + if c := n.child("data_attachment"); c.exists() { + enumJobsSubscriptionAttachmentDataAttachment(w, &c, v.DataAttachment) + } + if c := n.child("page_attachment"); c.exists() { + enumJobsSubscriptionAttachmentPageAttachment(w, &c, v.PageAttachment) + } +} + func enumServingAiGatewayGuardrailPiiBehavior(w *walker, n *node, v *serving.AiGatewayGuardrailPiiBehavior) { if v == nil { v = &serving.AiGatewayGuardrailPiiBehavior{} @@ -2541,6 +2581,20 @@ func enumPipelinesIngestionPipelineDefinitionFanoutOptions(w *walker, n *node, v } } +func enumJobsSubscriptionAttachmentDataAttachment(w *walker, n *node, v *jobs.SubscriptionAttachmentDataAttachment) { + if v == nil { + v = &jobs.SubscriptionAttachmentDataAttachment{} + } + w.enumField(n, "file_format", string(v.FileFormat), enumValuesJobsSubscriptionAttachmentDataAttachmentFileFormat) +} + +func enumJobsSubscriptionAttachmentPageAttachment(w *walker, n *node, v *jobs.SubscriptionAttachmentPageAttachment) { + if v == nil { + v = &jobs.SubscriptionAttachmentPageAttachment{} + } + w.enumField(n, "page_selection", string(v.PageSelection), enumValuesJobsSubscriptionAttachmentPageAttachmentPageSelection) +} + func enumPipelinesGoogleDriveOptions(w *walker, n *node, v *pipelines.GoogleDriveOptions) { if v == nil { v = &pipelines.GoogleDriveOptions{} diff --git a/bundle/config/validate/required_walk.go b/bundle/config/validate/required_walk.go index 14b5850d23b..3599cf9e3f4 100644 --- a/bundle/config/validate/required_walk.go +++ b/bundle/config/validate/required_walk.go @@ -1649,6 +1649,9 @@ func requiredJobsTask(w *walker, n *node, v *jobs.Task) { if c := n.child("condition_task"); c.exists() { requiredJobsConditionTask(w, &c, v.ConditionTask) } + if c := n.child("dashboard_task"); c.exists() { + requiredJobsDashboardTask(w, &c, v.DashboardTask) + } if c := n.child("dbt_task"); c.exists() { requiredJobsDbtTask(w, &c, v.DbtTask) } @@ -2788,6 +2791,15 @@ func requiredJobsConditionTask(w *walker, n *node, v *jobs.ConditionTask) { } } +func requiredJobsDashboardTask(w *walker, n *node, v *jobs.DashboardTask) { + if v == nil { + v = &jobs.DashboardTask{} + } + if c := n.child("subscription"); c.exists() { + requiredJobsSubscription(w, &c, v.Subscription) + } +} + func requiredJobsDbtTask(w *walker, n *node, v *jobs.DbtTask) { if v == nil { v = &jobs.DbtTask{} @@ -3475,6 +3487,15 @@ func requiredJobsDeploymentSpec(w *walker, n *node, v *jobs.DeploymentSpec) { } } +func requiredJobsSubscription(w *walker, n *node, v *jobs.Subscription) { + if v == nil { + v = &jobs.Subscription{} + } + if c := n.child("attachment"); c.exists() { + requiredJobsSubscriptionAttachment(w, &c, v.Attachment) + } +} + func requiredJobsTask2(w *walker, n *node, v *jobs.Task) { if v == nil { v = &jobs.Task{} @@ -3491,6 +3512,9 @@ func requiredJobsTask2(w *walker, n *node, v *jobs.Task) { if c := n.child("condition_task"); c.exists() { requiredJobsConditionTask(w, &c, v.ConditionTask) } + if c := n.child("dashboard_task"); c.exists() { + requiredJobsDashboardTask(w, &c, v.DashboardTask) + } if c := n.child("dbt_task"); c.exists() { requiredJobsDbtTask(w, &c, v.DbtTask) } @@ -3829,6 +3853,15 @@ func requiredJobsComputeSpec(w *walker, n *node, v *jobs.ComputeSpec) { } } +func requiredJobsSubscriptionAttachment(w *walker, n *node, v *jobs.SubscriptionAttachment) { + if v == nil { + v = &jobs.SubscriptionAttachment{} + } + if c := n.child("data_attachment"); c.exists() { + requiredJobsSubscriptionAttachmentDataAttachment(w, &c, v.DataAttachment) + } +} + func requiredJobsForEachTask2(w *walker, n *node, v *jobs.ForEachTask) { if v == nil { v = &jobs.ForEachTask{} @@ -3979,6 +4012,25 @@ func requiredPipelinesConnectorOptions(w *walker, n *node, v *pipelines.Connecto } } +func requiredJobsSubscriptionAttachmentDataAttachment(w *walker, n *node, v *jobs.SubscriptionAttachmentDataAttachment) { + if v == nil { + v = &jobs.SubscriptionAttachmentDataAttachment{} + } + if !(v.FileFormat != "") && !n.has("file_format") { + w.missing(n, "file_format") + } + if !(v.Widgets != nil) && !n.has("widgets") { + w.missing(n, "widgets") + } + if len(v.Widgets) > 0 { + c := n.child("widgets") + for i0 := range v.Widgets { + e := c.elem(i0) + requiredJobsSubscriptionAttachmentDataAttachmentWidget(w, &e, &v.Widgets[i0]) + } + } +} + func requiredCatalogModelProviderServiceConfigSecretReference(w *walker, n *node, v *catalog.ModelProviderServiceConfigSecretReference) { if v == nil { v = &catalog.ModelProviderServiceConfigSecretReference{} @@ -4027,6 +4079,18 @@ func requiredPipelinesRabbitmqOptions(w *walker, n *node, v *pipelines.RabbitmqO } } +func requiredJobsSubscriptionAttachmentDataAttachmentWidget(w *walker, n *node, v *jobs.SubscriptionAttachmentDataAttachmentWidget) { + if v == nil { + v = &jobs.SubscriptionAttachmentDataAttachmentWidget{} + } + if !(v.PageId != "") && !n.has("page_id") { + w.missing(n, "page_id") + } + if !(v.WidgetId != "") && !n.has("widget_id") { + w.missing(n, "widget_id") + } +} + func requiredPipelinesGoogleAdsCustomReportOptions(w *walker, n *node, v *pipelines.GoogleAdsCustomReportOptions) { if v == nil { v = &pipelines.GoogleAdsCustomReportOptions{} From 968a05a87e7ae721961c81425b74a20f962c8998 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Thu, 22 Oct 2026 11:21:17 +0200 Subject: [PATCH 4/5] Skip empty map keys in the generated walkers and remove the unused pattern trie Co-authored-by: Isaac --- bundle/config/validate/enum_walk.go | 111 ++++++++++++++ bundle/config/validate/required_walk.go | 120 +++++++++++++++ bundle/config/validate/walk_test.go | 22 +++ bundle/internal/validation/walker.go | 3 +- libs/dyn/pattern_trie.go | 172 --------------------- libs/dyn/pattern_trie_test.go | 195 ------------------------ 6 files changed, 255 insertions(+), 368 deletions(-) delete mode 100644 libs/dyn/pattern_trie.go delete mode 100644 libs/dyn/pattern_trie_test.go diff --git a/bundle/config/validate/enum_walk.go b/bundle/config/validate/enum_walk.go index 8358bb1d239..c464c5697de 100644 --- a/bundle/config/validate/enum_walk.go +++ b/bundle/config/validate/enum_walk.go @@ -310,6 +310,9 @@ func enumConfigRoot(w *walker, n *node, v *config.Root) { if len(v.Artifacts) > 0 { c := n.child("artifacts") for k0, x0 := range v.Artifacts { + if k0 == "" { + continue + } e := c.child(k0) enumConfigArtifact(w, &e, x0) } @@ -327,6 +330,9 @@ func enumConfigRoot(w *walker, n *node, v *config.Root) { if len(v.Variables) > 0 { c := n.child("variables") for k0, x0 := range v.Variables { + if k0 == "" { + continue + } e := c.child(k0) enumVariableVariable(w, &e, x0) } @@ -355,6 +361,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Alerts) > 0 { c := n.child("alerts") for k0, x0 := range v.Alerts { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesAlert(w, &e, x0) } @@ -362,6 +371,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Apps) > 0 { c := n.child("apps") for k0, x0 := range v.Apps { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesApp(w, &e, x0) } @@ -369,6 +381,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Catalogs) > 0 { c := n.child("catalogs") for k0, x0 := range v.Catalogs { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesCatalog(w, &e, x0) } @@ -376,6 +391,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.ClusterPolicies) > 0 { c := n.child("cluster_policies") for k0, x0 := range v.ClusterPolicies { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesClusterPolicy(w, &e, x0) } @@ -383,6 +401,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Clusters) > 0 { c := n.child("clusters") for k0, x0 := range v.Clusters { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesCluster(w, &e, x0) } @@ -390,6 +411,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Dashboards) > 0 { c := n.child("dashboards") for k0, x0 := range v.Dashboards { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesDashboard(w, &e, x0) } @@ -397,6 +421,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.DatabaseInstances) > 0 { c := n.child("database_instances") for k0, x0 := range v.DatabaseInstances { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesDatabaseInstance(w, &e, x0) } @@ -404,6 +431,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Experiments) > 0 { c := n.child("experiments") for k0, x0 := range v.Experiments { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesMlflowExperiment(w, &e, x0) } @@ -411,6 +441,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.ExternalLocations) > 0 { c := n.child("external_locations") for k0, x0 := range v.ExternalLocations { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesExternalLocation(w, &e, x0) } @@ -418,6 +451,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Features) > 0 { c := n.child("features") for k0, x0 := range v.Features { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesFeature(w, &e, x0) } @@ -425,6 +461,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.GenieSpaces) > 0 { c := n.child("genie_spaces") for k0, x0 := range v.GenieSpaces { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesGenieSpace(w, &e, x0) } @@ -432,6 +471,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.InstancePools) > 0 { c := n.child("instance_pools") for k0, x0 := range v.InstancePools { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesInstancePool(w, &e, x0) } @@ -439,6 +481,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.JobRuns) > 0 { c := n.child("job_runs") for k0, x0 := range v.JobRuns { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesJobRun(w, &e, x0) } @@ -446,6 +491,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Jobs) > 0 { c := n.child("jobs") for k0, x0 := range v.Jobs { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesJob(w, &e, x0) } @@ -453,6 +501,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.McpServices) > 0 { c := n.child("mcp_services") for k0, x0 := range v.McpServices { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesMcpService(w, &e, x0) } @@ -460,6 +511,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.ModelProviderServices) > 0 { c := n.child("model_provider_services") for k0, x0 := range v.ModelProviderServices { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesModelProviderService(w, &e, x0) } @@ -467,6 +521,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.ModelServices) > 0 { c := n.child("model_services") for k0, x0 := range v.ModelServices { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesModelService(w, &e, x0) } @@ -474,6 +531,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.ModelServingEndpoints) > 0 { c := n.child("model_serving_endpoints") for k0, x0 := range v.ModelServingEndpoints { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesModelServingEndpoint(w, &e, x0) } @@ -481,6 +541,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Models) > 0 { c := n.child("models") for k0, x0 := range v.Models { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesMlflowModel(w, &e, x0) } @@ -488,6 +551,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Pipelines) > 0 { c := n.child("pipelines") for k0, x0 := range v.Pipelines { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesPipeline(w, &e, x0) } @@ -495,6 +561,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.PostgresEndpoints) > 0 { c := n.child("postgres_endpoints") for k0, x0 := range v.PostgresEndpoints { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesPostgresEndpoint(w, &e, x0) } @@ -502,6 +571,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.PostgresProjects) > 0 { c := n.child("postgres_projects") for k0, x0 := range v.PostgresProjects { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesPostgresProject(w, &e, x0) } @@ -509,6 +581,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.PostgresRoles) > 0 { c := n.child("postgres_roles") for k0, x0 := range v.PostgresRoles { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesPostgresRole(w, &e, x0) } @@ -516,6 +591,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.PostgresSnapshotSchedules) > 0 { c := n.child("postgres_snapshot_schedules") for k0, x0 := range v.PostgresSnapshotSchedules { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesPostgresSnapshotSchedule(w, &e, x0) } @@ -523,6 +601,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.PostgresSyncedTables) > 0 { c := n.child("postgres_synced_tables") for k0, x0 := range v.PostgresSyncedTables { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesPostgresSyncedTable(w, &e, x0) } @@ -530,6 +611,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.QualityMonitors) > 0 { c := n.child("quality_monitors") for k0, x0 := range v.QualityMonitors { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesQualityMonitor(w, &e, x0) } @@ -537,6 +621,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.RegisteredModels) > 0 { c := n.child("registered_models") for k0, x0 := range v.RegisteredModels { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesRegisteredModel(w, &e, x0) } @@ -544,6 +631,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Schemas) > 0 { c := n.child("schemas") for k0, x0 := range v.Schemas { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesSchema(w, &e, x0) } @@ -551,6 +641,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.SecretScopes) > 0 { c := n.child("secret_scopes") for k0, x0 := range v.SecretScopes { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesSecretScope(w, &e, x0) } @@ -558,6 +651,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Secrets) > 0 { c := n.child("secrets") for k0, x0 := range v.Secrets { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesSecret(w, &e, x0) } @@ -565,6 +661,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.SqlWarehouses) > 0 { c := n.child("sql_warehouses") for k0, x0 := range v.SqlWarehouses { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesSqlWarehouse(w, &e, x0) } @@ -572,6 +671,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.SyncedDatabaseTables) > 0 { c := n.child("synced_database_tables") for k0, x0 := range v.SyncedDatabaseTables { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesSyncedDatabaseTable(w, &e, x0) } @@ -579,6 +681,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.VectorSearchEndpoints) > 0 { c := n.child("vector_search_endpoints") for k0, x0 := range v.VectorSearchEndpoints { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesVectorSearchEndpoint(w, &e, x0) } @@ -586,6 +691,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.VectorSearchIndexes) > 0 { c := n.child("vector_search_indexes") for k0, x0 := range v.VectorSearchIndexes { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesVectorSearchIndex(w, &e, x0) } @@ -593,6 +701,9 @@ func enumConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Volumes) > 0 { c := n.child("volumes") for k0, x0 := range v.Volumes { + if k0 == "" { + continue + } e := c.child(k0) enumResourcesVolume(w, &e, x0) } diff --git a/bundle/config/validate/required_walk.go b/bundle/config/validate/required_walk.go index 3599cf9e3f4..db2bf0a5430 100644 --- a/bundle/config/validate/required_walk.go +++ b/bundle/config/validate/required_walk.go @@ -27,6 +27,9 @@ func requiredConfigRoot(w *walker, n *node, v *config.Root) { if len(v.Artifacts) > 0 { c := n.child("artifacts") for k0, x0 := range v.Artifacts { + if k0 == "" { + continue + } e := c.child(k0) requiredConfigArtifact(w, &e, x0) } @@ -47,6 +50,9 @@ func requiredConfigRoot(w *walker, n *node, v *config.Root) { if len(v.Scripts) > 0 { c := n.child("scripts") for k0, x0 := range v.Scripts { + if k0 == "" { + continue + } e := c.child(k0) requiredConfigScript(w, &e, &x0) } @@ -91,6 +97,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Alerts) > 0 { c := n.child("alerts") for k0, x0 := range v.Alerts { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesAlert(w, &e, x0) } @@ -98,6 +107,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Apps) > 0 { c := n.child("apps") for k0, x0 := range v.Apps { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesApp(w, &e, x0) } @@ -105,6 +117,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Catalogs) > 0 { c := n.child("catalogs") for k0, x0 := range v.Catalogs { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesCatalog(w, &e, x0) } @@ -112,6 +127,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.ClusterPolicies) > 0 { c := n.child("cluster_policies") for k0, x0 := range v.ClusterPolicies { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesClusterPolicy(w, &e, x0) } @@ -119,6 +137,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Clusters) > 0 { c := n.child("clusters") for k0, x0 := range v.Clusters { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesCluster(w, &e, x0) } @@ -126,6 +147,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Dashboards) > 0 { c := n.child("dashboards") for k0, x0 := range v.Dashboards { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesDashboard(w, &e, x0) } @@ -133,6 +157,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.DatabaseCatalogs) > 0 { c := n.child("database_catalogs") for k0, x0 := range v.DatabaseCatalogs { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesDatabaseCatalog(w, &e, x0) } @@ -140,6 +167,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.DatabaseInstances) > 0 { c := n.child("database_instances") for k0, x0 := range v.DatabaseInstances { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesDatabaseInstance(w, &e, x0) } @@ -147,6 +177,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Experiments) > 0 { c := n.child("experiments") for k0, x0 := range v.Experiments { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesMlflowExperiment(w, &e, x0) } @@ -154,6 +187,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.ExternalLocations) > 0 { c := n.child("external_locations") for k0, x0 := range v.ExternalLocations { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesExternalLocation(w, &e, x0) } @@ -161,6 +197,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Features) > 0 { c := n.child("features") for k0, x0 := range v.Features { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesFeature(w, &e, x0) } @@ -168,6 +207,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.GenieSpaces) > 0 { c := n.child("genie_spaces") for k0, x0 := range v.GenieSpaces { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesGenieSpace(w, &e, x0) } @@ -175,6 +217,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.InstancePools) > 0 { c := n.child("instance_pools") for k0, x0 := range v.InstancePools { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesInstancePool(w, &e, x0) } @@ -182,6 +227,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.JobRuns) > 0 { c := n.child("job_runs") for k0, x0 := range v.JobRuns { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesJobRun(w, &e, x0) } @@ -189,6 +237,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Jobs) > 0 { c := n.child("jobs") for k0, x0 := range v.Jobs { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesJob(w, &e, x0) } @@ -196,6 +247,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.McpServices) > 0 { c := n.child("mcp_services") for k0, x0 := range v.McpServices { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesMcpService(w, &e, x0) } @@ -203,6 +257,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.ModelProviderServices) > 0 { c := n.child("model_provider_services") for k0, x0 := range v.ModelProviderServices { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesModelProviderService(w, &e, x0) } @@ -210,6 +267,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.ModelServices) > 0 { c := n.child("model_services") for k0, x0 := range v.ModelServices { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesModelService(w, &e, x0) } @@ -217,6 +277,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.ModelServingEndpoints) > 0 { c := n.child("model_serving_endpoints") for k0, x0 := range v.ModelServingEndpoints { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesModelServingEndpoint(w, &e, x0) } @@ -224,6 +287,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Models) > 0 { c := n.child("models") for k0, x0 := range v.Models { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesMlflowModel(w, &e, x0) } @@ -231,6 +297,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Pipelines) > 0 { c := n.child("pipelines") for k0, x0 := range v.Pipelines { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesPipeline(w, &e, x0) } @@ -238,6 +307,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.PostgresBranches) > 0 { c := n.child("postgres_branches") for k0, x0 := range v.PostgresBranches { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesPostgresBranch(w, &e, x0) } @@ -245,6 +317,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.PostgresCatalogs) > 0 { c := n.child("postgres_catalogs") for k0, x0 := range v.PostgresCatalogs { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesPostgresCatalog(w, &e, x0) } @@ -252,6 +327,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.PostgresDatabases) > 0 { c := n.child("postgres_databases") for k0, x0 := range v.PostgresDatabases { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesPostgresDatabase(w, &e, x0) } @@ -259,6 +337,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.PostgresEndpoints) > 0 { c := n.child("postgres_endpoints") for k0, x0 := range v.PostgresEndpoints { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesPostgresEndpoint(w, &e, x0) } @@ -266,6 +347,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.PostgresProjects) > 0 { c := n.child("postgres_projects") for k0, x0 := range v.PostgresProjects { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesPostgresProject(w, &e, x0) } @@ -273,6 +357,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.PostgresRoles) > 0 { c := n.child("postgres_roles") for k0, x0 := range v.PostgresRoles { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesPostgresRole(w, &e, x0) } @@ -280,6 +367,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.PostgresSnapshotSchedules) > 0 { c := n.child("postgres_snapshot_schedules") for k0, x0 := range v.PostgresSnapshotSchedules { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesPostgresSnapshotSchedule(w, &e, x0) } @@ -287,6 +377,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.PostgresSyncedTables) > 0 { c := n.child("postgres_synced_tables") for k0, x0 := range v.PostgresSyncedTables { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesPostgresSyncedTable(w, &e, x0) } @@ -294,6 +387,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.QualityMonitors) > 0 { c := n.child("quality_monitors") for k0, x0 := range v.QualityMonitors { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesQualityMonitor(w, &e, x0) } @@ -301,6 +397,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Schemas) > 0 { c := n.child("schemas") for k0, x0 := range v.Schemas { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesSchema(w, &e, x0) } @@ -308,6 +407,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.SecretScopes) > 0 { c := n.child("secret_scopes") for k0, x0 := range v.SecretScopes { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesSecretScope(w, &e, x0) } @@ -315,6 +417,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Secrets) > 0 { c := n.child("secrets") for k0, x0 := range v.Secrets { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesSecret(w, &e, x0) } @@ -322,6 +427,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.SqlWarehouses) > 0 { c := n.child("sql_warehouses") for k0, x0 := range v.SqlWarehouses { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesSqlWarehouse(w, &e, x0) } @@ -329,6 +437,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.SyncedDatabaseTables) > 0 { c := n.child("synced_database_tables") for k0, x0 := range v.SyncedDatabaseTables { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesSyncedDatabaseTable(w, &e, x0) } @@ -336,6 +447,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.VectorSearchEndpoints) > 0 { c := n.child("vector_search_endpoints") for k0, x0 := range v.VectorSearchEndpoints { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesVectorSearchEndpoint(w, &e, x0) } @@ -343,6 +457,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.VectorSearchIndexes) > 0 { c := n.child("vector_search_indexes") for k0, x0 := range v.VectorSearchIndexes { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesVectorSearchIndex(w, &e, x0) } @@ -350,6 +467,9 @@ func requiredConfigResources(w *walker, n *node, v *config.Resources) { if len(v.Volumes) > 0 { c := n.child("volumes") for k0, x0 := range v.Volumes { + if k0 == "" { + continue + } e := c.child(k0) requiredResourcesVolume(w, &e, x0) } diff --git a/bundle/config/validate/walk_test.go b/bundle/config/validate/walk_test.go index 380f4bce11e..cf0801b0da3 100644 --- a/bundle/config/validate/walk_test.go +++ b/bundle/config/validate/walk_test.go @@ -149,3 +149,25 @@ resources: "resources.jobs.mid.tasks[0].run_if", }, paths) } + +func TestWalksSkipEmptyMapKeys(t *testing.T) { + // The dynamic walk these replace never matched an empty key against a wildcard. + b := loadBundle(t, ` +bundle: + name: test-bundle +variables: + "": + type: bogus +resources: + jobs: + "": {} +`) + var paths []string + for _, d := range bundle.Apply(t.Context(), b, Enum()) { + paths = append(paths, d.Paths[0].String()) + } + for _, d := range bundle.Apply(t.Context(), b, Required()) { + paths = append(paths, d.Paths[0].String()) + } + assert.Empty(t, paths) +} diff --git a/bundle/internal/validation/walker.go b/bundle/internal/validation/walker.go index 7feab31638d..8f20007daef 100644 --- a/bundle/internal/validation/walker.go +++ b/bundle/internal/validation/walker.go @@ -378,7 +378,8 @@ func (g *gen) emitContainer(indent, expr string, typ reflect.Type, t *tnode, dep if typ.Key() != reflect.TypeFor[string]() { key = "string(" + k + ")" } - fmt.Fprintf(&g.out, "%sfor %s, %s := range %s {\n%s\te := c.child(%s)\n", indent, k, x, expr, indent, key) + // The dynamic walk this replaces never matched an empty key against the wildcard. + fmt.Fprintf(&g.out, "%sfor %s, %s := range %s {\n%s\tif %s == \"\" {\n%s\t\tcontinue\n%s\t}\n%s\te := c.child(%s)\n", indent, k, x, expr, indent, key, indent, indent, indent, key) if err := g.emitElem(indent+"\t", x, typ.Elem(), elem, depth); err != nil { return err } diff --git a/libs/dyn/pattern_trie.go b/libs/dyn/pattern_trie.go deleted file mode 100644 index a4239c3cb53..00000000000 --- a/libs/dyn/pattern_trie.go +++ /dev/null @@ -1,172 +0,0 @@ -package dyn - -import ( - "fmt" -) - -// TrieNode is a trie data structure for storing and querying patterns. -// It supports both exact matches and wildcard matches. You can insert [Pattern]s -// into the trie and then query it to see if a given [Path] matches any of the -// patterns. -// -// TrieNode represents a node in the pattern trie. -// Each node in the array represents one or more of: -// 1. An [AnyKey] component. This is the "*" wildcard which matches any map key. -// 2. An [AnyIndex] component. This is the "[*]" wildcard which matches any array index. -// 3. Multiple [Key] components. These are multiple static path keys for this node would match. -// -// Note: It's valid for both anyKey and pathKey to be set at the same time. -// For example, adding both "foo.*.bar" and "foo.bar" to a trie is valid. -// -// Note: Setting both key (one of pathKey or anyKey) and index (anyIndex) -// is not supported by the [PatternTrie.SearchPath] method. We don't perform validation for this -// case because it's not expected to arise in practice where a field is either a map or an array, -// but not both. -type TrieNode struct { - // If set this indicates the trie node is an AnyKey node. - // Maps to the [AnyKey] component. - AnyKey *TrieNode - - // Indicates the trie node is an AnyIndex node. - // Maps to the [AnyIndex] component. - AnyIndex *TrieNode - - // Set of strings which this trie node matches. - // Maps to the [Key] component. - PathKey map[string]*TrieNode - - // Indicates if this node is the end of a pattern. Encountering a node - // with IsEnd set to true in a trie means the pattern from the root to this - // node is a complete pattern. - IsEnd bool -} - -// Insert adds a pattern to the trie. -func (t *TrieNode) Insert(pattern Pattern) error { - // Empty pattern represents the root. - if len(pattern) == 0 { - t.IsEnd = true - return nil - } - - current := t - for i, component := range pattern { - // Create next node based on component type - var next *TrieNode - switch c := component.(type) { - case anyKeyComponent: - if current.AnyKey == nil { - current.AnyKey = &TrieNode{} - } - next = current.AnyKey - - case anyIndexComponent: - if current.AnyIndex == nil { - current.AnyIndex = &TrieNode{} - } - next = current.AnyIndex - - case pathComponent: - if key := c.Key(); key != "" { - if current.PathKey == nil { - current.PathKey = make(map[string]*TrieNode) - } - if _, exists := current.PathKey[key]; !exists { - current.PathKey[key] = &TrieNode{} - } - next = current.PathKey[key] - } else { - return fmt.Errorf("fixed index patterns are not supported: %#v", pattern) - } - } - - if next == nil { - return fmt.Errorf("invalid component type: %T", component) - } - - // Mark as end of pattern if this is the last component. - if i == len(pattern)-1 { - next.IsEnd = true - } - - // Move to next node - current = next - } - - return nil -} - -// SearchPath checks if the given path matches any pattern in the trie. -// A path matches if it exactly matches a pattern or if it matches a pattern with wildcards. -func (t *TrieNode) SearchPath(path Path) (Pattern, bool) { - // We pre-allocate the prefix array that is used to track the current - // prefix accumulated while walking the prefix tree. Pre-allocating - // ensures that we do not allocate memory on every recursive call. - prefix := make(Pattern, len(path)) - pattern, ok := t.searchPathRecursive(t, path, prefix, 0) - return pattern, ok -} - -// searchPathRecursive is a helper function that recursively checks if a path matches any pattern. -// Arguments: -// - node: the current node in the trie. -// - path: the path to check. -// - prefix: the prefix accumulated while walking the prefix tree. -// - index: the current index in the path / prefix -// -// Note we always expect the path and prefix to be the same length because wildcards like * and [*] -// only match a single path component. -func (t *TrieNode) searchPathRecursive(node *TrieNode, path Path, prefix Pattern, index int) (Pattern, bool) { - if node == nil { - return nil, false - } - - // Zero case, when the query path is the root node. We return nil here to match - // the semantics of [MustPatternFromString] which returns nil for the empty string. - // - // We cannot return a Pattern{} object here because then MustPatternFromString(""), which - // returns nil will not be equal to the Pattern{} object returned by this function. An equality - // is useful because users of this function can use it to check whether the root / empty pattern - // had been inserted into the trie. - if len(path) == 0 { - return nil, node.IsEnd - } - - // If we've reached the end of the path, check if this node is a valid end of a pattern. - isLast := index == len(path) - if isLast { - return prefix, node.IsEnd - } - - currentComponent := path[index] - - // First check if the key wildcard is set for the current index. - if currentComponent.isKey() && node.AnyKey != nil { - prefix[index] = AnyKey() - pattern, ok := t.searchPathRecursive(node.AnyKey, path, prefix, index+1) - if ok { - return pattern, true - } - } - - // If no key wildcard is set, check if the key is an exact match. - if currentComponent.isKey() { - child, exists := node.PathKey[currentComponent.Key()] - if !exists { - return nil, false - } - prefix[index] = currentComponent - return t.searchPathRecursive(child, path, prefix, index+1) - } - - if currentComponent.isIndex() && node.AnyIndex != nil { - prefix[index] = AnyIndex() - pattern, ok := t.searchPathRecursive(node.AnyIndex, path, prefix, index+1) - if ok { - return pattern, true - } - } - - // If we've reached this point, the path does not match any patterns in the trie. - return nil, false -} diff --git a/libs/dyn/pattern_trie_test.go b/libs/dyn/pattern_trie_test.go deleted file mode 100644 index 13bcad457e1..00000000000 --- a/libs/dyn/pattern_trie_test.go +++ /dev/null @@ -1,195 +0,0 @@ -package dyn_test - -import ( - "testing" - - "github.com/databricks/cli/libs/dyn" - "github.com/stretchr/testify/assert" -) - -func TestPatternTrie_SearchPath(t *testing.T) { - tests := []struct { - name string - pattern string - mustMatch []string - mustNotMatch []string - }{ - { - name: "empty pattern", - pattern: "", - mustMatch: []string{""}, - mustNotMatch: []string{"foo"}, - }, - { - name: "simple key pattern", - pattern: "foo", - mustMatch: []string{"foo"}, - mustNotMatch: []string{"foo.bar", "foo[0]", "bar"}, - }, - - { - name: "nested key pattern", - pattern: "foo.bar", - mustMatch: []string{"foo.bar"}, - mustNotMatch: []string{"foo", "foo[0]", "bar.foo", "foo.baz"}, - }, - { - name: "root wildcard", - pattern: "*", - mustMatch: []string{"foo", "bar"}, - mustNotMatch: []string{"", "bar.foo", "foo.baz"}, - }, - { - name: "wildcard * after foo", - pattern: "foo.*", - mustMatch: []string{"foo.bar", "foo.baz"}, - mustNotMatch: []string{"foo", "bar", "foo.bar.baz"}, - }, - { - name: "wildcard [*] after foo", - pattern: "foo[*]", - mustMatch: []string{"foo[0]", "foo[1]", "foo[2025]"}, - mustNotMatch: []string{"foo", "bar", "foo[0].bar"}, - }, - { - name: "key after * wildcard", - pattern: "foo.*.bar", - mustMatch: []string{"foo.abc.bar", "foo.def.bar"}, - mustNotMatch: []string{"foo", "bar", "foo.bar.baz"}, - }, - { - name: "key after [*] wildcard", - pattern: "foo[*].bar", - mustMatch: []string{"foo[0].bar", "foo[1].bar", "foo[2025].bar"}, - mustNotMatch: []string{"foo", "bar", "foo[0].baz"}, - }, - { - name: "multiple * wildcards", - pattern: "*.*.*", - mustMatch: []string{"foo.bar.baz", "foo.bar.qux"}, - mustNotMatch: []string{"foo", "bar", "foo.bar", "foo.bar.baz.qux"}, - }, - { - name: "multiple [*] wildcards", - pattern: "foo[*][*]", - mustMatch: []string{"foo[0][0]", "foo[1][1]", "foo[2025][2025]"}, - mustNotMatch: []string{"foo", "bar", "foo[0][0][0]"}, - }, - { - name: "[*] after * wildcard", - pattern: "*[*]", - mustMatch: []string{"foo[0]", "foo[1]", "foo[2025]"}, - mustNotMatch: []string{"foo", "bar", "foo[0].bar", "[0].foo"}, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - trie := &dyn.TrieNode{} - pattern := dyn.MustPatternFromString(tt.pattern) - - // None of the expected paths should match yet. - for _, path := range tt.mustMatch { - _, ok := trie.SearchPath(dyn.MustPathFromString(path)) - assert.False(t, ok) - } - for _, path := range tt.mustNotMatch { - _, ok := trie.SearchPath(dyn.MustPathFromString(path)) - assert.False(t, ok) - } - - err := trie.Insert(pattern) - assert.NoError(t, err) - - // Now all the expected paths should match. - for _, path := range tt.mustMatch { - pattern, ok := trie.SearchPath(dyn.MustPathFromString(path)) - assert.True(t, ok) - assert.Equal(t, dyn.MustPatternFromString(tt.pattern), pattern) - } - for _, path := range tt.mustNotMatch { - _, ok := trie.SearchPath(dyn.MustPathFromString(path)) - assert.False(t, ok) - } - }) - } -} - -func TestPatternTrie_MultiplePatterns(t *testing.T) { - trie := &dyn.TrieNode{} - - patterns := []string{ - "foo.bar", - "foo.*.baz", - "def[*]", - } - - mustMatch := map[string]string{ - "foo.bar": "foo.bar", - "foo.abc.baz": "foo.*.baz", - "foo.def.baz": "foo.*.baz", - "def[0]": "def[*]", - "def[1]": "def[*]", - } - - mustNotMatch := []string{ - "foo", - "abc[0]", - "abc[1]", - "def[2].x", - "foo.y", - "foo.bar.baz.qux", - } - - for _, pattern := range patterns { - err := trie.Insert(dyn.MustPatternFromString(pattern)) - assert.NoError(t, err) - } - - for path, expectedPattern := range mustMatch { - pattern, ok := trie.SearchPath(dyn.MustPathFromString(path)) - assert.True(t, ok) - assert.Equal(t, dyn.MustPatternFromString(expectedPattern), pattern) - } - - for _, path := range mustNotMatch { - _, ok := trie.SearchPath(dyn.MustPathFromString(path)) - assert.False(t, ok) - } -} - -func TestPatternTrie_OverlappingPatterns(t *testing.T) { - trie := &dyn.TrieNode{} - - // Insert overlapping patterns - patterns := []string{ - "foo.bar", - "foo.*", - "*.bar", - "*.*", - } - - for _, pattern := range patterns { - err := trie.Insert(dyn.MustPatternFromString(pattern)) - assert.NoError(t, err) - } - - for _, path := range []string{ - "foo.bar", - "foo.baz", - "baz.bar", - "baz.qux", - } { - _, ok := trie.SearchPath(dyn.MustPathFromString(path)) - assert.True(t, ok) - } -} - -func TestPatternTrie_FixedIndexPatterns(t *testing.T) { - trie := &dyn.TrieNode{} - - err := trie.Insert(dyn.MustPatternFromString("foo[0]")) - assert.EqualError(t, err, "fixed index patterns are not supported: dyn.Pattern{dyn.pathComponent{key:\"foo\", index:0}, dyn.pathComponent{key:\"\", index:0}}") - - err = trie.Insert(dyn.MustPatternFromString("foo[2]")) - assert.EqualError(t, err, "fixed index patterns are not supported: dyn.Pattern{dyn.pathComponent{key:\"foo\", index:0}, dyn.pathComponent{key:\"\", index:2}}") -} From e8a5ecc4fb1363afbfb9b6a6ef04566bf087234e Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Thu, 22 Oct 2026 11:44:47 +0200 Subject: [PATCH 5/5] Regenerate the walkers after the SDK update to v0.190.0 Co-authored-by: Isaac --- bundle/config/validate/enum_walk.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bundle/config/validate/enum_walk.go b/bundle/config/validate/enum_walk.go index c464c5697de..37add80d338 100644 --- a/bundle/config/validate/enum_walk.go +++ b/bundle/config/validate/enum_walk.go @@ -187,6 +187,8 @@ var enumValuesMlRegisteredModelPermissionLevel = []string{"CAN_EDIT", "CAN_MANAG var enumValuesMlScalarDataType = []string{"BINARY", "BOOLEAN", "DATE", "DECIMAL", "DOUBLE", "FLOAT", "INTEGER", "LONG", "SHORT", "STRING", "TIMESTAMP"} +var enumValuesMlSdpSourceState = []string{"ERROR", "PENDING", "RESOLVED"} + var enumValuesPipelinesConnectorType = []string{"CDC", "QUERY_BASED"} var enumValuesPipelinesDayOfWeek = []string{"FRIDAY", "MONDAY", "SATURDAY", "SUNDAY", "THURSDAY", "TUESDAY", "WEDNESDAY"} @@ -1501,6 +1503,9 @@ func enumMlDataSource(w *walker, n *node, v *ml.DataSource) { if c := n.child("request_source"); c.exists() { enumMlRequestSource(w, &c, v.RequestSource) } + if c := n.child("sdp_source"); c.exists() { + enumMlSdpSource(w, &c, v.SdpSource) + } } func enumComputeInstancePoolAwsAttributes(w *walker, n *node, v *compute.InstancePoolAwsAttributes) { @@ -2100,6 +2105,13 @@ func enumMlRequestSource(w *walker, n *node, v *ml.RequestSource) { } } +func enumMlSdpSource(w *walker, n *node, v *ml.SdpSource) { + if v == nil { + v = &ml.SdpSource{} + } + w.enumField(n, "pipeline_state", string(v.PipelineState), enumValuesMlSdpSourceState) +} + func enumComputeDiskType(w *walker, n *node, v *compute.DiskType) { if v == nil { v = &compute.DiskType{}