diff --git a/bundle/config/merge_parity_test.go b/bundle/config/merge_parity_test.go new file mode 100644 index 00000000000..2c6dd51f563 --- /dev/null +++ b/bundle/config/merge_parity_test.go @@ -0,0 +1,125 @@ +package config_test + +import ( + "encoding/json" + "os" + "path/filepath" + "strings" + "testing" + + "github.com/databricks/cli/bundle/config" + "github.com/databricks/cli/libs/structs/structvar" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// dynMerge merges b into a with the dynamic configuration, like includes do. +func dynMerge(t *testing.T, fa, fb string, a, b []byte) (string, bool) { + ra, diags := config.LoadDynFromBytes(fa, a) + if diags.HasError() { + return "", false + } + rb, diags := config.LoadDynFromBytes(fb, b) + if diags.HasError() { + return "", false + } + if err := ra.Merge(rb); err != nil { + return "merge error: " + err.Error(), true + } + if _, err := ra.FinishLoading(); err != nil { + return "", false + } + out, _ := json.Marshal(ra) + return string(out), true +} + +func typedMerge(t *testing.T, fa, fb string, a, b []byte) string { + var ra, rb config.Root + sva, _, err := structvar.DecodeYAML(fa, strings.NewReader(string(a)), &ra) + if err != nil { + return "decode error: " + err.Error() + } + svb, _, err := structvar.DecodeYAML(fb, strings.NewReader(string(b)), &rb) + if err != nil { + return "decode error: " + err.Error() + } + if err := sva.Merge(nil, svb.View()); err != nil { + return "merge error: " + err.Error() + } + out, _ := json.Marshal(&ra) + return string(out) +} + +// TestMergeParityWithDyn merges every ordered pair of the YAML files of a directory of +// the acceptance tests (and of its subdirectories) once with the dynamic configuration, +// like includes do, and once with structvar.Merge on the typed configuration, and +// requires the same result. The only difference is the shorthand of a target's variable +// (`foo: value` for `foo: {default: value}`), which loading rewrites before merging. +func TestMergeParityWithDyn(t *testing.T) { + root := "../../acceptance/bundle" + same, diff, skipped, sameButVars := 0, 0, 0, 0 + byDir := map[string][]string{} + err := filepath.WalkDir(root, func(p string, d os.DirEntry, err error) error { + if err == nil && !d.IsDir() && (strings.HasSuffix(p, ".yml") || strings.HasSuffix(p, ".yaml")) { + byDir[filepath.Dir(p)] = append(byDir[filepath.Dir(p)], p) + } + return nil + }) + require.NoError(t, err) + // Pairs of the files of a directory (and its subdirectories one level down). + var groups [][]string + for dir, files := range byDir { + g := append([]string(nil), files...) + for d2, f2 := range byDir { + if filepath.Dir(d2) == dir { + g = append(g, f2...) + } + } + groups = append(groups, g) + } + for _, files := range groups { + for _, fa := range files { + a, _ := os.ReadFile(fa) + for _, fb := range files { + b, _ := os.ReadFile(fb) + want, ok := dynMerge(t, fa, fb, a, b) + if !ok { + skipped++ + continue + } + got := typedMerge(t, fa, fb, a, b) + if got == want { + same++ + continue + } + if withoutTargetVariables(t, got) == withoutTargetVariables(t, want) { + sameButVars++ + continue + } + diff++ + if diff <= 12 { + t.Logf("DIFF %s + %s\n dyn: %.400s\n typed: %.400s", fa, fb, want, got) + } + } + } + } + assert.Zero(t, diff) + t.Logf("same=%d only-target-variables-differ=%d diff=%d skipped=%d", same, sameButVars, diff, skipped) +} + +// withoutTargetVariables drops the variables of the targets (the shorthand rewrite). +func withoutTargetVariables(t *testing.T, s string) string { + var m map[string]any + if json.Unmarshal([]byte(s), &m) != nil { + return s + } + if ts, ok := m["targets"].(map[string]any); ok { + for _, tv := range ts { + if tm, ok := tv.(map[string]any); ok { + delete(tm, "variables") + } + } + } + out, _ := json.Marshal(m) + return string(out) +} diff --git a/bundle/config/root.go b/bundle/config/root.go index b1a61a4a49f..1dbc24c86c9 100644 --- a/bundle/config/root.go +++ b/bundle/config/root.go @@ -824,6 +824,13 @@ func (r *Root) GetResourceConfig(path string) (any, error) { return typedConfigPtr.Interface(), nil } +// IsEmptyAt reports whether the map or slice at path was written as empty ({} or []): a +// typed value cannot tell it from an unset one. It says nothing about a value that has +// been filled in since: check that it is still empty. +func (r Root) IsEmptyAt(path *structpath.PathNode) bool { + return r.locations.Sub(path).IsEmpty() +} + // IsReferenceAt is [Root.IsReference] for a path node. func (r Root) IsReferenceAt(path *structpath.PathNode) bool { _, ok := r.refs[path.String()] diff --git a/bundle/config/root_test.go b/bundle/config/root_test.go index 4de19717daf..4b0a5625fde 100644 --- a/bundle/config/root_test.go +++ b/bundle/config/root_test.go @@ -324,3 +324,26 @@ func TestNestedYAMLAnchorCycle(t *testing.T) { _, diags := LoadFromBytes("a.yml", []byte("variables:\n v:\n default: &x {a: [*x]}\n")) assert.ErrorContains(t, diags.Error(), `cyclic reference to anchor "x"`) } + +func TestRootEmpties(t *testing.T) { + r, diags := LoadFromBytes("databricks.yml", []byte(` +resources: + jobs: + j: + name: x + permissions: [] + tags: {} + k: + name: y +`)) + require.False(t, diags.HasError(), diags) + + empty := func(name, field string) bool { + return r.IsEmptyAt(structpath.NewPath(nil, "resources", "jobs", name, field)) + } + assert.True(t, empty("j", "permissions")) + assert.True(t, empty("j", "tags")) + assert.False(t, empty("k", "permissions")) + assert.Empty(t, r.Resources.Jobs["j"].Permissions) + assert.Empty(t, r.Resources.Jobs["k"].Permissions) +} diff --git a/bundle/config/validate/enum.go b/bundle/config/validate/enum.go index 46364add693..a8637ff15be 100644 --- a/bundle/config/validate/enum.go +++ b/bundle/config/validate/enum.go @@ -4,6 +4,7 @@ import ( "context" "github.com/databricks/cli/bundle" + "github.com/databricks/cli/bundle/config/walk" "github.com/databricks/cli/libs/diag" ) @@ -20,7 +21,9 @@ func (f *enum) Name() string { // 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 := walkConfig(&b.Config, false, enumConfigRoot) + w := &walker{} + walk.Enums(&b.Config, w.enumValue) + diags := w.diags sortDiagnostics(diags) return diags } diff --git a/bundle/config/validate/enum_walk.go b/bundle/config/validate/enum_walk.go deleted file mode 100644 index 0573b7fde64..00000000000 --- a/bundle/config/validate/enum_walk.go +++ /dev/null @@ -1,3508 +0,0 @@ -// Code generated by bundle/internal/validation. DO NOT EDIT. - -// enumWalk reports 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/cli/bundle/config/walk" - "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 enumValues10 = []string{"CLASSIC_PREVIEW"} - -var enumValues100 = []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 enumValues101 = []string{"RATE_LIMIT_RENEWAL_PERIOD_HOUR", "RATE_LIMIT_RENEWAL_PERIOD_MINUTE"} - -var enumValues102 = []string{"endpoint", "service_principal", "user", "user_group"} - -var enumValues103 = []string{"CPU", "CPU_LARGE", "CPU_MEDIUM", "GPU_LARGE", "GPU_MEDIUM", "GPU_SMALL", "GPU_XLARGE", "GPU_XLARGE_8", "MULTIGPU_MEDIUM"} - -var enumValues104 = []string{"ENHANCED", "LEGACY"} - -var enumValues105 = []string{"APPEND_ONLY", "SCD_TYPE_1", "SCD_TYPE_2"} - -var enumValues106 = []string{"OAUTH", "PAT"} - -var enumValues107 = []string{"DIRECT_QUERY", "DUAL", "IMPORT"} - -var enumValues108 = []string{"DESTINATION_TYPE_EXTERNAL_FOUNDATION_MODEL", "DESTINATION_TYPE_PAY_PER_TOKEN_FOUNDATION_MODEL", "DESTINATION_TYPE_PROVISIONED_THROUGHPUT_FOUNDATION_MODEL"} - -var enumValues109 = []string{"ai21labs", "amazon-bedrock", "anthropic", "cohere", "custom", "databricks-model-serving", "google-cloud-vertex-ai", "openai", "palm"} - -var enumValues11 = []string{"NULL", "PHOTON", "STANDARD"} - -var enumValues110 = []string{"PROVISIONING_PHASE_INDEX_SCAN", "PROVISIONING_PHASE_INDEX_SORT", "PROVISIONING_PHASE_MAIN"} - -var enumValues111 = []string{"BINARY", "BOOLEAN", "DATE", "DECIMAL", "DOUBLE", "FLOAT", "INTEGER", "LONG", "SHORT", "STRING", "TIMESTAMP"} - -var enumValues112 = []string{"BLOCK", "MASK", "NONE"} - -var enumValues113 = []string{"ai21labs", "amazon", "anthropic", "cohere"} - -var enumValues114 = []string{"FILE_FORMAT_CSV", "FILE_FORMAT_EXCEL", "FILE_FORMAT_TSV"} - -var enumValues115 = []string{"PAGE_SELECTION_ALL", "PAGE_SELECTION_SUBSET"} - -var enumValues116 = []string{"FILE", "FILE_METADATA", "PERMISSION"} - -var enumValues117 = []string{"FILE", "FILE_METADATA"} - -var enumValues118 = []string{"ALL", "INLINE_ONLY", "NONE", "NON_INLINE_ONLY"} - -var enumValues119 = []string{"TEXT_HTML", "TEXT_PLAIN"} - -var enumValues12 = []string{"ACTIVE", "TRASHED"} - -var enumValues120 = []string{"FILE", "FILE_METADATA", "LIST", "PERMISSION"} - -var enumValues121 = []string{"AUCTION_AD", "AUCTION_ADGROUP", "AUCTION_ADVERTISER", "AUCTION_CAMPAIGN"} - -var enumValues122 = []string{"AUDIENCE", "BASIC", "BUSINESS_CENTER", "DSA", "GMV_MAX", "PLAYABLE_AD"} - -var enumValues123 = []string{"AVRO", "JSON", "PROTOBUF", "STRING"} - -var enumValues124 = []string{"AVRO", "BINARYFILE", "CSV", "EXCEL", "JSON", "ORC", "PARQUET", "XML"} - -var enumValues125 = []string{"ADD_NEW_COLUMNS", "ADD_NEW_COLUMNS_WITH_TYPE_WIDENING", "FAIL_ON_NEW_COLUMNS", "NONE", "RESCUE"} - -var enumValues126 = []string{"CAMPAIGN", "CAMPAIGN_GROUP", "CREATIVE"} - -var enumValues127 = []string{"ANALYTICS", "ATTRIBUTED_REVENUE_METRICS", "STATISTICS"} - -var enumValues128 = []string{"ALL", "DAILY", "MONTHLY", "YEARLY"} - -var enumValues129 = []string{"FAILFAST", "PERMISSIVE"} - -var enumValues13 = []string{"AVAILABLE", "DELETING", "FAILING_OVER", "STARTING", "STOPPED", "UPDATING"} - -var enumValues14 = []string{"PERFORMANCE_OPTIMIZED", "STANDARD"} - -var enumValues15 = []string{"EDITABLE", "UI_LOCKED"} - -var enumValues16 = []string{"MULTI_TASK", "SINGLE_TASK"} - -var enumValues17 = []string{"ENDPOINT_TYPE_READ_ONLY", "ENDPOINT_TYPE_READ_WRITE"} - -var enumValues18 = []string{"LAKEBASE_OAUTH_V1", "NO_LOGIN", "PG_PASSWORD_SCRAM_SHA_256"} - -var enumValues19 = []string{"GROUP", "SERVICE_PRINCIPAL", "USER"} - -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 enumValues20 = []string{"DATABRICKS_SUPERUSER"} - -var enumValues21 = []string{"CONTINUOUS", "SNAPSHOT", "TRIGGERED"} - -var enumValues22 = []string{"AZURE_KEYVAULT", "DATABRICKS"} - -var enumValues23 = []string{"COST_OPTIMIZED", "POLICY_UNSPECIFIED", "RELIABILITY_OPTIMIZED"} - -var enumValues24 = []string{"CLASSIC", "PRO", "REALTIME", "TYPE_UNSPECIFIED"} - -var enumValues25 = []string{"ACTIVE", "DEGRADED", "DELETING", "FAILED", "PROVISIONING", "UPDATING"} - -var enumValues26 = []string{"STANDARD", "STORAGE_OPTIMIZED"} - -var enumValues27 = []string{"FULL_TEXT", "HYBRID", "VECTOR"} - -var enumValues28 = []string{"DELTA_SYNC", "DIRECT_ACCESS"} - -var enumValues29 = []string{"EXTERNAL", "MANAGED"} - -var enumValues3 = []string{"complex"} - -var enumValues30 = []string{"EQUAL", "GREATER_THAN", "GREATER_THAN_OR_EQUAL", "IS_NOT_NULL", "IS_NULL", "LESS_THAN", "LESS_THAN_OR_EQUAL", "NOT_EQUAL"} - -var enumValues31 = []string{"ERROR", "OK", "TRIGGERED", "UNKNOWN"} - -var enumValues32 = []string{"PAUSED", "UNPAUSED"} - -var enumValues33 = []string{"AUTO_SYNC", "SNAPSHOT"} - -var enumValues34 = []string{"CRASHED", "DEPLOYING", "RUNNING", "UNAVAILABLE"} - -var enumValues35 = []string{"ACTIVE", "DELETING", "ERROR", "STARTING", "STOPPED", "STOPPING", "UPDATING"} - -var enumValues36 = []string{"CAN_MANAGE", "CAN_USE"} - -var enumValues37 = []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 enumValues38 = []string{"CAN_USE"} - -var enumValues39 = []string{"ON_DEMAND", "SPOT", "SPOT_WITH_FALLBACK"} - -var enumValues4 = []string{"overwrite", "in-place", "immutable"} - -var enumValues40 = []string{"GENERAL_PURPOSE_SSD", "THROUGHPUT_OPTIMIZED_HDD"} - -var enumValues41 = []string{"ON_DEMAND_AZURE", "SPOT_AZURE", "SPOT_WITH_FALLBACK_AZURE"} - -var enumValues42 = []string{"ON_DEMAND_GCP", "PREEMPTIBLE_GCP", "PREEMPTIBLE_WITH_FALLBACK_GCP"} - -var enumValues43 = []string{"CONFIDENTIAL_COMPUTE_TYPE_NONE", "SEV_SNP"} - -var enumValues44 = []string{"CAN_ATTACH_TO", "CAN_MANAGE", "CAN_RESTART"} - -var enumValues45 = []string{"CAN_EDIT", "CAN_MANAGE", "CAN_READ"} - -var enumValues46 = []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 enumValues47 = []string{"ON_DEMAND", "SPOT"} - -var enumValues48 = []string{"ON_DEMAND_AZURE", "SPOT_AZURE"} - -var enumValues49 = []string{"CAN_ATTACH_TO", "CAN_MANAGE"} - -var enumValues5 = []string{"HTML", "MARKDOWN"} - -var enumValues50 = []string{"NEVER", "ON_FAILURE"} - -var enumValues51 = []string{"BUNDLE", "SYSTEM_MANAGED"} - -var enumValues52 = []string{"awsCodeCommit", "azureDevOpsServices", "bitbucketCloud", "bitbucketServer", "gitHub", "gitHubEnterprise", "gitLab", "gitLabEnterpriseEdition"} - -var enumValues53 = []string{"CAN_MANAGE", "CAN_MANAGE_RUN", "CAN_VIEW", "IS_OWNER"} - -var enumValues54 = []string{"ALL_DONE", "ALL_FAILED", "ALL_SUCCESS", "AT_LEAST_ONE_FAILED", "AT_LEAST_ONE_SUCCESS", "NONE_FAILED"} - -var enumValues55 = []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 enumValues56 = []string{"CAN_MANAGE", "CAN_QUERY", "CAN_VIEW"} - -var enumValues57 = []string{"endpoint", "user"} - -var enumValues58 = []string{"minute"} - -var enumValues59 = []string{"TELEMETRY_FEATURE_INFERENCE_TABLE", "TELEMETRY_FEATURE_LOGS", "TELEMETRY_FEATURE_METRICS", "TELEMETRY_FEATURE_TRACES"} - -var enumValues6 = []string{"ACTIVE", "DELETED"} - -var enumValues60 = []string{"CAN_EDIT", "CAN_MANAGE", "CAN_MANAGE_PRODUCTION_VERSIONS", "CAN_MANAGE_STAGING_VERSIONS", "CAN_READ"} - -var enumValues61 = []string{"BUNDLE"} - -var enumValues62 = []string{"CDC", "QUERY_BASED"} - -var enumValues63 = []string{"BIGQUERY", "CONFLUENCE", "DYNAMICS365", "FOREIGN_CATALOG", "GA4_RAW_DATA", "GOOGLE_DRIVE", "JIRA", "MANAGED_POSTGRESQL", "META_MARKETING", "MYSQL", "NETSUITE", "ONEDRIVE", "ORACLE", "POSTGRESQL", "RABBITMQ", "SALESFORCE", "SERVICENOW", "SHAREPOINT", "SMARTSHEET", "SQLSERVER", "TERADATA", "TIKTOK_ADS", "WORKDAY_RAAS", "ZENDESK"} - -var enumValues64 = []string{"CAN_MANAGE", "CAN_RUN", "CAN_VIEW", "IS_OWNER"} - -var enumValues65 = []string{"FRIDAY", "MONDAY", "SATURDAY", "SUNDAY", "THURSDAY", "TUESDAY", "WEDNESDAY"} - -var enumValues66 = []string{"STORED_GENERATED"} - -var enumValues67 = []string{"CURRENT", "PREVIEW"} - -var enumValues68 = []string{"PG_SPECIFIC_TYPE_HALFVEC", "PG_SPECIFIC_TYPE_VARCHAR", "PG_SPECIFIC_TYPE_VECTOR"} - -var enumValues69 = []string{"CUSTOM_METRIC_TYPE_AGGREGATE", "CUSTOM_METRIC_TYPE_DERIVED", "CUSTOM_METRIC_TYPE_DRIFT"} - -var enumValues7 = []string{"LARGE", "MEDIUM", "XLARGE"} - -var enumValues70 = []string{"PROBLEM_TYPE_CLASSIFICATION", "PROBLEM_TYPE_REGRESSION"} - -var enumValues71 = []string{"PAUSED", "UNPAUSED", "UNSPECIFIED"} - -var enumValues72 = []string{"READ", "WRITE", "MANAGE"} - -var enumValues73 = []string{"CHANNEL_NAME_CURRENT", "CHANNEL_NAME_CUSTOM", "CHANNEL_NAME_PREVIEW", "CHANNEL_NAME_PREVIOUS"} - -var enumValues74 = []string{"CAN_MANAGE", "CAN_MONITOR", "CAN_USE", "CAN_VIEW", "IS_OWNER"} - -var enumValues75 = []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 enumValues76 = []string{"CAN_CREATE", "CAN_MANAGE", "CAN_USE"} - -var enumValues77 = []string{"CONTINUOUS", "TRIGGERED"} - -var enumValues78 = []string{"AVG", "COUNT", "COUNT_DISTINCT", "MAX", "MEDIAN", "MIN", "STDDEV", "SUM"} - -var enumValues79 = []string{"CANCELLED", "FAILED", "IN_PROGRESS", "SUCCEEDED"} - -var enumValues8 = []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 enumValues80 = []string{"CAN_CONNECT_AND_CREATE"} - -var enumValues81 = []string{"CAN_EDIT", "CAN_MANAGE", "CAN_RUN", "CAN_VIEW"} - -var enumValues82 = []string{"MANAGE", "READ", "WRITE"} - -var enumValues83 = []string{"CAN_MANAGE", "CAN_USE", "IS_OWNER"} - -var enumValues84 = []string{"EXECUTE", "MODIFY", "READ_VOLUME", "SELECT", "USE_CONNECTION", "WRITE_VOLUME"} - -var enumValues85 = []string{"CONNECTION", "FUNCTION", "MODEL_SERVICE", "TABLE", "VOLUME"} - -var enumValues86 = []string{"AWS_SSE_KMS", "AWS_SSE_S3"} - -var enumValues87 = []string{"ERROR", "PENDING", "RESOLVED"} - -var enumValues88 = []string{"PREMIUM_LRS", "STANDARD_LRS"} - -var enumValues89 = []string{"DISCONNECTED", "NOT_SYNCED"} - -var enumValues9 = []string{"DEPENDENCY_MODE_AUTO", "DEPENDENCY_MODE_CLUSTER_LIBRARIES", "DEPENDENCY_MODE_ENVIRONMENTS"} - -var enumValues90 = []string{"RUN_DURATION_SECONDS", "STREAMING_BACKLOG_BYTES", "STREAMING_BACKLOG_FILES", "STREAMING_BACKLOG_RECORDS", "STREAMING_BACKLOG_SECONDS"} - -var enumValues91 = []string{"GREATER_THAN"} - -var enumValues92 = []string{"QUERY_RETURNS_ROWS", "RESULT_VALUE_CHANGES"} - -var enumValues93 = []string{"BEST_EFFORT", "CRITICAL", "NORMAL"} - -var enumValues94 = []string{"GPU_1xA10", "GPU_1xH100", "GPU_8xB300", "GPU_8xH100"} - -var enumValues95 = []string{"EQUAL_TO", "GREATER_THAN", "GREATER_THAN_OR_EQUAL", "LESS_THAN", "LESS_THAN_OR_EQUAL", "NOT_EQUAL"} - -var enumValues96 = []string{"GIT", "WORKSPACE"} - -var enumValues97 = []string{"MODEL_ALIAS_SET", "MODEL_CREATED", "MODEL_VERSION_READY"} - -var enumValues98 = []string{"DAYS", "HOURS", "MINUTES", "WEEKS"} - -var enumValues99 = []string{"ALL_UPDATED", "ANY_UPDATED"} - -func enumConfigRoot(w *walker, n *walk.Node, v *config.Root) { - if v == nil { - return - } - if len(v.Artifacts) > 0 { - c := n.Child("artifacts") - for k, x := range v.Artifacts { - if k == "" { - continue - } - e := c.Child(k) - enumConfigArtifact(w, &e, x) - } - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesPermission(w, &e, &v.Permissions[i]) - } - } - if x := &v.Resources; !walk.IsZeroStruct(x) || n.HasRefs("resources") { - c := n.Child("resources") - enumConfigResources(w, &c, x) - } - if len(v.Variables) > 0 { - c := n.Child("variables") - for k, x := range v.Variables { - if k == "" { - continue - } - e := c.Child(k) - enumVariableVariable(w, &e, x) - } - } - if x := &v.Workspace; !walk.IsZeroStruct(x) || n.HasRefs("workspace") { - c := n.Child("workspace") - enumConfigWorkspace(w, &c, x) - } -} - -func enumConfigArtifact(w *walker, n *walk.Node, v *config.Artifact) { - if v == nil { - return - } - if s := string(v.Executable); s != "" { - c := n.Child("executable") - w.enumValue(&c, s, enumValues0) - } - if s := string(v.Type); s != "" { - c := n.Child("type") - w.enumValue(&c, s, enumValues1) - } -} - -func enumResourcesPermission(w *walker, n *walk.Node, v *resources.Permission) { - if v == nil { - return - } - if s := string(v.Level); s != "" { - c := n.Child("level") - w.enumValue(&c, s, enumValues2) - } -} - -func enumConfigResources(w *walker, n *walk.Node, v *config.Resources) { - if v == nil { - return - } - if len(v.Alerts) > 0 { - c := n.Child("alerts") - for k, x := range v.Alerts { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesAlert(w, &e, x) - } - } - if len(v.Apps) > 0 { - c := n.Child("apps") - for k, x := range v.Apps { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesApp(w, &e, x) - } - } - if len(v.Catalogs) > 0 { - c := n.Child("catalogs") - for k, x := range v.Catalogs { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesCatalog(w, &e, x) - } - } - if len(v.ClusterPolicies) > 0 { - c := n.Child("cluster_policies") - for k, x := range v.ClusterPolicies { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesClusterPolicy(w, &e, x) - } - } - if len(v.Clusters) > 0 { - c := n.Child("clusters") - for k, x := range v.Clusters { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesCluster(w, &e, x) - } - } - if len(v.Dashboards) > 0 { - c := n.Child("dashboards") - for k, x := range v.Dashboards { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesDashboard(w, &e, x) - } - } - if len(v.DatabaseInstances) > 0 { - c := n.Child("database_instances") - for k, x := range v.DatabaseInstances { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesDatabaseInstance(w, &e, x) - } - } - if len(v.Experiments) > 0 { - c := n.Child("experiments") - for k, x := range v.Experiments { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesMlflowExperiment(w, &e, x) - } - } - if len(v.ExternalLocations) > 0 { - c := n.Child("external_locations") - for k, x := range v.ExternalLocations { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesExternalLocation(w, &e, x) - } - } - if len(v.Features) > 0 { - c := n.Child("features") - for k, x := range v.Features { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesFeature(w, &e, x) - } - } - if len(v.GenieSpaces) > 0 { - c := n.Child("genie_spaces") - for k, x := range v.GenieSpaces { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesGenieSpace(w, &e, x) - } - } - if len(v.InstancePools) > 0 { - c := n.Child("instance_pools") - for k, x := range v.InstancePools { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesInstancePool(w, &e, x) - } - } - if len(v.JobRuns) > 0 { - c := n.Child("job_runs") - for k, x := range v.JobRuns { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesJobRun(w, &e, x) - } - } - if len(v.Jobs) > 0 { - c := n.Child("jobs") - for k, x := range v.Jobs { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesJob(w, &e, x) - } - } - if len(v.McpServices) > 0 { - c := n.Child("mcp_services") - for k, x := range v.McpServices { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesMcpService(w, &e, x) - } - } - if len(v.ModelProviderServices) > 0 { - c := n.Child("model_provider_services") - for k, x := range v.ModelProviderServices { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesModelProviderService(w, &e, x) - } - } - if len(v.ModelServices) > 0 { - c := n.Child("model_services") - for k, x := range v.ModelServices { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesModelService(w, &e, x) - } - } - if len(v.ModelServingEndpoints) > 0 { - c := n.Child("model_serving_endpoints") - for k, x := range v.ModelServingEndpoints { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesModelServingEndpoint(w, &e, x) - } - } - if len(v.Models) > 0 { - c := n.Child("models") - for k, x := range v.Models { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesMlflowModel(w, &e, x) - } - } - if len(v.Pipelines) > 0 { - c := n.Child("pipelines") - for k, x := range v.Pipelines { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesPipeline(w, &e, x) - } - } - if len(v.PostgresEndpoints) > 0 { - c := n.Child("postgres_endpoints") - for k, x := range v.PostgresEndpoints { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesPostgresEndpoint(w, &e, x) - } - } - if len(v.PostgresProjects) > 0 { - c := n.Child("postgres_projects") - for k, x := range v.PostgresProjects { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesPostgresProject(w, &e, x) - } - } - if len(v.PostgresRoles) > 0 { - c := n.Child("postgres_roles") - for k, x := range v.PostgresRoles { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesPostgresRole(w, &e, x) - } - } - if len(v.PostgresSnapshotSchedules) > 0 { - c := n.Child("postgres_snapshot_schedules") - for k, x := range v.PostgresSnapshotSchedules { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesPostgresSnapshotSchedule(w, &e, x) - } - } - if len(v.PostgresSyncedTables) > 0 { - c := n.Child("postgres_synced_tables") - for k, x := range v.PostgresSyncedTables { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesPostgresSyncedTable(w, &e, x) - } - } - if len(v.QualityMonitors) > 0 { - c := n.Child("quality_monitors") - for k, x := range v.QualityMonitors { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesQualityMonitor(w, &e, x) - } - } - if len(v.RegisteredModels) > 0 { - c := n.Child("registered_models") - for k, x := range v.RegisteredModels { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesRegisteredModel(w, &e, x) - } - } - if len(v.Schemas) > 0 { - c := n.Child("schemas") - for k, x := range v.Schemas { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesSchema(w, &e, x) - } - } - if len(v.SecretScopes) > 0 { - c := n.Child("secret_scopes") - for k, x := range v.SecretScopes { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesSecretScope(w, &e, x) - } - } - if len(v.Secrets) > 0 { - c := n.Child("secrets") - for k, x := range v.Secrets { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesSecret(w, &e, x) - } - } - if len(v.SqlWarehouses) > 0 { - c := n.Child("sql_warehouses") - for k, x := range v.SqlWarehouses { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesSqlWarehouse(w, &e, x) - } - } - if len(v.SyncedDatabaseTables) > 0 { - c := n.Child("synced_database_tables") - for k, x := range v.SyncedDatabaseTables { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesSyncedDatabaseTable(w, &e, x) - } - } - if len(v.VectorSearchEndpoints) > 0 { - c := n.Child("vector_search_endpoints") - for k, x := range v.VectorSearchEndpoints { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesVectorSearchEndpoint(w, &e, x) - } - } - if len(v.VectorSearchIndexes) > 0 { - c := n.Child("vector_search_indexes") - for k, x := range v.VectorSearchIndexes { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesVectorSearchIndex(w, &e, x) - } - } - if len(v.Volumes) > 0 { - c := n.Child("volumes") - for k, x := range v.Volumes { - if k == "" { - continue - } - e := c.Child(k) - enumResourcesVolume(w, &e, x) - } - } -} - -func enumVariableVariable(w *walker, n *walk.Node, v *variable.Variable) { - if v == nil { - return - } - if s := string(v.Type); s != "" { - c := n.Child("type") - w.enumValue(&c, s, enumValues3) - } -} - -func enumConfigWorkspace(w *walker, n *walk.Node, v *config.Workspace) { - if v == nil { - return - } - if s := string(v.SyncMode); s != "" { - c := n.Child("sync_mode") - w.enumValue(&c, s, enumValues4) - } -} - -func enumResourcesAlert(w *walker, n *walk.Node, v *resources.Alert) { - if v == nil { - return - } - if s := string(v.AlertV2.CustomTemplateFormat); s != "" || walk.Forced(v.AlertV2.ForceSendFields, "CustomTemplateFormat") { - c := n.Child("custom_template_format") - w.enumValue(&c, s, enumValues5) - } - if x := &v.AlertV2.Evaluation; !walk.IsZeroStruct(x) || walk.Forced(v.AlertV2.ForceSendFields, "Evaluation") || n.HasRefs("evaluation") { - c := n.Child("evaluation") - enumSqlAlertV2Evaluation(w, &c, x) - } - if s := string(v.AlertV2.LifecycleState); s != "" || walk.Forced(v.AlertV2.ForceSendFields, "LifecycleState") { - c := n.Child("lifecycle_state") - w.enumValue(&c, s, enumValues6) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesPermission(w, &e, &v.Permissions[i]) - } - } - if x := &v.AlertV2.Schedule; !walk.IsZeroStruct(x) || walk.Forced(v.AlertV2.ForceSendFields, "Schedule") || n.HasRefs("schedule") { - c := n.Child("schedule") - enumSqlCronSchedule(w, &c, x) - } -} - -func enumResourcesApp(w *walker, n *walk.Node, v *resources.App) { - if v == nil { - return - } - if x := v.App.ActiveDeployment; x != nil { - c := n.Child("active_deployment") - enumAppsAppDeployment(w, &c, x) - } - if x := v.App.AppStatus; x != nil { - c := n.Child("app_status") - enumAppsApplicationStatus(w, &c, x) - } - if s := string(v.App.ComputeSize); s != "" || walk.Forced(v.App.ForceSendFields, "ComputeSize") { - c := n.Child("compute_size") - w.enumValue(&c, s, enumValues7) - } - if x := v.App.ComputeStatus; x != nil { - c := n.Child("compute_status") - enumAppsComputeStatus(w, &c, x) - } - if x := v.App.PendingDeployment; x != nil { - c := n.Child("pending_deployment") - enumAppsAppDeployment(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesAppPermission(w, &e, &v.Permissions[i]) - } - } - if len(v.App.Resources) > 0 { - c := n.Child("resources") - for i := range v.App.Resources { - e := c.Elem(i) - enumAppsAppResource(w, &e, &v.App.Resources[i]) - } - } -} - -func enumResourcesCatalog(w *walker, n *walk.Node, v *resources.Catalog) { - if v == nil { - return - } - if len(v.Grants) > 0 { - c := n.Child("grants") - for i := range v.Grants { - e := c.Elem(i) - enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i]) - } - } -} - -func enumResourcesClusterPolicy(w *walker, n *walk.Node, v *resources.ClusterPolicy) { - if v == nil { - return - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesClusterPolicyPermission(w, &e, &v.Permissions[i]) - } - } -} - -func enumResourcesCluster(w *walker, n *walk.Node, v *resources.Cluster) { - if v == nil { - return - } - if x := v.ClusterSpec.AwsAttributes; x != nil { - c := n.Child("aws_attributes") - enumComputeAwsAttributes(w, &c, x) - } - if x := v.ClusterSpec.AzureAttributes; x != nil { - c := n.Child("azure_attributes") - enumComputeAzureAttributes(w, &c, x) - } - if s := string(v.ClusterSpec.DataSecurityMode); s != "" || walk.Forced(v.ClusterSpec.ForceSendFields, "DataSecurityMode") { - c := n.Child("data_security_mode") - w.enumValue(&c, s, enumValues8) - } - if s := string(v.ClusterSpec.DependencyMode); s != "" || walk.Forced(v.ClusterSpec.ForceSendFields, "DependencyMode") { - c := n.Child("dependency_mode") - w.enumValue(&c, s, enumValues9) - } - if x := v.ClusterSpec.GcpAttributes; x != nil { - c := n.Child("gcp_attributes") - enumComputeGcpAttributes(w, &c, x) - } - if s := string(v.ClusterSpec.Kind); s != "" || walk.Forced(v.ClusterSpec.ForceSendFields, "Kind") { - c := n.Child("kind") - w.enumValue(&c, s, enumValues10) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesClusterPermission(w, &e, &v.Permissions[i]) - } - } - if s := string(v.ClusterSpec.RuntimeEngine); s != "" || walk.Forced(v.ClusterSpec.ForceSendFields, "RuntimeEngine") { - c := n.Child("runtime_engine") - w.enumValue(&c, s, enumValues11) - } -} - -func enumResourcesDashboard(w *walker, n *walk.Node, v *resources.Dashboard) { - if v == nil { - return - } - if s := string(v.DashboardConfig.LifecycleState); s != "" || walk.Forced(v.DashboardConfig.ForceSendFields, "LifecycleState") { - c := n.Child("lifecycle_state") - w.enumValue(&c, s, enumValues12) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesPermission(w, &e, &v.Permissions[i]) - } - } -} - -func enumResourcesDatabaseInstance(w *walker, n *walk.Node, v *resources.DatabaseInstance) { - if v == nil { - return - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesPermission(w, &e, &v.Permissions[i]) - } - } - if s := string(v.DatabaseInstance.State); s != "" || walk.Forced(v.DatabaseInstance.ForceSendFields, "State") { - c := n.Child("state") - w.enumValue(&c, s, enumValues13) - } -} - -func enumResourcesMlflowExperiment(w *walker, n *walk.Node, v *resources.MlflowExperiment) { - if v == nil { - return - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesMlflowExperimentPermission(w, &e, &v.Permissions[i]) - } - } -} - -func enumResourcesExternalLocation(w *walker, n *walk.Node, v *resources.ExternalLocation) { - if v == nil { - return - } - if x := v.CreateExternalLocation.EncryptionDetails; x != nil { - c := n.Child("encryption_details") - enumCatalogEncryptionDetails(w, &c, x) - } - if len(v.Grants) > 0 { - c := n.Child("grants") - for i := range v.Grants { - e := c.Elem(i) - enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i]) - } - } -} - -func enumResourcesFeature(w *walker, n *walk.Node, v *resources.Feature) { - if v == nil { - return - } - if x := &v.Feature.Function; !walk.IsZeroStruct(x) || walk.Forced(v.Feature.ForceSendFields, "Function") || n.HasRefs("function") { - c := n.Child("function") - enumMlFunction(w, &c, x) - } - if x := &v.Feature.Source; !walk.IsZeroStruct(x) || walk.Forced(v.Feature.ForceSendFields, "Source") || n.HasRefs("source") { - c := n.Child("source") - enumMlDataSource(w, &c, x) - } -} - -func enumResourcesGenieSpace(w *walker, n *walk.Node, v *resources.GenieSpace) { - if v == nil { - return - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesPermission(w, &e, &v.Permissions[i]) - } - } -} - -func enumResourcesInstancePool(w *walker, n *walk.Node, v *resources.InstancePool) { - if v == nil { - return - } - if x := v.CreateInstancePool.AwsAttributes; x != nil { - c := n.Child("aws_attributes") - enumComputeInstancePoolAwsAttributes(w, &c, x) - } - if x := v.CreateInstancePool.AzureAttributes; x != nil { - c := n.Child("azure_attributes") - enumComputeInstancePoolAzureAttributes(w, &c, x) - } - if x := v.CreateInstancePool.DiskSpec; x != nil { - c := n.Child("disk_spec") - enumComputeDiskSpec(w, &c, x) - } - if x := v.CreateInstancePool.GcpAttributes; x != nil { - c := n.Child("gcp_attributes") - enumComputeInstancePoolGcpAttributes(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesInstancePoolPermission(w, &e, &v.Permissions[i]) - } - } -} - -func enumResourcesJobRun(w *walker, n *walk.Node, v *resources.JobRun) { - if v == nil { - return - } - if s := string(v.RunNow.PerformanceTarget); s != "" || walk.Forced(v.RunNow.ForceSendFields, "PerformanceTarget") { - c := n.Child("performance_target") - w.enumValue(&c, s, enumValues14) - } -} - -func enumResourcesJob(w *walker, n *walk.Node, v *resources.Job) { - if v == nil { - return - } - if x := v.JobSettings.Continuous; x != nil { - c := n.Child("continuous") - enumJobsContinuous(w, &c, x) - } - if x := v.JobSettings.Deployment; x != nil { - c := n.Child("deployment") - enumJobsJobDeployment(w, &c, x) - } - if s := string(v.JobSettings.EditMode); s != "" || walk.Forced(v.JobSettings.ForceSendFields, "EditMode") { - c := n.Child("edit_mode") - w.enumValue(&c, s, enumValues15) - } - if s := string(v.JobSettings.Format); s != "" || walk.Forced(v.JobSettings.ForceSendFields, "Format") { - c := n.Child("format") - w.enumValue(&c, s, enumValues16) - } - if x := v.JobSettings.GitSource; x != nil { - c := n.Child("git_source") - enumJobsGitSource(w, &c, x) - } - if x := v.JobSettings.Health; x != nil { - c := n.Child("health") - enumJobsJobsHealthRules(w, &c, x) - } - if len(v.JobSettings.JobClusters) > 0 { - c := n.Child("job_clusters") - for i := range v.JobSettings.JobClusters { - e := c.Elem(i) - enumJobsJobCluster(w, &e, &v.JobSettings.JobClusters[i]) - } - } - if s := string(v.JobSettings.PerformanceTarget); s != "" || walk.Forced(v.JobSettings.ForceSendFields, "PerformanceTarget") { - c := n.Child("performance_target") - w.enumValue(&c, s, enumValues14) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesJobPermission(w, &e, &v.Permissions[i]) - } - } - if x := v.JobSettings.Schedule; x != nil { - c := n.Child("schedule") - enumJobsCronSchedule(w, &c, x) - } - if len(v.JobSettings.Tasks) > 0 { - c := n.Child("tasks") - for i := range v.JobSettings.Tasks { - e := c.Elem(i) - enumJobsTask(w, &e, &v.JobSettings.Tasks[i]) - } - } - if x := v.JobSettings.Trigger; x != nil { - c := n.Child("trigger") - enumJobsTriggerSettings(w, &c, x) - } - if len(v.JobSettings.Triggers) > 0 { - c := n.Child("triggers") - for i := range v.JobSettings.Triggers { - e := c.Elem(i) - enumJobsTriggerConfiguration(w, &e, &v.JobSettings.Triggers[i]) - } - } -} - -func enumResourcesMcpService(w *walker, n *walk.Node, v *resources.McpService) { - if v == nil { - return - } - if x := v.McpServiceConfig.Config; x != nil { - c := n.Child("config") - enumCatalogMcpServiceConfig(w, &c, x) - } - if len(v.Grants) > 0 { - c := n.Child("grants") - for i := range v.Grants { - e := c.Elem(i) - enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i]) - } - } -} - -func enumResourcesModelProviderService(w *walker, n *walk.Node, v *resources.ModelProviderService) { - if v == nil { - return - } - if x := v.ModelProviderServiceConfig.Config; x != nil { - c := n.Child("config") - enumCatalogModelProviderServiceConfig(w, &c, x) - } - if len(v.Grants) > 0 { - c := n.Child("grants") - for i := range v.Grants { - e := c.Elem(i) - enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i]) - } - } -} - -func enumResourcesModelService(w *walker, n *walk.Node, v *resources.ModelService) { - if v == nil { - return - } - if x := v.ModelServiceConfig.Config; x != nil { - c := n.Child("config") - enumCatalogModelServiceConfig(w, &c, x) - } - if len(v.Grants) > 0 { - c := n.Child("grants") - for i := range v.Grants { - e := c.Elem(i) - enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i]) - } - } -} - -func enumResourcesModelServingEndpoint(w *walker, n *walk.Node, v *resources.ModelServingEndpoint) { - if v == nil { - return - } - if x := v.CreateServingEndpoint.AiGateway; x != nil { - c := n.Child("ai_gateway") - enumServingAiGatewayConfig(w, &c, x) - } - if x := v.CreateServingEndpoint.Config; x != nil { - c := n.Child("config") - enumServingEndpointCoreConfigInput(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesModelServingEndpointPermission(w, &e, &v.Permissions[i]) - } - } - if len(v.CreateServingEndpoint.RateLimits) > 0 { - c := n.Child("rate_limits") - for i := range v.CreateServingEndpoint.RateLimits { - e := c.Elem(i) - enumServingRateLimit(w, &e, &v.CreateServingEndpoint.RateLimits[i]) - } - } - if x := v.CreateServingEndpoint.TelemetryConfig; x != nil { - c := n.Child("telemetry_config") - enumServingTelemetryConfig(w, &c, x) - } -} - -func enumResourcesMlflowModel(w *walker, n *walk.Node, v *resources.MlflowModel) { - if v == nil { - return - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesMlflowModelPermission(w, &e, &v.Permissions[i]) - } - } -} - -func enumResourcesPipeline(w *walker, n *walk.Node, v *resources.Pipeline) { - if v == nil { - return - } - if len(v.CreatePipeline.Clusters) > 0 { - c := n.Child("clusters") - for i := range v.CreatePipeline.Clusters { - e := c.Elem(i) - enumPipelinesPipelineCluster(w, &e, &v.CreatePipeline.Clusters[i]) - } - } - if x := v.CreatePipeline.Deployment; x != nil { - c := n.Child("deployment") - enumPipelinesPipelineDeployment(w, &c, x) - } - if x := v.CreatePipeline.IngestionDefinition; x != nil { - c := n.Child("ingestion_definition") - enumPipelinesIngestionPipelineDefinition(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesPipelinePermission(w, &e, &v.Permissions[i]) - } - } - if x := v.CreatePipeline.RestartWindow; x != nil { - c := n.Child("restart_window") - enumPipelinesRestartWindow(w, &c, x) - } -} - -func enumResourcesPostgresEndpoint(w *walker, n *walk.Node, v *resources.PostgresEndpoint) { - if v == nil { - return - } - if s := string(v.PostgresEndpointConfig.EndpointSpec.EndpointType); s != "" || walk.Forced(v.PostgresEndpointConfig.EndpointSpec.ForceSendFields, "EndpointType") { - c := n.Child("endpoint_type") - w.enumValue(&c, s, enumValues17) - } -} - -func enumResourcesPostgresProject(w *walker, n *walk.Node, v *resources.PostgresProject) { - if v == nil { - return - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesPermission(w, &e, &v.Permissions[i]) - } - } -} - -func enumResourcesPostgresRole(w *walker, n *walk.Node, v *resources.PostgresRole) { - if v == nil { - return - } - if s := string(v.PostgresRoleConfig.RoleRoleSpec.AuthMethod); s != "" || walk.Forced(v.PostgresRoleConfig.RoleRoleSpec.ForceSendFields, "AuthMethod") { - c := n.Child("auth_method") - w.enumValue(&c, s, enumValues18) - } - if s := string(v.PostgresRoleConfig.RoleRoleSpec.IdentityType); s != "" || walk.Forced(v.PostgresRoleConfig.RoleRoleSpec.ForceSendFields, "IdentityType") { - c := n.Child("identity_type") - w.enumValue(&c, s, enumValues19) - } - if len(v.PostgresRoleConfig.RoleRoleSpec.MembershipRoles) > 0 { - c := n.Child("membership_roles") - for i := range v.PostgresRoleConfig.RoleRoleSpec.MembershipRoles { - e := c.Elem(i) - w.enumValue(&e, string(v.PostgresRoleConfig.RoleRoleSpec.MembershipRoles[i]), enumValues20) - } - } -} - -func enumResourcesPostgresSnapshotSchedule(w *walker, n *walk.Node, v *resources.PostgresSnapshotSchedule) { - if v == nil { - return - } - if len(v.PostgresSnapshotScheduleConfig.Schedule) > 0 { - c := n.Child("schedule") - for i := range v.PostgresSnapshotScheduleConfig.Schedule { - e := c.Elem(i) - enumPostgresScheduleCadence(w, &e, &v.PostgresSnapshotScheduleConfig.Schedule[i]) - } - } -} - -func enumResourcesPostgresSyncedTable(w *walker, n *walk.Node, v *resources.PostgresSyncedTable) { - if v == nil { - return - } - if len(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExtraColumns) > 0 { - c := n.Child("extra_columns") - for i := range v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExtraColumns { - e := c.Elem(i) - enumPostgresSyncedTableSyncedTableSpecExtraColumn(w, &e, &v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExtraColumns[i]) - } - } - if x := v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.NewPipelineSpec; x != nil { - c := n.Child("new_pipeline_spec") - enumPostgresNewPipelineSpec(w, &c, x) - } - if s := string(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.SchedulingPolicy); s != "" || walk.Forced(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ForceSendFields, "SchedulingPolicy") { - c := n.Child("scheduling_policy") - w.enumValue(&c, s, enumValues21) - } - if len(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides) > 0 { - c := n.Child("type_overrides") - for i := range v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides { - e := c.Elem(i) - enumPostgresSyncedTableSyncedTableSpecTypeOverride(w, &e, &v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides[i]) - } - } -} - -func enumResourcesQualityMonitor(w *walker, n *walk.Node, v *resources.QualityMonitor) { - if v == nil { - return - } - if len(v.CreateMonitor.CustomMetrics) > 0 { - c := n.Child("custom_metrics") - for i := range v.CreateMonitor.CustomMetrics { - e := c.Elem(i) - enumCatalogMonitorMetric(w, &e, &v.CreateMonitor.CustomMetrics[i]) - } - } - if x := v.CreateMonitor.InferenceLog; x != nil { - c := n.Child("inference_log") - enumCatalogMonitorInferenceLog(w, &c, x) - } - if x := v.CreateMonitor.Schedule; x != nil { - c := n.Child("schedule") - enumCatalogMonitorCronSchedule(w, &c, x) - } -} - -func enumResourcesRegisteredModel(w *walker, n *walk.Node, v *resources.RegisteredModel) { - if v == nil { - return - } - if len(v.Grants) > 0 { - c := n.Child("grants") - for i := range v.Grants { - e := c.Elem(i) - enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i]) - } - } -} - -func enumResourcesSchema(w *walker, n *walk.Node, v *resources.Schema) { - if v == nil { - return - } - if len(v.Grants) > 0 { - c := n.Child("grants") - for i := range v.Grants { - e := c.Elem(i) - enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i]) - } - } -} - -func enumResourcesSecretScope(w *walker, n *walk.Node, v *resources.SecretScope) { - if v == nil { - return - } - if s := string(v.BackendType); s != "" { - c := n.Child("backend_type") - w.enumValue(&c, s, enumValues22) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesSecretScopePermission(w, &e, &v.Permissions[i]) - } - } -} - -func enumResourcesSecret(w *walker, n *walk.Node, v *resources.Secret) { - if v == nil { - return - } - if len(v.Grants) > 0 { - c := n.Child("grants") - for i := range v.Grants { - e := c.Elem(i) - enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i]) - } - } -} - -func enumResourcesSqlWarehouse(w *walker, n *walk.Node, v *resources.SqlWarehouse) { - if v == nil { - return - } - if x := v.CreateWarehouseRequest.Channel; x != nil { - c := n.Child("channel") - enumSqlChannel(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesSqlWarehousePermission(w, &e, &v.Permissions[i]) - } - } - if s := string(v.CreateWarehouseRequest.SpotInstancePolicy); s != "" || walk.Forced(v.CreateWarehouseRequest.ForceSendFields, "SpotInstancePolicy") { - c := n.Child("spot_instance_policy") - w.enumValue(&c, s, enumValues23) - } - if s := string(v.CreateWarehouseRequest.WarehouseType); s != "" || walk.Forced(v.CreateWarehouseRequest.ForceSendFields, "WarehouseType") { - c := n.Child("warehouse_type") - w.enumValue(&c, s, enumValues24) - } -} - -func enumResourcesSyncedDatabaseTable(w *walker, n *walk.Node, v *resources.SyncedDatabaseTable) { - if v == nil { - return - } - if x := v.SyncedDatabaseTable.DataSynchronizationStatus; x != nil { - c := n.Child("data_synchronization_status") - enumDatabaseSyncedTableStatus(w, &c, x) - } - if x := v.SyncedDatabaseTable.Spec; x != nil { - c := n.Child("spec") - enumDatabaseSyncedTableSpec(w, &c, x) - } - if s := string(v.SyncedDatabaseTable.UnityCatalogProvisioningState); s != "" || walk.Forced(v.SyncedDatabaseTable.ForceSendFields, "UnityCatalogProvisioningState") { - c := n.Child("unity_catalog_provisioning_state") - w.enumValue(&c, s, enumValues25) - } -} - -func enumResourcesVectorSearchEndpoint(w *walker, n *walk.Node, v *resources.VectorSearchEndpoint) { - if v == nil { - return - } - if s := string(v.CreateEndpoint.EndpointType); s != "" || walk.Forced(v.CreateEndpoint.ForceSendFields, "EndpointType") { - c := n.Child("endpoint_type") - w.enumValue(&c, s, enumValues26) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - enumResourcesVectorSearchEndpointPermission(w, &e, &v.Permissions[i]) - } - } -} - -func enumResourcesVectorSearchIndex(w *walker, n *walk.Node, v *resources.VectorSearchIndex) { - if v == nil { - return - } - if x := v.CreateVectorIndexRequest.DeltaSyncIndexSpec; x != nil { - c := n.Child("delta_sync_index_spec") - enumVectorsearchDeltaSyncVectorIndexSpecRequest(w, &c, x) - } - if len(v.Grants) > 0 { - c := n.Child("grants") - for i := range v.Grants { - e := c.Elem(i) - enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i]) - } - } - if s := string(v.CreateVectorIndexRequest.IndexSubtype); s != "" { - c := n.Child("index_subtype") - w.enumValue(&c, s, enumValues27) - } - if s := string(v.CreateVectorIndexRequest.IndexType); s != "" { - c := n.Child("index_type") - w.enumValue(&c, s, enumValues28) - } -} - -func enumResourcesVolume(w *walker, n *walk.Node, v *resources.Volume) { - if v == nil { - return - } - if len(v.Grants) > 0 { - c := n.Child("grants") - for i := range v.Grants { - e := c.Elem(i) - enumCatalogPrivilegeAssignment(w, &e, &v.Grants[i]) - } - } - if s := string(v.CreateVolumeRequestContent.VolumeType); s != "" || walk.Forced(v.CreateVolumeRequestContent.ForceSendFields, "VolumeType") { - c := n.Child("volume_type") - w.enumValue(&c, s, enumValues29) - } -} - -func enumSqlAlertV2Evaluation(w *walker, n *walk.Node, v *sql.AlertV2Evaluation) { - if v == nil { - return - } - if s := string(v.ComparisonOperator); s != "" || walk.Forced(v.ForceSendFields, "ComparisonOperator") { - c := n.Child("comparison_operator") - w.enumValue(&c, s, enumValues30) - } - if s := string(v.EmptyResultState); s != "" || walk.Forced(v.ForceSendFields, "EmptyResultState") { - c := n.Child("empty_result_state") - w.enumValue(&c, s, enumValues31) - } - if x := &v.Source; !walk.IsZeroStruct(x) || walk.Forced(v.ForceSendFields, "Source") || n.HasRefs("source") { - c := n.Child("source") - enumSqlAlertV2OperandColumn(w, &c, x) - } - if s := string(v.State); s != "" || walk.Forced(v.ForceSendFields, "State") { - c := n.Child("state") - w.enumValue(&c, s, enumValues31) - } - if x := v.Threshold; x != nil { - c := n.Child("threshold") - enumSqlAlertV2Operand(w, &c, x) - } -} - -func enumSqlCronSchedule(w *walker, n *walk.Node, v *sql.CronSchedule) { - if v == nil { - return - } - if s := string(v.PauseStatus); s != "" { - c := n.Child("pause_status") - w.enumValue(&c, s, enumValues32) - } -} - -func enumAppsAppDeployment(w *walker, n *walk.Node, v *apps.AppDeployment) { - if v == nil { - return - } - if s := string(v.Mode); s != "" || walk.Forced(v.ForceSendFields, "Mode") { - c := n.Child("mode") - w.enumValue(&c, s, enumValues33) - } - if x := v.Status; x != nil { - c := n.Child("status") - enumAppsAppDeploymentStatus(w, &c, x) - } -} - -func enumAppsApplicationStatus(w *walker, n *walk.Node, v *apps.ApplicationStatus) { - if v == nil { - return - } - if s := string(v.State); s != "" || walk.Forced(v.ForceSendFields, "State") { - c := n.Child("state") - w.enumValue(&c, s, enumValues34) - } -} - -func enumAppsComputeStatus(w *walker, n *walk.Node, v *apps.ComputeStatus) { - if v == nil { - return - } - if s := string(v.State); s != "" || walk.Forced(v.ForceSendFields, "State") { - c := n.Child("state") - w.enumValue(&c, s, enumValues35) - } -} - -func enumResourcesAppPermission(w *walker, n *walk.Node, v *resources.AppPermission) { - if v == nil { - return - } - if s := string(v.Level); s != "" { - c := n.Child("level") - w.enumValue(&c, s, enumValues36) - } -} - -func enumAppsAppResource(w *walker, n *walk.Node, v *apps.AppResource) { - if v == nil { - return - } - if x := v.App; x != nil { - c := n.Child("app") - enumAppsAppResourceApp(w, &c, x) - } - if x := v.Database; x != nil { - c := n.Child("database") - enumAppsAppResourceDatabase(w, &c, x) - } - if x := v.Experiment; x != nil { - c := n.Child("experiment") - enumAppsAppResourceExperiment(w, &c, x) - } - if x := v.GenieSpace; x != nil { - c := n.Child("genie_space") - enumAppsAppResourceGenieSpace(w, &c, x) - } - if x := v.Job; x != nil { - c := n.Child("job") - enumAppsAppResourceJob(w, &c, x) - } - if x := v.Postgres; x != nil { - c := n.Child("postgres") - enumAppsAppResourcePostgres(w, &c, x) - } - if x := v.Secret; x != nil { - c := n.Child("secret") - enumAppsAppResourceSecret(w, &c, x) - } - if x := v.ServingEndpoint; x != nil { - c := n.Child("serving_endpoint") - enumAppsAppResourceServingEndpoint(w, &c, x) - } - if x := v.SqlWarehouse; x != nil { - c := n.Child("sql_warehouse") - enumAppsAppResourceSqlWarehouse(w, &c, x) - } - if x := v.UcSecurable; x != nil { - c := n.Child("uc_securable") - enumAppsAppResourceUcSecurable(w, &c, x) - } -} - -func enumCatalogPrivilegeAssignment(w *walker, n *walk.Node, v *catalog.PrivilegeAssignment) { - if v == nil { - return - } - if len(v.Privileges) > 0 { - c := n.Child("privileges") - for i := range v.Privileges { - e := c.Elem(i) - w.enumValue(&e, string(v.Privileges[i]), enumValues37) - } - } -} - -func enumResourcesClusterPolicyPermission(w *walker, n *walk.Node, v *resources.ClusterPolicyPermission) { - if v == nil { - return - } - if s := string(v.Level); s != "" { - c := n.Child("level") - w.enumValue(&c, s, enumValues38) - } -} - -func enumComputeAwsAttributes(w *walker, n *walk.Node, v *compute.AwsAttributes) { - if v == nil { - return - } - if s := string(v.Availability); s != "" || walk.Forced(v.ForceSendFields, "Availability") { - c := n.Child("availability") - w.enumValue(&c, s, enumValues39) - } - if s := string(v.EbsVolumeType); s != "" || walk.Forced(v.ForceSendFields, "EbsVolumeType") { - c := n.Child("ebs_volume_type") - w.enumValue(&c, s, enumValues40) - } -} - -func enumComputeAzureAttributes(w *walker, n *walk.Node, v *compute.AzureAttributes) { - if v == nil { - return - } - if s := string(v.Availability); s != "" || walk.Forced(v.ForceSendFields, "Availability") { - c := n.Child("availability") - w.enumValue(&c, s, enumValues41) - } -} - -func enumComputeGcpAttributes(w *walker, n *walk.Node, v *compute.GcpAttributes) { - if v == nil { - return - } - if s := string(v.Availability); s != "" || walk.Forced(v.ForceSendFields, "Availability") { - c := n.Child("availability") - w.enumValue(&c, s, enumValues42) - } - if s := string(v.ConfidentialComputeType); s != "" || walk.Forced(v.ForceSendFields, "ConfidentialComputeType") { - c := n.Child("confidential_compute_type") - w.enumValue(&c, s, enumValues43) - } -} - -func enumResourcesClusterPermission(w *walker, n *walk.Node, v *resources.ClusterPermission) { - if v == nil { - return - } - if s := string(v.Level); s != "" { - c := n.Child("level") - w.enumValue(&c, s, enumValues44) - } -} - -func enumResourcesMlflowExperimentPermission(w *walker, n *walk.Node, v *resources.MlflowExperimentPermission) { - if v == nil { - return - } - if s := string(v.Level); s != "" { - c := n.Child("level") - w.enumValue(&c, s, enumValues45) - } -} - -func enumCatalogEncryptionDetails(w *walker, n *walk.Node, v *catalog.EncryptionDetails) { - if v == nil { - return - } - if x := v.SseEncryptionDetails; x != nil { - c := n.Child("sse_encryption_details") - enumCatalogSseEncryptionDetails(w, &c, x) - } -} - -func enumMlFunction(w *walker, n *walk.Node, v *ml.Function) { - if v == nil { - return - } - if s := string(v.FunctionType); s != "" { - c := n.Child("function_type") - w.enumValue(&c, s, enumValues46) - } -} - -func enumMlDataSource(w *walker, n *walk.Node, v *ml.DataSource) { - if v == nil { - return - } - if x := v.RequestSource; x != nil { - c := n.Child("request_source") - enumMlRequestSource(w, &c, x) - } - if x := v.SdpSource; x != nil { - c := n.Child("sdp_source") - enumMlSdpSource(w, &c, x) - } -} - -func enumComputeInstancePoolAwsAttributes(w *walker, n *walk.Node, v *compute.InstancePoolAwsAttributes) { - if v == nil { - return - } - if s := string(v.Availability); s != "" || walk.Forced(v.ForceSendFields, "Availability") { - c := n.Child("availability") - w.enumValue(&c, s, enumValues47) - } -} - -func enumComputeInstancePoolAzureAttributes(w *walker, n *walk.Node, v *compute.InstancePoolAzureAttributes) { - if v == nil { - return - } - if s := string(v.Availability); s != "" || walk.Forced(v.ForceSendFields, "Availability") { - c := n.Child("availability") - w.enumValue(&c, s, enumValues48) - } -} - -func enumComputeDiskSpec(w *walker, n *walk.Node, v *compute.DiskSpec) { - if v == nil { - return - } - if x := v.DiskType; x != nil { - c := n.Child("disk_type") - enumComputeDiskType(w, &c, x) - } -} - -func enumComputeInstancePoolGcpAttributes(w *walker, n *walk.Node, v *compute.InstancePoolGcpAttributes) { - if v == nil { - return - } - if s := string(v.GcpAvailability); s != "" || walk.Forced(v.ForceSendFields, "GcpAvailability") { - c := n.Child("gcp_availability") - w.enumValue(&c, s, enumValues42) - } -} - -func enumResourcesInstancePoolPermission(w *walker, n *walk.Node, v *resources.InstancePoolPermission) { - if v == nil { - return - } - if s := string(v.Level); s != "" { - c := n.Child("level") - w.enumValue(&c, s, enumValues49) - } -} - -func enumJobsContinuous(w *walker, n *walk.Node, v *jobs.Continuous) { - if v == nil { - return - } - if x := v.MaintenanceWindow; x != nil { - c := n.Child("maintenance_window") - enumJobsMaintenanceWindow(w, &c, x) - } - if s := string(v.PauseStatus); s != "" { - c := n.Child("pause_status") - w.enumValue(&c, s, enumValues32) - } - if s := string(v.TaskRetryMode); s != "" { - c := n.Child("task_retry_mode") - w.enumValue(&c, s, enumValues50) - } -} - -func enumJobsJobDeployment(w *walker, n *walk.Node, v *jobs.JobDeployment) { - if v == nil { - return - } - if s := string(v.Kind); s != "" || walk.Forced(v.ForceSendFields, "Kind") { - c := n.Child("kind") - w.enumValue(&c, s, enumValues51) - } -} - -func enumJobsGitSource(w *walker, n *walk.Node, v *jobs.GitSource) { - if v == nil { - return - } - if s := string(v.GitProvider); s != "" || walk.Forced(v.ForceSendFields, "GitProvider") { - c := n.Child("git_provider") - w.enumValue(&c, s, enumValues52) - } - if x := v.JobSource; x != nil { - c := n.Child("job_source") - enumJobsJobSource(w, &c, x) - } -} - -func enumJobsJobsHealthRules(w *walker, n *walk.Node, v *jobs.JobsHealthRules) { - if v == nil { - return - } - if len(v.Rules) > 0 { - c := n.Child("rules") - for i := range v.Rules { - e := c.Elem(i) - enumJobsJobsHealthRule(w, &e, &v.Rules[i]) - } - } -} - -func enumJobsJobCluster(w *walker, n *walk.Node, v *jobs.JobCluster) { - if v == nil { - return - } - if x := v.NewCluster; x != nil { - c := n.Child("new_cluster") - enumComputeClusterSpec(w, &c, x) - } -} - -func enumResourcesJobPermission(w *walker, n *walk.Node, v *resources.JobPermission) { - if v == nil { - return - } - if s := string(v.Level); s != "" { - c := n.Child("level") - w.enumValue(&c, s, enumValues53) - } -} - -func enumJobsCronSchedule(w *walker, n *walk.Node, v *jobs.CronSchedule) { - if v == nil { - return - } - if s := string(v.PauseStatus); s != "" { - c := n.Child("pause_status") - w.enumValue(&c, s, enumValues32) - } - if x := v.SqlCondition; x != nil { - c := n.Child("sql_condition") - enumJobsSqlConditionConfiguration(w, &c, x) - } -} - -func enumJobsTask(w *walker, n *walk.Node, v *jobs.Task) { - if v == nil { - return - } - if x := v.AiRuntimeTask; x != nil { - c := n.Child("ai_runtime_task") - enumJobsAiRuntimeTask(w, &c, x) - } - if x := v.Compute; x != nil { - c := n.Child("compute") - enumJobsCompute(w, &c, x) - } - if x := v.ConditionTask; x != nil { - c := n.Child("condition_task") - enumJobsConditionTask(w, &c, x) - } - if x := v.DashboardTask; x != nil { - c := n.Child("dashboard_task") - enumJobsDashboardTask(w, &c, x) - } - if x := v.DbtTask; x != nil { - c := n.Child("dbt_task") - enumJobsDbtTask(w, &c, x) - } - if x := v.ForEachTask; x != nil { - c := n.Child("for_each_task") - enumJobsForEachTask(w, &c, x) - } - if x := v.GenAiComputeTask; x != nil { - c := n.Child("gen_ai_compute_task") - enumJobsGenAiComputeTask(w, &c, x) - } - if x := v.Health; x != nil { - c := n.Child("health") - enumJobsJobsHealthRules(w, &c, x) - } - if x := v.NewCluster; x != nil { - c := n.Child("new_cluster") - enumComputeClusterSpec(w, &c, x) - } - if x := v.NotebookTask; x != nil { - c := n.Child("notebook_task") - enumJobsNotebookTask(w, &c, x) - } - if x := v.PowerBiTask; x != nil { - c := n.Child("power_bi_task") - enumJobsPowerBiTask(w, &c, x) - } - if s := string(v.RunIf); s != "" || walk.Forced(v.ForceSendFields, "RunIf") { - c := n.Child("run_if") - w.enumValue(&c, s, enumValues54) - } - if x := v.SparkPythonTask; x != nil { - c := n.Child("spark_python_task") - enumJobsSparkPythonTask(w, &c, x) - } - if x := v.SqlTask; x != nil { - c := n.Child("sql_task") - enumJobsSqlTask(w, &c, x) - } -} - -func enumJobsTriggerSettings(w *walker, n *walk.Node, v *jobs.TriggerSettings) { - if v == nil { - return - } - if x := v.Model; x != nil { - c := n.Child("model") - enumJobsModelTriggerConfiguration(w, &c, x) - } - if s := string(v.PauseStatus); s != "" { - c := n.Child("pause_status") - w.enumValue(&c, s, enumValues32) - } - if x := v.Periodic; x != nil { - c := n.Child("periodic") - enumJobsPeriodicTriggerConfiguration(w, &c, x) - } - if x := v.SqlCondition; x != nil { - c := n.Child("sql_condition") - enumJobsSqlConditionConfiguration(w, &c, x) - } - if x := v.TableUpdate; x != nil { - c := n.Child("table_update") - enumJobsTableUpdateTriggerConfiguration(w, &c, x) - } -} - -func enumJobsTriggerConfiguration(w *walker, n *walk.Node, v *jobs.TriggerConfiguration) { - if v == nil { - return - } - if x := v.Continuous; x != nil { - c := n.Child("continuous") - enumJobsContinuousTriggerConfiguration(w, &c, x) - } - if x := v.Model; x != nil { - c := n.Child("model") - enumJobsModelTriggerConfiguration(w, &c, x) - } - if s := string(v.PauseStatus); s != "" { - c := n.Child("pause_status") - w.enumValue(&c, s, enumValues32) - } - if x := v.Periodic; x != nil { - c := n.Child("periodic") - enumJobsPeriodicTriggerConfiguration(w, &c, x) - } - if x := v.SqlCondition; x != nil { - c := n.Child("sql_condition") - enumJobsSqlConditionConfiguration(w, &c, x) - } - if x := v.TableUpdate; x != nil { - c := n.Child("table_update") - enumJobsTableUpdateTriggerConfiguration(w, &c, x) - } -} - -func enumCatalogMcpServiceConfig(w *walker, n *walk.Node, v *catalog.McpServiceConfig) { - if v == nil { - return - } - if len(v.RateLimits) > 0 { - c := n.Child("rate_limits") - for i := range v.RateLimits { - e := c.Elem(i) - enumCatalogRateLimit(w, &e, &v.RateLimits[i]) - } - } -} - -func enumCatalogModelProviderServiceConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfig) { - if v == nil { - return - } - if s := string(v.ProviderType); s != "" || walk.Forced(v.ForceSendFields, "ProviderType") { - c := n.Child("provider_type") - w.enumValue(&c, s, enumValues55) - } - if len(v.RateLimits) > 0 { - c := n.Child("rate_limits") - for i := range v.RateLimits { - e := c.Elem(i) - enumCatalogRateLimit(w, &e, &v.RateLimits[i]) - } - } -} - -func enumCatalogModelServiceConfig(w *walker, n *walk.Node, v *catalog.ModelServiceConfig) { - if v == nil { - return - } - if len(v.RateLimits) > 0 { - c := n.Child("rate_limits") - for i := range v.RateLimits { - e := c.Elem(i) - enumCatalogRateLimit(w, &e, &v.RateLimits[i]) - } - } - if x := v.Routing; x != nil { - c := n.Child("routing") - enumCatalogModelServiceConfigRoutingConfig(w, &c, x) - } -} - -func enumServingAiGatewayConfig(w *walker, n *walk.Node, v *serving.AiGatewayConfig) { - if v == nil { - return - } - if x := v.Guardrails; x != nil { - c := n.Child("guardrails") - enumServingAiGatewayGuardrails(w, &c, x) - } - if len(v.RateLimits) > 0 { - c := n.Child("rate_limits") - for i := range v.RateLimits { - e := c.Elem(i) - enumServingAiGatewayRateLimit(w, &e, &v.RateLimits[i]) - } - } -} - -func enumServingEndpointCoreConfigInput(w *walker, n *walk.Node, v *serving.EndpointCoreConfigInput) { - if v == nil { - return - } - if len(v.ServedEntities) > 0 { - c := n.Child("served_entities") - for i := range v.ServedEntities { - e := c.Elem(i) - enumServingServedEntityInput(w, &e, &v.ServedEntities[i]) - } - } - if len(v.ServedModels) > 0 { - c := n.Child("served_models") - for i := range v.ServedModels { - e := c.Elem(i) - enumServingServedModelInput(w, &e, &v.ServedModels[i]) - } - } -} - -func enumResourcesModelServingEndpointPermission(w *walker, n *walk.Node, v *resources.ModelServingEndpointPermission) { - if v == nil { - return - } - if s := string(v.Level); s != "" { - c := n.Child("level") - w.enumValue(&c, s, enumValues56) - } -} - -func enumServingRateLimit(w *walker, n *walk.Node, v *serving.RateLimit) { - if v == nil { - return - } - if s := string(v.Key); s != "" { - c := n.Child("key") - w.enumValue(&c, s, enumValues57) - } - if s := string(v.RenewalPeriod); s != "" { - c := n.Child("renewal_period") - w.enumValue(&c, s, enumValues58) - } -} - -func enumServingTelemetryConfig(w *walker, n *walk.Node, v *serving.TelemetryConfig) { - if v == nil { - return - } - if len(v.EnabledTelemetryFeatures) > 0 { - c := n.Child("enabled_telemetry_features") - for i := range v.EnabledTelemetryFeatures { - e := c.Elem(i) - w.enumValue(&e, string(v.EnabledTelemetryFeatures[i]), enumValues59) - } - } -} - -func enumResourcesMlflowModelPermission(w *walker, n *walk.Node, v *resources.MlflowModelPermission) { - if v == nil { - return - } - if s := string(v.Level); s != "" { - c := n.Child("level") - w.enumValue(&c, s, enumValues60) - } -} - -func enumPipelinesPipelineCluster(w *walker, n *walk.Node, v *pipelines.PipelineCluster) { - if v == nil { - return - } - if x := v.Autoscale; x != nil { - c := n.Child("autoscale") - enumPipelinesPipelineClusterAutoscale(w, &c, x) - } - if x := v.AwsAttributes; x != nil { - c := n.Child("aws_attributes") - enumComputeAwsAttributes(w, &c, x) - } - if x := v.AzureAttributes; x != nil { - c := n.Child("azure_attributes") - enumComputeAzureAttributes(w, &c, x) - } - if x := v.GcpAttributes; x != nil { - c := n.Child("gcp_attributes") - enumComputeGcpAttributes(w, &c, x) - } -} - -func enumPipelinesPipelineDeployment(w *walker, n *walk.Node, v *pipelines.PipelineDeployment) { - if v == nil { - return - } - if s := string(v.Kind); s != "" || walk.Forced(v.ForceSendFields, "Kind") { - c := n.Child("kind") - w.enumValue(&c, s, enumValues61) - } -} - -func enumPipelinesIngestionPipelineDefinition(w *walker, n *walk.Node, v *pipelines.IngestionPipelineDefinition) { - if v == nil { - return - } - if s := string(v.ConnectorType); s != "" || walk.Forced(v.ForceSendFields, "ConnectorType") { - c := n.Child("connector_type") - w.enumValue(&c, s, enumValues62) - } - if x := v.FullRefreshWindow; x != nil { - c := n.Child("full_refresh_window") - enumPipelinesOperationTimeWindow(w, &c, x) - } - if len(v.Objects) > 0 { - c := n.Child("objects") - for i := range v.Objects { - e := c.Elem(i) - enumPipelinesIngestionConfig(w, &e, &v.Objects[i]) - } - } - if s := string(v.SourceType); s != "" || walk.Forced(v.ForceSendFields, "SourceType") { - c := n.Child("source_type") - w.enumValue(&c, s, enumValues63) - } - if x := v.TableConfiguration; x != nil { - c := n.Child("table_configuration") - enumPipelinesTableSpecificConfig(w, &c, x) - } -} - -func enumResourcesPipelinePermission(w *walker, n *walk.Node, v *resources.PipelinePermission) { - if v == nil { - return - } - if s := string(v.Level); s != "" { - c := n.Child("level") - w.enumValue(&c, s, enumValues64) - } -} - -func enumPipelinesRestartWindow(w *walker, n *walk.Node, v *pipelines.RestartWindow) { - if v == nil { - return - } - if len(v.DaysOfWeek) > 0 { - c := n.Child("days_of_week") - for i := range v.DaysOfWeek { - e := c.Elem(i) - w.enumValue(&e, string(v.DaysOfWeek[i]), enumValues65) - } - } -} - -func enumPostgresScheduleCadence(w *walker, n *walk.Node, v *postgres.ScheduleCadence) { - if v == nil { - return - } - if x := v.WeeklySchedule; x != nil { - c := n.Child("weekly_schedule") - enumPostgresWeeklySchedule(w, &c, x) - } -} - -func enumPostgresSyncedTableSyncedTableSpecExtraColumn(w *walker, n *walk.Node, v *postgres.SyncedTableSyncedTableSpecExtraColumn) { - if v == nil { - return - } - if s := string(v.Maintenance); s != "" || walk.Forced(v.ForceSendFields, "Maintenance") { - c := n.Child("maintenance") - w.enumValue(&c, s, enumValues66) - } -} - -func enumPostgresNewPipelineSpec(w *walker, n *walk.Node, v *postgres.NewPipelineSpec) { - if v == nil { - return - } - if s := string(v.PipelineChannel); s != "" || walk.Forced(v.ForceSendFields, "PipelineChannel") { - c := n.Child("pipeline_channel") - w.enumValue(&c, s, enumValues67) - } -} - -func enumPostgresSyncedTableSyncedTableSpecTypeOverride(w *walker, n *walk.Node, v *postgres.SyncedTableSyncedTableSpecTypeOverride) { - if v == nil { - return - } - if s := string(v.PgType); s != "" || walk.Forced(v.ForceSendFields, "PgType") { - c := n.Child("pg_type") - w.enumValue(&c, s, enumValues68) - } -} - -func enumCatalogMonitorMetric(w *walker, n *walk.Node, v *catalog.MonitorMetric) { - if v == nil { - return - } - if s := string(v.Type); s != "" { - c := n.Child("type") - w.enumValue(&c, s, enumValues69) - } -} - -func enumCatalogMonitorInferenceLog(w *walker, n *walk.Node, v *catalog.MonitorInferenceLog) { - if v == nil { - return - } - if s := string(v.ProblemType); s != "" || walk.Forced(v.ForceSendFields, "ProblemType") { - c := n.Child("problem_type") - w.enumValue(&c, s, enumValues70) - } -} - -func enumCatalogMonitorCronSchedule(w *walker, n *walk.Node, v *catalog.MonitorCronSchedule) { - if v == nil { - return - } - if s := string(v.PauseStatus); s != "" { - c := n.Child("pause_status") - w.enumValue(&c, s, enumValues71) - } -} - -func enumResourcesSecretScopePermission(w *walker, n *walk.Node, v *resources.SecretScopePermission) { - if v == nil { - return - } - if s := string(v.Level); s != "" { - c := n.Child("level") - w.enumValue(&c, s, enumValues72) - } -} - -func enumSqlChannel(w *walker, n *walk.Node, v *sql.Channel) { - if v == nil { - return - } - if s := string(v.Name); s != "" || walk.Forced(v.ForceSendFields, "Name") { - c := n.Child("name") - w.enumValue(&c, s, enumValues73) - } -} - -func enumResourcesSqlWarehousePermission(w *walker, n *walk.Node, v *resources.SqlWarehousePermission) { - if v == nil { - return - } - if s := string(v.Level); s != "" { - c := n.Child("level") - w.enumValue(&c, s, enumValues74) - } -} - -func enumDatabaseSyncedTableStatus(w *walker, n *walk.Node, v *database.SyncedTableStatus) { - if v == nil { - return - } - if x := v.ContinuousUpdateStatus; x != nil { - c := n.Child("continuous_update_status") - enumDatabaseSyncedTableContinuousUpdateStatus(w, &c, x) - } - if s := string(v.DetailedState); s != "" || walk.Forced(v.ForceSendFields, "DetailedState") { - c := n.Child("detailed_state") - w.enumValue(&c, s, enumValues75) - } - if x := v.ProvisioningStatus; x != nil { - c := n.Child("provisioning_status") - enumDatabaseSyncedTableProvisioningStatus(w, &c, x) - } - if x := v.TriggeredUpdateStatus; x != nil { - c := n.Child("triggered_update_status") - enumDatabaseSyncedTableTriggeredUpdateStatus(w, &c, x) - } -} - -func enumDatabaseSyncedTableSpec(w *walker, n *walk.Node, v *database.SyncedTableSpec) { - if v == nil { - return - } - if s := string(v.SchedulingPolicy); s != "" || walk.Forced(v.ForceSendFields, "SchedulingPolicy") { - c := n.Child("scheduling_policy") - w.enumValue(&c, s, enumValues21) - } - if len(v.TypeOverrides) > 0 { - c := n.Child("type_overrides") - for i := range v.TypeOverrides { - e := c.Elem(i) - enumDatabaseSyncedTableSpecTypeOverride(w, &e, &v.TypeOverrides[i]) - } - } -} - -func enumResourcesVectorSearchEndpointPermission(w *walker, n *walk.Node, v *resources.VectorSearchEndpointPermission) { - if v == nil { - return - } - if s := string(v.Level); s != "" { - c := n.Child("level") - w.enumValue(&c, s, enumValues76) - } -} - -func enumVectorsearchDeltaSyncVectorIndexSpecRequest(w *walker, n *walk.Node, v *vectorsearch.DeltaSyncVectorIndexSpecRequest) { - if v == nil { - return - } - if s := string(v.PipelineType); s != "" || walk.Forced(v.ForceSendFields, "PipelineType") { - c := n.Child("pipeline_type") - w.enumValue(&c, s, enumValues77) - } -} - -func enumSqlAlertV2OperandColumn(w *walker, n *walk.Node, v *sql.AlertV2OperandColumn) { - if v == nil { - return - } - if s := string(v.Aggregation); s != "" || walk.Forced(v.ForceSendFields, "Aggregation") { - c := n.Child("aggregation") - w.enumValue(&c, s, enumValues78) - } -} - -func enumSqlAlertV2Operand(w *walker, n *walk.Node, v *sql.AlertV2Operand) { - if v == nil { - return - } - if x := v.Column; x != nil { - c := n.Child("column") - enumSqlAlertV2OperandColumn2(w, &c, x) - } -} - -func enumAppsAppDeploymentStatus(w *walker, n *walk.Node, v *apps.AppDeploymentStatus) { - if v == nil { - return - } - if s := string(v.State); s != "" || walk.Forced(v.ForceSendFields, "State") { - c := n.Child("state") - w.enumValue(&c, s, enumValues79) - } -} - -func enumAppsAppResourceApp(w *walker, n *walk.Node, v *apps.AppResourceApp) { - if v == nil { - return - } - if s := string(v.Permission); s != "" || walk.Forced(v.ForceSendFields, "Permission") { - c := n.Child("permission") - w.enumValue(&c, s, enumValues38) - } -} - -func enumAppsAppResourceDatabase(w *walker, n *walk.Node, v *apps.AppResourceDatabase) { - if v == nil { - return - } - if s := string(v.Permission); s != "" { - c := n.Child("permission") - w.enumValue(&c, s, enumValues80) - } -} - -func enumAppsAppResourceExperiment(w *walker, n *walk.Node, v *apps.AppResourceExperiment) { - if v == nil { - return - } - if s := string(v.Permission); s != "" { - c := n.Child("permission") - w.enumValue(&c, s, enumValues45) - } -} - -func enumAppsAppResourceGenieSpace(w *walker, n *walk.Node, v *apps.AppResourceGenieSpace) { - if v == nil { - return - } - if s := string(v.Permission); s != "" { - c := n.Child("permission") - w.enumValue(&c, s, enumValues81) - } -} - -func enumAppsAppResourceJob(w *walker, n *walk.Node, v *apps.AppResourceJob) { - if v == nil { - return - } - if s := string(v.Permission); s != "" { - c := n.Child("permission") - w.enumValue(&c, s, enumValues53) - } -} - -func enumAppsAppResourcePostgres(w *walker, n *walk.Node, v *apps.AppResourcePostgres) { - if v == nil { - return - } - if s := string(v.Permission); s != "" || walk.Forced(v.ForceSendFields, "Permission") { - c := n.Child("permission") - w.enumValue(&c, s, enumValues80) - } -} - -func enumAppsAppResourceSecret(w *walker, n *walk.Node, v *apps.AppResourceSecret) { - if v == nil { - return - } - if s := string(v.Permission); s != "" { - c := n.Child("permission") - w.enumValue(&c, s, enumValues82) - } -} - -func enumAppsAppResourceServingEndpoint(w *walker, n *walk.Node, v *apps.AppResourceServingEndpoint) { - if v == nil { - return - } - if s := string(v.Permission); s != "" { - c := n.Child("permission") - w.enumValue(&c, s, enumValues56) - } -} - -func enumAppsAppResourceSqlWarehouse(w *walker, n *walk.Node, v *apps.AppResourceSqlWarehouse) { - if v == nil { - return - } - if s := string(v.Permission); s != "" { - c := n.Child("permission") - w.enumValue(&c, s, enumValues83) - } -} - -func enumAppsAppResourceUcSecurable(w *walker, n *walk.Node, v *apps.AppResourceUcSecurable) { - if v == nil { - return - } - if s := string(v.Permission); s != "" || walk.Forced(v.ForceSendFields, "Permission") { - c := n.Child("permission") - w.enumValue(&c, s, enumValues84) - } - if s := string(v.SecurableType); s != "" || walk.Forced(v.ForceSendFields, "SecurableType") { - c := n.Child("securable_type") - w.enumValue(&c, s, enumValues85) - } -} - -func enumCatalogSseEncryptionDetails(w *walker, n *walk.Node, v *catalog.SseEncryptionDetails) { - if v == nil { - return - } - if s := string(v.Algorithm); s != "" || walk.Forced(v.ForceSendFields, "Algorithm") { - c := n.Child("algorithm") - w.enumValue(&c, s, enumValues86) - } -} - -func enumMlRequestSource(w *walker, n *walk.Node, v *ml.RequestSource) { - if v == nil { - return - } - if x := v.FlatSchema; x != nil { - c := n.Child("flat_schema") - enumMlFlatSchema(w, &c, x) - } -} - -func enumMlSdpSource(w *walker, n *walk.Node, v *ml.SdpSource) { - if v == nil { - return - } - if s := string(v.PipelineState); s != "" || walk.Forced(v.ForceSendFields, "PipelineState") { - c := n.Child("pipeline_state") - w.enumValue(&c, s, enumValues87) - } -} - -func enumComputeDiskType(w *walker, n *walk.Node, v *compute.DiskType) { - if v == nil { - return - } - if s := string(v.AzureDiskVolumeType); s != "" { - c := n.Child("azure_disk_volume_type") - w.enumValue(&c, s, enumValues88) - } - if s := string(v.EbsVolumeType); s != "" { - c := n.Child("ebs_volume_type") - w.enumValue(&c, s, enumValues40) - } -} - -func enumJobsMaintenanceWindow(w *walker, n *walk.Node, v *jobs.MaintenanceWindow) { - if v == nil { - return - } - if s := string(v.DayOfWeek); s != "" { - c := n.Child("day_of_week") - w.enumValue(&c, s, enumValues65) - } -} - -func enumJobsJobSource(w *walker, n *walk.Node, v *jobs.JobSource) { - if v == nil { - return - } - if s := string(v.DirtyState); s != "" { - c := n.Child("dirty_state") - w.enumValue(&c, s, enumValues89) - } -} - -func enumJobsJobsHealthRule(w *walker, n *walk.Node, v *jobs.JobsHealthRule) { - if v == nil { - return - } - if s := string(v.Metric); s != "" { - c := n.Child("metric") - w.enumValue(&c, s, enumValues90) - } - if s := string(v.Op); s != "" { - c := n.Child("op") - w.enumValue(&c, s, enumValues91) - } -} - -func enumComputeClusterSpec(w *walker, n *walk.Node, v *compute.ClusterSpec) { - if v == nil { - return - } - if x := v.AwsAttributes; x != nil { - c := n.Child("aws_attributes") - enumComputeAwsAttributes(w, &c, x) - } - if x := v.AzureAttributes; x != nil { - c := n.Child("azure_attributes") - enumComputeAzureAttributes(w, &c, x) - } - if s := string(v.DataSecurityMode); s != "" || walk.Forced(v.ForceSendFields, "DataSecurityMode") { - c := n.Child("data_security_mode") - w.enumValue(&c, s, enumValues8) - } - if s := string(v.DependencyMode); s != "" || walk.Forced(v.ForceSendFields, "DependencyMode") { - c := n.Child("dependency_mode") - w.enumValue(&c, s, enumValues9) - } - if x := v.GcpAttributes; x != nil { - c := n.Child("gcp_attributes") - enumComputeGcpAttributes(w, &c, x) - } - if s := string(v.Kind); s != "" || walk.Forced(v.ForceSendFields, "Kind") { - c := n.Child("kind") - w.enumValue(&c, s, enumValues10) - } - if s := string(v.RuntimeEngine); s != "" || walk.Forced(v.ForceSendFields, "RuntimeEngine") { - c := n.Child("runtime_engine") - w.enumValue(&c, s, enumValues11) - } -} - -func enumJobsSqlConditionConfiguration(w *walker, n *walk.Node, v *jobs.SqlConditionConfiguration) { - if v == nil { - return - } - if s := string(v.TriggerMode); s != "" { - c := n.Child("trigger_mode") - w.enumValue(&c, s, enumValues92) - } -} - -func enumJobsAiRuntimeTask(w *walker, n *walk.Node, v *jobs.AiRuntimeTask) { - if v == nil { - return - } - if len(v.Deployments) > 0 { - c := n.Child("deployments") - for i := range v.Deployments { - e := c.Elem(i) - enumJobsDeploymentSpec(w, &e, &v.Deployments[i]) - } - } - if s := string(v.PriorityClass); s != "" || walk.Forced(v.ForceSendFields, "PriorityClass") { - c := n.Child("priority_class") - w.enumValue(&c, s, enumValues93) - } -} - -func enumJobsCompute(w *walker, n *walk.Node, v *jobs.Compute) { - if v == nil { - return - } - if s := string(v.HardwareAccelerator); s != "" { - c := n.Child("hardware_accelerator") - w.enumValue(&c, s, enumValues94) - } -} - -func enumJobsConditionTask(w *walker, n *walk.Node, v *jobs.ConditionTask) { - if v == nil { - return - } - if s := string(v.Op); s != "" { - c := n.Child("op") - w.enumValue(&c, s, enumValues95) - } -} - -func enumJobsDashboardTask(w *walker, n *walk.Node, v *jobs.DashboardTask) { - if v == nil { - return - } - if x := v.Subscription; x != nil { - c := n.Child("subscription") - enumJobsSubscription(w, &c, x) - } -} - -func enumJobsDbtTask(w *walker, n *walk.Node, v *jobs.DbtTask) { - if v == nil { - return - } - if s := string(v.Source); s != "" || walk.Forced(v.ForceSendFields, "Source") { - c := n.Child("source") - w.enumValue(&c, s, enumValues96) - } -} - -func enumJobsForEachTask(w *walker, n *walk.Node, v *jobs.ForEachTask) { - if v == nil { - return - } - if x := &v.Task; !walk.IsZeroStruct(x) || walk.Forced(v.ForceSendFields, "Task") || n.HasRefs("task") { - c := n.Child("task") - enumJobsTask2(w, &c, x) - } -} - -func enumJobsGenAiComputeTask(w *walker, n *walk.Node, v *jobs.GenAiComputeTask) { - if v == nil { - return - } - if s := string(v.Source); s != "" || walk.Forced(v.ForceSendFields, "Source") { - c := n.Child("source") - w.enumValue(&c, s, enumValues96) - } -} - -func enumJobsNotebookTask(w *walker, n *walk.Node, v *jobs.NotebookTask) { - if v == nil { - return - } - if s := string(v.Source); s != "" || walk.Forced(v.ForceSendFields, "Source") { - c := n.Child("source") - w.enumValue(&c, s, enumValues96) - } -} - -func enumJobsPowerBiTask(w *walker, n *walk.Node, v *jobs.PowerBiTask) { - if v == nil { - return - } - if x := v.PowerBiModel; x != nil { - c := n.Child("power_bi_model") - enumJobsPowerBiModel(w, &c, x) - } - if len(v.Tables) > 0 { - c := n.Child("tables") - for i := range v.Tables { - e := c.Elem(i) - enumJobsPowerBiTable(w, &e, &v.Tables[i]) - } - } -} - -func enumJobsSparkPythonTask(w *walker, n *walk.Node, v *jobs.SparkPythonTask) { - if v == nil { - return - } - if s := string(v.Source); s != "" { - c := n.Child("source") - w.enumValue(&c, s, enumValues96) - } -} - -func enumJobsSqlTask(w *walker, n *walk.Node, v *jobs.SqlTask) { - if v == nil { - return - } - if x := v.File; x != nil { - c := n.Child("file") - enumJobsSqlTaskFile(w, &c, x) - } -} - -func enumJobsModelTriggerConfiguration(w *walker, n *walk.Node, v *jobs.ModelTriggerConfiguration) { - if v == nil { - return - } - if s := string(v.Condition); s != "" || walk.Forced(v.ForceSendFields, "Condition") { - c := n.Child("condition") - w.enumValue(&c, s, enumValues97) - } -} - -func enumJobsPeriodicTriggerConfiguration(w *walker, n *walk.Node, v *jobs.PeriodicTriggerConfiguration) { - if v == nil { - return - } - if s := string(v.Unit); s != "" { - c := n.Child("unit") - w.enumValue(&c, s, enumValues98) - } -} - -func enumJobsTableUpdateTriggerConfiguration(w *walker, n *walk.Node, v *jobs.TableUpdateTriggerConfiguration) { - if v == nil { - return - } - if s := string(v.Condition); s != "" || walk.Forced(v.ForceSendFields, "Condition") { - c := n.Child("condition") - w.enumValue(&c, s, enumValues99) - } -} - -func enumJobsContinuousTriggerConfiguration(w *walker, n *walk.Node, v *jobs.ContinuousTriggerConfiguration) { - if v == nil { - return - } - if x := v.MaintenanceWindow; x != nil { - c := n.Child("maintenance_window") - enumJobsMaintenanceWindow(w, &c, x) - } - if s := string(v.TaskRetryMode); s != "" { - c := n.Child("task_retry_mode") - w.enumValue(&c, s, enumValues50) - } -} - -func enumCatalogRateLimit(w *walker, n *walk.Node, v *catalog.RateLimit) { - if v == nil { - return - } - if s := string(v.Key); s != "" || walk.Forced(v.ForceSendFields, "Key") { - c := n.Child("key") - w.enumValue(&c, s, enumValues100) - } - if s := string(v.RenewalPeriod); s != "" || walk.Forced(v.ForceSendFields, "RenewalPeriod") { - c := n.Child("renewal_period") - w.enumValue(&c, s, enumValues101) - } -} - -func enumCatalogModelServiceConfigRoutingConfig(w *walker, n *walk.Node, v *catalog.ModelServiceConfigRoutingConfig) { - if v == nil { - return - } - if len(v.Destinations) > 0 { - c := n.Child("destinations") - for i := range v.Destinations { - e := c.Elem(i) - enumCatalogModelServiceConfigDestinationConfig(w, &e, &v.Destinations[i]) - } - } - if x := v.Fallback; x != nil { - c := n.Child("fallback") - enumCatalogModelServiceConfigFallbackConfig(w, &c, x) - } -} - -func enumServingAiGatewayGuardrails(w *walker, n *walk.Node, v *serving.AiGatewayGuardrails) { - if v == nil { - return - } - if x := v.Input; x != nil { - c := n.Child("input") - enumServingAiGatewayGuardrailParameters(w, &c, x) - } - if x := v.Output; x != nil { - c := n.Child("output") - enumServingAiGatewayGuardrailParameters(w, &c, x) - } -} - -func enumServingAiGatewayRateLimit(w *walker, n *walk.Node, v *serving.AiGatewayRateLimit) { - if v == nil { - return - } - if s := string(v.Key); s != "" || walk.Forced(v.ForceSendFields, "Key") { - c := n.Child("key") - w.enumValue(&c, s, enumValues102) - } - if s := string(v.RenewalPeriod); s != "" || walk.Forced(v.ForceSendFields, "RenewalPeriod") { - c := n.Child("renewal_period") - w.enumValue(&c, s, enumValues58) - } -} - -func enumServingServedEntityInput(w *walker, n *walk.Node, v *serving.ServedEntityInput) { - if v == nil { - return - } - if x := v.ExternalModel; x != nil { - c := n.Child("external_model") - enumServingExternalModel(w, &c, x) - } - if s := string(v.WorkloadType); s != "" || walk.Forced(v.ForceSendFields, "WorkloadType") { - c := n.Child("workload_type") - w.enumValue(&c, s, enumValues103) - } -} - -func enumServingServedModelInput(w *walker, n *walk.Node, v *serving.ServedModelInput) { - if v == nil { - return - } - if s := string(v.WorkloadType); s != "" || walk.Forced(v.ForceSendFields, "WorkloadType") { - c := n.Child("workload_type") - w.enumValue(&c, s, enumValues103) - } -} - -func enumPipelinesPipelineClusterAutoscale(w *walker, n *walk.Node, v *pipelines.PipelineClusterAutoscale) { - if v == nil { - return - } - if s := string(v.Mode); s != "" { - c := n.Child("mode") - w.enumValue(&c, s, enumValues104) - } -} - -func enumPipelinesOperationTimeWindow(w *walker, n *walk.Node, v *pipelines.OperationTimeWindow) { - if v == nil { - return - } - if len(v.DaysOfWeek) > 0 { - c := n.Child("days_of_week") - for i := range v.DaysOfWeek { - e := c.Elem(i) - w.enumValue(&e, string(v.DaysOfWeek[i]), enumValues65) - } - } -} - -func enumPipelinesIngestionConfig(w *walker, n *walk.Node, v *pipelines.IngestionConfig) { - if v == nil { - return - } - if x := v.Report; x != nil { - c := n.Child("report") - enumPipelinesReportSpec(w, &c, x) - } - if x := v.Schema; x != nil { - c := n.Child("schema") - enumPipelinesSchemaSpec(w, &c, x) - } - if x := v.Table; x != nil { - c := n.Child("table") - enumPipelinesTableSpec(w, &c, x) - } -} - -func enumPipelinesTableSpecificConfig(w *walker, n *walk.Node, v *pipelines.TableSpecificConfig) { - if v == nil { - return - } - if s := string(v.ScdType); s != "" || walk.Forced(v.ForceSendFields, "ScdType") { - c := n.Child("scd_type") - w.enumValue(&c, s, enumValues105) - } -} - -func enumPostgresWeeklySchedule(w *walker, n *walk.Node, v *postgres.WeeklySchedule) { - if v == nil { - return - } - if s := string(v.DayOfWeek); s != "" || walk.Forced(v.ForceSendFields, "DayOfWeek") { - c := n.Child("day_of_week") - w.enumValue(&c, s, enumValues65) - } -} - -func enumDatabaseSyncedTableContinuousUpdateStatus(w *walker, n *walk.Node, v *database.SyncedTableContinuousUpdateStatus) { - if v == nil { - return - } - if x := v.InitialPipelineSyncProgress; x != nil { - c := n.Child("initial_pipeline_sync_progress") - enumDatabaseSyncedTablePipelineProgress(w, &c, x) - } -} - -func enumDatabaseSyncedTableProvisioningStatus(w *walker, n *walk.Node, v *database.SyncedTableProvisioningStatus) { - if v == nil { - return - } - if x := v.InitialPipelineSyncProgress; x != nil { - c := n.Child("initial_pipeline_sync_progress") - enumDatabaseSyncedTablePipelineProgress(w, &c, x) - } -} - -func enumDatabaseSyncedTableTriggeredUpdateStatus(w *walker, n *walk.Node, v *database.SyncedTableTriggeredUpdateStatus) { - if v == nil { - return - } - if x := v.TriggeredUpdateProgress; x != nil { - c := n.Child("triggered_update_progress") - enumDatabaseSyncedTablePipelineProgress(w, &c, x) - } -} - -func enumDatabaseSyncedTableSpecTypeOverride(w *walker, n *walk.Node, v *database.SyncedTableSpecTypeOverride) { - if v == nil { - return - } - if s := string(v.PgType); s != "" || walk.Forced(v.ForceSendFields, "PgType") { - c := n.Child("pg_type") - w.enumValue(&c, s, enumValues68) - } -} - -func enumSqlAlertV2OperandColumn2(w *walker, n *walk.Node, v *sql.AlertV2OperandColumn) { - if v == nil { - return - } - if s := string(v.Aggregation); s != "" || walk.Forced(v.ForceSendFields, "Aggregation") { - c := n.Child("aggregation") - w.enumValue(&c, s, enumValues78) - } -} - -func enumMlFlatSchema(w *walker, n *walk.Node, v *ml.FlatSchema) { - if v == nil { - return - } - if len(v.Fields) > 0 { - c := n.Child("fields") - for i := range v.Fields { - e := c.Elem(i) - enumMlFieldDefinition(w, &e, &v.Fields[i]) - } - } -} - -func enumJobsDeploymentSpec(w *walker, n *walk.Node, v *jobs.DeploymentSpec) { - if v == nil { - return - } - if x := &v.Compute; !walk.IsZeroStruct(x) || walk.Forced(v.ForceSendFields, "Compute") || n.HasRefs("compute") { - c := n.Child("compute") - enumJobsComputeSpec(w, &c, x) - } -} - -func enumJobsSubscription(w *walker, n *walk.Node, v *jobs.Subscription) { - if v == nil { - return - } - if x := v.Attachment; x != nil { - c := n.Child("attachment") - enumJobsSubscriptionAttachment(w, &c, x) - } -} - -func enumJobsTask2(w *walker, n *walk.Node, v *jobs.Task) { - if v == nil { - return - } - if x := v.AiRuntimeTask; x != nil { - c := n.Child("ai_runtime_task") - enumJobsAiRuntimeTask(w, &c, x) - } - if x := v.Compute; x != nil { - c := n.Child("compute") - enumJobsCompute(w, &c, x) - } - if x := v.ConditionTask; x != nil { - c := n.Child("condition_task") - enumJobsConditionTask(w, &c, x) - } - if x := v.DashboardTask; x != nil { - c := n.Child("dashboard_task") - enumJobsDashboardTask(w, &c, x) - } - if x := v.DbtTask; x != nil { - c := n.Child("dbt_task") - enumJobsDbtTask(w, &c, x) - } - if x := v.GenAiComputeTask; x != nil { - c := n.Child("gen_ai_compute_task") - enumJobsGenAiComputeTask(w, &c, x) - } - if x := v.Health; x != nil { - c := n.Child("health") - enumJobsJobsHealthRules(w, &c, x) - } - if x := v.NewCluster; x != nil { - c := n.Child("new_cluster") - enumComputeClusterSpec(w, &c, x) - } - if x := v.NotebookTask; x != nil { - c := n.Child("notebook_task") - enumJobsNotebookTask(w, &c, x) - } - if x := v.PowerBiTask; x != nil { - c := n.Child("power_bi_task") - enumJobsPowerBiTask(w, &c, x) - } - if s := string(v.RunIf); s != "" || walk.Forced(v.ForceSendFields, "RunIf") { - c := n.Child("run_if") - w.enumValue(&c, s, enumValues54) - } - if x := v.SparkPythonTask; x != nil { - c := n.Child("spark_python_task") - enumJobsSparkPythonTask(w, &c, x) - } - if x := v.SqlTask; x != nil { - c := n.Child("sql_task") - enumJobsSqlTask(w, &c, x) - } -} - -func enumJobsPowerBiModel(w *walker, n *walk.Node, v *jobs.PowerBiModel) { - if v == nil { - return - } - if s := string(v.AuthenticationMethod); s != "" || walk.Forced(v.ForceSendFields, "AuthenticationMethod") { - c := n.Child("authentication_method") - w.enumValue(&c, s, enumValues106) - } - if s := string(v.StorageMode); s != "" || walk.Forced(v.ForceSendFields, "StorageMode") { - c := n.Child("storage_mode") - w.enumValue(&c, s, enumValues107) - } -} - -func enumJobsPowerBiTable(w *walker, n *walk.Node, v *jobs.PowerBiTable) { - if v == nil { - return - } - if s := string(v.StorageMode); s != "" || walk.Forced(v.ForceSendFields, "StorageMode") { - c := n.Child("storage_mode") - w.enumValue(&c, s, enumValues107) - } -} - -func enumJobsSqlTaskFile(w *walker, n *walk.Node, v *jobs.SqlTaskFile) { - if v == nil { - return - } - if s := string(v.Source); s != "" { - c := n.Child("source") - w.enumValue(&c, s, enumValues96) - } -} - -func enumCatalogModelServiceConfigDestinationConfig(w *walker, n *walk.Node, v *catalog.ModelServiceConfigDestinationConfig) { - if v == nil { - return - } - if s := string(v.DestinationType); s != "" || walk.Forced(v.ForceSendFields, "DestinationType") { - c := n.Child("destination_type") - w.enumValue(&c, s, enumValues108) - } -} - -func enumCatalogModelServiceConfigFallbackConfig(w *walker, n *walk.Node, v *catalog.ModelServiceConfigFallbackConfig) { - if v == nil { - return - } - if len(v.Destinations) > 0 { - c := n.Child("destinations") - for i := range v.Destinations { - e := c.Elem(i) - enumCatalogModelServiceConfigDestinationConfig(w, &e, &v.Destinations[i]) - } - } -} - -func enumServingAiGatewayGuardrailParameters(w *walker, n *walk.Node, v *serving.AiGatewayGuardrailParameters) { - if v == nil { - return - } - if x := v.Pii; x != nil { - c := n.Child("pii") - enumServingAiGatewayGuardrailPiiBehavior(w, &c, x) - } -} - -func enumServingExternalModel(w *walker, n *walk.Node, v *serving.ExternalModel) { - if v == nil { - return - } - if x := v.AmazonBedrockConfig; x != nil { - c := n.Child("amazon_bedrock_config") - enumServingAmazonBedrockConfig(w, &c, x) - } - if s := string(v.Provider); s != "" { - c := n.Child("provider") - w.enumValue(&c, s, enumValues109) - } -} - -func enumPipelinesReportSpec(w *walker, n *walk.Node, v *pipelines.ReportSpec) { - if v == nil { - return - } - if x := v.TableConfiguration; x != nil { - c := n.Child("table_configuration") - enumPipelinesTableSpecificConfig(w, &c, x) - } -} - -func enumPipelinesSchemaSpec(w *walker, n *walk.Node, v *pipelines.SchemaSpec) { - if v == nil { - return - } - if x := v.ConnectorOptions; x != nil { - c := n.Child("connector_options") - enumPipelinesConnectorOptions(w, &c, x) - } - if x := v.FanoutOptions; x != nil { - c := n.Child("fanout_options") - enumPipelinesIngestionPipelineDefinitionFanoutOptions(w, &c, x) - } - if x := v.TableConfiguration; x != nil { - c := n.Child("table_configuration") - enumPipelinesTableSpecificConfig(w, &c, x) - } -} - -func enumPipelinesTableSpec(w *walker, n *walk.Node, v *pipelines.TableSpec) { - if v == nil { - return - } - if x := v.ConnectorOptions; x != nil { - c := n.Child("connector_options") - enumPipelinesConnectorOptions(w, &c, x) - } - if x := v.TableConfiguration; x != nil { - c := n.Child("table_configuration") - enumPipelinesTableSpecificConfig(w, &c, x) - } -} - -func enumDatabaseSyncedTablePipelineProgress(w *walker, n *walk.Node, v *database.SyncedTablePipelineProgress) { - if v == nil { - return - } - if s := string(v.ProvisioningPhase); s != "" || walk.Forced(v.ForceSendFields, "ProvisioningPhase") { - c := n.Child("provisioning_phase") - w.enumValue(&c, s, enumValues110) - } -} - -func enumMlFieldDefinition(w *walker, n *walk.Node, v *ml.FieldDefinition) { - if v == nil { - return - } - if s := string(v.DataType); s != "" { - c := n.Child("data_type") - w.enumValue(&c, s, enumValues111) - } -} - -func enumJobsComputeSpec(w *walker, n *walk.Node, v *jobs.ComputeSpec) { - if v == nil { - return - } - if s := string(v.AcceleratorType); s != "" || walk.Forced(v.ForceSendFields, "AcceleratorType") { - c := n.Child("accelerator_type") - w.enumValue(&c, s, enumValues94) - } -} - -func enumJobsSubscriptionAttachment(w *walker, n *walk.Node, v *jobs.SubscriptionAttachment) { - if v == nil { - return - } - if x := v.DataAttachment; x != nil { - c := n.Child("data_attachment") - enumJobsSubscriptionAttachmentDataAttachment(w, &c, x) - } - if x := v.PageAttachment; x != nil { - c := n.Child("page_attachment") - enumJobsSubscriptionAttachmentPageAttachment(w, &c, x) - } -} - -func enumServingAiGatewayGuardrailPiiBehavior(w *walker, n *walk.Node, v *serving.AiGatewayGuardrailPiiBehavior) { - if v == nil { - return - } - if s := string(v.Behavior); s != "" { - c := n.Child("behavior") - w.enumValue(&c, s, enumValues112) - } -} - -func enumServingAmazonBedrockConfig(w *walker, n *walk.Node, v *serving.AmazonBedrockConfig) { - if v == nil { - return - } - if s := string(v.BedrockProvider); s != "" || walk.Forced(v.ForceSendFields, "BedrockProvider") { - c := n.Child("bedrock_provider") - w.enumValue(&c, s, enumValues113) - } -} - -func enumPipelinesConnectorOptions(w *walker, n *walk.Node, v *pipelines.ConnectorOptions) { - if v == nil { - return - } - if x := v.GdriveOptions; x != nil { - c := n.Child("gdrive_options") - enumPipelinesGoogleDriveOptions(w, &c, x) - } - if x := v.KafkaOptions; x != nil { - c := n.Child("kafka_options") - enumPipelinesKafkaOptions(w, &c, x) - } - if x := v.LinkedinAdsOptions; x != nil { - c := n.Child("linkedin_ads_options") - enumPipelinesLinkedInAdsOptions(w, &c, x) - } - if x := v.OnedriveOptions; x != nil { - c := n.Child("onedrive_options") - enumPipelinesOneDriveOptions(w, &c, x) - } - if x := v.OutlookOptions; x != nil { - c := n.Child("outlook_options") - enumPipelinesOutlookOptions(w, &c, x) - } - if x := v.SharepointOptions; x != nil { - c := n.Child("sharepoint_options") - enumPipelinesSharepointOptions(w, &c, x) - } - if x := v.TiktokAdsOptions; x != nil { - c := n.Child("tiktok_ads_options") - enumPipelinesTikTokAdsOptions(w, &c, x) - } -} - -func enumPipelinesIngestionPipelineDefinitionFanoutOptions(w *walker, n *walk.Node, v *pipelines.IngestionPipelineDefinitionFanoutOptions) { - if v == nil { - return - } - if len(v.Transforms) > 0 { - c := n.Child("transforms") - for i := range v.Transforms { - e := c.Elem(i) - enumPipelinesTransformer(w, &e, &v.Transforms[i]) - } - } -} - -func enumJobsSubscriptionAttachmentDataAttachment(w *walker, n *walk.Node, v *jobs.SubscriptionAttachmentDataAttachment) { - if v == nil { - return - } - if s := string(v.FileFormat); s != "" || walk.Forced(v.ForceSendFields, "FileFormat") { - c := n.Child("file_format") - w.enumValue(&c, s, enumValues114) - } -} - -func enumJobsSubscriptionAttachmentPageAttachment(w *walker, n *walk.Node, v *jobs.SubscriptionAttachmentPageAttachment) { - if v == nil { - return - } - if s := string(v.PageSelection); s != "" { - c := n.Child("page_selection") - w.enumValue(&c, s, enumValues115) - } -} - -func enumPipelinesGoogleDriveOptions(w *walker, n *walk.Node, v *pipelines.GoogleDriveOptions) { - if v == nil { - return - } - if s := string(v.EntityType); s != "" || walk.Forced(v.ForceSendFields, "EntityType") { - c := n.Child("entity_type") - w.enumValue(&c, s, enumValues116) - } - if x := v.FileIngestionOptions; x != nil { - c := n.Child("file_ingestion_options") - enumPipelinesFileIngestionOptions(w, &c, x) - } -} - -func enumPipelinesKafkaOptions(w *walker, n *walk.Node, v *pipelines.KafkaOptions) { - if v == nil { - return - } - if x := v.KeyTransformer; x != nil { - c := n.Child("key_transformer") - enumPipelinesTransformer2(w, &c, x) - } - if x := v.ValueTransformer; x != nil { - c := n.Child("value_transformer") - enumPipelinesTransformer2(w, &c, x) - } -} - -func enumPipelinesLinkedInAdsOptions(w *walker, n *walk.Node, v *pipelines.LinkedInAdsOptions) { - if v == nil { - return - } - if x := v.CustomReportOptions; x != nil { - c := n.Child("custom_report_options") - enumPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptions(w, &c, x) - } -} - -func enumPipelinesOneDriveOptions(w *walker, n *walk.Node, v *pipelines.OneDriveOptions) { - if v == nil { - return - } - if s := string(v.EntityType); s != "" || walk.Forced(v.ForceSendFields, "EntityType") { - c := n.Child("entity_type") - w.enumValue(&c, s, enumValues117) - } - if x := v.FileIngestionOptions; x != nil { - c := n.Child("file_ingestion_options") - enumPipelinesFileIngestionOptions(w, &c, x) - } -} - -func enumPipelinesOutlookOptions(w *walker, n *walk.Node, v *pipelines.OutlookOptions) { - if v == nil { - return - } - if s := string(v.AttachmentMode); s != "" || walk.Forced(v.ForceSendFields, "AttachmentMode") { - c := n.Child("attachment_mode") - w.enumValue(&c, s, enumValues118) - } - if s := string(v.BodyFormat); s != "" || walk.Forced(v.ForceSendFields, "BodyFormat") { - c := n.Child("body_format") - w.enumValue(&c, s, enumValues119) - } -} - -func enumPipelinesSharepointOptions(w *walker, n *walk.Node, v *pipelines.SharepointOptions) { - if v == nil { - return - } - if s := string(v.EntityType); s != "" || walk.Forced(v.ForceSendFields, "EntityType") { - c := n.Child("entity_type") - w.enumValue(&c, s, enumValues120) - } - if x := v.FileIngestionOptions; x != nil { - c := n.Child("file_ingestion_options") - enumPipelinesFileIngestionOptions(w, &c, x) - } -} - -func enumPipelinesTikTokAdsOptions(w *walker, n *walk.Node, v *pipelines.TikTokAdsOptions) { - if v == nil { - return - } - if x := v.CustomReportOptions; x != nil { - c := n.Child("custom_report_options") - enumPipelinesTikTokAdsOptionsTikTokAdsCustomReportOptions(w, &c, x) - } - if s := string(v.DataLevel); s != "" || walk.Forced(v.ForceSendFields, "DataLevel") { - c := n.Child("data_level") - w.enumValue(&c, s, enumValues121) - } - if s := string(v.ReportType); s != "" || walk.Forced(v.ForceSendFields, "ReportType") { - c := n.Child("report_type") - w.enumValue(&c, s, enumValues122) - } -} - -func enumPipelinesTransformer(w *walker, n *walk.Node, v *pipelines.Transformer) { - if v == nil { - return - } - if x := v.AvroOptions; x != nil { - c := n.Child("avro_options") - enumPipelinesAvroTransformerOptions(w, &c, x) - } - if s := string(v.Format); s != "" || walk.Forced(v.ForceSendFields, "Format") { - c := n.Child("format") - w.enumValue(&c, s, enumValues123) - } - if x := v.JsonOptions; x != nil { - c := n.Child("json_options") - enumPipelinesJsonTransformerOptions(w, &c, x) - } - if x := v.ProtobufOptions; x != nil { - c := n.Child("protobuf_options") - enumPipelinesProtobufTransformerOptions(w, &c, x) - } -} - -func enumPipelinesFileIngestionOptions(w *walker, n *walk.Node, v *pipelines.FileIngestionOptions) { - if v == nil { - return - } - if s := string(v.Format); s != "" || walk.Forced(v.ForceSendFields, "Format") { - c := n.Child("format") - w.enumValue(&c, s, enumValues124) - } - if s := string(v.SchemaEvolutionMode); s != "" || walk.Forced(v.ForceSendFields, "SchemaEvolutionMode") { - c := n.Child("schema_evolution_mode") - w.enumValue(&c, s, enumValues125) - } -} - -func enumPipelinesTransformer2(w *walker, n *walk.Node, v *pipelines.Transformer) { - if v == nil { - return - } - if x := v.AvroOptions; x != nil { - c := n.Child("avro_options") - enumPipelinesAvroTransformerOptions(w, &c, x) - } - if s := string(v.Format); s != "" || walk.Forced(v.ForceSendFields, "Format") { - c := n.Child("format") - w.enumValue(&c, s, enumValues123) - } - if x := v.JsonOptions; x != nil { - c := n.Child("json_options") - enumPipelinesJsonTransformerOptions(w, &c, x) - } - if x := v.ProtobufOptions; x != nil { - c := n.Child("protobuf_options") - enumPipelinesProtobufTransformerOptions(w, &c, x) - } -} - -func enumPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptions(w *walker, n *walk.Node, v *pipelines.LinkedInAdsOptionsLinkedInAdsCustomReportOptions) { - if v == nil { - return - } - if len(v.EntityGranularity) > 0 { - c := n.Child("entity_granularity") - for i := range v.EntityGranularity { - e := c.Elem(i) - w.enumValue(&e, string(v.EntityGranularity[i]), enumValues126) - } - } - if s := string(v.Finder); s != "" { - c := n.Child("finder") - w.enumValue(&c, s, enumValues127) - } - if s := string(v.TimeGranularity); s != "" { - c := n.Child("time_granularity") - w.enumValue(&c, s, enumValues128) - } -} - -func enumPipelinesTikTokAdsOptionsTikTokAdsCustomReportOptions(w *walker, n *walk.Node, v *pipelines.TikTokAdsOptionsTikTokAdsCustomReportOptions) { - if v == nil { - return - } - if s := string(v.DataLevel); s != "" || walk.Forced(v.ForceSendFields, "DataLevel") { - c := n.Child("data_level") - w.enumValue(&c, s, enumValues121) - } - if s := string(v.ReportType); s != "" || walk.Forced(v.ForceSendFields, "ReportType") { - c := n.Child("report_type") - w.enumValue(&c, s, enumValues122) - } -} - -func enumPipelinesAvroTransformerOptions(w *walker, n *walk.Node, v *pipelines.AvroTransformerOptions) { - if v == nil { - return - } - if s := string(v.ParseMode); s != "" || walk.Forced(v.ForceSendFields, "ParseMode") { - c := n.Child("parse_mode") - w.enumValue(&c, s, enumValues129) - } -} - -func enumPipelinesJsonTransformerOptions(w *walker, n *walk.Node, v *pipelines.JsonTransformerOptions) { - if v == nil { - return - } - if s := string(v.SchemaEvolutionMode); s != "" || walk.Forced(v.ForceSendFields, "SchemaEvolutionMode") { - c := n.Child("schema_evolution_mode") - w.enumValue(&c, s, enumValues125) - } -} - -func enumPipelinesProtobufTransformerOptions(w *walker, n *walk.Node, v *pipelines.ProtobufTransformerOptions) { - if v == nil { - return - } - if s := string(v.ParseMode); s != "" || walk.Forced(v.ForceSendFields, "ParseMode") { - c := n.Child("parse_mode") - w.enumValue(&c, s, enumValues129) - } -} diff --git a/bundle/config/validate/required.go b/bundle/config/validate/required.go index 251293e8697..ebd69123caa 100644 --- a/bundle/config/validate/required.go +++ b/bundle/config/validate/required.go @@ -8,6 +8,7 @@ import ( "strings" "github.com/databricks/cli/bundle" + "github.com/databricks/cli/bundle/config/walk" "github.com/databricks/cli/libs/diag" "github.com/databricks/cli/libs/structs/structpath" "github.com/databricks/databricks-sdk-go/service/catalog" @@ -26,7 +27,9 @@ 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 := walkConfig(&b.Config, true, requiredConfigRoot) + w := &walker{} + walk.Required(&b.Config, w.missing) + diags := w.diags sortDiagnostics(diags) return diags } diff --git a/bundle/config/validate/required_walk.go b/bundle/config/validate/required_walk.go deleted file mode 100644 index 121933e85b3..00000000000 --- a/bundle/config/validate/required_walk.go +++ /dev/null @@ -1,5687 +0,0 @@ -// Code generated by bundle/internal/validation. DO NOT EDIT. - -// requiredWalk reports 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/cli/bundle/config/walk" - "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 *walk.Node, v *config.Root) { - if v == nil { - return - } - if len(v.Artifacts) > 0 { - c := n.Child("artifacts") - for k, x := range v.Artifacts { - if k == "" { - continue - } - e := c.Child(k) - requiredConfigArtifact(w, &e, x) - } - } - if x := &v.Bundle; !walk.IsZeroStruct(x) || n.HasRefs("bundle") { - c := n.Child("bundle") - requiredConfigBundle(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesPermission(w, &e, &v.Permissions[i]) - } - } - if x := &v.Resources; !walk.IsZeroStruct(x) || n.HasRefs("resources") { - c := n.Child("resources") - requiredConfigResources(w, &c, x) - } - if len(v.Scripts) > 0 { - c := n.Child("scripts") - for k, x := range v.Scripts { - if k == "" { - continue - } - e := c.Child(k) - requiredConfigScript(w, &e, &x) - } - } -} - -func requiredConfigArtifact(w *walker, n *walk.Node, v *config.Artifact) { - if v == nil { - return - } - if len(v.Files) > 0 { - c := n.Child("files") - for i := range v.Files { - e := c.Elem(i) - requiredConfigArtifactFile(w, &e, &v.Files[i]) - } - } -} - -func requiredConfigBundle(w *walker, n *walk.Node, v *config.Bundle) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.Name != "") { - w.missing(n, "name") - } -} - -func requiredResourcesPermission(w *walker, n *walk.Node, v *resources.Permission) { - if v == nil { - w.missing(n, "level") - return - } - if !(v.Level != "") { - w.missing(n, "level") - } -} - -func requiredConfigResources(w *walker, n *walk.Node, v *config.Resources) { - if v == nil { - return - } - if len(v.Alerts) > 0 { - c := n.Child("alerts") - for k, x := range v.Alerts { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesAlert(w, &e, x) - } - } - if len(v.Apps) > 0 { - c := n.Child("apps") - for k, x := range v.Apps { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesApp(w, &e, x) - } - } - if len(v.Catalogs) > 0 { - c := n.Child("catalogs") - for k, x := range v.Catalogs { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesCatalog(w, &e, x) - } - } - if len(v.ClusterPolicies) > 0 { - c := n.Child("cluster_policies") - for k, x := range v.ClusterPolicies { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesClusterPolicy(w, &e, x) - } - } - if len(v.Clusters) > 0 { - c := n.Child("clusters") - for k, x := range v.Clusters { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesCluster(w, &e, x) - } - } - if len(v.Dashboards) > 0 { - c := n.Child("dashboards") - for k, x := range v.Dashboards { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesDashboard(w, &e, x) - } - } - if len(v.DatabaseCatalogs) > 0 { - c := n.Child("database_catalogs") - for k, x := range v.DatabaseCatalogs { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesDatabaseCatalog(w, &e, x) - } - } - if len(v.DatabaseInstances) > 0 { - c := n.Child("database_instances") - for k, x := range v.DatabaseInstances { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesDatabaseInstance(w, &e, x) - } - } - if len(v.Experiments) > 0 { - c := n.Child("experiments") - for k, x := range v.Experiments { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesMlflowExperiment(w, &e, x) - } - } - if len(v.ExternalLocations) > 0 { - c := n.Child("external_locations") - for k, x := range v.ExternalLocations { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesExternalLocation(w, &e, x) - } - } - if len(v.Features) > 0 { - c := n.Child("features") - for k, x := range v.Features { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesFeature(w, &e, x) - } - } - if len(v.GenieSpaces) > 0 { - c := n.Child("genie_spaces") - for k, x := range v.GenieSpaces { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesGenieSpace(w, &e, x) - } - } - if len(v.InstancePools) > 0 { - c := n.Child("instance_pools") - for k, x := range v.InstancePools { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesInstancePool(w, &e, x) - } - } - if len(v.JobRuns) > 0 { - c := n.Child("job_runs") - for k, x := range v.JobRuns { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesJobRun(w, &e, x) - } - } - if len(v.Jobs) > 0 { - c := n.Child("jobs") - for k, x := range v.Jobs { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesJob(w, &e, x) - } - } - if len(v.McpServices) > 0 { - c := n.Child("mcp_services") - for k, x := range v.McpServices { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesMcpService(w, &e, x) - } - } - if len(v.ModelProviderServices) > 0 { - c := n.Child("model_provider_services") - for k, x := range v.ModelProviderServices { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesModelProviderService(w, &e, x) - } - } - if len(v.ModelServices) > 0 { - c := n.Child("model_services") - for k, x := range v.ModelServices { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesModelService(w, &e, x) - } - } - if len(v.ModelServingEndpoints) > 0 { - c := n.Child("model_serving_endpoints") - for k, x := range v.ModelServingEndpoints { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesModelServingEndpoint(w, &e, x) - } - } - if len(v.Models) > 0 { - c := n.Child("models") - for k, x := range v.Models { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesMlflowModel(w, &e, x) - } - } - if len(v.Pipelines) > 0 { - c := n.Child("pipelines") - for k, x := range v.Pipelines { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesPipeline(w, &e, x) - } - } - if len(v.PostgresBranches) > 0 { - c := n.Child("postgres_branches") - for k, x := range v.PostgresBranches { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesPostgresBranch(w, &e, x) - } - } - if len(v.PostgresCatalogs) > 0 { - c := n.Child("postgres_catalogs") - for k, x := range v.PostgresCatalogs { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesPostgresCatalog(w, &e, x) - } - } - if len(v.PostgresDatabases) > 0 { - c := n.Child("postgres_databases") - for k, x := range v.PostgresDatabases { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesPostgresDatabase(w, &e, x) - } - } - if len(v.PostgresEndpoints) > 0 { - c := n.Child("postgres_endpoints") - for k, x := range v.PostgresEndpoints { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesPostgresEndpoint(w, &e, x) - } - } - if len(v.PostgresProjects) > 0 { - c := n.Child("postgres_projects") - for k, x := range v.PostgresProjects { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesPostgresProject(w, &e, x) - } - } - if len(v.PostgresRoles) > 0 { - c := n.Child("postgres_roles") - for k, x := range v.PostgresRoles { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesPostgresRole(w, &e, x) - } - } - if len(v.PostgresSnapshotSchedules) > 0 { - c := n.Child("postgres_snapshot_schedules") - for k, x := range v.PostgresSnapshotSchedules { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesPostgresSnapshotSchedule(w, &e, x) - } - } - if len(v.PostgresSyncedTables) > 0 { - c := n.Child("postgres_synced_tables") - for k, x := range v.PostgresSyncedTables { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesPostgresSyncedTable(w, &e, x) - } - } - if len(v.QualityMonitors) > 0 { - c := n.Child("quality_monitors") - for k, x := range v.QualityMonitors { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesQualityMonitor(w, &e, x) - } - } - if len(v.RegisteredModels) > 0 { - c := n.Child("registered_models") - for k, x := range v.RegisteredModels { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesRegisteredModel(w, &e, x) - } - } - if len(v.Schemas) > 0 { - c := n.Child("schemas") - for k, x := range v.Schemas { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesSchema(w, &e, x) - } - } - if len(v.SecretScopes) > 0 { - c := n.Child("secret_scopes") - for k, x := range v.SecretScopes { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesSecretScope(w, &e, x) - } - } - if len(v.Secrets) > 0 { - c := n.Child("secrets") - for k, x := range v.Secrets { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesSecret(w, &e, x) - } - } - if len(v.SqlWarehouses) > 0 { - c := n.Child("sql_warehouses") - for k, x := range v.SqlWarehouses { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesSqlWarehouse(w, &e, x) - } - } - if len(v.SyncedDatabaseTables) > 0 { - c := n.Child("synced_database_tables") - for k, x := range v.SyncedDatabaseTables { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesSyncedDatabaseTable(w, &e, x) - } - } - if len(v.VectorSearchEndpoints) > 0 { - c := n.Child("vector_search_endpoints") - for k, x := range v.VectorSearchEndpoints { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesVectorSearchEndpoint(w, &e, x) - } - } - if len(v.VectorSearchIndexes) > 0 { - c := n.Child("vector_search_indexes") - for k, x := range v.VectorSearchIndexes { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesVectorSearchIndex(w, &e, x) - } - } - if len(v.Volumes) > 0 { - c := n.Child("volumes") - for k, x := range v.Volumes { - if k == "" { - continue - } - e := c.Child(k) - requiredResourcesVolume(w, &e, x) - } - } -} - -func requiredConfigScript(w *walker, n *walk.Node, v *config.Script) { - if v == nil { - w.missing(n, "content") - return - } - if !(v.Content != "") { - w.missing(n, "content") - } -} - -func requiredConfigArtifactFile(w *walker, n *walk.Node, v *config.ArtifactFile) { - if v == nil { - w.missing(n, "source") - return - } - if !(v.Source != "") { - w.missing(n, "source") - } -} - -func requiredResourcesAlert(w *walker, n *walk.Node, v *resources.Alert) { - if v == nil { - w.missing(n, "display_name") - w.missing(n, "evaluation") - w.missing(n, "query_text") - w.missing(n, "schedule") - w.missing(n, "warehouse_id") - return - } - if !(v.AlertV2.DisplayName != "" || walk.Forced(v.AlertV2.ForceSendFields, "DisplayName")) { - w.missing(n, "display_name") - } - if !(!walk.IsZeroStruct(&v.AlertV2.Evaluation) || walk.Forced(v.AlertV2.ForceSendFields, "Evaluation") || n.HasRefs("evaluation")) { - w.missing(n, "evaluation") - } - if !(v.AlertV2.QueryText != "" || walk.Forced(v.AlertV2.ForceSendFields, "QueryText")) { - w.missing(n, "query_text") - } - if !(!walk.IsZeroStruct(&v.AlertV2.Schedule) || walk.Forced(v.AlertV2.ForceSendFields, "Schedule") || n.HasRefs("schedule")) { - w.missing(n, "schedule") - } - if !(v.AlertV2.WarehouseId != "" || walk.Forced(v.AlertV2.ForceSendFields, "WarehouseId")) { - w.missing(n, "warehouse_id") - } - if x := &v.AlertV2.Evaluation; !walk.IsZeroStruct(x) || walk.Forced(v.AlertV2.ForceSendFields, "Evaluation") || n.HasRefs("evaluation") { - c := n.Child("evaluation") - requiredSqlAlertV2Evaluation(w, &c, x) - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if len(v.AlertV2.Parameters) > 0 { - c := n.Child("parameters") - for i := range v.AlertV2.Parameters { - e := c.Elem(i) - requiredSqlAlertStatementParameter(w, &e, &v.AlertV2.Parameters[i]) - } - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesPermission(w, &e, &v.Permissions[i]) - } - } - if x := &v.AlertV2.Schedule; !walk.IsZeroStruct(x) || walk.Forced(v.AlertV2.ForceSendFields, "Schedule") || n.HasRefs("schedule") { - c := n.Child("schedule") - requiredSqlCronSchedule(w, &c, x) - } -} - -func requiredResourcesApp(w *walker, n *walk.Node, v *resources.App) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.App.Name != "" || walk.Forced(v.App.ForceSendFields, "Name")) { - w.missing(n, "name") - } - if x := v.App.ActiveDeployment; x != nil { - c := n.Child("active_deployment") - requiredAppsAppDeployment(w, &c, x) - } else if walk.Forced(v.App.ForceSendFields, "ActiveDeployment") || n.IsRef("active_deployment") { - c := n.Child("active_deployment") - requiredAppsAppDeployment(w, &c, nil) - } - if x := v.Config; x != nil { - c := n.Child("config") - requiredResourcesAppConfig(w, &c, x) - } else if n.IsRef("config") { - c := n.Child("config") - requiredResourcesAppConfig(w, &c, nil) - } - if x := v.App.DefaultGitSource; x != nil { - c := n.Child("default_git_source") - requiredAppsGitSource(w, &c, x) - } else if walk.Forced(v.App.ForceSendFields, "DefaultGitSource") || n.IsRef("default_git_source") { - c := n.Child("default_git_source") - requiredAppsGitSource(w, &c, nil) - } - if x := v.App.GitRepository; x != nil { - c := n.Child("git_repository") - requiredAppsGitRepository(w, &c, x) - } else if walk.Forced(v.App.ForceSendFields, "GitRepository") || n.IsRef("git_repository") { - c := n.Child("git_repository") - requiredAppsGitRepository(w, &c, nil) - } - if x := v.App.GitSource; x != nil { - c := n.Child("git_source") - requiredAppsGitSource(w, &c, x) - } else if walk.Forced(v.App.ForceSendFields, "GitSource") || n.IsRef("git_source") { - c := n.Child("git_source") - requiredAppsGitSource(w, &c, nil) - } - if x := v.Lifecycle; x != nil { - c := n.Child("lifecycle") - requiredResourcesLifecycleWithStarted(w, &c, x) - } else if n.IsRef("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycleWithStarted(w, &c, nil) - } - if x := v.App.PendingDeployment; x != nil { - c := n.Child("pending_deployment") - requiredAppsAppDeployment(w, &c, x) - } else if walk.Forced(v.App.ForceSendFields, "PendingDeployment") || n.IsRef("pending_deployment") { - c := n.Child("pending_deployment") - requiredAppsAppDeployment(w, &c, nil) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesAppPermission(w, &e, &v.Permissions[i]) - } - } - if len(v.App.Resources) > 0 { - c := n.Child("resources") - for i := range v.App.Resources { - e := c.Elem(i) - requiredAppsAppResource(w, &e, &v.App.Resources[i]) - } - } - if len(v.App.TelemetryExportDestinations) > 0 { - c := n.Child("telemetry_export_destinations") - for i := range v.App.TelemetryExportDestinations { - e := c.Elem(i) - requiredAppsTelemetryExportDestination(w, &e, &v.App.TelemetryExportDestinations[i]) - } - } -} - -func requiredResourcesCatalog(w *walker, n *walk.Node, v *resources.Catalog) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.CreateCatalog.Name != "" || walk.Forced(v.CreateCatalog.ForceSendFields, "Name")) { - w.missing(n, "name") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if x := v.CreateCatalog.ManagedEncryptionSettings; x != nil { - c := n.Child("managed_encryption_settings") - requiredCatalogEncryptionSettings(w, &c, x) - } else if walk.Forced(v.CreateCatalog.ForceSendFields, "ManagedEncryptionSettings") || n.IsRef("managed_encryption_settings") { - c := n.Child("managed_encryption_settings") - requiredCatalogEncryptionSettings(w, &c, nil) - } -} - -func requiredResourcesClusterPolicy(w *walker, n *walk.Node, v *resources.ClusterPolicy) { - if v == nil { - return - } - if len(v.CreatePolicy.Libraries) > 0 { - c := n.Child("libraries") - for i := range v.CreatePolicy.Libraries { - e := c.Elem(i) - requiredComputeLibrary(w, &e, &v.CreatePolicy.Libraries[i]) - } - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesClusterPolicyPermission(w, &e, &v.Permissions[i]) - } - } -} - -func requiredResourcesCluster(w *walker, n *walk.Node, v *resources.Cluster) { - if v == nil { - return - } - if x := v.ClusterSpec.ClusterLogConf; x != nil { - c := n.Child("cluster_log_conf") - requiredComputeClusterLogConf(w, &c, x) - } else if walk.Forced(v.ClusterSpec.ForceSendFields, "ClusterLogConf") || n.IsRef("cluster_log_conf") { - c := n.Child("cluster_log_conf") - requiredComputeClusterLogConf(w, &c, nil) - } - if len(v.ClusterSpec.InitScripts) > 0 { - c := n.Child("init_scripts") - for i := range v.ClusterSpec.InitScripts { - e := c.Elem(i) - requiredComputeInitScriptInfo(w, &e, &v.ClusterSpec.InitScripts[i]) - } - } - if len(v.Libraries) > 0 { - c := n.Child("libraries") - for i := range v.Libraries { - e := c.Elem(i) - requiredComputeLibrary(w, &e, &v.Libraries[i]) - } - } - if x := v.Lifecycle; x != nil { - c := n.Child("lifecycle") - requiredResourcesLifecycleWithStarted(w, &c, x) - } else if n.IsRef("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycleWithStarted(w, &c, nil) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesClusterPermission(w, &e, &v.Permissions[i]) - } - } - if x := v.ClusterSpec.WorkloadType; x != nil { - c := n.Child("workload_type") - requiredComputeWorkloadType(w, &c, x) - } else if walk.Forced(v.ClusterSpec.ForceSendFields, "WorkloadType") || n.IsRef("workload_type") { - c := n.Child("workload_type") - requiredComputeWorkloadType(w, &c, nil) - } -} - -func requiredResourcesDashboard(w *walker, n *walk.Node, v *resources.Dashboard) { - if v == nil { - return - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesPermission(w, &e, &v.Permissions[i]) - } - } -} - -func requiredResourcesDatabaseCatalog(w *walker, n *walk.Node, v *resources.DatabaseCatalog) { - if v == nil { - w.missing(n, "database_instance_name") - w.missing(n, "database_name") - w.missing(n, "name") - return - } - if !(v.DatabaseCatalog.DatabaseInstanceName != "" || walk.Forced(v.DatabaseCatalog.ForceSendFields, "DatabaseInstanceName")) { - w.missing(n, "database_instance_name") - } - if !(v.DatabaseCatalog.DatabaseName != "" || walk.Forced(v.DatabaseCatalog.ForceSendFields, "DatabaseName")) { - w.missing(n, "database_name") - } - if !(v.DatabaseCatalog.Name != "" || walk.Forced(v.DatabaseCatalog.ForceSendFields, "Name")) { - w.missing(n, "name") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } -} - -func requiredResourcesDatabaseInstance(w *walker, n *walk.Node, v *resources.DatabaseInstance) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.DatabaseInstance.Name != "" || walk.Forced(v.DatabaseInstance.ForceSendFields, "Name")) { - w.missing(n, "name") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesPermission(w, &e, &v.Permissions[i]) - } - } -} - -func requiredResourcesMlflowExperiment(w *walker, n *walk.Node, v *resources.MlflowExperiment) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.CreateExperiment.Name != "" || walk.Forced(v.CreateExperiment.ForceSendFields, "Name")) { - w.missing(n, "name") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesMlflowExperimentPermission(w, &e, &v.Permissions[i]) - } - } - if x := v.CreateExperiment.TraceLocation; x != nil { - c := n.Child("trace_location") - requiredMlExperimentTraceLocation(w, &c, x) - } else if walk.Forced(v.CreateExperiment.ForceSendFields, "TraceLocation") || n.IsRef("trace_location") { - c := n.Child("trace_location") - requiredMlExperimentTraceLocation(w, &c, nil) - } -} - -func requiredResourcesExternalLocation(w *walker, n *walk.Node, v *resources.ExternalLocation) { - if v == nil { - w.missing(n, "credential_name") - w.missing(n, "name") - w.missing(n, "url") - return - } - if !(v.CreateExternalLocation.CredentialName != "" || walk.Forced(v.CreateExternalLocation.ForceSendFields, "CredentialName")) { - w.missing(n, "credential_name") - } - if !(v.CreateExternalLocation.Name != "" || walk.Forced(v.CreateExternalLocation.ForceSendFields, "Name")) { - w.missing(n, "name") - } - if !(v.CreateExternalLocation.Url != "" || walk.Forced(v.CreateExternalLocation.ForceSendFields, "Url")) { - w.missing(n, "url") - } - if x := &v.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } -} - -func requiredResourcesFeature(w *walker, n *walk.Node, v *resources.Feature) { - if v == nil { - w.missing(n, "full_name") - w.missing(n, "function") - w.missing(n, "source") - return - } - if !(v.Feature.FullName != "" || walk.Forced(v.Feature.ForceSendFields, "FullName")) { - w.missing(n, "full_name") - } - if !(!walk.IsZeroStruct(&v.Feature.Function) || walk.Forced(v.Feature.ForceSendFields, "Function") || n.HasRefs("function")) { - w.missing(n, "function") - } - if !(!walk.IsZeroStruct(&v.Feature.Source) || walk.Forced(v.Feature.ForceSendFields, "Source") || n.HasRefs("source")) { - w.missing(n, "source") - } - if len(v.Feature.Entities) > 0 { - c := n.Child("entities") - for i := range v.Feature.Entities { - e := c.Elem(i) - requiredMlEntityColumn(w, &e, &v.Feature.Entities[i]) - } - } - if x := &v.Feature.Function; !walk.IsZeroStruct(x) || walk.Forced(v.Feature.ForceSendFields, "Function") || n.HasRefs("function") { - c := n.Child("function") - requiredMlFunction(w, &c, x) - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if x := &v.Feature.Source; !walk.IsZeroStruct(x) || walk.Forced(v.Feature.ForceSendFields, "Source") || n.HasRefs("source") { - c := n.Child("source") - requiredMlDataSource(w, &c, x) - } - if x := v.Feature.TimeWindow; x != nil { - c := n.Child("time_window") - requiredMlTimeWindow(w, &c, x) - } else if walk.Forced(v.Feature.ForceSendFields, "TimeWindow") || n.IsRef("time_window") { - c := n.Child("time_window") - requiredMlTimeWindow(w, &c, nil) - } - if x := v.Feature.TimeseriesColumn; x != nil { - c := n.Child("timeseries_column") - requiredMlTimeseriesColumn(w, &c, x) - } else if walk.Forced(v.Feature.ForceSendFields, "TimeseriesColumn") || n.IsRef("timeseries_column") { - c := n.Child("timeseries_column") - requiredMlTimeseriesColumn(w, &c, nil) - } -} - -func requiredResourcesGenieSpace(w *walker, n *walk.Node, v *resources.GenieSpace) { - if v == nil { - return - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesPermission(w, &e, &v.Permissions[i]) - } - } -} - -func requiredResourcesInstancePool(w *walker, n *walk.Node, v *resources.InstancePool) { - if v == nil { - w.missing(n, "instance_pool_name") - w.missing(n, "node_type_id") - return - } - if !(v.CreateInstancePool.InstancePoolName != "" || walk.Forced(v.CreateInstancePool.ForceSendFields, "InstancePoolName")) { - w.missing(n, "instance_pool_name") - } - if !(v.CreateInstancePool.NodeTypeId != "" || walk.Forced(v.CreateInstancePool.ForceSendFields, "NodeTypeId")) { - w.missing(n, "node_type_id") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesInstancePoolPermission(w, &e, &v.Permissions[i]) - } - } -} - -func requiredResourcesJobRun(w *walker, n *walk.Node, v *resources.JobRun) { - if v == nil { - w.missing(n, "job_id") - return - } - if !(v.RunNow.JobId != 0 || walk.Forced(v.RunNow.ForceSendFields, "JobId") || n.IsRef("job_id")) { - w.missing(n, "job_id") - } - if x := v.Lifecycle; x != nil { - c := n.Child("lifecycle") - requiredResourcesJobRunLifecycle(w, &c, x) - } else if n.IsRef("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesJobRunLifecycle(w, &c, nil) - } - if x := v.RunNow.Queue; x != nil { - c := n.Child("queue") - requiredJobsQueueSettings(w, &c, x) - } else if walk.Forced(v.RunNow.ForceSendFields, "Queue") || n.IsRef("queue") { - c := n.Child("queue") - requiredJobsQueueSettings(w, &c, nil) - } -} - -func requiredResourcesJob(w *walker, n *walk.Node, v *resources.Job) { - if v == nil { - return - } - if x := v.JobSettings.Continuous; x != nil { - c := n.Child("continuous") - requiredJobsContinuous(w, &c, x) - } else if walk.Forced(v.JobSettings.ForceSendFields, "Continuous") || n.IsRef("continuous") { - c := n.Child("continuous") - requiredJobsContinuous(w, &c, nil) - } - if x := v.JobSettings.Deployment; x != nil { - c := n.Child("deployment") - requiredJobsJobDeployment(w, &c, x) - } else if walk.Forced(v.JobSettings.ForceSendFields, "Deployment") || n.IsRef("deployment") { - c := n.Child("deployment") - requiredJobsJobDeployment(w, &c, nil) - } - if len(v.JobSettings.EnvironmentVariables) > 0 { - c := n.Child("environment_variables") - for i := range v.JobSettings.EnvironmentVariables { - e := c.Elem(i) - requiredJobsJobEnvironmentVariables(w, &e, &v.JobSettings.EnvironmentVariables[i]) - } - } - if len(v.JobSettings.Environments) > 0 { - c := n.Child("environments") - for i := range v.JobSettings.Environments { - e := c.Elem(i) - requiredJobsJobEnvironment(w, &e, &v.JobSettings.Environments[i]) - } - } - if x := v.JobSettings.GitSource; x != nil { - c := n.Child("git_source") - requiredJobsGitSource(w, &c, x) - } else if walk.Forced(v.JobSettings.ForceSendFields, "GitSource") || n.IsRef("git_source") { - c := n.Child("git_source") - requiredJobsGitSource(w, &c, nil) - } - if x := v.JobSettings.Health; x != nil { - c := n.Child("health") - requiredJobsJobsHealthRules(w, &c, x) - } else if walk.Forced(v.JobSettings.ForceSendFields, "Health") || n.IsRef("health") { - c := n.Child("health") - requiredJobsJobsHealthRules(w, &c, nil) - } - if len(v.JobSettings.JobClusters) > 0 { - c := n.Child("job_clusters") - for i := range v.JobSettings.JobClusters { - e := c.Elem(i) - requiredJobsJobCluster(w, &e, &v.JobSettings.JobClusters[i]) - } - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if len(v.JobSettings.Parameters) > 0 { - c := n.Child("parameters") - for i := range v.JobSettings.Parameters { - e := c.Elem(i) - requiredJobsJobParameterDefinition(w, &e, &v.JobSettings.Parameters[i]) - } - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesJobPermission(w, &e, &v.Permissions[i]) - } - } - if x := v.JobSettings.Queue; x != nil { - c := n.Child("queue") - requiredJobsQueueSettings(w, &c, x) - } else if walk.Forced(v.JobSettings.ForceSendFields, "Queue") || n.IsRef("queue") { - c := n.Child("queue") - requiredJobsQueueSettings(w, &c, nil) - } - if x := v.JobSettings.Schedule; x != nil { - c := n.Child("schedule") - requiredJobsCronSchedule(w, &c, x) - } else if walk.Forced(v.JobSettings.ForceSendFields, "Schedule") || n.IsRef("schedule") { - c := n.Child("schedule") - requiredJobsCronSchedule(w, &c, nil) - } - if len(v.JobSettings.Tasks) > 0 { - c := n.Child("tasks") - for i := range v.JobSettings.Tasks { - e := c.Elem(i) - requiredJobsTask(w, &e, &v.JobSettings.Tasks[i]) - } - } - if x := v.JobSettings.Trigger; x != nil { - c := n.Child("trigger") - requiredJobsTriggerSettings(w, &c, x) - } else if walk.Forced(v.JobSettings.ForceSendFields, "Trigger") || n.IsRef("trigger") { - c := n.Child("trigger") - requiredJobsTriggerSettings(w, &c, nil) - } - if len(v.JobSettings.Triggers) > 0 { - c := n.Child("triggers") - for i := range v.JobSettings.Triggers { - e := c.Elem(i) - requiredJobsTriggerConfiguration(w, &e, &v.JobSettings.Triggers[i]) - } - } - if x := v.JobSettings.WebhookNotifications; x != nil { - c := n.Child("webhook_notifications") - requiredJobsWebhookNotifications(w, &c, x) - } else if walk.Forced(v.JobSettings.ForceSendFields, "WebhookNotifications") || n.IsRef("webhook_notifications") { - c := n.Child("webhook_notifications") - requiredJobsWebhookNotifications(w, &c, nil) - } -} - -func requiredResourcesMcpService(w *walker, n *walk.Node, v *resources.McpService) { - if v == nil { - w.missing(n, "parent") - w.missing(n, "mcp_service_id") - return - } - if !(v.McpServiceConfig.Parent != "" || walk.Forced(v.McpServiceConfig.ForceSendFields, "Parent")) { - w.missing(n, "parent") - } - if !(v.McpServiceConfig.McpServiceId != "" || walk.Forced(v.McpServiceConfig.ForceSendFields, "McpServiceId")) { - w.missing(n, "mcp_service_id") - } - if x := v.McpServiceConfig.Config; x != nil { - c := n.Child("config") - requiredCatalogMcpServiceConfig(w, &c, x) - } else if walk.Forced(v.McpServiceConfig.ForceSendFields, "Config") || n.IsRef("config") { - c := n.Child("config") - requiredCatalogMcpServiceConfig(w, &c, nil) - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } -} - -func requiredResourcesModelProviderService(w *walker, n *walk.Node, v *resources.ModelProviderService) { - if v == nil { - w.missing(n, "parent") - w.missing(n, "model_provider_service_id") - return - } - if !(v.ModelProviderServiceConfig.Parent != "" || walk.Forced(v.ModelProviderServiceConfig.ForceSendFields, "Parent")) { - w.missing(n, "parent") - } - if !(v.ModelProviderServiceConfig.ModelProviderServiceId != "" || walk.Forced(v.ModelProviderServiceConfig.ForceSendFields, "ModelProviderServiceId")) { - w.missing(n, "model_provider_service_id") - } - if x := v.ModelProviderServiceConfig.Config; x != nil { - c := n.Child("config") - requiredCatalogModelProviderServiceConfig(w, &c, x) - } else if walk.Forced(v.ModelProviderServiceConfig.ForceSendFields, "Config") || n.IsRef("config") { - c := n.Child("config") - requiredCatalogModelProviderServiceConfig(w, &c, nil) - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } -} - -func requiredResourcesModelService(w *walker, n *walk.Node, v *resources.ModelService) { - if v == nil { - w.missing(n, "parent") - w.missing(n, "model_service_id") - return - } - if !(v.ModelServiceConfig.Parent != "" || walk.Forced(v.ModelServiceConfig.ForceSendFields, "Parent")) { - w.missing(n, "parent") - } - if !(v.ModelServiceConfig.ModelServiceId != "" || walk.Forced(v.ModelServiceConfig.ForceSendFields, "ModelServiceId")) { - w.missing(n, "model_service_id") - } - if x := v.ModelServiceConfig.Config; x != nil { - c := n.Child("config") - requiredCatalogModelServiceConfig(w, &c, x) - } else if walk.Forced(v.ModelServiceConfig.ForceSendFields, "Config") || n.IsRef("config") { - c := n.Child("config") - requiredCatalogModelServiceConfig(w, &c, nil) - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } -} - -func requiredResourcesModelServingEndpoint(w *walker, n *walk.Node, v *resources.ModelServingEndpoint) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.CreateServingEndpoint.Name != "" || walk.Forced(v.CreateServingEndpoint.ForceSendFields, "Name")) { - w.missing(n, "name") - } - if x := v.CreateServingEndpoint.AiGateway; x != nil { - c := n.Child("ai_gateway") - requiredServingAiGatewayConfig(w, &c, x) - } else if walk.Forced(v.CreateServingEndpoint.ForceSendFields, "AiGateway") || n.IsRef("ai_gateway") { - c := n.Child("ai_gateway") - requiredServingAiGatewayConfig(w, &c, nil) - } - if x := v.CreateServingEndpoint.Config; x != nil { - c := n.Child("config") - requiredServingEndpointCoreConfigInput(w, &c, x) - } else if walk.Forced(v.CreateServingEndpoint.ForceSendFields, "Config") || n.IsRef("config") { - c := n.Child("config") - requiredServingEndpointCoreConfigInput(w, &c, nil) - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesModelServingEndpointPermission(w, &e, &v.Permissions[i]) - } - } - if len(v.CreateServingEndpoint.RateLimits) > 0 { - c := n.Child("rate_limits") - for i := range v.CreateServingEndpoint.RateLimits { - e := c.Elem(i) - requiredServingRateLimit(w, &e, &v.CreateServingEndpoint.RateLimits[i]) - } - } - if len(v.CreateServingEndpoint.Tags) > 0 { - c := n.Child("tags") - for i := range v.CreateServingEndpoint.Tags { - e := c.Elem(i) - requiredServingEndpointTag(w, &e, &v.CreateServingEndpoint.Tags[i]) - } - } -} - -func requiredResourcesMlflowModel(w *walker, n *walk.Node, v *resources.MlflowModel) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.CreateModelRequest.Name != "" || walk.Forced(v.CreateModelRequest.ForceSendFields, "Name")) { - w.missing(n, "name") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesMlflowModelPermission(w, &e, &v.Permissions[i]) - } - } -} - -func requiredResourcesPipeline(w *walker, n *walk.Node, v *resources.Pipeline) { - if v == nil { - return - } - if len(v.CreatePipeline.Clusters) > 0 { - c := n.Child("clusters") - for i := range v.CreatePipeline.Clusters { - e := c.Elem(i) - requiredPipelinesPipelineCluster(w, &e, &v.CreatePipeline.Clusters[i]) - } - } - if x := v.CreatePipeline.Deployment; x != nil { - c := n.Child("deployment") - requiredPipelinesPipelineDeployment(w, &c, x) - } else if walk.Forced(v.CreatePipeline.ForceSendFields, "Deployment") || n.IsRef("deployment") { - c := n.Child("deployment") - requiredPipelinesPipelineDeployment(w, &c, nil) - } - if x := v.CreatePipeline.GatewayDefinition; x != nil { - c := n.Child("gateway_definition") - requiredPipelinesIngestionGatewayPipelineDefinition(w, &c, x) - } else if walk.Forced(v.CreatePipeline.ForceSendFields, "GatewayDefinition") || n.IsRef("gateway_definition") { - c := n.Child("gateway_definition") - requiredPipelinesIngestionGatewayPipelineDefinition(w, &c, nil) - } - if x := v.CreatePipeline.IngestionDefinition; x != nil { - c := n.Child("ingestion_definition") - requiredPipelinesIngestionPipelineDefinition(w, &c, x) - } else if walk.Forced(v.CreatePipeline.ForceSendFields, "IngestionDefinition") || n.IsRef("ingestion_definition") { - c := n.Child("ingestion_definition") - requiredPipelinesIngestionPipelineDefinition(w, &c, nil) - } - if len(v.CreatePipeline.Libraries) > 0 { - c := n.Child("libraries") - for i := range v.CreatePipeline.Libraries { - e := c.Elem(i) - requiredPipelinesPipelineLibrary(w, &e, &v.CreatePipeline.Libraries[i]) - } - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesPipelinePermission(w, &e, &v.Permissions[i]) - } - } - if x := v.CreatePipeline.RestartWindow; x != nil { - c := n.Child("restart_window") - requiredPipelinesRestartWindow(w, &c, x) - } else if walk.Forced(v.CreatePipeline.ForceSendFields, "RestartWindow") || n.IsRef("restart_window") { - c := n.Child("restart_window") - requiredPipelinesRestartWindow(w, &c, nil) - } -} - -func requiredResourcesPostgresBranch(w *walker, n *walk.Node, v *resources.PostgresBranch) { - if v == nil { - w.missing(n, "branch_id") - w.missing(n, "parent") - return - } - if !(v.PostgresBranchConfig.BranchId != "" || walk.Forced(v.PostgresBranchConfig.ForceSendFields, "BranchId")) { - w.missing(n, "branch_id") - } - if !(v.PostgresBranchConfig.Parent != "" || walk.Forced(v.PostgresBranchConfig.ForceSendFields, "Parent")) { - w.missing(n, "parent") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } -} - -func requiredResourcesPostgresCatalog(w *walker, n *walk.Node, v *resources.PostgresCatalog) { - if v == nil { - w.missing(n, "postgres_database") - w.missing(n, "catalog_id") - return - } - if !(v.PostgresCatalogConfig.CatalogCatalogSpec.PostgresDatabase != "" || walk.Forced(v.PostgresCatalogConfig.CatalogCatalogSpec.ForceSendFields, "PostgresDatabase")) { - w.missing(n, "postgres_database") - } - if !(v.PostgresCatalogConfig.CatalogId != "") { - w.missing(n, "catalog_id") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } -} - -func requiredResourcesPostgresDatabase(w *walker, n *walk.Node, v *resources.PostgresDatabase) { - if v == nil { - w.missing(n, "role") - w.missing(n, "database_id") - w.missing(n, "parent") - return - } - if !(v.PostgresDatabaseConfig.DatabaseDatabaseSpec.Role != "" || walk.Forced(v.PostgresDatabaseConfig.DatabaseDatabaseSpec.ForceSendFields, "Role")) { - w.missing(n, "role") - } - if !(v.PostgresDatabaseConfig.DatabaseId != "") { - w.missing(n, "database_id") - } - if !(v.PostgresDatabaseConfig.Parent != "") { - w.missing(n, "parent") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } -} - -func requiredResourcesPostgresEndpoint(w *walker, n *walk.Node, v *resources.PostgresEndpoint) { - if v == nil { - w.missing(n, "endpoint_type") - w.missing(n, "endpoint_id") - w.missing(n, "parent") - return - } - if !(v.PostgresEndpointConfig.EndpointSpec.EndpointType != "" || walk.Forced(v.PostgresEndpointConfig.EndpointSpec.ForceSendFields, "EndpointType")) { - w.missing(n, "endpoint_type") - } - if !(v.PostgresEndpointConfig.EndpointId != "") { - w.missing(n, "endpoint_id") - } - if !(v.PostgresEndpointConfig.Parent != "") { - w.missing(n, "parent") - } - if x := v.PostgresEndpointConfig.EndpointSpec.Group; x != nil { - c := n.Child("group") - requiredPostgresEndpointGroupSpec(w, &c, x) - } else if walk.Forced(v.PostgresEndpointConfig.EndpointSpec.ForceSendFields, "Group") || n.IsRef("group") { - c := n.Child("group") - requiredPostgresEndpointGroupSpec(w, &c, nil) - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } -} - -func requiredResourcesPostgresProject(w *walker, n *walk.Node, v *resources.PostgresProject) { - if v == nil { - w.missing(n, "project_id") - return - } - if !(v.PostgresProjectConfig.ProjectId != "" || walk.Forced(v.PostgresProjectConfig.ForceSendFields, "ProjectId")) { - w.missing(n, "project_id") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesPermission(w, &e, &v.Permissions[i]) - } - } -} - -func requiredResourcesPostgresRole(w *walker, n *walk.Node, v *resources.PostgresRole) { - if v == nil { - w.missing(n, "role_id") - w.missing(n, "parent") - return - } - if !(v.PostgresRoleConfig.RoleId != "") { - w.missing(n, "role_id") - } - if !(v.PostgresRoleConfig.Parent != "") { - w.missing(n, "parent") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } -} - -func requiredResourcesPostgresSnapshotSchedule(w *walker, n *walk.Node, v *resources.PostgresSnapshotSchedule) { - if v == nil { - w.missing(n, "branch") - return - } - if !(v.PostgresSnapshotScheduleConfig.Branch != "" || walk.Forced(v.PostgresSnapshotScheduleConfig.ForceSendFields, "Branch")) { - w.missing(n, "branch") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if len(v.PostgresSnapshotScheduleConfig.Schedule) > 0 { - c := n.Child("schedule") - for i := range v.PostgresSnapshotScheduleConfig.Schedule { - e := c.Elem(i) - requiredPostgresScheduleCadence(w, &e, &v.PostgresSnapshotScheduleConfig.Schedule[i]) - } - } -} - -func requiredResourcesPostgresSyncedTable(w *walker, n *walk.Node, v *resources.PostgresSyncedTable) { - if v == nil { - w.missing(n, "synced_table_id") - return - } - if !(v.PostgresSyncedTableConfig.SyncedTableId != "") { - w.missing(n, "synced_table_id") - } - if len(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExtraColumns) > 0 { - c := n.Child("extra_columns") - for i := range v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExtraColumns { - e := c.Elem(i) - requiredPostgresSyncedTableSyncedTableSpecExtraColumn(w, &e, &v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExtraColumns[i]) - } - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if len(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides) > 0 { - c := n.Child("type_overrides") - for i := range v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides { - e := c.Elem(i) - requiredPostgresSyncedTableSyncedTableSpecTypeOverride(w, &e, &v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides[i]) - } - } -} - -func requiredResourcesQualityMonitor(w *walker, n *walk.Node, v *resources.QualityMonitor) { - if v == nil { - w.missing(n, "assets_dir") - w.missing(n, "output_schema_name") - w.missing(n, "table_name") - return - } - if !(v.CreateMonitor.AssetsDir != "" || walk.Forced(v.CreateMonitor.ForceSendFields, "AssetsDir")) { - w.missing(n, "assets_dir") - } - if !(v.CreateMonitor.OutputSchemaName != "" || walk.Forced(v.CreateMonitor.ForceSendFields, "OutputSchemaName")) { - w.missing(n, "output_schema_name") - } - if !(v.TableName != "") { - w.missing(n, "table_name") - } - if len(v.CreateMonitor.CustomMetrics) > 0 { - c := n.Child("custom_metrics") - for i := range v.CreateMonitor.CustomMetrics { - e := c.Elem(i) - requiredCatalogMonitorMetric(w, &e, &v.CreateMonitor.CustomMetrics[i]) - } - } - if x := v.CreateMonitor.InferenceLog; x != nil { - c := n.Child("inference_log") - requiredCatalogMonitorInferenceLog(w, &c, x) - } else if walk.Forced(v.CreateMonitor.ForceSendFields, "InferenceLog") || n.IsRef("inference_log") { - c := n.Child("inference_log") - requiredCatalogMonitorInferenceLog(w, &c, nil) - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if x := v.CreateMonitor.Schedule; x != nil { - c := n.Child("schedule") - requiredCatalogMonitorCronSchedule(w, &c, x) - } else if walk.Forced(v.CreateMonitor.ForceSendFields, "Schedule") || n.IsRef("schedule") { - c := n.Child("schedule") - requiredCatalogMonitorCronSchedule(w, &c, nil) - } - if x := v.CreateMonitor.TimeSeries; x != nil { - c := n.Child("time_series") - requiredCatalogMonitorTimeSeries(w, &c, x) - } else if walk.Forced(v.CreateMonitor.ForceSendFields, "TimeSeries") || n.IsRef("time_series") { - c := n.Child("time_series") - requiredCatalogMonitorTimeSeries(w, &c, nil) - } -} - -func requiredResourcesRegisteredModel(w *walker, n *walk.Node, v *resources.RegisteredModel) { - if v == nil { - return - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } -} - -func requiredResourcesSchema(w *walker, n *walk.Node, v *resources.Schema) { - if v == nil { - w.missing(n, "catalog_name") - w.missing(n, "name") - return - } - if !(v.CreateSchema.CatalogName != "" || walk.Forced(v.CreateSchema.ForceSendFields, "CatalogName")) { - w.missing(n, "catalog_name") - } - if !(v.CreateSchema.Name != "" || walk.Forced(v.CreateSchema.ForceSendFields, "Name")) { - w.missing(n, "name") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } -} - -func requiredResourcesSecretScope(w *walker, n *walk.Node, v *resources.SecretScope) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.Name != "") { - w.missing(n, "name") - } - if x := v.KeyvaultMetadata; x != nil { - c := n.Child("keyvault_metadata") - requiredWorkspaceAzureKeyVaultSecretScopeMetadata(w, &c, x) - } else if n.IsRef("keyvault_metadata") { - c := n.Child("keyvault_metadata") - requiredWorkspaceAzureKeyVaultSecretScopeMetadata(w, &c, nil) - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesSecretScopePermission(w, &e, &v.Permissions[i]) - } - } -} - -func requiredResourcesSecret(w *walker, n *walk.Node, v *resources.Secret) { - if v == nil { - w.missing(n, "catalog_name") - w.missing(n, "name") - w.missing(n, "schema_name") - w.missing(n, "value") - return - } - if !(v.Secret.CatalogName != "" || walk.Forced(v.Secret.ForceSendFields, "CatalogName")) { - w.missing(n, "catalog_name") - } - if !(v.Secret.Name != "" || walk.Forced(v.Secret.ForceSendFields, "Name")) { - w.missing(n, "name") - } - if !(v.Secret.SchemaName != "" || walk.Forced(v.Secret.ForceSendFields, "SchemaName")) { - w.missing(n, "schema_name") - } - if !(v.Secret.Value != "" || walk.Forced(v.Secret.ForceSendFields, "Value")) { - w.missing(n, "value") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } -} - -func requiredResourcesSqlWarehouse(w *walker, n *walk.Node, v *resources.SqlWarehouse) { - if v == nil { - return - } - if x := v.Lifecycle; x != nil { - c := n.Child("lifecycle") - requiredResourcesLifecycleWithStarted(w, &c, x) - } else if n.IsRef("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycleWithStarted(w, &c, nil) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesSqlWarehousePermission(w, &e, &v.Permissions[i]) - } - } -} - -func requiredResourcesSyncedDatabaseTable(w *walker, n *walk.Node, v *resources.SyncedDatabaseTable) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.SyncedDatabaseTable.Name != "" || walk.Forced(v.SyncedDatabaseTable.ForceSendFields, "Name")) { - w.missing(n, "name") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if x := v.SyncedDatabaseTable.Spec; x != nil { - c := n.Child("spec") - requiredDatabaseSyncedTableSpec(w, &c, x) - } else if walk.Forced(v.SyncedDatabaseTable.ForceSendFields, "Spec") || n.IsRef("spec") { - c := n.Child("spec") - requiredDatabaseSyncedTableSpec(w, &c, nil) - } -} - -func requiredResourcesVectorSearchEndpoint(w *walker, n *walk.Node, v *resources.VectorSearchEndpoint) { - if v == nil { - w.missing(n, "endpoint_type") - w.missing(n, "name") - return - } - if !(v.CreateEndpoint.EndpointType != "" || walk.Forced(v.CreateEndpoint.ForceSendFields, "EndpointType")) { - w.missing(n, "endpoint_type") - } - if !(v.CreateEndpoint.Name != "" || walk.Forced(v.CreateEndpoint.ForceSendFields, "Name")) { - w.missing(n, "name") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } - if len(v.Permissions) > 0 { - c := n.Child("permissions") - for i := range v.Permissions { - e := c.Elem(i) - requiredResourcesVectorSearchEndpointPermission(w, &e, &v.Permissions[i]) - } - } -} - -func requiredResourcesVectorSearchIndex(w *walker, n *walk.Node, v *resources.VectorSearchIndex) { - if v == nil { - w.missing(n, "endpoint_name") - w.missing(n, "index_type") - w.missing(n, "name") - w.missing(n, "primary_key") - return - } - if !(v.CreateVectorIndexRequest.EndpointName != "") { - w.missing(n, "endpoint_name") - } - if !(v.CreateVectorIndexRequest.IndexType != "") { - w.missing(n, "index_type") - } - if !(v.CreateVectorIndexRequest.Name != "") { - w.missing(n, "name") - } - if !(v.CreateVectorIndexRequest.PrimaryKey != "") { - w.missing(n, "primary_key") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } -} - -func requiredResourcesVolume(w *walker, n *walk.Node, v *resources.Volume) { - if v == nil { - w.missing(n, "catalog_name") - w.missing(n, "name") - w.missing(n, "schema_name") - w.missing(n, "volume_type") - return - } - if !(v.CreateVolumeRequestContent.CatalogName != "" || walk.Forced(v.CreateVolumeRequestContent.ForceSendFields, "CatalogName")) { - w.missing(n, "catalog_name") - } - if !(v.CreateVolumeRequestContent.Name != "" || walk.Forced(v.CreateVolumeRequestContent.ForceSendFields, "Name")) { - w.missing(n, "name") - } - if !(v.CreateVolumeRequestContent.SchemaName != "" || walk.Forced(v.CreateVolumeRequestContent.ForceSendFields, "SchemaName")) { - w.missing(n, "schema_name") - } - if !(v.CreateVolumeRequestContent.VolumeType != "" || walk.Forced(v.CreateVolumeRequestContent.ForceSendFields, "VolumeType")) { - w.missing(n, "volume_type") - } - if x := &v.BaseResource.Lifecycle; !walk.IsZeroStruct(x) || n.HasRefs("lifecycle") { - c := n.Child("lifecycle") - requiredResourcesLifecycle(w, &c, x) - } -} - -func requiredSqlAlertV2Evaluation(w *walker, n *walk.Node, v *sql.AlertV2Evaluation) { - if v == nil { - w.missing(n, "comparison_operator") - w.missing(n, "source") - return - } - if !(v.ComparisonOperator != "" || walk.Forced(v.ForceSendFields, "ComparisonOperator")) { - w.missing(n, "comparison_operator") - } - if !(!walk.IsZeroStruct(&v.Source) || walk.Forced(v.ForceSendFields, "Source") || n.HasRefs("source")) { - w.missing(n, "source") - } - if x := &v.Source; !walk.IsZeroStruct(x) || walk.Forced(v.ForceSendFields, "Source") || n.HasRefs("source") { - c := n.Child("source") - requiredSqlAlertV2OperandColumn(w, &c, x) - } - if x := v.Threshold; x != nil { - c := n.Child("threshold") - requiredSqlAlertV2Operand(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Threshold") || n.IsRef("threshold") { - c := n.Child("threshold") - requiredSqlAlertV2Operand(w, &c, nil) - } -} - -func requiredResourcesLifecycle(w *walker, n *walk.Node, v *resources.Lifecycle) { - if v == nil { - return - } - if len(v.DependsOn) > 0 { - c := n.Child("depends_on") - for i := range v.DependsOn { - e := c.Elem(i) - requiredResourcesDependsOn(w, &e, &v.DependsOn[i]) - } - } -} - -func requiredSqlAlertStatementParameter(w *walker, n *walk.Node, v *sql.AlertStatementParameter) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.Name != "" || walk.Forced(v.ForceSendFields, "Name")) { - w.missing(n, "name") - } -} - -func requiredSqlCronSchedule(w *walker, n *walk.Node, v *sql.CronSchedule) { - if v == nil { - w.missing(n, "quartz_cron_schedule") - w.missing(n, "timezone_id") - return - } - if !(v.QuartzCronSchedule != "") { - w.missing(n, "quartz_cron_schedule") - } - if !(v.TimezoneId != "") { - w.missing(n, "timezone_id") - } -} - -func requiredAppsAppDeployment(w *walker, n *walk.Node, v *apps.AppDeployment) { - if v == nil { - return - } - if x := v.GitSource; x != nil { - c := n.Child("git_source") - requiredAppsGitSource(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "GitSource") || n.IsRef("git_source") { - c := n.Child("git_source") - requiredAppsGitSource(w, &c, nil) - } -} - -func requiredResourcesAppConfig(w *walker, n *walk.Node, v *resources.AppConfig) { - if v == nil { - return - } - if len(v.Env) > 0 { - c := n.Child("env") - for i := range v.Env { - e := c.Elem(i) - requiredResourcesAppEnvVar(w, &e, &v.Env[i]) - } - } -} - -func requiredAppsGitSource(w *walker, n *walk.Node, v *apps.GitSource) { - if v == nil { - return - } - if x := v.GitRepository; x != nil { - c := n.Child("git_repository") - requiredAppsGitRepository(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "GitRepository") || n.IsRef("git_repository") { - c := n.Child("git_repository") - requiredAppsGitRepository(w, &c, nil) - } -} - -func requiredAppsGitRepository(w *walker, n *walk.Node, v *apps.GitRepository) { - if v == nil { - w.missing(n, "provider") - w.missing(n, "url") - return - } - if !(v.Provider != "" || walk.Forced(v.ForceSendFields, "Provider")) { - w.missing(n, "provider") - } - if !(v.Url != "" || walk.Forced(v.ForceSendFields, "Url")) { - w.missing(n, "url") - } -} - -func requiredResourcesLifecycleWithStarted(w *walker, n *walk.Node, v *resources.LifecycleWithStarted) { - if v == nil { - return - } - if len(v.Lifecycle.DependsOn) > 0 { - c := n.Child("depends_on") - for i := range v.Lifecycle.DependsOn { - e := c.Elem(i) - requiredResourcesDependsOn(w, &e, &v.Lifecycle.DependsOn[i]) - } - } -} - -func requiredResourcesAppPermission(w *walker, n *walk.Node, v *resources.AppPermission) { - if v == nil { - w.missing(n, "level") - return - } - if !(v.Level != "") { - w.missing(n, "level") - } -} - -func requiredAppsAppResource(w *walker, n *walk.Node, v *apps.AppResource) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.Name != "" || walk.Forced(v.ForceSendFields, "Name")) { - w.missing(n, "name") - } - if x := v.Database; x != nil { - c := n.Child("database") - requiredAppsAppResourceDatabase(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Database") || n.IsRef("database") { - c := n.Child("database") - requiredAppsAppResourceDatabase(w, &c, nil) - } - if x := v.Experiment; x != nil { - c := n.Child("experiment") - requiredAppsAppResourceExperiment(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Experiment") || n.IsRef("experiment") { - c := n.Child("experiment") - requiredAppsAppResourceExperiment(w, &c, nil) - } - if x := v.GenieSpace; x != nil { - c := n.Child("genie_space") - requiredAppsAppResourceGenieSpace(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "GenieSpace") || n.IsRef("genie_space") { - c := n.Child("genie_space") - requiredAppsAppResourceGenieSpace(w, &c, nil) - } - if x := v.Job; x != nil { - c := n.Child("job") - requiredAppsAppResourceJob(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Job") || n.IsRef("job") { - c := n.Child("job") - requiredAppsAppResourceJob(w, &c, nil) - } - if x := v.Secret; x != nil { - c := n.Child("secret") - requiredAppsAppResourceSecret(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Secret") || n.IsRef("secret") { - c := n.Child("secret") - requiredAppsAppResourceSecret(w, &c, nil) - } - if x := v.ServingEndpoint; x != nil { - c := n.Child("serving_endpoint") - requiredAppsAppResourceServingEndpoint(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ServingEndpoint") || n.IsRef("serving_endpoint") { - c := n.Child("serving_endpoint") - requiredAppsAppResourceServingEndpoint(w, &c, nil) - } - if x := v.SqlWarehouse; x != nil { - c := n.Child("sql_warehouse") - requiredAppsAppResourceSqlWarehouse(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "SqlWarehouse") || n.IsRef("sql_warehouse") { - c := n.Child("sql_warehouse") - requiredAppsAppResourceSqlWarehouse(w, &c, nil) - } - if x := v.UcSecurable; x != nil { - c := n.Child("uc_securable") - requiredAppsAppResourceUcSecurable(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "UcSecurable") || n.IsRef("uc_securable") { - c := n.Child("uc_securable") - requiredAppsAppResourceUcSecurable(w, &c, nil) - } -} - -func requiredAppsTelemetryExportDestination(w *walker, n *walk.Node, v *apps.TelemetryExportDestination) { - if v == nil { - return - } - if x := v.UnityCatalog; x != nil { - c := n.Child("unity_catalog") - requiredAppsUnityCatalog(w, &c, x) - } else if n.IsRef("unity_catalog") { - c := n.Child("unity_catalog") - requiredAppsUnityCatalog(w, &c, nil) - } -} - -func requiredCatalogEncryptionSettings(w *walker, n *walk.Node, v *catalog.EncryptionSettings) { - if v == nil { - return - } - if x := v.AzureEncryptionSettings; x != nil { - c := n.Child("azure_encryption_settings") - requiredCatalogAzureEncryptionSettings(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "AzureEncryptionSettings") || n.IsRef("azure_encryption_settings") { - c := n.Child("azure_encryption_settings") - requiredCatalogAzureEncryptionSettings(w, &c, nil) - } -} - -func requiredComputeLibrary(w *walker, n *walk.Node, v *compute.Library) { - if v == nil { - return - } - if x := v.Cran; x != nil { - c := n.Child("cran") - requiredComputeRCranLibrary(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Cran") || n.IsRef("cran") { - c := n.Child("cran") - requiredComputeRCranLibrary(w, &c, nil) - } - if x := v.Maven; x != nil { - c := n.Child("maven") - requiredComputeMavenLibrary(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Maven") || n.IsRef("maven") { - c := n.Child("maven") - requiredComputeMavenLibrary(w, &c, nil) - } - if x := v.Pypi; x != nil { - c := n.Child("pypi") - requiredComputePythonPyPiLibrary(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Pypi") || n.IsRef("pypi") { - c := n.Child("pypi") - requiredComputePythonPyPiLibrary(w, &c, nil) - } -} - -func requiredResourcesClusterPolicyPermission(w *walker, n *walk.Node, v *resources.ClusterPolicyPermission) { - if v == nil { - w.missing(n, "level") - return - } - if !(v.Level != "") { - w.missing(n, "level") - } -} - -func requiredComputeClusterLogConf(w *walker, n *walk.Node, v *compute.ClusterLogConf) { - if v == nil { - return - } - if x := v.Dbfs; x != nil { - c := n.Child("dbfs") - requiredComputeDbfsStorageInfo(w, &c, x) - } else if n.IsRef("dbfs") { - c := n.Child("dbfs") - requiredComputeDbfsStorageInfo(w, &c, nil) - } - if x := v.S3; x != nil { - c := n.Child("s3") - requiredComputeS3StorageInfo(w, &c, x) - } else if n.IsRef("s3") { - c := n.Child("s3") - requiredComputeS3StorageInfo(w, &c, nil) - } - if x := v.Volumes; x != nil { - c := n.Child("volumes") - requiredComputeVolumesStorageInfo(w, &c, x) - } else if n.IsRef("volumes") { - c := n.Child("volumes") - requiredComputeVolumesStorageInfo(w, &c, nil) - } -} - -func requiredComputeInitScriptInfo(w *walker, n *walk.Node, v *compute.InitScriptInfo) { - if v == nil { - return - } - if x := v.Abfss; x != nil { - c := n.Child("abfss") - requiredComputeAdlsgen2Info(w, &c, x) - } else if n.IsRef("abfss") { - c := n.Child("abfss") - requiredComputeAdlsgen2Info(w, &c, nil) - } - if x := v.Dbfs; x != nil { - c := n.Child("dbfs") - requiredComputeDbfsStorageInfo(w, &c, x) - } else if n.IsRef("dbfs") { - c := n.Child("dbfs") - requiredComputeDbfsStorageInfo(w, &c, nil) - } - if x := v.File; x != nil { - c := n.Child("file") - requiredComputeLocalFileInfo(w, &c, x) - } else if n.IsRef("file") { - c := n.Child("file") - requiredComputeLocalFileInfo(w, &c, nil) - } - if x := v.Gcs; x != nil { - c := n.Child("gcs") - requiredComputeGcsStorageInfo(w, &c, x) - } else if n.IsRef("gcs") { - c := n.Child("gcs") - requiredComputeGcsStorageInfo(w, &c, nil) - } - if x := v.S3; x != nil { - c := n.Child("s3") - requiredComputeS3StorageInfo(w, &c, x) - } else if n.IsRef("s3") { - c := n.Child("s3") - requiredComputeS3StorageInfo(w, &c, nil) - } - if x := v.Volumes; x != nil { - c := n.Child("volumes") - requiredComputeVolumesStorageInfo(w, &c, x) - } else if n.IsRef("volumes") { - c := n.Child("volumes") - requiredComputeVolumesStorageInfo(w, &c, nil) - } - if x := v.Workspace; x != nil { - c := n.Child("workspace") - requiredComputeWorkspaceStorageInfo(w, &c, x) - } else if n.IsRef("workspace") { - c := n.Child("workspace") - requiredComputeWorkspaceStorageInfo(w, &c, nil) - } -} - -func requiredResourcesClusterPermission(w *walker, n *walk.Node, v *resources.ClusterPermission) { - if v == nil { - w.missing(n, "level") - return - } - if !(v.Level != "") { - w.missing(n, "level") - } -} - -func requiredComputeWorkloadType(w *walker, n *walk.Node, v *compute.WorkloadType) { - if v == nil { - w.missing(n, "clients") - return - } - if !(!walk.IsZeroStruct(&v.Clients) || n.HasRefs("clients")) { - w.missing(n, "clients") - } -} - -func requiredResourcesMlflowExperimentPermission(w *walker, n *walk.Node, v *resources.MlflowExperimentPermission) { - if v == nil { - w.missing(n, "level") - return - } - if !(v.Level != "") { - w.missing(n, "level") - } -} - -func requiredMlExperimentTraceLocation(w *walker, n *walk.Node, v *ml.ExperimentTraceLocation) { - if v == nil { - return - } - if x := v.UcTraceLocation; x != nil { - c := n.Child("uc_trace_location") - requiredMlUcTraceLocation(w, &c, x) - } else if n.IsRef("uc_trace_location") { - c := n.Child("uc_trace_location") - requiredMlUcTraceLocation(w, &c, nil) - } -} - -func requiredMlEntityColumn(w *walker, n *walk.Node, v *ml.EntityColumn) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.Name != "") { - w.missing(n, "name") - } -} - -func requiredMlFunction(w *walker, n *walk.Node, v *ml.Function) { - if v == nil { - return - } - if x := v.AggregationFunction; x != nil { - c := n.Child("aggregation_function") - requiredMlAggregationFunction(w, &c, x) - } else if n.IsRef("aggregation_function") { - c := n.Child("aggregation_function") - requiredMlAggregationFunction(w, &c, nil) - } - if x := v.ColumnSelection; x != nil { - c := n.Child("column_selection") - requiredMlColumnSelection(w, &c, x) - } else if n.IsRef("column_selection") { - c := n.Child("column_selection") - requiredMlColumnSelection(w, &c, nil) - } - if x := v.CustomUdf; x != nil { - c := n.Child("custom_udf") - requiredMlCustomUdf(w, &c, x) - } else if n.IsRef("custom_udf") { - c := n.Child("custom_udf") - requiredMlCustomUdf(w, &c, nil) - } - if len(v.ExtraParameters) > 0 { - c := n.Child("extra_parameters") - for i := range v.ExtraParameters { - e := c.Elem(i) - requiredMlFunctionExtraParameter(w, &e, &v.ExtraParameters[i]) - } - } -} - -func requiredMlDataSource(w *walker, n *walk.Node, v *ml.DataSource) { - if v == nil { - return - } - if x := v.DeltaTableSource; x != nil { - c := n.Child("delta_table_source") - requiredMlDeltaTableSource(w, &c, x) - } else if n.IsRef("delta_table_source") { - c := n.Child("delta_table_source") - requiredMlDeltaTableSource(w, &c, nil) - } - if x := v.FeatureViewSource; x != nil { - c := n.Child("feature_view_source") - requiredMlFeatureViewSource(w, &c, x) - } else if n.IsRef("feature_view_source") { - c := n.Child("feature_view_source") - requiredMlFeatureViewSource(w, &c, nil) - } - if x := v.KafkaSource; x != nil { - c := n.Child("kafka_source") - requiredMlKafkaSource(w, &c, x) - } else if n.IsRef("kafka_source") { - c := n.Child("kafka_source") - requiredMlKafkaSource(w, &c, nil) - } - if x := v.RequestSource; x != nil { - c := n.Child("request_source") - requiredMlRequestSource(w, &c, x) - } else if n.IsRef("request_source") { - c := n.Child("request_source") - requiredMlRequestSource(w, &c, nil) - } - if x := v.StreamSource; x != nil { - c := n.Child("stream_source") - requiredMlStreamSource(w, &c, x) - } else if n.IsRef("stream_source") { - c := n.Child("stream_source") - requiredMlStreamSource(w, &c, nil) - } -} - -func requiredMlTimeWindow(w *walker, n *walk.Node, v *ml.TimeWindow) { - if v == nil { - return - } - if x := v.Continuous; x != nil { - c := n.Child("continuous") - requiredMlContinuousWindow(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Continuous") || n.IsRef("continuous") { - c := n.Child("continuous") - requiredMlContinuousWindow(w, &c, nil) - } - if x := v.Sliding; x != nil { - c := n.Child("sliding") - requiredMlSlidingWindow(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Sliding") || n.IsRef("sliding") { - c := n.Child("sliding") - requiredMlSlidingWindow(w, &c, nil) - } - if x := v.Tumbling; x != nil { - c := n.Child("tumbling") - requiredMlTumblingWindow(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Tumbling") || n.IsRef("tumbling") { - c := n.Child("tumbling") - requiredMlTumblingWindow(w, &c, nil) - } -} - -func requiredMlTimeseriesColumn(w *walker, n *walk.Node, v *ml.TimeseriesColumn) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.Name != "") { - w.missing(n, "name") - } -} - -func requiredResourcesInstancePoolPermission(w *walker, n *walk.Node, v *resources.InstancePoolPermission) { - if v == nil { - w.missing(n, "level") - return - } - if !(v.Level != "") { - w.missing(n, "level") - } -} - -func requiredResourcesJobRunLifecycle(w *walker, n *walk.Node, v *resources.JobRunLifecycle) { - if v == nil { - return - } - if len(v.Lifecycle.DependsOn) > 0 { - c := n.Child("depends_on") - for i := range v.Lifecycle.DependsOn { - e := c.Elem(i) - requiredResourcesDependsOn(w, &e, &v.Lifecycle.DependsOn[i]) - } - } -} - -func requiredJobsQueueSettings(w *walker, n *walk.Node, v *jobs.QueueSettings) { - if v == nil { - w.missing(n, "enabled") - return - } - if !(v.Enabled || n.IsRef("enabled")) { - w.missing(n, "enabled") - } -} - -func requiredJobsContinuous(w *walker, n *walk.Node, v *jobs.Continuous) { - if v == nil { - return - } - if x := v.MaintenanceWindow; x != nil { - c := n.Child("maintenance_window") - requiredJobsMaintenanceWindow(w, &c, x) - } else if n.IsRef("maintenance_window") { - c := n.Child("maintenance_window") - requiredJobsMaintenanceWindow(w, &c, nil) - } -} - -func requiredJobsJobDeployment(w *walker, n *walk.Node, v *jobs.JobDeployment) { - if v == nil { - w.missing(n, "kind") - return - } - if !(v.Kind != "" || walk.Forced(v.ForceSendFields, "Kind")) { - w.missing(n, "kind") - } -} - -func requiredJobsJobEnvironmentVariables(w *walker, n *walk.Node, v *jobs.JobEnvironmentVariables) { - if v == nil { - w.missing(n, "environment_variables_key") - return - } - if !(v.EnvironmentVariablesKey != "") { - w.missing(n, "environment_variables_key") - } -} - -func requiredJobsJobEnvironment(w *walker, n *walk.Node, v *jobs.JobEnvironment) { - if v == nil { - w.missing(n, "environment_key") - return - } - if !(v.EnvironmentKey != "") { - w.missing(n, "environment_key") - } -} - -func requiredJobsGitSource(w *walker, n *walk.Node, v *jobs.GitSource) { - if v == nil { - w.missing(n, "git_provider") - w.missing(n, "git_url") - return - } - if !(v.GitProvider != "" || walk.Forced(v.ForceSendFields, "GitProvider")) { - w.missing(n, "git_provider") - } - if !(v.GitUrl != "" || walk.Forced(v.ForceSendFields, "GitUrl")) { - w.missing(n, "git_url") - } - if x := v.JobSource; x != nil { - c := n.Child("job_source") - requiredJobsJobSource(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "JobSource") || n.IsRef("job_source") { - c := n.Child("job_source") - requiredJobsJobSource(w, &c, nil) - } -} - -func requiredJobsJobsHealthRules(w *walker, n *walk.Node, v *jobs.JobsHealthRules) { - if v == nil { - return - } - if len(v.Rules) > 0 { - c := n.Child("rules") - for i := range v.Rules { - e := c.Elem(i) - requiredJobsJobsHealthRule(w, &e, &v.Rules[i]) - } - } -} - -func requiredJobsJobCluster(w *walker, n *walk.Node, v *jobs.JobCluster) { - if v == nil { - w.missing(n, "job_cluster_key") - return - } - if !(v.JobClusterKey != "" || walk.Forced(v.ForceSendFields, "JobClusterKey")) { - w.missing(n, "job_cluster_key") - } - if x := v.NewCluster; x != nil { - c := n.Child("new_cluster") - requiredComputeClusterSpec(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "NewCluster") || n.IsRef("new_cluster") { - c := n.Child("new_cluster") - requiredComputeClusterSpec(w, &c, nil) - } -} - -func requiredJobsJobParameterDefinition(w *walker, n *walk.Node, v *jobs.JobParameterDefinition) { - if v == nil { - w.missing(n, "default") - w.missing(n, "name") - return - } - if !(v.Name != "") { - w.missing(n, "name") - } -} - -func requiredResourcesJobPermission(w *walker, n *walk.Node, v *resources.JobPermission) { - if v == nil { - w.missing(n, "level") - return - } - if !(v.Level != "") { - w.missing(n, "level") - } -} - -func requiredJobsCronSchedule(w *walker, n *walk.Node, v *jobs.CronSchedule) { - if v == nil { - w.missing(n, "quartz_cron_expression") - w.missing(n, "timezone_id") - return - } - if !(v.QuartzCronExpression != "") { - w.missing(n, "quartz_cron_expression") - } - if !(v.TimezoneId != "") { - w.missing(n, "timezone_id") - } - if x := v.SqlCondition; x != nil { - c := n.Child("sql_condition") - requiredJobsSqlConditionConfiguration(w, &c, x) - } else if n.IsRef("sql_condition") { - c := n.Child("sql_condition") - requiredJobsSqlConditionConfiguration(w, &c, nil) - } -} - -func requiredJobsTask(w *walker, n *walk.Node, v *jobs.Task) { - if v == nil { - w.missing(n, "task_key") - return - } - if !(v.TaskKey != "" || walk.Forced(v.ForceSendFields, "TaskKey")) { - w.missing(n, "task_key") - } - if x := v.AiRuntimeTask; x != nil { - c := n.Child("ai_runtime_task") - requiredJobsAiRuntimeTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "AiRuntimeTask") || n.IsRef("ai_runtime_task") { - c := n.Child("ai_runtime_task") - requiredJobsAiRuntimeTask(w, &c, nil) - } - if x := v.CleanRoomsNotebookTask; x != nil { - c := n.Child("clean_rooms_notebook_task") - requiredJobsCleanRoomsNotebookTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "CleanRoomsNotebookTask") || n.IsRef("clean_rooms_notebook_task") { - c := n.Child("clean_rooms_notebook_task") - requiredJobsCleanRoomsNotebookTask(w, &c, nil) - } - if x := v.ConditionTask; x != nil { - c := n.Child("condition_task") - requiredJobsConditionTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ConditionTask") || n.IsRef("condition_task") { - c := n.Child("condition_task") - requiredJobsConditionTask(w, &c, nil) - } - if x := v.DashboardTask; x != nil { - c := n.Child("dashboard_task") - requiredJobsDashboardTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "DashboardTask") || n.IsRef("dashboard_task") { - c := n.Child("dashboard_task") - requiredJobsDashboardTask(w, &c, nil) - } - if x := v.DbtTask; x != nil { - c := n.Child("dbt_task") - requiredJobsDbtTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "DbtTask") || n.IsRef("dbt_task") { - c := n.Child("dbt_task") - requiredJobsDbtTask(w, &c, nil) - } - if len(v.DependsOn) > 0 { - c := n.Child("depends_on") - for i := range v.DependsOn { - e := c.Elem(i) - requiredJobsTaskDependency(w, &e, &v.DependsOn[i]) - } - } - if x := v.ForEachTask; x != nil { - c := n.Child("for_each_task") - requiredJobsForEachTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ForEachTask") || n.IsRef("for_each_task") { - c := n.Child("for_each_task") - requiredJobsForEachTask(w, &c, nil) - } - if x := v.GenAiComputeTask; x != nil { - c := n.Child("gen_ai_compute_task") - requiredJobsGenAiComputeTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "GenAiComputeTask") || n.IsRef("gen_ai_compute_task") { - c := n.Child("gen_ai_compute_task") - requiredJobsGenAiComputeTask(w, &c, nil) - } - if x := v.Health; x != nil { - c := n.Child("health") - requiredJobsJobsHealthRules(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Health") || n.IsRef("health") { - c := n.Child("health") - requiredJobsJobsHealthRules(w, &c, nil) - } - if len(v.Libraries) > 0 { - c := n.Child("libraries") - for i := range v.Libraries { - e := c.Elem(i) - requiredComputeLibrary(w, &e, &v.Libraries[i]) - } - } - if x := v.NewCluster; x != nil { - c := n.Child("new_cluster") - requiredComputeClusterSpec(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "NewCluster") || n.IsRef("new_cluster") { - c := n.Child("new_cluster") - requiredComputeClusterSpec(w, &c, nil) - } - if x := v.NotebookTask; x != nil { - c := n.Child("notebook_task") - requiredJobsNotebookTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "NotebookTask") || n.IsRef("notebook_task") { - c := n.Child("notebook_task") - requiredJobsNotebookTask(w, &c, nil) - } - if x := v.PipelineTask; x != nil { - c := n.Child("pipeline_task") - requiredJobsPipelineTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "PipelineTask") || n.IsRef("pipeline_task") { - c := n.Child("pipeline_task") - requiredJobsPipelineTask(w, &c, nil) - } - if x := v.PythonWheelTask; x != nil { - c := n.Child("python_wheel_task") - requiredJobsPythonWheelTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "PythonWheelTask") || n.IsRef("python_wheel_task") { - c := n.Child("python_wheel_task") - requiredJobsPythonWheelTask(w, &c, nil) - } - if x := v.RunJobTask; x != nil { - c := n.Child("run_job_task") - requiredJobsRunJobTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "RunJobTask") || n.IsRef("run_job_task") { - c := n.Child("run_job_task") - requiredJobsRunJobTask(w, &c, nil) - } - if x := v.SparkPythonTask; x != nil { - c := n.Child("spark_python_task") - requiredJobsSparkPythonTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "SparkPythonTask") || n.IsRef("spark_python_task") { - c := n.Child("spark_python_task") - requiredJobsSparkPythonTask(w, &c, nil) - } - if x := v.SqlTask; x != nil { - c := n.Child("sql_task") - requiredJobsSqlTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "SqlTask") || n.IsRef("sql_task") { - c := n.Child("sql_task") - requiredJobsSqlTask(w, &c, nil) - } - if x := v.WebhookNotifications; x != nil { - c := n.Child("webhook_notifications") - requiredJobsWebhookNotifications(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "WebhookNotifications") || n.IsRef("webhook_notifications") { - c := n.Child("webhook_notifications") - requiredJobsWebhookNotifications(w, &c, nil) - } -} - -func requiredJobsTriggerSettings(w *walker, n *walk.Node, v *jobs.TriggerSettings) { - if v == nil { - return - } - if x := v.FileArrival; x != nil { - c := n.Child("file_arrival") - requiredJobsFileArrivalTriggerConfiguration(w, &c, x) - } else if n.IsRef("file_arrival") { - c := n.Child("file_arrival") - requiredJobsFileArrivalTriggerConfiguration(w, &c, nil) - } - if x := v.Model; x != nil { - c := n.Child("model") - requiredJobsModelTriggerConfiguration(w, &c, x) - } else if n.IsRef("model") { - c := n.Child("model") - requiredJobsModelTriggerConfiguration(w, &c, nil) - } - if x := v.Periodic; x != nil { - c := n.Child("periodic") - requiredJobsPeriodicTriggerConfiguration(w, &c, x) - } else if n.IsRef("periodic") { - c := n.Child("periodic") - requiredJobsPeriodicTriggerConfiguration(w, &c, nil) - } - if x := v.SqlCondition; x != nil { - c := n.Child("sql_condition") - requiredJobsSqlConditionConfiguration(w, &c, x) - } else if n.IsRef("sql_condition") { - c := n.Child("sql_condition") - requiredJobsSqlConditionConfiguration(w, &c, nil) - } - if x := v.TableUpdate; x != nil { - c := n.Child("table_update") - requiredJobsTableUpdateTriggerConfiguration(w, &c, x) - } else if n.IsRef("table_update") { - c := n.Child("table_update") - requiredJobsTableUpdateTriggerConfiguration(w, &c, nil) - } -} - -func requiredJobsTriggerConfiguration(w *walker, n *walk.Node, v *jobs.TriggerConfiguration) { - if v == nil { - return - } - if x := v.Continuous; x != nil { - c := n.Child("continuous") - requiredJobsContinuousTriggerConfiguration(w, &c, x) - } else if n.IsRef("continuous") { - c := n.Child("continuous") - requiredJobsContinuousTriggerConfiguration(w, &c, nil) - } - if x := v.FileArrival; x != nil { - c := n.Child("file_arrival") - requiredJobsFileArrivalTriggerConfiguration(w, &c, x) - } else if n.IsRef("file_arrival") { - c := n.Child("file_arrival") - requiredJobsFileArrivalTriggerConfiguration(w, &c, nil) - } - if x := v.Model; x != nil { - c := n.Child("model") - requiredJobsModelTriggerConfiguration(w, &c, x) - } else if n.IsRef("model") { - c := n.Child("model") - requiredJobsModelTriggerConfiguration(w, &c, nil) - } - if x := v.Periodic; x != nil { - c := n.Child("periodic") - requiredJobsPeriodicTriggerConfiguration(w, &c, x) - } else if n.IsRef("periodic") { - c := n.Child("periodic") - requiredJobsPeriodicTriggerConfiguration(w, &c, nil) - } - if x := v.Schedule; x != nil { - c := n.Child("schedule") - requiredJobsCronTriggerConfiguration(w, &c, x) - } else if n.IsRef("schedule") { - c := n.Child("schedule") - requiredJobsCronTriggerConfiguration(w, &c, nil) - } - if x := v.SqlCondition; x != nil { - c := n.Child("sql_condition") - requiredJobsSqlConditionConfiguration(w, &c, x) - } else if n.IsRef("sql_condition") { - c := n.Child("sql_condition") - requiredJobsSqlConditionConfiguration(w, &c, nil) - } - if x := v.TableUpdate; x != nil { - c := n.Child("table_update") - requiredJobsTableUpdateTriggerConfiguration(w, &c, x) - } else if n.IsRef("table_update") { - c := n.Child("table_update") - requiredJobsTableUpdateTriggerConfiguration(w, &c, nil) - } -} - -func requiredJobsWebhookNotifications(w *walker, n *walk.Node, v *jobs.WebhookNotifications) { - if v == nil { - return - } - if len(v.OnDurationWarningThresholdExceeded) > 0 { - c := n.Child("on_duration_warning_threshold_exceeded") - for i := range v.OnDurationWarningThresholdExceeded { - e := c.Elem(i) - requiredJobsWebhook(w, &e, &v.OnDurationWarningThresholdExceeded[i]) - } - } - if len(v.OnFailure) > 0 { - c := n.Child("on_failure") - for i := range v.OnFailure { - e := c.Elem(i) - requiredJobsWebhook(w, &e, &v.OnFailure[i]) - } - } - if len(v.OnMaintenanceComplete) > 0 { - c := n.Child("on_maintenance_complete") - for i := range v.OnMaintenanceComplete { - e := c.Elem(i) - requiredJobsWebhook(w, &e, &v.OnMaintenanceComplete[i]) - } - } - if len(v.OnMaintenanceStart) > 0 { - c := n.Child("on_maintenance_start") - for i := range v.OnMaintenanceStart { - e := c.Elem(i) - requiredJobsWebhook(w, &e, &v.OnMaintenanceStart[i]) - } - } - if len(v.OnStart) > 0 { - c := n.Child("on_start") - for i := range v.OnStart { - e := c.Elem(i) - requiredJobsWebhook(w, &e, &v.OnStart[i]) - } - } - if len(v.OnStreamingBacklogExceeded) > 0 { - c := n.Child("on_streaming_backlog_exceeded") - for i := range v.OnStreamingBacklogExceeded { - e := c.Elem(i) - requiredJobsWebhook(w, &e, &v.OnStreamingBacklogExceeded[i]) - } - } - if len(v.OnSuccess) > 0 { - c := n.Child("on_success") - for i := range v.OnSuccess { - e := c.Elem(i) - requiredJobsWebhook(w, &e, &v.OnSuccess[i]) - } - } -} - -func requiredCatalogMcpServiceConfig(w *walker, n *walk.Node, v *catalog.McpServiceConfig) { - if v == nil { - return - } - if len(v.RateLimits) > 0 { - c := n.Child("rate_limits") - for i := range v.RateLimits { - e := c.Elem(i) - requiredCatalogRateLimit(w, &e, &v.RateLimits[i]) - } - } - if x := v.SourceConnection; x != nil { - c := n.Child("source_connection") - requiredCatalogMcpServiceConfigSourceConnection(w, &c, x) - } else if n.IsRef("source_connection") { - c := n.Child("source_connection") - requiredCatalogMcpServiceConfigSourceConnection(w, &c, nil) - } -} - -func requiredCatalogModelProviderServiceConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfig) { - if v == nil { - return - } - if x := v.AmazonBedrock; x != nil { - c := n.Child("amazon_bedrock") - requiredCatalogModelProviderServiceConfigAmazonBedrockProviderConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "AmazonBedrock") || n.IsRef("amazon_bedrock") { - c := n.Child("amazon_bedrock") - requiredCatalogModelProviderServiceConfigAmazonBedrockProviderConfig(w, &c, nil) - } - if x := v.Anthropic; x != nil { - c := n.Child("anthropic") - requiredCatalogModelProviderServiceConfigAnthropicProviderConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Anthropic") || n.IsRef("anthropic") { - c := n.Child("anthropic") - requiredCatalogModelProviderServiceConfigAnthropicProviderConfig(w, &c, nil) - } - if x := v.AzureOpenai; x != nil { - c := n.Child("azure_openai") - requiredCatalogModelProviderServiceConfigAzureOpenAiProviderConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "AzureOpenai") || n.IsRef("azure_openai") { - c := n.Child("azure_openai") - requiredCatalogModelProviderServiceConfigAzureOpenAiProviderConfig(w, &c, nil) - } - if x := v.BedrockMantle; x != nil { - c := n.Child("bedrock_mantle") - requiredCatalogModelProviderServiceConfigAmazonBedrockProviderConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "BedrockMantle") || n.IsRef("bedrock_mantle") { - c := n.Child("bedrock_mantle") - requiredCatalogModelProviderServiceConfigAmazonBedrockProviderConfig(w, &c, nil) - } - if x := v.Custom; x != nil { - c := n.Child("custom") - requiredCatalogModelProviderServiceConfigCustomProviderConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Custom") || n.IsRef("custom") { - c := n.Child("custom") - requiredCatalogModelProviderServiceConfigCustomProviderConfig(w, &c, nil) - } - if x := v.GeminiEnterprise; x != nil { - c := n.Child("gemini_enterprise") - requiredCatalogModelProviderServiceConfigGeminiEnterpriseProviderConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "GeminiEnterprise") || n.IsRef("gemini_enterprise") { - c := n.Child("gemini_enterprise") - requiredCatalogModelProviderServiceConfigGeminiEnterpriseProviderConfig(w, &c, nil) - } - if x := v.InferenceTable; x != nil { - c := n.Child("inference_table") - requiredCatalogInferenceTableConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "InferenceTable") || n.IsRef("inference_table") { - c := n.Child("inference_table") - requiredCatalogInferenceTableConfig(w, &c, nil) - } - if x := v.MicrosoftFoundry; x != nil { - c := n.Child("microsoft_foundry") - requiredCatalogModelProviderServiceConfigMicrosoftFoundryProviderConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "MicrosoftFoundry") || n.IsRef("microsoft_foundry") { - c := n.Child("microsoft_foundry") - requiredCatalogModelProviderServiceConfigMicrosoftFoundryProviderConfig(w, &c, nil) - } - if x := v.Openai; x != nil { - c := n.Child("openai") - requiredCatalogModelProviderServiceConfigOpenAiProviderConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Openai") || n.IsRef("openai") { - c := n.Child("openai") - requiredCatalogModelProviderServiceConfigOpenAiProviderConfig(w, &c, nil) - } - if len(v.RateLimits) > 0 { - c := n.Child("rate_limits") - for i := range v.RateLimits { - e := c.Elem(i) - requiredCatalogRateLimit(w, &e, &v.RateLimits[i]) - } - } - if len(v.Targets) > 0 { - c := n.Child("targets") - for i := range v.Targets { - e := c.Elem(i) - requiredCatalogModelProviderServiceConfigModelTargetConfig(w, &e, &v.Targets[i]) - } - } -} - -func requiredCatalogModelServiceConfig(w *walker, n *walk.Node, v *catalog.ModelServiceConfig) { - if v == nil { - return - } - if x := v.InferenceTable; x != nil { - c := n.Child("inference_table") - requiredCatalogInferenceTableConfig(w, &c, x) - } else if n.IsRef("inference_table") { - c := n.Child("inference_table") - requiredCatalogInferenceTableConfig(w, &c, nil) - } - if len(v.RateLimits) > 0 { - c := n.Child("rate_limits") - for i := range v.RateLimits { - e := c.Elem(i) - requiredCatalogRateLimit(w, &e, &v.RateLimits[i]) - } - } - if x := v.Routing; x != nil { - c := n.Child("routing") - requiredCatalogModelServiceConfigRoutingConfig(w, &c, x) - } else if n.IsRef("routing") { - c := n.Child("routing") - requiredCatalogModelServiceConfigRoutingConfig(w, &c, nil) - } -} - -func requiredServingAiGatewayConfig(w *walker, n *walk.Node, v *serving.AiGatewayConfig) { - if v == nil { - return - } - if x := v.FallbackConfig; x != nil { - c := n.Child("fallback_config") - requiredServingFallbackConfig(w, &c, x) - } else if n.IsRef("fallback_config") { - c := n.Child("fallback_config") - requiredServingFallbackConfig(w, &c, nil) - } - if len(v.RateLimits) > 0 { - c := n.Child("rate_limits") - for i := range v.RateLimits { - e := c.Elem(i) - requiredServingAiGatewayRateLimit(w, &e, &v.RateLimits[i]) - } - } -} - -func requiredServingEndpointCoreConfigInput(w *walker, n *walk.Node, v *serving.EndpointCoreConfigInput) { - if v == nil { - return - } - if len(v.ServedEntities) > 0 { - c := n.Child("served_entities") - for i := range v.ServedEntities { - e := c.Elem(i) - requiredServingServedEntityInput(w, &e, &v.ServedEntities[i]) - } - } - if len(v.ServedModels) > 0 { - c := n.Child("served_models") - for i := range v.ServedModels { - e := c.Elem(i) - requiredServingServedModelInput(w, &e, &v.ServedModels[i]) - } - } - if x := v.TrafficConfig; x != nil { - c := n.Child("traffic_config") - requiredServingTrafficConfig(w, &c, x) - } else if n.IsRef("traffic_config") { - c := n.Child("traffic_config") - requiredServingTrafficConfig(w, &c, nil) - } -} - -func requiredResourcesModelServingEndpointPermission(w *walker, n *walk.Node, v *resources.ModelServingEndpointPermission) { - if v == nil { - w.missing(n, "level") - return - } - if !(v.Level != "") { - w.missing(n, "level") - } -} - -func requiredServingRateLimit(w *walker, n *walk.Node, v *serving.RateLimit) { - if v == nil { - w.missing(n, "calls") - w.missing(n, "renewal_period") - return - } - if !(v.Calls != 0 || n.IsRef("calls")) { - w.missing(n, "calls") - } - if !(v.RenewalPeriod != "") { - w.missing(n, "renewal_period") - } -} - -func requiredServingEndpointTag(w *walker, n *walk.Node, v *serving.EndpointTag) { - if v == nil { - w.missing(n, "key") - return - } - if !(v.Key != "" || walk.Forced(v.ForceSendFields, "Key")) { - w.missing(n, "key") - } -} - -func requiredResourcesMlflowModelPermission(w *walker, n *walk.Node, v *resources.MlflowModelPermission) { - if v == nil { - w.missing(n, "level") - return - } - if !(v.Level != "") { - w.missing(n, "level") - } -} - -func requiredPipelinesPipelineCluster(w *walker, n *walk.Node, v *pipelines.PipelineCluster) { - if v == nil { - return - } - if x := v.Autoscale; x != nil { - c := n.Child("autoscale") - requiredPipelinesPipelineClusterAutoscale(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Autoscale") || n.IsRef("autoscale") { - c := n.Child("autoscale") - requiredPipelinesPipelineClusterAutoscale(w, &c, nil) - } - if x := v.ClusterLogConf; x != nil { - c := n.Child("cluster_log_conf") - requiredComputeClusterLogConf(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ClusterLogConf") || n.IsRef("cluster_log_conf") { - c := n.Child("cluster_log_conf") - requiredComputeClusterLogConf(w, &c, nil) - } - if len(v.InitScripts) > 0 { - c := n.Child("init_scripts") - for i := range v.InitScripts { - e := c.Elem(i) - requiredComputeInitScriptInfo(w, &e, &v.InitScripts[i]) - } - } -} - -func requiredPipelinesPipelineDeployment(w *walker, n *walk.Node, v *pipelines.PipelineDeployment) { - if v == nil { - w.missing(n, "kind") - return - } - if !(v.Kind != "" || walk.Forced(v.ForceSendFields, "Kind")) { - w.missing(n, "kind") - } -} - -func requiredPipelinesIngestionGatewayPipelineDefinition(w *walker, n *walk.Node, v *pipelines.IngestionGatewayPipelineDefinition) { - if v == nil { - w.missing(n, "connection_name") - w.missing(n, "gateway_storage_catalog") - w.missing(n, "gateway_storage_schema") - return - } - if !(v.ConnectionName != "" || walk.Forced(v.ForceSendFields, "ConnectionName")) { - w.missing(n, "connection_name") - } - if !(v.GatewayStorageCatalog != "" || walk.Forced(v.ForceSendFields, "GatewayStorageCatalog")) { - w.missing(n, "gateway_storage_catalog") - } - if !(v.GatewayStorageSchema != "" || walk.Forced(v.ForceSendFields, "GatewayStorageSchema")) { - w.missing(n, "gateway_storage_schema") - } -} - -func requiredPipelinesIngestionPipelineDefinition(w *walker, n *walk.Node, v *pipelines.IngestionPipelineDefinition) { - if v == nil { - return - } - if x := v.DataStagingOptions; x != nil { - c := n.Child("data_staging_options") - requiredPipelinesDataStagingOptions(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "DataStagingOptions") || n.IsRef("data_staging_options") { - c := n.Child("data_staging_options") - requiredPipelinesDataStagingOptions(w, &c, nil) - } - if x := v.FullRefreshWindow; x != nil { - c := n.Child("full_refresh_window") - requiredPipelinesOperationTimeWindow(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "FullRefreshWindow") || n.IsRef("full_refresh_window") { - c := n.Child("full_refresh_window") - requiredPipelinesOperationTimeWindow(w, &c, nil) - } - if len(v.Objects) > 0 { - c := n.Child("objects") - for i := range v.Objects { - e := c.Elem(i) - requiredPipelinesIngestionConfig(w, &e, &v.Objects[i]) - } - } - if x := v.TableConfiguration; x != nil { - c := n.Child("table_configuration") - requiredPipelinesTableSpecificConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "TableConfiguration") || n.IsRef("table_configuration") { - c := n.Child("table_configuration") - requiredPipelinesTableSpecificConfig(w, &c, nil) - } -} - -func requiredPipelinesPipelineLibrary(w *walker, n *walk.Node, v *pipelines.PipelineLibrary) { - if v == nil { - return - } - if x := v.Maven; x != nil { - c := n.Child("maven") - requiredComputeMavenLibrary(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Maven") || n.IsRef("maven") { - c := n.Child("maven") - requiredComputeMavenLibrary(w, &c, nil) - } -} - -func requiredResourcesPipelinePermission(w *walker, n *walk.Node, v *resources.PipelinePermission) { - if v == nil { - w.missing(n, "level") - return - } - if !(v.Level != "") { - w.missing(n, "level") - } -} - -func requiredPipelinesRestartWindow(w *walker, n *walk.Node, v *pipelines.RestartWindow) { - if v == nil { - w.missing(n, "start_hour") - return - } - if !(v.StartHour != 0 || walk.Forced(v.ForceSendFields, "StartHour") || n.IsRef("start_hour")) { - w.missing(n, "start_hour") - } -} - -func requiredPostgresEndpointGroupSpec(w *walker, n *walk.Node, v *postgres.EndpointGroupSpec) { - if v == nil { - w.missing(n, "max") - w.missing(n, "min") - return - } - if !(v.Max != 0 || walk.Forced(v.ForceSendFields, "Max") || n.IsRef("max")) { - w.missing(n, "max") - } - if !(v.Min != 0 || walk.Forced(v.ForceSendFields, "Min") || n.IsRef("min")) { - w.missing(n, "min") - } -} - -func requiredPostgresScheduleCadence(w *walker, n *walk.Node, v *postgres.ScheduleCadence) { - if v == nil { - w.missing(n, "retention") - return - } - if !(!walk.IsZeroStruct(&v.Retention) || n.HasRefs("retention")) { - w.missing(n, "retention") - } - if x := v.MonthlySchedule; x != nil { - c := n.Child("monthly_schedule") - requiredPostgresMonthlySchedule(w, &c, x) - } else if n.IsRef("monthly_schedule") { - c := n.Child("monthly_schedule") - requiredPostgresMonthlySchedule(w, &c, nil) - } - if x := v.WeeklySchedule; x != nil { - c := n.Child("weekly_schedule") - requiredPostgresWeeklySchedule(w, &c, x) - } else if n.IsRef("weekly_schedule") { - c := n.Child("weekly_schedule") - requiredPostgresWeeklySchedule(w, &c, nil) - } -} - -func requiredPostgresSyncedTableSyncedTableSpecExtraColumn(w *walker, n *walk.Node, v *postgres.SyncedTableSyncedTableSpecExtraColumn) { - if v == nil { - w.missing(n, "column_name") - w.missing(n, "column_type") - return - } - if !(v.ColumnName != "" || walk.Forced(v.ForceSendFields, "ColumnName")) { - w.missing(n, "column_name") - } - if !(v.ColumnType != "" || walk.Forced(v.ForceSendFields, "ColumnType")) { - w.missing(n, "column_type") - } -} - -func requiredPostgresSyncedTableSyncedTableSpecTypeOverride(w *walker, n *walk.Node, v *postgres.SyncedTableSyncedTableSpecTypeOverride) { - if v == nil { - w.missing(n, "column_name") - w.missing(n, "pg_type") - return - } - if !(v.ColumnName != "" || walk.Forced(v.ForceSendFields, "ColumnName")) { - w.missing(n, "column_name") - } - if !(v.PgType != "" || walk.Forced(v.ForceSendFields, "PgType")) { - w.missing(n, "pg_type") - } -} - -func requiredCatalogMonitorMetric(w *walker, n *walk.Node, v *catalog.MonitorMetric) { - if v == nil { - w.missing(n, "definition") - w.missing(n, "input_columns") - w.missing(n, "name") - w.missing(n, "output_data_type") - w.missing(n, "type") - return - } - if !(v.Definition != "") { - w.missing(n, "definition") - } - if !(v.InputColumns != nil || n.IsRef("input_columns")) { - w.missing(n, "input_columns") - } - if !(v.Name != "") { - w.missing(n, "name") - } - if !(v.OutputDataType != "") { - w.missing(n, "output_data_type") - } - if !(v.Type != "") { - w.missing(n, "type") - } -} - -func requiredCatalogMonitorInferenceLog(w *walker, n *walk.Node, v *catalog.MonitorInferenceLog) { - if v == nil { - w.missing(n, "granularities") - w.missing(n, "model_id_col") - w.missing(n, "prediction_col") - w.missing(n, "problem_type") - w.missing(n, "timestamp_col") - return - } - if !(v.Granularities != nil || n.IsRef("granularities")) { - w.missing(n, "granularities") - } - if !(v.ModelIdCol != "" || walk.Forced(v.ForceSendFields, "ModelIdCol")) { - w.missing(n, "model_id_col") - } - if !(v.PredictionCol != "" || walk.Forced(v.ForceSendFields, "PredictionCol")) { - w.missing(n, "prediction_col") - } - if !(v.ProblemType != "" || walk.Forced(v.ForceSendFields, "ProblemType")) { - w.missing(n, "problem_type") - } - if !(v.TimestampCol != "" || walk.Forced(v.ForceSendFields, "TimestampCol")) { - w.missing(n, "timestamp_col") - } -} - -func requiredCatalogMonitorCronSchedule(w *walker, n *walk.Node, v *catalog.MonitorCronSchedule) { - if v == nil { - w.missing(n, "quartz_cron_expression") - w.missing(n, "timezone_id") - return - } - if !(v.QuartzCronExpression != "") { - w.missing(n, "quartz_cron_expression") - } - if !(v.TimezoneId != "") { - w.missing(n, "timezone_id") - } -} - -func requiredCatalogMonitorTimeSeries(w *walker, n *walk.Node, v *catalog.MonitorTimeSeries) { - if v == nil { - w.missing(n, "granularities") - w.missing(n, "timestamp_col") - return - } - if !(v.Granularities != nil || n.IsRef("granularities")) { - w.missing(n, "granularities") - } - if !(v.TimestampCol != "") { - w.missing(n, "timestamp_col") - } -} - -func requiredWorkspaceAzureKeyVaultSecretScopeMetadata(w *walker, n *walk.Node, v *workspace.AzureKeyVaultSecretScopeMetadata) { - if v == nil { - w.missing(n, "dns_name") - w.missing(n, "resource_id") - return - } - if !(v.DnsName != "") { - w.missing(n, "dns_name") - } - if !(v.ResourceId != "") { - w.missing(n, "resource_id") - } -} - -func requiredResourcesSecretScopePermission(w *walker, n *walk.Node, v *resources.SecretScopePermission) { - if v == nil { - w.missing(n, "level") - return - } - if !(v.Level != "") { - w.missing(n, "level") - } -} - -func requiredResourcesSqlWarehousePermission(w *walker, n *walk.Node, v *resources.SqlWarehousePermission) { - if v == nil { - w.missing(n, "level") - return - } - if !(v.Level != "") { - w.missing(n, "level") - } -} - -func requiredDatabaseSyncedTableSpec(w *walker, n *walk.Node, v *database.SyncedTableSpec) { - if v == nil { - return - } - if len(v.TypeOverrides) > 0 { - c := n.Child("type_overrides") - for i := range v.TypeOverrides { - e := c.Elem(i) - requiredDatabaseSyncedTableSpecTypeOverride(w, &e, &v.TypeOverrides[i]) - } - } -} - -func requiredResourcesVectorSearchEndpointPermission(w *walker, n *walk.Node, v *resources.VectorSearchEndpointPermission) { - if v == nil { - w.missing(n, "level") - return - } - if !(v.Level != "") { - w.missing(n, "level") - } -} - -func requiredSqlAlertV2OperandColumn(w *walker, n *walk.Node, v *sql.AlertV2OperandColumn) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.Name != "" || walk.Forced(v.ForceSendFields, "Name")) { - w.missing(n, "name") - } -} - -func requiredSqlAlertV2Operand(w *walker, n *walk.Node, v *sql.AlertV2Operand) { - if v == nil { - return - } - if x := v.Column; x != nil { - c := n.Child("column") - requiredSqlAlertV2OperandColumn2(w, &c, x) - } else if n.IsRef("column") { - c := n.Child("column") - requiredSqlAlertV2OperandColumn2(w, &c, nil) - } -} - -func requiredResourcesDependsOn(w *walker, n *walk.Node, v *resources.DependsOn) { - if v == nil { - w.missing(n, "resource") - return - } - if !(v.Resource != "") { - w.missing(n, "resource") - } -} - -func requiredResourcesAppEnvVar(w *walker, n *walk.Node, v *resources.AppEnvVar) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.Name != "") { - w.missing(n, "name") - } -} - -func requiredAppsAppResourceDatabase(w *walker, n *walk.Node, v *apps.AppResourceDatabase) { - if v == nil { - w.missing(n, "database_name") - w.missing(n, "instance_name") - w.missing(n, "permission") - return - } - if !(v.DatabaseName != "") { - w.missing(n, "database_name") - } - if !(v.InstanceName != "") { - w.missing(n, "instance_name") - } - if !(v.Permission != "") { - w.missing(n, "permission") - } -} - -func requiredAppsAppResourceExperiment(w *walker, n *walk.Node, v *apps.AppResourceExperiment) { - if v == nil { - w.missing(n, "experiment_id") - w.missing(n, "permission") - return - } - if !(v.ExperimentId != "") { - w.missing(n, "experiment_id") - } - if !(v.Permission != "") { - w.missing(n, "permission") - } -} - -func requiredAppsAppResourceGenieSpace(w *walker, n *walk.Node, v *apps.AppResourceGenieSpace) { - if v == nil { - w.missing(n, "name") - w.missing(n, "permission") - w.missing(n, "space_id") - return - } - if !(v.Name != "") { - w.missing(n, "name") - } - if !(v.Permission != "") { - w.missing(n, "permission") - } - if !(v.SpaceId != "") { - w.missing(n, "space_id") - } -} - -func requiredAppsAppResourceJob(w *walker, n *walk.Node, v *apps.AppResourceJob) { - if v == nil { - w.missing(n, "id") - w.missing(n, "permission") - return - } - if !(v.Id != "") { - w.missing(n, "id") - } - if !(v.Permission != "") { - w.missing(n, "permission") - } -} - -func requiredAppsAppResourceSecret(w *walker, n *walk.Node, v *apps.AppResourceSecret) { - if v == nil { - w.missing(n, "key") - w.missing(n, "permission") - w.missing(n, "scope") - return - } - if !(v.Key != "") { - w.missing(n, "key") - } - if !(v.Permission != "") { - w.missing(n, "permission") - } - if !(v.Scope != "") { - w.missing(n, "scope") - } -} - -func requiredAppsAppResourceServingEndpoint(w *walker, n *walk.Node, v *apps.AppResourceServingEndpoint) { - if v == nil { - w.missing(n, "name") - w.missing(n, "permission") - return - } - if !(v.Name != "") { - w.missing(n, "name") - } - if !(v.Permission != "") { - w.missing(n, "permission") - } -} - -func requiredAppsAppResourceSqlWarehouse(w *walker, n *walk.Node, v *apps.AppResourceSqlWarehouse) { - if v == nil { - w.missing(n, "id") - w.missing(n, "permission") - return - } - if !(v.Id != "") { - w.missing(n, "id") - } - if !(v.Permission != "") { - w.missing(n, "permission") - } -} - -func requiredAppsAppResourceUcSecurable(w *walker, n *walk.Node, v *apps.AppResourceUcSecurable) { - if v == nil { - w.missing(n, "permission") - w.missing(n, "securable_full_name") - w.missing(n, "securable_type") - return - } - if !(v.Permission != "" || walk.Forced(v.ForceSendFields, "Permission")) { - w.missing(n, "permission") - } - if !(v.SecurableFullName != "" || walk.Forced(v.ForceSendFields, "SecurableFullName")) { - w.missing(n, "securable_full_name") - } - if !(v.SecurableType != "" || walk.Forced(v.ForceSendFields, "SecurableType")) { - w.missing(n, "securable_type") - } -} - -func requiredAppsUnityCatalog(w *walker, n *walk.Node, v *apps.UnityCatalog) { - if v == nil { - w.missing(n, "logs_table") - w.missing(n, "metrics_table") - w.missing(n, "traces_table") - return - } - if !(v.LogsTable != "") { - w.missing(n, "logs_table") - } - if !(v.MetricsTable != "") { - w.missing(n, "metrics_table") - } - if !(v.TracesTable != "") { - w.missing(n, "traces_table") - } -} - -func requiredCatalogAzureEncryptionSettings(w *walker, n *walk.Node, v *catalog.AzureEncryptionSettings) { - if v == nil { - w.missing(n, "azure_tenant_id") - return - } - if !(v.AzureTenantId != "" || walk.Forced(v.ForceSendFields, "AzureTenantId")) { - w.missing(n, "azure_tenant_id") - } -} - -func requiredComputeRCranLibrary(w *walker, n *walk.Node, v *compute.RCranLibrary) { - if v == nil { - w.missing(n, "package") - return - } - if !(v.Package != "" || walk.Forced(v.ForceSendFields, "Package")) { - w.missing(n, "package") - } -} - -func requiredComputeMavenLibrary(w *walker, n *walk.Node, v *compute.MavenLibrary) { - if v == nil { - w.missing(n, "coordinates") - return - } - if !(v.Coordinates != "" || walk.Forced(v.ForceSendFields, "Coordinates")) { - w.missing(n, "coordinates") - } -} - -func requiredComputePythonPyPiLibrary(w *walker, n *walk.Node, v *compute.PythonPyPiLibrary) { - if v == nil { - w.missing(n, "package") - return - } - if !(v.Package != "" || walk.Forced(v.ForceSendFields, "Package")) { - w.missing(n, "package") - } -} - -func requiredComputeDbfsStorageInfo(w *walker, n *walk.Node, v *compute.DbfsStorageInfo) { - if v == nil { - w.missing(n, "destination") - return - } - if !(v.Destination != "") { - w.missing(n, "destination") - } -} - -func requiredComputeS3StorageInfo(w *walker, n *walk.Node, v *compute.S3StorageInfo) { - if v == nil { - w.missing(n, "destination") - return - } - if !(v.Destination != "" || walk.Forced(v.ForceSendFields, "Destination")) { - w.missing(n, "destination") - } -} - -func requiredComputeVolumesStorageInfo(w *walker, n *walk.Node, v *compute.VolumesStorageInfo) { - if v == nil { - w.missing(n, "destination") - return - } - if !(v.Destination != "") { - w.missing(n, "destination") - } -} - -func requiredComputeAdlsgen2Info(w *walker, n *walk.Node, v *compute.Adlsgen2Info) { - if v == nil { - w.missing(n, "destination") - return - } - if !(v.Destination != "") { - w.missing(n, "destination") - } -} - -func requiredComputeLocalFileInfo(w *walker, n *walk.Node, v *compute.LocalFileInfo) { - if v == nil { - w.missing(n, "destination") - return - } - if !(v.Destination != "") { - w.missing(n, "destination") - } -} - -func requiredComputeGcsStorageInfo(w *walker, n *walk.Node, v *compute.GcsStorageInfo) { - if v == nil { - w.missing(n, "destination") - return - } - if !(v.Destination != "") { - w.missing(n, "destination") - } -} - -func requiredComputeWorkspaceStorageInfo(w *walker, n *walk.Node, v *compute.WorkspaceStorageInfo) { - if v == nil { - w.missing(n, "destination") - return - } - if !(v.Destination != "") { - w.missing(n, "destination") - } -} - -func requiredMlUcTraceLocation(w *walker, n *walk.Node, v *ml.UcTraceLocation) { - if v == nil { - w.missing(n, "catalog") - w.missing(n, "schema") - return - } - if !(v.Catalog != "" || walk.Forced(v.ForceSendFields, "Catalog")) { - w.missing(n, "catalog") - } - if !(v.Schema != "" || walk.Forced(v.ForceSendFields, "Schema")) { - w.missing(n, "schema") - } -} - -func requiredMlAggregationFunction(w *walker, n *walk.Node, v *ml.AggregationFunction) { - if v == nil { - return - } - if x := v.ApproxCountDistinct; x != nil { - c := n.Child("approx_count_distinct") - requiredMlApproxCountDistinctFunction(w, &c, x) - } else if n.IsRef("approx_count_distinct") { - c := n.Child("approx_count_distinct") - requiredMlApproxCountDistinctFunction(w, &c, nil) - } - if x := v.ApproxPercentile; x != nil { - c := n.Child("approx_percentile") - requiredMlApproxPercentileFunction(w, &c, x) - } else if n.IsRef("approx_percentile") { - c := n.Child("approx_percentile") - requiredMlApproxPercentileFunction(w, &c, nil) - } - if x := v.Avg; x != nil { - c := n.Child("avg") - requiredMlAvgFunction(w, &c, x) - } else if n.IsRef("avg") { - c := n.Child("avg") - requiredMlAvgFunction(w, &c, nil) - } - if x := v.CountFunction; x != nil { - c := n.Child("count_function") - requiredMlCountFunction(w, &c, x) - } else if n.IsRef("count_function") { - c := n.Child("count_function") - requiredMlCountFunction(w, &c, nil) - } - if x := v.First; x != nil { - c := n.Child("first") - requiredMlFirstFunction(w, &c, x) - } else if n.IsRef("first") { - c := n.Child("first") - requiredMlFirstFunction(w, &c, nil) - } - if x := v.FirstDistinct; x != nil { - c := n.Child("first_distinct") - requiredMlFirstDistinctFunction(w, &c, x) - } else if n.IsRef("first_distinct") { - c := n.Child("first_distinct") - requiredMlFirstDistinctFunction(w, &c, nil) - } - if x := v.FirstN; x != nil { - c := n.Child("first_n") - requiredMlFirstNFunction(w, &c, x) - } else if n.IsRef("first_n") { - c := n.Child("first_n") - requiredMlFirstNFunction(w, &c, nil) - } - if x := v.Last; x != nil { - c := n.Child("last") - requiredMlLastFunction(w, &c, x) - } else if n.IsRef("last") { - c := n.Child("last") - requiredMlLastFunction(w, &c, nil) - } - if x := v.LastDistinct; x != nil { - c := n.Child("last_distinct") - requiredMlLastDistinctFunction(w, &c, x) - } else if n.IsRef("last_distinct") { - c := n.Child("last_distinct") - requiredMlLastDistinctFunction(w, &c, nil) - } - if x := v.LastN; x != nil { - c := n.Child("last_n") - requiredMlLastNFunction(w, &c, x) - } else if n.IsRef("last_n") { - c := n.Child("last_n") - requiredMlLastNFunction(w, &c, nil) - } - if x := v.Max; x != nil { - c := n.Child("max") - requiredMlMaxFunction(w, &c, x) - } else if n.IsRef("max") { - c := n.Child("max") - requiredMlMaxFunction(w, &c, nil) - } - if x := v.Min; x != nil { - c := n.Child("min") - requiredMlMinFunction(w, &c, x) - } else if n.IsRef("min") { - c := n.Child("min") - requiredMlMinFunction(w, &c, nil) - } - if x := v.StddevPop; x != nil { - c := n.Child("stddev_pop") - requiredMlStddevPopFunction(w, &c, x) - } else if n.IsRef("stddev_pop") { - c := n.Child("stddev_pop") - requiredMlStddevPopFunction(w, &c, nil) - } - if x := v.StddevSamp; x != nil { - c := n.Child("stddev_samp") - requiredMlStddevSampFunction(w, &c, x) - } else if n.IsRef("stddev_samp") { - c := n.Child("stddev_samp") - requiredMlStddevSampFunction(w, &c, nil) - } - if x := v.Sum; x != nil { - c := n.Child("sum") - requiredMlSumFunction(w, &c, x) - } else if n.IsRef("sum") { - c := n.Child("sum") - requiredMlSumFunction(w, &c, nil) - } - if x := v.TimeWindow; x != nil { - c := n.Child("time_window") - requiredMlTimeWindow(w, &c, x) - } else if n.IsRef("time_window") { - c := n.Child("time_window") - requiredMlTimeWindow(w, &c, nil) - } - if x := v.VarPop; x != nil { - c := n.Child("var_pop") - requiredMlVarPopFunction(w, &c, x) - } else if n.IsRef("var_pop") { - c := n.Child("var_pop") - requiredMlVarPopFunction(w, &c, nil) - } - if x := v.VarSamp; x != nil { - c := n.Child("var_samp") - requiredMlVarSampFunction(w, &c, x) - } else if n.IsRef("var_samp") { - c := n.Child("var_samp") - requiredMlVarSampFunction(w, &c, nil) - } -} - -func requiredMlColumnSelection(w *walker, n *walk.Node, v *ml.ColumnSelection) { - if v == nil { - w.missing(n, "column") - return - } - if !(v.Column != "") { - w.missing(n, "column") - } -} - -func requiredMlCustomUdf(w *walker, n *walk.Node, v *ml.CustomUdf) { - if v == nil { - w.missing(n, "function_path") - return - } - if !(v.FunctionPath != "") { - w.missing(n, "function_path") - } - if len(v.InputBindings) > 0 { - c := n.Child("input_bindings") - for i := range v.InputBindings { - e := c.Elem(i) - requiredMlInputBinding(w, &e, &v.InputBindings[i]) - } - } -} - -func requiredMlFunctionExtraParameter(w *walker, n *walk.Node, v *ml.FunctionExtraParameter) { - if v == nil { - w.missing(n, "key") - w.missing(n, "value") - return - } - if !(v.Key != "") { - w.missing(n, "key") - } - if !(v.Value != "") { - w.missing(n, "value") - } -} - -func requiredMlDeltaTableSource(w *walker, n *walk.Node, v *ml.DeltaTableSource) { - if v == nil { - w.missing(n, "full_name") - return - } - if !(v.FullName != "" || walk.Forced(v.ForceSendFields, "FullName")) { - w.missing(n, "full_name") - } -} - -func requiredMlFeatureViewSource(w *walker, n *walk.Node, v *ml.FeatureViewSource) { - if v == nil { - return - } - if len(v.FeatureReferences) > 0 { - c := n.Child("feature_references") - for i := range v.FeatureReferences { - e := c.Elem(i) - requiredMlFeatureReference(w, &e, &v.FeatureReferences[i]) - } - } -} - -func requiredMlKafkaSource(w *walker, n *walk.Node, v *ml.KafkaSource) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.Name != "" || walk.Forced(v.ForceSendFields, "Name")) { - w.missing(n, "name") - } - if len(v.EntityColumnIdentifiers) > 0 { - c := n.Child("entity_column_identifiers") - for i := range v.EntityColumnIdentifiers { - e := c.Elem(i) - requiredMlColumnIdentifier(w, &e, &v.EntityColumnIdentifiers[i]) - } - } - if x := v.TimeseriesColumnIdentifier; x != nil { - c := n.Child("timeseries_column_identifier") - requiredMlColumnIdentifier2(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "TimeseriesColumnIdentifier") || n.IsRef("timeseries_column_identifier") { - c := n.Child("timeseries_column_identifier") - requiredMlColumnIdentifier2(w, &c, nil) - } -} - -func requiredMlRequestSource(w *walker, n *walk.Node, v *ml.RequestSource) { - if v == nil { - return - } - if x := v.FlatSchema; x != nil { - c := n.Child("flat_schema") - requiredMlFlatSchema(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "FlatSchema") || n.IsRef("flat_schema") { - c := n.Child("flat_schema") - requiredMlFlatSchema(w, &c, nil) - } -} - -func requiredMlStreamSource(w *walker, n *walk.Node, v *ml.StreamSource) { - if v == nil { - w.missing(n, "full_name") - return - } - if !(v.FullName != "" || walk.Forced(v.ForceSendFields, "FullName")) { - w.missing(n, "full_name") - } -} - -func requiredMlContinuousWindow(w *walker, n *walk.Node, v *ml.ContinuousWindow) { - if v == nil { - w.missing(n, "window_duration") - return - } - if !(v.WindowDuration != "" || walk.Forced(v.ForceSendFields, "WindowDuration")) { - w.missing(n, "window_duration") - } -} - -func requiredMlSlidingWindow(w *walker, n *walk.Node, v *ml.SlidingWindow) { - if v == nil { - w.missing(n, "slide_duration") - return - } - if !(v.SlideDuration != "" || walk.Forced(v.ForceSendFields, "SlideDuration")) { - w.missing(n, "slide_duration") - } -} - -func requiredMlTumblingWindow(w *walker, n *walk.Node, v *ml.TumblingWindow) { - if v == nil { - w.missing(n, "window_duration") - return - } - if !(v.WindowDuration != "" || walk.Forced(v.ForceSendFields, "WindowDuration")) { - w.missing(n, "window_duration") - } -} - -func requiredJobsMaintenanceWindow(w *walker, n *walk.Node, v *jobs.MaintenanceWindow) { - if v == nil { - w.missing(n, "day_of_week") - w.missing(n, "start_hour") - w.missing(n, "timezone_id") - return - } - if !(v.DayOfWeek != "") { - w.missing(n, "day_of_week") - } - if !(v.StartHour != 0 || n.IsRef("start_hour")) { - w.missing(n, "start_hour") - } - if !(v.TimezoneId != "") { - w.missing(n, "timezone_id") - } -} - -func requiredJobsJobSource(w *walker, n *walk.Node, v *jobs.JobSource) { - if v == nil { - w.missing(n, "import_from_git_branch") - w.missing(n, "job_config_path") - return - } - if !(v.ImportFromGitBranch != "") { - w.missing(n, "import_from_git_branch") - } - if !(v.JobConfigPath != "") { - w.missing(n, "job_config_path") - } -} - -func requiredJobsJobsHealthRule(w *walker, n *walk.Node, v *jobs.JobsHealthRule) { - if v == nil { - w.missing(n, "metric") - w.missing(n, "op") - w.missing(n, "value") - return - } - if !(v.Metric != "") { - w.missing(n, "metric") - } - if !(v.Op != "") { - w.missing(n, "op") - } - if !(v.Value != 0 || n.IsRef("value")) { - w.missing(n, "value") - } -} - -func requiredComputeClusterSpec(w *walker, n *walk.Node, v *compute.ClusterSpec) { - if v == nil { - return - } - if x := v.ClusterLogConf; x != nil { - c := n.Child("cluster_log_conf") - requiredComputeClusterLogConf(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ClusterLogConf") || n.IsRef("cluster_log_conf") { - c := n.Child("cluster_log_conf") - requiredComputeClusterLogConf(w, &c, nil) - } - if len(v.InitScripts) > 0 { - c := n.Child("init_scripts") - for i := range v.InitScripts { - e := c.Elem(i) - requiredComputeInitScriptInfo(w, &e, &v.InitScripts[i]) - } - } - if x := v.WorkloadType; x != nil { - c := n.Child("workload_type") - requiredComputeWorkloadType(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "WorkloadType") || n.IsRef("workload_type") { - c := n.Child("workload_type") - requiredComputeWorkloadType(w, &c, nil) - } -} - -func requiredJobsSqlConditionConfiguration(w *walker, n *walk.Node, v *jobs.SqlConditionConfiguration) { - if v == nil { - w.missing(n, "sql_query_id") - w.missing(n, "warehouse_id") - return - } - if !(v.SqlQueryId != "") { - w.missing(n, "sql_query_id") - } - if !(v.WarehouseId != "") { - w.missing(n, "warehouse_id") - } -} - -func requiredJobsAiRuntimeTask(w *walker, n *walk.Node, v *jobs.AiRuntimeTask) { - if v == nil { - w.missing(n, "deployments") - w.missing(n, "experiment") - return - } - if !(v.Deployments != nil || n.IsRef("deployments")) { - w.missing(n, "deployments") - } - if !(v.Experiment != "" || walk.Forced(v.ForceSendFields, "Experiment")) { - w.missing(n, "experiment") - } - if len(v.Deployments) > 0 { - c := n.Child("deployments") - for i := range v.Deployments { - e := c.Elem(i) - requiredJobsDeploymentSpec(w, &e, &v.Deployments[i]) - } - } -} - -func requiredJobsCleanRoomsNotebookTask(w *walker, n *walk.Node, v *jobs.CleanRoomsNotebookTask) { - if v == nil { - w.missing(n, "clean_room_name") - w.missing(n, "notebook_name") - return - } - if !(v.CleanRoomName != "" || walk.Forced(v.ForceSendFields, "CleanRoomName")) { - w.missing(n, "clean_room_name") - } - if !(v.NotebookName != "" || walk.Forced(v.ForceSendFields, "NotebookName")) { - w.missing(n, "notebook_name") - } -} - -func requiredJobsConditionTask(w *walker, n *walk.Node, v *jobs.ConditionTask) { - if v == nil { - w.missing(n, "left") - w.missing(n, "op") - w.missing(n, "right") - return - } - if !(v.Left != "") { - w.missing(n, "left") - } - if !(v.Op != "") { - w.missing(n, "op") - } - if !(v.Right != "") { - w.missing(n, "right") - } -} - -func requiredJobsDashboardTask(w *walker, n *walk.Node, v *jobs.DashboardTask) { - if v == nil { - return - } - if x := v.Subscription; x != nil { - c := n.Child("subscription") - requiredJobsSubscription(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Subscription") || n.IsRef("subscription") { - c := n.Child("subscription") - requiredJobsSubscription(w, &c, nil) - } -} - -func requiredJobsDbtTask(w *walker, n *walk.Node, v *jobs.DbtTask) { - if v == nil { - w.missing(n, "commands") - return - } - if !(v.Commands != nil || n.IsRef("commands")) { - w.missing(n, "commands") - } -} - -func requiredJobsTaskDependency(w *walker, n *walk.Node, v *jobs.TaskDependency) { - if v == nil { - w.missing(n, "task_key") - return - } - if !(v.TaskKey != "" || walk.Forced(v.ForceSendFields, "TaskKey")) { - w.missing(n, "task_key") - } -} - -func requiredJobsForEachTask(w *walker, n *walk.Node, v *jobs.ForEachTask) { - if v == nil { - w.missing(n, "inputs") - w.missing(n, "task") - return - } - if !(v.Inputs != "" || walk.Forced(v.ForceSendFields, "Inputs")) { - w.missing(n, "inputs") - } - if !(!walk.IsZeroStruct(&v.Task) || walk.Forced(v.ForceSendFields, "Task") || n.HasRefs("task")) { - w.missing(n, "task") - } - if x := &v.Task; !walk.IsZeroStruct(x) || walk.Forced(v.ForceSendFields, "Task") || n.HasRefs("task") { - c := n.Child("task") - requiredJobsTask2(w, &c, x) - } -} - -func requiredJobsGenAiComputeTask(w *walker, n *walk.Node, v *jobs.GenAiComputeTask) { - if v == nil { - w.missing(n, "dl_runtime_image") - return - } - if !(v.DlRuntimeImage != "" || walk.Forced(v.ForceSendFields, "DlRuntimeImage")) { - w.missing(n, "dl_runtime_image") - } - if x := v.Compute; x != nil { - c := n.Child("compute") - requiredJobsComputeConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Compute") || n.IsRef("compute") { - c := n.Child("compute") - requiredJobsComputeConfig(w, &c, nil) - } -} - -func requiredJobsNotebookTask(w *walker, n *walk.Node, v *jobs.NotebookTask) { - if v == nil { - w.missing(n, "notebook_path") - return - } - if !(v.NotebookPath != "" || walk.Forced(v.ForceSendFields, "NotebookPath")) { - w.missing(n, "notebook_path") - } -} - -func requiredJobsPipelineTask(w *walker, n *walk.Node, v *jobs.PipelineTask) { - if v == nil { - w.missing(n, "pipeline_id") - return - } - if !(v.PipelineId != "" || walk.Forced(v.ForceSendFields, "PipelineId")) { - w.missing(n, "pipeline_id") - } -} - -func requiredJobsPythonWheelTask(w *walker, n *walk.Node, v *jobs.PythonWheelTask) { - if v == nil { - w.missing(n, "entry_point") - w.missing(n, "package_name") - return - } - if !(v.EntryPoint != "") { - w.missing(n, "entry_point") - } - if !(v.PackageName != "") { - w.missing(n, "package_name") - } -} - -func requiredJobsRunJobTask(w *walker, n *walk.Node, v *jobs.RunJobTask) { - if v == nil { - w.missing(n, "job_id") - return - } - if !(v.JobId != 0 || n.IsRef("job_id")) { - w.missing(n, "job_id") - } -} - -func requiredJobsSparkPythonTask(w *walker, n *walk.Node, v *jobs.SparkPythonTask) { - if v == nil { - w.missing(n, "python_file") - return - } - if !(v.PythonFile != "") { - w.missing(n, "python_file") - } -} - -func requiredJobsSqlTask(w *walker, n *walk.Node, v *jobs.SqlTask) { - if v == nil { - w.missing(n, "warehouse_id") - return - } - if !(v.WarehouseId != "") { - w.missing(n, "warehouse_id") - } - if x := v.Alert; x != nil { - c := n.Child("alert") - requiredJobsSqlTaskAlert(w, &c, x) - } else if n.IsRef("alert") { - c := n.Child("alert") - requiredJobsSqlTaskAlert(w, &c, nil) - } - if x := v.Dashboard; x != nil { - c := n.Child("dashboard") - requiredJobsSqlTaskDashboard(w, &c, x) - } else if n.IsRef("dashboard") { - c := n.Child("dashboard") - requiredJobsSqlTaskDashboard(w, &c, nil) - } - if x := v.File; x != nil { - c := n.Child("file") - requiredJobsSqlTaskFile(w, &c, x) - } else if n.IsRef("file") { - c := n.Child("file") - requiredJobsSqlTaskFile(w, &c, nil) - } - if x := v.Query; x != nil { - c := n.Child("query") - requiredJobsSqlTaskQuery(w, &c, x) - } else if n.IsRef("query") { - c := n.Child("query") - requiredJobsSqlTaskQuery(w, &c, nil) - } -} - -func requiredJobsFileArrivalTriggerConfiguration(w *walker, n *walk.Node, v *jobs.FileArrivalTriggerConfiguration) { - if v == nil { - w.missing(n, "url") - return - } - if !(v.Url != "" || walk.Forced(v.ForceSendFields, "Url")) { - w.missing(n, "url") - } -} - -func requiredJobsModelTriggerConfiguration(w *walker, n *walk.Node, v *jobs.ModelTriggerConfiguration) { - if v == nil { - w.missing(n, "condition") - return - } - if !(v.Condition != "" || walk.Forced(v.ForceSendFields, "Condition")) { - w.missing(n, "condition") - } -} - -func requiredJobsPeriodicTriggerConfiguration(w *walker, n *walk.Node, v *jobs.PeriodicTriggerConfiguration) { - if v == nil { - w.missing(n, "interval") - w.missing(n, "unit") - return - } - if !(v.Interval != 0 || n.IsRef("interval")) { - w.missing(n, "interval") - } - if !(v.Unit != "") { - w.missing(n, "unit") - } -} - -func requiredJobsTableUpdateTriggerConfiguration(w *walker, n *walk.Node, v *jobs.TableUpdateTriggerConfiguration) { - if v == nil { - w.missing(n, "table_names") - return - } - if !(v.TableNames != nil || n.IsRef("table_names")) { - w.missing(n, "table_names") - } -} - -func requiredJobsContinuousTriggerConfiguration(w *walker, n *walk.Node, v *jobs.ContinuousTriggerConfiguration) { - if v == nil { - return - } - if x := v.MaintenanceWindow; x != nil { - c := n.Child("maintenance_window") - requiredJobsMaintenanceWindow(w, &c, x) - } else if n.IsRef("maintenance_window") { - c := n.Child("maintenance_window") - requiredJobsMaintenanceWindow(w, &c, nil) - } -} - -func requiredJobsCronTriggerConfiguration(w *walker, n *walk.Node, v *jobs.CronTriggerConfiguration) { - if v == nil { - w.missing(n, "quartz_cron_expression") - w.missing(n, "timezone_id") - return - } - if !(v.QuartzCronExpression != "") { - w.missing(n, "quartz_cron_expression") - } - if !(v.TimezoneId != "") { - w.missing(n, "timezone_id") - } -} - -func requiredJobsWebhook(w *walker, n *walk.Node, v *jobs.Webhook) { - if v == nil { - w.missing(n, "id") - return - } - if !(v.Id != "") { - w.missing(n, "id") - } -} - -func requiredCatalogRateLimit(w *walker, n *walk.Node, v *catalog.RateLimit) { - if v == nil { - w.missing(n, "key") - w.missing(n, "renewal_period") - return - } - if !(v.Key != "" || walk.Forced(v.ForceSendFields, "Key")) { - w.missing(n, "key") - } - if !(v.RenewalPeriod != "" || walk.Forced(v.ForceSendFields, "RenewalPeriod")) { - w.missing(n, "renewal_period") - } -} - -func requiredCatalogMcpServiceConfigSourceConnection(w *walker, n *walk.Node, v *catalog.McpServiceConfigSourceConnection) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.Name != "" || walk.Forced(v.ForceSendFields, "Name")) { - w.missing(n, "name") - } -} - -func requiredCatalogModelProviderServiceConfigAmazonBedrockProviderConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigAmazonBedrockProviderConfig) { - if v == nil { - return - } - if x := v.Direct; x != nil { - c := n.Child("direct") - requiredCatalogModelProviderServiceConfigAmazonBedrockProviderDirectConfig(w, &c, x) - } else if n.IsRef("direct") { - c := n.Child("direct") - requiredCatalogModelProviderServiceConfigAmazonBedrockProviderDirectConfig(w, &c, nil) - } -} - -func requiredCatalogModelProviderServiceConfigAnthropicProviderConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigAnthropicProviderConfig) { - if v == nil { - return - } - if x := v.Direct; x != nil { - c := n.Child("direct") - requiredCatalogModelProviderServiceConfigAnthropicProviderDirectConfig(w, &c, x) - } else if n.IsRef("direct") { - c := n.Child("direct") - requiredCatalogModelProviderServiceConfigAnthropicProviderDirectConfig(w, &c, nil) - } -} - -func requiredCatalogModelProviderServiceConfigAzureOpenAiProviderConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigAzureOpenAiProviderConfig) { - if v == nil { - return - } - if x := v.Direct; x != nil { - c := n.Child("direct") - requiredCatalogModelProviderServiceConfigAzureOpenAiProviderDirectConfig(w, &c, x) - } else if n.IsRef("direct") { - c := n.Child("direct") - requiredCatalogModelProviderServiceConfigAzureOpenAiProviderDirectConfig(w, &c, nil) - } -} - -func requiredCatalogModelProviderServiceConfigCustomProviderConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigCustomProviderConfig) { - if v == nil { - return - } - if x := v.Direct; x != nil { - c := n.Child("direct") - requiredCatalogModelProviderServiceConfigCustomProviderDirectConfig(w, &c, x) - } else if n.IsRef("direct") { - c := n.Child("direct") - requiredCatalogModelProviderServiceConfigCustomProviderDirectConfig(w, &c, nil) - } -} - -func requiredCatalogModelProviderServiceConfigGeminiEnterpriseProviderConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigGeminiEnterpriseProviderConfig) { - if v == nil { - return - } - if x := v.Direct; x != nil { - c := n.Child("direct") - requiredCatalogModelProviderServiceConfigGeminiEnterpriseProviderDirectConfig(w, &c, x) - } else if n.IsRef("direct") { - c := n.Child("direct") - requiredCatalogModelProviderServiceConfigGeminiEnterpriseProviderDirectConfig(w, &c, nil) - } -} - -func requiredCatalogInferenceTableConfig(w *walker, n *walk.Node, v *catalog.InferenceTableConfig) { - if v == nil { - w.missing(n, "parent") - return - } - if !(v.Parent != "" || walk.Forced(v.ForceSendFields, "Parent")) { - w.missing(n, "parent") - } -} - -func requiredCatalogModelProviderServiceConfigMicrosoftFoundryProviderConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigMicrosoftFoundryProviderConfig) { - if v == nil { - return - } - if x := v.Direct; x != nil { - c := n.Child("direct") - requiredCatalogModelProviderServiceConfigMicrosoftFoundryProviderDirectConfig(w, &c, x) - } else if n.IsRef("direct") { - c := n.Child("direct") - requiredCatalogModelProviderServiceConfigMicrosoftFoundryProviderDirectConfig(w, &c, nil) - } -} - -func requiredCatalogModelProviderServiceConfigOpenAiProviderConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigOpenAiProviderConfig) { - if v == nil { - return - } - if x := v.Direct; x != nil { - c := n.Child("direct") - requiredCatalogModelProviderServiceConfigOpenAiProviderDirectConfig(w, &c, x) - } else if n.IsRef("direct") { - c := n.Child("direct") - requiredCatalogModelProviderServiceConfigOpenAiProviderDirectConfig(w, &c, nil) - } -} - -func requiredCatalogModelProviderServiceConfigModelTargetConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigModelTargetConfig) { - if v == nil { - w.missing(n, "model") - return - } - if !(v.Model != "" || walk.Forced(v.ForceSendFields, "Model")) { - w.missing(n, "model") - } -} - -func requiredCatalogModelServiceConfigRoutingConfig(w *walker, n *walk.Node, v *catalog.ModelServiceConfigRoutingConfig) { - if v == nil { - return - } - if len(v.Destinations) > 0 { - c := n.Child("destinations") - for i := range v.Destinations { - e := c.Elem(i) - requiredCatalogModelServiceConfigDestinationConfig(w, &e, &v.Destinations[i]) - } - } - if x := v.Fallback; x != nil { - c := n.Child("fallback") - requiredCatalogModelServiceConfigFallbackConfig(w, &c, x) - } else if n.IsRef("fallback") { - c := n.Child("fallback") - requiredCatalogModelServiceConfigFallbackConfig(w, &c, nil) - } -} - -func requiredServingFallbackConfig(w *walker, n *walk.Node, v *serving.FallbackConfig) { - if v == nil { - w.missing(n, "enabled") - return - } - if !(v.Enabled || n.IsRef("enabled")) { - w.missing(n, "enabled") - } -} - -func requiredServingAiGatewayRateLimit(w *walker, n *walk.Node, v *serving.AiGatewayRateLimit) { - if v == nil { - w.missing(n, "renewal_period") - return - } - if !(v.RenewalPeriod != "" || walk.Forced(v.ForceSendFields, "RenewalPeriod")) { - w.missing(n, "renewal_period") - } -} - -func requiredServingServedEntityInput(w *walker, n *walk.Node, v *serving.ServedEntityInput) { - if v == nil { - return - } - if x := v.ExternalModel; x != nil { - c := n.Child("external_model") - requiredServingExternalModel(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ExternalModel") || n.IsRef("external_model") { - c := n.Child("external_model") - requiredServingExternalModel(w, &c, nil) - } -} - -func requiredServingServedModelInput(w *walker, n *walk.Node, v *serving.ServedModelInput) { - if v == nil { - w.missing(n, "model_name") - w.missing(n, "model_version") - w.missing(n, "scale_to_zero_enabled") - return - } - if !(v.ModelName != "" || walk.Forced(v.ForceSendFields, "ModelName")) { - w.missing(n, "model_name") - } - if !(v.ModelVersion != "" || walk.Forced(v.ForceSendFields, "ModelVersion")) { - w.missing(n, "model_version") - } - if !(v.ScaleToZeroEnabled || walk.Forced(v.ForceSendFields, "ScaleToZeroEnabled") || n.IsRef("scale_to_zero_enabled")) { - w.missing(n, "scale_to_zero_enabled") - } -} - -func requiredServingTrafficConfig(w *walker, n *walk.Node, v *serving.TrafficConfig) { - if v == nil { - return - } - if len(v.Routes) > 0 { - c := n.Child("routes") - for i := range v.Routes { - e := c.Elem(i) - requiredServingRoute(w, &e, &v.Routes[i]) - } - } -} - -func requiredPipelinesPipelineClusterAutoscale(w *walker, n *walk.Node, v *pipelines.PipelineClusterAutoscale) { - if v == nil { - w.missing(n, "max_workers") - w.missing(n, "min_workers") - return - } - if !(v.MaxWorkers != 0 || n.IsRef("max_workers")) { - w.missing(n, "max_workers") - } - if !(v.MinWorkers != 0 || n.IsRef("min_workers")) { - w.missing(n, "min_workers") - } -} - -func requiredPipelinesDataStagingOptions(w *walker, n *walk.Node, v *pipelines.DataStagingOptions) { - if v == nil { - w.missing(n, "catalog_name") - w.missing(n, "schema_name") - return - } - if !(v.CatalogName != "" || walk.Forced(v.ForceSendFields, "CatalogName")) { - w.missing(n, "catalog_name") - } - if !(v.SchemaName != "" || walk.Forced(v.ForceSendFields, "SchemaName")) { - w.missing(n, "schema_name") - } -} - -func requiredPipelinesOperationTimeWindow(w *walker, n *walk.Node, v *pipelines.OperationTimeWindow) { - if v == nil { - w.missing(n, "start_hour") - return - } - if !(v.StartHour != 0 || walk.Forced(v.ForceSendFields, "StartHour") || n.IsRef("start_hour")) { - w.missing(n, "start_hour") - } -} - -func requiredPipelinesIngestionConfig(w *walker, n *walk.Node, v *pipelines.IngestionConfig) { - if v == nil { - return - } - if x := v.Report; x != nil { - c := n.Child("report") - requiredPipelinesReportSpec(w, &c, x) - } else if n.IsRef("report") { - c := n.Child("report") - requiredPipelinesReportSpec(w, &c, nil) - } - if x := v.Schema; x != nil { - c := n.Child("schema") - requiredPipelinesSchemaSpec(w, &c, x) - } else if n.IsRef("schema") { - c := n.Child("schema") - requiredPipelinesSchemaSpec(w, &c, nil) - } - if x := v.Table; x != nil { - c := n.Child("table") - requiredPipelinesTableSpec(w, &c, x) - } else if n.IsRef("table") { - c := n.Child("table") - requiredPipelinesTableSpec(w, &c, nil) - } -} - -func requiredPipelinesTableSpecificConfig(w *walker, n *walk.Node, v *pipelines.TableSpecificConfig) { - if v == nil { - return - } - if x := v.AutoFullRefreshPolicy; x != nil { - c := n.Child("auto_full_refresh_policy") - requiredPipelinesAutoFullRefreshPolicy(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "AutoFullRefreshPolicy") || n.IsRef("auto_full_refresh_policy") { - c := n.Child("auto_full_refresh_policy") - requiredPipelinesAutoFullRefreshPolicy(w, &c, nil) - } -} - -func requiredPostgresMonthlySchedule(w *walker, n *walk.Node, v *postgres.MonthlySchedule) { - if v == nil { - w.missing(n, "day") - return - } - if !(v.Day != 0 || walk.Forced(v.ForceSendFields, "Day") || n.IsRef("day")) { - w.missing(n, "day") - } -} - -func requiredPostgresWeeklySchedule(w *walker, n *walk.Node, v *postgres.WeeklySchedule) { - if v == nil { - w.missing(n, "day_of_week") - return - } - if !(v.DayOfWeek != "" || walk.Forced(v.ForceSendFields, "DayOfWeek")) { - w.missing(n, "day_of_week") - } -} - -func requiredDatabaseSyncedTableSpecTypeOverride(w *walker, n *walk.Node, v *database.SyncedTableSpecTypeOverride) { - if v == nil { - w.missing(n, "column_name") - w.missing(n, "pg_type") - return - } - if !(v.ColumnName != "" || walk.Forced(v.ForceSendFields, "ColumnName")) { - w.missing(n, "column_name") - } - if !(v.PgType != "" || walk.Forced(v.ForceSendFields, "PgType")) { - w.missing(n, "pg_type") - } -} - -func requiredSqlAlertV2OperandColumn2(w *walker, n *walk.Node, v *sql.AlertV2OperandColumn) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.Name != "" || walk.Forced(v.ForceSendFields, "Name")) { - w.missing(n, "name") - } -} - -func requiredMlApproxCountDistinctFunction(w *walker, n *walk.Node, v *ml.ApproxCountDistinctFunction) { - if v == nil { - w.missing(n, "input") - return - } - if !(v.Input != "" || walk.Forced(v.ForceSendFields, "Input")) { - w.missing(n, "input") - } -} - -func requiredMlApproxPercentileFunction(w *walker, n *walk.Node, v *ml.ApproxPercentileFunction) { - if v == nil { - w.missing(n, "input") - w.missing(n, "percentile") - return - } - if !(v.Input != "" || walk.Forced(v.ForceSendFields, "Input")) { - w.missing(n, "input") - } - if !(v.Percentile != 0 || walk.Forced(v.ForceSendFields, "Percentile") || n.IsRef("percentile")) { - w.missing(n, "percentile") - } -} - -func requiredMlAvgFunction(w *walker, n *walk.Node, v *ml.AvgFunction) { - if v == nil { - w.missing(n, "input") - return - } - if !(v.Input != "") { - w.missing(n, "input") - } -} - -func requiredMlCountFunction(w *walker, n *walk.Node, v *ml.CountFunction) { - if v == nil { - w.missing(n, "input") - return - } - if !(v.Input != "") { - w.missing(n, "input") - } -} - -func requiredMlFirstFunction(w *walker, n *walk.Node, v *ml.FirstFunction) { - if v == nil { - w.missing(n, "input") - return - } - if !(v.Input != "") { - w.missing(n, "input") - } -} - -func requiredMlFirstDistinctFunction(w *walker, n *walk.Node, v *ml.FirstDistinctFunction) { - if v == nil { - w.missing(n, "input") - w.missing(n, "n") - return - } - if !(v.Input != "") { - w.missing(n, "input") - } - if !(v.N != 0 || n.IsRef("n")) { - w.missing(n, "n") - } -} - -func requiredMlFirstNFunction(w *walker, n *walk.Node, v *ml.FirstNFunction) { - if v == nil { - w.missing(n, "input") - w.missing(n, "n") - return - } - if !(v.Input != "") { - w.missing(n, "input") - } - if !(v.N != 0 || n.IsRef("n")) { - w.missing(n, "n") - } -} - -func requiredMlLastFunction(w *walker, n *walk.Node, v *ml.LastFunction) { - if v == nil { - w.missing(n, "input") - return - } - if !(v.Input != "") { - w.missing(n, "input") - } -} - -func requiredMlLastDistinctFunction(w *walker, n *walk.Node, v *ml.LastDistinctFunction) { - if v == nil { - w.missing(n, "input") - w.missing(n, "n") - return - } - if !(v.Input != "") { - w.missing(n, "input") - } - if !(v.N != 0 || n.IsRef("n")) { - w.missing(n, "n") - } -} - -func requiredMlLastNFunction(w *walker, n *walk.Node, v *ml.LastNFunction) { - if v == nil { - w.missing(n, "input") - w.missing(n, "n") - return - } - if !(v.Input != "") { - w.missing(n, "input") - } - if !(v.N != 0 || n.IsRef("n")) { - w.missing(n, "n") - } -} - -func requiredMlMaxFunction(w *walker, n *walk.Node, v *ml.MaxFunction) { - if v == nil { - w.missing(n, "input") - return - } - if !(v.Input != "") { - w.missing(n, "input") - } -} - -func requiredMlMinFunction(w *walker, n *walk.Node, v *ml.MinFunction) { - if v == nil { - w.missing(n, "input") - return - } - if !(v.Input != "") { - w.missing(n, "input") - } -} - -func requiredMlStddevPopFunction(w *walker, n *walk.Node, v *ml.StddevPopFunction) { - if v == nil { - w.missing(n, "input") - return - } - if !(v.Input != "") { - w.missing(n, "input") - } -} - -func requiredMlStddevSampFunction(w *walker, n *walk.Node, v *ml.StddevSampFunction) { - if v == nil { - w.missing(n, "input") - return - } - if !(v.Input != "") { - w.missing(n, "input") - } -} - -func requiredMlSumFunction(w *walker, n *walk.Node, v *ml.SumFunction) { - if v == nil { - w.missing(n, "input") - return - } - if !(v.Input != "") { - w.missing(n, "input") - } -} - -func requiredMlVarPopFunction(w *walker, n *walk.Node, v *ml.VarPopFunction) { - if v == nil { - w.missing(n, "input") - return - } - if !(v.Input != "") { - w.missing(n, "input") - } -} - -func requiredMlVarSampFunction(w *walker, n *walk.Node, v *ml.VarSampFunction) { - if v == nil { - w.missing(n, "input") - return - } - if !(v.Input != "") { - w.missing(n, "input") - } -} - -func requiredMlInputBinding(w *walker, n *walk.Node, v *ml.InputBinding) { - if v == nil { - w.missing(n, "column") - w.missing(n, "parameter") - return - } - if !(v.Column != "") { - w.missing(n, "column") - } - if !(v.Parameter != "") { - w.missing(n, "parameter") - } -} - -func requiredMlFeatureReference(w *walker, n *walk.Node, v *ml.FeatureReference) { - if v == nil { - w.missing(n, "feature") - return - } - if !(v.Feature != "") { - w.missing(n, "feature") - } -} - -func requiredMlColumnIdentifier(w *walker, n *walk.Node, v *ml.ColumnIdentifier) { - if v == nil { - w.missing(n, "variant_expr_path") - return - } - if !(v.VariantExprPath != "") { - w.missing(n, "variant_expr_path") - } -} - -func requiredMlColumnIdentifier2(w *walker, n *walk.Node, v *ml.ColumnIdentifier) { - if v == nil { - w.missing(n, "variant_expr_path") - return - } - if !(v.VariantExprPath != "") { - w.missing(n, "variant_expr_path") - } -} - -func requiredMlFlatSchema(w *walker, n *walk.Node, v *ml.FlatSchema) { - if v == nil { - w.missing(n, "fields") - return - } - if !(v.Fields != nil || n.IsRef("fields")) { - w.missing(n, "fields") - } - if len(v.Fields) > 0 { - c := n.Child("fields") - for i := range v.Fields { - e := c.Elem(i) - requiredMlFieldDefinition(w, &e, &v.Fields[i]) - } - } -} - -func requiredJobsDeploymentSpec(w *walker, n *walk.Node, v *jobs.DeploymentSpec) { - if v == nil { - w.missing(n, "compute") - return - } - if !(!walk.IsZeroStruct(&v.Compute) || walk.Forced(v.ForceSendFields, "Compute") || n.HasRefs("compute")) { - w.missing(n, "compute") - } - if x := &v.Compute; !walk.IsZeroStruct(x) || walk.Forced(v.ForceSendFields, "Compute") || n.HasRefs("compute") { - c := n.Child("compute") - requiredJobsComputeSpec(w, &c, x) - } -} - -func requiredJobsSubscription(w *walker, n *walk.Node, v *jobs.Subscription) { - if v == nil { - return - } - if x := v.Attachment; x != nil { - c := n.Child("attachment") - requiredJobsSubscriptionAttachment(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Attachment") || n.IsRef("attachment") { - c := n.Child("attachment") - requiredJobsSubscriptionAttachment(w, &c, nil) - } -} - -func requiredJobsTask2(w *walker, n *walk.Node, v *jobs.Task) { - if v == nil { - w.missing(n, "task_key") - return - } - if !(v.TaskKey != "" || walk.Forced(v.ForceSendFields, "TaskKey")) { - w.missing(n, "task_key") - } - if x := v.AiRuntimeTask; x != nil { - c := n.Child("ai_runtime_task") - requiredJobsAiRuntimeTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "AiRuntimeTask") || n.IsRef("ai_runtime_task") { - c := n.Child("ai_runtime_task") - requiredJobsAiRuntimeTask(w, &c, nil) - } - if x := v.CleanRoomsNotebookTask; x != nil { - c := n.Child("clean_rooms_notebook_task") - requiredJobsCleanRoomsNotebookTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "CleanRoomsNotebookTask") || n.IsRef("clean_rooms_notebook_task") { - c := n.Child("clean_rooms_notebook_task") - requiredJobsCleanRoomsNotebookTask(w, &c, nil) - } - if x := v.ConditionTask; x != nil { - c := n.Child("condition_task") - requiredJobsConditionTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ConditionTask") || n.IsRef("condition_task") { - c := n.Child("condition_task") - requiredJobsConditionTask(w, &c, nil) - } - if x := v.DashboardTask; x != nil { - c := n.Child("dashboard_task") - requiredJobsDashboardTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "DashboardTask") || n.IsRef("dashboard_task") { - c := n.Child("dashboard_task") - requiredJobsDashboardTask(w, &c, nil) - } - if x := v.DbtTask; x != nil { - c := n.Child("dbt_task") - requiredJobsDbtTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "DbtTask") || n.IsRef("dbt_task") { - c := n.Child("dbt_task") - requiredJobsDbtTask(w, &c, nil) - } - if len(v.DependsOn) > 0 { - c := n.Child("depends_on") - for i := range v.DependsOn { - e := c.Elem(i) - requiredJobsTaskDependency(w, &e, &v.DependsOn[i]) - } - } - if x := v.ForEachTask; x != nil { - c := n.Child("for_each_task") - requiredJobsForEachTask2(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ForEachTask") || n.IsRef("for_each_task") { - c := n.Child("for_each_task") - requiredJobsForEachTask2(w, &c, nil) - } - if x := v.GenAiComputeTask; x != nil { - c := n.Child("gen_ai_compute_task") - requiredJobsGenAiComputeTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "GenAiComputeTask") || n.IsRef("gen_ai_compute_task") { - c := n.Child("gen_ai_compute_task") - requiredJobsGenAiComputeTask(w, &c, nil) - } - if x := v.Health; x != nil { - c := n.Child("health") - requiredJobsJobsHealthRules(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "Health") || n.IsRef("health") { - c := n.Child("health") - requiredJobsJobsHealthRules(w, &c, nil) - } - if len(v.Libraries) > 0 { - c := n.Child("libraries") - for i := range v.Libraries { - e := c.Elem(i) - requiredComputeLibrary(w, &e, &v.Libraries[i]) - } - } - if x := v.NewCluster; x != nil { - c := n.Child("new_cluster") - requiredComputeClusterSpec(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "NewCluster") || n.IsRef("new_cluster") { - c := n.Child("new_cluster") - requiredComputeClusterSpec(w, &c, nil) - } - if x := v.NotebookTask; x != nil { - c := n.Child("notebook_task") - requiredJobsNotebookTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "NotebookTask") || n.IsRef("notebook_task") { - c := n.Child("notebook_task") - requiredJobsNotebookTask(w, &c, nil) - } - if x := v.PipelineTask; x != nil { - c := n.Child("pipeline_task") - requiredJobsPipelineTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "PipelineTask") || n.IsRef("pipeline_task") { - c := n.Child("pipeline_task") - requiredJobsPipelineTask(w, &c, nil) - } - if x := v.PythonWheelTask; x != nil { - c := n.Child("python_wheel_task") - requiredJobsPythonWheelTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "PythonWheelTask") || n.IsRef("python_wheel_task") { - c := n.Child("python_wheel_task") - requiredJobsPythonWheelTask(w, &c, nil) - } - if x := v.RunJobTask; x != nil { - c := n.Child("run_job_task") - requiredJobsRunJobTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "RunJobTask") || n.IsRef("run_job_task") { - c := n.Child("run_job_task") - requiredJobsRunJobTask(w, &c, nil) - } - if x := v.SparkPythonTask; x != nil { - c := n.Child("spark_python_task") - requiredJobsSparkPythonTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "SparkPythonTask") || n.IsRef("spark_python_task") { - c := n.Child("spark_python_task") - requiredJobsSparkPythonTask(w, &c, nil) - } - if x := v.SqlTask; x != nil { - c := n.Child("sql_task") - requiredJobsSqlTask(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "SqlTask") || n.IsRef("sql_task") { - c := n.Child("sql_task") - requiredJobsSqlTask(w, &c, nil) - } - if x := v.WebhookNotifications; x != nil { - c := n.Child("webhook_notifications") - requiredJobsWebhookNotifications(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "WebhookNotifications") || n.IsRef("webhook_notifications") { - c := n.Child("webhook_notifications") - requiredJobsWebhookNotifications(w, &c, nil) - } -} - -func requiredJobsComputeConfig(w *walker, n *walk.Node, v *jobs.ComputeConfig) { - if v == nil { - w.missing(n, "num_gpus") - return - } - if !(v.NumGpus != 0 || walk.Forced(v.ForceSendFields, "NumGpus") || n.IsRef("num_gpus")) { - w.missing(n, "num_gpus") - } -} - -func requiredJobsSqlTaskAlert(w *walker, n *walk.Node, v *jobs.SqlTaskAlert) { - if v == nil { - w.missing(n, "alert_id") - return - } - if !(v.AlertId != "" || walk.Forced(v.ForceSendFields, "AlertId")) { - w.missing(n, "alert_id") - } -} - -func requiredJobsSqlTaskDashboard(w *walker, n *walk.Node, v *jobs.SqlTaskDashboard) { - if v == nil { - w.missing(n, "dashboard_id") - return - } - if !(v.DashboardId != "" || walk.Forced(v.ForceSendFields, "DashboardId")) { - w.missing(n, "dashboard_id") - } -} - -func requiredJobsSqlTaskFile(w *walker, n *walk.Node, v *jobs.SqlTaskFile) { - if v == nil { - w.missing(n, "path") - return - } - if !(v.Path != "") { - w.missing(n, "path") - } -} - -func requiredJobsSqlTaskQuery(w *walker, n *walk.Node, v *jobs.SqlTaskQuery) { - if v == nil { - w.missing(n, "query_id") - return - } - if !(v.QueryId != "") { - w.missing(n, "query_id") - } -} - -func requiredCatalogModelProviderServiceConfigAmazonBedrockProviderDirectConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigAmazonBedrockProviderDirectConfig) { - if v == nil { - return - } - if x := v.AwsAccessKey; x != nil { - c := n.Child("aws_access_key") - requiredCatalogModelProviderServiceConfigAwsAccessKey(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "AwsAccessKey") || n.IsRef("aws_access_key") { - c := n.Child("aws_access_key") - requiredCatalogModelProviderServiceConfigAwsAccessKey(w, &c, nil) - } - if x := v.ServiceCredential; x != nil { - c := n.Child("service_credential") - requiredCatalogModelProviderServiceConfigServiceCredential(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ServiceCredential") || n.IsRef("service_credential") { - c := n.Child("service_credential") - requiredCatalogModelProviderServiceConfigServiceCredential(w, &c, nil) - } -} - -func requiredCatalogModelProviderServiceConfigAnthropicProviderDirectConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigAnthropicProviderDirectConfig) { - if v == nil { - return - } - if x := v.ApiKey; x != nil { - c := n.Child("api_key") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, x) - } else if n.IsRef("api_key") { - c := n.Child("api_key") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, nil) - } -} - -func requiredCatalogModelProviderServiceConfigAzureOpenAiProviderDirectConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigAzureOpenAiProviderDirectConfig) { - if v == nil { - return - } - if x := v.ApiKey; x != nil { - c := n.Child("api_key") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ApiKey") || n.IsRef("api_key") { - c := n.Child("api_key") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, nil) - } - if x := v.EntraServicePrincipal; x != nil { - c := n.Child("entra_service_principal") - requiredCatalogModelProviderServiceConfigEntraServicePrincipal(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "EntraServicePrincipal") || n.IsRef("entra_service_principal") { - c := n.Child("entra_service_principal") - requiredCatalogModelProviderServiceConfigEntraServicePrincipal(w, &c, nil) - } - if x := v.ServiceCredential; x != nil { - c := n.Child("service_credential") - requiredCatalogModelProviderServiceConfigServiceCredential(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ServiceCredential") || n.IsRef("service_credential") { - c := n.Child("service_credential") - requiredCatalogModelProviderServiceConfigServiceCredential(w, &c, nil) - } -} - -func requiredCatalogModelProviderServiceConfigCustomProviderDirectConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigCustomProviderDirectConfig) { - if v == nil { - return - } - if x := v.ApiKey; x != nil { - c := n.Child("api_key") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ApiKey") || n.IsRef("api_key") { - c := n.Child("api_key") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, nil) - } - if x := v.HeaderAuth; x != nil { - c := n.Child("header_auth") - requiredCatalogModelProviderServiceConfigCustomProviderApiKeyHeaderAuth(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "HeaderAuth") || n.IsRef("header_auth") { - c := n.Child("header_auth") - requiredCatalogModelProviderServiceConfigCustomProviderApiKeyHeaderAuth(w, &c, nil) - } -} - -func requiredCatalogModelProviderServiceConfigGeminiEnterpriseProviderDirectConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigGeminiEnterpriseProviderDirectConfig) { - if v == nil { - return - } - if x := v.ApiKey; x != nil { - c := n.Child("api_key") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ApiKey") || n.IsRef("api_key") { - c := n.Child("api_key") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, nil) - } - if x := v.ServiceCredential; x != nil { - c := n.Child("service_credential") - requiredCatalogModelProviderServiceConfigServiceCredential(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ServiceCredential") || n.IsRef("service_credential") { - c := n.Child("service_credential") - requiredCatalogModelProviderServiceConfigServiceCredential(w, &c, nil) - } -} - -func requiredCatalogModelProviderServiceConfigMicrosoftFoundryProviderDirectConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigMicrosoftFoundryProviderDirectConfig) { - if v == nil { - return - } - if x := v.ApiKey; x != nil { - c := n.Child("api_key") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ApiKey") || n.IsRef("api_key") { - c := n.Child("api_key") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, nil) - } - if x := v.EntraServicePrincipal; x != nil { - c := n.Child("entra_service_principal") - requiredCatalogModelProviderServiceConfigEntraServicePrincipal(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "EntraServicePrincipal") || n.IsRef("entra_service_principal") { - c := n.Child("entra_service_principal") - requiredCatalogModelProviderServiceConfigEntraServicePrincipal(w, &c, nil) - } - if x := v.ServiceCredential; x != nil { - c := n.Child("service_credential") - requiredCatalogModelProviderServiceConfigServiceCredential(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ServiceCredential") || n.IsRef("service_credential") { - c := n.Child("service_credential") - requiredCatalogModelProviderServiceConfigServiceCredential(w, &c, nil) - } -} - -func requiredCatalogModelProviderServiceConfigOpenAiProviderDirectConfig(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigOpenAiProviderDirectConfig) { - if v == nil { - return - } - if x := v.ApiKey; x != nil { - c := n.Child("api_key") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ApiKey") || n.IsRef("api_key") { - c := n.Child("api_key") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, nil) - } -} - -func requiredCatalogModelServiceConfigDestinationConfig(w *walker, n *walk.Node, v *catalog.ModelServiceConfigDestinationConfig) { - if v == nil { - w.missing(n, "destination_type") - w.missing(n, "name") - return - } - if !(v.DestinationType != "" || walk.Forced(v.ForceSendFields, "DestinationType")) { - w.missing(n, "destination_type") - } - if !(v.Name != "" || walk.Forced(v.ForceSendFields, "Name")) { - w.missing(n, "name") - } - if x := v.ExternalModelConfig; x != nil { - c := n.Child("external_model_config") - requiredCatalogModelServiceConfigExternalModelConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ExternalModelConfig") || n.IsRef("external_model_config") { - c := n.Child("external_model_config") - requiredCatalogModelServiceConfigExternalModelConfig(w, &c, nil) - } - if x := v.PayPerTokenConfig; x != nil { - c := n.Child("pay_per_token_config") - requiredCatalogModelServiceConfigPayPerTokenConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "PayPerTokenConfig") || n.IsRef("pay_per_token_config") { - c := n.Child("pay_per_token_config") - requiredCatalogModelServiceConfigPayPerTokenConfig(w, &c, nil) - } - if x := v.ProvisionedThroughputConfig; x != nil { - c := n.Child("provisioned_throughput_config") - requiredCatalogModelServiceConfigProvisionedThroughputConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ProvisionedThroughputConfig") || n.IsRef("provisioned_throughput_config") { - c := n.Child("provisioned_throughput_config") - requiredCatalogModelServiceConfigProvisionedThroughputConfig(w, &c, nil) - } -} - -func requiredCatalogModelServiceConfigFallbackConfig(w *walker, n *walk.Node, v *catalog.ModelServiceConfigFallbackConfig) { - if v == nil { - return - } - if len(v.Destinations) > 0 { - c := n.Child("destinations") - for i := range v.Destinations { - e := c.Elem(i) - requiredCatalogModelServiceConfigDestinationConfig(w, &e, &v.Destinations[i]) - } - } -} - -func requiredServingExternalModel(w *walker, n *walk.Node, v *serving.ExternalModel) { - if v == nil { - w.missing(n, "name") - w.missing(n, "provider") - w.missing(n, "task") - return - } - if !(v.Name != "") { - w.missing(n, "name") - } - if !(v.Provider != "") { - w.missing(n, "provider") - } - if !(v.Task != "") { - w.missing(n, "task") - } - if x := v.AmazonBedrockConfig; x != nil { - c := n.Child("amazon_bedrock_config") - requiredServingAmazonBedrockConfig(w, &c, x) - } else if n.IsRef("amazon_bedrock_config") { - c := n.Child("amazon_bedrock_config") - requiredServingAmazonBedrockConfig(w, &c, nil) - } - if x := v.CustomProviderConfig; x != nil { - c := n.Child("custom_provider_config") - requiredServingCustomProviderConfig(w, &c, x) - } else if n.IsRef("custom_provider_config") { - c := n.Child("custom_provider_config") - requiredServingCustomProviderConfig(w, &c, nil) - } - if x := v.DatabricksModelServingConfig; x != nil { - c := n.Child("databricks_model_serving_config") - requiredServingDatabricksModelServingConfig(w, &c, x) - } else if n.IsRef("databricks_model_serving_config") { - c := n.Child("databricks_model_serving_config") - requiredServingDatabricksModelServingConfig(w, &c, nil) - } - if x := v.GoogleCloudVertexAiConfig; x != nil { - c := n.Child("google_cloud_vertex_ai_config") - requiredServingGoogleCloudVertexAiConfig(w, &c, x) - } else if n.IsRef("google_cloud_vertex_ai_config") { - c := n.Child("google_cloud_vertex_ai_config") - requiredServingGoogleCloudVertexAiConfig(w, &c, nil) - } -} - -func requiredServingRoute(w *walker, n *walk.Node, v *serving.Route) { - if v == nil { - w.missing(n, "traffic_percentage") - return - } - if !(v.TrafficPercentage != 0 || walk.Forced(v.ForceSendFields, "TrafficPercentage") || n.IsRef("traffic_percentage")) { - w.missing(n, "traffic_percentage") - } -} - -func requiredPipelinesReportSpec(w *walker, n *walk.Node, v *pipelines.ReportSpec) { - if v == nil { - w.missing(n, "destination_catalog") - w.missing(n, "destination_schema") - w.missing(n, "source_url") - return - } - if !(v.DestinationCatalog != "" || walk.Forced(v.ForceSendFields, "DestinationCatalog")) { - w.missing(n, "destination_catalog") - } - if !(v.DestinationSchema != "" || walk.Forced(v.ForceSendFields, "DestinationSchema")) { - w.missing(n, "destination_schema") - } - if !(v.SourceUrl != "" || walk.Forced(v.ForceSendFields, "SourceUrl")) { - w.missing(n, "source_url") - } - if x := v.TableConfiguration; x != nil { - c := n.Child("table_configuration") - requiredPipelinesTableSpecificConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "TableConfiguration") || n.IsRef("table_configuration") { - c := n.Child("table_configuration") - requiredPipelinesTableSpecificConfig(w, &c, nil) - } -} - -func requiredPipelinesSchemaSpec(w *walker, n *walk.Node, v *pipelines.SchemaSpec) { - if v == nil { - w.missing(n, "destination_catalog") - w.missing(n, "destination_schema") - return - } - if !(v.DestinationCatalog != "" || walk.Forced(v.ForceSendFields, "DestinationCatalog")) { - w.missing(n, "destination_catalog") - } - if !(v.DestinationSchema != "" || walk.Forced(v.ForceSendFields, "DestinationSchema")) { - w.missing(n, "destination_schema") - } - if x := v.ConnectorOptions; x != nil { - c := n.Child("connector_options") - requiredPipelinesConnectorOptions(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ConnectorOptions") || n.IsRef("connector_options") { - c := n.Child("connector_options") - requiredPipelinesConnectorOptions(w, &c, nil) - } - if x := v.TableConfiguration; x != nil { - c := n.Child("table_configuration") - requiredPipelinesTableSpecificConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "TableConfiguration") || n.IsRef("table_configuration") { - c := n.Child("table_configuration") - requiredPipelinesTableSpecificConfig(w, &c, nil) - } -} - -func requiredPipelinesTableSpec(w *walker, n *walk.Node, v *pipelines.TableSpec) { - if v == nil { - w.missing(n, "destination_catalog") - w.missing(n, "destination_schema") - return - } - if !(v.DestinationCatalog != "" || walk.Forced(v.ForceSendFields, "DestinationCatalog")) { - w.missing(n, "destination_catalog") - } - if !(v.DestinationSchema != "" || walk.Forced(v.ForceSendFields, "DestinationSchema")) { - w.missing(n, "destination_schema") - } - if x := v.ConnectorOptions; x != nil { - c := n.Child("connector_options") - requiredPipelinesConnectorOptions(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ConnectorOptions") || n.IsRef("connector_options") { - c := n.Child("connector_options") - requiredPipelinesConnectorOptions(w, &c, nil) - } - if x := v.TableConfiguration; x != nil { - c := n.Child("table_configuration") - requiredPipelinesTableSpecificConfig(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "TableConfiguration") || n.IsRef("table_configuration") { - c := n.Child("table_configuration") - requiredPipelinesTableSpecificConfig(w, &c, nil) - } -} - -func requiredPipelinesAutoFullRefreshPolicy(w *walker, n *walk.Node, v *pipelines.AutoFullRefreshPolicy) { - if v == nil { - w.missing(n, "enabled") - return - } - if !(v.Enabled || walk.Forced(v.ForceSendFields, "Enabled") || n.IsRef("enabled")) { - w.missing(n, "enabled") - } -} - -func requiredMlFieldDefinition(w *walker, n *walk.Node, v *ml.FieldDefinition) { - if v == nil { - w.missing(n, "data_type") - w.missing(n, "name") - return - } - if !(v.DataType != "") { - w.missing(n, "data_type") - } - if !(v.Name != "") { - w.missing(n, "name") - } -} - -func requiredJobsComputeSpec(w *walker, n *walk.Node, v *jobs.ComputeSpec) { - if v == nil { - w.missing(n, "accelerator_count") - w.missing(n, "accelerator_type") - return - } - if !(v.AcceleratorCount != 0 || walk.Forced(v.ForceSendFields, "AcceleratorCount") || n.IsRef("accelerator_count")) { - w.missing(n, "accelerator_count") - } - if !(v.AcceleratorType != "" || walk.Forced(v.ForceSendFields, "AcceleratorType")) { - w.missing(n, "accelerator_type") - } -} - -func requiredJobsSubscriptionAttachment(w *walker, n *walk.Node, v *jobs.SubscriptionAttachment) { - if v == nil { - return - } - if x := v.DataAttachment; x != nil { - c := n.Child("data_attachment") - requiredJobsSubscriptionAttachmentDataAttachment(w, &c, x) - } else if n.IsRef("data_attachment") { - c := n.Child("data_attachment") - requiredJobsSubscriptionAttachmentDataAttachment(w, &c, nil) - } -} - -func requiredJobsForEachTask2(w *walker, n *walk.Node, v *jobs.ForEachTask) { - if v == nil { - w.missing(n, "inputs") - w.missing(n, "task") - return - } - if !(v.Inputs != "" || walk.Forced(v.ForceSendFields, "Inputs")) { - w.missing(n, "inputs") - } - if !(!walk.IsZeroStruct(&v.Task) || walk.Forced(v.ForceSendFields, "Task") || n.HasRefs("task")) { - w.missing(n, "task") - } -} - -func requiredCatalogModelProviderServiceConfigAwsAccessKey(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigAwsAccessKey) { - if v == nil { - return - } - if x := v.SecretAccessKey; x != nil { - c := n.Child("secret_access_key") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "SecretAccessKey") || n.IsRef("secret_access_key") { - c := n.Child("secret_access_key") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, nil) - } -} - -func requiredCatalogModelProviderServiceConfigServiceCredential(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigServiceCredential) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.Name != "") { - w.missing(n, "name") - } -} - -func requiredCatalogModelProviderServiceConfigProviderSecret(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigProviderSecret) { - if v == nil { - return - } - if x := v.SecretReference; x != nil { - c := n.Child("secret_reference") - requiredCatalogModelProviderServiceConfigSecretReference(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "SecretReference") || n.IsRef("secret_reference") { - c := n.Child("secret_reference") - requiredCatalogModelProviderServiceConfigSecretReference(w, &c, nil) - } -} - -func requiredCatalogModelProviderServiceConfigEntraServicePrincipal(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigEntraServicePrincipal) { - if v == nil { - return - } - if x := v.ClientSecret; x != nil { - c := n.Child("client_secret") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ClientSecret") || n.IsRef("client_secret") { - c := n.Child("client_secret") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, nil) - } -} - -func requiredCatalogModelProviderServiceConfigCustomProviderApiKeyHeaderAuth(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigCustomProviderApiKeyHeaderAuth) { - if v == nil { - return - } - if x := v.ApiKeyValue; x != nil { - c := n.Child("api_key_value") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "ApiKeyValue") || n.IsRef("api_key_value") { - c := n.Child("api_key_value") - requiredCatalogModelProviderServiceConfigProviderSecret(w, &c, nil) - } -} - -func requiredCatalogModelServiceConfigExternalModelConfig(w *walker, n *walk.Node, v *catalog.ModelServiceConfigExternalModelConfig) { - if v == nil { - w.missing(n, "model_provider_service") - w.missing(n, "target") - return - } - if !(v.ModelProviderService != "") { - w.missing(n, "model_provider_service") - } - if !(!walk.IsZeroStruct(&v.Target) || n.HasRefs("target")) { - w.missing(n, "target") - } - if x := &v.Target; !walk.IsZeroStruct(x) || n.HasRefs("target") { - c := n.Child("target") - requiredCatalogModelProviderServiceConfigModelTargetConfig(w, &c, x) - } -} - -func requiredCatalogModelServiceConfigPayPerTokenConfig(w *walker, n *walk.Node, v *catalog.ModelServiceConfigPayPerTokenConfig) { - if v == nil { - w.missing(n, "model") - return - } - if !(v.Model != "") { - w.missing(n, "model") - } -} - -func requiredCatalogModelServiceConfigProvisionedThroughputConfig(w *walker, n *walk.Node, v *catalog.ModelServiceConfigProvisionedThroughputConfig) { - if v == nil { - w.missing(n, "model_serving_endpoint") - return - } - if !(v.ModelServingEndpoint != "" || walk.Forced(v.ForceSendFields, "ModelServingEndpoint")) { - w.missing(n, "model_serving_endpoint") - } -} - -func requiredServingAmazonBedrockConfig(w *walker, n *walk.Node, v *serving.AmazonBedrockConfig) { - if v == nil { - w.missing(n, "aws_region") - w.missing(n, "bedrock_provider") - return - } - if !(v.AwsRegion != "" || walk.Forced(v.ForceSendFields, "AwsRegion")) { - w.missing(n, "aws_region") - } - if !(v.BedrockProvider != "" || walk.Forced(v.ForceSendFields, "BedrockProvider")) { - w.missing(n, "bedrock_provider") - } -} - -func requiredServingCustomProviderConfig(w *walker, n *walk.Node, v *serving.CustomProviderConfig) { - if v == nil { - w.missing(n, "custom_provider_url") - return - } - if !(v.CustomProviderUrl != "") { - w.missing(n, "custom_provider_url") - } - if x := v.ApiKeyAuth; x != nil { - c := n.Child("api_key_auth") - requiredServingApiKeyAuth(w, &c, x) - } else if n.IsRef("api_key_auth") { - c := n.Child("api_key_auth") - requiredServingApiKeyAuth(w, &c, nil) - } -} - -func requiredServingDatabricksModelServingConfig(w *walker, n *walk.Node, v *serving.DatabricksModelServingConfig) { - if v == nil { - w.missing(n, "databricks_workspace_url") - return - } - if !(v.DatabricksWorkspaceUrl != "" || walk.Forced(v.ForceSendFields, "DatabricksWorkspaceUrl")) { - w.missing(n, "databricks_workspace_url") - } -} - -func requiredServingGoogleCloudVertexAiConfig(w *walker, n *walk.Node, v *serving.GoogleCloudVertexAiConfig) { - if v == nil { - w.missing(n, "project_id") - w.missing(n, "region") - return - } - if !(v.ProjectId != "" || walk.Forced(v.ForceSendFields, "ProjectId")) { - w.missing(n, "project_id") - } - if !(v.Region != "" || walk.Forced(v.ForceSendFields, "Region")) { - w.missing(n, "region") - } -} - -func requiredPipelinesConnectorOptions(w *walker, n *walk.Node, v *pipelines.ConnectorOptions) { - if v == nil { - return - } - if x := v.GoogleAdsOptions; x != nil { - c := n.Child("google_ads_options") - requiredPipelinesGoogleAdsOptions(w, &c, x) - } else if n.IsRef("google_ads_options") { - c := n.Child("google_ads_options") - requiredPipelinesGoogleAdsOptions(w, &c, nil) - } - if x := v.LinkedinAdsOptions; x != nil { - c := n.Child("linkedin_ads_options") - requiredPipelinesLinkedInAdsOptions(w, &c, x) - } else if n.IsRef("linkedin_ads_options") { - c := n.Child("linkedin_ads_options") - requiredPipelinesLinkedInAdsOptions(w, &c, nil) - } - if x := v.RabbitmqOptions; x != nil { - c := n.Child("rabbitmq_options") - requiredPipelinesRabbitmqOptions(w, &c, x) - } else if n.IsRef("rabbitmq_options") { - c := n.Child("rabbitmq_options") - requiredPipelinesRabbitmqOptions(w, &c, nil) - } -} - -func requiredJobsSubscriptionAttachmentDataAttachment(w *walker, n *walk.Node, v *jobs.SubscriptionAttachmentDataAttachment) { - if v == nil { - w.missing(n, "file_format") - w.missing(n, "widgets") - return - } - if !(v.FileFormat != "" || walk.Forced(v.ForceSendFields, "FileFormat")) { - w.missing(n, "file_format") - } - if !(v.Widgets != nil || n.IsRef("widgets")) { - w.missing(n, "widgets") - } - if len(v.Widgets) > 0 { - c := n.Child("widgets") - for i := range v.Widgets { - e := c.Elem(i) - requiredJobsSubscriptionAttachmentDataAttachmentWidget(w, &e, &v.Widgets[i]) - } - } -} - -func requiredCatalogModelProviderServiceConfigSecretReference(w *walker, n *walk.Node, v *catalog.ModelProviderServiceConfigSecretReference) { - if v == nil { - w.missing(n, "name") - return - } - if !(v.Name != "") { - w.missing(n, "name") - } -} - -func requiredServingApiKeyAuth(w *walker, n *walk.Node, v *serving.ApiKeyAuth) { - if v == nil { - w.missing(n, "key") - return - } - if !(v.Key != "" || walk.Forced(v.ForceSendFields, "Key")) { - w.missing(n, "key") - } -} - -func requiredPipelinesGoogleAdsOptions(w *walker, n *walk.Node, v *pipelines.GoogleAdsOptions) { - if v == nil { - w.missing(n, "manager_account_id") - return - } - if !(v.ManagerAccountId != "" || walk.Forced(v.ForceSendFields, "ManagerAccountId")) { - w.missing(n, "manager_account_id") - } - if x := v.CustomReportOptions; x != nil { - c := n.Child("custom_report_options") - requiredPipelinesGoogleAdsCustomReportOptions(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "CustomReportOptions") || n.IsRef("custom_report_options") { - c := n.Child("custom_report_options") - requiredPipelinesGoogleAdsCustomReportOptions(w, &c, nil) - } -} - -func requiredPipelinesLinkedInAdsOptions(w *walker, n *walk.Node, v *pipelines.LinkedInAdsOptions) { - if v == nil { - return - } - if x := v.CustomReportOptions; x != nil { - c := n.Child("custom_report_options") - requiredPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptions(w, &c, x) - } else if walk.Forced(v.ForceSendFields, "CustomReportOptions") || n.IsRef("custom_report_options") { - c := n.Child("custom_report_options") - requiredPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptions(w, &c, nil) - } -} - -func requiredPipelinesRabbitmqOptions(w *walker, n *walk.Node, v *pipelines.RabbitmqOptions) { - if v == nil { - w.missing(n, "queue") - return - } - if !(v.Queue != "") { - w.missing(n, "queue") - } -} - -func requiredJobsSubscriptionAttachmentDataAttachmentWidget(w *walker, n *walk.Node, v *jobs.SubscriptionAttachmentDataAttachmentWidget) { - if v == nil { - w.missing(n, "page_id") - w.missing(n, "widget_id") - return - } - if !(v.PageId != "") { - w.missing(n, "page_id") - } - if !(v.WidgetId != "") { - w.missing(n, "widget_id") - } -} - -func requiredPipelinesGoogleAdsCustomReportOptions(w *walker, n *walk.Node, v *pipelines.GoogleAdsCustomReportOptions) { - if v == nil { - w.missing(n, "resource") - return - } - if !(v.Resource != "") { - w.missing(n, "resource") - } -} - -func requiredPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptions(w *walker, n *walk.Node, v *pipelines.LinkedInAdsOptionsLinkedInAdsCustomReportOptions) { - if v == nil { - w.missing(n, "finder") - return - } - if !(v.Finder != "") { - w.missing(n, "finder") - } -} diff --git a/bundle/config/validate/walk_node.go b/bundle/config/validate/walk_node.go index 756263f564e..7b4f593fa49 100644 --- a/bundle/config/validate/walk_node.go +++ b/bundle/config/validate/walk_node.go @@ -4,7 +4,6 @@ import ( "fmt" "slices" - "github.com/databricks/cli/bundle/config" "github.com/databricks/cli/bundle/config/walk" "github.com/databricks/cli/libs/diag" "github.com/databricks/cli/libs/structs/structpath" @@ -17,18 +16,6 @@ type walker struct { diags diag.Diagnostics } -// walkConfig runs the generated walker fn over the configuration of root; refs makes -// the nodes follow the pure references. -func walkConfig(root *config.Root, refs bool, fn func(*walker, *walk.Node, *config.Root)) diag.Diagnostics { - w := &walker{} - n := walk.Root(root) - if refs { - n = walk.RootWithReferences(root) - } - fn(w, &n, root) - return w.diags -} - // missing reports that the required field of n is not set. A pure reference // (e.g. "${resources.jobs.base.schedule}") has no fields of its own; the referenced // value is checked where it is defined. diff --git a/bundle/config/walk/rule_walk.go b/bundle/config/walk/rule_walk.go new file mode 100644 index 00000000000..a0d9d9ae19f --- /dev/null +++ b/bundle/config/walk/rule_walk.go @@ -0,0 +1,289 @@ +package walk + +import ( + "reflect" + "unsafe" + + "github.com/databricks/cli/bundle/config" + "github.com/databricks/cli/libs/structs/structinfo" + "github.com/databricks/databricks-sdk-go/service/jobs" +) + +// Possible optimizations, in the order to try them. The enum walk is 1.5x slower than +// the generated walker it replaced (0.62 ms vs 0.42 ms for 1000 jobs, about 4 ns vs 2.6 ns +// per visited field); the profile shows the time in field() itself, not in allocation. +// - Split each walk list by kind (nil-able pointers, enum strings, containers) and loop +// over each list separately: the shared switch on op.Kind is data-dependent and hard +// to predict, while the generated code has one specialised branch per field. +// - Unroll the recursion: copy the walk entries of a struct held by value into the +// parent's list with the offset added, and guard the entries of a pointer struct with +// one nil check, so a call and a loop setup per nested struct go away. Recursive types +// (jobs.Task -> ForEachTask -> Task) keep real recursion at the recursive edge. +// - The strings walk (strings_engine.go) is 1.3x slower than the generated one it replaced +// (2.9 ms vs 2.2 ms for 1000 jobs, 24k allocs vs 76k): the time is spread over the +// prologue of field(), the "${" search and the IsRef lookups, with no single hot spot. +// Splitting the cold paths (EmptyFields, interface and map values) out of field() to +// shrink its frame is the first thing to try. +// - Keep the node arena on the Go stack by passing nodes by value to callbacks that +// do not retain them (avoids write barriers on the heap arena). +// +// ruleWalk walks the configuration structs by the cached [structinfo.Type] of each struct: +// a field is reached by adding an offset to the address of its struct, and only the +// fields that lead to something the rule looks at are visited. +type ruleWalk struct { + arena + + rule int // index into structinfo.Type.Walk + missing func(n *Node, field string) + enum func(n *Node, s string, valid []string) +} + +// maxDepth is the number of nodes between the root and the deepest value. +const maxDepth = 64 + +// arena holds the nodes of the path being visited by a walk, so that handing a node to a +// callback does not allocate it: a callback is an indirect call, which would make a node +// on the Go stack escape. Callbacks must not keep the node. +type arena struct { + nodes [maxDepth]Node + depth int +} + +// child returns the node of the key k of n, stored in the arena until pop. +func (a *arena) child(n *Node, k string) *Node { + c := &a.nodes[a.depth] + a.depth++ + *c = n.Child(k) + return c +} + +// elemNode returns the node of the element i of n, stored in the arena until pop. +func (a *arena) elemNode(n *Node, i int) *Node { + c := &a.nodes[a.depth] + a.depth++ + *c = n.Elem(i) + return c +} + +// root stores n as the first node of the arena. +func (a *arena) root(n Node) *Node { + c := &a.nodes[a.depth] + a.depth++ + *c = n + return c +} + +func (a *arena) pop() { + a.depth-- +} + +var rootInfo = structinfo.For(reflect.TypeFor[config.Root]()) + +// Required calls missing for each required field of the configuration that is not set. +func Required(root *config.Root, missing func(n *Node, field string)) { + e := &ruleWalk{rule: 0, missing: missing} + n := e.root(RootWithReferences(root)) + e.strct(rootInfo, n, unsafe.Pointer(root)) +} + +// Enums calls enum for each value of an enum field that is not empty. +func Enums(root *config.Root, enum func(n *Node, s string, valid []string)) { + e := &ruleWalk{rule: 1, enum: enum} + n := e.root(Root(root)) + e.strct(rootInfo, n, unsafe.Pointer(root)) +} + +// zeroIsValid lists the required fields (by struct type) whose zero value is a valid +// value, so it is not reported as missing. Presence comes from ForceSendFields only, and +// these structs have none to record an explicit zero value. +var zeroIsValidType = reflect.TypeFor[jobs.JobParameterDefinition]() + +// zeroIsValidKey is the field of zeroIsValidType; an empty default is a common, valid +// job parameter default. +const zeroIsValidKey = "default" + +// strct walks the struct t at p, which is nil for a node without fields (a forced nil +// value or a pure reference). +func (e *ruleWalk) strct(t *structinfo.Type, n *Node, p unsafe.Pointer) { + if e.rule == 0 { + if p == nil { + for _, i := range t.Required { + e.missing(n, t.Fields[i].Key) + } + return + } + skip := "" + if t.Typ == zeroIsValidType { + skip = zeroIsValidKey + } + for _, i := range t.Required { + f := &t.Fields[i] + if f.Key != skip && !e.present(t, n, p, f) { + e.missing(n, f.Key) + } + } + } else if p == nil { + return + } + ops := t.Walk[e.rule] + for i := range ops { + // Targets and environments are merged into the root. + if t == rootInfo { + if k := t.Fields[ops[i].Idx].Key; k == "targets" || k == "environments" { + continue + } + } + e.field(t, n, p, &ops[i]) + } +} + +// present reports whether the required field f of the struct at p counts as set. +// Presence comes from the value and ForceSendFields only, never from locations: a scalar +// or a struct is set if it is not zero or is in ForceSendFields; a pointer, slice, map +// or interface if it is not nil. A value that cannot hold a string can also be replaced +// by a pure reference. +func (e *ruleWalk) present(t *structinfo.Type, n *Node, p unsafe.Pointer, f *structinfo.Field) bool { + fp := f.Loc.Resolve(p) + if fp == nil { + return false + } + switch f.Kind { + case structinfo.KindString: + return *(*string)(fp) != "" || t.Forced(p, f) + case structinfo.KindPtr, structinfo.KindSlice, structinfo.KindMap, structinfo.KindInterface: + return !isNil(f.Kind, fp) || n.IsRef(f.Key) + case structinfo.KindStruct: + // A struct whose fields are only references is zero, but set. + return !isZero(f, fp) || t.Forced(p, f) || n.HasRefs(f.Key) + default: + return !isZero(f, fp) || t.Forced(p, f) || n.IsRef(f.Key) + } +} + +func isNil(k structinfo.Kind, p unsafe.Pointer) bool { + // A slice, map, interface or pointer is nil if its first word is. + return *(*unsafe.Pointer)(p) == nil +} + +func isZero(f *structinfo.Field, p unsafe.Pointer) bool { + if f.Kind == structinfo.KindBool { + return !*(*bool)(p) + } + return reflect.NewAt(f.Typ, p).Elem().IsZero() +} + +type sliceHeader struct { + data unsafe.Pointer + len int +} + +// field visits the field of the struct t at p that the walk entry op describes. +func (e *ruleWalk) field(t *structinfo.Type, n *Node, p unsafe.Pointer, op *structinfo.Op) { + var fp unsafe.Pointer + if op.Slow { + fp = t.Fields[op.Idx].Loc.Resolve(p) + if fp == nil { + return + } + } else { + fp = unsafe.Add(p, op.Offset) + } + ft := op.Elem + switch { + case op.Kind == structinfo.KindPtr: + if q := *(*unsafe.Pointer)(fp); q != nil { + c := e.child(n, t.Fields[op.Idx].Key) + e.strct(ft.Elem, c, q) + e.pop() + } else if e.rule == 0 && (t.ForcedOp(p, op) || n.IsRef(t.Fields[op.Idx].Key)) { + // A forced nil value (e.g. "run_job_task:") or one replaced by a pure + // reference is a node without fields. + c := e.child(n, t.Fields[op.Idx].Key) + e.strct(ft.Elem, c, nil) + e.pop() + } + case op.Enum: + if s := *(*string)(fp); s != "" || t.ForcedOp(p, op) { + c := e.child(n, t.Fields[op.Idx].Key) + e.enum(c, s, ft.Enum) + e.pop() + } + case op.Kind == structinfo.KindStruct: + f := &t.Fields[op.Idx] + // A zero struct has nothing to report to the enum rule. + if e.rule == 1 || !isZero(f, fp) || t.ForcedOp(p, op) || n.HasRefs(f.Key) { + c := e.child(n, f.Key) + e.strct(ft, c, fp) + e.pop() + } + case op.Kind == structinfo.KindSlice: + if (*sliceHeader)(fp).len > 0 { + c := e.child(n, t.Fields[op.Idx].Key) + e.container(ft, c, fp) + e.pop() + } + case op.Kind == structinfo.KindMap: + // An empty map has no elements to visit. + if *(*unsafe.Pointer)(fp) != nil { + c := e.child(n, t.Fields[op.Idx].Key) + e.container(ft, c, fp) + e.pop() + } + } +} + +// container visits the elements of the slice or map t at p, whose node is c. +func (e *ruleWalk) container(t *structinfo.Type, c *Node, p unsafe.Pointer) { + if t.Kind == structinfo.KindSlice { + h := (*sliceHeader)(p) + for i := range h.len { + el := e.elemNode(c, i) + e.elem(t.Elem, el, unsafe.Add(h.data, uintptr(i)*t.Elem.Size)) + e.pop() + } + return + } + if t.MapKind == structinfo.MapStringPtr { + for k, q := range *(*map[string]unsafe.Pointer)(p) { + if k == "" { + continue + } + el := e.child(c, k) + e.elem(t.Elem, el, unsafe.Pointer(&q)) + e.pop() + } + return + } + it := reflect.NewAt(t.Typ, p).Elem().MapRange() + for it.Next() { + k := it.Key().String() + if k == "" { + continue + } + el := e.child(c, k) + v := it.Value() + if t.Elem.Kind == structinfo.KindPtr { + q := v.UnsafePointer() + e.elem(t.Elem, el, unsafe.Pointer(&q)) + } else { + cp := reflect.New(t.Elem.Typ) + cp.Elem().Set(v) + e.elem(t.Elem, el, cp.UnsafePointer()) + } + e.pop() + } +} + +// elem visits the element of type t at p, whose node is el. +func (e *ruleWalk) elem(t *structinfo.Type, el *Node, p unsafe.Pointer) { + switch { + case t.Enum != nil: + e.enum(el, *(*string)(p), t.Enum) + case t.Kind == structinfo.KindPtr: + e.strct(t.Elem, el, *(*unsafe.Pointer)(p)) + case t.Kind == structinfo.KindStruct: + e.strct(t, el, p) + case t.Kind == structinfo.KindSlice || t.Kind == structinfo.KindMap: + e.container(t, el, p) + } +} diff --git a/bundle/config/walk/rule_walk_bench_test.go b/bundle/config/walk/rule_walk_bench_test.go new file mode 100644 index 00000000000..4af1cbf56e2 --- /dev/null +++ b/bundle/config/walk/rule_walk_bench_test.go @@ -0,0 +1,75 @@ +package walk + +import ( + "fmt" + "testing" + + "github.com/databricks/cli/bundle/config" + "github.com/databricks/cli/bundle/config/resources" + "github.com/databricks/databricks-sdk-go/service/compute" + "github.com/databricks/databricks-sdk-go/service/jobs" +) + +func benchConfig(n int) *config.Root { + r := &config.Root{Bundle: config.Bundle{Name: "b"}} + r.Resources.Jobs = map[string]*resources.Job{} + for i := range n { + var tasks []jobs.Task + for j := range 5 { + t := jobs.Task{ + TaskKey: fmt.Sprintf("t%d", j), + NotebookTask: &jobs.NotebookTask{NotebookPath: "/a/b"}, + NewCluster: &compute.ClusterSpec{ + SparkVersion: "15.4.x-scala2.12", NodeTypeId: "i3.xlarge", NumWorkers: 2, + SparkConf: map[string]string{"a": "b"}, + }, + } + if j == 3 { + t.NotebookTask = &jobs.NotebookTask{} + } + tasks = append(tasks, t) + } + r.Resources.Jobs[fmt.Sprintf("job%d", i)] = &resources.Job{ + Name: fmt.Sprintf("job%d", i), + Tasks: tasks, + Schedule: &jobs.CronSchedule{QuartzCronExpression: "0 0 * * * ?"}, + Tags: map[string]string{"x": "y"}, + } + } + return r +} + +func BenchmarkRequired(b *testing.B) { + r := benchConfig(1000) + b.ReportAllocs() + n := 0 + for b.Loop() { + Required(r, func(*Node, string) { n++ }) + } +} + +func BenchmarkEnum(b *testing.B) { + r := benchConfig(1000) + b.ReportAllocs() + n := 0 + for b.Loop() { + Enums(r, func(*Node, string, []string) { n++ }) + } +} + +func BenchmarkStringsNonEmpty(b *testing.B) { + r := benchConfig(1000) + b.ReportAllocs() + n := 0 + for b.Loop() { + Strings(r, NonEmpty, func(*Node, string) (string, bool) { n++; return "", false }) + } +} + +func BenchmarkStringsRefs(b *testing.B) { + r := benchConfig(1000) + b.ReportAllocs() + for b.Loop() { + Strings(r, WithReferences, func(*Node, string) (string, bool) { return "", false }) + } +} diff --git a/bundle/config/walk/strings.go b/bundle/config/walk/strings.go index 692c33953ff..22b2a42d2ec 100644 --- a/bundle/config/walk/strings.go +++ b/bundle/config/walk/strings.go @@ -5,6 +5,7 @@ import ( "reflect" "slices" "strings" + "unsafe" "github.com/databricks/cli/bundle/config" "github.com/databricks/cli/libs/structs/structpath" @@ -39,23 +40,20 @@ type StringFunc func(n *Node, s string) (string, bool) // paying for the traversal once. Phase ordering limits which ones can be combined. func Strings(root *config.Root, mode Mode, fn StringFunc) { c := &stringsWalk{mode: mode, fn: fn} - n := RootWithReferences(root) - stringsConfigRoot(c, &n, root) + c.strct(rootInfo, c.root(RootWithReferences(root)), unsafe.Pointer(root)) } // StringsWithoutResources is [Strings] for the configuration outside "resources". func StringsWithoutResources(root *config.Root, mode Mode, fn StringFunc) { c := &stringsWalk{mode: mode, fn: fn, skipResources: true} - n := RootWithReferences(root) - stringsConfigRoot(c, &n, root) + c.strct(rootInfo, c.root(RootWithReferences(root)), unsafe.Pointer(root)) } // ResourceStrings is [Strings] for "resources" only. func ResourceStrings(root *config.Root, mode Mode, fn StringFunc) { c := &stringsWalk{mode: mode, fn: fn} n := rootWithReferencesUnder(root, structpath.NewStringKey(nil, "resources")) - ch := n.Child("resources") - stringsConfigResources(c, &ch, &root.Resources) + c.strct(resourcesInfo, c.child(&n, "resources"), unsafe.Pointer(&root.Resources)) } // ResourceStringsOf is [Strings] for the resource name of type typ. @@ -63,7 +61,7 @@ func ResourceStringsOf(root *config.Root, typ, name string, mode Mode, fn String c := &stringsWalk{mode: mode, fn: fn} n := rootWithReferencesUnder(root, structpath.NewPath(nil, "resources", typ, name)) rn := n.Child("resources") - stringsResource(c, &rn, &root.Resources, typ, name) + c.resource(&rn, &root.Resources, typ, name) } // VariableLookupStrings is [Strings] for the lookups of the variables @@ -79,11 +77,13 @@ func VariableLookupStrings(root *config.Root, mode Mode, fn StringFunc) { } ch := vn.Child(k) ln := ch.Child("lookup") - stringsVariableLookup(c, &ln, v.Lookup) + c.strct(lookupInfo, c.root(ln), unsafe.Pointer(v.Lookup)) + c.pop() } } type stringsWalk struct { + arena mode Mode fn StringFunc skipResources bool diff --git a/bundle/config/walk/strings_engine.go b/bundle/config/walk/strings_engine.go new file mode 100644 index 00000000000..5f3ef6768d9 --- /dev/null +++ b/bundle/config/walk/strings_engine.go @@ -0,0 +1,294 @@ +package walk + +import ( + "reflect" + "slices" + "strings" + "unsafe" + + "github.com/databricks/cli/bundle/config" + "github.com/databricks/cli/bundle/config/variable" + "github.com/databricks/cli/libs/structs/structinfo" +) + +var ( + resourcesInfo = structinfo.For(reflect.TypeFor[config.Resources]()) + lookupInfo = structinfo.For(reflect.TypeFor[variable.Lookup]()) +) + +// strct visits the strings of the struct t at p, in field order. A value replaced by a +// pure reference hides what is below it; the reference itself is in +// config.Root.References. +func (c *stringsWalk) strct(t *structinfo.Type, n *Node, p unsafe.Pointer) { + if n.isRef() { + return + } + ops := t.Walk[ruleStrings] + for i := range ops { + c.field(t, n, p, &ops[i]) + } +} + +// ruleStrings is the index of the strings rule in structinfo.Type.Walk. +const ruleStrings = 2 + +// field visits the strings of the field that op describes in the struct t at p. +func (c *stringsWalk) field(t *structinfo.Type, n *Node, p unsafe.Pointer, op *structinfo.Op) { + if t == rootInfo && c.skipResources && op.Key == "resources" { + return + } + var fp unsafe.Pointer + if op.Slow { + fp = t.Fields[op.Idx].Loc.Resolve(p) + if fp == nil { + return + } + } else { + fp = unsafe.Add(p, op.Offset) + } + if op.Kind == structinfo.KindString { + // The common case: a string field. + s := *(*string)(fp) + if c.mode == EmptyFields && s == "" && !op.NoOmitEmpty && t.ForcedOp(p, op) { + ch := c.child(n, op.Key) + c.fn(ch, "") + c.pop() + } + if c.match(s) { + ch := c.child(n, op.Key) + if r, ok := c.fn(ch, s); ok { + *(*string)(fp) = r + } + c.pop() + } + return + } + if op.Kind != structinfo.KindInterface && n.IsRef(op.Key) { + // A field replaced by a pure reference hides what is below it. + return + } + if c.mode == EmptyFields { + c.emptyField(t, n, p, op, fp) + } + c.visit(op.Elem, n, op.Key, fp) +} + +// emptyField visits the field in mode EmptyFields if it holds an empty string that is +// present: a forced string, a non-nil pointer to a string, or an interface. Fields +// without omitempty are skipped: their zero value is always sent. +func (c *stringsWalk) emptyField(t *structinfo.Type, n *Node, p unsafe.Pointer, op *structinfo.Op, fp unsafe.Pointer) { + if op.NoOmitEmpty { + return + } + switch { + case op.Kind == structinfo.KindString: + if *(*string)(fp) != "" || !t.ForcedOp(p, op) { + return + } + case op.Kind == structinfo.KindPtr && op.Elem.Elem.Kind == structinfo.KindString: + q := *(*unsafe.Pointer)(fp) + if q == nil || *(*string)(q) != "" { + return + } + case op.Kind == structinfo.KindInterface: + if s, ok := (*(*any)(fp)).(string); !ok || s != "" { + return + } + default: + return + } + ch := c.child(n, op.Key) + c.fn(ch, "") + c.pop() +} + +// visit visits the strings of the value of type t at p, the field or key k of n. +func (c *stringsWalk) visit(t *structinfo.Type, n *Node, k string, p unsafe.Pointer) { + switch t.Kind { + case structinfo.KindString: + if s := *(*string)(p); c.match(s) { + ch := c.child(n, k) + if r, ok := c.fn(ch, s); ok { + *(*string)(p) = r + } + c.pop() + } + case structinfo.KindInterface: + if a := (*any)(p); *a != nil { + ch := c.child(n, k) + c.any(ch, a) + c.pop() + } + case structinfo.KindPtr: + if q := *(*unsafe.Pointer)(p); q != nil { + if t.Elem.Kind == structinfo.KindStruct { + ch := c.child(n, k) + c.strct(t.Elem, ch, q) + c.pop() + } else { + c.visit(t.Elem, n, k, q) + } + } + case structinfo.KindStruct: + ch := c.child(n, k) + c.strct(t, ch, p) + c.pop() + case structinfo.KindSlice: + h := (*sliceHeader)(p) + if h.len == 0 { + return + } + cn := c.child(n, k) + for i := range h.len { + c.elem(t.Elem, cn, i, unsafe.Add(h.data, uintptr(i)*t.Elem.Size)) + } + c.pop() + case structinfo.KindMap: + c.mapValue(t, n, k, p) + default: + } +} + +// elem is [stringsWalk.visit] for the element i of a slice. +func (c *stringsWalk) elem(t *structinfo.Type, cn *Node, i int, p unsafe.Pointer) { + ch := c.elemNode(cn, i) + // The element node is the node of the value: visit it in place. + switch t.Kind { + case structinfo.KindString: + if s := *(*string)(p); c.match(s) { + if r, ok := c.fn(ch, s); ok { + *(*string)(p) = r + } + } + case structinfo.KindInterface: + if a := (*any)(p); *a != nil { + c.any(ch, a) + } + case structinfo.KindPtr: + if q := *(*unsafe.Pointer)(p); q != nil { + c.target(t.Elem, ch, q) + } + default: + c.target(t, ch, p) + } + c.pop() +} + +// target visits the strings of the value of type t at p whose node n is already made. +func (c *stringsWalk) target(t *structinfo.Type, n *Node, p unsafe.Pointer) { + switch t.Kind { + case structinfo.KindStruct: + c.strct(t, n, p) + case structinfo.KindString: + if s := *(*string)(p); c.match(s) { + if r, ok := c.fn(n, s); ok { + *(*string)(p) = r + } + } + case structinfo.KindInterface: + if a := (*any)(p); *a != nil { + c.any(n, a) + } + case structinfo.KindPtr: + if q := *(*unsafe.Pointer)(p); q != nil { + c.target(t.Elem, n, q) + } + case structinfo.KindSlice: + h := (*sliceHeader)(p) + for i := range h.len { + c.elem(t.Elem, n, i, unsafe.Add(h.data, uintptr(i)*t.Elem.Size)) + } + case structinfo.KindMap: + c.mapElems(t, n, p) + default: + } +} + +// mapValue visits the map t at p, the field or key k of n, in the order of its keys. +func (c *stringsWalk) mapValue(t *structinfo.Type, n *Node, k string, p unsafe.Pointer) { + if *(*unsafe.Pointer)(p) == nil { + return + } + cn := c.child(n, k) + c.mapElems(t, cn, p) + c.pop() +} + +// mapElems visits the elements of the map t at p, whose node is cn. +func (c *stringsWalk) mapElems(t *structinfo.Type, cn *Node, p unsafe.Pointer) { + switch t.MapKind { + case structinfo.MapStringPtr: + m := *(*map[string]unsafe.Pointer)(p) + for _, k := range sortedKeys(m) { + if q := m[k]; q != nil { + ch := c.child(cn, k) + c.target(t.Elem.Elem, ch, q) + c.pop() + } + } + return + case structinfo.MapStringString: + m := *(*map[string]string)(p) + for _, k := range sortedKeys(m) { + if s := m[k]; c.match(s) { + ch := c.child(cn, k) + if r, ok := c.fn(ch, s); ok { + m[k] = r + } + c.pop() + } + } + return + case structinfo.MapOther: + } + m := reflect.NewAt(t.Typ, p).Elem() + if m.Len() == 0 { + return + } + keys := m.MapKeys() + slices.SortFunc(keys, func(a, b reflect.Value) int { return strings.Compare(a.String(), b.String()) }) + et := t.Elem + for _, key := range keys { + ch := c.child(cn, key.String()) + switch et.Kind { + case structinfo.KindPtr: + // The pointer is not changed: visit what it points to. + if q := m.MapIndex(key).UnsafePointer(); q != nil { + c.target(et.Elem, ch, q) + } + case structinfo.KindString: + // Map values are not addressable: write the replacement back. + if s := m.MapIndex(key).String(); c.match(s) { + if r, ok := c.fn(ch, s); ok { + m.SetMapIndex(key, reflect.ValueOf(r).Convert(et.Typ)) + } + } + default: + cp := reflect.New(et.Typ) + cp.Elem().Set(m.MapIndex(key)) + c.target(et, ch, cp.UnsafePointer()) + m.SetMapIndex(key, cp.Elem()) + } + c.pop() + } +} + +// resource visits the strings of the resource name of type typ, whose node rn is the +// node of "resources". +func (c *stringsWalk) resource(rn *Node, r *config.Resources, typ, name string) { + for i := range resourcesInfo.Fields { + f := &resourcesInfo.Fields[i] + if f.Key != typ { + continue + } + m := reflect.NewAt(f.Typ, f.Loc.Resolve(unsafe.Pointer(r))).Elem() + q := m.MapIndex(reflect.ValueOf(name).Convert(f.Typ.Key())).UnsafePointer() + if q == nil || f.Type.Elem.Elem.Has&structinfo.RuleStrings == 0 { + return + } + ch := rn.Child(typ) + en := ch.Child(name) + c.strct(f.Type.Elem.Elem, c.root(en), q) + return + } +} diff --git a/bundle/config/walk/strings_walk.go b/bundle/config/walk/strings_walk.go deleted file mode 100644 index 6b039eba53d..00000000000 --- a/bundle/config/walk/strings_walk.go +++ /dev/null @@ -1,18957 +0,0 @@ -// Code generated by bundle/internal/validation. DO NOT EDIT. - -package walk - -import ( - "github.com/databricks/cli/bundle/config" - "github.com/databricks/cli/bundle/config/engine" - "github.com/databricks/cli/bundle/config/loctable" - "github.com/databricks/cli/bundle/config/resources" - "github.com/databricks/cli/bundle/config/variable" - "github.com/databricks/cli/libs/exec" - "github.com/databricks/cli/libs/snapshot" - "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/dashboards" - "github.com/databricks/databricks-sdk-go/service/database" - "github.com/databricks/databricks-sdk-go/service/iam" - "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" - "github.com/databricks/databricks-sdk-go/service/workspace" -) - -func stringsConfigRoot(c *stringsWalk, n *Node, v *config.Root) { - if n.isRef() { - return - } - if !n.IsRef("variables") { - if len(v.Variables) > 0 { - cn := n.Child("variables") - for _, k := range sortedKeys(v.Variables) { - if x := v.Variables[k]; x != nil { - ch := cn.Child(string(k)) - stringsVariableVariable(c, &ch, x) - } - } - } - } - if !n.IsRef("bundle") { - { - ch := n.Child("bundle") - stringsConfigBundle(c, &ch, &v.Bundle) - } - } - if !n.IsRef("include") { - if len(v.Include) > 0 { - cn := n.Child("include") - for i := range v.Include { - if s := string(v.Include[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Include[i] = (r) - } - } - } - } - } - if !n.IsRef("workspace") { - { - ch := n.Child("workspace") - stringsConfigWorkspace(c, &ch, &v.Workspace) - } - } - if !n.IsRef("artifacts") { - if len(v.Artifacts) > 0 { - cn := n.Child("artifacts") - for _, k := range sortedKeys(v.Artifacts) { - if x := v.Artifacts[k]; x != nil { - ch := cn.Child(string(k)) - stringsConfigArtifact(c, &ch, x) - } - } - } - } - if !c.skipResources && !n.IsRef("resources") { - { - ch := n.Child("resources") - stringsConfigResources(c, &ch, &v.Resources) - } - } - if !n.IsRef("targets") { - if len(v.Targets) > 0 { - cn := n.Child("targets") - for _, k := range sortedKeys(v.Targets) { - if x := v.Targets[k]; x != nil { - ch := cn.Child(string(k)) - stringsConfigTarget(c, &ch, x) - } - } - } - } - if !n.IsRef("environments") { - if len(v.Environments) > 0 { - cn := n.Child("environments") - for _, k := range sortedKeys(v.Environments) { - if x := v.Environments[k]; x != nil { - ch := cn.Child(string(k)) - stringsConfigTarget(c, &ch, x) - } - } - } - } - if !n.IsRef("sync") { - { - ch := n.Child("sync") - stringsConfigSync(c, &ch, &v.Sync) - } - } - if !n.IsRef("run_as") { - if x := v.RunAs; x != nil { - ch := n.Child("run_as") - stringsJobsJobRunAs(c, &ch, x) - } - } - if !n.IsRef("presets") { - { - ch := n.Child("presets") - stringsConfigPresets(c, &ch, &v.Presets) - } - } - if !n.IsRef("experimental") { - if x := v.Experimental; x != nil { - ch := n.Child("experimental") - stringsConfigExperimental(c, &ch, x) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesPermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if !n.IsRef("__locations") { - if x := v.Locations; x != nil { - ch := n.Child("__locations") - stringsLoctableLocations(c, &ch, x) - } - } - if !n.IsRef("scripts") { - if len(v.Scripts) > 0 { - cn := n.Child("scripts") - for _, k := range sortedKeys(v.Scripts) { - x := v.Scripts[k] - { - ch := cn.Child(string(k)) - stringsConfigScript(c, &ch, &x) - } - v.Scripts[k] = x - } - } - } - if !n.IsRef("python") { - { - ch := n.Child("python") - stringsConfigPython(c, &ch, &v.Python) - } - } - if c.mode == EmptyFields && v.Definitions == "" { - ch := n.Child("definitions") - c.fn(&ch, "") - } - if v.Definitions != nil { - ch := n.Child("definitions") - c.any(&ch, &v.Definitions) - } -} - -func stringsVariableVariable(c *stringsWalk, n *Node, v *variable.Variable) { - if n.isRef() { - return - } - if s := string(v.Type); c.match(s) { - ch := n.Child("type") - if r, ok := c.fn(&ch, s); ok { - v.Type = variable.VariableType(r) - } - } - if c.mode == EmptyFields && v.Default == "" { - ch := n.Child("default") - c.fn(&ch, "") - } - if v.Default != nil { - ch := n.Child("default") - c.any(&ch, &v.Default) - } - if s := string(v.Description); c.match(s) { - ch := n.Child("description") - if r, ok := c.fn(&ch, s); ok { - v.Description = (r) - } - } - if c.mode == EmptyFields && v.Value == "" { - ch := n.Child("value") - c.fn(&ch, "") - } - if v.Value != nil { - ch := n.Child("value") - c.any(&ch, &v.Value) - } - if !n.IsRef("lookup") { - if x := v.Lookup; x != nil { - ch := n.Child("lookup") - stringsVariableLookup(c, &ch, x) - } - } -} - -func stringsConfigBundle(c *stringsWalk, n *Node, v *config.Bundle) { - if n.isRef() { - return - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if s := string(v.Target); c.match(s) { - ch := n.Child("target") - if r, ok := c.fn(&ch, s); ok { - v.Target = (r) - } - } - if s := string(v.Environment); c.match(s) { - ch := n.Child("environment") - if r, ok := c.fn(&ch, s); ok { - v.Environment = (r) - } - } - if !n.IsRef("terraform") { - if x := v.Terraform; x != nil { - ch := n.Child("terraform") - stringsConfigTerraform(c, &ch, x) - } - } - if !n.IsRef("git") { - { - ch := n.Child("git") - stringsConfigGit(c, &ch, &v.Git) - } - } - if s := string(v.Mode); c.match(s) { - ch := n.Child("mode") - if r, ok := c.fn(&ch, s); ok { - v.Mode = config.Mode(r) - } - } - if s := string(v.ComputeId); c.match(s) { - ch := n.Child("compute_id") - if r, ok := c.fn(&ch, s); ok { - v.ComputeId = (r) - } - } - if s := string(v.ClusterId); c.match(s) { - ch := n.Child("cluster_id") - if r, ok := c.fn(&ch, s); ok { - v.ClusterId = (r) - } - } - if s := string(v.Engine); c.match(s) { - ch := n.Child("engine") - if r, ok := c.fn(&ch, s); ok { - v.Engine = engine.EngineType(r) - } - } - if !n.IsRef("deployment") { - { - ch := n.Child("deployment") - stringsConfigDeployment(c, &ch, &v.Deployment) - } - } - if s := string(v.DatabricksCliVersion); c.match(s) { - ch := n.Child("databricks_cli_version") - if r, ok := c.fn(&ch, s); ok { - v.DatabricksCliVersion = (r) - } - } - if s := string(v.Uuid); c.match(s) { - ch := n.Child("uuid") - if r, ok := c.fn(&ch, s); ok { - v.Uuid = (r) - } - } -} - -func stringsConfigWorkspace(c *stringsWalk, n *Node, v *config.Workspace) { - if n.isRef() { - return - } - if s := string(v.Host); c.match(s) { - ch := n.Child("host") - if r, ok := c.fn(&ch, s); ok { - v.Host = (r) - } - } - if s := string(v.Profile); c.match(s) { - ch := n.Child("profile") - if r, ok := c.fn(&ch, s); ok { - v.Profile = (r) - } - } - if s := string(v.AuthType); c.match(s) { - ch := n.Child("auth_type") - if r, ok := c.fn(&ch, s); ok { - v.AuthType = (r) - } - } - if s := string(v.MetadataServiceURL); c.match(s) { - ch := n.Child("metadata_service_url") - if r, ok := c.fn(&ch, s); ok { - v.MetadataServiceURL = (r) - } - } - if s := string(v.ClientID); c.match(s) { - ch := n.Child("client_id") - if r, ok := c.fn(&ch, s); ok { - v.ClientID = (r) - } - } - if s := string(v.GoogleServiceAccount); c.match(s) { - ch := n.Child("google_service_account") - if r, ok := c.fn(&ch, s); ok { - v.GoogleServiceAccount = (r) - } - } - if s := string(v.AzureResourceID); c.match(s) { - ch := n.Child("azure_workspace_resource_id") - if r, ok := c.fn(&ch, s); ok { - v.AzureResourceID = (r) - } - } - if s := string(v.AzureClientID); c.match(s) { - ch := n.Child("azure_client_id") - if r, ok := c.fn(&ch, s); ok { - v.AzureClientID = (r) - } - } - if s := string(v.AzureTenantID); c.match(s) { - ch := n.Child("azure_tenant_id") - if r, ok := c.fn(&ch, s); ok { - v.AzureTenantID = (r) - } - } - if s := string(v.AzureEnvironment); c.match(s) { - ch := n.Child("azure_environment") - if r, ok := c.fn(&ch, s); ok { - v.AzureEnvironment = (r) - } - } - if s := string(v.AzureLoginAppID); c.match(s) { - ch := n.Child("azure_login_app_id") - if r, ok := c.fn(&ch, s); ok { - v.AzureLoginAppID = (r) - } - } - if s := string(v.AccountID); c.match(s) { - ch := n.Child("account_id") - if r, ok := c.fn(&ch, s); ok { - v.AccountID = (r) - } - } - if s := string(v.WorkspaceID); c.match(s) { - ch := n.Child("workspace_id") - if r, ok := c.fn(&ch, s); ok { - v.WorkspaceID = (r) - } - } - if !n.IsRef("current_user") { - if x := v.CurrentUser; x != nil { - ch := n.Child("current_user") - stringsConfigUser(c, &ch, x) - } - } - if s := string(v.RootPath); c.match(s) { - ch := n.Child("root_path") - if r, ok := c.fn(&ch, s); ok { - v.RootPath = (r) - } - } - if s := string(v.FilePath); c.match(s) { - ch := n.Child("file_path") - if r, ok := c.fn(&ch, s); ok { - v.FilePath = (r) - } - } - if s := string(v.ResourcePath); c.match(s) { - ch := n.Child("resource_path") - if r, ok := c.fn(&ch, s); ok { - v.ResourcePath = (r) - } - } - if s := string(v.ArtifactPath); c.match(s) { - ch := n.Child("artifact_path") - if r, ok := c.fn(&ch, s); ok { - v.ArtifactPath = (r) - } - } - if s := string(v.StatePath); c.match(s) { - ch := n.Child("state_path") - if r, ok := c.fn(&ch, s); ok { - v.StatePath = (r) - } - } - if s := string(v.SyncMode); c.match(s) { - ch := n.Child("sync_mode") - if r, ok := c.fn(&ch, s); ok { - v.SyncMode = config.SyncMode(r) - } - } -} - -func stringsConfigArtifact(c *stringsWalk, n *Node, v *config.Artifact) { - if n.isRef() { - return - } - if s := string(v.Type); c.match(s) { - ch := n.Child("type") - if r, ok := c.fn(&ch, s); ok { - v.Type = config.ArtifactType(r) - } - } - if s := string(v.Path); c.match(s) { - ch := n.Child("path") - if r, ok := c.fn(&ch, s); ok { - v.Path = (r) - } - } - if !n.IsRef("files") { - if len(v.Files) > 0 { - cn := n.Child("files") - for i := range v.Files { - { - ch := cn.Elem(i) - stringsConfigArtifactFile(c, &ch, &v.Files[i]) - } - } - } - } - if s := string(v.BuildCommand); c.match(s) { - ch := n.Child("build") - if r, ok := c.fn(&ch, s); ok { - v.BuildCommand = (r) - } - } - if s := string(v.Executable); c.match(s) { - ch := n.Child("executable") - if r, ok := c.fn(&ch, s); ok { - v.Executable = exec.ExecutableType(r) - } - } - if !n.IsRef("include") { - if len(v.Include) > 0 { - cn := n.Child("include") - for i := range v.Include { - if s := string(v.Include[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Include[i] = (r) - } - } - } - } - } - if !n.IsRef("git") { - if x := v.Git; x != nil { - ch := n.Child("git") - stringsConfigArtifactGit(c, &ch, x) - } - } -} - -func stringsConfigResources(c *stringsWalk, n *Node, v *config.Resources) { - if n.isRef() { - return - } - if !n.IsRef("jobs") { - if len(v.Jobs) > 0 { - cn := n.Child("jobs") - for _, k := range sortedKeys(v.Jobs) { - if x := v.Jobs[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesJob(c, &ch, x) - } - } - } - } - if !n.IsRef("job_runs") { - if len(v.JobRuns) > 0 { - cn := n.Child("job_runs") - for _, k := range sortedKeys(v.JobRuns) { - if x := v.JobRuns[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesJobRun(c, &ch, x) - } - } - } - } - if !n.IsRef("pipelines") { - if len(v.Pipelines) > 0 { - cn := n.Child("pipelines") - for _, k := range sortedKeys(v.Pipelines) { - if x := v.Pipelines[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesPipeline(c, &ch, x) - } - } - } - } - if !n.IsRef("features") { - if len(v.Features) > 0 { - cn := n.Child("features") - for _, k := range sortedKeys(v.Features) { - if x := v.Features[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesFeature(c, &ch, x) - } - } - } - } - if !n.IsRef("models") { - if len(v.Models) > 0 { - cn := n.Child("models") - for _, k := range sortedKeys(v.Models) { - if x := v.Models[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesMlflowModel(c, &ch, x) - } - } - } - } - if !n.IsRef("experiments") { - if len(v.Experiments) > 0 { - cn := n.Child("experiments") - for _, k := range sortedKeys(v.Experiments) { - if x := v.Experiments[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesMlflowExperiment(c, &ch, x) - } - } - } - } - if !n.IsRef("model_serving_endpoints") { - if len(v.ModelServingEndpoints) > 0 { - cn := n.Child("model_serving_endpoints") - for _, k := range sortedKeys(v.ModelServingEndpoints) { - if x := v.ModelServingEndpoints[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesModelServingEndpoint(c, &ch, x) - } - } - } - } - if !n.IsRef("model_services") { - if len(v.ModelServices) > 0 { - cn := n.Child("model_services") - for _, k := range sortedKeys(v.ModelServices) { - if x := v.ModelServices[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesModelService(c, &ch, x) - } - } - } - } - if !n.IsRef("mcp_services") { - if len(v.McpServices) > 0 { - cn := n.Child("mcp_services") - for _, k := range sortedKeys(v.McpServices) { - if x := v.McpServices[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesMcpService(c, &ch, x) - } - } - } - } - if !n.IsRef("model_provider_services") { - if len(v.ModelProviderServices) > 0 { - cn := n.Child("model_provider_services") - for _, k := range sortedKeys(v.ModelProviderServices) { - if x := v.ModelProviderServices[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesModelProviderService(c, &ch, x) - } - } - } - } - if !n.IsRef("registered_models") { - if len(v.RegisteredModels) > 0 { - cn := n.Child("registered_models") - for _, k := range sortedKeys(v.RegisteredModels) { - if x := v.RegisteredModels[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesRegisteredModel(c, &ch, x) - } - } - } - } - if !n.IsRef("quality_monitors") { - if len(v.QualityMonitors) > 0 { - cn := n.Child("quality_monitors") - for _, k := range sortedKeys(v.QualityMonitors) { - if x := v.QualityMonitors[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesQualityMonitor(c, &ch, x) - } - } - } - } - if !n.IsRef("catalogs") { - if len(v.Catalogs) > 0 { - cn := n.Child("catalogs") - for _, k := range sortedKeys(v.Catalogs) { - if x := v.Catalogs[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesCatalog(c, &ch, x) - } - } - } - } - if !n.IsRef("schemas") { - if len(v.Schemas) > 0 { - cn := n.Child("schemas") - for _, k := range sortedKeys(v.Schemas) { - if x := v.Schemas[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesSchema(c, &ch, x) - } - } - } - } - if !n.IsRef("volumes") { - if len(v.Volumes) > 0 { - cn := n.Child("volumes") - for _, k := range sortedKeys(v.Volumes) { - if x := v.Volumes[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesVolume(c, &ch, x) - } - } - } - } - if !n.IsRef("external_locations") { - if len(v.ExternalLocations) > 0 { - cn := n.Child("external_locations") - for _, k := range sortedKeys(v.ExternalLocations) { - if x := v.ExternalLocations[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesExternalLocation(c, &ch, x) - } - } - } - } - if !n.IsRef("clusters") { - if len(v.Clusters) > 0 { - cn := n.Child("clusters") - for _, k := range sortedKeys(v.Clusters) { - if x := v.Clusters[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesCluster(c, &ch, x) - } - } - } - } - if !n.IsRef("dashboards") { - if len(v.Dashboards) > 0 { - cn := n.Child("dashboards") - for _, k := range sortedKeys(v.Dashboards) { - if x := v.Dashboards[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesDashboard(c, &ch, x) - } - } - } - } - if !n.IsRef("genie_spaces") { - if len(v.GenieSpaces) > 0 { - cn := n.Child("genie_spaces") - for _, k := range sortedKeys(v.GenieSpaces) { - if x := v.GenieSpaces[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesGenieSpace(c, &ch, x) - } - } - } - } - if !n.IsRef("apps") { - if len(v.Apps) > 0 { - cn := n.Child("apps") - for _, k := range sortedKeys(v.Apps) { - if x := v.Apps[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesApp(c, &ch, x) - } - } - } - } - if !n.IsRef("secret_scopes") { - if len(v.SecretScopes) > 0 { - cn := n.Child("secret_scopes") - for _, k := range sortedKeys(v.SecretScopes) { - if x := v.SecretScopes[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesSecretScope(c, &ch, x) - } - } - } - } - if !n.IsRef("alerts") { - if len(v.Alerts) > 0 { - cn := n.Child("alerts") - for _, k := range sortedKeys(v.Alerts) { - if x := v.Alerts[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesAlert(c, &ch, x) - } - } - } - } - if !n.IsRef("sql_warehouses") { - if len(v.SqlWarehouses) > 0 { - cn := n.Child("sql_warehouses") - for _, k := range sortedKeys(v.SqlWarehouses) { - if x := v.SqlWarehouses[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesSqlWarehouse(c, &ch, x) - } - } - } - } - if !n.IsRef("database_instances") { - if len(v.DatabaseInstances) > 0 { - cn := n.Child("database_instances") - for _, k := range sortedKeys(v.DatabaseInstances) { - if x := v.DatabaseInstances[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesDatabaseInstance(c, &ch, x) - } - } - } - } - if !n.IsRef("database_catalogs") { - if len(v.DatabaseCatalogs) > 0 { - cn := n.Child("database_catalogs") - for _, k := range sortedKeys(v.DatabaseCatalogs) { - if x := v.DatabaseCatalogs[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesDatabaseCatalog(c, &ch, x) - } - } - } - } - if !n.IsRef("synced_database_tables") { - if len(v.SyncedDatabaseTables) > 0 { - cn := n.Child("synced_database_tables") - for _, k := range sortedKeys(v.SyncedDatabaseTables) { - if x := v.SyncedDatabaseTables[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesSyncedDatabaseTable(c, &ch, x) - } - } - } - } - if !n.IsRef("postgres_projects") { - if len(v.PostgresProjects) > 0 { - cn := n.Child("postgres_projects") - for _, k := range sortedKeys(v.PostgresProjects) { - if x := v.PostgresProjects[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesPostgresProject(c, &ch, x) - } - } - } - } - if !n.IsRef("postgres_branches") { - if len(v.PostgresBranches) > 0 { - cn := n.Child("postgres_branches") - for _, k := range sortedKeys(v.PostgresBranches) { - if x := v.PostgresBranches[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesPostgresBranch(c, &ch, x) - } - } - } - } - if !n.IsRef("postgres_endpoints") { - if len(v.PostgresEndpoints) > 0 { - cn := n.Child("postgres_endpoints") - for _, k := range sortedKeys(v.PostgresEndpoints) { - if x := v.PostgresEndpoints[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesPostgresEndpoint(c, &ch, x) - } - } - } - } - if !n.IsRef("postgres_catalogs") { - if len(v.PostgresCatalogs) > 0 { - cn := n.Child("postgres_catalogs") - for _, k := range sortedKeys(v.PostgresCatalogs) { - if x := v.PostgresCatalogs[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesPostgresCatalog(c, &ch, x) - } - } - } - } - if !n.IsRef("postgres_databases") { - if len(v.PostgresDatabases) > 0 { - cn := n.Child("postgres_databases") - for _, k := range sortedKeys(v.PostgresDatabases) { - if x := v.PostgresDatabases[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesPostgresDatabase(c, &ch, x) - } - } - } - } - if !n.IsRef("postgres_roles") { - if len(v.PostgresRoles) > 0 { - cn := n.Child("postgres_roles") - for _, k := range sortedKeys(v.PostgresRoles) { - if x := v.PostgresRoles[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesPostgresRole(c, &ch, x) - } - } - } - } - if !n.IsRef("postgres_synced_tables") { - if len(v.PostgresSyncedTables) > 0 { - cn := n.Child("postgres_synced_tables") - for _, k := range sortedKeys(v.PostgresSyncedTables) { - if x := v.PostgresSyncedTables[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesPostgresSyncedTable(c, &ch, x) - } - } - } - } - if !n.IsRef("postgres_snapshot_schedules") { - if len(v.PostgresSnapshotSchedules) > 0 { - cn := n.Child("postgres_snapshot_schedules") - for _, k := range sortedKeys(v.PostgresSnapshotSchedules) { - if x := v.PostgresSnapshotSchedules[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesPostgresSnapshotSchedule(c, &ch, x) - } - } - } - } - if !n.IsRef("vector_search_endpoints") { - if len(v.VectorSearchEndpoints) > 0 { - cn := n.Child("vector_search_endpoints") - for _, k := range sortedKeys(v.VectorSearchEndpoints) { - if x := v.VectorSearchEndpoints[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesVectorSearchEndpoint(c, &ch, x) - } - } - } - } - if !n.IsRef("vector_search_indexes") { - if len(v.VectorSearchIndexes) > 0 { - cn := n.Child("vector_search_indexes") - for _, k := range sortedKeys(v.VectorSearchIndexes) { - if x := v.VectorSearchIndexes[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesVectorSearchIndex(c, &ch, x) - } - } - } - } - if !n.IsRef("instance_pools") { - if len(v.InstancePools) > 0 { - cn := n.Child("instance_pools") - for _, k := range sortedKeys(v.InstancePools) { - if x := v.InstancePools[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesInstancePool(c, &ch, x) - } - } - } - } - if !n.IsRef("secrets") { - if len(v.Secrets) > 0 { - cn := n.Child("secrets") - for _, k := range sortedKeys(v.Secrets) { - if x := v.Secrets[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesSecret(c, &ch, x) - } - } - } - } - if !n.IsRef("cluster_policies") { - if len(v.ClusterPolicies) > 0 { - cn := n.Child("cluster_policies") - for _, k := range sortedKeys(v.ClusterPolicies) { - if x := v.ClusterPolicies[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesClusterPolicy(c, &ch, x) - } - } - } - } - if !n.IsRef("internal_immutable_snapshots") { - if len(v.Snapshots) > 0 { - cn := n.Child("internal_immutable_snapshots") - for _, k := range sortedKeys(v.Snapshots) { - if x := v.Snapshots[k]; x != nil { - ch := cn.Child(string(k)) - stringsResourcesSnapshot(c, &ch, x) - } - } - } - } -} - -func stringsConfigTarget(c *stringsWalk, n *Node, v *config.Target) { - if n.isRef() { - return - } - if s := string(v.Mode); c.match(s) { - ch := n.Child("mode") - if r, ok := c.fn(&ch, s); ok { - v.Mode = config.Mode(r) - } - } - if !n.IsRef("presets") { - { - ch := n.Child("presets") - stringsConfigPresets(c, &ch, &v.Presets) - } - } - if s := string(v.ComputeId); c.match(s) { - ch := n.Child("compute_id") - if r, ok := c.fn(&ch, s); ok { - v.ComputeId = (r) - } - } - if s := string(v.ClusterId); c.match(s) { - ch := n.Child("cluster_id") - if r, ok := c.fn(&ch, s); ok { - v.ClusterId = (r) - } - } - if !n.IsRef("bundle") { - if x := v.Bundle; x != nil { - ch := n.Child("bundle") - stringsConfigBundle(c, &ch, x) - } - } - if !n.IsRef("workspace") { - if x := v.Workspace; x != nil { - ch := n.Child("workspace") - stringsConfigWorkspace(c, &ch, x) - } - } - if !n.IsRef("artifacts") { - if len(v.Artifacts) > 0 { - cn := n.Child("artifacts") - for _, k := range sortedKeys(v.Artifacts) { - if x := v.Artifacts[k]; x != nil { - ch := cn.Child(string(k)) - stringsConfigArtifact(c, &ch, x) - } - } - } - } - if !n.IsRef("resources") { - if x := v.Resources; x != nil { - ch := n.Child("resources") - stringsConfigResources(c, &ch, x) - } - } - if !n.IsRef("variables") { - if len(v.Variables) > 0 { - cn := n.Child("variables") - for _, k := range sortedKeys(v.Variables) { - if x := v.Variables[k]; x != nil { - ch := cn.Child(string(k)) - stringsVariableTargetVariable(c, &ch, x) - } - } - } - } - if !n.IsRef("git") { - { - ch := n.Child("git") - stringsConfigGit(c, &ch, &v.Git) - } - } - if !n.IsRef("run_as") { - if x := v.RunAs; x != nil { - ch := n.Child("run_as") - stringsJobsJobRunAs(c, &ch, x) - } - } - if !n.IsRef("sync") { - if x := v.Sync; x != nil { - ch := n.Child("sync") - stringsConfigSync(c, &ch, x) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesPermission(c, &ch, &v.Permissions[i]) - } - } - } - } -} - -func stringsConfigSync(c *stringsWalk, n *Node, v *config.Sync) { - if n.isRef() { - return - } - if !n.IsRef("paths") { - if len(v.Paths) > 0 { - cn := n.Child("paths") - for i := range v.Paths { - if s := string(v.Paths[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Paths[i] = (r) - } - } - } - } - } - if !n.IsRef("include") { - if len(v.Include) > 0 { - cn := n.Child("include") - for i := range v.Include { - if s := string(v.Include[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Include[i] = (r) - } - } - } - } - } - if !n.IsRef("exclude") { - if len(v.Exclude) > 0 { - cn := n.Child("exclude") - for i := range v.Exclude { - if s := string(v.Exclude[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Exclude[i] = (r) - } - } - } - } - } -} - -func stringsJobsJobRunAs(c *stringsWalk, n *Node, v *jobs.JobRunAs) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.GroupName == "" && Forced(v.ForceSendFields, "GroupName") { - ch := n.Child("group_name") - c.fn(&ch, "") - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } - if c.mode == EmptyFields && v.ServicePrincipalName == "" && Forced(v.ForceSendFields, "ServicePrincipalName") { - ch := n.Child("service_principal_name") - c.fn(&ch, "") - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if c.mode == EmptyFields && v.UserName == "" && Forced(v.ForceSendFields, "UserName") { - ch := n.Child("user_name") - c.fn(&ch, "") - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } -} - -func stringsConfigPresets(c *stringsWalk, n *Node, v *config.Presets) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.NamePrefix == "" && Forced(v.ForceSendFields, "NamePrefix") { - ch := n.Child("name_prefix") - c.fn(&ch, "") - } - if s := string(v.NamePrefix); c.match(s) { - ch := n.Child("name_prefix") - if r, ok := c.fn(&ch, s); ok { - v.NamePrefix = (r) - } - } - if c.mode == EmptyFields && v.TriggerPauseStatus == "" && Forced(v.ForceSendFields, "TriggerPauseStatus") { - ch := n.Child("trigger_pause_status") - c.fn(&ch, "") - } - if s := string(v.TriggerPauseStatus); c.match(s) { - ch := n.Child("trigger_pause_status") - if r, ok := c.fn(&ch, s); ok { - v.TriggerPauseStatus = (r) - } - } - if !n.IsRef("tags") { - if len(v.Tags) > 0 { - cn := n.Child("tags") - for _, k := range sortedKeys(v.Tags) { - if s := string(v.Tags[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.Tags[k] = (r) - } - } - } - } - } -} - -func stringsConfigExperimental(c *stringsWalk, n *Node, v *config.Experimental) { - if n.isRef() { - return - } - if !n.IsRef("scripts") { - if len(v.Scripts) > 0 { - cn := n.Child("scripts") - for _, k := range sortedKeys(v.Scripts) { - if s := string(v.Scripts[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.Scripts[k] = config.Command(r) - } - } - } - } - } - if !n.IsRef("python") { - { - ch := n.Child("python") - stringsConfigPython(c, &ch, &v.Python) - } - } -} - -func stringsResourcesPermission(c *stringsWalk, n *Node, v *resources.Permission) { - if n.isRef() { - return - } - if s := string(v.Level); c.match(s) { - ch := n.Child("level") - if r, ok := c.fn(&ch, s); ok { - v.Level = iam.PermissionLevel(r) - } - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } -} - -func stringsLoctableLocations(c *stringsWalk, n *Node, v *loctable.Locations) { - if n.isRef() { - return - } - if !n.IsRef("files") { - if len(v.Files) > 0 { - cn := n.Child("files") - for i := range v.Files { - if s := string(v.Files[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Files[i] = (r) - } - } - } - } - } -} - -func stringsConfigScript(c *stringsWalk, n *Node, v *config.Script) { - if n.isRef() { - return - } - if s := string(v.Content); c.match(s) { - ch := n.Child("content") - if r, ok := c.fn(&ch, s); ok { - v.Content = (r) - } - } - if !n.IsRef("env") { - if len(v.Env) > 0 { - cn := n.Child("env") - for _, k := range sortedKeys(v.Env) { - if s := string(v.Env[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.Env[k] = (r) - } - } - } - } - } -} - -func stringsConfigPython(c *stringsWalk, n *Node, v *config.Python) { - if n.isRef() { - return - } - if !n.IsRef("resources") { - if len(v.Resources) > 0 { - cn := n.Child("resources") - for i := range v.Resources { - if s := string(v.Resources[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Resources[i] = (r) - } - } - } - } - } - if !n.IsRef("mutators") { - if len(v.Mutators) > 0 { - cn := n.Child("mutators") - for i := range v.Mutators { - if s := string(v.Mutators[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Mutators[i] = (r) - } - } - } - } - } - if s := string(v.VEnvPath); c.match(s) { - ch := n.Child("venv_path") - if r, ok := c.fn(&ch, s); ok { - v.VEnvPath = (r) - } - } -} - -func stringsVariableLookup(c *stringsWalk, n *Node, v *variable.Lookup) { - if n.isRef() { - return - } - if s := string(v.Alert); c.match(s) { - ch := n.Child("alert") - if r, ok := c.fn(&ch, s); ok { - v.Alert = (r) - } - } - if s := string(v.ClusterPolicy); c.match(s) { - ch := n.Child("cluster_policy") - if r, ok := c.fn(&ch, s); ok { - v.ClusterPolicy = (r) - } - } - if s := string(v.Cluster); c.match(s) { - ch := n.Child("cluster") - if r, ok := c.fn(&ch, s); ok { - v.Cluster = (r) - } - } - if s := string(v.Dashboard); c.match(s) { - ch := n.Child("dashboard") - if r, ok := c.fn(&ch, s); ok { - v.Dashboard = (r) - } - } - if s := string(v.InstancePool); c.match(s) { - ch := n.Child("instance_pool") - if r, ok := c.fn(&ch, s); ok { - v.InstancePool = (r) - } - } - if s := string(v.Job); c.match(s) { - ch := n.Child("job") - if r, ok := c.fn(&ch, s); ok { - v.Job = (r) - } - } - if s := string(v.Metastore); c.match(s) { - ch := n.Child("metastore") - if r, ok := c.fn(&ch, s); ok { - v.Metastore = (r) - } - } - if s := string(v.NotificationDestination); c.match(s) { - ch := n.Child("notification_destination") - if r, ok := c.fn(&ch, s); ok { - v.NotificationDestination = (r) - } - } - if s := string(v.Pipeline); c.match(s) { - ch := n.Child("pipeline") - if r, ok := c.fn(&ch, s); ok { - v.Pipeline = (r) - } - } - if s := string(v.Query); c.match(s) { - ch := n.Child("query") - if r, ok := c.fn(&ch, s); ok { - v.Query = (r) - } - } - if s := string(v.ServicePrincipal); c.match(s) { - ch := n.Child("service_principal") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipal = (r) - } - } - if s := string(v.Warehouse); c.match(s) { - ch := n.Child("warehouse") - if r, ok := c.fn(&ch, s); ok { - v.Warehouse = (r) - } - } -} - -func stringsConfigTerraform(c *stringsWalk, n *Node, v *config.Terraform) { - if n.isRef() { - return - } - if s := string(v.ExecPath); c.match(s) { - ch := n.Child("exec_path") - if r, ok := c.fn(&ch, s); ok { - v.ExecPath = (r) - } - } -} - -func stringsConfigGit(c *stringsWalk, n *Node, v *config.Git) { - if n.isRef() { - return - } - if s := string(v.Branch); c.match(s) { - ch := n.Child("branch") - if r, ok := c.fn(&ch, s); ok { - v.Branch = (r) - } - } - if s := string(v.OriginURL); c.match(s) { - ch := n.Child("origin_url") - if r, ok := c.fn(&ch, s); ok { - v.OriginURL = (r) - } - } - if s := string(v.Commit); c.match(s) { - ch := n.Child("commit") - if r, ok := c.fn(&ch, s); ok { - v.Commit = (r) - } - } - if s := string(v.BundleRootPath); c.match(s) { - ch := n.Child("bundle_root_path") - if r, ok := c.fn(&ch, s); ok { - v.BundleRootPath = (r) - } - } - if s := string(v.ActualBranch); c.match(s) { - ch := n.Child("actual_branch") - if r, ok := c.fn(&ch, s); ok { - v.ActualBranch = (r) - } - } -} - -func stringsConfigDeployment(c *stringsWalk, n *Node, v *config.Deployment) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DeploymentID == "" && Forced(v.ForceSendFields, "DeploymentID") { - ch := n.Child("deployment_id") - c.fn(&ch, "") - } - if s := string(v.DeploymentID); c.match(s) { - ch := n.Child("deployment_id") - if r, ok := c.fn(&ch, s); ok { - v.DeploymentID = (r) - } - } -} - -func stringsConfigUser(c *stringsWalk, n *Node, v *config.User) { - if n.isRef() { - return - } - if s := string(v.ShortName); c.match(s) { - ch := n.Child("short_name") - if r, ok := c.fn(&ch, s); ok { - v.ShortName = (r) - } - } - if s := string(v.DomainFriendlyName); c.match(s) { - ch := n.Child("domain_friendly_name") - if r, ok := c.fn(&ch, s); ok { - v.DomainFriendlyName = (r) - } - } - if v.User != nil { - if c.mode == EmptyFields && v.User.DisplayName == "" && Forced(v.User.ForceSendFields, "DisplayName") { - ch := n.Child("displayName") - c.fn(&ch, "") - } - if s := string(v.User.DisplayName); c.match(s) { - ch := n.Child("displayName") - if r, ok := c.fn(&ch, s); ok { - v.User.DisplayName = (r) - } - } - } - if v.User != nil && !n.IsRef("emails") { - if len(v.User.Emails) > 0 { - cn := n.Child("emails") - for i := range v.User.Emails { - { - ch := cn.Elem(i) - stringsIamComplexValue(c, &ch, &v.User.Emails[i]) - } - } - } - } - if v.User != nil && !n.IsRef("entitlements") { - if len(v.User.Entitlements) > 0 { - cn := n.Child("entitlements") - for i := range v.User.Entitlements { - { - ch := cn.Elem(i) - stringsIamComplexValue(c, &ch, &v.User.Entitlements[i]) - } - } - } - } - if v.User != nil { - if c.mode == EmptyFields && v.User.ExternalId == "" && Forced(v.User.ForceSendFields, "ExternalId") { - ch := n.Child("externalId") - c.fn(&ch, "") - } - if s := string(v.User.ExternalId); c.match(s) { - ch := n.Child("externalId") - if r, ok := c.fn(&ch, s); ok { - v.User.ExternalId = (r) - } - } - } - if v.User != nil && !n.IsRef("groups") { - if len(v.User.Groups) > 0 { - cn := n.Child("groups") - for i := range v.User.Groups { - { - ch := cn.Elem(i) - stringsIamComplexValue(c, &ch, &v.User.Groups[i]) - } - } - } - } - if v.User != nil { - if c.mode == EmptyFields && v.User.Id == "" && Forced(v.User.ForceSendFields, "Id") { - ch := n.Child("id") - c.fn(&ch, "") - } - if s := string(v.User.Id); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.User.Id = (r) - } - } - } - if v.User != nil && !n.IsRef("name") { - if x := v.User.Name; x != nil { - ch := n.Child("name") - stringsIamName(c, &ch, x) - } - } - if v.User != nil && !n.IsRef("roles") { - if len(v.User.Roles) > 0 { - cn := n.Child("roles") - for i := range v.User.Roles { - { - ch := cn.Elem(i) - stringsIamComplexValue(c, &ch, &v.User.Roles[i]) - } - } - } - } - if v.User != nil && !n.IsRef("schemas") { - if len(v.User.Schemas) > 0 { - cn := n.Child("schemas") - for i := range v.User.Schemas { - if s := string(v.User.Schemas[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.User.Schemas[i] = iam.UserSchema(r) - } - } - } - } - } - if v.User != nil { - if c.mode == EmptyFields && v.User.UserName == "" && Forced(v.User.ForceSendFields, "UserName") { - ch := n.Child("userName") - c.fn(&ch, "") - } - if s := string(v.User.UserName); c.match(s) { - ch := n.Child("userName") - if r, ok := c.fn(&ch, s); ok { - v.User.UserName = (r) - } - } - } -} - -func stringsConfigArtifactFile(c *stringsWalk, n *Node, v *config.ArtifactFile) { - if n.isRef() { - return - } - if s := string(v.Source); c.match(s) { - ch := n.Child("source") - if r, ok := c.fn(&ch, s); ok { - v.Source = (r) - } - } - if s := string(v.Patched); c.match(s) { - ch := n.Child("patched") - if r, ok := c.fn(&ch, s); ok { - v.Patched = (r) - } - } - if s := string(v.RemotePath); c.match(s) { - ch := n.Child("remote_path") - if r, ok := c.fn(&ch, s); ok { - v.RemotePath = (r) - } - } -} - -func stringsConfigArtifactGit(c *stringsWalk, n *Node, v *config.ArtifactGit) { - if n.isRef() { - return - } - if s := string(v.Branch); c.match(s) { - ch := n.Child("branch") - if r, ok := c.fn(&ch, s); ok { - v.Branch = (r) - } - } - if s := string(v.Commit); c.match(s) { - ch := n.Child("commit") - if r, ok := c.fn(&ch, s); ok { - v.Commit = (r) - } - } -} - -func stringsResourcesJob(c *stringsWalk, n *Node, v *resources.Job) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesJobPermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if c.mode == EmptyFields && v.JobSettings.BudgetPolicyId == "" && Forced(v.JobSettings.ForceSendFields, "BudgetPolicyId") { - ch := n.Child("budget_policy_id") - c.fn(&ch, "") - } - if s := string(v.JobSettings.BudgetPolicyId); c.match(s) { - ch := n.Child("budget_policy_id") - if r, ok := c.fn(&ch, s); ok { - v.JobSettings.BudgetPolicyId = (r) - } - } - if !n.IsRef("continuous") { - if x := v.JobSettings.Continuous; x != nil { - ch := n.Child("continuous") - stringsJobsContinuous(c, &ch, x) - } - } - if !n.IsRef("deployment") { - if x := v.JobSettings.Deployment; x != nil { - ch := n.Child("deployment") - stringsJobsJobDeployment(c, &ch, x) - } - } - if c.mode == EmptyFields && v.JobSettings.Description == "" && Forced(v.JobSettings.ForceSendFields, "Description") { - ch := n.Child("description") - c.fn(&ch, "") - } - if s := string(v.JobSettings.Description); c.match(s) { - ch := n.Child("description") - if r, ok := c.fn(&ch, s); ok { - v.JobSettings.Description = (r) - } - } - if c.mode == EmptyFields && v.JobSettings.DurationTarget == "" && Forced(v.JobSettings.ForceSendFields, "DurationTarget") { - ch := n.Child("duration_target") - c.fn(&ch, "") - } - if s := string(v.JobSettings.DurationTarget); c.match(s) { - ch := n.Child("duration_target") - if r, ok := c.fn(&ch, s); ok { - v.JobSettings.DurationTarget = (r) - } - } - if c.mode == EmptyFields && v.JobSettings.EditMode == "" && Forced(v.JobSettings.ForceSendFields, "EditMode") { - ch := n.Child("edit_mode") - c.fn(&ch, "") - } - if s := string(v.JobSettings.EditMode); c.match(s) { - ch := n.Child("edit_mode") - if r, ok := c.fn(&ch, s); ok { - v.JobSettings.EditMode = jobs.JobEditMode(r) - } - } - if !n.IsRef("email_notifications") { - if x := v.JobSettings.EmailNotifications; x != nil { - ch := n.Child("email_notifications") - stringsJobsJobEmailNotifications(c, &ch, x) - } - } - if !n.IsRef("environment_variables") { - if len(v.JobSettings.EnvironmentVariables) > 0 { - cn := n.Child("environment_variables") - for i := range v.JobSettings.EnvironmentVariables { - { - ch := cn.Elem(i) - stringsJobsJobEnvironmentVariables(c, &ch, &v.JobSettings.EnvironmentVariables[i]) - } - } - } - } - if !n.IsRef("environments") { - if len(v.JobSettings.Environments) > 0 { - cn := n.Child("environments") - for i := range v.JobSettings.Environments { - { - ch := cn.Elem(i) - stringsJobsJobEnvironment(c, &ch, &v.JobSettings.Environments[i]) - } - } - } - } - if c.mode == EmptyFields && v.JobSettings.Format == "" && Forced(v.JobSettings.ForceSendFields, "Format") { - ch := n.Child("format") - c.fn(&ch, "") - } - if s := string(v.JobSettings.Format); c.match(s) { - ch := n.Child("format") - if r, ok := c.fn(&ch, s); ok { - v.JobSettings.Format = jobs.Format(r) - } - } - if !n.IsRef("git_source") { - if x := v.JobSettings.GitSource; x != nil { - ch := n.Child("git_source") - stringsJobsGitSource(c, &ch, x) - } - } - if !n.IsRef("health") { - if x := v.JobSettings.Health; x != nil { - ch := n.Child("health") - stringsJobsJobsHealthRules(c, &ch, x) - } - } - if !n.IsRef("job_clusters") { - if len(v.JobSettings.JobClusters) > 0 { - cn := n.Child("job_clusters") - for i := range v.JobSettings.JobClusters { - { - ch := cn.Elem(i) - stringsJobsJobCluster(c, &ch, &v.JobSettings.JobClusters[i]) - } - } - } - } - if c.mode == EmptyFields && v.JobSettings.Name == "" && Forced(v.JobSettings.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.JobSettings.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.JobSettings.Name = (r) - } - } - if !n.IsRef("parameters") { - if len(v.JobSettings.Parameters) > 0 { - cn := n.Child("parameters") - for i := range v.JobSettings.Parameters { - { - ch := cn.Elem(i) - stringsJobsJobParameterDefinition(c, &ch, &v.JobSettings.Parameters[i]) - } - } - } - } - if c.mode == EmptyFields && v.JobSettings.ParentPath == "" && Forced(v.JobSettings.ForceSendFields, "ParentPath") { - ch := n.Child("parent_path") - c.fn(&ch, "") - } - if s := string(v.JobSettings.ParentPath); c.match(s) { - ch := n.Child("parent_path") - if r, ok := c.fn(&ch, s); ok { - v.JobSettings.ParentPath = (r) - } - } - if c.mode == EmptyFields && v.JobSettings.PerformanceTarget == "" && Forced(v.JobSettings.ForceSendFields, "PerformanceTarget") { - ch := n.Child("performance_target") - c.fn(&ch, "") - } - if s := string(v.JobSettings.PerformanceTarget); c.match(s) { - ch := n.Child("performance_target") - if r, ok := c.fn(&ch, s); ok { - v.JobSettings.PerformanceTarget = jobs.PerformanceTarget(r) - } - } - if !n.IsRef("run_as") { - if x := v.JobSettings.RunAs; x != nil { - ch := n.Child("run_as") - stringsJobsJobRunAs(c, &ch, x) - } - } - if !n.IsRef("schedule") { - if x := v.JobSettings.Schedule; x != nil { - ch := n.Child("schedule") - stringsJobsCronSchedule(c, &ch, x) - } - } - if !n.IsRef("tags") { - if len(v.JobSettings.Tags) > 0 { - cn := n.Child("tags") - for _, k := range sortedKeys(v.JobSettings.Tags) { - if s := string(v.JobSettings.Tags[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.JobSettings.Tags[k] = (r) - } - } - } - } - } - if !n.IsRef("tasks") { - if len(v.JobSettings.Tasks) > 0 { - cn := n.Child("tasks") - for i := range v.JobSettings.Tasks { - { - ch := cn.Elem(i) - stringsJobsTask(c, &ch, &v.JobSettings.Tasks[i]) - } - } - } - } - if !n.IsRef("trigger") { - if x := v.JobSettings.Trigger; x != nil { - ch := n.Child("trigger") - stringsJobsTriggerSettings(c, &ch, x) - } - } - if !n.IsRef("triggers") { - if len(v.JobSettings.Triggers) > 0 { - cn := n.Child("triggers") - for i := range v.JobSettings.Triggers { - { - ch := cn.Elem(i) - stringsJobsTriggerConfiguration(c, &ch, &v.JobSettings.Triggers[i]) - } - } - } - } - if c.mode == EmptyFields && v.JobSettings.UsagePolicyId == "" && Forced(v.JobSettings.ForceSendFields, "UsagePolicyId") { - ch := n.Child("usage_policy_id") - c.fn(&ch, "") - } - if s := string(v.JobSettings.UsagePolicyId); c.match(s) { - ch := n.Child("usage_policy_id") - if r, ok := c.fn(&ch, s); ok { - v.JobSettings.UsagePolicyId = (r) - } - } - if !n.IsRef("webhook_notifications") { - if x := v.JobSettings.WebhookNotifications; x != nil { - ch := n.Child("webhook_notifications") - stringsJobsWebhookNotifications(c, &ch, x) - } - } -} - -func stringsResourcesJobRun(c *stringsWalk, n *Node, v *resources.JobRun) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("lifecycle") { - if x := v.Lifecycle; x != nil { - ch := n.Child("lifecycle") - stringsResourcesJobRunLifecycle(c, &ch, x) - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("dbt_commands") { - if len(v.RunNow.DbtCommands) > 0 { - cn := n.Child("dbt_commands") - for i := range v.RunNow.DbtCommands { - if s := string(v.RunNow.DbtCommands[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.RunNow.DbtCommands[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.RunNow.DurationTarget == "" && Forced(v.RunNow.ForceSendFields, "DurationTarget") { - ch := n.Child("duration_target") - c.fn(&ch, "") - } - if s := string(v.RunNow.DurationTarget); c.match(s) { - ch := n.Child("duration_target") - if r, ok := c.fn(&ch, s); ok { - v.RunNow.DurationTarget = (r) - } - } - if c.mode == EmptyFields && v.RunNow.IdempotencyToken == "" && Forced(v.RunNow.ForceSendFields, "IdempotencyToken") { - ch := n.Child("idempotency_token") - c.fn(&ch, "") - } - if s := string(v.RunNow.IdempotencyToken); c.match(s) { - ch := n.Child("idempotency_token") - if r, ok := c.fn(&ch, s); ok { - v.RunNow.IdempotencyToken = (r) - } - } - if !n.IsRef("jar_params") { - if len(v.RunNow.JarParams) > 0 { - cn := n.Child("jar_params") - for i := range v.RunNow.JarParams { - if s := string(v.RunNow.JarParams[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.RunNow.JarParams[i] = (r) - } - } - } - } - } - if !n.IsRef("job_parameters") { - if len(v.RunNow.JobParameters) > 0 { - cn := n.Child("job_parameters") - for _, k := range sortedKeys(v.RunNow.JobParameters) { - if s := string(v.RunNow.JobParameters[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.RunNow.JobParameters[k] = (r) - } - } - } - } - } - if !n.IsRef("notebook_params") { - if len(v.RunNow.NotebookParams) > 0 { - cn := n.Child("notebook_params") - for _, k := range sortedKeys(v.RunNow.NotebookParams) { - if s := string(v.RunNow.NotebookParams[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.RunNow.NotebookParams[k] = (r) - } - } - } - } - } - if !n.IsRef("only") { - if len(v.RunNow.Only) > 0 { - cn := n.Child("only") - for i := range v.RunNow.Only { - if s := string(v.RunNow.Only[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.RunNow.Only[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.RunNow.PerformanceTarget == "" && Forced(v.RunNow.ForceSendFields, "PerformanceTarget") { - ch := n.Child("performance_target") - c.fn(&ch, "") - } - if s := string(v.RunNow.PerformanceTarget); c.match(s) { - ch := n.Child("performance_target") - if r, ok := c.fn(&ch, s); ok { - v.RunNow.PerformanceTarget = jobs.PerformanceTarget(r) - } - } - if !n.IsRef("pipeline_params") { - if x := v.RunNow.PipelineParams; x != nil { - ch := n.Child("pipeline_params") - stringsJobsPipelineParams(c, &ch, x) - } - } - if !n.IsRef("python_named_params") { - if len(v.RunNow.PythonNamedParams) > 0 { - cn := n.Child("python_named_params") - for _, k := range sortedKeys(v.RunNow.PythonNamedParams) { - if s := string(v.RunNow.PythonNamedParams[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.RunNow.PythonNamedParams[k] = (r) - } - } - } - } - } - if !n.IsRef("python_params") { - if len(v.RunNow.PythonParams) > 0 { - cn := n.Child("python_params") - for i := range v.RunNow.PythonParams { - if s := string(v.RunNow.PythonParams[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.RunNow.PythonParams[i] = (r) - } - } - } - } - } - if !n.IsRef("spark_submit_params") { - if len(v.RunNow.SparkSubmitParams) > 0 { - cn := n.Child("spark_submit_params") - for i := range v.RunNow.SparkSubmitParams { - if s := string(v.RunNow.SparkSubmitParams[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.RunNow.SparkSubmitParams[i] = (r) - } - } - } - } - } - if !n.IsRef("sql_params") { - if len(v.RunNow.SqlParams) > 0 { - cn := n.Child("sql_params") - for _, k := range sortedKeys(v.RunNow.SqlParams) { - if s := string(v.RunNow.SqlParams[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.RunNow.SqlParams[k] = (r) - } - } - } - } - } -} - -func stringsResourcesPipeline(c *stringsWalk, n *Node, v *resources.Pipeline) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesPipelinePermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if c.mode == EmptyFields && v.CreatePipeline.BudgetPolicyId == "" && Forced(v.CreatePipeline.ForceSendFields, "BudgetPolicyId") { - ch := n.Child("budget_policy_id") - c.fn(&ch, "") - } - if s := string(v.CreatePipeline.BudgetPolicyId); c.match(s) { - ch := n.Child("budget_policy_id") - if r, ok := c.fn(&ch, s); ok { - v.CreatePipeline.BudgetPolicyId = (r) - } - } - if c.mode == EmptyFields && v.CreatePipeline.Catalog == "" && Forced(v.CreatePipeline.ForceSendFields, "Catalog") { - ch := n.Child("catalog") - c.fn(&ch, "") - } - if s := string(v.CreatePipeline.Catalog); c.match(s) { - ch := n.Child("catalog") - if r, ok := c.fn(&ch, s); ok { - v.CreatePipeline.Catalog = (r) - } - } - if c.mode == EmptyFields && v.CreatePipeline.Channel == "" && Forced(v.CreatePipeline.ForceSendFields, "Channel") { - ch := n.Child("channel") - c.fn(&ch, "") - } - if s := string(v.CreatePipeline.Channel); c.match(s) { - ch := n.Child("channel") - if r, ok := c.fn(&ch, s); ok { - v.CreatePipeline.Channel = (r) - } - } - if !n.IsRef("clusters") { - if len(v.CreatePipeline.Clusters) > 0 { - cn := n.Child("clusters") - for i := range v.CreatePipeline.Clusters { - { - ch := cn.Elem(i) - stringsPipelinesPipelineCluster(c, &ch, &v.CreatePipeline.Clusters[i]) - } - } - } - } - if !n.IsRef("configuration") { - if len(v.CreatePipeline.Configuration) > 0 { - cn := n.Child("configuration") - for _, k := range sortedKeys(v.CreatePipeline.Configuration) { - if s := string(v.CreatePipeline.Configuration[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.CreatePipeline.Configuration[k] = (r) - } - } - } - } - } - if !n.IsRef("deployment") { - if x := v.CreatePipeline.Deployment; x != nil { - ch := n.Child("deployment") - stringsPipelinesPipelineDeployment(c, &ch, x) - } - } - if c.mode == EmptyFields && v.CreatePipeline.Edition == "" && Forced(v.CreatePipeline.ForceSendFields, "Edition") { - ch := n.Child("edition") - c.fn(&ch, "") - } - if s := string(v.CreatePipeline.Edition); c.match(s) { - ch := n.Child("edition") - if r, ok := c.fn(&ch, s); ok { - v.CreatePipeline.Edition = (r) - } - } - if !n.IsRef("environment") { - if x := v.CreatePipeline.Environment; x != nil { - ch := n.Child("environment") - stringsPipelinesPipelinesEnvironment(c, &ch, x) - } - } - if !n.IsRef("event_log") { - if x := v.CreatePipeline.EventLog; x != nil { - ch := n.Child("event_log") - stringsPipelinesEventLogSpec(c, &ch, x) - } - } - if !n.IsRef("filters") { - if x := v.CreatePipeline.Filters; x != nil { - ch := n.Child("filters") - stringsPipelinesFilters(c, &ch, x) - } - } - if !n.IsRef("gateway_definition") { - if x := v.CreatePipeline.GatewayDefinition; x != nil { - ch := n.Child("gateway_definition") - stringsPipelinesIngestionGatewayPipelineDefinition(c, &ch, x) - } - } - if !n.IsRef("ingestion_definition") { - if x := v.CreatePipeline.IngestionDefinition; x != nil { - ch := n.Child("ingestion_definition") - stringsPipelinesIngestionPipelineDefinition(c, &ch, x) - } - } - if !n.IsRef("libraries") { - if len(v.CreatePipeline.Libraries) > 0 { - cn := n.Child("libraries") - for i := range v.CreatePipeline.Libraries { - { - ch := cn.Elem(i) - stringsPipelinesPipelineLibrary(c, &ch, &v.CreatePipeline.Libraries[i]) - } - } - } - } - if c.mode == EmptyFields && v.CreatePipeline.Name == "" && Forced(v.CreatePipeline.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.CreatePipeline.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.CreatePipeline.Name = (r) - } - } - if !n.IsRef("notifications") { - if len(v.CreatePipeline.Notifications) > 0 { - cn := n.Child("notifications") - for i := range v.CreatePipeline.Notifications { - { - ch := cn.Elem(i) - stringsPipelinesNotifications(c, &ch, &v.CreatePipeline.Notifications[i]) - } - } - } - } - if !n.IsRef("parameters") { - if len(v.CreatePipeline.Parameters) > 0 { - cn := n.Child("parameters") - for _, k := range sortedKeys(v.CreatePipeline.Parameters) { - if s := string(v.CreatePipeline.Parameters[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.CreatePipeline.Parameters[k] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.CreatePipeline.ParentPath == "" && Forced(v.CreatePipeline.ForceSendFields, "ParentPath") { - ch := n.Child("parent_path") - c.fn(&ch, "") - } - if s := string(v.CreatePipeline.ParentPath); c.match(s) { - ch := n.Child("parent_path") - if r, ok := c.fn(&ch, s); ok { - v.CreatePipeline.ParentPath = (r) - } - } - if !n.IsRef("restart_window") { - if x := v.CreatePipeline.RestartWindow; x != nil { - ch := n.Child("restart_window") - stringsPipelinesRestartWindow(c, &ch, x) - } - } - if c.mode == EmptyFields && v.CreatePipeline.RootPath == "" && Forced(v.CreatePipeline.ForceSendFields, "RootPath") { - ch := n.Child("root_path") - c.fn(&ch, "") - } - if s := string(v.CreatePipeline.RootPath); c.match(s) { - ch := n.Child("root_path") - if r, ok := c.fn(&ch, s); ok { - v.CreatePipeline.RootPath = (r) - } - } - if !n.IsRef("run_as") { - if x := v.CreatePipeline.RunAs; x != nil { - ch := n.Child("run_as") - stringsPipelinesRunAs(c, &ch, x) - } - } - if c.mode == EmptyFields && v.CreatePipeline.Schema == "" && Forced(v.CreatePipeline.ForceSendFields, "Schema") { - ch := n.Child("schema") - c.fn(&ch, "") - } - if s := string(v.CreatePipeline.Schema); c.match(s) { - ch := n.Child("schema") - if r, ok := c.fn(&ch, s); ok { - v.CreatePipeline.Schema = (r) - } - } - if c.mode == EmptyFields && v.CreatePipeline.ServerlessComputeId == "" && Forced(v.CreatePipeline.ForceSendFields, "ServerlessComputeId") { - ch := n.Child("serverless_compute_id") - c.fn(&ch, "") - } - if s := string(v.CreatePipeline.ServerlessComputeId); c.match(s) { - ch := n.Child("serverless_compute_id") - if r, ok := c.fn(&ch, s); ok { - v.CreatePipeline.ServerlessComputeId = (r) - } - } - if c.mode == EmptyFields && v.CreatePipeline.Storage == "" && Forced(v.CreatePipeline.ForceSendFields, "Storage") { - ch := n.Child("storage") - c.fn(&ch, "") - } - if s := string(v.CreatePipeline.Storage); c.match(s) { - ch := n.Child("storage") - if r, ok := c.fn(&ch, s); ok { - v.CreatePipeline.Storage = (r) - } - } - if !n.IsRef("tags") { - if len(v.CreatePipeline.Tags) > 0 { - cn := n.Child("tags") - for _, k := range sortedKeys(v.CreatePipeline.Tags) { - if s := string(v.CreatePipeline.Tags[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.CreatePipeline.Tags[k] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.CreatePipeline.Target == "" && Forced(v.CreatePipeline.ForceSendFields, "Target") { - ch := n.Child("target") - c.fn(&ch, "") - } - if s := string(v.CreatePipeline.Target); c.match(s) { - ch := n.Child("target") - if r, ok := c.fn(&ch, s); ok { - v.CreatePipeline.Target = (r) - } - } - if !n.IsRef("trigger") { - if x := v.CreatePipeline.Trigger; x != nil { - ch := n.Child("trigger") - stringsPipelinesPipelineTrigger(c, &ch, x) - } - } - if c.mode == EmptyFields && v.CreatePipeline.UsagePolicyId == "" && Forced(v.CreatePipeline.ForceSendFields, "UsagePolicyId") { - ch := n.Child("usage_policy_id") - c.fn(&ch, "") - } - if s := string(v.CreatePipeline.UsagePolicyId); c.match(s) { - ch := n.Child("usage_policy_id") - if r, ok := c.fn(&ch, s); ok { - v.CreatePipeline.UsagePolicyId = (r) - } - } -} - -func stringsResourcesFeature(c *stringsWalk, n *Node, v *resources.Feature) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if c.mode == EmptyFields && v.Feature.CatalogName == "" && Forced(v.Feature.ForceSendFields, "CatalogName") { - ch := n.Child("catalog_name") - c.fn(&ch, "") - } - if s := string(v.Feature.CatalogName); c.match(s) { - ch := n.Child("catalog_name") - if r, ok := c.fn(&ch, s); ok { - v.Feature.CatalogName = (r) - } - } - if c.mode == EmptyFields && v.Feature.CreatedBy == "" && Forced(v.Feature.ForceSendFields, "CreatedBy") { - ch := n.Child("created_by") - c.fn(&ch, "") - } - if s := string(v.Feature.CreatedBy); c.match(s) { - ch := n.Child("created_by") - if r, ok := c.fn(&ch, s); ok { - v.Feature.CreatedBy = (r) - } - } - if c.mode == EmptyFields && v.Feature.Description == "" && Forced(v.Feature.ForceSendFields, "Description") { - ch := n.Child("description") - c.fn(&ch, "") - } - if s := string(v.Feature.Description); c.match(s) { - ch := n.Child("description") - if r, ok := c.fn(&ch, s); ok { - v.Feature.Description = (r) - } - } - if !n.IsRef("entities") { - if len(v.Feature.Entities) > 0 { - cn := n.Child("entities") - for i := range v.Feature.Entities { - { - ch := cn.Elem(i) - stringsMlEntityColumn(c, &ch, &v.Feature.Entities[i]) - } - } - } - } - if c.mode == EmptyFields && v.Feature.FilterCondition == "" && Forced(v.Feature.ForceSendFields, "FilterCondition") { - ch := n.Child("filter_condition") - c.fn(&ch, "") - } - if s := string(v.Feature.FilterCondition); c.match(s) { - ch := n.Child("filter_condition") - if r, ok := c.fn(&ch, s); ok { - v.Feature.FilterCondition = (r) - } - } - if s := string(v.Feature.FullName); c.match(s) { - ch := n.Child("full_name") - if r, ok := c.fn(&ch, s); ok { - v.Feature.FullName = (r) - } - } - if !n.IsRef("function") { - { - ch := n.Child("function") - stringsMlFunction(c, &ch, &v.Feature.Function) - } - } - if !n.IsRef("inputs") { - if len(v.Feature.Inputs) > 0 { - cn := n.Child("inputs") - for i := range v.Feature.Inputs { - if s := string(v.Feature.Inputs[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Feature.Inputs[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.Feature.Name == "" && Forced(v.Feature.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.Feature.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Feature.Name = (r) - } - } - if c.mode == EmptyFields && v.Feature.SchemaName == "" && Forced(v.Feature.ForceSendFields, "SchemaName") { - ch := n.Child("schema_name") - c.fn(&ch, "") - } - if s := string(v.Feature.SchemaName); c.match(s) { - ch := n.Child("schema_name") - if r, ok := c.fn(&ch, s); ok { - v.Feature.SchemaName = (r) - } - } - if !n.IsRef("source") { - { - ch := n.Child("source") - stringsMlDataSource(c, &ch, &v.Feature.Source) - } - } - if !n.IsRef("time_window") { - if x := v.Feature.TimeWindow; x != nil { - ch := n.Child("time_window") - stringsMlTimeWindow(c, &ch, x) - } - } - if !n.IsRef("timeseries_column") { - if x := v.Feature.TimeseriesColumn; x != nil { - ch := n.Child("timeseries_column") - stringsMlTimeseriesColumn(c, &ch, x) - } - } -} - -func stringsResourcesMlflowModel(c *stringsWalk, n *Node, v *resources.MlflowModel) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesMlflowModelPermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if c.mode == EmptyFields && v.CreateModelRequest.Description == "" && Forced(v.CreateModelRequest.ForceSendFields, "Description") { - ch := n.Child("description") - c.fn(&ch, "") - } - if s := string(v.CreateModelRequest.Description); c.match(s) { - ch := n.Child("description") - if r, ok := c.fn(&ch, s); ok { - v.CreateModelRequest.Description = (r) - } - } - if s := string(v.CreateModelRequest.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.CreateModelRequest.Name = (r) - } - } - if !n.IsRef("tags") { - if len(v.CreateModelRequest.Tags) > 0 { - cn := n.Child("tags") - for i := range v.CreateModelRequest.Tags { - { - ch := cn.Elem(i) - stringsMlModelTag(c, &ch, &v.CreateModelRequest.Tags[i]) - } - } - } - } -} - -func stringsResourcesMlflowExperiment(c *stringsWalk, n *Node, v *resources.MlflowExperiment) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesMlflowExperimentPermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if c.mode == EmptyFields && v.CreateExperiment.ArtifactLocation == "" && Forced(v.CreateExperiment.ForceSendFields, "ArtifactLocation") { - ch := n.Child("artifact_location") - c.fn(&ch, "") - } - if s := string(v.CreateExperiment.ArtifactLocation); c.match(s) { - ch := n.Child("artifact_location") - if r, ok := c.fn(&ch, s); ok { - v.CreateExperiment.ArtifactLocation = (r) - } - } - if s := string(v.CreateExperiment.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.CreateExperiment.Name = (r) - } - } - if !n.IsRef("tags") { - if len(v.CreateExperiment.Tags) > 0 { - cn := n.Child("tags") - for i := range v.CreateExperiment.Tags { - { - ch := cn.Elem(i) - stringsMlExperimentTag(c, &ch, &v.CreateExperiment.Tags[i]) - } - } - } - } - if !n.IsRef("trace_location") { - if x := v.CreateExperiment.TraceLocation; x != nil { - ch := n.Child("trace_location") - stringsMlExperimentTraceLocation(c, &ch, x) - } - } -} - -func stringsResourcesModelServingEndpoint(c *stringsWalk, n *Node, v *resources.ModelServingEndpoint) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesModelServingEndpointPermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if !n.IsRef("ai_gateway") { - if x := v.CreateServingEndpoint.AiGateway; x != nil { - ch := n.Child("ai_gateway") - stringsServingAiGatewayConfig(c, &ch, x) - } - } - if c.mode == EmptyFields && v.CreateServingEndpoint.BudgetPolicyId == "" && Forced(v.CreateServingEndpoint.ForceSendFields, "BudgetPolicyId") { - ch := n.Child("budget_policy_id") - c.fn(&ch, "") - } - if s := string(v.CreateServingEndpoint.BudgetPolicyId); c.match(s) { - ch := n.Child("budget_policy_id") - if r, ok := c.fn(&ch, s); ok { - v.CreateServingEndpoint.BudgetPolicyId = (r) - } - } - if !n.IsRef("config") { - if x := v.CreateServingEndpoint.Config; x != nil { - ch := n.Child("config") - stringsServingEndpointCoreConfigInput(c, &ch, x) - } - } - if c.mode == EmptyFields && v.CreateServingEndpoint.Description == "" && Forced(v.CreateServingEndpoint.ForceSendFields, "Description") { - ch := n.Child("description") - c.fn(&ch, "") - } - if s := string(v.CreateServingEndpoint.Description); c.match(s) { - ch := n.Child("description") - if r, ok := c.fn(&ch, s); ok { - v.CreateServingEndpoint.Description = (r) - } - } - if !n.IsRef("email_notifications") { - if x := v.CreateServingEndpoint.EmailNotifications; x != nil { - ch := n.Child("email_notifications") - stringsServingEmailNotifications(c, &ch, x) - } - } - if s := string(v.CreateServingEndpoint.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.CreateServingEndpoint.Name = (r) - } - } - if !n.IsRef("rate_limits") { - if len(v.CreateServingEndpoint.RateLimits) > 0 { - cn := n.Child("rate_limits") - for i := range v.CreateServingEndpoint.RateLimits { - { - ch := cn.Elem(i) - stringsServingRateLimit(c, &ch, &v.CreateServingEndpoint.RateLimits[i]) - } - } - } - } - if !n.IsRef("tags") { - if len(v.CreateServingEndpoint.Tags) > 0 { - cn := n.Child("tags") - for i := range v.CreateServingEndpoint.Tags { - { - ch := cn.Elem(i) - stringsServingEndpointTag(c, &ch, &v.CreateServingEndpoint.Tags[i]) - } - } - } - } - if !n.IsRef("telemetry_config") { - if x := v.CreateServingEndpoint.TelemetryConfig; x != nil { - ch := n.Child("telemetry_config") - stringsServingTelemetryConfig(c, &ch, x) - } - } -} - -func stringsResourcesModelService(c *stringsWalk, n *Node, v *resources.ModelService) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("grants") { - if len(v.Grants) > 0 { - cn := n.Child("grants") - for i := range v.Grants { - { - ch := cn.Elem(i) - stringsCatalogPrivilegeAssignment(c, &ch, &v.Grants[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if s := string(v.ModelServiceConfig.Parent); c.match(s) { - ch := n.Child("parent") - if r, ok := c.fn(&ch, s); ok { - v.ModelServiceConfig.Parent = (r) - } - } - if s := string(v.ModelServiceConfig.ModelServiceId); c.match(s) { - ch := n.Child("model_service_id") - if r, ok := c.fn(&ch, s); ok { - v.ModelServiceConfig.ModelServiceId = (r) - } - } - if c.mode == EmptyFields && v.ModelServiceConfig.Comment == "" && Forced(v.ModelServiceConfig.ForceSendFields, "Comment") { - ch := n.Child("comment") - c.fn(&ch, "") - } - if s := string(v.ModelServiceConfig.Comment); c.match(s) { - ch := n.Child("comment") - if r, ok := c.fn(&ch, s); ok { - v.ModelServiceConfig.Comment = (r) - } - } - if !n.IsRef("config") { - if x := v.ModelServiceConfig.Config; x != nil { - ch := n.Child("config") - stringsCatalogModelServiceConfig(c, &ch, x) - } - } -} - -func stringsResourcesMcpService(c *stringsWalk, n *Node, v *resources.McpService) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("grants") { - if len(v.Grants) > 0 { - cn := n.Child("grants") - for i := range v.Grants { - { - ch := cn.Elem(i) - stringsCatalogPrivilegeAssignment(c, &ch, &v.Grants[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if s := string(v.McpServiceConfig.Parent); c.match(s) { - ch := n.Child("parent") - if r, ok := c.fn(&ch, s); ok { - v.McpServiceConfig.Parent = (r) - } - } - if s := string(v.McpServiceConfig.McpServiceId); c.match(s) { - ch := n.Child("mcp_service_id") - if r, ok := c.fn(&ch, s); ok { - v.McpServiceConfig.McpServiceId = (r) - } - } - if c.mode == EmptyFields && v.McpServiceConfig.Comment == "" && Forced(v.McpServiceConfig.ForceSendFields, "Comment") { - ch := n.Child("comment") - c.fn(&ch, "") - } - if s := string(v.McpServiceConfig.Comment); c.match(s) { - ch := n.Child("comment") - if r, ok := c.fn(&ch, s); ok { - v.McpServiceConfig.Comment = (r) - } - } - if !n.IsRef("config") { - if x := v.McpServiceConfig.Config; x != nil { - ch := n.Child("config") - stringsCatalogMcpServiceConfig(c, &ch, x) - } - } -} - -func stringsResourcesModelProviderService(c *stringsWalk, n *Node, v *resources.ModelProviderService) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("grants") { - if len(v.Grants) > 0 { - cn := n.Child("grants") - for i := range v.Grants { - { - ch := cn.Elem(i) - stringsCatalogPrivilegeAssignment(c, &ch, &v.Grants[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if s := string(v.ModelProviderServiceConfig.Parent); c.match(s) { - ch := n.Child("parent") - if r, ok := c.fn(&ch, s); ok { - v.ModelProviderServiceConfig.Parent = (r) - } - } - if s := string(v.ModelProviderServiceConfig.ModelProviderServiceId); c.match(s) { - ch := n.Child("model_provider_service_id") - if r, ok := c.fn(&ch, s); ok { - v.ModelProviderServiceConfig.ModelProviderServiceId = (r) - } - } - if c.mode == EmptyFields && v.ModelProviderServiceConfig.Comment == "" && Forced(v.ModelProviderServiceConfig.ForceSendFields, "Comment") { - ch := n.Child("comment") - c.fn(&ch, "") - } - if s := string(v.ModelProviderServiceConfig.Comment); c.match(s) { - ch := n.Child("comment") - if r, ok := c.fn(&ch, s); ok { - v.ModelProviderServiceConfig.Comment = (r) - } - } - if !n.IsRef("config") { - if x := v.ModelProviderServiceConfig.Config; x != nil { - ch := n.Child("config") - stringsCatalogModelProviderServiceConfig(c, &ch, x) - } - } -} - -func stringsResourcesRegisteredModel(c *stringsWalk, n *Node, v *resources.RegisteredModel) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("grants") { - if len(v.Grants) > 0 { - cn := n.Child("grants") - for i := range v.Grants { - { - ch := cn.Elem(i) - stringsCatalogPrivilegeAssignment(c, &ch, &v.Grants[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if !n.IsRef("aliases") { - if len(v.CreateRegisteredModelRequest.Aliases) > 0 { - cn := n.Child("aliases") - for i := range v.CreateRegisteredModelRequest.Aliases { - { - ch := cn.Elem(i) - stringsCatalogRegisteredModelAlias(c, &ch, &v.CreateRegisteredModelRequest.Aliases[i]) - } - } - } - } - if c.mode == EmptyFields && v.CreateRegisteredModelRequest.CatalogName == "" && Forced(v.CreateRegisteredModelRequest.ForceSendFields, "CatalogName") { - ch := n.Child("catalog_name") - c.fn(&ch, "") - } - if s := string(v.CreateRegisteredModelRequest.CatalogName); c.match(s) { - ch := n.Child("catalog_name") - if r, ok := c.fn(&ch, s); ok { - v.CreateRegisteredModelRequest.CatalogName = (r) - } - } - if c.mode == EmptyFields && v.CreateRegisteredModelRequest.Comment == "" && Forced(v.CreateRegisteredModelRequest.ForceSendFields, "Comment") { - ch := n.Child("comment") - c.fn(&ch, "") - } - if s := string(v.CreateRegisteredModelRequest.Comment); c.match(s) { - ch := n.Child("comment") - if r, ok := c.fn(&ch, s); ok { - v.CreateRegisteredModelRequest.Comment = (r) - } - } - if c.mode == EmptyFields && v.CreateRegisteredModelRequest.CreatedBy == "" && Forced(v.CreateRegisteredModelRequest.ForceSendFields, "CreatedBy") { - ch := n.Child("created_by") - c.fn(&ch, "") - } - if s := string(v.CreateRegisteredModelRequest.CreatedBy); c.match(s) { - ch := n.Child("created_by") - if r, ok := c.fn(&ch, s); ok { - v.CreateRegisteredModelRequest.CreatedBy = (r) - } - } - if c.mode == EmptyFields && v.CreateRegisteredModelRequest.FullName == "" && Forced(v.CreateRegisteredModelRequest.ForceSendFields, "FullName") { - ch := n.Child("full_name") - c.fn(&ch, "") - } - if s := string(v.CreateRegisteredModelRequest.FullName); c.match(s) { - ch := n.Child("full_name") - if r, ok := c.fn(&ch, s); ok { - v.CreateRegisteredModelRequest.FullName = (r) - } - } - if c.mode == EmptyFields && v.CreateRegisteredModelRequest.MetastoreId == "" && Forced(v.CreateRegisteredModelRequest.ForceSendFields, "MetastoreId") { - ch := n.Child("metastore_id") - c.fn(&ch, "") - } - if s := string(v.CreateRegisteredModelRequest.MetastoreId); c.match(s) { - ch := n.Child("metastore_id") - if r, ok := c.fn(&ch, s); ok { - v.CreateRegisteredModelRequest.MetastoreId = (r) - } - } - if c.mode == EmptyFields && v.CreateRegisteredModelRequest.Name == "" && Forced(v.CreateRegisteredModelRequest.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.CreateRegisteredModelRequest.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.CreateRegisteredModelRequest.Name = (r) - } - } - if c.mode == EmptyFields && v.CreateRegisteredModelRequest.Owner == "" && Forced(v.CreateRegisteredModelRequest.ForceSendFields, "Owner") { - ch := n.Child("owner") - c.fn(&ch, "") - } - if s := string(v.CreateRegisteredModelRequest.Owner); c.match(s) { - ch := n.Child("owner") - if r, ok := c.fn(&ch, s); ok { - v.CreateRegisteredModelRequest.Owner = (r) - } - } - if c.mode == EmptyFields && v.CreateRegisteredModelRequest.SchemaName == "" && Forced(v.CreateRegisteredModelRequest.ForceSendFields, "SchemaName") { - ch := n.Child("schema_name") - c.fn(&ch, "") - } - if s := string(v.CreateRegisteredModelRequest.SchemaName); c.match(s) { - ch := n.Child("schema_name") - if r, ok := c.fn(&ch, s); ok { - v.CreateRegisteredModelRequest.SchemaName = (r) - } - } - if c.mode == EmptyFields && v.CreateRegisteredModelRequest.StorageLocation == "" && Forced(v.CreateRegisteredModelRequest.ForceSendFields, "StorageLocation") { - ch := n.Child("storage_location") - c.fn(&ch, "") - } - if s := string(v.CreateRegisteredModelRequest.StorageLocation); c.match(s) { - ch := n.Child("storage_location") - if r, ok := c.fn(&ch, s); ok { - v.CreateRegisteredModelRequest.StorageLocation = (r) - } - } - if c.mode == EmptyFields && v.CreateRegisteredModelRequest.UpdatedBy == "" && Forced(v.CreateRegisteredModelRequest.ForceSendFields, "UpdatedBy") { - ch := n.Child("updated_by") - c.fn(&ch, "") - } - if s := string(v.CreateRegisteredModelRequest.UpdatedBy); c.match(s) { - ch := n.Child("updated_by") - if r, ok := c.fn(&ch, s); ok { - v.CreateRegisteredModelRequest.UpdatedBy = (r) - } - } -} - -func stringsResourcesQualityMonitor(c *stringsWalk, n *Node, v *resources.QualityMonitor) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if s := string(v.TableName); c.match(s) { - ch := n.Child("table_name") - if r, ok := c.fn(&ch, s); ok { - v.TableName = (r) - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if s := string(v.CreateMonitor.AssetsDir); c.match(s) { - ch := n.Child("assets_dir") - if r, ok := c.fn(&ch, s); ok { - v.CreateMonitor.AssetsDir = (r) - } - } - if c.mode == EmptyFields && v.CreateMonitor.BaselineTableName == "" && Forced(v.CreateMonitor.ForceSendFields, "BaselineTableName") { - ch := n.Child("baseline_table_name") - c.fn(&ch, "") - } - if s := string(v.CreateMonitor.BaselineTableName); c.match(s) { - ch := n.Child("baseline_table_name") - if r, ok := c.fn(&ch, s); ok { - v.CreateMonitor.BaselineTableName = (r) - } - } - if !n.IsRef("custom_metrics") { - if len(v.CreateMonitor.CustomMetrics) > 0 { - cn := n.Child("custom_metrics") - for i := range v.CreateMonitor.CustomMetrics { - { - ch := cn.Elem(i) - stringsCatalogMonitorMetric(c, &ch, &v.CreateMonitor.CustomMetrics[i]) - } - } - } - } - if !n.IsRef("inference_log") { - if x := v.CreateMonitor.InferenceLog; x != nil { - ch := n.Child("inference_log") - stringsCatalogMonitorInferenceLog(c, &ch, x) - } - } - if c.mode == EmptyFields && v.CreateMonitor.LatestMonitorFailureMsg == "" && Forced(v.CreateMonitor.ForceSendFields, "LatestMonitorFailureMsg") { - ch := n.Child("latest_monitor_failure_msg") - c.fn(&ch, "") - } - if s := string(v.CreateMonitor.LatestMonitorFailureMsg); c.match(s) { - ch := n.Child("latest_monitor_failure_msg") - if r, ok := c.fn(&ch, s); ok { - v.CreateMonitor.LatestMonitorFailureMsg = (r) - } - } - if !n.IsRef("notifications") { - if x := v.CreateMonitor.Notifications; x != nil { - ch := n.Child("notifications") - stringsCatalogMonitorNotifications(c, &ch, x) - } - } - if s := string(v.CreateMonitor.OutputSchemaName); c.match(s) { - ch := n.Child("output_schema_name") - if r, ok := c.fn(&ch, s); ok { - v.CreateMonitor.OutputSchemaName = (r) - } - } - if !n.IsRef("schedule") { - if x := v.CreateMonitor.Schedule; x != nil { - ch := n.Child("schedule") - stringsCatalogMonitorCronSchedule(c, &ch, x) - } - } - if !n.IsRef("slicing_exprs") { - if len(v.CreateMonitor.SlicingExprs) > 0 { - cn := n.Child("slicing_exprs") - for i := range v.CreateMonitor.SlicingExprs { - if s := string(v.CreateMonitor.SlicingExprs[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.CreateMonitor.SlicingExprs[i] = (r) - } - } - } - } - } - if !n.IsRef("time_series") { - if x := v.CreateMonitor.TimeSeries; x != nil { - ch := n.Child("time_series") - stringsCatalogMonitorTimeSeries(c, &ch, x) - } - } - if c.mode == EmptyFields && v.CreateMonitor.WarehouseId == "" && Forced(v.CreateMonitor.ForceSendFields, "WarehouseId") { - ch := n.Child("warehouse_id") - c.fn(&ch, "") - } - if s := string(v.CreateMonitor.WarehouseId); c.match(s) { - ch := n.Child("warehouse_id") - if r, ok := c.fn(&ch, s); ok { - v.CreateMonitor.WarehouseId = (r) - } - } -} - -func stringsResourcesCatalog(c *stringsWalk, n *Node, v *resources.Catalog) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("grants") { - if len(v.Grants) > 0 { - cn := n.Child("grants") - for i := range v.Grants { - { - ch := cn.Elem(i) - stringsCatalogPrivilegeAssignment(c, &ch, &v.Grants[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if c.mode == EmptyFields && v.CreateCatalog.Comment == "" && Forced(v.CreateCatalog.ForceSendFields, "Comment") { - ch := n.Child("comment") - c.fn(&ch, "") - } - if s := string(v.CreateCatalog.Comment); c.match(s) { - ch := n.Child("comment") - if r, ok := c.fn(&ch, s); ok { - v.CreateCatalog.Comment = (r) - } - } - if c.mode == EmptyFields && v.CreateCatalog.ConnectionName == "" && Forced(v.CreateCatalog.ForceSendFields, "ConnectionName") { - ch := n.Child("connection_name") - c.fn(&ch, "") - } - if s := string(v.CreateCatalog.ConnectionName); c.match(s) { - ch := n.Child("connection_name") - if r, ok := c.fn(&ch, s); ok { - v.CreateCatalog.ConnectionName = (r) - } - } - if !n.IsRef("managed_encryption_settings") { - if x := v.CreateCatalog.ManagedEncryptionSettings; x != nil { - ch := n.Child("managed_encryption_settings") - stringsCatalogEncryptionSettings(c, &ch, x) - } - } - if s := string(v.CreateCatalog.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.CreateCatalog.Name = (r) - } - } - if !n.IsRef("options") { - if len(v.CreateCatalog.Options) > 0 { - cn := n.Child("options") - for _, k := range sortedKeys(v.CreateCatalog.Options) { - if s := string(v.CreateCatalog.Options[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.CreateCatalog.Options[k] = (r) - } - } - } - } - } - if !n.IsRef("properties") { - if len(v.CreateCatalog.Properties) > 0 { - cn := n.Child("properties") - for _, k := range sortedKeys(v.CreateCatalog.Properties) { - if s := string(v.CreateCatalog.Properties[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.CreateCatalog.Properties[k] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.CreateCatalog.ProviderName == "" && Forced(v.CreateCatalog.ForceSendFields, "ProviderName") { - ch := n.Child("provider_name") - c.fn(&ch, "") - } - if s := string(v.CreateCatalog.ProviderName); c.match(s) { - ch := n.Child("provider_name") - if r, ok := c.fn(&ch, s); ok { - v.CreateCatalog.ProviderName = (r) - } - } - if c.mode == EmptyFields && v.CreateCatalog.ShareName == "" && Forced(v.CreateCatalog.ForceSendFields, "ShareName") { - ch := n.Child("share_name") - c.fn(&ch, "") - } - if s := string(v.CreateCatalog.ShareName); c.match(s) { - ch := n.Child("share_name") - if r, ok := c.fn(&ch, s); ok { - v.CreateCatalog.ShareName = (r) - } - } - if c.mode == EmptyFields && v.CreateCatalog.StorageRoot == "" && Forced(v.CreateCatalog.ForceSendFields, "StorageRoot") { - ch := n.Child("storage_root") - c.fn(&ch, "") - } - if s := string(v.CreateCatalog.StorageRoot); c.match(s) { - ch := n.Child("storage_root") - if r, ok := c.fn(&ch, s); ok { - v.CreateCatalog.StorageRoot = (r) - } - } -} - -func stringsResourcesSchema(c *stringsWalk, n *Node, v *resources.Schema) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("grants") { - if len(v.Grants) > 0 { - cn := n.Child("grants") - for i := range v.Grants { - { - ch := cn.Elem(i) - stringsCatalogPrivilegeAssignment(c, &ch, &v.Grants[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if s := string(v.CreateSchema.CatalogName); c.match(s) { - ch := n.Child("catalog_name") - if r, ok := c.fn(&ch, s); ok { - v.CreateSchema.CatalogName = (r) - } - } - if c.mode == EmptyFields && v.CreateSchema.Comment == "" && Forced(v.CreateSchema.ForceSendFields, "Comment") { - ch := n.Child("comment") - c.fn(&ch, "") - } - if s := string(v.CreateSchema.Comment); c.match(s) { - ch := n.Child("comment") - if r, ok := c.fn(&ch, s); ok { - v.CreateSchema.Comment = (r) - } - } - if s := string(v.CreateSchema.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.CreateSchema.Name = (r) - } - } - if !n.IsRef("properties") { - if len(v.CreateSchema.Properties) > 0 { - cn := n.Child("properties") - for _, k := range sortedKeys(v.CreateSchema.Properties) { - if s := string(v.CreateSchema.Properties[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.CreateSchema.Properties[k] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.CreateSchema.StorageRoot == "" && Forced(v.CreateSchema.ForceSendFields, "StorageRoot") { - ch := n.Child("storage_root") - c.fn(&ch, "") - } - if s := string(v.CreateSchema.StorageRoot); c.match(s) { - ch := n.Child("storage_root") - if r, ok := c.fn(&ch, s); ok { - v.CreateSchema.StorageRoot = (r) - } - } -} - -func stringsResourcesVolume(c *stringsWalk, n *Node, v *resources.Volume) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if s := string(v.VolumePath); c.match(s) { - ch := n.Child("volume_path") - if r, ok := c.fn(&ch, s); ok { - v.VolumePath = (r) - } - } - if !n.IsRef("grants") { - if len(v.Grants) > 0 { - cn := n.Child("grants") - for i := range v.Grants { - { - ch := cn.Elem(i) - stringsCatalogPrivilegeAssignment(c, &ch, &v.Grants[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if s := string(v.CreateVolumeRequestContent.CatalogName); c.match(s) { - ch := n.Child("catalog_name") - if r, ok := c.fn(&ch, s); ok { - v.CreateVolumeRequestContent.CatalogName = (r) - } - } - if c.mode == EmptyFields && v.CreateVolumeRequestContent.Comment == "" && Forced(v.CreateVolumeRequestContent.ForceSendFields, "Comment") { - ch := n.Child("comment") - c.fn(&ch, "") - } - if s := string(v.CreateVolumeRequestContent.Comment); c.match(s) { - ch := n.Child("comment") - if r, ok := c.fn(&ch, s); ok { - v.CreateVolumeRequestContent.Comment = (r) - } - } - if s := string(v.CreateVolumeRequestContent.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.CreateVolumeRequestContent.Name = (r) - } - } - if s := string(v.CreateVolumeRequestContent.SchemaName); c.match(s) { - ch := n.Child("schema_name") - if r, ok := c.fn(&ch, s); ok { - v.CreateVolumeRequestContent.SchemaName = (r) - } - } - if c.mode == EmptyFields && v.CreateVolumeRequestContent.StorageLocation == "" && Forced(v.CreateVolumeRequestContent.ForceSendFields, "StorageLocation") { - ch := n.Child("storage_location") - c.fn(&ch, "") - } - if s := string(v.CreateVolumeRequestContent.StorageLocation); c.match(s) { - ch := n.Child("storage_location") - if r, ok := c.fn(&ch, s); ok { - v.CreateVolumeRequestContent.StorageLocation = (r) - } - } - if s := string(v.CreateVolumeRequestContent.VolumeType); c.match(s) { - ch := n.Child("volume_type") - if r, ok := c.fn(&ch, s); ok { - v.CreateVolumeRequestContent.VolumeType = catalog.VolumeType(r) - } - } -} - -func stringsResourcesExternalLocation(c *stringsWalk, n *Node, v *resources.ExternalLocation) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if s := string(v.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.Lifecycle) - } - } - if !n.IsRef("grants") { - if len(v.Grants) > 0 { - cn := n.Child("grants") - for i := range v.Grants { - { - ch := cn.Elem(i) - stringsCatalogPrivilegeAssignment(c, &ch, &v.Grants[i]) - } - } - } - } - if c.mode == EmptyFields && v.CreateExternalLocation.Comment == "" && Forced(v.CreateExternalLocation.ForceSendFields, "Comment") { - ch := n.Child("comment") - c.fn(&ch, "") - } - if s := string(v.CreateExternalLocation.Comment); c.match(s) { - ch := n.Child("comment") - if r, ok := c.fn(&ch, s); ok { - v.CreateExternalLocation.Comment = (r) - } - } - if s := string(v.CreateExternalLocation.CredentialName); c.match(s) { - ch := n.Child("credential_name") - if r, ok := c.fn(&ch, s); ok { - v.CreateExternalLocation.CredentialName = (r) - } - } - if !n.IsRef("effective_file_event_queue") { - if x := v.CreateExternalLocation.EffectiveFileEventQueue; x != nil { - ch := n.Child("effective_file_event_queue") - stringsCatalogFileEventQueue(c, &ch, x) - } - } - if !n.IsRef("encryption_details") { - if x := v.CreateExternalLocation.EncryptionDetails; x != nil { - ch := n.Child("encryption_details") - stringsCatalogEncryptionDetails(c, &ch, x) - } - } - if !n.IsRef("file_event_queue") { - if x := v.CreateExternalLocation.FileEventQueue; x != nil { - ch := n.Child("file_event_queue") - stringsCatalogFileEventQueue(c, &ch, x) - } - } - if s := string(v.CreateExternalLocation.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.CreateExternalLocation.Name = (r) - } - } - if s := string(v.CreateExternalLocation.Url); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.CreateExternalLocation.Url = (r) - } - } -} - -func stringsResourcesCluster(c *stringsWalk, n *Node, v *resources.Cluster) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("lifecycle") { - if x := v.Lifecycle; x != nil { - ch := n.Child("lifecycle") - stringsResourcesLifecycleWithStarted(c, &ch, x) - } - } - if !n.IsRef("libraries") { - if len(v.Libraries) > 0 { - cn := n.Child("libraries") - for i := range v.Libraries { - { - ch := cn.Elem(i) - stringsComputeLibrary(c, &ch, &v.Libraries[i]) - } - } - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesClusterPermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("aws_attributes") { - if x := v.ClusterSpec.AwsAttributes; x != nil { - ch := n.Child("aws_attributes") - stringsComputeAwsAttributes(c, &ch, x) - } - } - if !n.IsRef("azure_attributes") { - if x := v.ClusterSpec.AzureAttributes; x != nil { - ch := n.Child("azure_attributes") - stringsComputeAzureAttributes(c, &ch, x) - } - } - if !n.IsRef("cluster_log_conf") { - if x := v.ClusterSpec.ClusterLogConf; x != nil { - ch := n.Child("cluster_log_conf") - stringsComputeClusterLogConf(c, &ch, x) - } - } - if c.mode == EmptyFields && v.ClusterSpec.ClusterName == "" && Forced(v.ClusterSpec.ForceSendFields, "ClusterName") { - ch := n.Child("cluster_name") - c.fn(&ch, "") - } - if s := string(v.ClusterSpec.ClusterName); c.match(s) { - ch := n.Child("cluster_name") - if r, ok := c.fn(&ch, s); ok { - v.ClusterSpec.ClusterName = (r) - } - } - if !n.IsRef("custom_tags") { - if len(v.ClusterSpec.CustomTags) > 0 { - cn := n.Child("custom_tags") - for _, k := range sortedKeys(v.ClusterSpec.CustomTags) { - if s := string(v.ClusterSpec.CustomTags[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.ClusterSpec.CustomTags[k] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.ClusterSpec.DataSecurityMode == "" && Forced(v.ClusterSpec.ForceSendFields, "DataSecurityMode") { - ch := n.Child("data_security_mode") - c.fn(&ch, "") - } - if s := string(v.ClusterSpec.DataSecurityMode); c.match(s) { - ch := n.Child("data_security_mode") - if r, ok := c.fn(&ch, s); ok { - v.ClusterSpec.DataSecurityMode = compute.DataSecurityMode(r) - } - } - if c.mode == EmptyFields && v.ClusterSpec.DependencyMode == "" && Forced(v.ClusterSpec.ForceSendFields, "DependencyMode") { - ch := n.Child("dependency_mode") - c.fn(&ch, "") - } - if s := string(v.ClusterSpec.DependencyMode); c.match(s) { - ch := n.Child("dependency_mode") - if r, ok := c.fn(&ch, s); ok { - v.ClusterSpec.DependencyMode = compute.DependencyMode(r) - } - } - if !n.IsRef("docker_image") { - if x := v.ClusterSpec.DockerImage; x != nil { - ch := n.Child("docker_image") - stringsComputeDockerImage(c, &ch, x) - } - } - if c.mode == EmptyFields && v.ClusterSpec.DriverInstancePoolId == "" && Forced(v.ClusterSpec.ForceSendFields, "DriverInstancePoolId") { - ch := n.Child("driver_instance_pool_id") - c.fn(&ch, "") - } - if s := string(v.ClusterSpec.DriverInstancePoolId); c.match(s) { - ch := n.Child("driver_instance_pool_id") - if r, ok := c.fn(&ch, s); ok { - v.ClusterSpec.DriverInstancePoolId = (r) - } - } - if !n.IsRef("driver_node_type_flexibility") { - if x := v.ClusterSpec.DriverNodeTypeFlexibility; x != nil { - ch := n.Child("driver_node_type_flexibility") - stringsComputeNodeTypeFlexibility(c, &ch, x) - } - } - if c.mode == EmptyFields && v.ClusterSpec.DriverNodeTypeId == "" && Forced(v.ClusterSpec.ForceSendFields, "DriverNodeTypeId") { - ch := n.Child("driver_node_type_id") - c.fn(&ch, "") - } - if s := string(v.ClusterSpec.DriverNodeTypeId); c.match(s) { - ch := n.Child("driver_node_type_id") - if r, ok := c.fn(&ch, s); ok { - v.ClusterSpec.DriverNodeTypeId = (r) - } - } - if !n.IsRef("gcp_attributes") { - if x := v.ClusterSpec.GcpAttributes; x != nil { - ch := n.Child("gcp_attributes") - stringsComputeGcpAttributes(c, &ch, x) - } - } - if !n.IsRef("init_scripts") { - if len(v.ClusterSpec.InitScripts) > 0 { - cn := n.Child("init_scripts") - for i := range v.ClusterSpec.InitScripts { - { - ch := cn.Elem(i) - stringsComputeInitScriptInfo(c, &ch, &v.ClusterSpec.InitScripts[i]) - } - } - } - } - if c.mode == EmptyFields && v.ClusterSpec.InstancePoolId == "" && Forced(v.ClusterSpec.ForceSendFields, "InstancePoolId") { - ch := n.Child("instance_pool_id") - c.fn(&ch, "") - } - if s := string(v.ClusterSpec.InstancePoolId); c.match(s) { - ch := n.Child("instance_pool_id") - if r, ok := c.fn(&ch, s); ok { - v.ClusterSpec.InstancePoolId = (r) - } - } - if c.mode == EmptyFields && v.ClusterSpec.Kind == "" && Forced(v.ClusterSpec.ForceSendFields, "Kind") { - ch := n.Child("kind") - c.fn(&ch, "") - } - if s := string(v.ClusterSpec.Kind); c.match(s) { - ch := n.Child("kind") - if r, ok := c.fn(&ch, s); ok { - v.ClusterSpec.Kind = compute.Kind(r) - } - } - if c.mode == EmptyFields && v.ClusterSpec.NodeTypeId == "" && Forced(v.ClusterSpec.ForceSendFields, "NodeTypeId") { - ch := n.Child("node_type_id") - c.fn(&ch, "") - } - if s := string(v.ClusterSpec.NodeTypeId); c.match(s) { - ch := n.Child("node_type_id") - if r, ok := c.fn(&ch, s); ok { - v.ClusterSpec.NodeTypeId = (r) - } - } - if c.mode == EmptyFields && v.ClusterSpec.PolicyId == "" && Forced(v.ClusterSpec.ForceSendFields, "PolicyId") { - ch := n.Child("policy_id") - c.fn(&ch, "") - } - if s := string(v.ClusterSpec.PolicyId); c.match(s) { - ch := n.Child("policy_id") - if r, ok := c.fn(&ch, s); ok { - v.ClusterSpec.PolicyId = (r) - } - } - if c.mode == EmptyFields && v.ClusterSpec.RuntimeEngine == "" && Forced(v.ClusterSpec.ForceSendFields, "RuntimeEngine") { - ch := n.Child("runtime_engine") - c.fn(&ch, "") - } - if s := string(v.ClusterSpec.RuntimeEngine); c.match(s) { - ch := n.Child("runtime_engine") - if r, ok := c.fn(&ch, s); ok { - v.ClusterSpec.RuntimeEngine = compute.RuntimeEngine(r) - } - } - if c.mode == EmptyFields && v.ClusterSpec.SingleUserName == "" && Forced(v.ClusterSpec.ForceSendFields, "SingleUserName") { - ch := n.Child("single_user_name") - c.fn(&ch, "") - } - if s := string(v.ClusterSpec.SingleUserName); c.match(s) { - ch := n.Child("single_user_name") - if r, ok := c.fn(&ch, s); ok { - v.ClusterSpec.SingleUserName = (r) - } - } - if !n.IsRef("spark_conf") { - if len(v.ClusterSpec.SparkConf) > 0 { - cn := n.Child("spark_conf") - for _, k := range sortedKeys(v.ClusterSpec.SparkConf) { - if s := string(v.ClusterSpec.SparkConf[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.ClusterSpec.SparkConf[k] = (r) - } - } - } - } - } - if !n.IsRef("spark_env_vars") { - if len(v.ClusterSpec.SparkEnvVars) > 0 { - cn := n.Child("spark_env_vars") - for _, k := range sortedKeys(v.ClusterSpec.SparkEnvVars) { - if s := string(v.ClusterSpec.SparkEnvVars[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.ClusterSpec.SparkEnvVars[k] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.ClusterSpec.SparkVersion == "" && Forced(v.ClusterSpec.ForceSendFields, "SparkVersion") { - ch := n.Child("spark_version") - c.fn(&ch, "") - } - if s := string(v.ClusterSpec.SparkVersion); c.match(s) { - ch := n.Child("spark_version") - if r, ok := c.fn(&ch, s); ok { - v.ClusterSpec.SparkVersion = (r) - } - } - if !n.IsRef("ssh_public_keys") { - if len(v.ClusterSpec.SshPublicKeys) > 0 { - cn := n.Child("ssh_public_keys") - for i := range v.ClusterSpec.SshPublicKeys { - if s := string(v.ClusterSpec.SshPublicKeys[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.ClusterSpec.SshPublicKeys[i] = (r) - } - } - } - } - } - if !n.IsRef("worker_node_type_flexibility") { - if x := v.ClusterSpec.WorkerNodeTypeFlexibility; x != nil { - ch := n.Child("worker_node_type_flexibility") - stringsComputeNodeTypeFlexibility(c, &ch, x) - } - } -} - -func stringsResourcesDashboard(c *stringsWalk, n *Node, v *resources.Dashboard) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesPermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.FilePath); c.match(s) { - ch := n.Child("file_path") - if r, ok := c.fn(&ch, s); ok { - v.FilePath = (r) - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if c.mode == EmptyFields && v.DashboardConfig.CreateTime == "" && Forced(v.DashboardConfig.ForceSendFields, "CreateTime") { - ch := n.Child("create_time") - c.fn(&ch, "") - } - if s := string(v.DashboardConfig.CreateTime); c.match(s) { - ch := n.Child("create_time") - if r, ok := c.fn(&ch, s); ok { - v.DashboardConfig.CreateTime = (r) - } - } - if c.mode == EmptyFields && v.DashboardConfig.DashboardId == "" && Forced(v.DashboardConfig.ForceSendFields, "DashboardId") { - ch := n.Child("dashboard_id") - c.fn(&ch, "") - } - if s := string(v.DashboardConfig.DashboardId); c.match(s) { - ch := n.Child("dashboard_id") - if r, ok := c.fn(&ch, s); ok { - v.DashboardConfig.DashboardId = (r) - } - } - if c.mode == EmptyFields && v.DashboardConfig.DisplayName == "" && Forced(v.DashboardConfig.ForceSendFields, "DisplayName") { - ch := n.Child("display_name") - c.fn(&ch, "") - } - if s := string(v.DashboardConfig.DisplayName); c.match(s) { - ch := n.Child("display_name") - if r, ok := c.fn(&ch, s); ok { - v.DashboardConfig.DisplayName = (r) - } - } - if c.mode == EmptyFields && v.DashboardConfig.Etag == "" && Forced(v.DashboardConfig.ForceSendFields, "Etag") { - ch := n.Child("etag") - c.fn(&ch, "") - } - if s := string(v.DashboardConfig.Etag); c.match(s) { - ch := n.Child("etag") - if r, ok := c.fn(&ch, s); ok { - v.DashboardConfig.Etag = (r) - } - } - if c.mode == EmptyFields && v.DashboardConfig.LifecycleState == "" && Forced(v.DashboardConfig.ForceSendFields, "LifecycleState") { - ch := n.Child("lifecycle_state") - c.fn(&ch, "") - } - if s := string(v.DashboardConfig.LifecycleState); c.match(s) { - ch := n.Child("lifecycle_state") - if r, ok := c.fn(&ch, s); ok { - v.DashboardConfig.LifecycleState = dashboards.LifecycleState(r) - } - } - if c.mode == EmptyFields && v.DashboardConfig.ParentPath == "" && Forced(v.DashboardConfig.ForceSendFields, "ParentPath") { - ch := n.Child("parent_path") - c.fn(&ch, "") - } - if s := string(v.DashboardConfig.ParentPath); c.match(s) { - ch := n.Child("parent_path") - if r, ok := c.fn(&ch, s); ok { - v.DashboardConfig.ParentPath = (r) - } - } - if c.mode == EmptyFields && v.DashboardConfig.Path == "" && Forced(v.DashboardConfig.ForceSendFields, "Path") { - ch := n.Child("path") - c.fn(&ch, "") - } - if s := string(v.DashboardConfig.Path); c.match(s) { - ch := n.Child("path") - if r, ok := c.fn(&ch, s); ok { - v.DashboardConfig.Path = (r) - } - } - if c.mode == EmptyFields && v.DashboardConfig.UpdateTime == "" && Forced(v.DashboardConfig.ForceSendFields, "UpdateTime") { - ch := n.Child("update_time") - c.fn(&ch, "") - } - if s := string(v.DashboardConfig.UpdateTime); c.match(s) { - ch := n.Child("update_time") - if r, ok := c.fn(&ch, s); ok { - v.DashboardConfig.UpdateTime = (r) - } - } - if c.mode == EmptyFields && v.DashboardConfig.WarehouseId == "" && Forced(v.DashboardConfig.ForceSendFields, "WarehouseId") { - ch := n.Child("warehouse_id") - c.fn(&ch, "") - } - if s := string(v.DashboardConfig.WarehouseId); c.match(s) { - ch := n.Child("warehouse_id") - if r, ok := c.fn(&ch, s); ok { - v.DashboardConfig.WarehouseId = (r) - } - } - if c.mode == EmptyFields && v.DashboardConfig.SerializedDashboard == "" { - ch := n.Child("serialized_dashboard") - c.fn(&ch, "") - } - if v.DashboardConfig.SerializedDashboard != nil { - ch := n.Child("serialized_dashboard") - c.any(&ch, &v.DashboardConfig.SerializedDashboard) - } - if c.mode == EmptyFields && v.DashboardConfig.DatasetCatalog == "" && Forced(v.DashboardConfig.ForceSendFields, "DatasetCatalog") { - ch := n.Child("dataset_catalog") - c.fn(&ch, "") - } - if s := string(v.DashboardConfig.DatasetCatalog); c.match(s) { - ch := n.Child("dataset_catalog") - if r, ok := c.fn(&ch, s); ok { - v.DashboardConfig.DatasetCatalog = (r) - } - } - if c.mode == EmptyFields && v.DashboardConfig.DatasetSchema == "" && Forced(v.DashboardConfig.ForceSendFields, "DatasetSchema") { - ch := n.Child("dataset_schema") - c.fn(&ch, "") - } - if s := string(v.DashboardConfig.DatasetSchema); c.match(s) { - ch := n.Child("dataset_schema") - if r, ok := c.fn(&ch, s); ok { - v.DashboardConfig.DatasetSchema = (r) - } - } -} - -func stringsResourcesGenieSpace(c *stringsWalk, n *Node, v *resources.GenieSpace) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesPermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.FilePath); c.match(s) { - ch := n.Child("file_path") - if r, ok := c.fn(&ch, s); ok { - v.FilePath = (r) - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if c.mode == EmptyFields && v.GenieSpaceConfig.Description == "" && Forced(v.GenieSpaceConfig.ForceSendFields, "Description") { - ch := n.Child("description") - c.fn(&ch, "") - } - if s := string(v.GenieSpaceConfig.Description); c.match(s) { - ch := n.Child("description") - if r, ok := c.fn(&ch, s); ok { - v.GenieSpaceConfig.Description = (r) - } - } - if c.mode == EmptyFields && v.GenieSpaceConfig.Etag == "" && Forced(v.GenieSpaceConfig.ForceSendFields, "Etag") { - ch := n.Child("etag") - c.fn(&ch, "") - } - if s := string(v.GenieSpaceConfig.Etag); c.match(s) { - ch := n.Child("etag") - if r, ok := c.fn(&ch, s); ok { - v.GenieSpaceConfig.Etag = (r) - } - } - if c.mode == EmptyFields && v.GenieSpaceConfig.Title == "" && Forced(v.GenieSpaceConfig.ForceSendFields, "Title") { - ch := n.Child("title") - c.fn(&ch, "") - } - if s := string(v.GenieSpaceConfig.Title); c.match(s) { - ch := n.Child("title") - if r, ok := c.fn(&ch, s); ok { - v.GenieSpaceConfig.Title = (r) - } - } - if c.mode == EmptyFields && v.GenieSpaceConfig.WarehouseId == "" && Forced(v.GenieSpaceConfig.ForceSendFields, "WarehouseId") { - ch := n.Child("warehouse_id") - c.fn(&ch, "") - } - if s := string(v.GenieSpaceConfig.WarehouseId); c.match(s) { - ch := n.Child("warehouse_id") - if r, ok := c.fn(&ch, s); ok { - v.GenieSpaceConfig.WarehouseId = (r) - } - } - if c.mode == EmptyFields && v.GenieSpaceConfig.ParentPath == "" && Forced(v.GenieSpaceConfig.ForceSendFields, "ParentPath") { - ch := n.Child("parent_path") - c.fn(&ch, "") - } - if s := string(v.GenieSpaceConfig.ParentPath); c.match(s) { - ch := n.Child("parent_path") - if r, ok := c.fn(&ch, s); ok { - v.GenieSpaceConfig.ParentPath = (r) - } - } - if c.mode == EmptyFields && v.GenieSpaceConfig.SerializedSpace == "" { - ch := n.Child("serialized_space") - c.fn(&ch, "") - } - if v.GenieSpaceConfig.SerializedSpace != nil { - ch := n.Child("serialized_space") - c.any(&ch, &v.GenieSpaceConfig.SerializedSpace) - } -} - -func stringsResourcesApp(c *stringsWalk, n *Node, v *resources.App) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if s := string(v.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.URL = (r) - } - } - if !n.IsRef("lifecycle") { - if x := v.Lifecycle; x != nil { - ch := n.Child("lifecycle") - stringsResourcesLifecycleWithStarted(c, &ch, x) - } - } - if !n.IsRef("config") { - if x := v.Config; x != nil { - ch := n.Child("config") - stringsResourcesAppConfig(c, &ch, x) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesAppPermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("active_deployment") { - if x := v.App.ActiveDeployment; x != nil { - ch := n.Child("active_deployment") - stringsAppsAppDeployment(c, &ch, x) - } - } - if !n.IsRef("app_status") { - if x := v.App.AppStatus; x != nil { - ch := n.Child("app_status") - stringsAppsApplicationStatus(c, &ch, x) - } - } - if c.mode == EmptyFields && v.App.BudgetPolicyId == "" && Forced(v.App.ForceSendFields, "BudgetPolicyId") { - ch := n.Child("budget_policy_id") - c.fn(&ch, "") - } - if s := string(v.App.BudgetPolicyId); c.match(s) { - ch := n.Child("budget_policy_id") - if r, ok := c.fn(&ch, s); ok { - v.App.BudgetPolicyId = (r) - } - } - if c.mode == EmptyFields && v.App.ComputeSize == "" && Forced(v.App.ForceSendFields, "ComputeSize") { - ch := n.Child("compute_size") - c.fn(&ch, "") - } - if s := string(v.App.ComputeSize); c.match(s) { - ch := n.Child("compute_size") - if r, ok := c.fn(&ch, s); ok { - v.App.ComputeSize = apps.ComputeSize(r) - } - } - if !n.IsRef("compute_status") { - if x := v.App.ComputeStatus; x != nil { - ch := n.Child("compute_status") - stringsAppsComputeStatus(c, &ch, x) - } - } - if c.mode == EmptyFields && v.App.CreateTime == "" && Forced(v.App.ForceSendFields, "CreateTime") { - ch := n.Child("create_time") - c.fn(&ch, "") - } - if s := string(v.App.CreateTime); c.match(s) { - ch := n.Child("create_time") - if r, ok := c.fn(&ch, s); ok { - v.App.CreateTime = (r) - } - } - if c.mode == EmptyFields && v.App.Creator == "" && Forced(v.App.ForceSendFields, "Creator") { - ch := n.Child("creator") - c.fn(&ch, "") - } - if s := string(v.App.Creator); c.match(s) { - ch := n.Child("creator") - if r, ok := c.fn(&ch, s); ok { - v.App.Creator = (r) - } - } - if !n.IsRef("default_git_source") { - if x := v.App.DefaultGitSource; x != nil { - ch := n.Child("default_git_source") - stringsAppsGitSource(c, &ch, x) - } - } - if c.mode == EmptyFields && v.App.DefaultSourceCodePath == "" && Forced(v.App.ForceSendFields, "DefaultSourceCodePath") { - ch := n.Child("default_source_code_path") - c.fn(&ch, "") - } - if s := string(v.App.DefaultSourceCodePath); c.match(s) { - ch := n.Child("default_source_code_path") - if r, ok := c.fn(&ch, s); ok { - v.App.DefaultSourceCodePath = (r) - } - } - if c.mode == EmptyFields && v.App.Description == "" && Forced(v.App.ForceSendFields, "Description") { - ch := n.Child("description") - c.fn(&ch, "") - } - if s := string(v.App.Description); c.match(s) { - ch := n.Child("description") - if r, ok := c.fn(&ch, s); ok { - v.App.Description = (r) - } - } - if c.mode == EmptyFields && v.App.EffectiveBudgetPolicyId == "" && Forced(v.App.ForceSendFields, "EffectiveBudgetPolicyId") { - ch := n.Child("effective_budget_policy_id") - c.fn(&ch, "") - } - if s := string(v.App.EffectiveBudgetPolicyId); c.match(s) { - ch := n.Child("effective_budget_policy_id") - if r, ok := c.fn(&ch, s); ok { - v.App.EffectiveBudgetPolicyId = (r) - } - } - if c.mode == EmptyFields && v.App.EffectiveUsagePolicyId == "" && Forced(v.App.ForceSendFields, "EffectiveUsagePolicyId") { - ch := n.Child("effective_usage_policy_id") - c.fn(&ch, "") - } - if s := string(v.App.EffectiveUsagePolicyId); c.match(s) { - ch := n.Child("effective_usage_policy_id") - if r, ok := c.fn(&ch, s); ok { - v.App.EffectiveUsagePolicyId = (r) - } - } - if !n.IsRef("effective_user_api_scopes") { - if len(v.App.EffectiveUserApiScopes) > 0 { - cn := n.Child("effective_user_api_scopes") - for i := range v.App.EffectiveUserApiScopes { - if s := string(v.App.EffectiveUserApiScopes[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.App.EffectiveUserApiScopes[i] = (r) - } - } - } - } - } - if !n.IsRef("git_repository") { - if x := v.App.GitRepository; x != nil { - ch := n.Child("git_repository") - stringsAppsGitRepository(c, &ch, x) - } - } - if !n.IsRef("git_source") { - if x := v.App.GitSource; x != nil { - ch := n.Child("git_source") - stringsAppsGitSource(c, &ch, x) - } - } - if s := string(v.App.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.App.Name = (r) - } - } - if c.mode == EmptyFields && v.App.Oauth2AppClientId == "" && Forced(v.App.ForceSendFields, "Oauth2AppClientId") { - ch := n.Child("oauth2_app_client_id") - c.fn(&ch, "") - } - if s := string(v.App.Oauth2AppClientId); c.match(s) { - ch := n.Child("oauth2_app_client_id") - if r, ok := c.fn(&ch, s); ok { - v.App.Oauth2AppClientId = (r) - } - } - if c.mode == EmptyFields && v.App.Oauth2AppIntegrationId == "" && Forced(v.App.ForceSendFields, "Oauth2AppIntegrationId") { - ch := n.Child("oauth2_app_integration_id") - c.fn(&ch, "") - } - if s := string(v.App.Oauth2AppIntegrationId); c.match(s) { - ch := n.Child("oauth2_app_integration_id") - if r, ok := c.fn(&ch, s); ok { - v.App.Oauth2AppIntegrationId = (r) - } - } - if !n.IsRef("pending_deployment") { - if x := v.App.PendingDeployment; x != nil { - ch := n.Child("pending_deployment") - stringsAppsAppDeployment(c, &ch, x) - } - } - if !n.IsRef("resources") { - if len(v.App.Resources) > 0 { - cn := n.Child("resources") - for i := range v.App.Resources { - { - ch := cn.Elem(i) - stringsAppsAppResource(c, &ch, &v.App.Resources[i]) - } - } - } - } - if c.mode == EmptyFields && v.App.ServicePrincipalClientId == "" && Forced(v.App.ForceSendFields, "ServicePrincipalClientId") { - ch := n.Child("service_principal_client_id") - c.fn(&ch, "") - } - if s := string(v.App.ServicePrincipalClientId); c.match(s) { - ch := n.Child("service_principal_client_id") - if r, ok := c.fn(&ch, s); ok { - v.App.ServicePrincipalClientId = (r) - } - } - if c.mode == EmptyFields && v.App.ServicePrincipalName == "" && Forced(v.App.ForceSendFields, "ServicePrincipalName") { - ch := n.Child("service_principal_name") - c.fn(&ch, "") - } - if s := string(v.App.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.App.ServicePrincipalName = (r) - } - } - if c.mode == EmptyFields && v.App.SourceCodePath == "" && Forced(v.App.ForceSendFields, "SourceCodePath") { - ch := n.Child("source_code_path") - c.fn(&ch, "") - } - if s := string(v.App.SourceCodePath); c.match(s) { - ch := n.Child("source_code_path") - if r, ok := c.fn(&ch, s); ok { - v.App.SourceCodePath = (r) - } - } - if c.mode == EmptyFields && v.App.Space == "" && Forced(v.App.ForceSendFields, "Space") { - ch := n.Child("space") - c.fn(&ch, "") - } - if s := string(v.App.Space); c.match(s) { - ch := n.Child("space") - if r, ok := c.fn(&ch, s); ok { - v.App.Space = (r) - } - } - if !n.IsRef("telemetry_export_destinations") { - if len(v.App.TelemetryExportDestinations) > 0 { - cn := n.Child("telemetry_export_destinations") - for i := range v.App.TelemetryExportDestinations { - { - ch := cn.Elem(i) - stringsAppsTelemetryExportDestination(c, &ch, &v.App.TelemetryExportDestinations[i]) - } - } - } - } - if c.mode == EmptyFields && v.App.ThumbnailUrl == "" && Forced(v.App.ForceSendFields, "ThumbnailUrl") { - ch := n.Child("thumbnail_url") - c.fn(&ch, "") - } - if s := string(v.App.ThumbnailUrl); c.match(s) { - ch := n.Child("thumbnail_url") - if r, ok := c.fn(&ch, s); ok { - v.App.ThumbnailUrl = (r) - } - } - if c.mode == EmptyFields && v.App.UpdateTime == "" && Forced(v.App.ForceSendFields, "UpdateTime") { - ch := n.Child("update_time") - c.fn(&ch, "") - } - if s := string(v.App.UpdateTime); c.match(s) { - ch := n.Child("update_time") - if r, ok := c.fn(&ch, s); ok { - v.App.UpdateTime = (r) - } - } - if c.mode == EmptyFields && v.App.Updater == "" && Forced(v.App.ForceSendFields, "Updater") { - ch := n.Child("updater") - c.fn(&ch, "") - } - if s := string(v.App.Updater); c.match(s) { - ch := n.Child("updater") - if r, ok := c.fn(&ch, s); ok { - v.App.Updater = (r) - } - } - if c.mode == EmptyFields && v.App.UsagePolicyId == "" && Forced(v.App.ForceSendFields, "UsagePolicyId") { - ch := n.Child("usage_policy_id") - c.fn(&ch, "") - } - if s := string(v.App.UsagePolicyId); c.match(s) { - ch := n.Child("usage_policy_id") - if r, ok := c.fn(&ch, s); ok { - v.App.UsagePolicyId = (r) - } - } - if !n.IsRef("user_api_scopes") { - if len(v.App.UserApiScopes) > 0 { - cn := n.Child("user_api_scopes") - for i := range v.App.UserApiScopes { - if s := string(v.App.UserApiScopes[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.App.UserApiScopes[i] = (r) - } - } - } - } - } -} - -func stringsResourcesSecretScope(c *stringsWalk, n *Node, v *resources.SecretScope) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesSecretScopePermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.BackendType); c.match(s) { - ch := n.Child("backend_type") - if r, ok := c.fn(&ch, s); ok { - v.BackendType = workspace.ScopeBackendType(r) - } - } - if !n.IsRef("keyvault_metadata") { - if x := v.KeyvaultMetadata; x != nil { - ch := n.Child("keyvault_metadata") - stringsWorkspaceAzureKeyVaultSecretScopeMetadata(c, &ch, x) - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } -} - -func stringsResourcesAlert(c *stringsWalk, n *Node, v *resources.Alert) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesPermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.FilePath); c.match(s) { - ch := n.Child("file_path") - if r, ok := c.fn(&ch, s); ok { - v.FilePath = (r) - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if c.mode == EmptyFields && v.AlertV2.CreateTime == "" && Forced(v.AlertV2.ForceSendFields, "CreateTime") { - ch := n.Child("create_time") - c.fn(&ch, "") - } - if s := string(v.AlertV2.CreateTime); c.match(s) { - ch := n.Child("create_time") - if r, ok := c.fn(&ch, s); ok { - v.AlertV2.CreateTime = (r) - } - } - if c.mode == EmptyFields && v.AlertV2.CustomDescription == "" && Forced(v.AlertV2.ForceSendFields, "CustomDescription") { - ch := n.Child("custom_description") - c.fn(&ch, "") - } - if s := string(v.AlertV2.CustomDescription); c.match(s) { - ch := n.Child("custom_description") - if r, ok := c.fn(&ch, s); ok { - v.AlertV2.CustomDescription = (r) - } - } - if c.mode == EmptyFields && v.AlertV2.CustomSummary == "" && Forced(v.AlertV2.ForceSendFields, "CustomSummary") { - ch := n.Child("custom_summary") - c.fn(&ch, "") - } - if s := string(v.AlertV2.CustomSummary); c.match(s) { - ch := n.Child("custom_summary") - if r, ok := c.fn(&ch, s); ok { - v.AlertV2.CustomSummary = (r) - } - } - if c.mode == EmptyFields && v.AlertV2.CustomTemplateFormat == "" && Forced(v.AlertV2.ForceSendFields, "CustomTemplateFormat") { - ch := n.Child("custom_template_format") - c.fn(&ch, "") - } - if s := string(v.AlertV2.CustomTemplateFormat); c.match(s) { - ch := n.Child("custom_template_format") - if r, ok := c.fn(&ch, s); ok { - v.AlertV2.CustomTemplateFormat = sql.CustomTemplateFormat(r) - } - } - if s := string(v.AlertV2.DisplayName); c.match(s) { - ch := n.Child("display_name") - if r, ok := c.fn(&ch, s); ok { - v.AlertV2.DisplayName = (r) - } - } - if !n.IsRef("effective_run_as") { - if x := v.AlertV2.EffectiveRunAs; x != nil { - ch := n.Child("effective_run_as") - stringsSqlAlertV2RunAs(c, &ch, x) - } - } - if !n.IsRef("evaluation") { - { - ch := n.Child("evaluation") - stringsSqlAlertV2Evaluation(c, &ch, &v.AlertV2.Evaluation) - } - } - if c.mode == EmptyFields && v.AlertV2.LifecycleState == "" && Forced(v.AlertV2.ForceSendFields, "LifecycleState") { - ch := n.Child("lifecycle_state") - c.fn(&ch, "") - } - if s := string(v.AlertV2.LifecycleState); c.match(s) { - ch := n.Child("lifecycle_state") - if r, ok := c.fn(&ch, s); ok { - v.AlertV2.LifecycleState = sql.AlertLifecycleState(r) - } - } - if c.mode == EmptyFields && v.AlertV2.OwnerUserName == "" && Forced(v.AlertV2.ForceSendFields, "OwnerUserName") { - ch := n.Child("owner_user_name") - c.fn(&ch, "") - } - if s := string(v.AlertV2.OwnerUserName); c.match(s) { - ch := n.Child("owner_user_name") - if r, ok := c.fn(&ch, s); ok { - v.AlertV2.OwnerUserName = (r) - } - } - if !n.IsRef("parameters") { - if len(v.AlertV2.Parameters) > 0 { - cn := n.Child("parameters") - for i := range v.AlertV2.Parameters { - { - ch := cn.Elem(i) - stringsSqlAlertStatementParameter(c, &ch, &v.AlertV2.Parameters[i]) - } - } - } - } - if c.mode == EmptyFields && v.AlertV2.ParentPath == "" && Forced(v.AlertV2.ForceSendFields, "ParentPath") { - ch := n.Child("parent_path") - c.fn(&ch, "") - } - if s := string(v.AlertV2.ParentPath); c.match(s) { - ch := n.Child("parent_path") - if r, ok := c.fn(&ch, s); ok { - v.AlertV2.ParentPath = (r) - } - } - if s := string(v.AlertV2.QueryText); c.match(s) { - ch := n.Child("query_text") - if r, ok := c.fn(&ch, s); ok { - v.AlertV2.QueryText = (r) - } - } - if !n.IsRef("run_as") { - if x := v.AlertV2.RunAs; x != nil { - ch := n.Child("run_as") - stringsSqlAlertV2RunAs(c, &ch, x) - } - } - if c.mode == EmptyFields && v.AlertV2.RunAsUserName == "" && Forced(v.AlertV2.ForceSendFields, "RunAsUserName") { - ch := n.Child("run_as_user_name") - c.fn(&ch, "") - } - if s := string(v.AlertV2.RunAsUserName); c.match(s) { - ch := n.Child("run_as_user_name") - if r, ok := c.fn(&ch, s); ok { - v.AlertV2.RunAsUserName = (r) - } - } - if !n.IsRef("schedule") { - { - ch := n.Child("schedule") - stringsSqlCronSchedule(c, &ch, &v.AlertV2.Schedule) - } - } - if c.mode == EmptyFields && v.AlertV2.UpdateTime == "" && Forced(v.AlertV2.ForceSendFields, "UpdateTime") { - ch := n.Child("update_time") - c.fn(&ch, "") - } - if s := string(v.AlertV2.UpdateTime); c.match(s) { - ch := n.Child("update_time") - if r, ok := c.fn(&ch, s); ok { - v.AlertV2.UpdateTime = (r) - } - } - if s := string(v.AlertV2.WarehouseId); c.match(s) { - ch := n.Child("warehouse_id") - if r, ok := c.fn(&ch, s); ok { - v.AlertV2.WarehouseId = (r) - } - } -} - -func stringsResourcesSqlWarehouse(c *stringsWalk, n *Node, v *resources.SqlWarehouse) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("lifecycle") { - if x := v.Lifecycle; x != nil { - ch := n.Child("lifecycle") - stringsResourcesLifecycleWithStarted(c, &ch, x) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesSqlWarehousePermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("channel") { - if x := v.CreateWarehouseRequest.Channel; x != nil { - ch := n.Child("channel") - stringsSqlChannel(c, &ch, x) - } - } - if c.mode == EmptyFields && v.CreateWarehouseRequest.ClusterSize == "" && Forced(v.CreateWarehouseRequest.ForceSendFields, "ClusterSize") { - ch := n.Child("cluster_size") - c.fn(&ch, "") - } - if s := string(v.CreateWarehouseRequest.ClusterSize); c.match(s) { - ch := n.Child("cluster_size") - if r, ok := c.fn(&ch, s); ok { - v.CreateWarehouseRequest.ClusterSize = (r) - } - } - if c.mode == EmptyFields && v.CreateWarehouseRequest.CreatorName == "" && Forced(v.CreateWarehouseRequest.ForceSendFields, "CreatorName") { - ch := n.Child("creator_name") - c.fn(&ch, "") - } - if s := string(v.CreateWarehouseRequest.CreatorName); c.match(s) { - ch := n.Child("creator_name") - if r, ok := c.fn(&ch, s); ok { - v.CreateWarehouseRequest.CreatorName = (r) - } - } - if c.mode == EmptyFields && v.CreateWarehouseRequest.CustomerVersionLabel == "" && Forced(v.CreateWarehouseRequest.ForceSendFields, "CustomerVersionLabel") { - ch := n.Child("customer_version_label") - c.fn(&ch, "") - } - if s := string(v.CreateWarehouseRequest.CustomerVersionLabel); c.match(s) { - ch := n.Child("customer_version_label") - if r, ok := c.fn(&ch, s); ok { - v.CreateWarehouseRequest.CustomerVersionLabel = (r) - } - } - if c.mode == EmptyFields && v.CreateWarehouseRequest.InstanceProfileArn == "" && Forced(v.CreateWarehouseRequest.ForceSendFields, "InstanceProfileArn") { - ch := n.Child("instance_profile_arn") - c.fn(&ch, "") - } - if s := string(v.CreateWarehouseRequest.InstanceProfileArn); c.match(s) { - ch := n.Child("instance_profile_arn") - if r, ok := c.fn(&ch, s); ok { - v.CreateWarehouseRequest.InstanceProfileArn = (r) - } - } - if c.mode == EmptyFields && v.CreateWarehouseRequest.Name == "" && Forced(v.CreateWarehouseRequest.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.CreateWarehouseRequest.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.CreateWarehouseRequest.Name = (r) - } - } - if c.mode == EmptyFields && v.CreateWarehouseRequest.SpotInstancePolicy == "" && Forced(v.CreateWarehouseRequest.ForceSendFields, "SpotInstancePolicy") { - ch := n.Child("spot_instance_policy") - c.fn(&ch, "") - } - if s := string(v.CreateWarehouseRequest.SpotInstancePolicy); c.match(s) { - ch := n.Child("spot_instance_policy") - if r, ok := c.fn(&ch, s); ok { - v.CreateWarehouseRequest.SpotInstancePolicy = sql.SpotInstancePolicy(r) - } - } - if !n.IsRef("tags") { - if x := v.CreateWarehouseRequest.Tags; x != nil { - ch := n.Child("tags") - stringsSqlEndpointTags(c, &ch, x) - } - } - if c.mode == EmptyFields && v.CreateWarehouseRequest.WarehouseType == "" && Forced(v.CreateWarehouseRequest.ForceSendFields, "WarehouseType") { - ch := n.Child("warehouse_type") - c.fn(&ch, "") - } - if s := string(v.CreateWarehouseRequest.WarehouseType); c.match(s) { - ch := n.Child("warehouse_type") - if r, ok := c.fn(&ch, s); ok { - v.CreateWarehouseRequest.WarehouseType = sql.CreateWarehouseRequestWarehouseType(r) - } - } -} - -func stringsResourcesDatabaseInstance(c *stringsWalk, n *Node, v *resources.DatabaseInstance) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesPermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if c.mode == EmptyFields && v.DatabaseInstance.Capacity == "" && Forced(v.DatabaseInstance.ForceSendFields, "Capacity") { - ch := n.Child("capacity") - c.fn(&ch, "") - } - if s := string(v.DatabaseInstance.Capacity); c.match(s) { - ch := n.Child("capacity") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseInstance.Capacity = (r) - } - } - if !n.IsRef("child_instance_refs") { - if len(v.DatabaseInstance.ChildInstanceRefs) > 0 { - cn := n.Child("child_instance_refs") - for i := range v.DatabaseInstance.ChildInstanceRefs { - { - ch := cn.Elem(i) - stringsDatabaseDatabaseInstanceRef(c, &ch, &v.DatabaseInstance.ChildInstanceRefs[i]) - } - } - } - } - if c.mode == EmptyFields && v.DatabaseInstance.CreationTime == "" && Forced(v.DatabaseInstance.ForceSendFields, "CreationTime") { - ch := n.Child("creation_time") - c.fn(&ch, "") - } - if s := string(v.DatabaseInstance.CreationTime); c.match(s) { - ch := n.Child("creation_time") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseInstance.CreationTime = (r) - } - } - if c.mode == EmptyFields && v.DatabaseInstance.Creator == "" && Forced(v.DatabaseInstance.ForceSendFields, "Creator") { - ch := n.Child("creator") - c.fn(&ch, "") - } - if s := string(v.DatabaseInstance.Creator); c.match(s) { - ch := n.Child("creator") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseInstance.Creator = (r) - } - } - if !n.IsRef("custom_tags") { - if len(v.DatabaseInstance.CustomTags) > 0 { - cn := n.Child("custom_tags") - for i := range v.DatabaseInstance.CustomTags { - { - ch := cn.Elem(i) - stringsDatabaseCustomTag(c, &ch, &v.DatabaseInstance.CustomTags[i]) - } - } - } - } - if c.mode == EmptyFields && v.DatabaseInstance.EffectiveCapacity == "" && Forced(v.DatabaseInstance.ForceSendFields, "EffectiveCapacity") { - ch := n.Child("effective_capacity") - c.fn(&ch, "") - } - if s := string(v.DatabaseInstance.EffectiveCapacity); c.match(s) { - ch := n.Child("effective_capacity") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseInstance.EffectiveCapacity = (r) - } - } - if !n.IsRef("effective_custom_tags") { - if len(v.DatabaseInstance.EffectiveCustomTags) > 0 { - cn := n.Child("effective_custom_tags") - for i := range v.DatabaseInstance.EffectiveCustomTags { - { - ch := cn.Elem(i) - stringsDatabaseCustomTag(c, &ch, &v.DatabaseInstance.EffectiveCustomTags[i]) - } - } - } - } - if c.mode == EmptyFields && v.DatabaseInstance.EffectiveUsagePolicyId == "" && Forced(v.DatabaseInstance.ForceSendFields, "EffectiveUsagePolicyId") { - ch := n.Child("effective_usage_policy_id") - c.fn(&ch, "") - } - if s := string(v.DatabaseInstance.EffectiveUsagePolicyId); c.match(s) { - ch := n.Child("effective_usage_policy_id") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseInstance.EffectiveUsagePolicyId = (r) - } - } - if s := string(v.DatabaseInstance.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseInstance.Name = (r) - } - } - if !n.IsRef("parent_instance_ref") { - if x := v.DatabaseInstance.ParentInstanceRef; x != nil { - ch := n.Child("parent_instance_ref") - stringsDatabaseDatabaseInstanceRef(c, &ch, x) - } - } - if c.mode == EmptyFields && v.DatabaseInstance.PgVersion == "" && Forced(v.DatabaseInstance.ForceSendFields, "PgVersion") { - ch := n.Child("pg_version") - c.fn(&ch, "") - } - if s := string(v.DatabaseInstance.PgVersion); c.match(s) { - ch := n.Child("pg_version") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseInstance.PgVersion = (r) - } - } - if c.mode == EmptyFields && v.DatabaseInstance.ReadOnlyDns == "" && Forced(v.DatabaseInstance.ForceSendFields, "ReadOnlyDns") { - ch := n.Child("read_only_dns") - c.fn(&ch, "") - } - if s := string(v.DatabaseInstance.ReadOnlyDns); c.match(s) { - ch := n.Child("read_only_dns") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseInstance.ReadOnlyDns = (r) - } - } - if c.mode == EmptyFields && v.DatabaseInstance.ReadWriteDns == "" && Forced(v.DatabaseInstance.ForceSendFields, "ReadWriteDns") { - ch := n.Child("read_write_dns") - c.fn(&ch, "") - } - if s := string(v.DatabaseInstance.ReadWriteDns); c.match(s) { - ch := n.Child("read_write_dns") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseInstance.ReadWriteDns = (r) - } - } - if c.mode == EmptyFields && v.DatabaseInstance.State == "" && Forced(v.DatabaseInstance.ForceSendFields, "State") { - ch := n.Child("state") - c.fn(&ch, "") - } - if s := string(v.DatabaseInstance.State); c.match(s) { - ch := n.Child("state") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseInstance.State = database.DatabaseInstanceState(r) - } - } - if c.mode == EmptyFields && v.DatabaseInstance.Uid == "" && Forced(v.DatabaseInstance.ForceSendFields, "Uid") { - ch := n.Child("uid") - c.fn(&ch, "") - } - if s := string(v.DatabaseInstance.Uid); c.match(s) { - ch := n.Child("uid") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseInstance.Uid = (r) - } - } - if c.mode == EmptyFields && v.DatabaseInstance.UsagePolicyId == "" && Forced(v.DatabaseInstance.ForceSendFields, "UsagePolicyId") { - ch := n.Child("usage_policy_id") - c.fn(&ch, "") - } - if s := string(v.DatabaseInstance.UsagePolicyId); c.match(s) { - ch := n.Child("usage_policy_id") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseInstance.UsagePolicyId = (r) - } - } -} - -func stringsResourcesDatabaseCatalog(c *stringsWalk, n *Node, v *resources.DatabaseCatalog) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if s := string(v.DatabaseCatalog.DatabaseInstanceName); c.match(s) { - ch := n.Child("database_instance_name") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseCatalog.DatabaseInstanceName = (r) - } - } - if s := string(v.DatabaseCatalog.DatabaseName); c.match(s) { - ch := n.Child("database_name") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseCatalog.DatabaseName = (r) - } - } - if s := string(v.DatabaseCatalog.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseCatalog.Name = (r) - } - } - if c.mode == EmptyFields && v.DatabaseCatalog.Uid == "" && Forced(v.DatabaseCatalog.ForceSendFields, "Uid") { - ch := n.Child("uid") - c.fn(&ch, "") - } - if s := string(v.DatabaseCatalog.Uid); c.match(s) { - ch := n.Child("uid") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseCatalog.Uid = (r) - } - } -} - -func stringsResourcesSyncedDatabaseTable(c *stringsWalk, n *Node, v *resources.SyncedDatabaseTable) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if !n.IsRef("data_synchronization_status") { - if x := v.SyncedDatabaseTable.DataSynchronizationStatus; x != nil { - ch := n.Child("data_synchronization_status") - stringsDatabaseSyncedTableStatus(c, &ch, x) - } - } - if c.mode == EmptyFields && v.SyncedDatabaseTable.DatabaseInstanceName == "" && Forced(v.SyncedDatabaseTable.ForceSendFields, "DatabaseInstanceName") { - ch := n.Child("database_instance_name") - c.fn(&ch, "") - } - if s := string(v.SyncedDatabaseTable.DatabaseInstanceName); c.match(s) { - ch := n.Child("database_instance_name") - if r, ok := c.fn(&ch, s); ok { - v.SyncedDatabaseTable.DatabaseInstanceName = (r) - } - } - if c.mode == EmptyFields && v.SyncedDatabaseTable.EffectiveDatabaseInstanceName == "" && Forced(v.SyncedDatabaseTable.ForceSendFields, "EffectiveDatabaseInstanceName") { - ch := n.Child("effective_database_instance_name") - c.fn(&ch, "") - } - if s := string(v.SyncedDatabaseTable.EffectiveDatabaseInstanceName); c.match(s) { - ch := n.Child("effective_database_instance_name") - if r, ok := c.fn(&ch, s); ok { - v.SyncedDatabaseTable.EffectiveDatabaseInstanceName = (r) - } - } - if c.mode == EmptyFields && v.SyncedDatabaseTable.EffectiveLogicalDatabaseName == "" && Forced(v.SyncedDatabaseTable.ForceSendFields, "EffectiveLogicalDatabaseName") { - ch := n.Child("effective_logical_database_name") - c.fn(&ch, "") - } - if s := string(v.SyncedDatabaseTable.EffectiveLogicalDatabaseName); c.match(s) { - ch := n.Child("effective_logical_database_name") - if r, ok := c.fn(&ch, s); ok { - v.SyncedDatabaseTable.EffectiveLogicalDatabaseName = (r) - } - } - if c.mode == EmptyFields && v.SyncedDatabaseTable.LogicalDatabaseName == "" && Forced(v.SyncedDatabaseTable.ForceSendFields, "LogicalDatabaseName") { - ch := n.Child("logical_database_name") - c.fn(&ch, "") - } - if s := string(v.SyncedDatabaseTable.LogicalDatabaseName); c.match(s) { - ch := n.Child("logical_database_name") - if r, ok := c.fn(&ch, s); ok { - v.SyncedDatabaseTable.LogicalDatabaseName = (r) - } - } - if s := string(v.SyncedDatabaseTable.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.SyncedDatabaseTable.Name = (r) - } - } - if !n.IsRef("spec") { - if x := v.SyncedDatabaseTable.Spec; x != nil { - ch := n.Child("spec") - stringsDatabaseSyncedTableSpec(c, &ch, x) - } - } - if c.mode == EmptyFields && v.SyncedDatabaseTable.UnityCatalogProvisioningState == "" && Forced(v.SyncedDatabaseTable.ForceSendFields, "UnityCatalogProvisioningState") { - ch := n.Child("unity_catalog_provisioning_state") - c.fn(&ch, "") - } - if s := string(v.SyncedDatabaseTable.UnityCatalogProvisioningState); c.match(s) { - ch := n.Child("unity_catalog_provisioning_state") - if r, ok := c.fn(&ch, s); ok { - v.SyncedDatabaseTable.UnityCatalogProvisioningState = database.ProvisioningInfoState(r) - } - } -} - -func stringsResourcesPostgresProject(c *stringsWalk, n *Node, v *resources.PostgresProject) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesPermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if s := string(v.PostgresProjectConfig.ProjectId); c.match(s) { - ch := n.Child("project_id") - if r, ok := c.fn(&ch, s); ok { - v.PostgresProjectConfig.ProjectId = (r) - } - } - if c.mode == EmptyFields && v.PostgresProjectConfig.ProjectSpec.BudgetPolicyId == "" && Forced(v.PostgresProjectConfig.ProjectSpec.ForceSendFields, "BudgetPolicyId") { - ch := n.Child("budget_policy_id") - c.fn(&ch, "") - } - if s := string(v.PostgresProjectConfig.ProjectSpec.BudgetPolicyId); c.match(s) { - ch := n.Child("budget_policy_id") - if r, ok := c.fn(&ch, s); ok { - v.PostgresProjectConfig.ProjectSpec.BudgetPolicyId = (r) - } - } - if !n.IsRef("custom_tags") { - if len(v.PostgresProjectConfig.ProjectSpec.CustomTags) > 0 { - cn := n.Child("custom_tags") - for i := range v.PostgresProjectConfig.ProjectSpec.CustomTags { - { - ch := cn.Elem(i) - stringsPostgresProjectCustomTag(c, &ch, &v.PostgresProjectConfig.ProjectSpec.CustomTags[i]) - } - } - } - } - if c.mode == EmptyFields && v.PostgresProjectConfig.ProjectSpec.DefaultBranch == "" && Forced(v.PostgresProjectConfig.ProjectSpec.ForceSendFields, "DefaultBranch") { - ch := n.Child("default_branch") - c.fn(&ch, "") - } - if s := string(v.PostgresProjectConfig.ProjectSpec.DefaultBranch); c.match(s) { - ch := n.Child("default_branch") - if r, ok := c.fn(&ch, s); ok { - v.PostgresProjectConfig.ProjectSpec.DefaultBranch = (r) - } - } - if !n.IsRef("default_endpoint_settings") { - if x := v.PostgresProjectConfig.ProjectSpec.DefaultEndpointSettings; x != nil { - ch := n.Child("default_endpoint_settings") - stringsPostgresProjectDefaultEndpointSettings(c, &ch, x) - } - } - if c.mode == EmptyFields && v.PostgresProjectConfig.ProjectSpec.DisplayName == "" && Forced(v.PostgresProjectConfig.ProjectSpec.ForceSendFields, "DisplayName") { - ch := n.Child("display_name") - c.fn(&ch, "") - } - if s := string(v.PostgresProjectConfig.ProjectSpec.DisplayName); c.match(s) { - ch := n.Child("display_name") - if r, ok := c.fn(&ch, s); ok { - v.PostgresProjectConfig.ProjectSpec.DisplayName = (r) - } - } -} - -func stringsResourcesPostgresBranch(c *stringsWalk, n *Node, v *resources.PostgresBranch) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if s := string(v.PostgresBranchConfig.BranchId); c.match(s) { - ch := n.Child("branch_id") - if r, ok := c.fn(&ch, s); ok { - v.PostgresBranchConfig.BranchId = (r) - } - } - if s := string(v.PostgresBranchConfig.Parent); c.match(s) { - ch := n.Child("parent") - if r, ok := c.fn(&ch, s); ok { - v.PostgresBranchConfig.Parent = (r) - } - } - if c.mode == EmptyFields && v.PostgresBranchConfig.BranchSpec.SourceBranch == "" && Forced(v.PostgresBranchConfig.BranchSpec.ForceSendFields, "SourceBranch") { - ch := n.Child("source_branch") - c.fn(&ch, "") - } - if s := string(v.PostgresBranchConfig.BranchSpec.SourceBranch); c.match(s) { - ch := n.Child("source_branch") - if r, ok := c.fn(&ch, s); ok { - v.PostgresBranchConfig.BranchSpec.SourceBranch = (r) - } - } - if c.mode == EmptyFields && v.PostgresBranchConfig.BranchSpec.SourceBranchLsn == "" && Forced(v.PostgresBranchConfig.BranchSpec.ForceSendFields, "SourceBranchLsn") { - ch := n.Child("source_branch_lsn") - c.fn(&ch, "") - } - if s := string(v.PostgresBranchConfig.BranchSpec.SourceBranchLsn); c.match(s) { - ch := n.Child("source_branch_lsn") - if r, ok := c.fn(&ch, s); ok { - v.PostgresBranchConfig.BranchSpec.SourceBranchLsn = (r) - } - } - if c.mode == EmptyFields && v.PostgresBranchConfig.BranchSpec.SourceSnapshot == "" && Forced(v.PostgresBranchConfig.BranchSpec.ForceSendFields, "SourceSnapshot") { - ch := n.Child("source_snapshot") - c.fn(&ch, "") - } - if s := string(v.PostgresBranchConfig.BranchSpec.SourceSnapshot); c.match(s) { - ch := n.Child("source_snapshot") - if r, ok := c.fn(&ch, s); ok { - v.PostgresBranchConfig.BranchSpec.SourceSnapshot = (r) - } - } -} - -func stringsResourcesPostgresEndpoint(c *stringsWalk, n *Node, v *resources.PostgresEndpoint) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if s := string(v.PostgresEndpointConfig.EndpointId); c.match(s) { - ch := n.Child("endpoint_id") - if r, ok := c.fn(&ch, s); ok { - v.PostgresEndpointConfig.EndpointId = (r) - } - } - if s := string(v.PostgresEndpointConfig.Parent); c.match(s) { - ch := n.Child("parent") - if r, ok := c.fn(&ch, s); ok { - v.PostgresEndpointConfig.Parent = (r) - } - } - if s := string(v.PostgresEndpointConfig.EndpointSpec.EndpointType); c.match(s) { - ch := n.Child("endpoint_type") - if r, ok := c.fn(&ch, s); ok { - v.PostgresEndpointConfig.EndpointSpec.EndpointType = postgres.EndpointType(r) - } - } - if !n.IsRef("settings") { - if x := v.PostgresEndpointConfig.EndpointSpec.Settings; x != nil { - ch := n.Child("settings") - stringsPostgresEndpointSettings(c, &ch, x) - } - } -} - -func stringsResourcesPostgresCatalog(c *stringsWalk, n *Node, v *resources.PostgresCatalog) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if s := string(v.PostgresCatalogConfig.CatalogId); c.match(s) { - ch := n.Child("catalog_id") - if r, ok := c.fn(&ch, s); ok { - v.PostgresCatalogConfig.CatalogId = (r) - } - } - if c.mode == EmptyFields && v.PostgresCatalogConfig.CatalogCatalogSpec.Branch == "" && Forced(v.PostgresCatalogConfig.CatalogCatalogSpec.ForceSendFields, "Branch") { - ch := n.Child("branch") - c.fn(&ch, "") - } - if s := string(v.PostgresCatalogConfig.CatalogCatalogSpec.Branch); c.match(s) { - ch := n.Child("branch") - if r, ok := c.fn(&ch, s); ok { - v.PostgresCatalogConfig.CatalogCatalogSpec.Branch = (r) - } - } - if s := string(v.PostgresCatalogConfig.CatalogCatalogSpec.PostgresDatabase); c.match(s) { - ch := n.Child("postgres_database") - if r, ok := c.fn(&ch, s); ok { - v.PostgresCatalogConfig.CatalogCatalogSpec.PostgresDatabase = (r) - } - } -} - -func stringsResourcesPostgresDatabase(c *stringsWalk, n *Node, v *resources.PostgresDatabase) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if s := string(v.PostgresDatabaseConfig.DatabaseId); c.match(s) { - ch := n.Child("database_id") - if r, ok := c.fn(&ch, s); ok { - v.PostgresDatabaseConfig.DatabaseId = (r) - } - } - if s := string(v.PostgresDatabaseConfig.Parent); c.match(s) { - ch := n.Child("parent") - if r, ok := c.fn(&ch, s); ok { - v.PostgresDatabaseConfig.Parent = (r) - } - } - if c.mode == EmptyFields && v.PostgresDatabaseConfig.DatabaseDatabaseSpec.PostgresDatabase == "" && Forced(v.PostgresDatabaseConfig.DatabaseDatabaseSpec.ForceSendFields, "PostgresDatabase") { - ch := n.Child("postgres_database") - c.fn(&ch, "") - } - if s := string(v.PostgresDatabaseConfig.DatabaseDatabaseSpec.PostgresDatabase); c.match(s) { - ch := n.Child("postgres_database") - if r, ok := c.fn(&ch, s); ok { - v.PostgresDatabaseConfig.DatabaseDatabaseSpec.PostgresDatabase = (r) - } - } - if s := string(v.PostgresDatabaseConfig.DatabaseDatabaseSpec.Role); c.match(s) { - ch := n.Child("role") - if r, ok := c.fn(&ch, s); ok { - v.PostgresDatabaseConfig.DatabaseDatabaseSpec.Role = (r) - } - } -} - -func stringsResourcesPostgresRole(c *stringsWalk, n *Node, v *resources.PostgresRole) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if s := string(v.PostgresRoleConfig.RoleId); c.match(s) { - ch := n.Child("role_id") - if r, ok := c.fn(&ch, s); ok { - v.PostgresRoleConfig.RoleId = (r) - } - } - if s := string(v.PostgresRoleConfig.Parent); c.match(s) { - ch := n.Child("parent") - if r, ok := c.fn(&ch, s); ok { - v.PostgresRoleConfig.Parent = (r) - } - } - if c.mode == EmptyFields && v.PostgresRoleConfig.RoleRoleSpec.AuthMethod == "" && Forced(v.PostgresRoleConfig.RoleRoleSpec.ForceSendFields, "AuthMethod") { - ch := n.Child("auth_method") - c.fn(&ch, "") - } - if s := string(v.PostgresRoleConfig.RoleRoleSpec.AuthMethod); c.match(s) { - ch := n.Child("auth_method") - if r, ok := c.fn(&ch, s); ok { - v.PostgresRoleConfig.RoleRoleSpec.AuthMethod = postgres.RoleAuthMethod(r) - } - } - if c.mode == EmptyFields && v.PostgresRoleConfig.RoleRoleSpec.IdentityType == "" && Forced(v.PostgresRoleConfig.RoleRoleSpec.ForceSendFields, "IdentityType") { - ch := n.Child("identity_type") - c.fn(&ch, "") - } - if s := string(v.PostgresRoleConfig.RoleRoleSpec.IdentityType); c.match(s) { - ch := n.Child("identity_type") - if r, ok := c.fn(&ch, s); ok { - v.PostgresRoleConfig.RoleRoleSpec.IdentityType = postgres.RoleIdentityType(r) - } - } - if !n.IsRef("membership_roles") { - if len(v.PostgresRoleConfig.RoleRoleSpec.MembershipRoles) > 0 { - cn := n.Child("membership_roles") - for i := range v.PostgresRoleConfig.RoleRoleSpec.MembershipRoles { - if s := string(v.PostgresRoleConfig.RoleRoleSpec.MembershipRoles[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.PostgresRoleConfig.RoleRoleSpec.MembershipRoles[i] = postgres.RoleMembershipRole(r) - } - } - } - } - } - if c.mode == EmptyFields && v.PostgresRoleConfig.RoleRoleSpec.PostgresRole == "" && Forced(v.PostgresRoleConfig.RoleRoleSpec.ForceSendFields, "PostgresRole") { - ch := n.Child("postgres_role") - c.fn(&ch, "") - } - if s := string(v.PostgresRoleConfig.RoleRoleSpec.PostgresRole); c.match(s) { - ch := n.Child("postgres_role") - if r, ok := c.fn(&ch, s); ok { - v.PostgresRoleConfig.RoleRoleSpec.PostgresRole = (r) - } - } -} - -func stringsResourcesPostgresSyncedTable(c *stringsWalk, n *Node, v *resources.PostgresSyncedTable) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if s := string(v.PostgresSyncedTableConfig.SyncedTableId); c.match(s) { - ch := n.Child("synced_table_id") - if r, ok := c.fn(&ch, s); ok { - v.PostgresSyncedTableConfig.SyncedTableId = (r) - } - } - if c.mode == EmptyFields && v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.Branch == "" && Forced(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ForceSendFields, "Branch") { - ch := n.Child("branch") - c.fn(&ch, "") - } - if s := string(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.Branch); c.match(s) { - ch := n.Child("branch") - if r, ok := c.fn(&ch, s); ok { - v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.Branch = (r) - } - } - if c.mode == EmptyFields && v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExistingPipelineId == "" && Forced(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ForceSendFields, "ExistingPipelineId") { - ch := n.Child("existing_pipeline_id") - c.fn(&ch, "") - } - if s := string(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExistingPipelineId); c.match(s) { - ch := n.Child("existing_pipeline_id") - if r, ok := c.fn(&ch, s); ok { - v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExistingPipelineId = (r) - } - } - if !n.IsRef("extra_columns") { - if len(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExtraColumns) > 0 { - cn := n.Child("extra_columns") - for i := range v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExtraColumns { - { - ch := cn.Elem(i) - stringsPostgresSyncedTableSyncedTableSpecExtraColumn(c, &ch, &v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ExtraColumns[i]) - } - } - } - } - if !n.IsRef("new_pipeline_spec") { - if x := v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.NewPipelineSpec; x != nil { - ch := n.Child("new_pipeline_spec") - stringsPostgresNewPipelineSpec(c, &ch, x) - } - } - if c.mode == EmptyFields && v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.PostgresDatabase == "" && Forced(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ForceSendFields, "PostgresDatabase") { - ch := n.Child("postgres_database") - c.fn(&ch, "") - } - if s := string(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.PostgresDatabase); c.match(s) { - ch := n.Child("postgres_database") - if r, ok := c.fn(&ch, s); ok { - v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.PostgresDatabase = (r) - } - } - if !n.IsRef("primary_key_columns") { - if len(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.PrimaryKeyColumns) > 0 { - cn := n.Child("primary_key_columns") - for i := range v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.PrimaryKeyColumns { - if s := string(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.PrimaryKeyColumns[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.PrimaryKeyColumns[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.SchedulingPolicy == "" && Forced(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ForceSendFields, "SchedulingPolicy") { - ch := n.Child("scheduling_policy") - c.fn(&ch, "") - } - if s := string(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.SchedulingPolicy); c.match(s) { - ch := n.Child("scheduling_policy") - if r, ok := c.fn(&ch, s); ok { - v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.SchedulingPolicy = postgres.SyncedTableSyncedTableSpecSyncedTableSchedulingPolicy(r) - } - } - if c.mode == EmptyFields && v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.SourceTableFullName == "" && Forced(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ForceSendFields, "SourceTableFullName") { - ch := n.Child("source_table_full_name") - c.fn(&ch, "") - } - if s := string(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.SourceTableFullName); c.match(s) { - ch := n.Child("source_table_full_name") - if r, ok := c.fn(&ch, s); ok { - v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.SourceTableFullName = (r) - } - } - if c.mode == EmptyFields && v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TimeseriesKey == "" && Forced(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.ForceSendFields, "TimeseriesKey") { - ch := n.Child("timeseries_key") - c.fn(&ch, "") - } - if s := string(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TimeseriesKey); c.match(s) { - ch := n.Child("timeseries_key") - if r, ok := c.fn(&ch, s); ok { - v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TimeseriesKey = (r) - } - } - if !n.IsRef("type_overrides") { - if len(v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides) > 0 { - cn := n.Child("type_overrides") - for i := range v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides { - { - ch := cn.Elem(i) - stringsPostgresSyncedTableSyncedTableSpecTypeOverride(c, &ch, &v.PostgresSyncedTableConfig.SyncedTableSyncedTableSpec.TypeOverrides[i]) - } - } - } - } -} - -func stringsResourcesPostgresSnapshotSchedule(c *stringsWalk, n *Node, v *resources.PostgresSnapshotSchedule) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if s := string(v.PostgresSnapshotScheduleConfig.Branch); c.match(s) { - ch := n.Child("branch") - if r, ok := c.fn(&ch, s); ok { - v.PostgresSnapshotScheduleConfig.Branch = (r) - } - } - if !n.IsRef("schedule") { - if len(v.PostgresSnapshotScheduleConfig.Schedule) > 0 { - cn := n.Child("schedule") - for i := range v.PostgresSnapshotScheduleConfig.Schedule { - { - ch := cn.Elem(i) - stringsPostgresScheduleCadence(c, &ch, &v.PostgresSnapshotScheduleConfig.Schedule[i]) - } - } - } - } -} - -func stringsResourcesVectorSearchEndpoint(c *stringsWalk, n *Node, v *resources.VectorSearchEndpoint) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesVectorSearchEndpointPermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if c.mode == EmptyFields && v.CreateEndpoint.BudgetPolicyId == "" && Forced(v.CreateEndpoint.ForceSendFields, "BudgetPolicyId") { - ch := n.Child("budget_policy_id") - c.fn(&ch, "") - } - if s := string(v.CreateEndpoint.BudgetPolicyId); c.match(s) { - ch := n.Child("budget_policy_id") - if r, ok := c.fn(&ch, s); ok { - v.CreateEndpoint.BudgetPolicyId = (r) - } - } - if s := string(v.CreateEndpoint.EndpointType); c.match(s) { - ch := n.Child("endpoint_type") - if r, ok := c.fn(&ch, s); ok { - v.CreateEndpoint.EndpointType = vectorsearch.EndpointType(r) - } - } - if s := string(v.CreateEndpoint.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.CreateEndpoint.Name = (r) - } - } - if c.mode == EmptyFields && v.CreateEndpoint.UsagePolicyId == "" && Forced(v.CreateEndpoint.ForceSendFields, "UsagePolicyId") { - ch := n.Child("usage_policy_id") - c.fn(&ch, "") - } - if s := string(v.CreateEndpoint.UsagePolicyId); c.match(s) { - ch := n.Child("usage_policy_id") - if r, ok := c.fn(&ch, s); ok { - v.CreateEndpoint.UsagePolicyId = (r) - } - } -} - -func stringsResourcesVectorSearchIndex(c *stringsWalk, n *Node, v *resources.VectorSearchIndex) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("grants") { - if len(v.Grants) > 0 { - cn := n.Child("grants") - for i := range v.Grants { - { - ch := cn.Elem(i) - stringsCatalogPrivilegeAssignment(c, &ch, &v.Grants[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if !n.IsRef("delta_sync_index_spec") { - if x := v.CreateVectorIndexRequest.DeltaSyncIndexSpec; x != nil { - ch := n.Child("delta_sync_index_spec") - stringsVectorsearchDeltaSyncVectorIndexSpecRequest(c, &ch, x) - } - } - if !n.IsRef("direct_access_index_spec") { - if x := v.CreateVectorIndexRequest.DirectAccessIndexSpec; x != nil { - ch := n.Child("direct_access_index_spec") - stringsVectorsearchDirectAccessVectorIndexSpec(c, &ch, x) - } - } - if s := string(v.CreateVectorIndexRequest.EndpointName); c.match(s) { - ch := n.Child("endpoint_name") - if r, ok := c.fn(&ch, s); ok { - v.CreateVectorIndexRequest.EndpointName = (r) - } - } - if s := string(v.CreateVectorIndexRequest.IndexSubtype); c.match(s) { - ch := n.Child("index_subtype") - if r, ok := c.fn(&ch, s); ok { - v.CreateVectorIndexRequest.IndexSubtype = vectorsearch.IndexSubtype(r) - } - } - if s := string(v.CreateVectorIndexRequest.IndexType); c.match(s) { - ch := n.Child("index_type") - if r, ok := c.fn(&ch, s); ok { - v.CreateVectorIndexRequest.IndexType = vectorsearch.VectorIndexType(r) - } - } - if s := string(v.CreateVectorIndexRequest.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.CreateVectorIndexRequest.Name = (r) - } - } - if s := string(v.CreateVectorIndexRequest.PrimaryKey); c.match(s) { - ch := n.Child("primary_key") - if r, ok := c.fn(&ch, s); ok { - v.CreateVectorIndexRequest.PrimaryKey = (r) - } - } -} - -func stringsResourcesInstancePool(c *stringsWalk, n *Node, v *resources.InstancePool) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesInstancePoolPermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if !n.IsRef("aws_attributes") { - if x := v.CreateInstancePool.AwsAttributes; x != nil { - ch := n.Child("aws_attributes") - stringsComputeInstancePoolAwsAttributes(c, &ch, x) - } - } - if !n.IsRef("azure_attributes") { - if x := v.CreateInstancePool.AzureAttributes; x != nil { - ch := n.Child("azure_attributes") - stringsComputeInstancePoolAzureAttributes(c, &ch, x) - } - } - if !n.IsRef("custom_tags") { - if len(v.CreateInstancePool.CustomTags) > 0 { - cn := n.Child("custom_tags") - for _, k := range sortedKeys(v.CreateInstancePool.CustomTags) { - if s := string(v.CreateInstancePool.CustomTags[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.CreateInstancePool.CustomTags[k] = (r) - } - } - } - } - } - if !n.IsRef("disk_spec") { - if x := v.CreateInstancePool.DiskSpec; x != nil { - ch := n.Child("disk_spec") - stringsComputeDiskSpec(c, &ch, x) - } - } - if !n.IsRef("gcp_attributes") { - if x := v.CreateInstancePool.GcpAttributes; x != nil { - ch := n.Child("gcp_attributes") - stringsComputeInstancePoolGcpAttributes(c, &ch, x) - } - } - if s := string(v.CreateInstancePool.InstancePoolName); c.match(s) { - ch := n.Child("instance_pool_name") - if r, ok := c.fn(&ch, s); ok { - v.CreateInstancePool.InstancePoolName = (r) - } - } - if !n.IsRef("node_type_flexibility") { - if x := v.CreateInstancePool.NodeTypeFlexibility; x != nil { - ch := n.Child("node_type_flexibility") - stringsComputeNodeTypeFlexibility(c, &ch, x) - } - } - if s := string(v.CreateInstancePool.NodeTypeId); c.match(s) { - ch := n.Child("node_type_id") - if r, ok := c.fn(&ch, s); ok { - v.CreateInstancePool.NodeTypeId = (r) - } - } - if !n.IsRef("preloaded_docker_images") { - if len(v.CreateInstancePool.PreloadedDockerImages) > 0 { - cn := n.Child("preloaded_docker_images") - for i := range v.CreateInstancePool.PreloadedDockerImages { - { - ch := cn.Elem(i) - stringsComputeDockerImage(c, &ch, &v.CreateInstancePool.PreloadedDockerImages[i]) - } - } - } - } - if !n.IsRef("preloaded_spark_versions") { - if len(v.CreateInstancePool.PreloadedSparkVersions) > 0 { - cn := n.Child("preloaded_spark_versions") - for i := range v.CreateInstancePool.PreloadedSparkVersions { - if s := string(v.CreateInstancePool.PreloadedSparkVersions[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.CreateInstancePool.PreloadedSparkVersions[i] = (r) - } - } - } - } - } -} - -func stringsResourcesSecret(c *stringsWalk, n *Node, v *resources.Secret) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if !n.IsRef("grants") { - if len(v.Grants) > 0 { - cn := n.Child("grants") - for i := range v.Grants { - { - ch := cn.Elem(i) - stringsCatalogPrivilegeAssignment(c, &ch, &v.Grants[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if s := string(v.Secret.CatalogName); c.match(s) { - ch := n.Child("catalog_name") - if r, ok := c.fn(&ch, s); ok { - v.Secret.CatalogName = (r) - } - } - if c.mode == EmptyFields && v.Secret.Comment == "" && Forced(v.Secret.ForceSendFields, "Comment") { - ch := n.Child("comment") - c.fn(&ch, "") - } - if s := string(v.Secret.Comment); c.match(s) { - ch := n.Child("comment") - if r, ok := c.fn(&ch, s); ok { - v.Secret.Comment = (r) - } - } - if c.mode == EmptyFields && v.Secret.CreatedBy == "" && Forced(v.Secret.ForceSendFields, "CreatedBy") { - ch := n.Child("created_by") - c.fn(&ch, "") - } - if s := string(v.Secret.CreatedBy); c.match(s) { - ch := n.Child("created_by") - if r, ok := c.fn(&ch, s); ok { - v.Secret.CreatedBy = (r) - } - } - if c.mode == EmptyFields && v.Secret.EffectiveOwner == "" && Forced(v.Secret.ForceSendFields, "EffectiveOwner") { - ch := n.Child("effective_owner") - c.fn(&ch, "") - } - if s := string(v.Secret.EffectiveOwner); c.match(s) { - ch := n.Child("effective_owner") - if r, ok := c.fn(&ch, s); ok { - v.Secret.EffectiveOwner = (r) - } - } - if c.mode == EmptyFields && v.Secret.EffectiveValue == "" && Forced(v.Secret.ForceSendFields, "EffectiveValue") { - ch := n.Child("effective_value") - c.fn(&ch, "") - } - if s := string(v.Secret.EffectiveValue); c.match(s) { - ch := n.Child("effective_value") - if r, ok := c.fn(&ch, s); ok { - v.Secret.EffectiveValue = (r) - } - } - if c.mode == EmptyFields && v.Secret.FullName == "" && Forced(v.Secret.ForceSendFields, "FullName") { - ch := n.Child("full_name") - c.fn(&ch, "") - } - if s := string(v.Secret.FullName); c.match(s) { - ch := n.Child("full_name") - if r, ok := c.fn(&ch, s); ok { - v.Secret.FullName = (r) - } - } - if c.mode == EmptyFields && v.Secret.MetastoreId == "" && Forced(v.Secret.ForceSendFields, "MetastoreId") { - ch := n.Child("metastore_id") - c.fn(&ch, "") - } - if s := string(v.Secret.MetastoreId); c.match(s) { - ch := n.Child("metastore_id") - if r, ok := c.fn(&ch, s); ok { - v.Secret.MetastoreId = (r) - } - } - if s := string(v.Secret.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Secret.Name = (r) - } - } - if c.mode == EmptyFields && v.Secret.Owner == "" && Forced(v.Secret.ForceSendFields, "Owner") { - ch := n.Child("owner") - c.fn(&ch, "") - } - if s := string(v.Secret.Owner); c.match(s) { - ch := n.Child("owner") - if r, ok := c.fn(&ch, s); ok { - v.Secret.Owner = (r) - } - } - if s := string(v.Secret.SchemaName); c.match(s) { - ch := n.Child("schema_name") - if r, ok := c.fn(&ch, s); ok { - v.Secret.SchemaName = (r) - } - } - if c.mode == EmptyFields && v.Secret.UpdatedBy == "" && Forced(v.Secret.ForceSendFields, "UpdatedBy") { - ch := n.Child("updated_by") - c.fn(&ch, "") - } - if s := string(v.Secret.UpdatedBy); c.match(s) { - ch := n.Child("updated_by") - if r, ok := c.fn(&ch, s); ok { - v.Secret.UpdatedBy = (r) - } - } - if s := string(v.Secret.Value); c.match(s) { - ch := n.Child("value") - if r, ok := c.fn(&ch, s); ok { - v.Secret.Value = (r) - } - } -} - -func stringsResourcesClusterPolicy(c *stringsWalk, n *Node, v *resources.ClusterPolicy) { - if n.isRef() { - return - } - if s := string(v.ID); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.ID = (r) - } - } - if c.mode == EmptyFields && v.Definition == "" { - ch := n.Child("definition") - c.fn(&ch, "") - } - if v.Definition != nil { - ch := n.Child("definition") - c.any(&ch, &v.Definition) - } - if c.mode == EmptyFields && v.PolicyFamilyDefinitionOverrides == "" { - ch := n.Child("policy_family_definition_overrides") - c.fn(&ch, "") - } - if v.PolicyFamilyDefinitionOverrides != nil { - ch := n.Child("policy_family_definition_overrides") - c.any(&ch, &v.PolicyFamilyDefinitionOverrides) - } - if !n.IsRef("permissions") { - if len(v.Permissions) > 0 { - cn := n.Child("permissions") - for i := range v.Permissions { - { - ch := cn.Elem(i) - stringsResourcesClusterPolicyPermission(c, &ch, &v.Permissions[i]) - } - } - } - } - if s := string(v.BaseResource.URL); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.URL = (r) - } - } - if s := string(v.BaseResource.ModifiedStatus); c.match(s) { - ch := n.Child("modified_status") - if r, ok := c.fn(&ch, s); ok { - v.BaseResource.ModifiedStatus = (r) - } - } - if !n.IsRef("lifecycle") { - { - ch := n.Child("lifecycle") - stringsResourcesLifecycle(c, &ch, &v.BaseResource.Lifecycle) - } - } - if c.mode == EmptyFields && v.CreatePolicy.Description == "" && Forced(v.CreatePolicy.ForceSendFields, "Description") { - ch := n.Child("description") - c.fn(&ch, "") - } - if s := string(v.CreatePolicy.Description); c.match(s) { - ch := n.Child("description") - if r, ok := c.fn(&ch, s); ok { - v.CreatePolicy.Description = (r) - } - } - if !n.IsRef("libraries") { - if len(v.CreatePolicy.Libraries) > 0 { - cn := n.Child("libraries") - for i := range v.CreatePolicy.Libraries { - { - ch := cn.Elem(i) - stringsComputeLibrary(c, &ch, &v.CreatePolicy.Libraries[i]) - } - } - } - } - if c.mode == EmptyFields && v.CreatePolicy.Name == "" && Forced(v.CreatePolicy.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.CreatePolicy.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.CreatePolicy.Name = (r) - } - } - if c.mode == EmptyFields && v.CreatePolicy.PolicyFamilyId == "" && Forced(v.CreatePolicy.ForceSendFields, "PolicyFamilyId") { - ch := n.Child("policy_family_id") - c.fn(&ch, "") - } - if s := string(v.CreatePolicy.PolicyFamilyId); c.match(s) { - ch := n.Child("policy_family_id") - if r, ok := c.fn(&ch, s); ok { - v.CreatePolicy.PolicyFamilyId = (r) - } - } -} - -func stringsResourcesSnapshot(c *stringsWalk, n *Node, v *resources.Snapshot) { - if n.isRef() { - return - } - if s := string(v.BundleID); c.match(s) { - ch := n.Child("bundle_id") - if r, ok := c.fn(&ch, s); ok { - v.BundleID = (r) - } - } - if !n.IsRef("acl") { - if len(v.ACL) > 0 { - cn := n.Child("acl") - for i := range v.ACL { - { - ch := cn.Elem(i) - stringsSnapshotACLEntry(c, &ch, &v.ACL[i]) - } - } - } - } - if !n.IsRef("can_manage") { - if len(v.CanManage) > 0 { - cn := n.Child("can_manage") - for i := range v.CanManage { - { - ch := cn.Elem(i) - stringsSnapshotManagePrincipal(c, &ch, &v.CanManage[i]) - } - } - } - } - if s := string(v.ZipPath); c.match(s) { - ch := n.Child("zip_path") - if r, ok := c.fn(&ch, s); ok { - v.ZipPath = (r) - } - } - if s := string(v.RemoteRoot); c.match(s) { - ch := n.Child("remote_root") - if r, ok := c.fn(&ch, s); ok { - v.RemoteRoot = (r) - } - } -} - -func stringsVariableTargetVariable(c *stringsWalk, n *Node, v *variable.TargetVariable) { - if n.isRef() { - return - } - if s := string(v.Type); c.match(s) { - ch := n.Child("type") - if r, ok := c.fn(&ch, s); ok { - v.Type = variable.VariableType(r) - } - } - if c.mode == EmptyFields && v.Default == "" { - ch := n.Child("default") - c.fn(&ch, "") - } - if v.Default != nil { - ch := n.Child("default") - c.any(&ch, &v.Default) - } - if s := string(v.Description); c.match(s) { - ch := n.Child("description") - if r, ok := c.fn(&ch, s); ok { - v.Description = (r) - } - } - if c.mode == EmptyFields && v.Value == "" { - ch := n.Child("value") - c.fn(&ch, "") - } - if v.Value != nil { - ch := n.Child("value") - c.any(&ch, &v.Value) - } - if !n.IsRef("lookup") { - if x := v.Lookup; x != nil { - ch := n.Child("lookup") - stringsVariableLookup(c, &ch, x) - } - } -} - -func stringsIamComplexValue(c *stringsWalk, n *Node, v *iam.ComplexValue) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Display == "" && Forced(v.ForceSendFields, "Display") { - ch := n.Child("display") - c.fn(&ch, "") - } - if s := string(v.Display); c.match(s) { - ch := n.Child("display") - if r, ok := c.fn(&ch, s); ok { - v.Display = (r) - } - } - if c.mode == EmptyFields && v.Ref == "" && Forced(v.ForceSendFields, "Ref") { - ch := n.Child("$ref") - c.fn(&ch, "") - } - if s := string(v.Ref); c.match(s) { - ch := n.Child("$ref") - if r, ok := c.fn(&ch, s); ok { - v.Ref = (r) - } - } - if c.mode == EmptyFields && v.Type == "" && Forced(v.ForceSendFields, "Type") { - ch := n.Child("type") - c.fn(&ch, "") - } - if s := string(v.Type); c.match(s) { - ch := n.Child("type") - if r, ok := c.fn(&ch, s); ok { - v.Type = (r) - } - } - if c.mode == EmptyFields && v.Value == "" && Forced(v.ForceSendFields, "Value") { - ch := n.Child("value") - c.fn(&ch, "") - } - if s := string(v.Value); c.match(s) { - ch := n.Child("value") - if r, ok := c.fn(&ch, s); ok { - v.Value = (r) - } - } -} - -func stringsIamName(c *stringsWalk, n *Node, v *iam.Name) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.FamilyName == "" && Forced(v.ForceSendFields, "FamilyName") { - ch := n.Child("familyName") - c.fn(&ch, "") - } - if s := string(v.FamilyName); c.match(s) { - ch := n.Child("familyName") - if r, ok := c.fn(&ch, s); ok { - v.FamilyName = (r) - } - } - if c.mode == EmptyFields && v.GivenName == "" && Forced(v.ForceSendFields, "GivenName") { - ch := n.Child("givenName") - c.fn(&ch, "") - } - if s := string(v.GivenName); c.match(s) { - ch := n.Child("givenName") - if r, ok := c.fn(&ch, s); ok { - v.GivenName = (r) - } - } -} - -func stringsResourcesJobPermission(c *stringsWalk, n *Node, v *resources.JobPermission) { - if n.isRef() { - return - } - if s := string(v.Level); c.match(s) { - ch := n.Child("level") - if r, ok := c.fn(&ch, s); ok { - v.Level = jobs.JobPermissionLevel(r) - } - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } -} - -func stringsResourcesLifecycle(c *stringsWalk, n *Node, v *resources.Lifecycle) { - if n.isRef() { - return - } - if !n.IsRef("depends_on") { - if len(v.DependsOn) > 0 { - cn := n.Child("depends_on") - for i := range v.DependsOn { - { - ch := cn.Elem(i) - stringsResourcesDependsOn(c, &ch, &v.DependsOn[i]) - } - } - } - } -} - -func stringsJobsContinuous(c *stringsWalk, n *Node, v *jobs.Continuous) { - if n.isRef() { - return - } - if !n.IsRef("maintenance_window") { - if x := v.MaintenanceWindow; x != nil { - ch := n.Child("maintenance_window") - stringsJobsMaintenanceWindow(c, &ch, x) - } - } - if s := string(v.PauseStatus); c.match(s) { - ch := n.Child("pause_status") - if r, ok := c.fn(&ch, s); ok { - v.PauseStatus = jobs.PauseStatus(r) - } - } - if s := string(v.TaskRetryMode); c.match(s) { - ch := n.Child("task_retry_mode") - if r, ok := c.fn(&ch, s); ok { - v.TaskRetryMode = jobs.TaskRetryMode(r) - } - } -} - -func stringsJobsJobDeployment(c *stringsWalk, n *Node, v *jobs.JobDeployment) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DeploymentId == "" && Forced(v.ForceSendFields, "DeploymentId") { - ch := n.Child("deployment_id") - c.fn(&ch, "") - } - if s := string(v.DeploymentId); c.match(s) { - ch := n.Child("deployment_id") - if r, ok := c.fn(&ch, s); ok { - v.DeploymentId = (r) - } - } - if s := string(v.Kind); c.match(s) { - ch := n.Child("kind") - if r, ok := c.fn(&ch, s); ok { - v.Kind = jobs.JobDeploymentKind(r) - } - } - if c.mode == EmptyFields && v.MetadataFilePath == "" && Forced(v.ForceSendFields, "MetadataFilePath") { - ch := n.Child("metadata_file_path") - c.fn(&ch, "") - } - if s := string(v.MetadataFilePath); c.match(s) { - ch := n.Child("metadata_file_path") - if r, ok := c.fn(&ch, s); ok { - v.MetadataFilePath = (r) - } - } - if c.mode == EmptyFields && v.VersionId == "" && Forced(v.ForceSendFields, "VersionId") { - ch := n.Child("version_id") - c.fn(&ch, "") - } - if s := string(v.VersionId); c.match(s) { - ch := n.Child("version_id") - if r, ok := c.fn(&ch, s); ok { - v.VersionId = (r) - } - } -} - -func stringsJobsJobEmailNotifications(c *stringsWalk, n *Node, v *jobs.JobEmailNotifications) { - if n.isRef() { - return - } - if !n.IsRef("on_duration_warning_threshold_exceeded") { - if len(v.OnDurationWarningThresholdExceeded) > 0 { - cn := n.Child("on_duration_warning_threshold_exceeded") - for i := range v.OnDurationWarningThresholdExceeded { - if s := string(v.OnDurationWarningThresholdExceeded[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.OnDurationWarningThresholdExceeded[i] = (r) - } - } - } - } - } - if !n.IsRef("on_failure") { - if len(v.OnFailure) > 0 { - cn := n.Child("on_failure") - for i := range v.OnFailure { - if s := string(v.OnFailure[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.OnFailure[i] = (r) - } - } - } - } - } - if !n.IsRef("on_maintenance_complete") { - if len(v.OnMaintenanceComplete) > 0 { - cn := n.Child("on_maintenance_complete") - for i := range v.OnMaintenanceComplete { - if s := string(v.OnMaintenanceComplete[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.OnMaintenanceComplete[i] = (r) - } - } - } - } - } - if !n.IsRef("on_maintenance_start") { - if len(v.OnMaintenanceStart) > 0 { - cn := n.Child("on_maintenance_start") - for i := range v.OnMaintenanceStart { - if s := string(v.OnMaintenanceStart[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.OnMaintenanceStart[i] = (r) - } - } - } - } - } - if !n.IsRef("on_start") { - if len(v.OnStart) > 0 { - cn := n.Child("on_start") - for i := range v.OnStart { - if s := string(v.OnStart[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.OnStart[i] = (r) - } - } - } - } - } - if !n.IsRef("on_streaming_backlog_exceeded") { - if len(v.OnStreamingBacklogExceeded) > 0 { - cn := n.Child("on_streaming_backlog_exceeded") - for i := range v.OnStreamingBacklogExceeded { - if s := string(v.OnStreamingBacklogExceeded[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.OnStreamingBacklogExceeded[i] = (r) - } - } - } - } - } - if !n.IsRef("on_success") { - if len(v.OnSuccess) > 0 { - cn := n.Child("on_success") - for i := range v.OnSuccess { - if s := string(v.OnSuccess[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.OnSuccess[i] = (r) - } - } - } - } - } -} - -func stringsJobsJobEnvironmentVariables(c *stringsWalk, n *Node, v *jobs.JobEnvironmentVariables) { - if n.isRef() { - return - } - if s := string(v.EnvironmentVariablesKey); c.match(s) { - ch := n.Child("environment_variables_key") - if r, ok := c.fn(&ch, s); ok { - v.EnvironmentVariablesKey = (r) - } - } - if !n.IsRef("spec") { - if x := v.Spec; x != nil { - ch := n.Child("spec") - stringsJobsJobEnvironmentVariablesSpec(c, &ch, x) - } - } -} - -func stringsJobsJobEnvironment(c *stringsWalk, n *Node, v *jobs.JobEnvironment) { - if n.isRef() { - return - } - if s := string(v.EnvironmentKey); c.match(s) { - ch := n.Child("environment_key") - if r, ok := c.fn(&ch, s); ok { - v.EnvironmentKey = (r) - } - } - if !n.IsRef("spec") { - if x := v.Spec; x != nil { - ch := n.Child("spec") - stringsComputeEnvironment(c, &ch, x) - } - } -} - -func stringsJobsGitSource(c *stringsWalk, n *Node, v *jobs.GitSource) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.GitBranch == "" && Forced(v.ForceSendFields, "GitBranch") { - ch := n.Child("git_branch") - c.fn(&ch, "") - } - if s := string(v.GitBranch); c.match(s) { - ch := n.Child("git_branch") - if r, ok := c.fn(&ch, s); ok { - v.GitBranch = (r) - } - } - if c.mode == EmptyFields && v.GitCommit == "" && Forced(v.ForceSendFields, "GitCommit") { - ch := n.Child("git_commit") - c.fn(&ch, "") - } - if s := string(v.GitCommit); c.match(s) { - ch := n.Child("git_commit") - if r, ok := c.fn(&ch, s); ok { - v.GitCommit = (r) - } - } - if s := string(v.GitProvider); c.match(s) { - ch := n.Child("git_provider") - if r, ok := c.fn(&ch, s); ok { - v.GitProvider = jobs.GitProvider(r) - } - } - if !n.IsRef("git_snapshot") { - if x := v.GitSnapshot; x != nil { - ch := n.Child("git_snapshot") - stringsJobsGitSnapshot(c, &ch, x) - } - } - if c.mode == EmptyFields && v.GitTag == "" && Forced(v.ForceSendFields, "GitTag") { - ch := n.Child("git_tag") - c.fn(&ch, "") - } - if s := string(v.GitTag); c.match(s) { - ch := n.Child("git_tag") - if r, ok := c.fn(&ch, s); ok { - v.GitTag = (r) - } - } - if s := string(v.GitUrl); c.match(s) { - ch := n.Child("git_url") - if r, ok := c.fn(&ch, s); ok { - v.GitUrl = (r) - } - } - if !n.IsRef("job_source") { - if x := v.JobSource; x != nil { - ch := n.Child("job_source") - stringsJobsJobSource(c, &ch, x) - } - } - if !n.IsRef("sparse_checkout") { - if x := v.SparseCheckout; x != nil { - ch := n.Child("sparse_checkout") - stringsJobsSparseCheckout(c, &ch, x) - } - } -} - -func stringsJobsJobsHealthRules(c *stringsWalk, n *Node, v *jobs.JobsHealthRules) { - if n.isRef() { - return - } - if !n.IsRef("rules") { - if len(v.Rules) > 0 { - cn := n.Child("rules") - for i := range v.Rules { - { - ch := cn.Elem(i) - stringsJobsJobsHealthRule(c, &ch, &v.Rules[i]) - } - } - } - } -} - -func stringsJobsJobCluster(c *stringsWalk, n *Node, v *jobs.JobCluster) { - if n.isRef() { - return - } - if s := string(v.JobClusterKey); c.match(s) { - ch := n.Child("job_cluster_key") - if r, ok := c.fn(&ch, s); ok { - v.JobClusterKey = (r) - } - } - if !n.IsRef("new_cluster") { - if x := v.NewCluster; x != nil { - ch := n.Child("new_cluster") - stringsComputeClusterSpec(c, &ch, x) - } - } - if c.mode == EmptyFields && v.ServerlessComputeId == "" && Forced(v.ForceSendFields, "ServerlessComputeId") { - ch := n.Child("serverless_compute_id") - c.fn(&ch, "") - } - if s := string(v.ServerlessComputeId); c.match(s) { - ch := n.Child("serverless_compute_id") - if r, ok := c.fn(&ch, s); ok { - v.ServerlessComputeId = (r) - } - } -} - -func stringsJobsJobParameterDefinition(c *stringsWalk, n *Node, v *jobs.JobParameterDefinition) { - if n.isRef() { - return - } - if s := string(v.Default); c.match(s) { - ch := n.Child("default") - if r, ok := c.fn(&ch, s); ok { - v.Default = (r) - } - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } -} - -func stringsJobsCronSchedule(c *stringsWalk, n *Node, v *jobs.CronSchedule) { - if n.isRef() { - return - } - if s := string(v.PauseStatus); c.match(s) { - ch := n.Child("pause_status") - if r, ok := c.fn(&ch, s); ok { - v.PauseStatus = jobs.PauseStatus(r) - } - } - if s := string(v.QuartzCronExpression); c.match(s) { - ch := n.Child("quartz_cron_expression") - if r, ok := c.fn(&ch, s); ok { - v.QuartzCronExpression = (r) - } - } - if !n.IsRef("sql_condition") { - if x := v.SqlCondition; x != nil { - ch := n.Child("sql_condition") - stringsJobsSqlConditionConfiguration(c, &ch, x) - } - } - if s := string(v.TimezoneId); c.match(s) { - ch := n.Child("timezone_id") - if r, ok := c.fn(&ch, s); ok { - v.TimezoneId = (r) - } - } -} - -func stringsJobsTask(c *stringsWalk, n *Node, v *jobs.Task) { - if n.isRef() { - return - } - if !n.IsRef("ai_runtime_task") { - if x := v.AiRuntimeTask; x != nil { - ch := n.Child("ai_runtime_task") - stringsJobsAiRuntimeTask(c, &ch, x) - } - } - if !n.IsRef("alert_task") { - if x := v.AlertTask; x != nil { - ch := n.Child("alert_task") - stringsJobsAlertTask(c, &ch, x) - } - } - if !n.IsRef("clean_rooms_notebook_task") { - if x := v.CleanRoomsNotebookTask; x != nil { - ch := n.Child("clean_rooms_notebook_task") - stringsJobsCleanRoomsNotebookTask(c, &ch, x) - } - } - if !n.IsRef("compute") { - if x := v.Compute; x != nil { - ch := n.Child("compute") - stringsJobsCompute(c, &ch, x) - } - } - if !n.IsRef("condition_task") { - if x := v.ConditionTask; x != nil { - ch := n.Child("condition_task") - stringsJobsConditionTask(c, &ch, x) - } - } - if !n.IsRef("dashboard_task") { - if x := v.DashboardTask; x != nil { - ch := n.Child("dashboard_task") - stringsJobsDashboardTask(c, &ch, x) - } - } - if !n.IsRef("dbt_cloud_task") { - if x := v.DbtCloudTask; x != nil { - ch := n.Child("dbt_cloud_task") - stringsJobsDbtCloudTask(c, &ch, x) - } - } - if !n.IsRef("dbt_platform_task") { - if x := v.DbtPlatformTask; x != nil { - ch := n.Child("dbt_platform_task") - stringsJobsDbtPlatformTask(c, &ch, x) - } - } - if !n.IsRef("dbt_task") { - if x := v.DbtTask; x != nil { - ch := n.Child("dbt_task") - stringsJobsDbtTask(c, &ch, x) - } - } - if !n.IsRef("depends_on") { - if len(v.DependsOn) > 0 { - cn := n.Child("depends_on") - for i := range v.DependsOn { - { - ch := cn.Elem(i) - stringsJobsTaskDependency(c, &ch, &v.DependsOn[i]) - } - } - } - } - if c.mode == EmptyFields && v.Description == "" && Forced(v.ForceSendFields, "Description") { - ch := n.Child("description") - c.fn(&ch, "") - } - if s := string(v.Description); c.match(s) { - ch := n.Child("description") - if r, ok := c.fn(&ch, s); ok { - v.Description = (r) - } - } - if !n.IsRef("email_notifications") { - if x := v.EmailNotifications; x != nil { - ch := n.Child("email_notifications") - stringsJobsTaskEmailNotifications(c, &ch, x) - } - } - if c.mode == EmptyFields && v.EnvironmentKey == "" && Forced(v.ForceSendFields, "EnvironmentKey") { - ch := n.Child("environment_key") - c.fn(&ch, "") - } - if s := string(v.EnvironmentKey); c.match(s) { - ch := n.Child("environment_key") - if r, ok := c.fn(&ch, s); ok { - v.EnvironmentKey = (r) - } - } - if c.mode == EmptyFields && v.EnvironmentVariablesKey == "" && Forced(v.ForceSendFields, "EnvironmentVariablesKey") { - ch := n.Child("environment_variables_key") - c.fn(&ch, "") - } - if s := string(v.EnvironmentVariablesKey); c.match(s) { - ch := n.Child("environment_variables_key") - if r, ok := c.fn(&ch, s); ok { - v.EnvironmentVariablesKey = (r) - } - } - if c.mode == EmptyFields && v.ExistingClusterId == "" && Forced(v.ForceSendFields, "ExistingClusterId") { - ch := n.Child("existing_cluster_id") - c.fn(&ch, "") - } - if s := string(v.ExistingClusterId); c.match(s) { - ch := n.Child("existing_cluster_id") - if r, ok := c.fn(&ch, s); ok { - v.ExistingClusterId = (r) - } - } - if !n.IsRef("for_each_task") { - if x := v.ForEachTask; x != nil { - ch := n.Child("for_each_task") - stringsJobsForEachTask(c, &ch, x) - } - } - if !n.IsRef("gen_ai_compute_task") { - if x := v.GenAiComputeTask; x != nil { - ch := n.Child("gen_ai_compute_task") - stringsJobsGenAiComputeTask(c, &ch, x) - } - } - if !n.IsRef("health") { - if x := v.Health; x != nil { - ch := n.Child("health") - stringsJobsJobsHealthRules(c, &ch, x) - } - } - if c.mode == EmptyFields && v.JobClusterKey == "" && Forced(v.ForceSendFields, "JobClusterKey") { - ch := n.Child("job_cluster_key") - c.fn(&ch, "") - } - if s := string(v.JobClusterKey); c.match(s) { - ch := n.Child("job_cluster_key") - if r, ok := c.fn(&ch, s); ok { - v.JobClusterKey = (r) - } - } - if !n.IsRef("libraries") { - if len(v.Libraries) > 0 { - cn := n.Child("libraries") - for i := range v.Libraries { - { - ch := cn.Elem(i) - stringsComputeLibrary(c, &ch, &v.Libraries[i]) - } - } - } - } - if !n.IsRef("new_cluster") { - if x := v.NewCluster; x != nil { - ch := n.Child("new_cluster") - stringsComputeClusterSpec(c, &ch, x) - } - } - if !n.IsRef("notebook_task") { - if x := v.NotebookTask; x != nil { - ch := n.Child("notebook_task") - stringsJobsNotebookTask(c, &ch, x) - } - } - if !n.IsRef("pipeline_task") { - if x := v.PipelineTask; x != nil { - ch := n.Child("pipeline_task") - stringsJobsPipelineTask(c, &ch, x) - } - } - if !n.IsRef("power_bi_task") { - if x := v.PowerBiTask; x != nil { - ch := n.Child("power_bi_task") - stringsJobsPowerBiTask(c, &ch, x) - } - } - if !n.IsRef("python_operator_task") { - if x := v.PythonOperatorTask; x != nil { - ch := n.Child("python_operator_task") - stringsJobsPythonOperatorTask(c, &ch, x) - } - } - if !n.IsRef("python_wheel_task") { - if x := v.PythonWheelTask; x != nil { - ch := n.Child("python_wheel_task") - stringsJobsPythonWheelTask(c, &ch, x) - } - } - if c.mode == EmptyFields && v.RunIf == "" && Forced(v.ForceSendFields, "RunIf") { - ch := n.Child("run_if") - c.fn(&ch, "") - } - if s := string(v.RunIf); c.match(s) { - ch := n.Child("run_if") - if r, ok := c.fn(&ch, s); ok { - v.RunIf = jobs.RunIf(r) - } - } - if !n.IsRef("run_job_task") { - if x := v.RunJobTask; x != nil { - ch := n.Child("run_job_task") - stringsJobsRunJobTask(c, &ch, x) - } - } - if !n.IsRef("spark_jar_task") { - if x := v.SparkJarTask; x != nil { - ch := n.Child("spark_jar_task") - stringsJobsSparkJarTask(c, &ch, x) - } - } - if !n.IsRef("spark_python_task") { - if x := v.SparkPythonTask; x != nil { - ch := n.Child("spark_python_task") - stringsJobsSparkPythonTask(c, &ch, x) - } - } - if !n.IsRef("spark_submit_task") { - if x := v.SparkSubmitTask; x != nil { - ch := n.Child("spark_submit_task") - stringsJobsSparkSubmitTask(c, &ch, x) - } - } - if !n.IsRef("sql_task") { - if x := v.SqlTask; x != nil { - ch := n.Child("sql_task") - stringsJobsSqlTask(c, &ch, x) - } - } - if s := string(v.TaskKey); c.match(s) { - ch := n.Child("task_key") - if r, ok := c.fn(&ch, s); ok { - v.TaskKey = (r) - } - } - if !n.IsRef("webhook_notifications") { - if x := v.WebhookNotifications; x != nil { - ch := n.Child("webhook_notifications") - stringsJobsWebhookNotifications(c, &ch, x) - } - } -} - -func stringsJobsTriggerSettings(c *stringsWalk, n *Node, v *jobs.TriggerSettings) { - if n.isRef() { - return - } - if !n.IsRef("file_arrival") { - if x := v.FileArrival; x != nil { - ch := n.Child("file_arrival") - stringsJobsFileArrivalTriggerConfiguration(c, &ch, x) - } - } - if !n.IsRef("model") { - if x := v.Model; x != nil { - ch := n.Child("model") - stringsJobsModelTriggerConfiguration(c, &ch, x) - } - } - if s := string(v.PauseStatus); c.match(s) { - ch := n.Child("pause_status") - if r, ok := c.fn(&ch, s); ok { - v.PauseStatus = jobs.PauseStatus(r) - } - } - if !n.IsRef("periodic") { - if x := v.Periodic; x != nil { - ch := n.Child("periodic") - stringsJobsPeriodicTriggerConfiguration(c, &ch, x) - } - } - if !n.IsRef("sql_condition") { - if x := v.SqlCondition; x != nil { - ch := n.Child("sql_condition") - stringsJobsSqlConditionConfiguration(c, &ch, x) - } - } - if !n.IsRef("table_update") { - if x := v.TableUpdate; x != nil { - ch := n.Child("table_update") - stringsJobsTableUpdateTriggerConfiguration(c, &ch, x) - } - } -} - -func stringsJobsTriggerConfiguration(c *stringsWalk, n *Node, v *jobs.TriggerConfiguration) { - if n.isRef() { - return - } - if !n.IsRef("continuous") { - if x := v.Continuous; x != nil { - ch := n.Child("continuous") - stringsJobsContinuousTriggerConfiguration(c, &ch, x) - } - } - if !n.IsRef("file_arrival") { - if x := v.FileArrival; x != nil { - ch := n.Child("file_arrival") - stringsJobsFileArrivalTriggerConfiguration(c, &ch, x) - } - } - if !n.IsRef("model") { - if x := v.Model; x != nil { - ch := n.Child("model") - stringsJobsModelTriggerConfiguration(c, &ch, x) - } - } - if s := string(v.PauseStatus); c.match(s) { - ch := n.Child("pause_status") - if r, ok := c.fn(&ch, s); ok { - v.PauseStatus = jobs.PauseStatus(r) - } - } - if !n.IsRef("periodic") { - if x := v.Periodic; x != nil { - ch := n.Child("periodic") - stringsJobsPeriodicTriggerConfiguration(c, &ch, x) - } - } - if !n.IsRef("schedule") { - if x := v.Schedule; x != nil { - ch := n.Child("schedule") - stringsJobsCronTriggerConfiguration(c, &ch, x) - } - } - if !n.IsRef("sql_condition") { - if x := v.SqlCondition; x != nil { - ch := n.Child("sql_condition") - stringsJobsSqlConditionConfiguration(c, &ch, x) - } - } - if !n.IsRef("table_update") { - if x := v.TableUpdate; x != nil { - ch := n.Child("table_update") - stringsJobsTableUpdateTriggerConfiguration(c, &ch, x) - } - } -} - -func stringsJobsWebhookNotifications(c *stringsWalk, n *Node, v *jobs.WebhookNotifications) { - if n.isRef() { - return - } - if !n.IsRef("on_duration_warning_threshold_exceeded") { - if len(v.OnDurationWarningThresholdExceeded) > 0 { - cn := n.Child("on_duration_warning_threshold_exceeded") - for i := range v.OnDurationWarningThresholdExceeded { - { - ch := cn.Elem(i) - stringsJobsWebhook(c, &ch, &v.OnDurationWarningThresholdExceeded[i]) - } - } - } - } - if !n.IsRef("on_failure") { - if len(v.OnFailure) > 0 { - cn := n.Child("on_failure") - for i := range v.OnFailure { - { - ch := cn.Elem(i) - stringsJobsWebhook(c, &ch, &v.OnFailure[i]) - } - } - } - } - if !n.IsRef("on_maintenance_complete") { - if len(v.OnMaintenanceComplete) > 0 { - cn := n.Child("on_maintenance_complete") - for i := range v.OnMaintenanceComplete { - { - ch := cn.Elem(i) - stringsJobsWebhook(c, &ch, &v.OnMaintenanceComplete[i]) - } - } - } - } - if !n.IsRef("on_maintenance_start") { - if len(v.OnMaintenanceStart) > 0 { - cn := n.Child("on_maintenance_start") - for i := range v.OnMaintenanceStart { - { - ch := cn.Elem(i) - stringsJobsWebhook(c, &ch, &v.OnMaintenanceStart[i]) - } - } - } - } - if !n.IsRef("on_start") { - if len(v.OnStart) > 0 { - cn := n.Child("on_start") - for i := range v.OnStart { - { - ch := cn.Elem(i) - stringsJobsWebhook(c, &ch, &v.OnStart[i]) - } - } - } - } - if !n.IsRef("on_streaming_backlog_exceeded") { - if len(v.OnStreamingBacklogExceeded) > 0 { - cn := n.Child("on_streaming_backlog_exceeded") - for i := range v.OnStreamingBacklogExceeded { - { - ch := cn.Elem(i) - stringsJobsWebhook(c, &ch, &v.OnStreamingBacklogExceeded[i]) - } - } - } - } - if !n.IsRef("on_success") { - if len(v.OnSuccess) > 0 { - cn := n.Child("on_success") - for i := range v.OnSuccess { - { - ch := cn.Elem(i) - stringsJobsWebhook(c, &ch, &v.OnSuccess[i]) - } - } - } - } -} - -func stringsResourcesJobRunLifecycle(c *stringsWalk, n *Node, v *resources.JobRunLifecycle) { - if n.isRef() { - return - } - if !n.IsRef("triggers") { - if len(v.Triggers) > 0 { - cn := n.Child("triggers") - for i := range v.Triggers { - { - ch := cn.Elem(i) - stringsResourcesJobRunTrigger(c, &ch, &v.Triggers[i]) - } - } - } - } - if !n.IsRef("triggers_state") { - if x := v.TriggersState; x != nil { - ch := n.Child("triggers_state") - stringsResourcesJobRunTriggersState(c, &ch, x) - } - } - if !n.IsRef("depends_on") { - if len(v.Lifecycle.DependsOn) > 0 { - cn := n.Child("depends_on") - for i := range v.Lifecycle.DependsOn { - { - ch := cn.Elem(i) - stringsResourcesDependsOn(c, &ch, &v.Lifecycle.DependsOn[i]) - } - } - } - } -} - -func stringsJobsPipelineParams(c *stringsWalk, n *Node, v *jobs.PipelineParams) { - if n.isRef() { - return - } - if !n.IsRef("full_refresh_selection") { - if len(v.FullRefreshSelection) > 0 { - cn := n.Child("full_refresh_selection") - for i := range v.FullRefreshSelection { - if s := string(v.FullRefreshSelection[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.FullRefreshSelection[i] = (r) - } - } - } - } - } - if !n.IsRef("refresh_flow_selection") { - if len(v.RefreshFlowSelection) > 0 { - cn := n.Child("refresh_flow_selection") - for i := range v.RefreshFlowSelection { - if s := string(v.RefreshFlowSelection[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.RefreshFlowSelection[i] = (r) - } - } - } - } - } - if !n.IsRef("refresh_selection") { - if len(v.RefreshSelection) > 0 { - cn := n.Child("refresh_selection") - for i := range v.RefreshSelection { - if s := string(v.RefreshSelection[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.RefreshSelection[i] = (r) - } - } - } - } - } - if !n.IsRef("reset_checkpoint_selection") { - if len(v.ResetCheckpointSelection) > 0 { - cn := n.Child("reset_checkpoint_selection") - for i := range v.ResetCheckpointSelection { - if s := string(v.ResetCheckpointSelection[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.ResetCheckpointSelection[i] = (r) - } - } - } - } - } -} - -func stringsResourcesPipelinePermission(c *stringsWalk, n *Node, v *resources.PipelinePermission) { - if n.isRef() { - return - } - if s := string(v.Level); c.match(s) { - ch := n.Child("level") - if r, ok := c.fn(&ch, s); ok { - v.Level = pipelines.PipelinePermissionLevel(r) - } - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } -} - -func stringsPipelinesPipelineCluster(c *stringsWalk, n *Node, v *pipelines.PipelineCluster) { - if n.isRef() { - return - } - if !n.IsRef("autoscale") { - if x := v.Autoscale; x != nil { - ch := n.Child("autoscale") - stringsPipelinesPipelineClusterAutoscale(c, &ch, x) - } - } - if !n.IsRef("aws_attributes") { - if x := v.AwsAttributes; x != nil { - ch := n.Child("aws_attributes") - stringsComputeAwsAttributes(c, &ch, x) - } - } - if !n.IsRef("azure_attributes") { - if x := v.AzureAttributes; x != nil { - ch := n.Child("azure_attributes") - stringsComputeAzureAttributes(c, &ch, x) - } - } - if !n.IsRef("cluster_log_conf") { - if x := v.ClusterLogConf; x != nil { - ch := n.Child("cluster_log_conf") - stringsComputeClusterLogConf(c, &ch, x) - } - } - if !n.IsRef("custom_tags") { - if len(v.CustomTags) > 0 { - cn := n.Child("custom_tags") - for _, k := range sortedKeys(v.CustomTags) { - if s := string(v.CustomTags[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.CustomTags[k] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.DriverInstancePoolId == "" && Forced(v.ForceSendFields, "DriverInstancePoolId") { - ch := n.Child("driver_instance_pool_id") - c.fn(&ch, "") - } - if s := string(v.DriverInstancePoolId); c.match(s) { - ch := n.Child("driver_instance_pool_id") - if r, ok := c.fn(&ch, s); ok { - v.DriverInstancePoolId = (r) - } - } - if c.mode == EmptyFields && v.DriverNodeTypeId == "" && Forced(v.ForceSendFields, "DriverNodeTypeId") { - ch := n.Child("driver_node_type_id") - c.fn(&ch, "") - } - if s := string(v.DriverNodeTypeId); c.match(s) { - ch := n.Child("driver_node_type_id") - if r, ok := c.fn(&ch, s); ok { - v.DriverNodeTypeId = (r) - } - } - if !n.IsRef("gcp_attributes") { - if x := v.GcpAttributes; x != nil { - ch := n.Child("gcp_attributes") - stringsComputeGcpAttributes(c, &ch, x) - } - } - if !n.IsRef("init_scripts") { - if len(v.InitScripts) > 0 { - cn := n.Child("init_scripts") - for i := range v.InitScripts { - { - ch := cn.Elem(i) - stringsComputeInitScriptInfo(c, &ch, &v.InitScripts[i]) - } - } - } - } - if c.mode == EmptyFields && v.InstancePoolId == "" && Forced(v.ForceSendFields, "InstancePoolId") { - ch := n.Child("instance_pool_id") - c.fn(&ch, "") - } - if s := string(v.InstancePoolId); c.match(s) { - ch := n.Child("instance_pool_id") - if r, ok := c.fn(&ch, s); ok { - v.InstancePoolId = (r) - } - } - if c.mode == EmptyFields && v.Label == "" && Forced(v.ForceSendFields, "Label") { - ch := n.Child("label") - c.fn(&ch, "") - } - if s := string(v.Label); c.match(s) { - ch := n.Child("label") - if r, ok := c.fn(&ch, s); ok { - v.Label = (r) - } - } - if c.mode == EmptyFields && v.NodeTypeId == "" && Forced(v.ForceSendFields, "NodeTypeId") { - ch := n.Child("node_type_id") - c.fn(&ch, "") - } - if s := string(v.NodeTypeId); c.match(s) { - ch := n.Child("node_type_id") - if r, ok := c.fn(&ch, s); ok { - v.NodeTypeId = (r) - } - } - if c.mode == EmptyFields && v.PolicyId == "" && Forced(v.ForceSendFields, "PolicyId") { - ch := n.Child("policy_id") - c.fn(&ch, "") - } - if s := string(v.PolicyId); c.match(s) { - ch := n.Child("policy_id") - if r, ok := c.fn(&ch, s); ok { - v.PolicyId = (r) - } - } - if !n.IsRef("spark_conf") { - if len(v.SparkConf) > 0 { - cn := n.Child("spark_conf") - for _, k := range sortedKeys(v.SparkConf) { - if s := string(v.SparkConf[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.SparkConf[k] = (r) - } - } - } - } - } - if !n.IsRef("spark_env_vars") { - if len(v.SparkEnvVars) > 0 { - cn := n.Child("spark_env_vars") - for _, k := range sortedKeys(v.SparkEnvVars) { - if s := string(v.SparkEnvVars[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.SparkEnvVars[k] = (r) - } - } - } - } - } - if !n.IsRef("ssh_public_keys") { - if len(v.SshPublicKeys) > 0 { - cn := n.Child("ssh_public_keys") - for i := range v.SshPublicKeys { - if s := string(v.SshPublicKeys[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.SshPublicKeys[i] = (r) - } - } - } - } - } -} - -func stringsPipelinesPipelineDeployment(c *stringsWalk, n *Node, v *pipelines.PipelineDeployment) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DeploymentId == "" && Forced(v.ForceSendFields, "DeploymentId") { - ch := n.Child("deployment_id") - c.fn(&ch, "") - } - if s := string(v.DeploymentId); c.match(s) { - ch := n.Child("deployment_id") - if r, ok := c.fn(&ch, s); ok { - v.DeploymentId = (r) - } - } - if s := string(v.Kind); c.match(s) { - ch := n.Child("kind") - if r, ok := c.fn(&ch, s); ok { - v.Kind = pipelines.DeploymentKind(r) - } - } - if c.mode == EmptyFields && v.MetadataFilePath == "" && Forced(v.ForceSendFields, "MetadataFilePath") { - ch := n.Child("metadata_file_path") - c.fn(&ch, "") - } - if s := string(v.MetadataFilePath); c.match(s) { - ch := n.Child("metadata_file_path") - if r, ok := c.fn(&ch, s); ok { - v.MetadataFilePath = (r) - } - } - if c.mode == EmptyFields && v.VersionId == "" && Forced(v.ForceSendFields, "VersionId") { - ch := n.Child("version_id") - c.fn(&ch, "") - } - if s := string(v.VersionId); c.match(s) { - ch := n.Child("version_id") - if r, ok := c.fn(&ch, s); ok { - v.VersionId = (r) - } - } -} - -func stringsPipelinesPipelinesEnvironment(c *stringsWalk, n *Node, v *pipelines.PipelinesEnvironment) { - if n.isRef() { - return - } - if !n.IsRef("dependencies") { - if len(v.Dependencies) > 0 { - cn := n.Child("dependencies") - for i := range v.Dependencies { - if s := string(v.Dependencies[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Dependencies[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.EnvironmentVersion == "" && Forced(v.ForceSendFields, "EnvironmentVersion") { - ch := n.Child("environment_version") - c.fn(&ch, "") - } - if s := string(v.EnvironmentVersion); c.match(s) { - ch := n.Child("environment_version") - if r, ok := c.fn(&ch, s); ok { - v.EnvironmentVersion = (r) - } - } -} - -func stringsPipelinesEventLogSpec(c *stringsWalk, n *Node, v *pipelines.EventLogSpec) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Catalog == "" && Forced(v.ForceSendFields, "Catalog") { - ch := n.Child("catalog") - c.fn(&ch, "") - } - if s := string(v.Catalog); c.match(s) { - ch := n.Child("catalog") - if r, ok := c.fn(&ch, s); ok { - v.Catalog = (r) - } - } - if c.mode == EmptyFields && v.Name == "" && Forced(v.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if c.mode == EmptyFields && v.Schema == "" && Forced(v.ForceSendFields, "Schema") { - ch := n.Child("schema") - c.fn(&ch, "") - } - if s := string(v.Schema); c.match(s) { - ch := n.Child("schema") - if r, ok := c.fn(&ch, s); ok { - v.Schema = (r) - } - } -} - -func stringsPipelinesFilters(c *stringsWalk, n *Node, v *pipelines.Filters) { - if n.isRef() { - return - } - if !n.IsRef("exclude") { - if len(v.Exclude) > 0 { - cn := n.Child("exclude") - for i := range v.Exclude { - if s := string(v.Exclude[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Exclude[i] = (r) - } - } - } - } - } - if !n.IsRef("include") { - if len(v.Include) > 0 { - cn := n.Child("include") - for i := range v.Include { - if s := string(v.Include[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Include[i] = (r) - } - } - } - } - } -} - -func stringsPipelinesIngestionGatewayPipelineDefinition(c *stringsWalk, n *Node, v *pipelines.IngestionGatewayPipelineDefinition) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ConnectionId == "" && Forced(v.ForceSendFields, "ConnectionId") { - ch := n.Child("connection_id") - c.fn(&ch, "") - } - if s := string(v.ConnectionId); c.match(s) { - ch := n.Child("connection_id") - if r, ok := c.fn(&ch, s); ok { - v.ConnectionId = (r) - } - } - if s := string(v.ConnectionName); c.match(s) { - ch := n.Child("connection_name") - if r, ok := c.fn(&ch, s); ok { - v.ConnectionName = (r) - } - } - if !n.IsRef("connection_parameters") { - if x := v.ConnectionParameters; x != nil { - ch := n.Child("connection_parameters") - stringsPipelinesConnectionParameters(c, &ch, x) - } - } - if s := string(v.GatewayStorageCatalog); c.match(s) { - ch := n.Child("gateway_storage_catalog") - if r, ok := c.fn(&ch, s); ok { - v.GatewayStorageCatalog = (r) - } - } - if c.mode == EmptyFields && v.GatewayStorageName == "" && Forced(v.ForceSendFields, "GatewayStorageName") { - ch := n.Child("gateway_storage_name") - c.fn(&ch, "") - } - if s := string(v.GatewayStorageName); c.match(s) { - ch := n.Child("gateway_storage_name") - if r, ok := c.fn(&ch, s); ok { - v.GatewayStorageName = (r) - } - } - if s := string(v.GatewayStorageSchema); c.match(s) { - ch := n.Child("gateway_storage_schema") - if r, ok := c.fn(&ch, s); ok { - v.GatewayStorageSchema = (r) - } - } -} - -func stringsPipelinesIngestionPipelineDefinition(c *stringsWalk, n *Node, v *pipelines.IngestionPipelineDefinition) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ConnectionName == "" && Forced(v.ForceSendFields, "ConnectionName") { - ch := n.Child("connection_name") - c.fn(&ch, "") - } - if s := string(v.ConnectionName); c.match(s) { - ch := n.Child("connection_name") - if r, ok := c.fn(&ch, s); ok { - v.ConnectionName = (r) - } - } - if c.mode == EmptyFields && v.ConnectorType == "" && Forced(v.ForceSendFields, "ConnectorType") { - ch := n.Child("connector_type") - c.fn(&ch, "") - } - if s := string(v.ConnectorType); c.match(s) { - ch := n.Child("connector_type") - if r, ok := c.fn(&ch, s); ok { - v.ConnectorType = pipelines.ConnectorType(r) - } - } - if !n.IsRef("data_staging_options") { - if x := v.DataStagingOptions; x != nil { - ch := n.Child("data_staging_options") - stringsPipelinesDataStagingOptions(c, &ch, x) - } - } - if !n.IsRef("full_refresh_window") { - if x := v.FullRefreshWindow; x != nil { - ch := n.Child("full_refresh_window") - stringsPipelinesOperationTimeWindow(c, &ch, x) - } - } - if c.mode == EmptyFields && v.IngestionGatewayId == "" && Forced(v.ForceSendFields, "IngestionGatewayId") { - ch := n.Child("ingestion_gateway_id") - c.fn(&ch, "") - } - if s := string(v.IngestionGatewayId); c.match(s) { - ch := n.Child("ingestion_gateway_id") - if r, ok := c.fn(&ch, s); ok { - v.IngestionGatewayId = (r) - } - } - if c.mode == EmptyFields && v.NetsuiteJarPath == "" && Forced(v.ForceSendFields, "NetsuiteJarPath") { - ch := n.Child("netsuite_jar_path") - c.fn(&ch, "") - } - if s := string(v.NetsuiteJarPath); c.match(s) { - ch := n.Child("netsuite_jar_path") - if r, ok := c.fn(&ch, s); ok { - v.NetsuiteJarPath = (r) - } - } - if !n.IsRef("objects") { - if len(v.Objects) > 0 { - cn := n.Child("objects") - for i := range v.Objects { - { - ch := cn.Elem(i) - stringsPipelinesIngestionConfig(c, &ch, &v.Objects[i]) - } - } - } - } - if !n.IsRef("source_configurations") { - if len(v.SourceConfigurations) > 0 { - cn := n.Child("source_configurations") - for i := range v.SourceConfigurations { - { - ch := cn.Elem(i) - stringsPipelinesSourceConfig(c, &ch, &v.SourceConfigurations[i]) - } - } - } - } - if c.mode == EmptyFields && v.SourceType == "" && Forced(v.ForceSendFields, "SourceType") { - ch := n.Child("source_type") - c.fn(&ch, "") - } - if s := string(v.SourceType); c.match(s) { - ch := n.Child("source_type") - if r, ok := c.fn(&ch, s); ok { - v.SourceType = pipelines.IngestionSourceType(r) - } - } - if !n.IsRef("table_configuration") { - if x := v.TableConfiguration; x != nil { - ch := n.Child("table_configuration") - stringsPipelinesTableSpecificConfig(c, &ch, x) - } - } -} - -func stringsPipelinesPipelineLibrary(c *stringsWalk, n *Node, v *pipelines.PipelineLibrary) { - if n.isRef() { - return - } - if !n.IsRef("file") { - if x := v.File; x != nil { - ch := n.Child("file") - stringsPipelinesFileLibrary(c, &ch, x) - } - } - if !n.IsRef("glob") { - if x := v.Glob; x != nil { - ch := n.Child("glob") - stringsPipelinesPathPattern(c, &ch, x) - } - } - if c.mode == EmptyFields && v.Jar == "" && Forced(v.ForceSendFields, "Jar") { - ch := n.Child("jar") - c.fn(&ch, "") - } - if s := string(v.Jar); c.match(s) { - ch := n.Child("jar") - if r, ok := c.fn(&ch, s); ok { - v.Jar = (r) - } - } - if !n.IsRef("maven") { - if x := v.Maven; x != nil { - ch := n.Child("maven") - stringsComputeMavenLibrary(c, &ch, x) - } - } - if !n.IsRef("notebook") { - if x := v.Notebook; x != nil { - ch := n.Child("notebook") - stringsPipelinesNotebookLibrary(c, &ch, x) - } - } - if c.mode == EmptyFields && v.Whl == "" && Forced(v.ForceSendFields, "Whl") { - ch := n.Child("whl") - c.fn(&ch, "") - } - if s := string(v.Whl); c.match(s) { - ch := n.Child("whl") - if r, ok := c.fn(&ch, s); ok { - v.Whl = (r) - } - } -} - -func stringsPipelinesNotifications(c *stringsWalk, n *Node, v *pipelines.Notifications) { - if n.isRef() { - return - } - if !n.IsRef("alerts") { - if len(v.Alerts) > 0 { - cn := n.Child("alerts") - for i := range v.Alerts { - if s := string(v.Alerts[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Alerts[i] = (r) - } - } - } - } - } - if !n.IsRef("email_recipients") { - if len(v.EmailRecipients) > 0 { - cn := n.Child("email_recipients") - for i := range v.EmailRecipients { - if s := string(v.EmailRecipients[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.EmailRecipients[i] = (r) - } - } - } - } - } -} - -func stringsPipelinesRestartWindow(c *stringsWalk, n *Node, v *pipelines.RestartWindow) { - if n.isRef() { - return - } - if !n.IsRef("days_of_week") { - if len(v.DaysOfWeek) > 0 { - cn := n.Child("days_of_week") - for i := range v.DaysOfWeek { - if s := string(v.DaysOfWeek[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.DaysOfWeek[i] = pipelines.DayOfWeek(r) - } - } - } - } - } - if c.mode == EmptyFields && v.TimeZoneId == "" && Forced(v.ForceSendFields, "TimeZoneId") { - ch := n.Child("time_zone_id") - c.fn(&ch, "") - } - if s := string(v.TimeZoneId); c.match(s) { - ch := n.Child("time_zone_id") - if r, ok := c.fn(&ch, s); ok { - v.TimeZoneId = (r) - } - } -} - -func stringsPipelinesRunAs(c *stringsWalk, n *Node, v *pipelines.RunAs) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.GroupName == "" && Forced(v.ForceSendFields, "GroupName") { - ch := n.Child("group_name") - c.fn(&ch, "") - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } - if c.mode == EmptyFields && v.ServicePrincipalName == "" && Forced(v.ForceSendFields, "ServicePrincipalName") { - ch := n.Child("service_principal_name") - c.fn(&ch, "") - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if c.mode == EmptyFields && v.UserName == "" && Forced(v.ForceSendFields, "UserName") { - ch := n.Child("user_name") - c.fn(&ch, "") - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } -} - -func stringsPipelinesPipelineTrigger(c *stringsWalk, n *Node, v *pipelines.PipelineTrigger) { - if n.isRef() { - return - } - if !n.IsRef("cron") { - if x := v.Cron; x != nil { - ch := n.Child("cron") - stringsPipelinesCronTrigger(c, &ch, x) - } - } -} - -func stringsMlEntityColumn(c *stringsWalk, n *Node, v *ml.EntityColumn) { - if n.isRef() { - return - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } -} - -func stringsMlFunction(c *stringsWalk, n *Node, v *ml.Function) { - if n.isRef() { - return - } - if !n.IsRef("aggregation_function") { - if x := v.AggregationFunction; x != nil { - ch := n.Child("aggregation_function") - stringsMlAggregationFunction(c, &ch, x) - } - } - if !n.IsRef("column_selection") { - if x := v.ColumnSelection; x != nil { - ch := n.Child("column_selection") - stringsMlColumnSelection(c, &ch, x) - } - } - if !n.IsRef("custom_udf") { - if x := v.CustomUdf; x != nil { - ch := n.Child("custom_udf") - stringsMlCustomUdf(c, &ch, x) - } - } - if !n.IsRef("extra_parameters") { - if len(v.ExtraParameters) > 0 { - cn := n.Child("extra_parameters") - for i := range v.ExtraParameters { - { - ch := cn.Elem(i) - stringsMlFunctionExtraParameter(c, &ch, &v.ExtraParameters[i]) - } - } - } - } - if s := string(v.FunctionType); c.match(s) { - ch := n.Child("function_type") - if r, ok := c.fn(&ch, s); ok { - v.FunctionType = ml.FunctionFunctionType(r) - } - } -} - -func stringsMlDataSource(c *stringsWalk, n *Node, v *ml.DataSource) { - if n.isRef() { - return - } - if !n.IsRef("delta_table_source") { - if x := v.DeltaTableSource; x != nil { - ch := n.Child("delta_table_source") - stringsMlDeltaTableSource(c, &ch, x) - } - } - if !n.IsRef("feature_view_source") { - if x := v.FeatureViewSource; x != nil { - ch := n.Child("feature_view_source") - stringsMlFeatureViewSource(c, &ch, x) - } - } - if !n.IsRef("kafka_source") { - if x := v.KafkaSource; x != nil { - ch := n.Child("kafka_source") - stringsMlKafkaSource(c, &ch, x) - } - } - if !n.IsRef("request_source") { - if x := v.RequestSource; x != nil { - ch := n.Child("request_source") - stringsMlRequestSource(c, &ch, x) - } - } - if !n.IsRef("sdp_source") { - if x := v.SdpSource; x != nil { - ch := n.Child("sdp_source") - stringsMlSdpSource(c, &ch, x) - } - } - if !n.IsRef("stream_source") { - if x := v.StreamSource; x != nil { - ch := n.Child("stream_source") - stringsMlStreamSource(c, &ch, x) - } - } -} - -func stringsMlTimeWindow(c *stringsWalk, n *Node, v *ml.TimeWindow) { - if n.isRef() { - return - } - if !n.IsRef("continuous") { - if x := v.Continuous; x != nil { - ch := n.Child("continuous") - stringsMlContinuousWindow(c, &ch, x) - } - } - if !n.IsRef("sliding") { - if x := v.Sliding; x != nil { - ch := n.Child("sliding") - stringsMlSlidingWindow(c, &ch, x) - } - } - if !n.IsRef("tumbling") { - if x := v.Tumbling; x != nil { - ch := n.Child("tumbling") - stringsMlTumblingWindow(c, &ch, x) - } - } -} - -func stringsMlTimeseriesColumn(c *stringsWalk, n *Node, v *ml.TimeseriesColumn) { - if n.isRef() { - return - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } -} - -func stringsResourcesMlflowModelPermission(c *stringsWalk, n *Node, v *resources.MlflowModelPermission) { - if n.isRef() { - return - } - if s := string(v.Level); c.match(s) { - ch := n.Child("level") - if r, ok := c.fn(&ch, s); ok { - v.Level = ml.RegisteredModelPermissionLevel(r) - } - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } -} - -func stringsMlModelTag(c *stringsWalk, n *Node, v *ml.ModelTag) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Key == "" && Forced(v.ForceSendFields, "Key") { - ch := n.Child("key") - c.fn(&ch, "") - } - if s := string(v.Key); c.match(s) { - ch := n.Child("key") - if r, ok := c.fn(&ch, s); ok { - v.Key = (r) - } - } - if c.mode == EmptyFields && v.Value == "" && Forced(v.ForceSendFields, "Value") { - ch := n.Child("value") - c.fn(&ch, "") - } - if s := string(v.Value); c.match(s) { - ch := n.Child("value") - if r, ok := c.fn(&ch, s); ok { - v.Value = (r) - } - } -} - -func stringsResourcesMlflowExperimentPermission(c *stringsWalk, n *Node, v *resources.MlflowExperimentPermission) { - if n.isRef() { - return - } - if s := string(v.Level); c.match(s) { - ch := n.Child("level") - if r, ok := c.fn(&ch, s); ok { - v.Level = ml.ExperimentPermissionLevel(r) - } - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } -} - -func stringsMlExperimentTag(c *stringsWalk, n *Node, v *ml.ExperimentTag) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Key == "" && Forced(v.ForceSendFields, "Key") { - ch := n.Child("key") - c.fn(&ch, "") - } - if s := string(v.Key); c.match(s) { - ch := n.Child("key") - if r, ok := c.fn(&ch, s); ok { - v.Key = (r) - } - } - if c.mode == EmptyFields && v.Value == "" && Forced(v.ForceSendFields, "Value") { - ch := n.Child("value") - c.fn(&ch, "") - } - if s := string(v.Value); c.match(s) { - ch := n.Child("value") - if r, ok := c.fn(&ch, s); ok { - v.Value = (r) - } - } -} - -func stringsMlExperimentTraceLocation(c *stringsWalk, n *Node, v *ml.ExperimentTraceLocation) { - if n.isRef() { - return - } - if !n.IsRef("uc_trace_location") { - if x := v.UcTraceLocation; x != nil { - ch := n.Child("uc_trace_location") - stringsMlUcTraceLocation(c, &ch, x) - } - } -} - -func stringsResourcesModelServingEndpointPermission(c *stringsWalk, n *Node, v *resources.ModelServingEndpointPermission) { - if n.isRef() { - return - } - if s := string(v.Level); c.match(s) { - ch := n.Child("level") - if r, ok := c.fn(&ch, s); ok { - v.Level = serving.ServingEndpointPermissionLevel(r) - } - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } -} - -func stringsServingAiGatewayConfig(c *stringsWalk, n *Node, v *serving.AiGatewayConfig) { - if n.isRef() { - return - } - if !n.IsRef("guardrails") { - if x := v.Guardrails; x != nil { - ch := n.Child("guardrails") - stringsServingAiGatewayGuardrails(c, &ch, x) - } - } - if !n.IsRef("inference_table_config") { - if x := v.InferenceTableConfig; x != nil { - ch := n.Child("inference_table_config") - stringsServingAiGatewayInferenceTableConfig(c, &ch, x) - } - } - if !n.IsRef("rate_limits") { - if len(v.RateLimits) > 0 { - cn := n.Child("rate_limits") - for i := range v.RateLimits { - { - ch := cn.Elem(i) - stringsServingAiGatewayRateLimit(c, &ch, &v.RateLimits[i]) - } - } - } - } -} - -func stringsServingEndpointCoreConfigInput(c *stringsWalk, n *Node, v *serving.EndpointCoreConfigInput) { - if n.isRef() { - return - } - if !n.IsRef("auto_capture_config") { - if x := v.AutoCaptureConfig; x != nil { - ch := n.Child("auto_capture_config") - stringsServingAutoCaptureConfigInput(c, &ch, x) - } - } - if !n.IsRef("served_entities") { - if len(v.ServedEntities) > 0 { - cn := n.Child("served_entities") - for i := range v.ServedEntities { - { - ch := cn.Elem(i) - stringsServingServedEntityInput(c, &ch, &v.ServedEntities[i]) - } - } - } - } - if !n.IsRef("served_models") { - if len(v.ServedModels) > 0 { - cn := n.Child("served_models") - for i := range v.ServedModels { - { - ch := cn.Elem(i) - stringsServingServedModelInput(c, &ch, &v.ServedModels[i]) - } - } - } - } - if !n.IsRef("traffic_config") { - if x := v.TrafficConfig; x != nil { - ch := n.Child("traffic_config") - stringsServingTrafficConfig(c, &ch, x) - } - } -} - -func stringsServingEmailNotifications(c *stringsWalk, n *Node, v *serving.EmailNotifications) { - if n.isRef() { - return - } - if !n.IsRef("on_update_failure") { - if len(v.OnUpdateFailure) > 0 { - cn := n.Child("on_update_failure") - for i := range v.OnUpdateFailure { - if s := string(v.OnUpdateFailure[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.OnUpdateFailure[i] = (r) - } - } - } - } - } - if !n.IsRef("on_update_success") { - if len(v.OnUpdateSuccess) > 0 { - cn := n.Child("on_update_success") - for i := range v.OnUpdateSuccess { - if s := string(v.OnUpdateSuccess[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.OnUpdateSuccess[i] = (r) - } - } - } - } - } -} - -func stringsServingRateLimit(c *stringsWalk, n *Node, v *serving.RateLimit) { - if n.isRef() { - return - } - if s := string(v.Key); c.match(s) { - ch := n.Child("key") - if r, ok := c.fn(&ch, s); ok { - v.Key = serving.RateLimitKey(r) - } - } - if s := string(v.RenewalPeriod); c.match(s) { - ch := n.Child("renewal_period") - if r, ok := c.fn(&ch, s); ok { - v.RenewalPeriod = serving.RateLimitRenewalPeriod(r) - } - } -} - -func stringsServingEndpointTag(c *stringsWalk, n *Node, v *serving.EndpointTag) { - if n.isRef() { - return - } - if s := string(v.Key); c.match(s) { - ch := n.Child("key") - if r, ok := c.fn(&ch, s); ok { - v.Key = (r) - } - } - if c.mode == EmptyFields && v.Value == "" && Forced(v.ForceSendFields, "Value") { - ch := n.Child("value") - c.fn(&ch, "") - } - if s := string(v.Value); c.match(s) { - ch := n.Child("value") - if r, ok := c.fn(&ch, s); ok { - v.Value = (r) - } - } -} - -func stringsServingTelemetryConfig(c *stringsWalk, n *Node, v *serving.TelemetryConfig) { - if n.isRef() { - return - } - if !n.IsRef("enabled_telemetry_features") { - if len(v.EnabledTelemetryFeatures) > 0 { - cn := n.Child("enabled_telemetry_features") - for i := range v.EnabledTelemetryFeatures { - if s := string(v.EnabledTelemetryFeatures[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.EnabledTelemetryFeatures[i] = serving.TelemetryFeature(r) - } - } - } - } - } - if !n.IsRef("inference_table_config") { - if x := v.InferenceTableConfig; x != nil { - ch := n.Child("inference_table_config") - stringsServingTelemetryInferenceTableConfig(c, &ch, x) - } - } - if !n.IsRef("table_names") { - if x := v.TableNames; x != nil { - ch := n.Child("table_names") - stringsServingUnityCatalogTableNames(c, &ch, x) - } - } - if c.mode == EmptyFields && v.TelemetryProfileId == "" && Forced(v.ForceSendFields, "TelemetryProfileId") { - ch := n.Child("telemetry_profile_id") - c.fn(&ch, "") - } - if s := string(v.TelemetryProfileId); c.match(s) { - ch := n.Child("telemetry_profile_id") - if r, ok := c.fn(&ch, s); ok { - v.TelemetryProfileId = (r) - } - } -} - -func stringsCatalogPrivilegeAssignment(c *stringsWalk, n *Node, v *catalog.PrivilegeAssignment) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Principal == "" && Forced(v.ForceSendFields, "Principal") { - ch := n.Child("principal") - c.fn(&ch, "") - } - if s := string(v.Principal); c.match(s) { - ch := n.Child("principal") - if r, ok := c.fn(&ch, s); ok { - v.Principal = (r) - } - } - if !n.IsRef("privileges") { - if len(v.Privileges) > 0 { - cn := n.Child("privileges") - for i := range v.Privileges { - if s := string(v.Privileges[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Privileges[i] = catalog.Privilege(r) - } - } - } - } - } -} - -func stringsCatalogModelServiceConfig(c *stringsWalk, n *Node, v *catalog.ModelServiceConfig) { - if n.isRef() { - return - } - if !n.IsRef("inference_table") { - if x := v.InferenceTable; x != nil { - ch := n.Child("inference_table") - stringsCatalogInferenceTableConfig(c, &ch, x) - } - } - if !n.IsRef("rate_limits") { - if len(v.RateLimits) > 0 { - cn := n.Child("rate_limits") - for i := range v.RateLimits { - { - ch := cn.Elem(i) - stringsCatalogRateLimit(c, &ch, &v.RateLimits[i]) - } - } - } - } - if !n.IsRef("routing") { - if x := v.Routing; x != nil { - ch := n.Child("routing") - stringsCatalogModelServiceConfigRoutingConfig(c, &ch, x) - } - } -} - -func stringsCatalogMcpServiceConfig(c *stringsWalk, n *Node, v *catalog.McpServiceConfig) { - if n.isRef() { - return - } - if !n.IsRef("include_tool_selectors") { - if len(v.IncludeToolSelectors) > 0 { - cn := n.Child("include_tool_selectors") - for i := range v.IncludeToolSelectors { - if s := string(v.IncludeToolSelectors[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.IncludeToolSelectors[i] = (r) - } - } - } - } - } - if !n.IsRef("rate_limits") { - if len(v.RateLimits) > 0 { - cn := n.Child("rate_limits") - for i := range v.RateLimits { - { - ch := cn.Elem(i) - stringsCatalogRateLimit(c, &ch, &v.RateLimits[i]) - } - } - } - } - if !n.IsRef("source_connection") { - if x := v.SourceConnection; x != nil { - ch := n.Child("source_connection") - stringsCatalogMcpServiceConfigSourceConnection(c, &ch, x) - } - } -} - -func stringsCatalogModelProviderServiceConfig(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfig) { - if n.isRef() { - return - } - if !n.IsRef("amazon_bedrock") { - if x := v.AmazonBedrock; x != nil { - ch := n.Child("amazon_bedrock") - stringsCatalogModelProviderServiceConfigAmazonBedrockProviderConfig(c, &ch, x) - } - } - if !n.IsRef("anthropic") { - if x := v.Anthropic; x != nil { - ch := n.Child("anthropic") - stringsCatalogModelProviderServiceConfigAnthropicProviderConfig(c, &ch, x) - } - } - if !n.IsRef("azure_openai") { - if x := v.AzureOpenai; x != nil { - ch := n.Child("azure_openai") - stringsCatalogModelProviderServiceConfigAzureOpenAiProviderConfig(c, &ch, x) - } - } - if !n.IsRef("bedrock_mantle") { - if x := v.BedrockMantle; x != nil { - ch := n.Child("bedrock_mantle") - stringsCatalogModelProviderServiceConfigAmazonBedrockProviderConfig(c, &ch, x) - } - } - if !n.IsRef("custom") { - if x := v.Custom; x != nil { - ch := n.Child("custom") - stringsCatalogModelProviderServiceConfigCustomProviderConfig(c, &ch, x) - } - } - if !n.IsRef("gemini_enterprise") { - if x := v.GeminiEnterprise; x != nil { - ch := n.Child("gemini_enterprise") - stringsCatalogModelProviderServiceConfigGeminiEnterpriseProviderConfig(c, &ch, x) - } - } - if !n.IsRef("inference_table") { - if x := v.InferenceTable; x != nil { - ch := n.Child("inference_table") - stringsCatalogInferenceTableConfig(c, &ch, x) - } - } - if !n.IsRef("microsoft_foundry") { - if x := v.MicrosoftFoundry; x != nil { - ch := n.Child("microsoft_foundry") - stringsCatalogModelProviderServiceConfigMicrosoftFoundryProviderConfig(c, &ch, x) - } - } - if !n.IsRef("openai") { - if x := v.Openai; x != nil { - ch := n.Child("openai") - stringsCatalogModelProviderServiceConfigOpenAiProviderConfig(c, &ch, x) - } - } - if c.mode == EmptyFields && v.ProviderType == "" && Forced(v.ForceSendFields, "ProviderType") { - ch := n.Child("provider_type") - c.fn(&ch, "") - } - if s := string(v.ProviderType); c.match(s) { - ch := n.Child("provider_type") - if r, ok := c.fn(&ch, s); ok { - v.ProviderType = catalog.ModelProviderServiceConfigExternalModelProviderType(r) - } - } - if !n.IsRef("rate_limits") { - if len(v.RateLimits) > 0 { - cn := n.Child("rate_limits") - for i := range v.RateLimits { - { - ch := cn.Elem(i) - stringsCatalogRateLimit(c, &ch, &v.RateLimits[i]) - } - } - } - } - if !n.IsRef("targets") { - if len(v.Targets) > 0 { - cn := n.Child("targets") - for i := range v.Targets { - { - ch := cn.Elem(i) - stringsCatalogModelProviderServiceConfigModelTargetConfig(c, &ch, &v.Targets[i]) - } - } - } - } -} - -func stringsCatalogRegisteredModelAlias(c *stringsWalk, n *Node, v *catalog.RegisteredModelAlias) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.AliasName == "" && Forced(v.ForceSendFields, "AliasName") { - ch := n.Child("alias_name") - c.fn(&ch, "") - } - if s := string(v.AliasName); c.match(s) { - ch := n.Child("alias_name") - if r, ok := c.fn(&ch, s); ok { - v.AliasName = (r) - } - } - if c.mode == EmptyFields && v.CatalogName == "" && Forced(v.ForceSendFields, "CatalogName") { - ch := n.Child("catalog_name") - c.fn(&ch, "") - } - if s := string(v.CatalogName); c.match(s) { - ch := n.Child("catalog_name") - if r, ok := c.fn(&ch, s); ok { - v.CatalogName = (r) - } - } - if c.mode == EmptyFields && v.Id == "" && Forced(v.ForceSendFields, "Id") { - ch := n.Child("id") - c.fn(&ch, "") - } - if s := string(v.Id); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.Id = (r) - } - } - if c.mode == EmptyFields && v.ModelName == "" && Forced(v.ForceSendFields, "ModelName") { - ch := n.Child("model_name") - c.fn(&ch, "") - } - if s := string(v.ModelName); c.match(s) { - ch := n.Child("model_name") - if r, ok := c.fn(&ch, s); ok { - v.ModelName = (r) - } - } - if c.mode == EmptyFields && v.SchemaName == "" && Forced(v.ForceSendFields, "SchemaName") { - ch := n.Child("schema_name") - c.fn(&ch, "") - } - if s := string(v.SchemaName); c.match(s) { - ch := n.Child("schema_name") - if r, ok := c.fn(&ch, s); ok { - v.SchemaName = (r) - } - } -} - -func stringsCatalogMonitorMetric(c *stringsWalk, n *Node, v *catalog.MonitorMetric) { - if n.isRef() { - return - } - if s := string(v.Definition); c.match(s) { - ch := n.Child("definition") - if r, ok := c.fn(&ch, s); ok { - v.Definition = (r) - } - } - if !n.IsRef("input_columns") { - if len(v.InputColumns) > 0 { - cn := n.Child("input_columns") - for i := range v.InputColumns { - if s := string(v.InputColumns[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.InputColumns[i] = (r) - } - } - } - } - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if s := string(v.OutputDataType); c.match(s) { - ch := n.Child("output_data_type") - if r, ok := c.fn(&ch, s); ok { - v.OutputDataType = (r) - } - } - if s := string(v.Type); c.match(s) { - ch := n.Child("type") - if r, ok := c.fn(&ch, s); ok { - v.Type = catalog.MonitorMetricType(r) - } - } -} - -func stringsCatalogMonitorInferenceLog(c *stringsWalk, n *Node, v *catalog.MonitorInferenceLog) { - if n.isRef() { - return - } - if !n.IsRef("granularities") { - if len(v.Granularities) > 0 { - cn := n.Child("granularities") - for i := range v.Granularities { - if s := string(v.Granularities[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Granularities[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.LabelCol == "" && Forced(v.ForceSendFields, "LabelCol") { - ch := n.Child("label_col") - c.fn(&ch, "") - } - if s := string(v.LabelCol); c.match(s) { - ch := n.Child("label_col") - if r, ok := c.fn(&ch, s); ok { - v.LabelCol = (r) - } - } - if s := string(v.ModelIdCol); c.match(s) { - ch := n.Child("model_id_col") - if r, ok := c.fn(&ch, s); ok { - v.ModelIdCol = (r) - } - } - if s := string(v.PredictionCol); c.match(s) { - ch := n.Child("prediction_col") - if r, ok := c.fn(&ch, s); ok { - v.PredictionCol = (r) - } - } - if c.mode == EmptyFields && v.PredictionProbaCol == "" && Forced(v.ForceSendFields, "PredictionProbaCol") { - ch := n.Child("prediction_proba_col") - c.fn(&ch, "") - } - if s := string(v.PredictionProbaCol); c.match(s) { - ch := n.Child("prediction_proba_col") - if r, ok := c.fn(&ch, s); ok { - v.PredictionProbaCol = (r) - } - } - if s := string(v.ProblemType); c.match(s) { - ch := n.Child("problem_type") - if r, ok := c.fn(&ch, s); ok { - v.ProblemType = catalog.MonitorInferenceLogProblemType(r) - } - } - if s := string(v.TimestampCol); c.match(s) { - ch := n.Child("timestamp_col") - if r, ok := c.fn(&ch, s); ok { - v.TimestampCol = (r) - } - } -} - -func stringsCatalogMonitorNotifications(c *stringsWalk, n *Node, v *catalog.MonitorNotifications) { - if n.isRef() { - return - } - if !n.IsRef("on_failure") { - if x := v.OnFailure; x != nil { - ch := n.Child("on_failure") - stringsCatalogMonitorDestination(c, &ch, x) - } - } - if !n.IsRef("on_new_classification_tag_detected") { - if x := v.OnNewClassificationTagDetected; x != nil { - ch := n.Child("on_new_classification_tag_detected") - stringsCatalogMonitorDestination(c, &ch, x) - } - } -} - -func stringsCatalogMonitorCronSchedule(c *stringsWalk, n *Node, v *catalog.MonitorCronSchedule) { - if n.isRef() { - return - } - if s := string(v.PauseStatus); c.match(s) { - ch := n.Child("pause_status") - if r, ok := c.fn(&ch, s); ok { - v.PauseStatus = catalog.MonitorCronSchedulePauseStatus(r) - } - } - if s := string(v.QuartzCronExpression); c.match(s) { - ch := n.Child("quartz_cron_expression") - if r, ok := c.fn(&ch, s); ok { - v.QuartzCronExpression = (r) - } - } - if s := string(v.TimezoneId); c.match(s) { - ch := n.Child("timezone_id") - if r, ok := c.fn(&ch, s); ok { - v.TimezoneId = (r) - } - } -} - -func stringsCatalogMonitorTimeSeries(c *stringsWalk, n *Node, v *catalog.MonitorTimeSeries) { - if n.isRef() { - return - } - if !n.IsRef("granularities") { - if len(v.Granularities) > 0 { - cn := n.Child("granularities") - for i := range v.Granularities { - if s := string(v.Granularities[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Granularities[i] = (r) - } - } - } - } - } - if s := string(v.TimestampCol); c.match(s) { - ch := n.Child("timestamp_col") - if r, ok := c.fn(&ch, s); ok { - v.TimestampCol = (r) - } - } -} - -func stringsCatalogEncryptionSettings(c *stringsWalk, n *Node, v *catalog.EncryptionSettings) { - if n.isRef() { - return - } - if !n.IsRef("azure_encryption_settings") { - if x := v.AzureEncryptionSettings; x != nil { - ch := n.Child("azure_encryption_settings") - stringsCatalogAzureEncryptionSettings(c, &ch, x) - } - } - if c.mode == EmptyFields && v.AzureKeyVaultKeyId == "" && Forced(v.ForceSendFields, "AzureKeyVaultKeyId") { - ch := n.Child("azure_key_vault_key_id") - c.fn(&ch, "") - } - if s := string(v.AzureKeyVaultKeyId); c.match(s) { - ch := n.Child("azure_key_vault_key_id") - if r, ok := c.fn(&ch, s); ok { - v.AzureKeyVaultKeyId = (r) - } - } - if c.mode == EmptyFields && v.CustomerManagedKeyId == "" && Forced(v.ForceSendFields, "CustomerManagedKeyId") { - ch := n.Child("customer_managed_key_id") - c.fn(&ch, "") - } - if s := string(v.CustomerManagedKeyId); c.match(s) { - ch := n.Child("customer_managed_key_id") - if r, ok := c.fn(&ch, s); ok { - v.CustomerManagedKeyId = (r) - } - } -} - -func stringsCatalogFileEventQueue(c *stringsWalk, n *Node, v *catalog.FileEventQueue) { - if n.isRef() { - return - } - if !n.IsRef("managed_aqs") { - if x := v.ManagedAqs; x != nil { - ch := n.Child("managed_aqs") - stringsCatalogAzureQueueStorage(c, &ch, x) - } - } - if !n.IsRef("managed_pubsub") { - if x := v.ManagedPubsub; x != nil { - ch := n.Child("managed_pubsub") - stringsCatalogGcpPubsub(c, &ch, x) - } - } - if !n.IsRef("managed_sqs") { - if x := v.ManagedSqs; x != nil { - ch := n.Child("managed_sqs") - stringsCatalogAwsSqsQueue(c, &ch, x) - } - } - if !n.IsRef("provided_aqs") { - if x := v.ProvidedAqs; x != nil { - ch := n.Child("provided_aqs") - stringsCatalogAzureQueueStorage(c, &ch, x) - } - } - if !n.IsRef("provided_pubsub") { - if x := v.ProvidedPubsub; x != nil { - ch := n.Child("provided_pubsub") - stringsCatalogGcpPubsub(c, &ch, x) - } - } - if !n.IsRef("provided_sqs") { - if x := v.ProvidedSqs; x != nil { - ch := n.Child("provided_sqs") - stringsCatalogAwsSqsQueue(c, &ch, x) - } - } -} - -func stringsCatalogEncryptionDetails(c *stringsWalk, n *Node, v *catalog.EncryptionDetails) { - if n.isRef() { - return - } - if !n.IsRef("sse_encryption_details") { - if x := v.SseEncryptionDetails; x != nil { - ch := n.Child("sse_encryption_details") - stringsCatalogSseEncryptionDetails(c, &ch, x) - } - } -} - -func stringsResourcesLifecycleWithStarted(c *stringsWalk, n *Node, v *resources.LifecycleWithStarted) { - if n.isRef() { - return - } - if !n.IsRef("depends_on") { - if len(v.Lifecycle.DependsOn) > 0 { - cn := n.Child("depends_on") - for i := range v.Lifecycle.DependsOn { - { - ch := cn.Elem(i) - stringsResourcesDependsOn(c, &ch, &v.Lifecycle.DependsOn[i]) - } - } - } - } -} - -func stringsComputeLibrary(c *stringsWalk, n *Node, v *compute.Library) { - if n.isRef() { - return - } - if !n.IsRef("cran") { - if x := v.Cran; x != nil { - ch := n.Child("cran") - stringsComputeRCranLibrary(c, &ch, x) - } - } - if c.mode == EmptyFields && v.Egg == "" && Forced(v.ForceSendFields, "Egg") { - ch := n.Child("egg") - c.fn(&ch, "") - } - if s := string(v.Egg); c.match(s) { - ch := n.Child("egg") - if r, ok := c.fn(&ch, s); ok { - v.Egg = (r) - } - } - if c.mode == EmptyFields && v.Jar == "" && Forced(v.ForceSendFields, "Jar") { - ch := n.Child("jar") - c.fn(&ch, "") - } - if s := string(v.Jar); c.match(s) { - ch := n.Child("jar") - if r, ok := c.fn(&ch, s); ok { - v.Jar = (r) - } - } - if !n.IsRef("maven") { - if x := v.Maven; x != nil { - ch := n.Child("maven") - stringsComputeMavenLibrary(c, &ch, x) - } - } - if !n.IsRef("pypi") { - if x := v.Pypi; x != nil { - ch := n.Child("pypi") - stringsComputePythonPyPiLibrary(c, &ch, x) - } - } - if c.mode == EmptyFields && v.Requirements == "" && Forced(v.ForceSendFields, "Requirements") { - ch := n.Child("requirements") - c.fn(&ch, "") - } - if s := string(v.Requirements); c.match(s) { - ch := n.Child("requirements") - if r, ok := c.fn(&ch, s); ok { - v.Requirements = (r) - } - } - if c.mode == EmptyFields && v.Whl == "" && Forced(v.ForceSendFields, "Whl") { - ch := n.Child("whl") - c.fn(&ch, "") - } - if s := string(v.Whl); c.match(s) { - ch := n.Child("whl") - if r, ok := c.fn(&ch, s); ok { - v.Whl = (r) - } - } -} - -func stringsResourcesClusterPermission(c *stringsWalk, n *Node, v *resources.ClusterPermission) { - if n.isRef() { - return - } - if s := string(v.Level); c.match(s) { - ch := n.Child("level") - if r, ok := c.fn(&ch, s); ok { - v.Level = compute.ClusterPermissionLevel(r) - } - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } -} - -func stringsComputeAwsAttributes(c *stringsWalk, n *Node, v *compute.AwsAttributes) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Availability == "" && Forced(v.ForceSendFields, "Availability") { - ch := n.Child("availability") - c.fn(&ch, "") - } - if s := string(v.Availability); c.match(s) { - ch := n.Child("availability") - if r, ok := c.fn(&ch, s); ok { - v.Availability = compute.AwsAvailability(r) - } - } - if c.mode == EmptyFields && v.EbsVolumeType == "" && Forced(v.ForceSendFields, "EbsVolumeType") { - ch := n.Child("ebs_volume_type") - c.fn(&ch, "") - } - if s := string(v.EbsVolumeType); c.match(s) { - ch := n.Child("ebs_volume_type") - if r, ok := c.fn(&ch, s); ok { - v.EbsVolumeType = compute.EbsVolumeType(r) - } - } - if c.mode == EmptyFields && v.InstanceProfileArn == "" && Forced(v.ForceSendFields, "InstanceProfileArn") { - ch := n.Child("instance_profile_arn") - c.fn(&ch, "") - } - if s := string(v.InstanceProfileArn); c.match(s) { - ch := n.Child("instance_profile_arn") - if r, ok := c.fn(&ch, s); ok { - v.InstanceProfileArn = (r) - } - } - if c.mode == EmptyFields && v.ZoneId == "" && Forced(v.ForceSendFields, "ZoneId") { - ch := n.Child("zone_id") - c.fn(&ch, "") - } - if s := string(v.ZoneId); c.match(s) { - ch := n.Child("zone_id") - if r, ok := c.fn(&ch, s); ok { - v.ZoneId = (r) - } - } -} - -func stringsComputeAzureAttributes(c *stringsWalk, n *Node, v *compute.AzureAttributes) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Availability == "" && Forced(v.ForceSendFields, "Availability") { - ch := n.Child("availability") - c.fn(&ch, "") - } - if s := string(v.Availability); c.match(s) { - ch := n.Child("availability") - if r, ok := c.fn(&ch, s); ok { - v.Availability = compute.AzureAvailability(r) - } - } - if c.mode == EmptyFields && v.CapacityReservationGroup == "" && Forced(v.ForceSendFields, "CapacityReservationGroup") { - ch := n.Child("capacity_reservation_group") - c.fn(&ch, "") - } - if s := string(v.CapacityReservationGroup); c.match(s) { - ch := n.Child("capacity_reservation_group") - if r, ok := c.fn(&ch, s); ok { - v.CapacityReservationGroup = (r) - } - } - if !n.IsRef("log_analytics_info") { - if x := v.LogAnalyticsInfo; x != nil { - ch := n.Child("log_analytics_info") - stringsComputeLogAnalyticsInfo(c, &ch, x) - } - } -} - -func stringsComputeClusterLogConf(c *stringsWalk, n *Node, v *compute.ClusterLogConf) { - if n.isRef() { - return - } - if !n.IsRef("dbfs") { - if x := v.Dbfs; x != nil { - ch := n.Child("dbfs") - stringsComputeDbfsStorageInfo(c, &ch, x) - } - } - if !n.IsRef("s3") { - if x := v.S3; x != nil { - ch := n.Child("s3") - stringsComputeS3StorageInfo(c, &ch, x) - } - } - if !n.IsRef("volumes") { - if x := v.Volumes; x != nil { - ch := n.Child("volumes") - stringsComputeVolumesStorageInfo(c, &ch, x) - } - } -} - -func stringsComputeDockerImage(c *stringsWalk, n *Node, v *compute.DockerImage) { - if n.isRef() { - return - } - if !n.IsRef("basic_auth") { - if x := v.BasicAuth; x != nil { - ch := n.Child("basic_auth") - stringsComputeDockerBasicAuth(c, &ch, x) - } - } - if c.mode == EmptyFields && v.Url == "" && Forced(v.ForceSendFields, "Url") { - ch := n.Child("url") - c.fn(&ch, "") - } - if s := string(v.Url); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.Url = (r) - } - } -} - -func stringsComputeNodeTypeFlexibility(c *stringsWalk, n *Node, v *compute.NodeTypeFlexibility) { - if n.isRef() { - return - } - if !n.IsRef("alternate_node_type_ids") { - if len(v.AlternateNodeTypeIds) > 0 { - cn := n.Child("alternate_node_type_ids") - for i := range v.AlternateNodeTypeIds { - if s := string(v.AlternateNodeTypeIds[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.AlternateNodeTypeIds[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.AwsContextId == "" && Forced(v.ForceSendFields, "AwsContextId") { - ch := n.Child("aws_context_id") - c.fn(&ch, "") - } - if s := string(v.AwsContextId); c.match(s) { - ch := n.Child("aws_context_id") - if r, ok := c.fn(&ch, s); ok { - v.AwsContextId = (r) - } - } -} - -func stringsComputeGcpAttributes(c *stringsWalk, n *Node, v *compute.GcpAttributes) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Availability == "" && Forced(v.ForceSendFields, "Availability") { - ch := n.Child("availability") - c.fn(&ch, "") - } - if s := string(v.Availability); c.match(s) { - ch := n.Child("availability") - if r, ok := c.fn(&ch, s); ok { - v.Availability = compute.GcpAvailability(r) - } - } - if c.mode == EmptyFields && v.ConfidentialComputeType == "" && Forced(v.ForceSendFields, "ConfidentialComputeType") { - ch := n.Child("confidential_compute_type") - c.fn(&ch, "") - } - if s := string(v.ConfidentialComputeType); c.match(s) { - ch := n.Child("confidential_compute_type") - if r, ok := c.fn(&ch, s); ok { - v.ConfidentialComputeType = compute.ConfidentialComputeType(r) - } - } - if c.mode == EmptyFields && v.GoogleServiceAccount == "" && Forced(v.ForceSendFields, "GoogleServiceAccount") { - ch := n.Child("google_service_account") - c.fn(&ch, "") - } - if s := string(v.GoogleServiceAccount); c.match(s) { - ch := n.Child("google_service_account") - if r, ok := c.fn(&ch, s); ok { - v.GoogleServiceAccount = (r) - } - } - if c.mode == EmptyFields && v.ZoneId == "" && Forced(v.ForceSendFields, "ZoneId") { - ch := n.Child("zone_id") - c.fn(&ch, "") - } - if s := string(v.ZoneId); c.match(s) { - ch := n.Child("zone_id") - if r, ok := c.fn(&ch, s); ok { - v.ZoneId = (r) - } - } -} - -func stringsComputeInitScriptInfo(c *stringsWalk, n *Node, v *compute.InitScriptInfo) { - if n.isRef() { - return - } - if !n.IsRef("abfss") { - if x := v.Abfss; x != nil { - ch := n.Child("abfss") - stringsComputeAdlsgen2Info(c, &ch, x) - } - } - if !n.IsRef("dbfs") { - if x := v.Dbfs; x != nil { - ch := n.Child("dbfs") - stringsComputeDbfsStorageInfo(c, &ch, x) - } - } - if !n.IsRef("file") { - if x := v.File; x != nil { - ch := n.Child("file") - stringsComputeLocalFileInfo(c, &ch, x) - } - } - if !n.IsRef("gcs") { - if x := v.Gcs; x != nil { - ch := n.Child("gcs") - stringsComputeGcsStorageInfo(c, &ch, x) - } - } - if !n.IsRef("s3") { - if x := v.S3; x != nil { - ch := n.Child("s3") - stringsComputeS3StorageInfo(c, &ch, x) - } - } - if !n.IsRef("volumes") { - if x := v.Volumes; x != nil { - ch := n.Child("volumes") - stringsComputeVolumesStorageInfo(c, &ch, x) - } - } - if !n.IsRef("workspace") { - if x := v.Workspace; x != nil { - ch := n.Child("workspace") - stringsComputeWorkspaceStorageInfo(c, &ch, x) - } - } -} - -func stringsResourcesAppConfig(c *stringsWalk, n *Node, v *resources.AppConfig) { - if n.isRef() { - return - } - if !n.IsRef("command") { - if len(v.Command) > 0 { - cn := n.Child("command") - for i := range v.Command { - if s := string(v.Command[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Command[i] = (r) - } - } - } - } - } - if !n.IsRef("env") { - if len(v.Env) > 0 { - cn := n.Child("env") - for i := range v.Env { - { - ch := cn.Elem(i) - stringsResourcesAppEnvVar(c, &ch, &v.Env[i]) - } - } - } - } -} - -func stringsResourcesAppPermission(c *stringsWalk, n *Node, v *resources.AppPermission) { - if n.isRef() { - return - } - if s := string(v.Level); c.match(s) { - ch := n.Child("level") - if r, ok := c.fn(&ch, s); ok { - v.Level = apps.AppPermissionLevel(r) - } - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } -} - -func stringsAppsAppDeployment(c *stringsWalk, n *Node, v *apps.AppDeployment) { - if n.isRef() { - return - } - if !n.IsRef("command") { - if len(v.Command) > 0 { - cn := n.Child("command") - for i := range v.Command { - if s := string(v.Command[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Command[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.CreateTime == "" && Forced(v.ForceSendFields, "CreateTime") { - ch := n.Child("create_time") - c.fn(&ch, "") - } - if s := string(v.CreateTime); c.match(s) { - ch := n.Child("create_time") - if r, ok := c.fn(&ch, s); ok { - v.CreateTime = (r) - } - } - if c.mode == EmptyFields && v.Creator == "" && Forced(v.ForceSendFields, "Creator") { - ch := n.Child("creator") - c.fn(&ch, "") - } - if s := string(v.Creator); c.match(s) { - ch := n.Child("creator") - if r, ok := c.fn(&ch, s); ok { - v.Creator = (r) - } - } - if !n.IsRef("deployment_artifacts") { - if x := v.DeploymentArtifacts; x != nil { - ch := n.Child("deployment_artifacts") - stringsAppsAppDeploymentArtifacts(c, &ch, x) - } - } - if c.mode == EmptyFields && v.DeploymentId == "" && Forced(v.ForceSendFields, "DeploymentId") { - ch := n.Child("deployment_id") - c.fn(&ch, "") - } - if s := string(v.DeploymentId); c.match(s) { - ch := n.Child("deployment_id") - if r, ok := c.fn(&ch, s); ok { - v.DeploymentId = (r) - } - } - if !n.IsRef("env_vars") { - if len(v.EnvVars) > 0 { - cn := n.Child("env_vars") - for i := range v.EnvVars { - { - ch := cn.Elem(i) - stringsAppsEnvVar(c, &ch, &v.EnvVars[i]) - } - } - } - } - if !n.IsRef("git_source") { - if x := v.GitSource; x != nil { - ch := n.Child("git_source") - stringsAppsGitSource(c, &ch, x) - } - } - if !n.IsRef("health_check") { - if x := v.HealthCheck; x != nil { - ch := n.Child("health_check") - stringsAppsAppHealthCheck(c, &ch, x) - } - } - if c.mode == EmptyFields && v.Mode == "" && Forced(v.ForceSendFields, "Mode") { - ch := n.Child("mode") - c.fn(&ch, "") - } - if s := string(v.Mode); c.match(s) { - ch := n.Child("mode") - if r, ok := c.fn(&ch, s); ok { - v.Mode = apps.AppDeploymentMode(r) - } - } - if c.mode == EmptyFields && v.SourceCodePath == "" && Forced(v.ForceSendFields, "SourceCodePath") { - ch := n.Child("source_code_path") - c.fn(&ch, "") - } - if s := string(v.SourceCodePath); c.match(s) { - ch := n.Child("source_code_path") - if r, ok := c.fn(&ch, s); ok { - v.SourceCodePath = (r) - } - } - if !n.IsRef("status") { - if x := v.Status; x != nil { - ch := n.Child("status") - stringsAppsAppDeploymentStatus(c, &ch, x) - } - } - if c.mode == EmptyFields && v.UpdateTime == "" && Forced(v.ForceSendFields, "UpdateTime") { - ch := n.Child("update_time") - c.fn(&ch, "") - } - if s := string(v.UpdateTime); c.match(s) { - ch := n.Child("update_time") - if r, ok := c.fn(&ch, s); ok { - v.UpdateTime = (r) - } - } -} - -func stringsAppsApplicationStatus(c *stringsWalk, n *Node, v *apps.ApplicationStatus) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Message == "" && Forced(v.ForceSendFields, "Message") { - ch := n.Child("message") - c.fn(&ch, "") - } - if s := string(v.Message); c.match(s) { - ch := n.Child("message") - if r, ok := c.fn(&ch, s); ok { - v.Message = (r) - } - } - if c.mode == EmptyFields && v.State == "" && Forced(v.ForceSendFields, "State") { - ch := n.Child("state") - c.fn(&ch, "") - } - if s := string(v.State); c.match(s) { - ch := n.Child("state") - if r, ok := c.fn(&ch, s); ok { - v.State = apps.ApplicationState(r) - } - } -} - -func stringsAppsComputeStatus(c *stringsWalk, n *Node, v *apps.ComputeStatus) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Message == "" && Forced(v.ForceSendFields, "Message") { - ch := n.Child("message") - c.fn(&ch, "") - } - if s := string(v.Message); c.match(s) { - ch := n.Child("message") - if r, ok := c.fn(&ch, s); ok { - v.Message = (r) - } - } - if c.mode == EmptyFields && v.State == "" && Forced(v.ForceSendFields, "State") { - ch := n.Child("state") - c.fn(&ch, "") - } - if s := string(v.State); c.match(s) { - ch := n.Child("state") - if r, ok := c.fn(&ch, s); ok { - v.State = apps.ComputeState(r) - } - } -} - -func stringsAppsGitSource(c *stringsWalk, n *Node, v *apps.GitSource) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Branch == "" && Forced(v.ForceSendFields, "Branch") { - ch := n.Child("branch") - c.fn(&ch, "") - } - if s := string(v.Branch); c.match(s) { - ch := n.Child("branch") - if r, ok := c.fn(&ch, s); ok { - v.Branch = (r) - } - } - if c.mode == EmptyFields && v.Commit == "" && Forced(v.ForceSendFields, "Commit") { - ch := n.Child("commit") - c.fn(&ch, "") - } - if s := string(v.Commit); c.match(s) { - ch := n.Child("commit") - if r, ok := c.fn(&ch, s); ok { - v.Commit = (r) - } - } - if !n.IsRef("git_repository") { - if x := v.GitRepository; x != nil { - ch := n.Child("git_repository") - stringsAppsGitRepository(c, &ch, x) - } - } - if c.mode == EmptyFields && v.ResolvedCommit == "" && Forced(v.ForceSendFields, "ResolvedCommit") { - ch := n.Child("resolved_commit") - c.fn(&ch, "") - } - if s := string(v.ResolvedCommit); c.match(s) { - ch := n.Child("resolved_commit") - if r, ok := c.fn(&ch, s); ok { - v.ResolvedCommit = (r) - } - } - if c.mode == EmptyFields && v.SourceCodePath == "" && Forced(v.ForceSendFields, "SourceCodePath") { - ch := n.Child("source_code_path") - c.fn(&ch, "") - } - if s := string(v.SourceCodePath); c.match(s) { - ch := n.Child("source_code_path") - if r, ok := c.fn(&ch, s); ok { - v.SourceCodePath = (r) - } - } - if c.mode == EmptyFields && v.Tag == "" && Forced(v.ForceSendFields, "Tag") { - ch := n.Child("tag") - c.fn(&ch, "") - } - if s := string(v.Tag); c.match(s) { - ch := n.Child("tag") - if r, ok := c.fn(&ch, s); ok { - v.Tag = (r) - } - } -} - -func stringsAppsGitRepository(c *stringsWalk, n *Node, v *apps.GitRepository) { - if n.isRef() { - return - } - if s := string(v.Provider); c.match(s) { - ch := n.Child("provider") - if r, ok := c.fn(&ch, s); ok { - v.Provider = (r) - } - } - if s := string(v.Url); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.Url = (r) - } - } -} - -func stringsAppsAppResource(c *stringsWalk, n *Node, v *apps.AppResource) { - if n.isRef() { - return - } - if !n.IsRef("app") { - if x := v.App; x != nil { - ch := n.Child("app") - stringsAppsAppResourceApp(c, &ch, x) - } - } - if !n.IsRef("database") { - if x := v.Database; x != nil { - ch := n.Child("database") - stringsAppsAppResourceDatabase(c, &ch, x) - } - } - if c.mode == EmptyFields && v.Description == "" && Forced(v.ForceSendFields, "Description") { - ch := n.Child("description") - c.fn(&ch, "") - } - if s := string(v.Description); c.match(s) { - ch := n.Child("description") - if r, ok := c.fn(&ch, s); ok { - v.Description = (r) - } - } - if !n.IsRef("experiment") { - if x := v.Experiment; x != nil { - ch := n.Child("experiment") - stringsAppsAppResourceExperiment(c, &ch, x) - } - } - if !n.IsRef("genie_space") { - if x := v.GenieSpace; x != nil { - ch := n.Child("genie_space") - stringsAppsAppResourceGenieSpace(c, &ch, x) - } - } - if !n.IsRef("job") { - if x := v.Job; x != nil { - ch := n.Child("job") - stringsAppsAppResourceJob(c, &ch, x) - } - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if !n.IsRef("postgres") { - if x := v.Postgres; x != nil { - ch := n.Child("postgres") - stringsAppsAppResourcePostgres(c, &ch, x) - } - } - if !n.IsRef("secret") { - if x := v.Secret; x != nil { - ch := n.Child("secret") - stringsAppsAppResourceSecret(c, &ch, x) - } - } - if !n.IsRef("serving_endpoint") { - if x := v.ServingEndpoint; x != nil { - ch := n.Child("serving_endpoint") - stringsAppsAppResourceServingEndpoint(c, &ch, x) - } - } - if !n.IsRef("sql_warehouse") { - if x := v.SqlWarehouse; x != nil { - ch := n.Child("sql_warehouse") - stringsAppsAppResourceSqlWarehouse(c, &ch, x) - } - } - if !n.IsRef("uc_securable") { - if x := v.UcSecurable; x != nil { - ch := n.Child("uc_securable") - stringsAppsAppResourceUcSecurable(c, &ch, x) - } - } -} - -func stringsAppsTelemetryExportDestination(c *stringsWalk, n *Node, v *apps.TelemetryExportDestination) { - if n.isRef() { - return - } - if !n.IsRef("unity_catalog") { - if x := v.UnityCatalog; x != nil { - ch := n.Child("unity_catalog") - stringsAppsUnityCatalog(c, &ch, x) - } - } -} - -func stringsResourcesSecretScopePermission(c *stringsWalk, n *Node, v *resources.SecretScopePermission) { - if n.isRef() { - return - } - if s := string(v.Level); c.match(s) { - ch := n.Child("level") - if r, ok := c.fn(&ch, s); ok { - v.Level = resources.SecretScopePermissionLevel(r) - } - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } -} - -func stringsWorkspaceAzureKeyVaultSecretScopeMetadata(c *stringsWalk, n *Node, v *workspace.AzureKeyVaultSecretScopeMetadata) { - if n.isRef() { - return - } - if s := string(v.DnsName); c.match(s) { - ch := n.Child("dns_name") - if r, ok := c.fn(&ch, s); ok { - v.DnsName = (r) - } - } - if s := string(v.ResourceId); c.match(s) { - ch := n.Child("resource_id") - if r, ok := c.fn(&ch, s); ok { - v.ResourceId = (r) - } - } -} - -func stringsSqlAlertV2RunAs(c *stringsWalk, n *Node, v *sql.AlertV2RunAs) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ServicePrincipalName == "" && Forced(v.ForceSendFields, "ServicePrincipalName") { - ch := n.Child("service_principal_name") - c.fn(&ch, "") - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if c.mode == EmptyFields && v.UserName == "" && Forced(v.ForceSendFields, "UserName") { - ch := n.Child("user_name") - c.fn(&ch, "") - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } -} - -func stringsSqlAlertV2Evaluation(c *stringsWalk, n *Node, v *sql.AlertV2Evaluation) { - if n.isRef() { - return - } - if s := string(v.ComparisonOperator); c.match(s) { - ch := n.Child("comparison_operator") - if r, ok := c.fn(&ch, s); ok { - v.ComparisonOperator = sql.ComparisonOperator(r) - } - } - if c.mode == EmptyFields && v.EmptyResultState == "" && Forced(v.ForceSendFields, "EmptyResultState") { - ch := n.Child("empty_result_state") - c.fn(&ch, "") - } - if s := string(v.EmptyResultState); c.match(s) { - ch := n.Child("empty_result_state") - if r, ok := c.fn(&ch, s); ok { - v.EmptyResultState = sql.AlertEvaluationState(r) - } - } - if c.mode == EmptyFields && v.LastEvaluatedAt == "" && Forced(v.ForceSendFields, "LastEvaluatedAt") { - ch := n.Child("last_evaluated_at") - c.fn(&ch, "") - } - if s := string(v.LastEvaluatedAt); c.match(s) { - ch := n.Child("last_evaluated_at") - if r, ok := c.fn(&ch, s); ok { - v.LastEvaluatedAt = (r) - } - } - if !n.IsRef("notification") { - if x := v.Notification; x != nil { - ch := n.Child("notification") - stringsSqlAlertV2Notification(c, &ch, x) - } - } - if !n.IsRef("source") { - { - ch := n.Child("source") - stringsSqlAlertV2OperandColumn(c, &ch, &v.Source) - } - } - if c.mode == EmptyFields && v.State == "" && Forced(v.ForceSendFields, "State") { - ch := n.Child("state") - c.fn(&ch, "") - } - if s := string(v.State); c.match(s) { - ch := n.Child("state") - if r, ok := c.fn(&ch, s); ok { - v.State = sql.AlertEvaluationState(r) - } - } - if !n.IsRef("threshold") { - if x := v.Threshold; x != nil { - ch := n.Child("threshold") - stringsSqlAlertV2Operand(c, &ch, x) - } - } -} - -func stringsSqlAlertStatementParameter(c *stringsWalk, n *Node, v *sql.AlertStatementParameter) { - if n.isRef() { - return - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if c.mode == EmptyFields && v.Type == "" && Forced(v.ForceSendFields, "Type") { - ch := n.Child("type") - c.fn(&ch, "") - } - if s := string(v.Type); c.match(s) { - ch := n.Child("type") - if r, ok := c.fn(&ch, s); ok { - v.Type = (r) - } - } - if c.mode == EmptyFields && v.Value == "" && Forced(v.ForceSendFields, "Value") { - ch := n.Child("value") - c.fn(&ch, "") - } - if s := string(v.Value); c.match(s) { - ch := n.Child("value") - if r, ok := c.fn(&ch, s); ok { - v.Value = (r) - } - } -} - -func stringsSqlCronSchedule(c *stringsWalk, n *Node, v *sql.CronSchedule) { - if n.isRef() { - return - } - if s := string(v.PauseStatus); c.match(s) { - ch := n.Child("pause_status") - if r, ok := c.fn(&ch, s); ok { - v.PauseStatus = sql.SchedulePauseStatus(r) - } - } - if s := string(v.QuartzCronSchedule); c.match(s) { - ch := n.Child("quartz_cron_schedule") - if r, ok := c.fn(&ch, s); ok { - v.QuartzCronSchedule = (r) - } - } - if s := string(v.TimezoneId); c.match(s) { - ch := n.Child("timezone_id") - if r, ok := c.fn(&ch, s); ok { - v.TimezoneId = (r) - } - } -} - -func stringsResourcesSqlWarehousePermission(c *stringsWalk, n *Node, v *resources.SqlWarehousePermission) { - if n.isRef() { - return - } - if s := string(v.Level); c.match(s) { - ch := n.Child("level") - if r, ok := c.fn(&ch, s); ok { - v.Level = sql.WarehousePermissionLevel(r) - } - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } -} - -func stringsSqlChannel(c *stringsWalk, n *Node, v *sql.Channel) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DbsqlVersion == "" && Forced(v.ForceSendFields, "DbsqlVersion") { - ch := n.Child("dbsql_version") - c.fn(&ch, "") - } - if s := string(v.DbsqlVersion); c.match(s) { - ch := n.Child("dbsql_version") - if r, ok := c.fn(&ch, s); ok { - v.DbsqlVersion = (r) - } - } - if c.mode == EmptyFields && v.Name == "" && Forced(v.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = sql.ChannelName(r) - } - } -} - -func stringsSqlEndpointTags(c *stringsWalk, n *Node, v *sql.EndpointTags) { - if n.isRef() { - return - } - if !n.IsRef("custom_tags") { - if len(v.CustomTags) > 0 { - cn := n.Child("custom_tags") - for i := range v.CustomTags { - { - ch := cn.Elem(i) - stringsSqlEndpointTagPair(c, &ch, &v.CustomTags[i]) - } - } - } - } -} - -func stringsDatabaseDatabaseInstanceRef(c *stringsWalk, n *Node, v *database.DatabaseInstanceRef) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.BranchTime == "" && Forced(v.ForceSendFields, "BranchTime") { - ch := n.Child("branch_time") - c.fn(&ch, "") - } - if s := string(v.BranchTime); c.match(s) { - ch := n.Child("branch_time") - if r, ok := c.fn(&ch, s); ok { - v.BranchTime = (r) - } - } - if c.mode == EmptyFields && v.EffectiveLsn == "" && Forced(v.ForceSendFields, "EffectiveLsn") { - ch := n.Child("effective_lsn") - c.fn(&ch, "") - } - if s := string(v.EffectiveLsn); c.match(s) { - ch := n.Child("effective_lsn") - if r, ok := c.fn(&ch, s); ok { - v.EffectiveLsn = (r) - } - } - if c.mode == EmptyFields && v.Lsn == "" && Forced(v.ForceSendFields, "Lsn") { - ch := n.Child("lsn") - c.fn(&ch, "") - } - if s := string(v.Lsn); c.match(s) { - ch := n.Child("lsn") - if r, ok := c.fn(&ch, s); ok { - v.Lsn = (r) - } - } - if c.mode == EmptyFields && v.Name == "" && Forced(v.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if c.mode == EmptyFields && v.Uid == "" && Forced(v.ForceSendFields, "Uid") { - ch := n.Child("uid") - c.fn(&ch, "") - } - if s := string(v.Uid); c.match(s) { - ch := n.Child("uid") - if r, ok := c.fn(&ch, s); ok { - v.Uid = (r) - } - } -} - -func stringsDatabaseCustomTag(c *stringsWalk, n *Node, v *database.CustomTag) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Key == "" && Forced(v.ForceSendFields, "Key") { - ch := n.Child("key") - c.fn(&ch, "") - } - if s := string(v.Key); c.match(s) { - ch := n.Child("key") - if r, ok := c.fn(&ch, s); ok { - v.Key = (r) - } - } - if c.mode == EmptyFields && v.Value == "" && Forced(v.ForceSendFields, "Value") { - ch := n.Child("value") - c.fn(&ch, "") - } - if s := string(v.Value); c.match(s) { - ch := n.Child("value") - if r, ok := c.fn(&ch, s); ok { - v.Value = (r) - } - } -} - -func stringsDatabaseSyncedTableStatus(c *stringsWalk, n *Node, v *database.SyncedTableStatus) { - if n.isRef() { - return - } - if !n.IsRef("continuous_update_status") { - if x := v.ContinuousUpdateStatus; x != nil { - ch := n.Child("continuous_update_status") - stringsDatabaseSyncedTableContinuousUpdateStatus(c, &ch, x) - } - } - if c.mode == EmptyFields && v.DetailedState == "" && Forced(v.ForceSendFields, "DetailedState") { - ch := n.Child("detailed_state") - c.fn(&ch, "") - } - if s := string(v.DetailedState); c.match(s) { - ch := n.Child("detailed_state") - if r, ok := c.fn(&ch, s); ok { - v.DetailedState = database.SyncedTableState(r) - } - } - if !n.IsRef("failed_status") { - if x := v.FailedStatus; x != nil { - ch := n.Child("failed_status") - stringsDatabaseSyncedTableFailedStatus(c, &ch, x) - } - } - if !n.IsRef("last_sync") { - if x := v.LastSync; x != nil { - ch := n.Child("last_sync") - stringsDatabaseSyncedTablePosition(c, &ch, x) - } - } - if c.mode == EmptyFields && v.Message == "" && Forced(v.ForceSendFields, "Message") { - ch := n.Child("message") - c.fn(&ch, "") - } - if s := string(v.Message); c.match(s) { - ch := n.Child("message") - if r, ok := c.fn(&ch, s); ok { - v.Message = (r) - } - } - if c.mode == EmptyFields && v.PipelineId == "" && Forced(v.ForceSendFields, "PipelineId") { - ch := n.Child("pipeline_id") - c.fn(&ch, "") - } - if s := string(v.PipelineId); c.match(s) { - ch := n.Child("pipeline_id") - if r, ok := c.fn(&ch, s); ok { - v.PipelineId = (r) - } - } - if !n.IsRef("provisioning_status") { - if x := v.ProvisioningStatus; x != nil { - ch := n.Child("provisioning_status") - stringsDatabaseSyncedTableProvisioningStatus(c, &ch, x) - } - } - if !n.IsRef("triggered_update_status") { - if x := v.TriggeredUpdateStatus; x != nil { - ch := n.Child("triggered_update_status") - stringsDatabaseSyncedTableTriggeredUpdateStatus(c, &ch, x) - } - } -} - -func stringsDatabaseSyncedTableSpec(c *stringsWalk, n *Node, v *database.SyncedTableSpec) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ExistingPipelineId == "" && Forced(v.ForceSendFields, "ExistingPipelineId") { - ch := n.Child("existing_pipeline_id") - c.fn(&ch, "") - } - if s := string(v.ExistingPipelineId); c.match(s) { - ch := n.Child("existing_pipeline_id") - if r, ok := c.fn(&ch, s); ok { - v.ExistingPipelineId = (r) - } - } - if !n.IsRef("new_pipeline_spec") { - if x := v.NewPipelineSpec; x != nil { - ch := n.Child("new_pipeline_spec") - stringsDatabaseNewPipelineSpec(c, &ch, x) - } - } - if !n.IsRef("primary_key_columns") { - if len(v.PrimaryKeyColumns) > 0 { - cn := n.Child("primary_key_columns") - for i := range v.PrimaryKeyColumns { - if s := string(v.PrimaryKeyColumns[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.PrimaryKeyColumns[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.SchedulingPolicy == "" && Forced(v.ForceSendFields, "SchedulingPolicy") { - ch := n.Child("scheduling_policy") - c.fn(&ch, "") - } - if s := string(v.SchedulingPolicy); c.match(s) { - ch := n.Child("scheduling_policy") - if r, ok := c.fn(&ch, s); ok { - v.SchedulingPolicy = database.SyncedTableSchedulingPolicy(r) - } - } - if c.mode == EmptyFields && v.SourceTableFullName == "" && Forced(v.ForceSendFields, "SourceTableFullName") { - ch := n.Child("source_table_full_name") - c.fn(&ch, "") - } - if s := string(v.SourceTableFullName); c.match(s) { - ch := n.Child("source_table_full_name") - if r, ok := c.fn(&ch, s); ok { - v.SourceTableFullName = (r) - } - } - if c.mode == EmptyFields && v.TimeseriesKey == "" && Forced(v.ForceSendFields, "TimeseriesKey") { - ch := n.Child("timeseries_key") - c.fn(&ch, "") - } - if s := string(v.TimeseriesKey); c.match(s) { - ch := n.Child("timeseries_key") - if r, ok := c.fn(&ch, s); ok { - v.TimeseriesKey = (r) - } - } - if !n.IsRef("type_overrides") { - if len(v.TypeOverrides) > 0 { - cn := n.Child("type_overrides") - for i := range v.TypeOverrides { - { - ch := cn.Elem(i) - stringsDatabaseSyncedTableSpecTypeOverride(c, &ch, &v.TypeOverrides[i]) - } - } - } - } -} - -func stringsPostgresProjectCustomTag(c *stringsWalk, n *Node, v *postgres.ProjectCustomTag) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Key == "" && Forced(v.ForceSendFields, "Key") { - ch := n.Child("key") - c.fn(&ch, "") - } - if s := string(v.Key); c.match(s) { - ch := n.Child("key") - if r, ok := c.fn(&ch, s); ok { - v.Key = (r) - } - } - if c.mode == EmptyFields && v.Value == "" && Forced(v.ForceSendFields, "Value") { - ch := n.Child("value") - c.fn(&ch, "") - } - if s := string(v.Value); c.match(s) { - ch := n.Child("value") - if r, ok := c.fn(&ch, s); ok { - v.Value = (r) - } - } -} - -func stringsPostgresProjectDefaultEndpointSettings(c *stringsWalk, n *Node, v *postgres.ProjectDefaultEndpointSettings) { - if n.isRef() { - return - } - if !n.IsRef("pg_settings") { - if len(v.PgSettings) > 0 { - cn := n.Child("pg_settings") - for _, k := range sortedKeys(v.PgSettings) { - if s := string(v.PgSettings[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.PgSettings[k] = (r) - } - } - } - } - } -} - -func stringsPostgresEndpointSettings(c *stringsWalk, n *Node, v *postgres.EndpointSettings) { - if n.isRef() { - return - } - if !n.IsRef("pg_settings") { - if len(v.PgSettings) > 0 { - cn := n.Child("pg_settings") - for _, k := range sortedKeys(v.PgSettings) { - if s := string(v.PgSettings[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.PgSettings[k] = (r) - } - } - } - } - } -} - -func stringsPostgresSyncedTableSyncedTableSpecExtraColumn(c *stringsWalk, n *Node, v *postgres.SyncedTableSyncedTableSpecExtraColumn) { - if n.isRef() { - return - } - if s := string(v.ColumnName); c.match(s) { - ch := n.Child("column_name") - if r, ok := c.fn(&ch, s); ok { - v.ColumnName = (r) - } - } - if s := string(v.ColumnType); c.match(s) { - ch := n.Child("column_type") - if r, ok := c.fn(&ch, s); ok { - v.ColumnType = (r) - } - } - if c.mode == EmptyFields && v.Compute == "" && Forced(v.ForceSendFields, "Compute") { - ch := n.Child("compute") - c.fn(&ch, "") - } - if s := string(v.Compute); c.match(s) { - ch := n.Child("compute") - if r, ok := c.fn(&ch, s); ok { - v.Compute = (r) - } - } - if c.mode == EmptyFields && v.Maintenance == "" && Forced(v.ForceSendFields, "Maintenance") { - ch := n.Child("maintenance") - c.fn(&ch, "") - } - if s := string(v.Maintenance); c.match(s) { - ch := n.Child("maintenance") - if r, ok := c.fn(&ch, s); ok { - v.Maintenance = postgres.SyncedTableSyncedTableSpecExtraColumnMaintenance(r) - } - } -} - -func stringsPostgresNewPipelineSpec(c *stringsWalk, n *Node, v *postgres.NewPipelineSpec) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.BudgetPolicyId == "" && Forced(v.ForceSendFields, "BudgetPolicyId") { - ch := n.Child("budget_policy_id") - c.fn(&ch, "") - } - if s := string(v.BudgetPolicyId); c.match(s) { - ch := n.Child("budget_policy_id") - if r, ok := c.fn(&ch, s); ok { - v.BudgetPolicyId = (r) - } - } - if c.mode == EmptyFields && v.PipelineChannel == "" && Forced(v.ForceSendFields, "PipelineChannel") { - ch := n.Child("pipeline_channel") - c.fn(&ch, "") - } - if s := string(v.PipelineChannel); c.match(s) { - ch := n.Child("pipeline_channel") - if r, ok := c.fn(&ch, s); ok { - v.PipelineChannel = postgres.NewPipelineSpecPipelineChannel(r) - } - } - if c.mode == EmptyFields && v.StorageCatalog == "" && Forced(v.ForceSendFields, "StorageCatalog") { - ch := n.Child("storage_catalog") - c.fn(&ch, "") - } - if s := string(v.StorageCatalog); c.match(s) { - ch := n.Child("storage_catalog") - if r, ok := c.fn(&ch, s); ok { - v.StorageCatalog = (r) - } - } - if c.mode == EmptyFields && v.StorageSchema == "" && Forced(v.ForceSendFields, "StorageSchema") { - ch := n.Child("storage_schema") - c.fn(&ch, "") - } - if s := string(v.StorageSchema); c.match(s) { - ch := n.Child("storage_schema") - if r, ok := c.fn(&ch, s); ok { - v.StorageSchema = (r) - } - } -} - -func stringsPostgresSyncedTableSyncedTableSpecTypeOverride(c *stringsWalk, n *Node, v *postgres.SyncedTableSyncedTableSpecTypeOverride) { - if n.isRef() { - return - } - if s := string(v.ColumnName); c.match(s) { - ch := n.Child("column_name") - if r, ok := c.fn(&ch, s); ok { - v.ColumnName = (r) - } - } - if s := string(v.PgType); c.match(s) { - ch := n.Child("pg_type") - if r, ok := c.fn(&ch, s); ok { - v.PgType = postgres.SyncedTableSyncedTableSpecPgSpecificType(r) - } - } -} - -func stringsPostgresScheduleCadence(c *stringsWalk, n *Node, v *postgres.ScheduleCadence) { - if n.isRef() { - return - } - if !n.IsRef("weekly_schedule") { - if x := v.WeeklySchedule; x != nil { - ch := n.Child("weekly_schedule") - stringsPostgresWeeklySchedule(c, &ch, x) - } - } -} - -func stringsResourcesVectorSearchEndpointPermission(c *stringsWalk, n *Node, v *resources.VectorSearchEndpointPermission) { - if n.isRef() { - return - } - if s := string(v.Level); c.match(s) { - ch := n.Child("level") - if r, ok := c.fn(&ch, s); ok { - v.Level = vectorsearch.VectorSearchEndpointPermissionLevel(r) - } - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } -} - -func stringsVectorsearchDeltaSyncVectorIndexSpecRequest(c *stringsWalk, n *Node, v *vectorsearch.DeltaSyncVectorIndexSpecRequest) { - if n.isRef() { - return - } - if !n.IsRef("columns_to_index") { - if len(v.ColumnsToIndex) > 0 { - cn := n.Child("columns_to_index") - for i := range v.ColumnsToIndex { - if s := string(v.ColumnsToIndex[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.ColumnsToIndex[i] = (r) - } - } - } - } - } - if !n.IsRef("columns_to_sync") { - if len(v.ColumnsToSync) > 0 { - cn := n.Child("columns_to_sync") - for i := range v.ColumnsToSync { - if s := string(v.ColumnsToSync[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.ColumnsToSync[i] = (r) - } - } - } - } - } - if !n.IsRef("embedding_source_columns") { - if len(v.EmbeddingSourceColumns) > 0 { - cn := n.Child("embedding_source_columns") - for i := range v.EmbeddingSourceColumns { - { - ch := cn.Elem(i) - stringsVectorsearchEmbeddingSourceColumn(c, &ch, &v.EmbeddingSourceColumns[i]) - } - } - } - } - if !n.IsRef("embedding_vector_columns") { - if len(v.EmbeddingVectorColumns) > 0 { - cn := n.Child("embedding_vector_columns") - for i := range v.EmbeddingVectorColumns { - { - ch := cn.Elem(i) - stringsVectorsearchEmbeddingVectorColumn(c, &ch, &v.EmbeddingVectorColumns[i]) - } - } - } - } - if c.mode == EmptyFields && v.EmbeddingWritebackTable == "" && Forced(v.ForceSendFields, "EmbeddingWritebackTable") { - ch := n.Child("embedding_writeback_table") - c.fn(&ch, "") - } - if s := string(v.EmbeddingWritebackTable); c.match(s) { - ch := n.Child("embedding_writeback_table") - if r, ok := c.fn(&ch, s); ok { - v.EmbeddingWritebackTable = (r) - } - } - if c.mode == EmptyFields && v.PipelineType == "" && Forced(v.ForceSendFields, "PipelineType") { - ch := n.Child("pipeline_type") - c.fn(&ch, "") - } - if s := string(v.PipelineType); c.match(s) { - ch := n.Child("pipeline_type") - if r, ok := c.fn(&ch, s); ok { - v.PipelineType = vectorsearch.PipelineType(r) - } - } - if c.mode == EmptyFields && v.SourceTable == "" && Forced(v.ForceSendFields, "SourceTable") { - ch := n.Child("source_table") - c.fn(&ch, "") - } - if s := string(v.SourceTable); c.match(s) { - ch := n.Child("source_table") - if r, ok := c.fn(&ch, s); ok { - v.SourceTable = (r) - } - } -} - -func stringsVectorsearchDirectAccessVectorIndexSpec(c *stringsWalk, n *Node, v *vectorsearch.DirectAccessVectorIndexSpec) { - if n.isRef() { - return - } - if !n.IsRef("embedding_source_columns") { - if len(v.EmbeddingSourceColumns) > 0 { - cn := n.Child("embedding_source_columns") - for i := range v.EmbeddingSourceColumns { - { - ch := cn.Elem(i) - stringsVectorsearchEmbeddingSourceColumn(c, &ch, &v.EmbeddingSourceColumns[i]) - } - } - } - } - if !n.IsRef("embedding_vector_columns") { - if len(v.EmbeddingVectorColumns) > 0 { - cn := n.Child("embedding_vector_columns") - for i := range v.EmbeddingVectorColumns { - { - ch := cn.Elem(i) - stringsVectorsearchEmbeddingVectorColumn(c, &ch, &v.EmbeddingVectorColumns[i]) - } - } - } - } - if c.mode == EmptyFields && v.SchemaJson == "" && Forced(v.ForceSendFields, "SchemaJson") { - ch := n.Child("schema_json") - c.fn(&ch, "") - } - if s := string(v.SchemaJson); c.match(s) { - ch := n.Child("schema_json") - if r, ok := c.fn(&ch, s); ok { - v.SchemaJson = (r) - } - } -} - -func stringsResourcesInstancePoolPermission(c *stringsWalk, n *Node, v *resources.InstancePoolPermission) { - if n.isRef() { - return - } - if s := string(v.Level); c.match(s) { - ch := n.Child("level") - if r, ok := c.fn(&ch, s); ok { - v.Level = compute.InstancePoolPermissionLevel(r) - } - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } -} - -func stringsComputeInstancePoolAwsAttributes(c *stringsWalk, n *Node, v *compute.InstancePoolAwsAttributes) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Availability == "" && Forced(v.ForceSendFields, "Availability") { - ch := n.Child("availability") - c.fn(&ch, "") - } - if s := string(v.Availability); c.match(s) { - ch := n.Child("availability") - if r, ok := c.fn(&ch, s); ok { - v.Availability = compute.InstancePoolAwsAttributesAvailability(r) - } - } - if c.mode == EmptyFields && v.InstanceProfileArn == "" && Forced(v.ForceSendFields, "InstanceProfileArn") { - ch := n.Child("instance_profile_arn") - c.fn(&ch, "") - } - if s := string(v.InstanceProfileArn); c.match(s) { - ch := n.Child("instance_profile_arn") - if r, ok := c.fn(&ch, s); ok { - v.InstanceProfileArn = (r) - } - } - if c.mode == EmptyFields && v.ZoneId == "" && Forced(v.ForceSendFields, "ZoneId") { - ch := n.Child("zone_id") - c.fn(&ch, "") - } - if s := string(v.ZoneId); c.match(s) { - ch := n.Child("zone_id") - if r, ok := c.fn(&ch, s); ok { - v.ZoneId = (r) - } - } -} - -func stringsComputeInstancePoolAzureAttributes(c *stringsWalk, n *Node, v *compute.InstancePoolAzureAttributes) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Availability == "" && Forced(v.ForceSendFields, "Availability") { - ch := n.Child("availability") - c.fn(&ch, "") - } - if s := string(v.Availability); c.match(s) { - ch := n.Child("availability") - if r, ok := c.fn(&ch, s); ok { - v.Availability = compute.InstancePoolAzureAttributesAvailability(r) - } - } - if c.mode == EmptyFields && v.CapacityReservationGroup == "" && Forced(v.ForceSendFields, "CapacityReservationGroup") { - ch := n.Child("capacity_reservation_group") - c.fn(&ch, "") - } - if s := string(v.CapacityReservationGroup); c.match(s) { - ch := n.Child("capacity_reservation_group") - if r, ok := c.fn(&ch, s); ok { - v.CapacityReservationGroup = (r) - } - } -} - -func stringsComputeDiskSpec(c *stringsWalk, n *Node, v *compute.DiskSpec) { - if n.isRef() { - return - } - if !n.IsRef("disk_type") { - if x := v.DiskType; x != nil { - ch := n.Child("disk_type") - stringsComputeDiskType(c, &ch, x) - } - } -} - -func stringsComputeInstancePoolGcpAttributes(c *stringsWalk, n *Node, v *compute.InstancePoolGcpAttributes) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.GcpAvailability == "" && Forced(v.ForceSendFields, "GcpAvailability") { - ch := n.Child("gcp_availability") - c.fn(&ch, "") - } - if s := string(v.GcpAvailability); c.match(s) { - ch := n.Child("gcp_availability") - if r, ok := c.fn(&ch, s); ok { - v.GcpAvailability = compute.GcpAvailability(r) - } - } - if c.mode == EmptyFields && v.ZoneId == "" && Forced(v.ForceSendFields, "ZoneId") { - ch := n.Child("zone_id") - c.fn(&ch, "") - } - if s := string(v.ZoneId); c.match(s) { - ch := n.Child("zone_id") - if r, ok := c.fn(&ch, s); ok { - v.ZoneId = (r) - } - } -} - -func stringsResourcesClusterPolicyPermission(c *stringsWalk, n *Node, v *resources.ClusterPolicyPermission) { - if n.isRef() { - return - } - if s := string(v.Level); c.match(s) { - ch := n.Child("level") - if r, ok := c.fn(&ch, s); ok { - v.Level = compute.ClusterPolicyPermissionLevel(r) - } - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } -} - -func stringsSnapshotACLEntry(c *stringsWalk, n *Node, v *snapshot.ACLEntry) { - if n.isRef() { - return - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } - if s := string(v.PermissionLevel); c.match(s) { - ch := n.Child("permission_level") - if r, ok := c.fn(&ch, s); ok { - v.PermissionLevel = (r) - } - } -} - -func stringsSnapshotManagePrincipal(c *stringsWalk, n *Node, v *snapshot.ManagePrincipal) { - if n.isRef() { - return - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } - if s := string(v.GroupName); c.match(s) { - ch := n.Child("group_name") - if r, ok := c.fn(&ch, s); ok { - v.GroupName = (r) - } - } - if s := string(v.ServicePrincipalName); c.match(s) { - ch := n.Child("service_principal_name") - if r, ok := c.fn(&ch, s); ok { - v.ServicePrincipalName = (r) - } - } -} - -func stringsResourcesDependsOn(c *stringsWalk, n *Node, v *resources.DependsOn) { - if n.isRef() { - return - } - if s := string(v.Resource); c.match(s) { - ch := n.Child("resource") - if r, ok := c.fn(&ch, s); ok { - v.Resource = (r) - } - } -} - -func stringsJobsMaintenanceWindow(c *stringsWalk, n *Node, v *jobs.MaintenanceWindow) { - if n.isRef() { - return - } - if s := string(v.DayOfWeek); c.match(s) { - ch := n.Child("day_of_week") - if r, ok := c.fn(&ch, s); ok { - v.DayOfWeek = jobs.DayOfWeek(r) - } - } - if s := string(v.TimezoneId); c.match(s) { - ch := n.Child("timezone_id") - if r, ok := c.fn(&ch, s); ok { - v.TimezoneId = (r) - } - } -} - -func stringsJobsJobEnvironmentVariablesSpec(c *stringsWalk, n *Node, v *jobs.JobEnvironmentVariablesSpec) { - if n.isRef() { - return - } - if !n.IsRef("files") { - if len(v.Files) > 0 { - cn := n.Child("files") - for i := range v.Files { - if s := string(v.Files[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Files[i] = (r) - } - } - } - } - } - if !n.IsRef("variables") { - if len(v.Variables) > 0 { - cn := n.Child("variables") - for _, k := range sortedKeys(v.Variables) { - if s := string(v.Variables[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.Variables[k] = (r) - } - } - } - } - } -} - -func stringsComputeEnvironment(c *stringsWalk, n *Node, v *compute.Environment) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.BaseEnvironment == "" && Forced(v.ForceSendFields, "BaseEnvironment") { - ch := n.Child("base_environment") - c.fn(&ch, "") - } - if s := string(v.BaseEnvironment); c.match(s) { - ch := n.Child("base_environment") - if r, ok := c.fn(&ch, s); ok { - v.BaseEnvironment = (r) - } - } - if c.mode == EmptyFields && v.Client == "" && Forced(v.ForceSendFields, "Client") { - ch := n.Child("client") - c.fn(&ch, "") - } - if s := string(v.Client); c.match(s) { - ch := n.Child("client") - if r, ok := c.fn(&ch, s); ok { - v.Client = (r) - } - } - if !n.IsRef("dependencies") { - if len(v.Dependencies) > 0 { - cn := n.Child("dependencies") - for i := range v.Dependencies { - if s := string(v.Dependencies[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Dependencies[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.EnvironmentVersion == "" && Forced(v.ForceSendFields, "EnvironmentVersion") { - ch := n.Child("environment_version") - c.fn(&ch, "") - } - if s := string(v.EnvironmentVersion); c.match(s) { - ch := n.Child("environment_version") - if r, ok := c.fn(&ch, s); ok { - v.EnvironmentVersion = (r) - } - } - if !n.IsRef("java_dependencies") { - if len(v.JavaDependencies) > 0 { - cn := n.Child("java_dependencies") - for i := range v.JavaDependencies { - if s := string(v.JavaDependencies[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.JavaDependencies[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.ProjectEnvironment == "" && Forced(v.ForceSendFields, "ProjectEnvironment") { - ch := n.Child("project_environment") - c.fn(&ch, "") - } - if s := string(v.ProjectEnvironment); c.match(s) { - ch := n.Child("project_environment") - if r, ok := c.fn(&ch, s); ok { - v.ProjectEnvironment = (r) - } - } -} - -func stringsJobsGitSnapshot(c *stringsWalk, n *Node, v *jobs.GitSnapshot) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.UsedCommit == "" && Forced(v.ForceSendFields, "UsedCommit") { - ch := n.Child("used_commit") - c.fn(&ch, "") - } - if s := string(v.UsedCommit); c.match(s) { - ch := n.Child("used_commit") - if r, ok := c.fn(&ch, s); ok { - v.UsedCommit = (r) - } - } -} - -func stringsJobsJobSource(c *stringsWalk, n *Node, v *jobs.JobSource) { - if n.isRef() { - return - } - if s := string(v.DirtyState); c.match(s) { - ch := n.Child("dirty_state") - if r, ok := c.fn(&ch, s); ok { - v.DirtyState = jobs.JobSourceDirtyState(r) - } - } - if s := string(v.ImportFromGitBranch); c.match(s) { - ch := n.Child("import_from_git_branch") - if r, ok := c.fn(&ch, s); ok { - v.ImportFromGitBranch = (r) - } - } - if s := string(v.JobConfigPath); c.match(s) { - ch := n.Child("job_config_path") - if r, ok := c.fn(&ch, s); ok { - v.JobConfigPath = (r) - } - } -} - -func stringsJobsSparseCheckout(c *stringsWalk, n *Node, v *jobs.SparseCheckout) { - if n.isRef() { - return - } - if !n.IsRef("patterns") { - if len(v.Patterns) > 0 { - cn := n.Child("patterns") - for i := range v.Patterns { - if s := string(v.Patterns[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Patterns[i] = (r) - } - } - } - } - } -} - -func stringsJobsJobsHealthRule(c *stringsWalk, n *Node, v *jobs.JobsHealthRule) { - if n.isRef() { - return - } - if s := string(v.Metric); c.match(s) { - ch := n.Child("metric") - if r, ok := c.fn(&ch, s); ok { - v.Metric = jobs.JobsHealthMetric(r) - } - } - if s := string(v.Op); c.match(s) { - ch := n.Child("op") - if r, ok := c.fn(&ch, s); ok { - v.Op = jobs.JobsHealthOperator(r) - } - } -} - -func stringsComputeClusterSpec(c *stringsWalk, n *Node, v *compute.ClusterSpec) { - if n.isRef() { - return - } - if !n.IsRef("aws_attributes") { - if x := v.AwsAttributes; x != nil { - ch := n.Child("aws_attributes") - stringsComputeAwsAttributes(c, &ch, x) - } - } - if !n.IsRef("azure_attributes") { - if x := v.AzureAttributes; x != nil { - ch := n.Child("azure_attributes") - stringsComputeAzureAttributes(c, &ch, x) - } - } - if !n.IsRef("cluster_log_conf") { - if x := v.ClusterLogConf; x != nil { - ch := n.Child("cluster_log_conf") - stringsComputeClusterLogConf(c, &ch, x) - } - } - if c.mode == EmptyFields && v.ClusterName == "" && Forced(v.ForceSendFields, "ClusterName") { - ch := n.Child("cluster_name") - c.fn(&ch, "") - } - if s := string(v.ClusterName); c.match(s) { - ch := n.Child("cluster_name") - if r, ok := c.fn(&ch, s); ok { - v.ClusterName = (r) - } - } - if !n.IsRef("custom_tags") { - if len(v.CustomTags) > 0 { - cn := n.Child("custom_tags") - for _, k := range sortedKeys(v.CustomTags) { - if s := string(v.CustomTags[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.CustomTags[k] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.DataSecurityMode == "" && Forced(v.ForceSendFields, "DataSecurityMode") { - ch := n.Child("data_security_mode") - c.fn(&ch, "") - } - if s := string(v.DataSecurityMode); c.match(s) { - ch := n.Child("data_security_mode") - if r, ok := c.fn(&ch, s); ok { - v.DataSecurityMode = compute.DataSecurityMode(r) - } - } - if c.mode == EmptyFields && v.DependencyMode == "" && Forced(v.ForceSendFields, "DependencyMode") { - ch := n.Child("dependency_mode") - c.fn(&ch, "") - } - if s := string(v.DependencyMode); c.match(s) { - ch := n.Child("dependency_mode") - if r, ok := c.fn(&ch, s); ok { - v.DependencyMode = compute.DependencyMode(r) - } - } - if !n.IsRef("docker_image") { - if x := v.DockerImage; x != nil { - ch := n.Child("docker_image") - stringsComputeDockerImage(c, &ch, x) - } - } - if c.mode == EmptyFields && v.DriverInstancePoolId == "" && Forced(v.ForceSendFields, "DriverInstancePoolId") { - ch := n.Child("driver_instance_pool_id") - c.fn(&ch, "") - } - if s := string(v.DriverInstancePoolId); c.match(s) { - ch := n.Child("driver_instance_pool_id") - if r, ok := c.fn(&ch, s); ok { - v.DriverInstancePoolId = (r) - } - } - if !n.IsRef("driver_node_type_flexibility") { - if x := v.DriverNodeTypeFlexibility; x != nil { - ch := n.Child("driver_node_type_flexibility") - stringsComputeNodeTypeFlexibility(c, &ch, x) - } - } - if c.mode == EmptyFields && v.DriverNodeTypeId == "" && Forced(v.ForceSendFields, "DriverNodeTypeId") { - ch := n.Child("driver_node_type_id") - c.fn(&ch, "") - } - if s := string(v.DriverNodeTypeId); c.match(s) { - ch := n.Child("driver_node_type_id") - if r, ok := c.fn(&ch, s); ok { - v.DriverNodeTypeId = (r) - } - } - if !n.IsRef("gcp_attributes") { - if x := v.GcpAttributes; x != nil { - ch := n.Child("gcp_attributes") - stringsComputeGcpAttributes(c, &ch, x) - } - } - if !n.IsRef("init_scripts") { - if len(v.InitScripts) > 0 { - cn := n.Child("init_scripts") - for i := range v.InitScripts { - { - ch := cn.Elem(i) - stringsComputeInitScriptInfo(c, &ch, &v.InitScripts[i]) - } - } - } - } - if c.mode == EmptyFields && v.InstancePoolId == "" && Forced(v.ForceSendFields, "InstancePoolId") { - ch := n.Child("instance_pool_id") - c.fn(&ch, "") - } - if s := string(v.InstancePoolId); c.match(s) { - ch := n.Child("instance_pool_id") - if r, ok := c.fn(&ch, s); ok { - v.InstancePoolId = (r) - } - } - if c.mode == EmptyFields && v.Kind == "" && Forced(v.ForceSendFields, "Kind") { - ch := n.Child("kind") - c.fn(&ch, "") - } - if s := string(v.Kind); c.match(s) { - ch := n.Child("kind") - if r, ok := c.fn(&ch, s); ok { - v.Kind = compute.Kind(r) - } - } - if c.mode == EmptyFields && v.NodeTypeId == "" && Forced(v.ForceSendFields, "NodeTypeId") { - ch := n.Child("node_type_id") - c.fn(&ch, "") - } - if s := string(v.NodeTypeId); c.match(s) { - ch := n.Child("node_type_id") - if r, ok := c.fn(&ch, s); ok { - v.NodeTypeId = (r) - } - } - if c.mode == EmptyFields && v.PolicyId == "" && Forced(v.ForceSendFields, "PolicyId") { - ch := n.Child("policy_id") - c.fn(&ch, "") - } - if s := string(v.PolicyId); c.match(s) { - ch := n.Child("policy_id") - if r, ok := c.fn(&ch, s); ok { - v.PolicyId = (r) - } - } - if c.mode == EmptyFields && v.RuntimeEngine == "" && Forced(v.ForceSendFields, "RuntimeEngine") { - ch := n.Child("runtime_engine") - c.fn(&ch, "") - } - if s := string(v.RuntimeEngine); c.match(s) { - ch := n.Child("runtime_engine") - if r, ok := c.fn(&ch, s); ok { - v.RuntimeEngine = compute.RuntimeEngine(r) - } - } - if c.mode == EmptyFields && v.SingleUserName == "" && Forced(v.ForceSendFields, "SingleUserName") { - ch := n.Child("single_user_name") - c.fn(&ch, "") - } - if s := string(v.SingleUserName); c.match(s) { - ch := n.Child("single_user_name") - if r, ok := c.fn(&ch, s); ok { - v.SingleUserName = (r) - } - } - if !n.IsRef("spark_conf") { - if len(v.SparkConf) > 0 { - cn := n.Child("spark_conf") - for _, k := range sortedKeys(v.SparkConf) { - if s := string(v.SparkConf[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.SparkConf[k] = (r) - } - } - } - } - } - if !n.IsRef("spark_env_vars") { - if len(v.SparkEnvVars) > 0 { - cn := n.Child("spark_env_vars") - for _, k := range sortedKeys(v.SparkEnvVars) { - if s := string(v.SparkEnvVars[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.SparkEnvVars[k] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.SparkVersion == "" && Forced(v.ForceSendFields, "SparkVersion") { - ch := n.Child("spark_version") - c.fn(&ch, "") - } - if s := string(v.SparkVersion); c.match(s) { - ch := n.Child("spark_version") - if r, ok := c.fn(&ch, s); ok { - v.SparkVersion = (r) - } - } - if !n.IsRef("ssh_public_keys") { - if len(v.SshPublicKeys) > 0 { - cn := n.Child("ssh_public_keys") - for i := range v.SshPublicKeys { - if s := string(v.SshPublicKeys[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.SshPublicKeys[i] = (r) - } - } - } - } - } - if !n.IsRef("worker_node_type_flexibility") { - if x := v.WorkerNodeTypeFlexibility; x != nil { - ch := n.Child("worker_node_type_flexibility") - stringsComputeNodeTypeFlexibility(c, &ch, x) - } - } -} - -func stringsJobsSqlConditionConfiguration(c *stringsWalk, n *Node, v *jobs.SqlConditionConfiguration) { - if n.isRef() { - return - } - if s := string(v.SqlQueryId); c.match(s) { - ch := n.Child("sql_query_id") - if r, ok := c.fn(&ch, s); ok { - v.SqlQueryId = (r) - } - } - if s := string(v.TriggerMode); c.match(s) { - ch := n.Child("trigger_mode") - if r, ok := c.fn(&ch, s); ok { - v.TriggerMode = jobs.SqlConditionTriggerMode(r) - } - } - if s := string(v.WarehouseId); c.match(s) { - ch := n.Child("warehouse_id") - if r, ok := c.fn(&ch, s); ok { - v.WarehouseId = (r) - } - } -} - -func stringsJobsAiRuntimeTask(c *stringsWalk, n *Node, v *jobs.AiRuntimeTask) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.CodeSourcePath == "" && Forced(v.ForceSendFields, "CodeSourcePath") { - ch := n.Child("code_source_path") - c.fn(&ch, "") - } - if s := string(v.CodeSourcePath); c.match(s) { - ch := n.Child("code_source_path") - if r, ok := c.fn(&ch, s); ok { - v.CodeSourcePath = (r) - } - } - if !n.IsRef("deployments") { - if len(v.Deployments) > 0 { - cn := n.Child("deployments") - for i := range v.Deployments { - { - ch := cn.Elem(i) - stringsJobsDeploymentSpec(c, &ch, &v.Deployments[i]) - } - } - } - } - if c.mode == EmptyFields && v.DockerImageUrl == "" && Forced(v.ForceSendFields, "DockerImageUrl") { - ch := n.Child("docker_image_url") - c.fn(&ch, "") - } - if s := string(v.DockerImageUrl); c.match(s) { - ch := n.Child("docker_image_url") - if r, ok := c.fn(&ch, s); ok { - v.DockerImageUrl = (r) - } - } - if s := string(v.Experiment); c.match(s) { - ch := n.Child("experiment") - if r, ok := c.fn(&ch, s); ok { - v.Experiment = (r) - } - } - if c.mode == EmptyFields && v.MlflowArtifactLocation == "" && Forced(v.ForceSendFields, "MlflowArtifactLocation") { - ch := n.Child("mlflow_artifact_location") - c.fn(&ch, "") - } - if s := string(v.MlflowArtifactLocation); c.match(s) { - ch := n.Child("mlflow_artifact_location") - if r, ok := c.fn(&ch, s); ok { - v.MlflowArtifactLocation = (r) - } - } - if c.mode == EmptyFields && v.MlflowExperimentDirectory == "" && Forced(v.ForceSendFields, "MlflowExperimentDirectory") { - ch := n.Child("mlflow_experiment_directory") - c.fn(&ch, "") - } - if s := string(v.MlflowExperimentDirectory); c.match(s) { - ch := n.Child("mlflow_experiment_directory") - if r, ok := c.fn(&ch, s); ok { - v.MlflowExperimentDirectory = (r) - } - } - if c.mode == EmptyFields && v.MlflowRun == "" && Forced(v.ForceSendFields, "MlflowRun") { - ch := n.Child("mlflow_run") - c.fn(&ch, "") - } - if s := string(v.MlflowRun); c.match(s) { - ch := n.Child("mlflow_run") - if r, ok := c.fn(&ch, s); ok { - v.MlflowRun = (r) - } - } - if c.mode == EmptyFields && v.PriorityClass == "" && Forced(v.ForceSendFields, "PriorityClass") { - ch := n.Child("priority_class") - c.fn(&ch, "") - } - if s := string(v.PriorityClass); c.match(s) { - ch := n.Child("priority_class") - if r, ok := c.fn(&ch, s); ok { - v.PriorityClass = jobs.AiRuntimeTaskPriorityClass(r) - } - } - if c.mode == EmptyFields && v.UnityCatalogImagePath == "" && Forced(v.ForceSendFields, "UnityCatalogImagePath") { - ch := n.Child("unity_catalog_image_path") - c.fn(&ch, "") - } - if s := string(v.UnityCatalogImagePath); c.match(s) { - ch := n.Child("unity_catalog_image_path") - if r, ok := c.fn(&ch, s); ok { - v.UnityCatalogImagePath = (r) - } - } -} - -func stringsJobsAlertTask(c *stringsWalk, n *Node, v *jobs.AlertTask) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.AlertId == "" && Forced(v.ForceSendFields, "AlertId") { - ch := n.Child("alert_id") - c.fn(&ch, "") - } - if s := string(v.AlertId); c.match(s) { - ch := n.Child("alert_id") - if r, ok := c.fn(&ch, s); ok { - v.AlertId = (r) - } - } - if !n.IsRef("parameters") { - if len(v.Parameters) > 0 { - cn := n.Child("parameters") - for _, k := range sortedKeys(v.Parameters) { - if s := string(v.Parameters[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.Parameters[k] = (r) - } - } - } - } - } - if !n.IsRef("subscribers") { - if len(v.Subscribers) > 0 { - cn := n.Child("subscribers") - for i := range v.Subscribers { - { - ch := cn.Elem(i) - stringsJobsAlertTaskSubscriber(c, &ch, &v.Subscribers[i]) - } - } - } - } - if c.mode == EmptyFields && v.WarehouseId == "" && Forced(v.ForceSendFields, "WarehouseId") { - ch := n.Child("warehouse_id") - c.fn(&ch, "") - } - if s := string(v.WarehouseId); c.match(s) { - ch := n.Child("warehouse_id") - if r, ok := c.fn(&ch, s); ok { - v.WarehouseId = (r) - } - } - if c.mode == EmptyFields && v.WorkspacePath == "" && Forced(v.ForceSendFields, "WorkspacePath") { - ch := n.Child("workspace_path") - c.fn(&ch, "") - } - if s := string(v.WorkspacePath); c.match(s) { - ch := n.Child("workspace_path") - if r, ok := c.fn(&ch, s); ok { - v.WorkspacePath = (r) - } - } -} - -func stringsJobsCleanRoomsNotebookTask(c *stringsWalk, n *Node, v *jobs.CleanRoomsNotebookTask) { - if n.isRef() { - return - } - if s := string(v.CleanRoomName); c.match(s) { - ch := n.Child("clean_room_name") - if r, ok := c.fn(&ch, s); ok { - v.CleanRoomName = (r) - } - } - if c.mode == EmptyFields && v.Etag == "" && Forced(v.ForceSendFields, "Etag") { - ch := n.Child("etag") - c.fn(&ch, "") - } - if s := string(v.Etag); c.match(s) { - ch := n.Child("etag") - if r, ok := c.fn(&ch, s); ok { - v.Etag = (r) - } - } - if !n.IsRef("notebook_base_parameters") { - if len(v.NotebookBaseParameters) > 0 { - cn := n.Child("notebook_base_parameters") - for _, k := range sortedKeys(v.NotebookBaseParameters) { - if s := string(v.NotebookBaseParameters[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.NotebookBaseParameters[k] = (r) - } - } - } - } - } - if s := string(v.NotebookName); c.match(s) { - ch := n.Child("notebook_name") - if r, ok := c.fn(&ch, s); ok { - v.NotebookName = (r) - } - } -} - -func stringsJobsCompute(c *stringsWalk, n *Node, v *jobs.Compute) { - if n.isRef() { - return - } - if s := string(v.HardwareAccelerator); c.match(s) { - ch := n.Child("hardware_accelerator") - if r, ok := c.fn(&ch, s); ok { - v.HardwareAccelerator = compute.HardwareAcceleratorType(r) - } - } -} - -func stringsJobsConditionTask(c *stringsWalk, n *Node, v *jobs.ConditionTask) { - if n.isRef() { - return - } - if s := string(v.Left); c.match(s) { - ch := n.Child("left") - if r, ok := c.fn(&ch, s); ok { - v.Left = (r) - } - } - if s := string(v.Op); c.match(s) { - ch := n.Child("op") - if r, ok := c.fn(&ch, s); ok { - v.Op = jobs.ConditionTaskOp(r) - } - } - if s := string(v.Right); c.match(s) { - ch := n.Child("right") - if r, ok := c.fn(&ch, s); ok { - v.Right = (r) - } - } -} - -func stringsJobsDashboardTask(c *stringsWalk, n *Node, v *jobs.DashboardTask) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DashboardId == "" && Forced(v.ForceSendFields, "DashboardId") { - ch := n.Child("dashboard_id") - c.fn(&ch, "") - } - if s := string(v.DashboardId); c.match(s) { - ch := n.Child("dashboard_id") - if r, ok := c.fn(&ch, s); ok { - v.DashboardId = (r) - } - } - if !n.IsRef("filters") { - if len(v.Filters) > 0 { - cn := n.Child("filters") - for _, k := range sortedKeys(v.Filters) { - if s := string(v.Filters[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.Filters[k] = (r) - } - } - } - } - } - if !n.IsRef("subscription") { - if x := v.Subscription; x != nil { - ch := n.Child("subscription") - stringsJobsSubscription(c, &ch, x) - } - } - if c.mode == EmptyFields && v.WarehouseId == "" && Forced(v.ForceSendFields, "WarehouseId") { - ch := n.Child("warehouse_id") - c.fn(&ch, "") - } - if s := string(v.WarehouseId); c.match(s) { - ch := n.Child("warehouse_id") - if r, ok := c.fn(&ch, s); ok { - v.WarehouseId = (r) - } - } -} - -func stringsJobsDbtCloudTask(c *stringsWalk, n *Node, v *jobs.DbtCloudTask) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ConnectionResourceName == "" && Forced(v.ForceSendFields, "ConnectionResourceName") { - ch := n.Child("connection_resource_name") - c.fn(&ch, "") - } - if s := string(v.ConnectionResourceName); c.match(s) { - ch := n.Child("connection_resource_name") - if r, ok := c.fn(&ch, s); ok { - v.ConnectionResourceName = (r) - } - } -} - -func stringsJobsDbtPlatformTask(c *stringsWalk, n *Node, v *jobs.DbtPlatformTask) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ConnectionResourceName == "" && Forced(v.ForceSendFields, "ConnectionResourceName") { - ch := n.Child("connection_resource_name") - c.fn(&ch, "") - } - if s := string(v.ConnectionResourceName); c.match(s) { - ch := n.Child("connection_resource_name") - if r, ok := c.fn(&ch, s); ok { - v.ConnectionResourceName = (r) - } - } - if c.mode == EmptyFields && v.DbtPlatformJobId == "" && Forced(v.ForceSendFields, "DbtPlatformJobId") { - ch := n.Child("dbt_platform_job_id") - c.fn(&ch, "") - } - if s := string(v.DbtPlatformJobId); c.match(s) { - ch := n.Child("dbt_platform_job_id") - if r, ok := c.fn(&ch, s); ok { - v.DbtPlatformJobId = (r) - } - } -} - -func stringsJobsDbtTask(c *stringsWalk, n *Node, v *jobs.DbtTask) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Catalog == "" && Forced(v.ForceSendFields, "Catalog") { - ch := n.Child("catalog") - c.fn(&ch, "") - } - if s := string(v.Catalog); c.match(s) { - ch := n.Child("catalog") - if r, ok := c.fn(&ch, s); ok { - v.Catalog = (r) - } - } - if !n.IsRef("commands") { - if len(v.Commands) > 0 { - cn := n.Child("commands") - for i := range v.Commands { - if s := string(v.Commands[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Commands[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.ProfilesDirectory == "" && Forced(v.ForceSendFields, "ProfilesDirectory") { - ch := n.Child("profiles_directory") - c.fn(&ch, "") - } - if s := string(v.ProfilesDirectory); c.match(s) { - ch := n.Child("profiles_directory") - if r, ok := c.fn(&ch, s); ok { - v.ProfilesDirectory = (r) - } - } - if c.mode == EmptyFields && v.ProjectDirectory == "" && Forced(v.ForceSendFields, "ProjectDirectory") { - ch := n.Child("project_directory") - c.fn(&ch, "") - } - if s := string(v.ProjectDirectory); c.match(s) { - ch := n.Child("project_directory") - if r, ok := c.fn(&ch, s); ok { - v.ProjectDirectory = (r) - } - } - if c.mode == EmptyFields && v.Schema == "" && Forced(v.ForceSendFields, "Schema") { - ch := n.Child("schema") - c.fn(&ch, "") - } - if s := string(v.Schema); c.match(s) { - ch := n.Child("schema") - if r, ok := c.fn(&ch, s); ok { - v.Schema = (r) - } - } - if c.mode == EmptyFields && v.Source == "" && Forced(v.ForceSendFields, "Source") { - ch := n.Child("source") - c.fn(&ch, "") - } - if s := string(v.Source); c.match(s) { - ch := n.Child("source") - if r, ok := c.fn(&ch, s); ok { - v.Source = jobs.Source(r) - } - } - if c.mode == EmptyFields && v.WarehouseId == "" && Forced(v.ForceSendFields, "WarehouseId") { - ch := n.Child("warehouse_id") - c.fn(&ch, "") - } - if s := string(v.WarehouseId); c.match(s) { - ch := n.Child("warehouse_id") - if r, ok := c.fn(&ch, s); ok { - v.WarehouseId = (r) - } - } -} - -func stringsJobsTaskDependency(c *stringsWalk, n *Node, v *jobs.TaskDependency) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Outcome == "" && Forced(v.ForceSendFields, "Outcome") { - ch := n.Child("outcome") - c.fn(&ch, "") - } - if s := string(v.Outcome); c.match(s) { - ch := n.Child("outcome") - if r, ok := c.fn(&ch, s); ok { - v.Outcome = (r) - } - } - if s := string(v.TaskKey); c.match(s) { - ch := n.Child("task_key") - if r, ok := c.fn(&ch, s); ok { - v.TaskKey = (r) - } - } -} - -func stringsJobsTaskEmailNotifications(c *stringsWalk, n *Node, v *jobs.TaskEmailNotifications) { - if n.isRef() { - return - } - if !n.IsRef("on_duration_warning_threshold_exceeded") { - if len(v.OnDurationWarningThresholdExceeded) > 0 { - cn := n.Child("on_duration_warning_threshold_exceeded") - for i := range v.OnDurationWarningThresholdExceeded { - if s := string(v.OnDurationWarningThresholdExceeded[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.OnDurationWarningThresholdExceeded[i] = (r) - } - } - } - } - } - if !n.IsRef("on_failure") { - if len(v.OnFailure) > 0 { - cn := n.Child("on_failure") - for i := range v.OnFailure { - if s := string(v.OnFailure[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.OnFailure[i] = (r) - } - } - } - } - } - if !n.IsRef("on_maintenance_complete") { - if len(v.OnMaintenanceComplete) > 0 { - cn := n.Child("on_maintenance_complete") - for i := range v.OnMaintenanceComplete { - if s := string(v.OnMaintenanceComplete[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.OnMaintenanceComplete[i] = (r) - } - } - } - } - } - if !n.IsRef("on_maintenance_start") { - if len(v.OnMaintenanceStart) > 0 { - cn := n.Child("on_maintenance_start") - for i := range v.OnMaintenanceStart { - if s := string(v.OnMaintenanceStart[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.OnMaintenanceStart[i] = (r) - } - } - } - } - } - if !n.IsRef("on_start") { - if len(v.OnStart) > 0 { - cn := n.Child("on_start") - for i := range v.OnStart { - if s := string(v.OnStart[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.OnStart[i] = (r) - } - } - } - } - } - if !n.IsRef("on_streaming_backlog_exceeded") { - if len(v.OnStreamingBacklogExceeded) > 0 { - cn := n.Child("on_streaming_backlog_exceeded") - for i := range v.OnStreamingBacklogExceeded { - if s := string(v.OnStreamingBacklogExceeded[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.OnStreamingBacklogExceeded[i] = (r) - } - } - } - } - } - if !n.IsRef("on_success") { - if len(v.OnSuccess) > 0 { - cn := n.Child("on_success") - for i := range v.OnSuccess { - if s := string(v.OnSuccess[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.OnSuccess[i] = (r) - } - } - } - } - } -} - -func stringsJobsForEachTask(c *stringsWalk, n *Node, v *jobs.ForEachTask) { - if n.isRef() { - return - } - if s := string(v.Inputs); c.match(s) { - ch := n.Child("inputs") - if r, ok := c.fn(&ch, s); ok { - v.Inputs = (r) - } - } - if !n.IsRef("task") { - { - ch := n.Child("task") - stringsJobsTask(c, &ch, &v.Task) - } - } -} - -func stringsJobsGenAiComputeTask(c *stringsWalk, n *Node, v *jobs.GenAiComputeTask) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Command == "" && Forced(v.ForceSendFields, "Command") { - ch := n.Child("command") - c.fn(&ch, "") - } - if s := string(v.Command); c.match(s) { - ch := n.Child("command") - if r, ok := c.fn(&ch, s); ok { - v.Command = (r) - } - } - if !n.IsRef("compute") { - if x := v.Compute; x != nil { - ch := n.Child("compute") - stringsJobsComputeConfig(c, &ch, x) - } - } - if s := string(v.DlRuntimeImage); c.match(s) { - ch := n.Child("dl_runtime_image") - if r, ok := c.fn(&ch, s); ok { - v.DlRuntimeImage = (r) - } - } - if c.mode == EmptyFields && v.MlflowExperimentName == "" && Forced(v.ForceSendFields, "MlflowExperimentName") { - ch := n.Child("mlflow_experiment_name") - c.fn(&ch, "") - } - if s := string(v.MlflowExperimentName); c.match(s) { - ch := n.Child("mlflow_experiment_name") - if r, ok := c.fn(&ch, s); ok { - v.MlflowExperimentName = (r) - } - } - if c.mode == EmptyFields && v.Source == "" && Forced(v.ForceSendFields, "Source") { - ch := n.Child("source") - c.fn(&ch, "") - } - if s := string(v.Source); c.match(s) { - ch := n.Child("source") - if r, ok := c.fn(&ch, s); ok { - v.Source = jobs.Source(r) - } - } - if c.mode == EmptyFields && v.TrainingScriptPath == "" && Forced(v.ForceSendFields, "TrainingScriptPath") { - ch := n.Child("training_script_path") - c.fn(&ch, "") - } - if s := string(v.TrainingScriptPath); c.match(s) { - ch := n.Child("training_script_path") - if r, ok := c.fn(&ch, s); ok { - v.TrainingScriptPath = (r) - } - } - if c.mode == EmptyFields && v.YamlParameters == "" && Forced(v.ForceSendFields, "YamlParameters") { - ch := n.Child("yaml_parameters") - c.fn(&ch, "") - } - if s := string(v.YamlParameters); c.match(s) { - ch := n.Child("yaml_parameters") - if r, ok := c.fn(&ch, s); ok { - v.YamlParameters = (r) - } - } - if c.mode == EmptyFields && v.YamlParametersFilePath == "" && Forced(v.ForceSendFields, "YamlParametersFilePath") { - ch := n.Child("yaml_parameters_file_path") - c.fn(&ch, "") - } - if s := string(v.YamlParametersFilePath); c.match(s) { - ch := n.Child("yaml_parameters_file_path") - if r, ok := c.fn(&ch, s); ok { - v.YamlParametersFilePath = (r) - } - } -} - -func stringsJobsNotebookTask(c *stringsWalk, n *Node, v *jobs.NotebookTask) { - if n.isRef() { - return - } - if !n.IsRef("base_parameters") { - if len(v.BaseParameters) > 0 { - cn := n.Child("base_parameters") - for _, k := range sortedKeys(v.BaseParameters) { - if s := string(v.BaseParameters[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.BaseParameters[k] = (r) - } - } - } - } - } - if s := string(v.NotebookPath); c.match(s) { - ch := n.Child("notebook_path") - if r, ok := c.fn(&ch, s); ok { - v.NotebookPath = (r) - } - } - if c.mode == EmptyFields && v.Source == "" && Forced(v.ForceSendFields, "Source") { - ch := n.Child("source") - c.fn(&ch, "") - } - if s := string(v.Source); c.match(s) { - ch := n.Child("source") - if r, ok := c.fn(&ch, s); ok { - v.Source = jobs.Source(r) - } - } - if c.mode == EmptyFields && v.WarehouseId == "" && Forced(v.ForceSendFields, "WarehouseId") { - ch := n.Child("warehouse_id") - c.fn(&ch, "") - } - if s := string(v.WarehouseId); c.match(s) { - ch := n.Child("warehouse_id") - if r, ok := c.fn(&ch, s); ok { - v.WarehouseId = (r) - } - } -} - -func stringsJobsPipelineTask(c *stringsWalk, n *Node, v *jobs.PipelineTask) { - if n.isRef() { - return - } - if !n.IsRef("full_refresh_selection") { - if len(v.FullRefreshSelection) > 0 { - cn := n.Child("full_refresh_selection") - for i := range v.FullRefreshSelection { - if s := string(v.FullRefreshSelection[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.FullRefreshSelection[i] = (r) - } - } - } - } - } - if !n.IsRef("parameters") { - if len(v.Parameters) > 0 { - cn := n.Child("parameters") - for _, k := range sortedKeys(v.Parameters) { - if s := string(v.Parameters[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.Parameters[k] = (r) - } - } - } - } - } - if s := string(v.PipelineId); c.match(s) { - ch := n.Child("pipeline_id") - if r, ok := c.fn(&ch, s); ok { - v.PipelineId = (r) - } - } - if !n.IsRef("refresh_flow_selection") { - if len(v.RefreshFlowSelection) > 0 { - cn := n.Child("refresh_flow_selection") - for i := range v.RefreshFlowSelection { - if s := string(v.RefreshFlowSelection[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.RefreshFlowSelection[i] = (r) - } - } - } - } - } - if !n.IsRef("refresh_selection") { - if len(v.RefreshSelection) > 0 { - cn := n.Child("refresh_selection") - for i := range v.RefreshSelection { - if s := string(v.RefreshSelection[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.RefreshSelection[i] = (r) - } - } - } - } - } - if !n.IsRef("reset_checkpoint_selection") { - if len(v.ResetCheckpointSelection) > 0 { - cn := n.Child("reset_checkpoint_selection") - for i := range v.ResetCheckpointSelection { - if s := string(v.ResetCheckpointSelection[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.ResetCheckpointSelection[i] = (r) - } - } - } - } - } -} - -func stringsJobsPowerBiTask(c *stringsWalk, n *Node, v *jobs.PowerBiTask) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ConnectionResourceName == "" && Forced(v.ForceSendFields, "ConnectionResourceName") { - ch := n.Child("connection_resource_name") - c.fn(&ch, "") - } - if s := string(v.ConnectionResourceName); c.match(s) { - ch := n.Child("connection_resource_name") - if r, ok := c.fn(&ch, s); ok { - v.ConnectionResourceName = (r) - } - } - if !n.IsRef("power_bi_model") { - if x := v.PowerBiModel; x != nil { - ch := n.Child("power_bi_model") - stringsJobsPowerBiModel(c, &ch, x) - } - } - if !n.IsRef("tables") { - if len(v.Tables) > 0 { - cn := n.Child("tables") - for i := range v.Tables { - { - ch := cn.Elem(i) - stringsJobsPowerBiTable(c, &ch, &v.Tables[i]) - } - } - } - } - if c.mode == EmptyFields && v.WarehouseId == "" && Forced(v.ForceSendFields, "WarehouseId") { - ch := n.Child("warehouse_id") - c.fn(&ch, "") - } - if s := string(v.WarehouseId); c.match(s) { - ch := n.Child("warehouse_id") - if r, ok := c.fn(&ch, s); ok { - v.WarehouseId = (r) - } - } -} - -func stringsJobsPythonOperatorTask(c *stringsWalk, n *Node, v *jobs.PythonOperatorTask) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Main == "" && Forced(v.ForceSendFields, "Main") { - ch := n.Child("main") - c.fn(&ch, "") - } - if s := string(v.Main); c.match(s) { - ch := n.Child("main") - if r, ok := c.fn(&ch, s); ok { - v.Main = (r) - } - } - if !n.IsRef("parameters") { - if len(v.Parameters) > 0 { - cn := n.Child("parameters") - for i := range v.Parameters { - { - ch := cn.Elem(i) - stringsJobsPythonOperatorTaskParameter(c, &ch, &v.Parameters[i]) - } - } - } - } -} - -func stringsJobsPythonWheelTask(c *stringsWalk, n *Node, v *jobs.PythonWheelTask) { - if n.isRef() { - return - } - if s := string(v.EntryPoint); c.match(s) { - ch := n.Child("entry_point") - if r, ok := c.fn(&ch, s); ok { - v.EntryPoint = (r) - } - } - if !n.IsRef("named_parameters") { - if len(v.NamedParameters) > 0 { - cn := n.Child("named_parameters") - for _, k := range sortedKeys(v.NamedParameters) { - if s := string(v.NamedParameters[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.NamedParameters[k] = (r) - } - } - } - } - } - if s := string(v.PackageName); c.match(s) { - ch := n.Child("package_name") - if r, ok := c.fn(&ch, s); ok { - v.PackageName = (r) - } - } - if !n.IsRef("parameters") { - if len(v.Parameters) > 0 { - cn := n.Child("parameters") - for i := range v.Parameters { - if s := string(v.Parameters[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Parameters[i] = (r) - } - } - } - } - } -} - -func stringsJobsRunJobTask(c *stringsWalk, n *Node, v *jobs.RunJobTask) { - if n.isRef() { - return - } - if !n.IsRef("dbt_commands") { - if len(v.DbtCommands) > 0 { - cn := n.Child("dbt_commands") - for i := range v.DbtCommands { - if s := string(v.DbtCommands[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.DbtCommands[i] = (r) - } - } - } - } - } - if !n.IsRef("jar_params") { - if len(v.JarParams) > 0 { - cn := n.Child("jar_params") - for i := range v.JarParams { - if s := string(v.JarParams[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.JarParams[i] = (r) - } - } - } - } - } - if !n.IsRef("job_parameters") { - if len(v.JobParameters) > 0 { - cn := n.Child("job_parameters") - for _, k := range sortedKeys(v.JobParameters) { - if s := string(v.JobParameters[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.JobParameters[k] = (r) - } - } - } - } - } - if !n.IsRef("notebook_params") { - if len(v.NotebookParams) > 0 { - cn := n.Child("notebook_params") - for _, k := range sortedKeys(v.NotebookParams) { - if s := string(v.NotebookParams[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.NotebookParams[k] = (r) - } - } - } - } - } - if !n.IsRef("pipeline_params") { - if x := v.PipelineParams; x != nil { - ch := n.Child("pipeline_params") - stringsJobsPipelineParams(c, &ch, x) - } - } - if !n.IsRef("python_named_params") { - if len(v.PythonNamedParams) > 0 { - cn := n.Child("python_named_params") - for _, k := range sortedKeys(v.PythonNamedParams) { - if s := string(v.PythonNamedParams[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.PythonNamedParams[k] = (r) - } - } - } - } - } - if !n.IsRef("python_params") { - if len(v.PythonParams) > 0 { - cn := n.Child("python_params") - for i := range v.PythonParams { - if s := string(v.PythonParams[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.PythonParams[i] = (r) - } - } - } - } - } - if !n.IsRef("spark_submit_params") { - if len(v.SparkSubmitParams) > 0 { - cn := n.Child("spark_submit_params") - for i := range v.SparkSubmitParams { - if s := string(v.SparkSubmitParams[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.SparkSubmitParams[i] = (r) - } - } - } - } - } - if !n.IsRef("sql_params") { - if len(v.SqlParams) > 0 { - cn := n.Child("sql_params") - for _, k := range sortedKeys(v.SqlParams) { - if s := string(v.SqlParams[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.SqlParams[k] = (r) - } - } - } - } - } -} - -func stringsJobsSparkJarTask(c *stringsWalk, n *Node, v *jobs.SparkJarTask) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.JarUri == "" && Forced(v.ForceSendFields, "JarUri") { - ch := n.Child("jar_uri") - c.fn(&ch, "") - } - if s := string(v.JarUri); c.match(s) { - ch := n.Child("jar_uri") - if r, ok := c.fn(&ch, s); ok { - v.JarUri = (r) - } - } - if c.mode == EmptyFields && v.MainClassName == "" && Forced(v.ForceSendFields, "MainClassName") { - ch := n.Child("main_class_name") - c.fn(&ch, "") - } - if s := string(v.MainClassName); c.match(s) { - ch := n.Child("main_class_name") - if r, ok := c.fn(&ch, s); ok { - v.MainClassName = (r) - } - } - if !n.IsRef("parameters") { - if len(v.Parameters) > 0 { - cn := n.Child("parameters") - for i := range v.Parameters { - if s := string(v.Parameters[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Parameters[i] = (r) - } - } - } - } - } -} - -func stringsJobsSparkPythonTask(c *stringsWalk, n *Node, v *jobs.SparkPythonTask) { - if n.isRef() { - return - } - if !n.IsRef("parameters") { - if len(v.Parameters) > 0 { - cn := n.Child("parameters") - for i := range v.Parameters { - if s := string(v.Parameters[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Parameters[i] = (r) - } - } - } - } - } - if s := string(v.PythonFile); c.match(s) { - ch := n.Child("python_file") - if r, ok := c.fn(&ch, s); ok { - v.PythonFile = (r) - } - } - if s := string(v.Source); c.match(s) { - ch := n.Child("source") - if r, ok := c.fn(&ch, s); ok { - v.Source = jobs.Source(r) - } - } -} - -func stringsJobsSparkSubmitTask(c *stringsWalk, n *Node, v *jobs.SparkSubmitTask) { - if n.isRef() { - return - } - if !n.IsRef("parameters") { - if len(v.Parameters) > 0 { - cn := n.Child("parameters") - for i := range v.Parameters { - if s := string(v.Parameters[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Parameters[i] = (r) - } - } - } - } - } -} - -func stringsJobsSqlTask(c *stringsWalk, n *Node, v *jobs.SqlTask) { - if n.isRef() { - return - } - if !n.IsRef("alert") { - if x := v.Alert; x != nil { - ch := n.Child("alert") - stringsJobsSqlTaskAlert(c, &ch, x) - } - } - if !n.IsRef("dashboard") { - if x := v.Dashboard; x != nil { - ch := n.Child("dashboard") - stringsJobsSqlTaskDashboard(c, &ch, x) - } - } - if !n.IsRef("file") { - if x := v.File; x != nil { - ch := n.Child("file") - stringsJobsSqlTaskFile(c, &ch, x) - } - } - if !n.IsRef("parameters") { - if len(v.Parameters) > 0 { - cn := n.Child("parameters") - for _, k := range sortedKeys(v.Parameters) { - if s := string(v.Parameters[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.Parameters[k] = (r) - } - } - } - } - } - if !n.IsRef("query") { - if x := v.Query; x != nil { - ch := n.Child("query") - stringsJobsSqlTaskQuery(c, &ch, x) - } - } - if s := string(v.WarehouseId); c.match(s) { - ch := n.Child("warehouse_id") - if r, ok := c.fn(&ch, s); ok { - v.WarehouseId = (r) - } - } -} - -func stringsJobsFileArrivalTriggerConfiguration(c *stringsWalk, n *Node, v *jobs.FileArrivalTriggerConfiguration) { - if n.isRef() { - return - } - if s := string(v.Url); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.Url = (r) - } - } -} - -func stringsJobsModelTriggerConfiguration(c *stringsWalk, n *Node, v *jobs.ModelTriggerConfiguration) { - if n.isRef() { - return - } - if !n.IsRef("aliases") { - if len(v.Aliases) > 0 { - cn := n.Child("aliases") - for i := range v.Aliases { - if s := string(v.Aliases[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Aliases[i] = (r) - } - } - } - } - } - if s := string(v.Condition); c.match(s) { - ch := n.Child("condition") - if r, ok := c.fn(&ch, s); ok { - v.Condition = jobs.ModelTriggerConfigurationCondition(r) - } - } - if c.mode == EmptyFields && v.SecurableName == "" && Forced(v.ForceSendFields, "SecurableName") { - ch := n.Child("securable_name") - c.fn(&ch, "") - } - if s := string(v.SecurableName); c.match(s) { - ch := n.Child("securable_name") - if r, ok := c.fn(&ch, s); ok { - v.SecurableName = (r) - } - } -} - -func stringsJobsPeriodicTriggerConfiguration(c *stringsWalk, n *Node, v *jobs.PeriodicTriggerConfiguration) { - if n.isRef() { - return - } - if s := string(v.Unit); c.match(s) { - ch := n.Child("unit") - if r, ok := c.fn(&ch, s); ok { - v.Unit = jobs.PeriodicTriggerConfigurationTimeUnit(r) - } - } -} - -func stringsJobsTableUpdateTriggerConfiguration(c *stringsWalk, n *Node, v *jobs.TableUpdateTriggerConfiguration) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Condition == "" && Forced(v.ForceSendFields, "Condition") { - ch := n.Child("condition") - c.fn(&ch, "") - } - if s := string(v.Condition); c.match(s) { - ch := n.Child("condition") - if r, ok := c.fn(&ch, s); ok { - v.Condition = jobs.Condition(r) - } - } - if !n.IsRef("table_names") { - if len(v.TableNames) > 0 { - cn := n.Child("table_names") - for i := range v.TableNames { - if s := string(v.TableNames[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.TableNames[i] = (r) - } - } - } - } - } -} - -func stringsJobsContinuousTriggerConfiguration(c *stringsWalk, n *Node, v *jobs.ContinuousTriggerConfiguration) { - if n.isRef() { - return - } - if !n.IsRef("maintenance_window") { - if x := v.MaintenanceWindow; x != nil { - ch := n.Child("maintenance_window") - stringsJobsMaintenanceWindow(c, &ch, x) - } - } - if s := string(v.TaskRetryMode); c.match(s) { - ch := n.Child("task_retry_mode") - if r, ok := c.fn(&ch, s); ok { - v.TaskRetryMode = jobs.TaskRetryMode(r) - } - } -} - -func stringsJobsCronTriggerConfiguration(c *stringsWalk, n *Node, v *jobs.CronTriggerConfiguration) { - if n.isRef() { - return - } - if s := string(v.QuartzCronExpression); c.match(s) { - ch := n.Child("quartz_cron_expression") - if r, ok := c.fn(&ch, s); ok { - v.QuartzCronExpression = (r) - } - } - if s := string(v.TimezoneId); c.match(s) { - ch := n.Child("timezone_id") - if r, ok := c.fn(&ch, s); ok { - v.TimezoneId = (r) - } - } -} - -func stringsJobsWebhook(c *stringsWalk, n *Node, v *jobs.Webhook) { - if n.isRef() { - return - } - if s := string(v.Id); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.Id = (r) - } - } -} - -func stringsResourcesJobRunTrigger(c *stringsWalk, n *Node, v *resources.JobRunTrigger) { - if n.isRef() { - return - } - if !n.IsRef("on_file_change") { - if c.mode == EmptyFields && v.OnFileChange != nil && *v.OnFileChange == "" { - ch := n.Child("on_file_change") - c.fn(&ch, "") - } - if x := v.OnFileChange; x != nil { - if s := string(*x); c.match(s) { - ch := n.Child("on_file_change") - if r, ok := c.fn(&ch, s); ok { - *x = (r) - } - } - } - } -} - -func stringsResourcesJobRunTriggersState(c *stringsWalk, n *Node, v *resources.JobRunTriggersState) { - if n.isRef() { - return - } - if s := string(v.OnBundleDeploy); c.match(s) { - ch := n.Child("on_bundle_deploy") - if r, ok := c.fn(&ch, s); ok { - v.OnBundleDeploy = (r) - } - } - if !n.IsRef("on_file_change") { - if len(v.OnFileChange) > 0 { - cn := n.Child("on_file_change") - for _, k := range sortedKeys(v.OnFileChange) { - if s := string(v.OnFileChange[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.OnFileChange[k] = (r) - } - } - } - } - } -} - -func stringsPipelinesPipelineClusterAutoscale(c *stringsWalk, n *Node, v *pipelines.PipelineClusterAutoscale) { - if n.isRef() { - return - } - if s := string(v.Mode); c.match(s) { - ch := n.Child("mode") - if r, ok := c.fn(&ch, s); ok { - v.Mode = pipelines.PipelineClusterAutoscaleMode(r) - } - } -} - -func stringsPipelinesConnectionParameters(c *stringsWalk, n *Node, v *pipelines.ConnectionParameters) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.SourceCatalog == "" && Forced(v.ForceSendFields, "SourceCatalog") { - ch := n.Child("source_catalog") - c.fn(&ch, "") - } - if s := string(v.SourceCatalog); c.match(s) { - ch := n.Child("source_catalog") - if r, ok := c.fn(&ch, s); ok { - v.SourceCatalog = (r) - } - } -} - -func stringsPipelinesDataStagingOptions(c *stringsWalk, n *Node, v *pipelines.DataStagingOptions) { - if n.isRef() { - return - } - if s := string(v.CatalogName); c.match(s) { - ch := n.Child("catalog_name") - if r, ok := c.fn(&ch, s); ok { - v.CatalogName = (r) - } - } - if s := string(v.SchemaName); c.match(s) { - ch := n.Child("schema_name") - if r, ok := c.fn(&ch, s); ok { - v.SchemaName = (r) - } - } - if c.mode == EmptyFields && v.VolumeName == "" && Forced(v.ForceSendFields, "VolumeName") { - ch := n.Child("volume_name") - c.fn(&ch, "") - } - if s := string(v.VolumeName); c.match(s) { - ch := n.Child("volume_name") - if r, ok := c.fn(&ch, s); ok { - v.VolumeName = (r) - } - } -} - -func stringsPipelinesOperationTimeWindow(c *stringsWalk, n *Node, v *pipelines.OperationTimeWindow) { - if n.isRef() { - return - } - if !n.IsRef("days_of_week") { - if len(v.DaysOfWeek) > 0 { - cn := n.Child("days_of_week") - for i := range v.DaysOfWeek { - if s := string(v.DaysOfWeek[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.DaysOfWeek[i] = pipelines.DayOfWeek(r) - } - } - } - } - } - if c.mode == EmptyFields && v.TimeZoneId == "" && Forced(v.ForceSendFields, "TimeZoneId") { - ch := n.Child("time_zone_id") - c.fn(&ch, "") - } - if s := string(v.TimeZoneId); c.match(s) { - ch := n.Child("time_zone_id") - if r, ok := c.fn(&ch, s); ok { - v.TimeZoneId = (r) - } - } -} - -func stringsPipelinesIngestionConfig(c *stringsWalk, n *Node, v *pipelines.IngestionConfig) { - if n.isRef() { - return - } - if !n.IsRef("report") { - if x := v.Report; x != nil { - ch := n.Child("report") - stringsPipelinesReportSpec(c, &ch, x) - } - } - if !n.IsRef("schema") { - if x := v.Schema; x != nil { - ch := n.Child("schema") - stringsPipelinesSchemaSpec(c, &ch, x) - } - } - if !n.IsRef("table") { - if x := v.Table; x != nil { - ch := n.Child("table") - stringsPipelinesTableSpec(c, &ch, x) - } - } -} - -func stringsPipelinesSourceConfig(c *stringsWalk, n *Node, v *pipelines.SourceConfig) { - if n.isRef() { - return - } - if !n.IsRef("api_source_connector_config") { - if x := v.ApiSourceConnectorConfig; x != nil { - ch := n.Child("api_source_connector_config") - stringsPipelinesApiSourceConnectorConfig(c, &ch, x) - } - } - if !n.IsRef("catalog") { - if x := v.Catalog; x != nil { - ch := n.Child("catalog") - stringsPipelinesSourceCatalogConfig(c, &ch, x) - } - } - if !n.IsRef("google_ads_config") { - if x := v.GoogleAdsConfig; x != nil { - ch := n.Child("google_ads_config") - stringsPipelinesGoogleAdsConfig(c, &ch, x) - } - } -} - -func stringsPipelinesTableSpecificConfig(c *stringsWalk, n *Node, v *pipelines.TableSpecificConfig) { - if n.isRef() { - return - } - if !n.IsRef("clustering_columns") { - if len(v.ClusteringColumns) > 0 { - cn := n.Child("clustering_columns") - for i := range v.ClusteringColumns { - if s := string(v.ClusteringColumns[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.ClusteringColumns[i] = (r) - } - } - } - } - } - if !n.IsRef("exclude_columns") { - if len(v.ExcludeColumns) > 0 { - cn := n.Child("exclude_columns") - for i := range v.ExcludeColumns { - if s := string(v.ExcludeColumns[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.ExcludeColumns[i] = (r) - } - } - } - } - } - if !n.IsRef("include_columns") { - if len(v.IncludeColumns) > 0 { - cn := n.Child("include_columns") - for i := range v.IncludeColumns { - if s := string(v.IncludeColumns[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.IncludeColumns[i] = (r) - } - } - } - } - } - if !n.IsRef("primary_keys") { - if len(v.PrimaryKeys) > 0 { - cn := n.Child("primary_keys") - for i := range v.PrimaryKeys { - if s := string(v.PrimaryKeys[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.PrimaryKeys[i] = (r) - } - } - } - } - } - if !n.IsRef("query_based_connector_config") { - if x := v.QueryBasedConnectorConfig; x != nil { - ch := n.Child("query_based_connector_config") - stringsPipelinesIngestionPipelineDefinitionTableSpecificConfigQueryBasedConnectorConfig(c, &ch, x) - } - } - if c.mode == EmptyFields && v.RowFilter == "" && Forced(v.ForceSendFields, "RowFilter") { - ch := n.Child("row_filter") - c.fn(&ch, "") - } - if s := string(v.RowFilter); c.match(s) { - ch := n.Child("row_filter") - if r, ok := c.fn(&ch, s); ok { - v.RowFilter = (r) - } - } - if c.mode == EmptyFields && v.ScdType == "" && Forced(v.ForceSendFields, "ScdType") { - ch := n.Child("scd_type") - c.fn(&ch, "") - } - if s := string(v.ScdType); c.match(s) { - ch := n.Child("scd_type") - if r, ok := c.fn(&ch, s); ok { - v.ScdType = pipelines.TableSpecificConfigScdType(r) - } - } - if !n.IsRef("sequence_by") { - if len(v.SequenceBy) > 0 { - cn := n.Child("sequence_by") - for i := range v.SequenceBy { - if s := string(v.SequenceBy[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.SequenceBy[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.SourceMetadataColumn == "" && Forced(v.ForceSendFields, "SourceMetadataColumn") { - ch := n.Child("source_metadata_column") - c.fn(&ch, "") - } - if s := string(v.SourceMetadataColumn); c.match(s) { - ch := n.Child("source_metadata_column") - if r, ok := c.fn(&ch, s); ok { - v.SourceMetadataColumn = (r) - } - } - if !n.IsRef("table_properties") { - if len(v.TableProperties) > 0 { - cn := n.Child("table_properties") - for _, k := range sortedKeys(v.TableProperties) { - if s := string(v.TableProperties[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.TableProperties[k] = (r) - } - } - } - } - } - if !n.IsRef("workday_report_parameters") { - if x := v.WorkdayReportParameters; x != nil { - ch := n.Child("workday_report_parameters") - stringsPipelinesIngestionPipelineDefinitionWorkdayReportParameters(c, &ch, x) - } - } -} - -func stringsPipelinesFileLibrary(c *stringsWalk, n *Node, v *pipelines.FileLibrary) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Path == "" && Forced(v.ForceSendFields, "Path") { - ch := n.Child("path") - c.fn(&ch, "") - } - if s := string(v.Path); c.match(s) { - ch := n.Child("path") - if r, ok := c.fn(&ch, s); ok { - v.Path = (r) - } - } -} - -func stringsPipelinesPathPattern(c *stringsWalk, n *Node, v *pipelines.PathPattern) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Include == "" && Forced(v.ForceSendFields, "Include") { - ch := n.Child("include") - c.fn(&ch, "") - } - if s := string(v.Include); c.match(s) { - ch := n.Child("include") - if r, ok := c.fn(&ch, s); ok { - v.Include = (r) - } - } -} - -func stringsComputeMavenLibrary(c *stringsWalk, n *Node, v *compute.MavenLibrary) { - if n.isRef() { - return - } - if s := string(v.Coordinates); c.match(s) { - ch := n.Child("coordinates") - if r, ok := c.fn(&ch, s); ok { - v.Coordinates = (r) - } - } - if !n.IsRef("exclusions") { - if len(v.Exclusions) > 0 { - cn := n.Child("exclusions") - for i := range v.Exclusions { - if s := string(v.Exclusions[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Exclusions[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.Repo == "" && Forced(v.ForceSendFields, "Repo") { - ch := n.Child("repo") - c.fn(&ch, "") - } - if s := string(v.Repo); c.match(s) { - ch := n.Child("repo") - if r, ok := c.fn(&ch, s); ok { - v.Repo = (r) - } - } -} - -func stringsPipelinesNotebookLibrary(c *stringsWalk, n *Node, v *pipelines.NotebookLibrary) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Path == "" && Forced(v.ForceSendFields, "Path") { - ch := n.Child("path") - c.fn(&ch, "") - } - if s := string(v.Path); c.match(s) { - ch := n.Child("path") - if r, ok := c.fn(&ch, s); ok { - v.Path = (r) - } - } -} - -func stringsPipelinesCronTrigger(c *stringsWalk, n *Node, v *pipelines.CronTrigger) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.QuartzCronSchedule == "" && Forced(v.ForceSendFields, "QuartzCronSchedule") { - ch := n.Child("quartz_cron_schedule") - c.fn(&ch, "") - } - if s := string(v.QuartzCronSchedule); c.match(s) { - ch := n.Child("quartz_cron_schedule") - if r, ok := c.fn(&ch, s); ok { - v.QuartzCronSchedule = (r) - } - } - if c.mode == EmptyFields && v.TimezoneId == "" && Forced(v.ForceSendFields, "TimezoneId") { - ch := n.Child("timezone_id") - c.fn(&ch, "") - } - if s := string(v.TimezoneId); c.match(s) { - ch := n.Child("timezone_id") - if r, ok := c.fn(&ch, s); ok { - v.TimezoneId = (r) - } - } -} - -func stringsMlAggregationFunction(c *stringsWalk, n *Node, v *ml.AggregationFunction) { - if n.isRef() { - return - } - if !n.IsRef("approx_count_distinct") { - if x := v.ApproxCountDistinct; x != nil { - ch := n.Child("approx_count_distinct") - stringsMlApproxCountDistinctFunction(c, &ch, x) - } - } - if !n.IsRef("approx_percentile") { - if x := v.ApproxPercentile; x != nil { - ch := n.Child("approx_percentile") - stringsMlApproxPercentileFunction(c, &ch, x) - } - } - if !n.IsRef("avg") { - if x := v.Avg; x != nil { - ch := n.Child("avg") - stringsMlAvgFunction(c, &ch, x) - } - } - if !n.IsRef("count_function") { - if x := v.CountFunction; x != nil { - ch := n.Child("count_function") - stringsMlCountFunction(c, &ch, x) - } - } - if !n.IsRef("first") { - if x := v.First; x != nil { - ch := n.Child("first") - stringsMlFirstFunction(c, &ch, x) - } - } - if !n.IsRef("first_distinct") { - if x := v.FirstDistinct; x != nil { - ch := n.Child("first_distinct") - stringsMlFirstDistinctFunction(c, &ch, x) - } - } - if !n.IsRef("first_n") { - if x := v.FirstN; x != nil { - ch := n.Child("first_n") - stringsMlFirstNFunction(c, &ch, x) - } - } - if !n.IsRef("last") { - if x := v.Last; x != nil { - ch := n.Child("last") - stringsMlLastFunction(c, &ch, x) - } - } - if !n.IsRef("last_distinct") { - if x := v.LastDistinct; x != nil { - ch := n.Child("last_distinct") - stringsMlLastDistinctFunction(c, &ch, x) - } - } - if !n.IsRef("last_n") { - if x := v.LastN; x != nil { - ch := n.Child("last_n") - stringsMlLastNFunction(c, &ch, x) - } - } - if !n.IsRef("max") { - if x := v.Max; x != nil { - ch := n.Child("max") - stringsMlMaxFunction(c, &ch, x) - } - } - if !n.IsRef("min") { - if x := v.Min; x != nil { - ch := n.Child("min") - stringsMlMinFunction(c, &ch, x) - } - } - if !n.IsRef("stddev_pop") { - if x := v.StddevPop; x != nil { - ch := n.Child("stddev_pop") - stringsMlStddevPopFunction(c, &ch, x) - } - } - if !n.IsRef("stddev_samp") { - if x := v.StddevSamp; x != nil { - ch := n.Child("stddev_samp") - stringsMlStddevSampFunction(c, &ch, x) - } - } - if !n.IsRef("sum") { - if x := v.Sum; x != nil { - ch := n.Child("sum") - stringsMlSumFunction(c, &ch, x) - } - } - if !n.IsRef("time_window") { - if x := v.TimeWindow; x != nil { - ch := n.Child("time_window") - stringsMlTimeWindow(c, &ch, x) - } - } - if !n.IsRef("var_pop") { - if x := v.VarPop; x != nil { - ch := n.Child("var_pop") - stringsMlVarPopFunction(c, &ch, x) - } - } - if !n.IsRef("var_samp") { - if x := v.VarSamp; x != nil { - ch := n.Child("var_samp") - stringsMlVarSampFunction(c, &ch, x) - } - } -} - -func stringsMlColumnSelection(c *stringsWalk, n *Node, v *ml.ColumnSelection) { - if n.isRef() { - return - } - if s := string(v.Column); c.match(s) { - ch := n.Child("column") - if r, ok := c.fn(&ch, s); ok { - v.Column = (r) - } - } -} - -func stringsMlCustomUdf(c *stringsWalk, n *Node, v *ml.CustomUdf) { - if n.isRef() { - return - } - if s := string(v.FunctionPath); c.match(s) { - ch := n.Child("function_path") - if r, ok := c.fn(&ch, s); ok { - v.FunctionPath = (r) - } - } - if !n.IsRef("input_bindings") { - if len(v.InputBindings) > 0 { - cn := n.Child("input_bindings") - for i := range v.InputBindings { - { - ch := cn.Elem(i) - stringsMlInputBinding(c, &ch, &v.InputBindings[i]) - } - } - } - } -} - -func stringsMlFunctionExtraParameter(c *stringsWalk, n *Node, v *ml.FunctionExtraParameter) { - if n.isRef() { - return - } - if s := string(v.Key); c.match(s) { - ch := n.Child("key") - if r, ok := c.fn(&ch, s); ok { - v.Key = (r) - } - } - if s := string(v.Value); c.match(s) { - ch := n.Child("value") - if r, ok := c.fn(&ch, s); ok { - v.Value = (r) - } - } -} - -func stringsMlDeltaTableSource(c *stringsWalk, n *Node, v *ml.DeltaTableSource) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DataframeSchema == "" && Forced(v.ForceSendFields, "DataframeSchema") { - ch := n.Child("dataframe_schema") - c.fn(&ch, "") - } - if s := string(v.DataframeSchema); c.match(s) { - ch := n.Child("dataframe_schema") - if r, ok := c.fn(&ch, s); ok { - v.DataframeSchema = (r) - } - } - if !n.IsRef("entity_columns") { - if len(v.EntityColumns) > 0 { - cn := n.Child("entity_columns") - for i := range v.EntityColumns { - if s := string(v.EntityColumns[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.EntityColumns[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.FilterCondition == "" && Forced(v.ForceSendFields, "FilterCondition") { - ch := n.Child("filter_condition") - c.fn(&ch, "") - } - if s := string(v.FilterCondition); c.match(s) { - ch := n.Child("filter_condition") - if r, ok := c.fn(&ch, s); ok { - v.FilterCondition = (r) - } - } - if s := string(v.FullName); c.match(s) { - ch := n.Child("full_name") - if r, ok := c.fn(&ch, s); ok { - v.FullName = (r) - } - } - if c.mode == EmptyFields && v.TimeseriesColumn == "" && Forced(v.ForceSendFields, "TimeseriesColumn") { - ch := n.Child("timeseries_column") - c.fn(&ch, "") - } - if s := string(v.TimeseriesColumn); c.match(s) { - ch := n.Child("timeseries_column") - if r, ok := c.fn(&ch, s); ok { - v.TimeseriesColumn = (r) - } - } - if c.mode == EmptyFields && v.TransformationSql == "" && Forced(v.ForceSendFields, "TransformationSql") { - ch := n.Child("transformation_sql") - c.fn(&ch, "") - } - if s := string(v.TransformationSql); c.match(s) { - ch := n.Child("transformation_sql") - if r, ok := c.fn(&ch, s); ok { - v.TransformationSql = (r) - } - } -} - -func stringsMlFeatureViewSource(c *stringsWalk, n *Node, v *ml.FeatureViewSource) { - if n.isRef() { - return - } - if !n.IsRef("feature_references") { - if len(v.FeatureReferences) > 0 { - cn := n.Child("feature_references") - for i := range v.FeatureReferences { - { - ch := cn.Elem(i) - stringsMlFeatureReference(c, &ch, &v.FeatureReferences[i]) - } - } - } - } -} - -func stringsMlKafkaSource(c *stringsWalk, n *Node, v *ml.KafkaSource) { - if n.isRef() { - return - } - if !n.IsRef("entity_column_identifiers") { - if len(v.EntityColumnIdentifiers) > 0 { - cn := n.Child("entity_column_identifiers") - for i := range v.EntityColumnIdentifiers { - { - ch := cn.Elem(i) - stringsMlColumnIdentifier(c, &ch, &v.EntityColumnIdentifiers[i]) - } - } - } - } - if c.mode == EmptyFields && v.FilterCondition == "" && Forced(v.ForceSendFields, "FilterCondition") { - ch := n.Child("filter_condition") - c.fn(&ch, "") - } - if s := string(v.FilterCondition); c.match(s) { - ch := n.Child("filter_condition") - if r, ok := c.fn(&ch, s); ok { - v.FilterCondition = (r) - } - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if !n.IsRef("timeseries_column_identifier") { - if x := v.TimeseriesColumnIdentifier; x != nil { - ch := n.Child("timeseries_column_identifier") - stringsMlColumnIdentifier(c, &ch, x) - } - } -} - -func stringsMlRequestSource(c *stringsWalk, n *Node, v *ml.RequestSource) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DataframeSchema == "" && Forced(v.ForceSendFields, "DataframeSchema") { - ch := n.Child("dataframe_schema") - c.fn(&ch, "") - } - if s := string(v.DataframeSchema); c.match(s) { - ch := n.Child("dataframe_schema") - if r, ok := c.fn(&ch, s); ok { - v.DataframeSchema = (r) - } - } - if !n.IsRef("flat_schema") { - if x := v.FlatSchema; x != nil { - ch := n.Child("flat_schema") - stringsMlFlatSchema(c, &ch, x) - } - } -} - -func stringsMlSdpSource(c *stringsWalk, n *Node, v *ml.SdpSource) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DataframeSchema == "" && Forced(v.ForceSendFields, "DataframeSchema") { - ch := n.Child("dataframe_schema") - c.fn(&ch, "") - } - if s := string(v.DataframeSchema); c.match(s) { - ch := n.Child("dataframe_schema") - if r, ok := c.fn(&ch, s); ok { - v.DataframeSchema = (r) - } - } - if c.mode == EmptyFields && v.FilterCondition == "" && Forced(v.ForceSendFields, "FilterCondition") { - ch := n.Child("filter_condition") - c.fn(&ch, "") - } - if s := string(v.FilterCondition); c.match(s) { - ch := n.Child("filter_condition") - if r, ok := c.fn(&ch, s); ok { - v.FilterCondition = (r) - } - } - if !n.IsRef("input_tables") { - if len(v.InputTables) > 0 { - cn := n.Child("input_tables") - for i := range v.InputTables { - if s := string(v.InputTables[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.InputTables[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.OutputTable == "" && Forced(v.ForceSendFields, "OutputTable") { - ch := n.Child("output_table") - c.fn(&ch, "") - } - if s := string(v.OutputTable); c.match(s) { - ch := n.Child("output_table") - if r, ok := c.fn(&ch, s); ok { - v.OutputTable = (r) - } - } - if c.mode == EmptyFields && v.PipelineId == "" && Forced(v.ForceSendFields, "PipelineId") { - ch := n.Child("pipeline_id") - c.fn(&ch, "") - } - if s := string(v.PipelineId); c.match(s) { - ch := n.Child("pipeline_id") - if r, ok := c.fn(&ch, s); ok { - v.PipelineId = (r) - } - } - if c.mode == EmptyFields && v.PipelineState == "" && Forced(v.ForceSendFields, "PipelineState") { - ch := n.Child("pipeline_state") - c.fn(&ch, "") - } - if s := string(v.PipelineState); c.match(s) { - ch := n.Child("pipeline_state") - if r, ok := c.fn(&ch, s); ok { - v.PipelineState = ml.SdpSourceState(r) - } - } - if c.mode == EmptyFields && v.TransformationSql == "" && Forced(v.ForceSendFields, "TransformationSql") { - ch := n.Child("transformation_sql") - c.fn(&ch, "") - } - if s := string(v.TransformationSql); c.match(s) { - ch := n.Child("transformation_sql") - if r, ok := c.fn(&ch, s); ok { - v.TransformationSql = (r) - } - } -} - -func stringsMlStreamSource(c *stringsWalk, n *Node, v *ml.StreamSource) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DataframeSchema == "" && Forced(v.ForceSendFields, "DataframeSchema") { - ch := n.Child("dataframe_schema") - c.fn(&ch, "") - } - if s := string(v.DataframeSchema); c.match(s) { - ch := n.Child("dataframe_schema") - if r, ok := c.fn(&ch, s); ok { - v.DataframeSchema = (r) - } - } - if c.mode == EmptyFields && v.FilterCondition == "" && Forced(v.ForceSendFields, "FilterCondition") { - ch := n.Child("filter_condition") - c.fn(&ch, "") - } - if s := string(v.FilterCondition); c.match(s) { - ch := n.Child("filter_condition") - if r, ok := c.fn(&ch, s); ok { - v.FilterCondition = (r) - } - } - if s := string(v.FullName); c.match(s) { - ch := n.Child("full_name") - if r, ok := c.fn(&ch, s); ok { - v.FullName = (r) - } - } - if c.mode == EmptyFields && v.TransformationSql == "" && Forced(v.ForceSendFields, "TransformationSql") { - ch := n.Child("transformation_sql") - c.fn(&ch, "") - } - if s := string(v.TransformationSql); c.match(s) { - ch := n.Child("transformation_sql") - if r, ok := c.fn(&ch, s); ok { - v.TransformationSql = (r) - } - } -} - -func stringsMlContinuousWindow(c *stringsWalk, n *Node, v *ml.ContinuousWindow) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Offset == "" && Forced(v.ForceSendFields, "Offset") { - ch := n.Child("offset") - c.fn(&ch, "") - } - if s := string(v.Offset); c.match(s) { - ch := n.Child("offset") - if r, ok := c.fn(&ch, s); ok { - v.Offset = (r) - } - } - if s := string(v.WindowDuration); c.match(s) { - ch := n.Child("window_duration") - if r, ok := c.fn(&ch, s); ok { - v.WindowDuration = (r) - } - } -} - -func stringsMlSlidingWindow(c *stringsWalk, n *Node, v *ml.SlidingWindow) { - if n.isRef() { - return - } - if s := string(v.SlideDuration); c.match(s) { - ch := n.Child("slide_duration") - if r, ok := c.fn(&ch, s); ok { - v.SlideDuration = (r) - } - } - if c.mode == EmptyFields && v.WindowDuration == "" && Forced(v.ForceSendFields, "WindowDuration") { - ch := n.Child("window_duration") - c.fn(&ch, "") - } - if s := string(v.WindowDuration); c.match(s) { - ch := n.Child("window_duration") - if r, ok := c.fn(&ch, s); ok { - v.WindowDuration = (r) - } - } -} - -func stringsMlTumblingWindow(c *stringsWalk, n *Node, v *ml.TumblingWindow) { - if n.isRef() { - return - } - if s := string(v.WindowDuration); c.match(s) { - ch := n.Child("window_duration") - if r, ok := c.fn(&ch, s); ok { - v.WindowDuration = (r) - } - } -} - -func stringsMlUcTraceLocation(c *stringsWalk, n *Node, v *ml.UcTraceLocation) { - if n.isRef() { - return - } - if s := string(v.Catalog); c.match(s) { - ch := n.Child("catalog") - if r, ok := c.fn(&ch, s); ok { - v.Catalog = (r) - } - } - if c.mode == EmptyFields && v.EffectiveTablePrefix == "" && Forced(v.ForceSendFields, "EffectiveTablePrefix") { - ch := n.Child("effective_table_prefix") - c.fn(&ch, "") - } - if s := string(v.EffectiveTablePrefix); c.match(s) { - ch := n.Child("effective_table_prefix") - if r, ok := c.fn(&ch, s); ok { - v.EffectiveTablePrefix = (r) - } - } - if s := string(v.Schema); c.match(s) { - ch := n.Child("schema") - if r, ok := c.fn(&ch, s); ok { - v.Schema = (r) - } - } - if c.mode == EmptyFields && v.TablePrefix == "" && Forced(v.ForceSendFields, "TablePrefix") { - ch := n.Child("table_prefix") - c.fn(&ch, "") - } - if s := string(v.TablePrefix); c.match(s) { - ch := n.Child("table_prefix") - if r, ok := c.fn(&ch, s); ok { - v.TablePrefix = (r) - } - } -} - -func stringsServingAiGatewayGuardrails(c *stringsWalk, n *Node, v *serving.AiGatewayGuardrails) { - if n.isRef() { - return - } - if !n.IsRef("input") { - if x := v.Input; x != nil { - ch := n.Child("input") - stringsServingAiGatewayGuardrailParameters(c, &ch, x) - } - } - if !n.IsRef("output") { - if x := v.Output; x != nil { - ch := n.Child("output") - stringsServingAiGatewayGuardrailParameters(c, &ch, x) - } - } -} - -func stringsServingAiGatewayInferenceTableConfig(c *stringsWalk, n *Node, v *serving.AiGatewayInferenceTableConfig) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.CatalogName == "" && Forced(v.ForceSendFields, "CatalogName") { - ch := n.Child("catalog_name") - c.fn(&ch, "") - } - if s := string(v.CatalogName); c.match(s) { - ch := n.Child("catalog_name") - if r, ok := c.fn(&ch, s); ok { - v.CatalogName = (r) - } - } - if c.mode == EmptyFields && v.SchemaName == "" && Forced(v.ForceSendFields, "SchemaName") { - ch := n.Child("schema_name") - c.fn(&ch, "") - } - if s := string(v.SchemaName); c.match(s) { - ch := n.Child("schema_name") - if r, ok := c.fn(&ch, s); ok { - v.SchemaName = (r) - } - } - if c.mode == EmptyFields && v.TableNamePrefix == "" && Forced(v.ForceSendFields, "TableNamePrefix") { - ch := n.Child("table_name_prefix") - c.fn(&ch, "") - } - if s := string(v.TableNamePrefix); c.match(s) { - ch := n.Child("table_name_prefix") - if r, ok := c.fn(&ch, s); ok { - v.TableNamePrefix = (r) - } - } -} - -func stringsServingAiGatewayRateLimit(c *stringsWalk, n *Node, v *serving.AiGatewayRateLimit) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Key == "" && Forced(v.ForceSendFields, "Key") { - ch := n.Child("key") - c.fn(&ch, "") - } - if s := string(v.Key); c.match(s) { - ch := n.Child("key") - if r, ok := c.fn(&ch, s); ok { - v.Key = serving.AiGatewayRateLimitKey(r) - } - } - if c.mode == EmptyFields && v.Principal == "" && Forced(v.ForceSendFields, "Principal") { - ch := n.Child("principal") - c.fn(&ch, "") - } - if s := string(v.Principal); c.match(s) { - ch := n.Child("principal") - if r, ok := c.fn(&ch, s); ok { - v.Principal = (r) - } - } - if s := string(v.RenewalPeriod); c.match(s) { - ch := n.Child("renewal_period") - if r, ok := c.fn(&ch, s); ok { - v.RenewalPeriod = serving.AiGatewayRateLimitRenewalPeriod(r) - } - } -} - -func stringsServingAutoCaptureConfigInput(c *stringsWalk, n *Node, v *serving.AutoCaptureConfigInput) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.CatalogName == "" && Forced(v.ForceSendFields, "CatalogName") { - ch := n.Child("catalog_name") - c.fn(&ch, "") - } - if s := string(v.CatalogName); c.match(s) { - ch := n.Child("catalog_name") - if r, ok := c.fn(&ch, s); ok { - v.CatalogName = (r) - } - } - if c.mode == EmptyFields && v.SchemaName == "" && Forced(v.ForceSendFields, "SchemaName") { - ch := n.Child("schema_name") - c.fn(&ch, "") - } - if s := string(v.SchemaName); c.match(s) { - ch := n.Child("schema_name") - if r, ok := c.fn(&ch, s); ok { - v.SchemaName = (r) - } - } - if c.mode == EmptyFields && v.TableNamePrefix == "" && Forced(v.ForceSendFields, "TableNamePrefix") { - ch := n.Child("table_name_prefix") - c.fn(&ch, "") - } - if s := string(v.TableNamePrefix); c.match(s) { - ch := n.Child("table_name_prefix") - if r, ok := c.fn(&ch, s); ok { - v.TableNamePrefix = (r) - } - } -} - -func stringsServingServedEntityInput(c *stringsWalk, n *Node, v *serving.ServedEntityInput) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.EntityName == "" && Forced(v.ForceSendFields, "EntityName") { - ch := n.Child("entity_name") - c.fn(&ch, "") - } - if s := string(v.EntityName); c.match(s) { - ch := n.Child("entity_name") - if r, ok := c.fn(&ch, s); ok { - v.EntityName = (r) - } - } - if c.mode == EmptyFields && v.EntityVersion == "" && Forced(v.ForceSendFields, "EntityVersion") { - ch := n.Child("entity_version") - c.fn(&ch, "") - } - if s := string(v.EntityVersion); c.match(s) { - ch := n.Child("entity_version") - if r, ok := c.fn(&ch, s); ok { - v.EntityVersion = (r) - } - } - if !n.IsRef("environment_vars") { - if len(v.EnvironmentVars) > 0 { - cn := n.Child("environment_vars") - for _, k := range sortedKeys(v.EnvironmentVars) { - if s := string(v.EnvironmentVars[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.EnvironmentVars[k] = (r) - } - } - } - } - } - if !n.IsRef("external_model") { - if x := v.ExternalModel; x != nil { - ch := n.Child("external_model") - stringsServingExternalModel(c, &ch, x) - } - } - if c.mode == EmptyFields && v.InstanceProfileArn == "" && Forced(v.ForceSendFields, "InstanceProfileArn") { - ch := n.Child("instance_profile_arn") - c.fn(&ch, "") - } - if s := string(v.InstanceProfileArn); c.match(s) { - ch := n.Child("instance_profile_arn") - if r, ok := c.fn(&ch, s); ok { - v.InstanceProfileArn = (r) - } - } - if c.mode == EmptyFields && v.Name == "" && Forced(v.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if c.mode == EmptyFields && v.WorkloadSize == "" && Forced(v.ForceSendFields, "WorkloadSize") { - ch := n.Child("workload_size") - c.fn(&ch, "") - } - if s := string(v.WorkloadSize); c.match(s) { - ch := n.Child("workload_size") - if r, ok := c.fn(&ch, s); ok { - v.WorkloadSize = (r) - } - } - if c.mode == EmptyFields && v.WorkloadType == "" && Forced(v.ForceSendFields, "WorkloadType") { - ch := n.Child("workload_type") - c.fn(&ch, "") - } - if s := string(v.WorkloadType); c.match(s) { - ch := n.Child("workload_type") - if r, ok := c.fn(&ch, s); ok { - v.WorkloadType = serving.ServingModelWorkloadType(r) - } - } -} - -func stringsServingServedModelInput(c *stringsWalk, n *Node, v *serving.ServedModelInput) { - if n.isRef() { - return - } - if !n.IsRef("environment_vars") { - if len(v.EnvironmentVars) > 0 { - cn := n.Child("environment_vars") - for _, k := range sortedKeys(v.EnvironmentVars) { - if s := string(v.EnvironmentVars[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.EnvironmentVars[k] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.InstanceProfileArn == "" && Forced(v.ForceSendFields, "InstanceProfileArn") { - ch := n.Child("instance_profile_arn") - c.fn(&ch, "") - } - if s := string(v.InstanceProfileArn); c.match(s) { - ch := n.Child("instance_profile_arn") - if r, ok := c.fn(&ch, s); ok { - v.InstanceProfileArn = (r) - } - } - if s := string(v.ModelName); c.match(s) { - ch := n.Child("model_name") - if r, ok := c.fn(&ch, s); ok { - v.ModelName = (r) - } - } - if s := string(v.ModelVersion); c.match(s) { - ch := n.Child("model_version") - if r, ok := c.fn(&ch, s); ok { - v.ModelVersion = (r) - } - } - if c.mode == EmptyFields && v.Name == "" && Forced(v.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if c.mode == EmptyFields && v.WorkloadSize == "" && Forced(v.ForceSendFields, "WorkloadSize") { - ch := n.Child("workload_size") - c.fn(&ch, "") - } - if s := string(v.WorkloadSize); c.match(s) { - ch := n.Child("workload_size") - if r, ok := c.fn(&ch, s); ok { - v.WorkloadSize = (r) - } - } - if c.mode == EmptyFields && v.WorkloadType == "" && Forced(v.ForceSendFields, "WorkloadType") { - ch := n.Child("workload_type") - c.fn(&ch, "") - } - if s := string(v.WorkloadType); c.match(s) { - ch := n.Child("workload_type") - if r, ok := c.fn(&ch, s); ok { - v.WorkloadType = serving.ServedModelInputWorkloadType(r) - } - } -} - -func stringsServingTrafficConfig(c *stringsWalk, n *Node, v *serving.TrafficConfig) { - if n.isRef() { - return - } - if !n.IsRef("routes") { - if len(v.Routes) > 0 { - cn := n.Child("routes") - for i := range v.Routes { - { - ch := cn.Elem(i) - stringsServingRoute(c, &ch, &v.Routes[i]) - } - } - } - } -} - -func stringsServingTelemetryInferenceTableConfig(c *stringsWalk, n *Node, v *serving.TelemetryInferenceTableConfig) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Name == "" && Forced(v.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } -} - -func stringsServingUnityCatalogTableNames(c *stringsWalk, n *Node, v *serving.UnityCatalogTableNames) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.AnnotationsTable == "" && Forced(v.ForceSendFields, "AnnotationsTable") { - ch := n.Child("annotations_table") - c.fn(&ch, "") - } - if s := string(v.AnnotationsTable); c.match(s) { - ch := n.Child("annotations_table") - if r, ok := c.fn(&ch, s); ok { - v.AnnotationsTable = (r) - } - } - if c.mode == EmptyFields && v.LogsTable == "" && Forced(v.ForceSendFields, "LogsTable") { - ch := n.Child("logs_table") - c.fn(&ch, "") - } - if s := string(v.LogsTable); c.match(s) { - ch := n.Child("logs_table") - if r, ok := c.fn(&ch, s); ok { - v.LogsTable = (r) - } - } - if c.mode == EmptyFields && v.MetricsTable == "" && Forced(v.ForceSendFields, "MetricsTable") { - ch := n.Child("metrics_table") - c.fn(&ch, "") - } - if s := string(v.MetricsTable); c.match(s) { - ch := n.Child("metrics_table") - if r, ok := c.fn(&ch, s); ok { - v.MetricsTable = (r) - } - } - if c.mode == EmptyFields && v.TracesTable == "" && Forced(v.ForceSendFields, "TracesTable") { - ch := n.Child("traces_table") - c.fn(&ch, "") - } - if s := string(v.TracesTable); c.match(s) { - ch := n.Child("traces_table") - if r, ok := c.fn(&ch, s); ok { - v.TracesTable = (r) - } - } -} - -func stringsCatalogInferenceTableConfig(c *stringsWalk, n *Node, v *catalog.InferenceTableConfig) { - if n.isRef() { - return - } - if s := string(v.Parent); c.match(s) { - ch := n.Child("parent") - if r, ok := c.fn(&ch, s); ok { - v.Parent = (r) - } - } - if c.mode == EmptyFields && v.Table == "" && Forced(v.ForceSendFields, "Table") { - ch := n.Child("table") - c.fn(&ch, "") - } - if s := string(v.Table); c.match(s) { - ch := n.Child("table") - if r, ok := c.fn(&ch, s); ok { - v.Table = (r) - } - } - if c.mode == EmptyFields && v.TableNamePrefix == "" && Forced(v.ForceSendFields, "TableNamePrefix") { - ch := n.Child("table_name_prefix") - c.fn(&ch, "") - } - if s := string(v.TableNamePrefix); c.match(s) { - ch := n.Child("table_name_prefix") - if r, ok := c.fn(&ch, s); ok { - v.TableNamePrefix = (r) - } - } -} - -func stringsCatalogRateLimit(c *stringsWalk, n *Node, v *catalog.RateLimit) { - if n.isRef() { - return - } - if s := string(v.Key); c.match(s) { - ch := n.Child("key") - if r, ok := c.fn(&ch, s); ok { - v.Key = catalog.RateLimitRateLimitKey(r) - } - } - if c.mode == EmptyFields && v.Principal == "" && Forced(v.ForceSendFields, "Principal") { - ch := n.Child("principal") - c.fn(&ch, "") - } - if s := string(v.Principal); c.match(s) { - ch := n.Child("principal") - if r, ok := c.fn(&ch, s); ok { - v.Principal = (r) - } - } - if s := string(v.RenewalPeriod); c.match(s) { - ch := n.Child("renewal_period") - if r, ok := c.fn(&ch, s); ok { - v.RenewalPeriod = catalog.RateLimitRateLimitRenewalPeriod(r) - } - } -} - -func stringsCatalogModelServiceConfigRoutingConfig(c *stringsWalk, n *Node, v *catalog.ModelServiceConfigRoutingConfig) { - if n.isRef() { - return - } - if !n.IsRef("destinations") { - if len(v.Destinations) > 0 { - cn := n.Child("destinations") - for i := range v.Destinations { - { - ch := cn.Elem(i) - stringsCatalogModelServiceConfigDestinationConfig(c, &ch, &v.Destinations[i]) - } - } - } - } - if !n.IsRef("fallback") { - if x := v.Fallback; x != nil { - ch := n.Child("fallback") - stringsCatalogModelServiceConfigFallbackConfig(c, &ch, x) - } - } -} - -func stringsCatalogMcpServiceConfigSourceConnection(c *stringsWalk, n *Node, v *catalog.McpServiceConfigSourceConnection) { - if n.isRef() { - return - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if !n.IsRef("options") { - if len(v.Options) > 0 { - cn := n.Child("options") - for _, k := range sortedKeys(v.Options) { - if s := string(v.Options[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.Options[k] = (r) - } - } - } - } - } -} - -func stringsCatalogModelProviderServiceConfigAmazonBedrockProviderConfig(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigAmazonBedrockProviderConfig) { - if n.isRef() { - return - } - if !n.IsRef("direct") { - if x := v.Direct; x != nil { - ch := n.Child("direct") - stringsCatalogModelProviderServiceConfigAmazonBedrockProviderDirectConfig(c, &ch, x) - } - } -} - -func stringsCatalogModelProviderServiceConfigAnthropicProviderConfig(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigAnthropicProviderConfig) { - if n.isRef() { - return - } - if !n.IsRef("direct") { - if x := v.Direct; x != nil { - ch := n.Child("direct") - stringsCatalogModelProviderServiceConfigAnthropicProviderDirectConfig(c, &ch, x) - } - } -} - -func stringsCatalogModelProviderServiceConfigAzureOpenAiProviderConfig(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigAzureOpenAiProviderConfig) { - if n.isRef() { - return - } - if !n.IsRef("direct") { - if x := v.Direct; x != nil { - ch := n.Child("direct") - stringsCatalogModelProviderServiceConfigAzureOpenAiProviderDirectConfig(c, &ch, x) - } - } -} - -func stringsCatalogModelProviderServiceConfigCustomProviderConfig(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigCustomProviderConfig) { - if n.isRef() { - return - } - if !n.IsRef("direct") { - if x := v.Direct; x != nil { - ch := n.Child("direct") - stringsCatalogModelProviderServiceConfigCustomProviderDirectConfig(c, &ch, x) - } - } -} - -func stringsCatalogModelProviderServiceConfigGeminiEnterpriseProviderConfig(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigGeminiEnterpriseProviderConfig) { - if n.isRef() { - return - } - if !n.IsRef("direct") { - if x := v.Direct; x != nil { - ch := n.Child("direct") - stringsCatalogModelProviderServiceConfigGeminiEnterpriseProviderDirectConfig(c, &ch, x) - } - } -} - -func stringsCatalogModelProviderServiceConfigMicrosoftFoundryProviderConfig(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigMicrosoftFoundryProviderConfig) { - if n.isRef() { - return - } - if !n.IsRef("direct") { - if x := v.Direct; x != nil { - ch := n.Child("direct") - stringsCatalogModelProviderServiceConfigMicrosoftFoundryProviderDirectConfig(c, &ch, x) - } - } -} - -func stringsCatalogModelProviderServiceConfigOpenAiProviderConfig(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigOpenAiProviderConfig) { - if n.isRef() { - return - } - if !n.IsRef("direct") { - if x := v.Direct; x != nil { - ch := n.Child("direct") - stringsCatalogModelProviderServiceConfigOpenAiProviderDirectConfig(c, &ch, x) - } - } -} - -func stringsCatalogModelProviderServiceConfigModelTargetConfig(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigModelTargetConfig) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.EndpointRoute == "" && Forced(v.ForceSendFields, "EndpointRoute") { - ch := n.Child("endpoint_route") - c.fn(&ch, "") - } - if s := string(v.EndpointRoute); c.match(s) { - ch := n.Child("endpoint_route") - if r, ok := c.fn(&ch, s); ok { - v.EndpointRoute = (r) - } - } - if s := string(v.Model); c.match(s) { - ch := n.Child("model") - if r, ok := c.fn(&ch, s); ok { - v.Model = (r) - } - } - if !n.IsRef("native_api_types") { - if len(v.NativeApiTypes) > 0 { - cn := n.Child("native_api_types") - for i := range v.NativeApiTypes { - if s := string(v.NativeApiTypes[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.NativeApiTypes[i] = (r) - } - } - } - } - } -} - -func stringsCatalogMonitorDestination(c *stringsWalk, n *Node, v *catalog.MonitorDestination) { - if n.isRef() { - return - } - if !n.IsRef("email_addresses") { - if len(v.EmailAddresses) > 0 { - cn := n.Child("email_addresses") - for i := range v.EmailAddresses { - if s := string(v.EmailAddresses[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.EmailAddresses[i] = (r) - } - } - } - } - } -} - -func stringsCatalogAzureEncryptionSettings(c *stringsWalk, n *Node, v *catalog.AzureEncryptionSettings) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.AzureCmkAccessConnectorId == "" && Forced(v.ForceSendFields, "AzureCmkAccessConnectorId") { - ch := n.Child("azure_cmk_access_connector_id") - c.fn(&ch, "") - } - if s := string(v.AzureCmkAccessConnectorId); c.match(s) { - ch := n.Child("azure_cmk_access_connector_id") - if r, ok := c.fn(&ch, s); ok { - v.AzureCmkAccessConnectorId = (r) - } - } - if c.mode == EmptyFields && v.AzureCmkManagedIdentityId == "" && Forced(v.ForceSendFields, "AzureCmkManagedIdentityId") { - ch := n.Child("azure_cmk_managed_identity_id") - c.fn(&ch, "") - } - if s := string(v.AzureCmkManagedIdentityId); c.match(s) { - ch := n.Child("azure_cmk_managed_identity_id") - if r, ok := c.fn(&ch, s); ok { - v.AzureCmkManagedIdentityId = (r) - } - } - if s := string(v.AzureTenantId); c.match(s) { - ch := n.Child("azure_tenant_id") - if r, ok := c.fn(&ch, s); ok { - v.AzureTenantId = (r) - } - } -} - -func stringsCatalogAzureQueueStorage(c *stringsWalk, n *Node, v *catalog.AzureQueueStorage) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ManagedResourceId == "" && Forced(v.ForceSendFields, "ManagedResourceId") { - ch := n.Child("managed_resource_id") - c.fn(&ch, "") - } - if s := string(v.ManagedResourceId); c.match(s) { - ch := n.Child("managed_resource_id") - if r, ok := c.fn(&ch, s); ok { - v.ManagedResourceId = (r) - } - } - if c.mode == EmptyFields && v.QueueUrl == "" && Forced(v.ForceSendFields, "QueueUrl") { - ch := n.Child("queue_url") - c.fn(&ch, "") - } - if s := string(v.QueueUrl); c.match(s) { - ch := n.Child("queue_url") - if r, ok := c.fn(&ch, s); ok { - v.QueueUrl = (r) - } - } - if c.mode == EmptyFields && v.ResourceGroup == "" && Forced(v.ForceSendFields, "ResourceGroup") { - ch := n.Child("resource_group") - c.fn(&ch, "") - } - if s := string(v.ResourceGroup); c.match(s) { - ch := n.Child("resource_group") - if r, ok := c.fn(&ch, s); ok { - v.ResourceGroup = (r) - } - } - if c.mode == EmptyFields && v.SubscriptionId == "" && Forced(v.ForceSendFields, "SubscriptionId") { - ch := n.Child("subscription_id") - c.fn(&ch, "") - } - if s := string(v.SubscriptionId); c.match(s) { - ch := n.Child("subscription_id") - if r, ok := c.fn(&ch, s); ok { - v.SubscriptionId = (r) - } - } -} - -func stringsCatalogGcpPubsub(c *stringsWalk, n *Node, v *catalog.GcpPubsub) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ManagedResourceId == "" && Forced(v.ForceSendFields, "ManagedResourceId") { - ch := n.Child("managed_resource_id") - c.fn(&ch, "") - } - if s := string(v.ManagedResourceId); c.match(s) { - ch := n.Child("managed_resource_id") - if r, ok := c.fn(&ch, s); ok { - v.ManagedResourceId = (r) - } - } - if c.mode == EmptyFields && v.SubscriptionName == "" && Forced(v.ForceSendFields, "SubscriptionName") { - ch := n.Child("subscription_name") - c.fn(&ch, "") - } - if s := string(v.SubscriptionName); c.match(s) { - ch := n.Child("subscription_name") - if r, ok := c.fn(&ch, s); ok { - v.SubscriptionName = (r) - } - } -} - -func stringsCatalogAwsSqsQueue(c *stringsWalk, n *Node, v *catalog.AwsSqsQueue) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ManagedResourceId == "" && Forced(v.ForceSendFields, "ManagedResourceId") { - ch := n.Child("managed_resource_id") - c.fn(&ch, "") - } - if s := string(v.ManagedResourceId); c.match(s) { - ch := n.Child("managed_resource_id") - if r, ok := c.fn(&ch, s); ok { - v.ManagedResourceId = (r) - } - } - if c.mode == EmptyFields && v.QueueUrl == "" && Forced(v.ForceSendFields, "QueueUrl") { - ch := n.Child("queue_url") - c.fn(&ch, "") - } - if s := string(v.QueueUrl); c.match(s) { - ch := n.Child("queue_url") - if r, ok := c.fn(&ch, s); ok { - v.QueueUrl = (r) - } - } -} - -func stringsCatalogSseEncryptionDetails(c *stringsWalk, n *Node, v *catalog.SseEncryptionDetails) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Algorithm == "" && Forced(v.ForceSendFields, "Algorithm") { - ch := n.Child("algorithm") - c.fn(&ch, "") - } - if s := string(v.Algorithm); c.match(s) { - ch := n.Child("algorithm") - if r, ok := c.fn(&ch, s); ok { - v.Algorithm = catalog.SseEncryptionDetailsAlgorithm(r) - } - } - if c.mode == EmptyFields && v.AwsKmsKeyArn == "" && Forced(v.ForceSendFields, "AwsKmsKeyArn") { - ch := n.Child("aws_kms_key_arn") - c.fn(&ch, "") - } - if s := string(v.AwsKmsKeyArn); c.match(s) { - ch := n.Child("aws_kms_key_arn") - if r, ok := c.fn(&ch, s); ok { - v.AwsKmsKeyArn = (r) - } - } -} - -func stringsComputeRCranLibrary(c *stringsWalk, n *Node, v *compute.RCranLibrary) { - if n.isRef() { - return - } - if s := string(v.Package); c.match(s) { - ch := n.Child("package") - if r, ok := c.fn(&ch, s); ok { - v.Package = (r) - } - } - if c.mode == EmptyFields && v.Repo == "" && Forced(v.ForceSendFields, "Repo") { - ch := n.Child("repo") - c.fn(&ch, "") - } - if s := string(v.Repo); c.match(s) { - ch := n.Child("repo") - if r, ok := c.fn(&ch, s); ok { - v.Repo = (r) - } - } -} - -func stringsComputePythonPyPiLibrary(c *stringsWalk, n *Node, v *compute.PythonPyPiLibrary) { - if n.isRef() { - return - } - if s := string(v.Package); c.match(s) { - ch := n.Child("package") - if r, ok := c.fn(&ch, s); ok { - v.Package = (r) - } - } - if c.mode == EmptyFields && v.Repo == "" && Forced(v.ForceSendFields, "Repo") { - ch := n.Child("repo") - c.fn(&ch, "") - } - if s := string(v.Repo); c.match(s) { - ch := n.Child("repo") - if r, ok := c.fn(&ch, s); ok { - v.Repo = (r) - } - } -} - -func stringsComputeLogAnalyticsInfo(c *stringsWalk, n *Node, v *compute.LogAnalyticsInfo) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.LogAnalyticsPrimaryKey == "" && Forced(v.ForceSendFields, "LogAnalyticsPrimaryKey") { - ch := n.Child("log_analytics_primary_key") - c.fn(&ch, "") - } - if s := string(v.LogAnalyticsPrimaryKey); c.match(s) { - ch := n.Child("log_analytics_primary_key") - if r, ok := c.fn(&ch, s); ok { - v.LogAnalyticsPrimaryKey = (r) - } - } - if c.mode == EmptyFields && v.LogAnalyticsWorkspaceId == "" && Forced(v.ForceSendFields, "LogAnalyticsWorkspaceId") { - ch := n.Child("log_analytics_workspace_id") - c.fn(&ch, "") - } - if s := string(v.LogAnalyticsWorkspaceId); c.match(s) { - ch := n.Child("log_analytics_workspace_id") - if r, ok := c.fn(&ch, s); ok { - v.LogAnalyticsWorkspaceId = (r) - } - } -} - -func stringsComputeDbfsStorageInfo(c *stringsWalk, n *Node, v *compute.DbfsStorageInfo) { - if n.isRef() { - return - } - if s := string(v.Destination); c.match(s) { - ch := n.Child("destination") - if r, ok := c.fn(&ch, s); ok { - v.Destination = (r) - } - } -} - -func stringsComputeS3StorageInfo(c *stringsWalk, n *Node, v *compute.S3StorageInfo) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.CannedAcl == "" && Forced(v.ForceSendFields, "CannedAcl") { - ch := n.Child("canned_acl") - c.fn(&ch, "") - } - if s := string(v.CannedAcl); c.match(s) { - ch := n.Child("canned_acl") - if r, ok := c.fn(&ch, s); ok { - v.CannedAcl = (r) - } - } - if s := string(v.Destination); c.match(s) { - ch := n.Child("destination") - if r, ok := c.fn(&ch, s); ok { - v.Destination = (r) - } - } - if c.mode == EmptyFields && v.EncryptionType == "" && Forced(v.ForceSendFields, "EncryptionType") { - ch := n.Child("encryption_type") - c.fn(&ch, "") - } - if s := string(v.EncryptionType); c.match(s) { - ch := n.Child("encryption_type") - if r, ok := c.fn(&ch, s); ok { - v.EncryptionType = (r) - } - } - if c.mode == EmptyFields && v.Endpoint == "" && Forced(v.ForceSendFields, "Endpoint") { - ch := n.Child("endpoint") - c.fn(&ch, "") - } - if s := string(v.Endpoint); c.match(s) { - ch := n.Child("endpoint") - if r, ok := c.fn(&ch, s); ok { - v.Endpoint = (r) - } - } - if c.mode == EmptyFields && v.KmsKey == "" && Forced(v.ForceSendFields, "KmsKey") { - ch := n.Child("kms_key") - c.fn(&ch, "") - } - if s := string(v.KmsKey); c.match(s) { - ch := n.Child("kms_key") - if r, ok := c.fn(&ch, s); ok { - v.KmsKey = (r) - } - } - if c.mode == EmptyFields && v.Region == "" && Forced(v.ForceSendFields, "Region") { - ch := n.Child("region") - c.fn(&ch, "") - } - if s := string(v.Region); c.match(s) { - ch := n.Child("region") - if r, ok := c.fn(&ch, s); ok { - v.Region = (r) - } - } -} - -func stringsComputeVolumesStorageInfo(c *stringsWalk, n *Node, v *compute.VolumesStorageInfo) { - if n.isRef() { - return - } - if s := string(v.Destination); c.match(s) { - ch := n.Child("destination") - if r, ok := c.fn(&ch, s); ok { - v.Destination = (r) - } - } -} - -func stringsComputeDockerBasicAuth(c *stringsWalk, n *Node, v *compute.DockerBasicAuth) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Password == "" && Forced(v.ForceSendFields, "Password") { - ch := n.Child("password") - c.fn(&ch, "") - } - if s := string(v.Password); c.match(s) { - ch := n.Child("password") - if r, ok := c.fn(&ch, s); ok { - v.Password = (r) - } - } - if c.mode == EmptyFields && v.Username == "" && Forced(v.ForceSendFields, "Username") { - ch := n.Child("username") - c.fn(&ch, "") - } - if s := string(v.Username); c.match(s) { - ch := n.Child("username") - if r, ok := c.fn(&ch, s); ok { - v.Username = (r) - } - } -} - -func stringsComputeAdlsgen2Info(c *stringsWalk, n *Node, v *compute.Adlsgen2Info) { - if n.isRef() { - return - } - if s := string(v.Destination); c.match(s) { - ch := n.Child("destination") - if r, ok := c.fn(&ch, s); ok { - v.Destination = (r) - } - } -} - -func stringsComputeLocalFileInfo(c *stringsWalk, n *Node, v *compute.LocalFileInfo) { - if n.isRef() { - return - } - if s := string(v.Destination); c.match(s) { - ch := n.Child("destination") - if r, ok := c.fn(&ch, s); ok { - v.Destination = (r) - } - } -} - -func stringsComputeGcsStorageInfo(c *stringsWalk, n *Node, v *compute.GcsStorageInfo) { - if n.isRef() { - return - } - if s := string(v.Destination); c.match(s) { - ch := n.Child("destination") - if r, ok := c.fn(&ch, s); ok { - v.Destination = (r) - } - } -} - -func stringsComputeWorkspaceStorageInfo(c *stringsWalk, n *Node, v *compute.WorkspaceStorageInfo) { - if n.isRef() { - return - } - if s := string(v.Destination); c.match(s) { - ch := n.Child("destination") - if r, ok := c.fn(&ch, s); ok { - v.Destination = (r) - } - } -} - -func stringsResourcesAppEnvVar(c *stringsWalk, n *Node, v *resources.AppEnvVar) { - if n.isRef() { - return - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if s := string(v.Value); c.match(s) { - ch := n.Child("value") - if r, ok := c.fn(&ch, s); ok { - v.Value = (r) - } - } - if s := string(v.ValueFrom); c.match(s) { - ch := n.Child("value_from") - if r, ok := c.fn(&ch, s); ok { - v.ValueFrom = (r) - } - } -} - -func stringsAppsAppDeploymentArtifacts(c *stringsWalk, n *Node, v *apps.AppDeploymentArtifacts) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.SourceCodePath == "" && Forced(v.ForceSendFields, "SourceCodePath") { - ch := n.Child("source_code_path") - c.fn(&ch, "") - } - if s := string(v.SourceCodePath); c.match(s) { - ch := n.Child("source_code_path") - if r, ok := c.fn(&ch, s); ok { - v.SourceCodePath = (r) - } - } -} - -func stringsAppsEnvVar(c *stringsWalk, n *Node, v *apps.EnvVar) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Name == "" && Forced(v.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if c.mode == EmptyFields && v.Value == "" && Forced(v.ForceSendFields, "Value") { - ch := n.Child("value") - c.fn(&ch, "") - } - if s := string(v.Value); c.match(s) { - ch := n.Child("value") - if r, ok := c.fn(&ch, s); ok { - v.Value = (r) - } - } - if c.mode == EmptyFields && v.ValueFrom == "" && Forced(v.ForceSendFields, "ValueFrom") { - ch := n.Child("value_from") - c.fn(&ch, "") - } - if s := string(v.ValueFrom); c.match(s) { - ch := n.Child("value_from") - if r, ok := c.fn(&ch, s); ok { - v.ValueFrom = (r) - } - } -} - -func stringsAppsAppHealthCheck(c *stringsWalk, n *Node, v *apps.AppHealthCheck) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Path == "" && Forced(v.ForceSendFields, "Path") { - ch := n.Child("path") - c.fn(&ch, "") - } - if s := string(v.Path); c.match(s) { - ch := n.Child("path") - if r, ok := c.fn(&ch, s); ok { - v.Path = (r) - } - } -} - -func stringsAppsAppDeploymentStatus(c *stringsWalk, n *Node, v *apps.AppDeploymentStatus) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Message == "" && Forced(v.ForceSendFields, "Message") { - ch := n.Child("message") - c.fn(&ch, "") - } - if s := string(v.Message); c.match(s) { - ch := n.Child("message") - if r, ok := c.fn(&ch, s); ok { - v.Message = (r) - } - } - if c.mode == EmptyFields && v.State == "" && Forced(v.ForceSendFields, "State") { - ch := n.Child("state") - c.fn(&ch, "") - } - if s := string(v.State); c.match(s) { - ch := n.Child("state") - if r, ok := c.fn(&ch, s); ok { - v.State = apps.AppDeploymentState(r) - } - } -} - -func stringsAppsAppResourceApp(c *stringsWalk, n *Node, v *apps.AppResourceApp) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Name == "" && Forced(v.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if c.mode == EmptyFields && v.Permission == "" && Forced(v.ForceSendFields, "Permission") { - ch := n.Child("permission") - c.fn(&ch, "") - } - if s := string(v.Permission); c.match(s) { - ch := n.Child("permission") - if r, ok := c.fn(&ch, s); ok { - v.Permission = apps.AppResourceAppAppPermission(r) - } - } -} - -func stringsAppsAppResourceDatabase(c *stringsWalk, n *Node, v *apps.AppResourceDatabase) { - if n.isRef() { - return - } - if s := string(v.DatabaseName); c.match(s) { - ch := n.Child("database_name") - if r, ok := c.fn(&ch, s); ok { - v.DatabaseName = (r) - } - } - if s := string(v.InstanceName); c.match(s) { - ch := n.Child("instance_name") - if r, ok := c.fn(&ch, s); ok { - v.InstanceName = (r) - } - } - if s := string(v.Permission); c.match(s) { - ch := n.Child("permission") - if r, ok := c.fn(&ch, s); ok { - v.Permission = apps.AppResourceDatabaseDatabasePermission(r) - } - } -} - -func stringsAppsAppResourceExperiment(c *stringsWalk, n *Node, v *apps.AppResourceExperiment) { - if n.isRef() { - return - } - if s := string(v.ExperimentId); c.match(s) { - ch := n.Child("experiment_id") - if r, ok := c.fn(&ch, s); ok { - v.ExperimentId = (r) - } - } - if s := string(v.Permission); c.match(s) { - ch := n.Child("permission") - if r, ok := c.fn(&ch, s); ok { - v.Permission = apps.AppResourceExperimentExperimentPermission(r) - } - } -} - -func stringsAppsAppResourceGenieSpace(c *stringsWalk, n *Node, v *apps.AppResourceGenieSpace) { - if n.isRef() { - return - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if s := string(v.Permission); c.match(s) { - ch := n.Child("permission") - if r, ok := c.fn(&ch, s); ok { - v.Permission = apps.AppResourceGenieSpaceGenieSpacePermission(r) - } - } - if s := string(v.SpaceId); c.match(s) { - ch := n.Child("space_id") - if r, ok := c.fn(&ch, s); ok { - v.SpaceId = (r) - } - } -} - -func stringsAppsAppResourceJob(c *stringsWalk, n *Node, v *apps.AppResourceJob) { - if n.isRef() { - return - } - if s := string(v.Id); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.Id = (r) - } - } - if s := string(v.Permission); c.match(s) { - ch := n.Child("permission") - if r, ok := c.fn(&ch, s); ok { - v.Permission = apps.AppResourceJobJobPermission(r) - } - } -} - -func stringsAppsAppResourcePostgres(c *stringsWalk, n *Node, v *apps.AppResourcePostgres) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Branch == "" && Forced(v.ForceSendFields, "Branch") { - ch := n.Child("branch") - c.fn(&ch, "") - } - if s := string(v.Branch); c.match(s) { - ch := n.Child("branch") - if r, ok := c.fn(&ch, s); ok { - v.Branch = (r) - } - } - if c.mode == EmptyFields && v.Database == "" && Forced(v.ForceSendFields, "Database") { - ch := n.Child("database") - c.fn(&ch, "") - } - if s := string(v.Database); c.match(s) { - ch := n.Child("database") - if r, ok := c.fn(&ch, s); ok { - v.Database = (r) - } - } - if c.mode == EmptyFields && v.Permission == "" && Forced(v.ForceSendFields, "Permission") { - ch := n.Child("permission") - c.fn(&ch, "") - } - if s := string(v.Permission); c.match(s) { - ch := n.Child("permission") - if r, ok := c.fn(&ch, s); ok { - v.Permission = apps.AppResourcePostgresPostgresPermission(r) - } - } -} - -func stringsAppsAppResourceSecret(c *stringsWalk, n *Node, v *apps.AppResourceSecret) { - if n.isRef() { - return - } - if s := string(v.Key); c.match(s) { - ch := n.Child("key") - if r, ok := c.fn(&ch, s); ok { - v.Key = (r) - } - } - if s := string(v.Permission); c.match(s) { - ch := n.Child("permission") - if r, ok := c.fn(&ch, s); ok { - v.Permission = apps.AppResourceSecretSecretPermission(r) - } - } - if s := string(v.Scope); c.match(s) { - ch := n.Child("scope") - if r, ok := c.fn(&ch, s); ok { - v.Scope = (r) - } - } -} - -func stringsAppsAppResourceServingEndpoint(c *stringsWalk, n *Node, v *apps.AppResourceServingEndpoint) { - if n.isRef() { - return - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if s := string(v.Permission); c.match(s) { - ch := n.Child("permission") - if r, ok := c.fn(&ch, s); ok { - v.Permission = apps.AppResourceServingEndpointServingEndpointPermission(r) - } - } -} - -func stringsAppsAppResourceSqlWarehouse(c *stringsWalk, n *Node, v *apps.AppResourceSqlWarehouse) { - if n.isRef() { - return - } - if s := string(v.Id); c.match(s) { - ch := n.Child("id") - if r, ok := c.fn(&ch, s); ok { - v.Id = (r) - } - } - if s := string(v.Permission); c.match(s) { - ch := n.Child("permission") - if r, ok := c.fn(&ch, s); ok { - v.Permission = apps.AppResourceSqlWarehouseSqlWarehousePermission(r) - } - } -} - -func stringsAppsAppResourceUcSecurable(c *stringsWalk, n *Node, v *apps.AppResourceUcSecurable) { - if n.isRef() { - return - } - if s := string(v.Permission); c.match(s) { - ch := n.Child("permission") - if r, ok := c.fn(&ch, s); ok { - v.Permission = apps.AppResourceUcSecurableUcSecurablePermission(r) - } - } - if s := string(v.SecurableFullName); c.match(s) { - ch := n.Child("securable_full_name") - if r, ok := c.fn(&ch, s); ok { - v.SecurableFullName = (r) - } - } - if c.mode == EmptyFields && v.SecurableKind == "" && Forced(v.ForceSendFields, "SecurableKind") { - ch := n.Child("securable_kind") - c.fn(&ch, "") - } - if s := string(v.SecurableKind); c.match(s) { - ch := n.Child("securable_kind") - if r, ok := c.fn(&ch, s); ok { - v.SecurableKind = (r) - } - } - if s := string(v.SecurableType); c.match(s) { - ch := n.Child("securable_type") - if r, ok := c.fn(&ch, s); ok { - v.SecurableType = apps.AppResourceUcSecurableUcSecurableType(r) - } - } -} - -func stringsAppsUnityCatalog(c *stringsWalk, n *Node, v *apps.UnityCatalog) { - if n.isRef() { - return - } - if s := string(v.LogsTable); c.match(s) { - ch := n.Child("logs_table") - if r, ok := c.fn(&ch, s); ok { - v.LogsTable = (r) - } - } - if s := string(v.MetricsTable); c.match(s) { - ch := n.Child("metrics_table") - if r, ok := c.fn(&ch, s); ok { - v.MetricsTable = (r) - } - } - if s := string(v.TracesTable); c.match(s) { - ch := n.Child("traces_table") - if r, ok := c.fn(&ch, s); ok { - v.TracesTable = (r) - } - } -} - -func stringsSqlAlertV2Notification(c *stringsWalk, n *Node, v *sql.AlertV2Notification) { - if n.isRef() { - return - } - if !n.IsRef("subscriptions") { - if len(v.Subscriptions) > 0 { - cn := n.Child("subscriptions") - for i := range v.Subscriptions { - { - ch := cn.Elem(i) - stringsSqlAlertV2Subscription(c, &ch, &v.Subscriptions[i]) - } - } - } - } -} - -func stringsSqlAlertV2OperandColumn(c *stringsWalk, n *Node, v *sql.AlertV2OperandColumn) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Aggregation == "" && Forced(v.ForceSendFields, "Aggregation") { - ch := n.Child("aggregation") - c.fn(&ch, "") - } - if s := string(v.Aggregation); c.match(s) { - ch := n.Child("aggregation") - if r, ok := c.fn(&ch, s); ok { - v.Aggregation = sql.Aggregation(r) - } - } - if c.mode == EmptyFields && v.Display == "" && Forced(v.ForceSendFields, "Display") { - ch := n.Child("display") - c.fn(&ch, "") - } - if s := string(v.Display); c.match(s) { - ch := n.Child("display") - if r, ok := c.fn(&ch, s); ok { - v.Display = (r) - } - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } -} - -func stringsSqlAlertV2Operand(c *stringsWalk, n *Node, v *sql.AlertV2Operand) { - if n.isRef() { - return - } - if !n.IsRef("column") { - if x := v.Column; x != nil { - ch := n.Child("column") - stringsSqlAlertV2OperandColumn(c, &ch, x) - } - } - if !n.IsRef("value") { - if x := v.Value; x != nil { - ch := n.Child("value") - stringsSqlAlertV2OperandValue(c, &ch, x) - } - } -} - -func stringsSqlEndpointTagPair(c *stringsWalk, n *Node, v *sql.EndpointTagPair) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Key == "" && Forced(v.ForceSendFields, "Key") { - ch := n.Child("key") - c.fn(&ch, "") - } - if s := string(v.Key); c.match(s) { - ch := n.Child("key") - if r, ok := c.fn(&ch, s); ok { - v.Key = (r) - } - } - if c.mode == EmptyFields && v.Value == "" && Forced(v.ForceSendFields, "Value") { - ch := n.Child("value") - c.fn(&ch, "") - } - if s := string(v.Value); c.match(s) { - ch := n.Child("value") - if r, ok := c.fn(&ch, s); ok { - v.Value = (r) - } - } -} - -func stringsDatabaseSyncedTableContinuousUpdateStatus(c *stringsWalk, n *Node, v *database.SyncedTableContinuousUpdateStatus) { - if n.isRef() { - return - } - if !n.IsRef("initial_pipeline_sync_progress") { - if x := v.InitialPipelineSyncProgress; x != nil { - ch := n.Child("initial_pipeline_sync_progress") - stringsDatabaseSyncedTablePipelineProgress(c, &ch, x) - } - } - if c.mode == EmptyFields && v.Timestamp == "" && Forced(v.ForceSendFields, "Timestamp") { - ch := n.Child("timestamp") - c.fn(&ch, "") - } - if s := string(v.Timestamp); c.match(s) { - ch := n.Child("timestamp") - if r, ok := c.fn(&ch, s); ok { - v.Timestamp = (r) - } - } -} - -func stringsDatabaseSyncedTableFailedStatus(c *stringsWalk, n *Node, v *database.SyncedTableFailedStatus) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Timestamp == "" && Forced(v.ForceSendFields, "Timestamp") { - ch := n.Child("timestamp") - c.fn(&ch, "") - } - if s := string(v.Timestamp); c.match(s) { - ch := n.Child("timestamp") - if r, ok := c.fn(&ch, s); ok { - v.Timestamp = (r) - } - } -} - -func stringsDatabaseSyncedTablePosition(c *stringsWalk, n *Node, v *database.SyncedTablePosition) { - if n.isRef() { - return - } - if !n.IsRef("delta_table_sync_info") { - if x := v.DeltaTableSyncInfo; x != nil { - ch := n.Child("delta_table_sync_info") - stringsDatabaseDeltaTableSyncInfo(c, &ch, x) - } - } - if c.mode == EmptyFields && v.SyncEndTimestamp == "" && Forced(v.ForceSendFields, "SyncEndTimestamp") { - ch := n.Child("sync_end_timestamp") - c.fn(&ch, "") - } - if s := string(v.SyncEndTimestamp); c.match(s) { - ch := n.Child("sync_end_timestamp") - if r, ok := c.fn(&ch, s); ok { - v.SyncEndTimestamp = (r) - } - } - if c.mode == EmptyFields && v.SyncStartTimestamp == "" && Forced(v.ForceSendFields, "SyncStartTimestamp") { - ch := n.Child("sync_start_timestamp") - c.fn(&ch, "") - } - if s := string(v.SyncStartTimestamp); c.match(s) { - ch := n.Child("sync_start_timestamp") - if r, ok := c.fn(&ch, s); ok { - v.SyncStartTimestamp = (r) - } - } -} - -func stringsDatabaseSyncedTableProvisioningStatus(c *stringsWalk, n *Node, v *database.SyncedTableProvisioningStatus) { - if n.isRef() { - return - } - if !n.IsRef("initial_pipeline_sync_progress") { - if x := v.InitialPipelineSyncProgress; x != nil { - ch := n.Child("initial_pipeline_sync_progress") - stringsDatabaseSyncedTablePipelineProgress(c, &ch, x) - } - } -} - -func stringsDatabaseSyncedTableTriggeredUpdateStatus(c *stringsWalk, n *Node, v *database.SyncedTableTriggeredUpdateStatus) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Timestamp == "" && Forced(v.ForceSendFields, "Timestamp") { - ch := n.Child("timestamp") - c.fn(&ch, "") - } - if s := string(v.Timestamp); c.match(s) { - ch := n.Child("timestamp") - if r, ok := c.fn(&ch, s); ok { - v.Timestamp = (r) - } - } - if !n.IsRef("triggered_update_progress") { - if x := v.TriggeredUpdateProgress; x != nil { - ch := n.Child("triggered_update_progress") - stringsDatabaseSyncedTablePipelineProgress(c, &ch, x) - } - } -} - -func stringsDatabaseNewPipelineSpec(c *stringsWalk, n *Node, v *database.NewPipelineSpec) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.BudgetPolicyId == "" && Forced(v.ForceSendFields, "BudgetPolicyId") { - ch := n.Child("budget_policy_id") - c.fn(&ch, "") - } - if s := string(v.BudgetPolicyId); c.match(s) { - ch := n.Child("budget_policy_id") - if r, ok := c.fn(&ch, s); ok { - v.BudgetPolicyId = (r) - } - } - if c.mode == EmptyFields && v.StorageCatalog == "" && Forced(v.ForceSendFields, "StorageCatalog") { - ch := n.Child("storage_catalog") - c.fn(&ch, "") - } - if s := string(v.StorageCatalog); c.match(s) { - ch := n.Child("storage_catalog") - if r, ok := c.fn(&ch, s); ok { - v.StorageCatalog = (r) - } - } - if c.mode == EmptyFields && v.StorageSchema == "" && Forced(v.ForceSendFields, "StorageSchema") { - ch := n.Child("storage_schema") - c.fn(&ch, "") - } - if s := string(v.StorageSchema); c.match(s) { - ch := n.Child("storage_schema") - if r, ok := c.fn(&ch, s); ok { - v.StorageSchema = (r) - } - } -} - -func stringsDatabaseSyncedTableSpecTypeOverride(c *stringsWalk, n *Node, v *database.SyncedTableSpecTypeOverride) { - if n.isRef() { - return - } - if s := string(v.ColumnName); c.match(s) { - ch := n.Child("column_name") - if r, ok := c.fn(&ch, s); ok { - v.ColumnName = (r) - } - } - if s := string(v.PgType); c.match(s) { - ch := n.Child("pg_type") - if r, ok := c.fn(&ch, s); ok { - v.PgType = database.SyncedTableSpecPgSpecificType(r) - } - } -} - -func stringsPostgresWeeklySchedule(c *stringsWalk, n *Node, v *postgres.WeeklySchedule) { - if n.isRef() { - return - } - if s := string(v.DayOfWeek); c.match(s) { - ch := n.Child("day_of_week") - if r, ok := c.fn(&ch, s); ok { - v.DayOfWeek = postgres.DayOfWeek(r) - } - } -} - -func stringsVectorsearchEmbeddingSourceColumn(c *stringsWalk, n *Node, v *vectorsearch.EmbeddingSourceColumn) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.EmbeddingModelEndpointName == "" && Forced(v.ForceSendFields, "EmbeddingModelEndpointName") { - ch := n.Child("embedding_model_endpoint_name") - c.fn(&ch, "") - } - if s := string(v.EmbeddingModelEndpointName); c.match(s) { - ch := n.Child("embedding_model_endpoint_name") - if r, ok := c.fn(&ch, s); ok { - v.EmbeddingModelEndpointName = (r) - } - } - if c.mode == EmptyFields && v.ModelEndpointNameForQuery == "" && Forced(v.ForceSendFields, "ModelEndpointNameForQuery") { - ch := n.Child("model_endpoint_name_for_query") - c.fn(&ch, "") - } - if s := string(v.ModelEndpointNameForQuery); c.match(s) { - ch := n.Child("model_endpoint_name_for_query") - if r, ok := c.fn(&ch, s); ok { - v.ModelEndpointNameForQuery = (r) - } - } - if c.mode == EmptyFields && v.Name == "" && Forced(v.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } -} - -func stringsVectorsearchEmbeddingVectorColumn(c *stringsWalk, n *Node, v *vectorsearch.EmbeddingVectorColumn) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Name == "" && Forced(v.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } -} - -func stringsComputeDiskType(c *stringsWalk, n *Node, v *compute.DiskType) { - if n.isRef() { - return - } - if s := string(v.AzureDiskVolumeType); c.match(s) { - ch := n.Child("azure_disk_volume_type") - if r, ok := c.fn(&ch, s); ok { - v.AzureDiskVolumeType = compute.DiskTypeAzureDiskVolumeType(r) - } - } - if s := string(v.EbsVolumeType); c.match(s) { - ch := n.Child("ebs_volume_type") - if r, ok := c.fn(&ch, s); ok { - v.EbsVolumeType = compute.DiskTypeEbsVolumeType(r) - } - } -} - -func stringsJobsDeploymentSpec(c *stringsWalk, n *Node, v *jobs.DeploymentSpec) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.CommandPath == "" && Forced(v.ForceSendFields, "CommandPath") { - ch := n.Child("command_path") - c.fn(&ch, "") - } - if s := string(v.CommandPath); c.match(s) { - ch := n.Child("command_path") - if r, ok := c.fn(&ch, s); ok { - v.CommandPath = (r) - } - } - if !n.IsRef("compute") { - { - ch := n.Child("compute") - stringsJobsComputeSpec(c, &ch, &v.Compute) - } - } - if c.mode == EmptyFields && v.Name == "" && Forced(v.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } -} - -func stringsJobsAlertTaskSubscriber(c *stringsWalk, n *Node, v *jobs.AlertTaskSubscriber) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DestinationId == "" && Forced(v.ForceSendFields, "DestinationId") { - ch := n.Child("destination_id") - c.fn(&ch, "") - } - if s := string(v.DestinationId); c.match(s) { - ch := n.Child("destination_id") - if r, ok := c.fn(&ch, s); ok { - v.DestinationId = (r) - } - } - if c.mode == EmptyFields && v.UserName == "" && Forced(v.ForceSendFields, "UserName") { - ch := n.Child("user_name") - c.fn(&ch, "") - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } -} - -func stringsJobsSubscription(c *stringsWalk, n *Node, v *jobs.Subscription) { - if n.isRef() { - return - } - if !n.IsRef("attachment") { - if x := v.Attachment; x != nil { - ch := n.Child("attachment") - stringsJobsSubscriptionAttachment(c, &ch, x) - } - } - if c.mode == EmptyFields && v.CustomSubject == "" && Forced(v.ForceSendFields, "CustomSubject") { - ch := n.Child("custom_subject") - c.fn(&ch, "") - } - if s := string(v.CustomSubject); c.match(s) { - ch := n.Child("custom_subject") - if r, ok := c.fn(&ch, s); ok { - v.CustomSubject = (r) - } - } - if !n.IsRef("subscribers") { - if len(v.Subscribers) > 0 { - cn := n.Child("subscribers") - for i := range v.Subscribers { - { - ch := cn.Elem(i) - stringsJobsSubscriptionSubscriber(c, &ch, &v.Subscribers[i]) - } - } - } - } -} - -func stringsJobsComputeConfig(c *stringsWalk, n *Node, v *jobs.ComputeConfig) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.GpuNodePoolId == "" && Forced(v.ForceSendFields, "GpuNodePoolId") { - ch := n.Child("gpu_node_pool_id") - c.fn(&ch, "") - } - if s := string(v.GpuNodePoolId); c.match(s) { - ch := n.Child("gpu_node_pool_id") - if r, ok := c.fn(&ch, s); ok { - v.GpuNodePoolId = (r) - } - } - if c.mode == EmptyFields && v.GpuType == "" && Forced(v.ForceSendFields, "GpuType") { - ch := n.Child("gpu_type") - c.fn(&ch, "") - } - if s := string(v.GpuType); c.match(s) { - ch := n.Child("gpu_type") - if r, ok := c.fn(&ch, s); ok { - v.GpuType = (r) - } - } -} - -func stringsJobsPowerBiModel(c *stringsWalk, n *Node, v *jobs.PowerBiModel) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.AuthenticationMethod == "" && Forced(v.ForceSendFields, "AuthenticationMethod") { - ch := n.Child("authentication_method") - c.fn(&ch, "") - } - if s := string(v.AuthenticationMethod); c.match(s) { - ch := n.Child("authentication_method") - if r, ok := c.fn(&ch, s); ok { - v.AuthenticationMethod = jobs.AuthenticationMethod(r) - } - } - if c.mode == EmptyFields && v.ModelName == "" && Forced(v.ForceSendFields, "ModelName") { - ch := n.Child("model_name") - c.fn(&ch, "") - } - if s := string(v.ModelName); c.match(s) { - ch := n.Child("model_name") - if r, ok := c.fn(&ch, s); ok { - v.ModelName = (r) - } - } - if c.mode == EmptyFields && v.StorageMode == "" && Forced(v.ForceSendFields, "StorageMode") { - ch := n.Child("storage_mode") - c.fn(&ch, "") - } - if s := string(v.StorageMode); c.match(s) { - ch := n.Child("storage_mode") - if r, ok := c.fn(&ch, s); ok { - v.StorageMode = jobs.StorageMode(r) - } - } - if c.mode == EmptyFields && v.WorkspaceName == "" && Forced(v.ForceSendFields, "WorkspaceName") { - ch := n.Child("workspace_name") - c.fn(&ch, "") - } - if s := string(v.WorkspaceName); c.match(s) { - ch := n.Child("workspace_name") - if r, ok := c.fn(&ch, s); ok { - v.WorkspaceName = (r) - } - } -} - -func stringsJobsPowerBiTable(c *stringsWalk, n *Node, v *jobs.PowerBiTable) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Catalog == "" && Forced(v.ForceSendFields, "Catalog") { - ch := n.Child("catalog") - c.fn(&ch, "") - } - if s := string(v.Catalog); c.match(s) { - ch := n.Child("catalog") - if r, ok := c.fn(&ch, s); ok { - v.Catalog = (r) - } - } - if c.mode == EmptyFields && v.Name == "" && Forced(v.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if c.mode == EmptyFields && v.Schema == "" && Forced(v.ForceSendFields, "Schema") { - ch := n.Child("schema") - c.fn(&ch, "") - } - if s := string(v.Schema); c.match(s) { - ch := n.Child("schema") - if r, ok := c.fn(&ch, s); ok { - v.Schema = (r) - } - } - if c.mode == EmptyFields && v.StorageMode == "" && Forced(v.ForceSendFields, "StorageMode") { - ch := n.Child("storage_mode") - c.fn(&ch, "") - } - if s := string(v.StorageMode); c.match(s) { - ch := n.Child("storage_mode") - if r, ok := c.fn(&ch, s); ok { - v.StorageMode = jobs.StorageMode(r) - } - } -} - -func stringsJobsPythonOperatorTaskParameter(c *stringsWalk, n *Node, v *jobs.PythonOperatorTaskParameter) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Name == "" && Forced(v.ForceSendFields, "Name") { - ch := n.Child("name") - c.fn(&ch, "") - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if c.mode == EmptyFields && v.Value == "" && Forced(v.ForceSendFields, "Value") { - ch := n.Child("value") - c.fn(&ch, "") - } - if s := string(v.Value); c.match(s) { - ch := n.Child("value") - if r, ok := c.fn(&ch, s); ok { - v.Value = (r) - } - } -} - -func stringsJobsSqlTaskAlert(c *stringsWalk, n *Node, v *jobs.SqlTaskAlert) { - if n.isRef() { - return - } - if s := string(v.AlertId); c.match(s) { - ch := n.Child("alert_id") - if r, ok := c.fn(&ch, s); ok { - v.AlertId = (r) - } - } - if !n.IsRef("subscriptions") { - if len(v.Subscriptions) > 0 { - cn := n.Child("subscriptions") - for i := range v.Subscriptions { - { - ch := cn.Elem(i) - stringsJobsSqlTaskSubscription(c, &ch, &v.Subscriptions[i]) - } - } - } - } -} - -func stringsJobsSqlTaskDashboard(c *stringsWalk, n *Node, v *jobs.SqlTaskDashboard) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.CustomSubject == "" && Forced(v.ForceSendFields, "CustomSubject") { - ch := n.Child("custom_subject") - c.fn(&ch, "") - } - if s := string(v.CustomSubject); c.match(s) { - ch := n.Child("custom_subject") - if r, ok := c.fn(&ch, s); ok { - v.CustomSubject = (r) - } - } - if s := string(v.DashboardId); c.match(s) { - ch := n.Child("dashboard_id") - if r, ok := c.fn(&ch, s); ok { - v.DashboardId = (r) - } - } - if !n.IsRef("subscriptions") { - if len(v.Subscriptions) > 0 { - cn := n.Child("subscriptions") - for i := range v.Subscriptions { - { - ch := cn.Elem(i) - stringsJobsSqlTaskSubscription(c, &ch, &v.Subscriptions[i]) - } - } - } - } -} - -func stringsJobsSqlTaskFile(c *stringsWalk, n *Node, v *jobs.SqlTaskFile) { - if n.isRef() { - return - } - if s := string(v.Path); c.match(s) { - ch := n.Child("path") - if r, ok := c.fn(&ch, s); ok { - v.Path = (r) - } - } - if s := string(v.Source); c.match(s) { - ch := n.Child("source") - if r, ok := c.fn(&ch, s); ok { - v.Source = jobs.Source(r) - } - } -} - -func stringsJobsSqlTaskQuery(c *stringsWalk, n *Node, v *jobs.SqlTaskQuery) { - if n.isRef() { - return - } - if s := string(v.QueryId); c.match(s) { - ch := n.Child("query_id") - if r, ok := c.fn(&ch, s); ok { - v.QueryId = (r) - } - } -} - -func stringsPipelinesReportSpec(c *stringsWalk, n *Node, v *pipelines.ReportSpec) { - if n.isRef() { - return - } - if s := string(v.DestinationCatalog); c.match(s) { - ch := n.Child("destination_catalog") - if r, ok := c.fn(&ch, s); ok { - v.DestinationCatalog = (r) - } - } - if s := string(v.DestinationSchema); c.match(s) { - ch := n.Child("destination_schema") - if r, ok := c.fn(&ch, s); ok { - v.DestinationSchema = (r) - } - } - if c.mode == EmptyFields && v.DestinationTable == "" && Forced(v.ForceSendFields, "DestinationTable") { - ch := n.Child("destination_table") - c.fn(&ch, "") - } - if s := string(v.DestinationTable); c.match(s) { - ch := n.Child("destination_table") - if r, ok := c.fn(&ch, s); ok { - v.DestinationTable = (r) - } - } - if s := string(v.SourceUrl); c.match(s) { - ch := n.Child("source_url") - if r, ok := c.fn(&ch, s); ok { - v.SourceUrl = (r) - } - } - if !n.IsRef("table_configuration") { - if x := v.TableConfiguration; x != nil { - ch := n.Child("table_configuration") - stringsPipelinesTableSpecificConfig(c, &ch, x) - } - } -} - -func stringsPipelinesSchemaSpec(c *stringsWalk, n *Node, v *pipelines.SchemaSpec) { - if n.isRef() { - return - } - if !n.IsRef("connector_options") { - if x := v.ConnectorOptions; x != nil { - ch := n.Child("connector_options") - stringsPipelinesConnectorOptions(c, &ch, x) - } - } - if s := string(v.DestinationCatalog); c.match(s) { - ch := n.Child("destination_catalog") - if r, ok := c.fn(&ch, s); ok { - v.DestinationCatalog = (r) - } - } - if s := string(v.DestinationSchema); c.match(s) { - ch := n.Child("destination_schema") - if r, ok := c.fn(&ch, s); ok { - v.DestinationSchema = (r) - } - } - if !n.IsRef("fanout_options") { - if x := v.FanoutOptions; x != nil { - ch := n.Child("fanout_options") - stringsPipelinesIngestionPipelineDefinitionFanoutOptions(c, &ch, x) - } - } - if c.mode == EmptyFields && v.SourceCatalog == "" && Forced(v.ForceSendFields, "SourceCatalog") { - ch := n.Child("source_catalog") - c.fn(&ch, "") - } - if s := string(v.SourceCatalog); c.match(s) { - ch := n.Child("source_catalog") - if r, ok := c.fn(&ch, s); ok { - v.SourceCatalog = (r) - } - } - if c.mode == EmptyFields && v.SourceSchema == "" && Forced(v.ForceSendFields, "SourceSchema") { - ch := n.Child("source_schema") - c.fn(&ch, "") - } - if s := string(v.SourceSchema); c.match(s) { - ch := n.Child("source_schema") - if r, ok := c.fn(&ch, s); ok { - v.SourceSchema = (r) - } - } - if !n.IsRef("table_configuration") { - if x := v.TableConfiguration; x != nil { - ch := n.Child("table_configuration") - stringsPipelinesTableSpecificConfig(c, &ch, x) - } - } -} - -func stringsPipelinesTableSpec(c *stringsWalk, n *Node, v *pipelines.TableSpec) { - if n.isRef() { - return - } - if !n.IsRef("connector_options") { - if x := v.ConnectorOptions; x != nil { - ch := n.Child("connector_options") - stringsPipelinesConnectorOptions(c, &ch, x) - } - } - if s := string(v.DestinationCatalog); c.match(s) { - ch := n.Child("destination_catalog") - if r, ok := c.fn(&ch, s); ok { - v.DestinationCatalog = (r) - } - } - if s := string(v.DestinationSchema); c.match(s) { - ch := n.Child("destination_schema") - if r, ok := c.fn(&ch, s); ok { - v.DestinationSchema = (r) - } - } - if c.mode == EmptyFields && v.DestinationTable == "" && Forced(v.ForceSendFields, "DestinationTable") { - ch := n.Child("destination_table") - c.fn(&ch, "") - } - if s := string(v.DestinationTable); c.match(s) { - ch := n.Child("destination_table") - if r, ok := c.fn(&ch, s); ok { - v.DestinationTable = (r) - } - } - if c.mode == EmptyFields && v.SourceCatalog == "" && Forced(v.ForceSendFields, "SourceCatalog") { - ch := n.Child("source_catalog") - c.fn(&ch, "") - } - if s := string(v.SourceCatalog); c.match(s) { - ch := n.Child("source_catalog") - if r, ok := c.fn(&ch, s); ok { - v.SourceCatalog = (r) - } - } - if c.mode == EmptyFields && v.SourceSchema == "" && Forced(v.ForceSendFields, "SourceSchema") { - ch := n.Child("source_schema") - c.fn(&ch, "") - } - if s := string(v.SourceSchema); c.match(s) { - ch := n.Child("source_schema") - if r, ok := c.fn(&ch, s); ok { - v.SourceSchema = (r) - } - } - if c.mode == EmptyFields && v.SourceTable == "" && Forced(v.ForceSendFields, "SourceTable") { - ch := n.Child("source_table") - c.fn(&ch, "") - } - if s := string(v.SourceTable); c.match(s) { - ch := n.Child("source_table") - if r, ok := c.fn(&ch, s); ok { - v.SourceTable = (r) - } - } - if !n.IsRef("table_configuration") { - if x := v.TableConfiguration; x != nil { - ch := n.Child("table_configuration") - stringsPipelinesTableSpecificConfig(c, &ch, x) - } - } -} - -func stringsPipelinesApiSourceConnectorConfig(c *stringsWalk, n *Node, v *pipelines.ApiSourceConnectorConfig) { - if n.isRef() { - return - } - if !n.IsRef("configs") { - if len(v.Configs) > 0 { - cn := n.Child("configs") - for _, k := range sortedKeys(v.Configs) { - if s := string(v.Configs[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.Configs[k] = (r) - } - } - } - } - } -} - -func stringsPipelinesSourceCatalogConfig(c *stringsWalk, n *Node, v *pipelines.SourceCatalogConfig) { - if n.isRef() { - return - } - if !n.IsRef("postgres") { - if x := v.Postgres; x != nil { - ch := n.Child("postgres") - stringsPipelinesPostgresCatalogConfig(c, &ch, x) - } - } - if c.mode == EmptyFields && v.SourceCatalog == "" && Forced(v.ForceSendFields, "SourceCatalog") { - ch := n.Child("source_catalog") - c.fn(&ch, "") - } - if s := string(v.SourceCatalog); c.match(s) { - ch := n.Child("source_catalog") - if r, ok := c.fn(&ch, s); ok { - v.SourceCatalog = (r) - } - } -} - -func stringsPipelinesGoogleAdsConfig(c *stringsWalk, n *Node, v *pipelines.GoogleAdsConfig) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ManagerAccountId == "" && Forced(v.ForceSendFields, "ManagerAccountId") { - ch := n.Child("manager_account_id") - c.fn(&ch, "") - } - if s := string(v.ManagerAccountId); c.match(s) { - ch := n.Child("manager_account_id") - if r, ok := c.fn(&ch, s); ok { - v.ManagerAccountId = (r) - } - } -} - -func stringsPipelinesIngestionPipelineDefinitionTableSpecificConfigQueryBasedConnectorConfig(c *stringsWalk, n *Node, v *pipelines.IngestionPipelineDefinitionTableSpecificConfigQueryBasedConnectorConfig) { - if n.isRef() { - return - } - if !n.IsRef("cursor_columns") { - if len(v.CursorColumns) > 0 { - cn := n.Child("cursor_columns") - for i := range v.CursorColumns { - if s := string(v.CursorColumns[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.CursorColumns[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.DeletionCondition == "" && Forced(v.ForceSendFields, "DeletionCondition") { - ch := n.Child("deletion_condition") - c.fn(&ch, "") - } - if s := string(v.DeletionCondition); c.match(s) { - ch := n.Child("deletion_condition") - if r, ok := c.fn(&ch, s); ok { - v.DeletionCondition = (r) - } - } -} - -func stringsPipelinesIngestionPipelineDefinitionWorkdayReportParameters(c *stringsWalk, n *Node, v *pipelines.IngestionPipelineDefinitionWorkdayReportParameters) { - if n.isRef() { - return - } - if !n.IsRef("parameters") { - if len(v.Parameters) > 0 { - cn := n.Child("parameters") - for _, k := range sortedKeys(v.Parameters) { - if s := string(v.Parameters[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.Parameters[k] = (r) - } - } - } - } - } - if !n.IsRef("report_parameters") { - if len(v.ReportParameters) > 0 { - cn := n.Child("report_parameters") - for i := range v.ReportParameters { - { - ch := cn.Elem(i) - stringsPipelinesIngestionPipelineDefinitionWorkdayReportParametersQueryKeyValue(c, &ch, &v.ReportParameters[i]) - } - } - } - } -} - -func stringsMlApproxCountDistinctFunction(c *stringsWalk, n *Node, v *ml.ApproxCountDistinctFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlApproxPercentileFunction(c *stringsWalk, n *Node, v *ml.ApproxPercentileFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlAvgFunction(c *stringsWalk, n *Node, v *ml.AvgFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlCountFunction(c *stringsWalk, n *Node, v *ml.CountFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlFirstFunction(c *stringsWalk, n *Node, v *ml.FirstFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlFirstDistinctFunction(c *stringsWalk, n *Node, v *ml.FirstDistinctFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlFirstNFunction(c *stringsWalk, n *Node, v *ml.FirstNFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlLastFunction(c *stringsWalk, n *Node, v *ml.LastFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlLastDistinctFunction(c *stringsWalk, n *Node, v *ml.LastDistinctFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlLastNFunction(c *stringsWalk, n *Node, v *ml.LastNFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlMaxFunction(c *stringsWalk, n *Node, v *ml.MaxFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlMinFunction(c *stringsWalk, n *Node, v *ml.MinFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlStddevPopFunction(c *stringsWalk, n *Node, v *ml.StddevPopFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlStddevSampFunction(c *stringsWalk, n *Node, v *ml.StddevSampFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlSumFunction(c *stringsWalk, n *Node, v *ml.SumFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlVarPopFunction(c *stringsWalk, n *Node, v *ml.VarPopFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlVarSampFunction(c *stringsWalk, n *Node, v *ml.VarSampFunction) { - if n.isRef() { - return - } - if s := string(v.Input); c.match(s) { - ch := n.Child("input") - if r, ok := c.fn(&ch, s); ok { - v.Input = (r) - } - } -} - -func stringsMlInputBinding(c *stringsWalk, n *Node, v *ml.InputBinding) { - if n.isRef() { - return - } - if s := string(v.Column); c.match(s) { - ch := n.Child("column") - if r, ok := c.fn(&ch, s); ok { - v.Column = (r) - } - } - if s := string(v.Parameter); c.match(s) { - ch := n.Child("parameter") - if r, ok := c.fn(&ch, s); ok { - v.Parameter = (r) - } - } -} - -func stringsMlFeatureReference(c *stringsWalk, n *Node, v *ml.FeatureReference) { - if n.isRef() { - return - } - if s := string(v.Feature); c.match(s) { - ch := n.Child("feature") - if r, ok := c.fn(&ch, s); ok { - v.Feature = (r) - } - } -} - -func stringsMlColumnIdentifier(c *stringsWalk, n *Node, v *ml.ColumnIdentifier) { - if n.isRef() { - return - } - if s := string(v.VariantExprPath); c.match(s) { - ch := n.Child("variant_expr_path") - if r, ok := c.fn(&ch, s); ok { - v.VariantExprPath = (r) - } - } -} - -func stringsMlFlatSchema(c *stringsWalk, n *Node, v *ml.FlatSchema) { - if n.isRef() { - return - } - if !n.IsRef("fields") { - if len(v.Fields) > 0 { - cn := n.Child("fields") - for i := range v.Fields { - { - ch := cn.Elem(i) - stringsMlFieldDefinition(c, &ch, &v.Fields[i]) - } - } - } - } -} - -func stringsServingAiGatewayGuardrailParameters(c *stringsWalk, n *Node, v *serving.AiGatewayGuardrailParameters) { - if n.isRef() { - return - } - if !n.IsRef("invalid_keywords") { - if len(v.InvalidKeywords) > 0 { - cn := n.Child("invalid_keywords") - for i := range v.InvalidKeywords { - if s := string(v.InvalidKeywords[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.InvalidKeywords[i] = (r) - } - } - } - } - } - if !n.IsRef("pii") { - if x := v.Pii; x != nil { - ch := n.Child("pii") - stringsServingAiGatewayGuardrailPiiBehavior(c, &ch, x) - } - } - if !n.IsRef("valid_topics") { - if len(v.ValidTopics) > 0 { - cn := n.Child("valid_topics") - for i := range v.ValidTopics { - if s := string(v.ValidTopics[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.ValidTopics[i] = (r) - } - } - } - } - } -} - -func stringsServingExternalModel(c *stringsWalk, n *Node, v *serving.ExternalModel) { - if n.isRef() { - return - } - if !n.IsRef("ai21labs_config") { - if x := v.Ai21labsConfig; x != nil { - ch := n.Child("ai21labs_config") - stringsServingAi21LabsConfig(c, &ch, x) - } - } - if !n.IsRef("amazon_bedrock_config") { - if x := v.AmazonBedrockConfig; x != nil { - ch := n.Child("amazon_bedrock_config") - stringsServingAmazonBedrockConfig(c, &ch, x) - } - } - if !n.IsRef("anthropic_config") { - if x := v.AnthropicConfig; x != nil { - ch := n.Child("anthropic_config") - stringsServingAnthropicConfig(c, &ch, x) - } - } - if !n.IsRef("cohere_config") { - if x := v.CohereConfig; x != nil { - ch := n.Child("cohere_config") - stringsServingCohereConfig(c, &ch, x) - } - } - if !n.IsRef("custom_provider_config") { - if x := v.CustomProviderConfig; x != nil { - ch := n.Child("custom_provider_config") - stringsServingCustomProviderConfig(c, &ch, x) - } - } - if !n.IsRef("databricks_model_serving_config") { - if x := v.DatabricksModelServingConfig; x != nil { - ch := n.Child("databricks_model_serving_config") - stringsServingDatabricksModelServingConfig(c, &ch, x) - } - } - if !n.IsRef("google_cloud_vertex_ai_config") { - if x := v.GoogleCloudVertexAiConfig; x != nil { - ch := n.Child("google_cloud_vertex_ai_config") - stringsServingGoogleCloudVertexAiConfig(c, &ch, x) - } - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if !n.IsRef("openai_config") { - if x := v.OpenaiConfig; x != nil { - ch := n.Child("openai_config") - stringsServingOpenAiConfig(c, &ch, x) - } - } - if !n.IsRef("palm_config") { - if x := v.PalmConfig; x != nil { - ch := n.Child("palm_config") - stringsServingPaLmConfig(c, &ch, x) - } - } - if s := string(v.Provider); c.match(s) { - ch := n.Child("provider") - if r, ok := c.fn(&ch, s); ok { - v.Provider = serving.ExternalModelProvider(r) - } - } - if s := string(v.Task); c.match(s) { - ch := n.Child("task") - if r, ok := c.fn(&ch, s); ok { - v.Task = (r) - } - } -} - -func stringsServingRoute(c *stringsWalk, n *Node, v *serving.Route) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ServedEntityName == "" && Forced(v.ForceSendFields, "ServedEntityName") { - ch := n.Child("served_entity_name") - c.fn(&ch, "") - } - if s := string(v.ServedEntityName); c.match(s) { - ch := n.Child("served_entity_name") - if r, ok := c.fn(&ch, s); ok { - v.ServedEntityName = (r) - } - } - if c.mode == EmptyFields && v.ServedModelName == "" && Forced(v.ForceSendFields, "ServedModelName") { - ch := n.Child("served_model_name") - c.fn(&ch, "") - } - if s := string(v.ServedModelName); c.match(s) { - ch := n.Child("served_model_name") - if r, ok := c.fn(&ch, s); ok { - v.ServedModelName = (r) - } - } -} - -func stringsCatalogModelServiceConfigDestinationConfig(c *stringsWalk, n *Node, v *catalog.ModelServiceConfigDestinationConfig) { - if n.isRef() { - return - } - if s := string(v.DestinationType); c.match(s) { - ch := n.Child("destination_type") - if r, ok := c.fn(&ch, s); ok { - v.DestinationType = catalog.ModelServiceConfigDestinationConfigDestinationType(r) - } - } - if !n.IsRef("external_model_config") { - if x := v.ExternalModelConfig; x != nil { - ch := n.Child("external_model_config") - stringsCatalogModelServiceConfigExternalModelConfig(c, &ch, x) - } - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } - if !n.IsRef("pay_per_token_config") { - if x := v.PayPerTokenConfig; x != nil { - ch := n.Child("pay_per_token_config") - stringsCatalogModelServiceConfigPayPerTokenConfig(c, &ch, x) - } - } - if !n.IsRef("provisioned_throughput_config") { - if x := v.ProvisionedThroughputConfig; x != nil { - ch := n.Child("provisioned_throughput_config") - stringsCatalogModelServiceConfigProvisionedThroughputConfig(c, &ch, x) - } - } -} - -func stringsCatalogModelServiceConfigFallbackConfig(c *stringsWalk, n *Node, v *catalog.ModelServiceConfigFallbackConfig) { - if n.isRef() { - return - } - if !n.IsRef("destinations") { - if len(v.Destinations) > 0 { - cn := n.Child("destinations") - for i := range v.Destinations { - { - ch := cn.Elem(i) - stringsCatalogModelServiceConfigDestinationConfig(c, &ch, &v.Destinations[i]) - } - } - } - } -} - -func stringsCatalogModelProviderServiceConfigAmazonBedrockProviderDirectConfig(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigAmazonBedrockProviderDirectConfig) { - if n.isRef() { - return - } - if !n.IsRef("aws_access_key") { - if x := v.AwsAccessKey; x != nil { - ch := n.Child("aws_access_key") - stringsCatalogModelProviderServiceConfigAwsAccessKey(c, &ch, x) - } - } - if c.mode == EmptyFields && v.Region == "" && Forced(v.ForceSendFields, "Region") { - ch := n.Child("region") - c.fn(&ch, "") - } - if s := string(v.Region); c.match(s) { - ch := n.Child("region") - if r, ok := c.fn(&ch, s); ok { - v.Region = (r) - } - } - if !n.IsRef("service_credential") { - if x := v.ServiceCredential; x != nil { - ch := n.Child("service_credential") - stringsCatalogModelProviderServiceConfigServiceCredential(c, &ch, x) - } - } -} - -func stringsCatalogModelProviderServiceConfigAnthropicProviderDirectConfig(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigAnthropicProviderDirectConfig) { - if n.isRef() { - return - } - if !n.IsRef("api_key") { - if x := v.ApiKey; x != nil { - ch := n.Child("api_key") - stringsCatalogModelProviderServiceConfigProviderSecret(c, &ch, x) - } - } -} - -func stringsCatalogModelProviderServiceConfigAzureOpenAiProviderDirectConfig(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigAzureOpenAiProviderDirectConfig) { - if n.isRef() { - return - } - if !n.IsRef("api_key") { - if x := v.ApiKey; x != nil { - ch := n.Child("api_key") - stringsCatalogModelProviderServiceConfigProviderSecret(c, &ch, x) - } - } - if c.mode == EmptyFields && v.BaseUrl == "" && Forced(v.ForceSendFields, "BaseUrl") { - ch := n.Child("base_url") - c.fn(&ch, "") - } - if s := string(v.BaseUrl); c.match(s) { - ch := n.Child("base_url") - if r, ok := c.fn(&ch, s); ok { - v.BaseUrl = (r) - } - } - if !n.IsRef("entra_service_principal") { - if x := v.EntraServicePrincipal; x != nil { - ch := n.Child("entra_service_principal") - stringsCatalogModelProviderServiceConfigEntraServicePrincipal(c, &ch, x) - } - } - if !n.IsRef("service_credential") { - if x := v.ServiceCredential; x != nil { - ch := n.Child("service_credential") - stringsCatalogModelProviderServiceConfigServiceCredential(c, &ch, x) - } - } -} - -func stringsCatalogModelProviderServiceConfigCustomProviderDirectConfig(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigCustomProviderDirectConfig) { - if n.isRef() { - return - } - if !n.IsRef("api_key") { - if x := v.ApiKey; x != nil { - ch := n.Child("api_key") - stringsCatalogModelProviderServiceConfigProviderSecret(c, &ch, x) - } - } - if c.mode == EmptyFields && v.BaseUrl == "" && Forced(v.ForceSendFields, "BaseUrl") { - ch := n.Child("base_url") - c.fn(&ch, "") - } - if s := string(v.BaseUrl); c.match(s) { - ch := n.Child("base_url") - if r, ok := c.fn(&ch, s); ok { - v.BaseUrl = (r) - } - } - if !n.IsRef("header_auth") { - if x := v.HeaderAuth; x != nil { - ch := n.Child("header_auth") - stringsCatalogModelProviderServiceConfigCustomProviderApiKeyHeaderAuth(c, &ch, x) - } - } -} - -func stringsCatalogModelProviderServiceConfigGeminiEnterpriseProviderDirectConfig(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigGeminiEnterpriseProviderDirectConfig) { - if n.isRef() { - return - } - if !n.IsRef("api_key") { - if x := v.ApiKey; x != nil { - ch := n.Child("api_key") - stringsCatalogModelProviderServiceConfigProviderSecret(c, &ch, x) - } - } - if c.mode == EmptyFields && v.ProjectId == "" && Forced(v.ForceSendFields, "ProjectId") { - ch := n.Child("project_id") - c.fn(&ch, "") - } - if s := string(v.ProjectId); c.match(s) { - ch := n.Child("project_id") - if r, ok := c.fn(&ch, s); ok { - v.ProjectId = (r) - } - } - if c.mode == EmptyFields && v.Region == "" && Forced(v.ForceSendFields, "Region") { - ch := n.Child("region") - c.fn(&ch, "") - } - if s := string(v.Region); c.match(s) { - ch := n.Child("region") - if r, ok := c.fn(&ch, s); ok { - v.Region = (r) - } - } - if !n.IsRef("service_credential") { - if x := v.ServiceCredential; x != nil { - ch := n.Child("service_credential") - stringsCatalogModelProviderServiceConfigServiceCredential(c, &ch, x) - } - } -} - -func stringsCatalogModelProviderServiceConfigMicrosoftFoundryProviderDirectConfig(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigMicrosoftFoundryProviderDirectConfig) { - if n.isRef() { - return - } - if !n.IsRef("api_key") { - if x := v.ApiKey; x != nil { - ch := n.Child("api_key") - stringsCatalogModelProviderServiceConfigProviderSecret(c, &ch, x) - } - } - if c.mode == EmptyFields && v.BaseUrl == "" && Forced(v.ForceSendFields, "BaseUrl") { - ch := n.Child("base_url") - c.fn(&ch, "") - } - if s := string(v.BaseUrl); c.match(s) { - ch := n.Child("base_url") - if r, ok := c.fn(&ch, s); ok { - v.BaseUrl = (r) - } - } - if !n.IsRef("entra_service_principal") { - if x := v.EntraServicePrincipal; x != nil { - ch := n.Child("entra_service_principal") - stringsCatalogModelProviderServiceConfigEntraServicePrincipal(c, &ch, x) - } - } - if !n.IsRef("service_credential") { - if x := v.ServiceCredential; x != nil { - ch := n.Child("service_credential") - stringsCatalogModelProviderServiceConfigServiceCredential(c, &ch, x) - } - } -} - -func stringsCatalogModelProviderServiceConfigOpenAiProviderDirectConfig(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigOpenAiProviderDirectConfig) { - if n.isRef() { - return - } - if !n.IsRef("api_key") { - if x := v.ApiKey; x != nil { - ch := n.Child("api_key") - stringsCatalogModelProviderServiceConfigProviderSecret(c, &ch, x) - } - } - if c.mode == EmptyFields && v.BaseUrl == "" && Forced(v.ForceSendFields, "BaseUrl") { - ch := n.Child("base_url") - c.fn(&ch, "") - } - if s := string(v.BaseUrl); c.match(s) { - ch := n.Child("base_url") - if r, ok := c.fn(&ch, s); ok { - v.BaseUrl = (r) - } - } - if c.mode == EmptyFields && v.Organization == "" && Forced(v.ForceSendFields, "Organization") { - ch := n.Child("organization") - c.fn(&ch, "") - } - if s := string(v.Organization); c.match(s) { - ch := n.Child("organization") - if r, ok := c.fn(&ch, s); ok { - v.Organization = (r) - } - } -} - -func stringsSqlAlertV2Subscription(c *stringsWalk, n *Node, v *sql.AlertV2Subscription) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DestinationId == "" && Forced(v.ForceSendFields, "DestinationId") { - ch := n.Child("destination_id") - c.fn(&ch, "") - } - if s := string(v.DestinationId); c.match(s) { - ch := n.Child("destination_id") - if r, ok := c.fn(&ch, s); ok { - v.DestinationId = (r) - } - } - if c.mode == EmptyFields && v.UserEmail == "" && Forced(v.ForceSendFields, "UserEmail") { - ch := n.Child("user_email") - c.fn(&ch, "") - } - if s := string(v.UserEmail); c.match(s) { - ch := n.Child("user_email") - if r, ok := c.fn(&ch, s); ok { - v.UserEmail = (r) - } - } -} - -func stringsSqlAlertV2OperandValue(c *stringsWalk, n *Node, v *sql.AlertV2OperandValue) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.StringValue == "" && Forced(v.ForceSendFields, "StringValue") { - ch := n.Child("string_value") - c.fn(&ch, "") - } - if s := string(v.StringValue); c.match(s) { - ch := n.Child("string_value") - if r, ok := c.fn(&ch, s); ok { - v.StringValue = (r) - } - } -} - -func stringsDatabaseSyncedTablePipelineProgress(c *stringsWalk, n *Node, v *database.SyncedTablePipelineProgress) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ProvisioningPhase == "" && Forced(v.ForceSendFields, "ProvisioningPhase") { - ch := n.Child("provisioning_phase") - c.fn(&ch, "") - } - if s := string(v.ProvisioningPhase); c.match(s) { - ch := n.Child("provisioning_phase") - if r, ok := c.fn(&ch, s); ok { - v.ProvisioningPhase = database.ProvisioningPhase(r) - } - } -} - -func stringsDatabaseDeltaTableSyncInfo(c *stringsWalk, n *Node, v *database.DeltaTableSyncInfo) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DeltaCommitTimestamp == "" && Forced(v.ForceSendFields, "DeltaCommitTimestamp") { - ch := n.Child("delta_commit_timestamp") - c.fn(&ch, "") - } - if s := string(v.DeltaCommitTimestamp); c.match(s) { - ch := n.Child("delta_commit_timestamp") - if r, ok := c.fn(&ch, s); ok { - v.DeltaCommitTimestamp = (r) - } - } -} - -func stringsJobsComputeSpec(c *stringsWalk, n *Node, v *jobs.ComputeSpec) { - if n.isRef() { - return - } - if s := string(v.AcceleratorType); c.match(s) { - ch := n.Child("accelerator_type") - if r, ok := c.fn(&ch, s); ok { - v.AcceleratorType = jobs.ComputeSpecAcceleratorType(r) - } - } - if c.mode == EmptyFields && v.ProvisionedCapacityId == "" && Forced(v.ForceSendFields, "ProvisionedCapacityId") { - ch := n.Child("provisioned_capacity_id") - c.fn(&ch, "") - } - if s := string(v.ProvisionedCapacityId); c.match(s) { - ch := n.Child("provisioned_capacity_id") - if r, ok := c.fn(&ch, s); ok { - v.ProvisionedCapacityId = (r) - } - } -} - -func stringsJobsSubscriptionAttachment(c *stringsWalk, n *Node, v *jobs.SubscriptionAttachment) { - if n.isRef() { - return - } - if !n.IsRef("data_attachment") { - if x := v.DataAttachment; x != nil { - ch := n.Child("data_attachment") - stringsJobsSubscriptionAttachmentDataAttachment(c, &ch, x) - } - } - if !n.IsRef("page_attachment") { - if x := v.PageAttachment; x != nil { - ch := n.Child("page_attachment") - stringsJobsSubscriptionAttachmentPageAttachment(c, &ch, x) - } - } -} - -func stringsJobsSubscriptionSubscriber(c *stringsWalk, n *Node, v *jobs.SubscriptionSubscriber) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DestinationId == "" && Forced(v.ForceSendFields, "DestinationId") { - ch := n.Child("destination_id") - c.fn(&ch, "") - } - if s := string(v.DestinationId); c.match(s) { - ch := n.Child("destination_id") - if r, ok := c.fn(&ch, s); ok { - v.DestinationId = (r) - } - } - if c.mode == EmptyFields && v.UserName == "" && Forced(v.ForceSendFields, "UserName") { - ch := n.Child("user_name") - c.fn(&ch, "") - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } -} - -func stringsJobsSqlTaskSubscription(c *stringsWalk, n *Node, v *jobs.SqlTaskSubscription) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DestinationId == "" && Forced(v.ForceSendFields, "DestinationId") { - ch := n.Child("destination_id") - c.fn(&ch, "") - } - if s := string(v.DestinationId); c.match(s) { - ch := n.Child("destination_id") - if r, ok := c.fn(&ch, s); ok { - v.DestinationId = (r) - } - } - if c.mode == EmptyFields && v.UserName == "" && Forced(v.ForceSendFields, "UserName") { - ch := n.Child("user_name") - c.fn(&ch, "") - } - if s := string(v.UserName); c.match(s) { - ch := n.Child("user_name") - if r, ok := c.fn(&ch, s); ok { - v.UserName = (r) - } - } -} - -func stringsPipelinesConnectorOptions(c *stringsWalk, n *Node, v *pipelines.ConnectorOptions) { - if n.isRef() { - return - } - if !n.IsRef("api_source_connector_options") { - if x := v.ApiSourceConnectorOptions; x != nil { - ch := n.Child("api_source_connector_options") - stringsPipelinesApiSourceConnectorOptions(c, &ch, x) - } - } - if !n.IsRef("confluence_options") { - if x := v.ConfluenceOptions; x != nil { - ch := n.Child("confluence_options") - stringsPipelinesConfluenceConnectorOptions(c, &ch, x) - } - } - if !n.IsRef("gdrive_options") { - if x := v.GdriveOptions; x != nil { - ch := n.Child("gdrive_options") - stringsPipelinesGoogleDriveOptions(c, &ch, x) - } - } - if !n.IsRef("google_ads_options") { - if x := v.GoogleAdsOptions; x != nil { - ch := n.Child("google_ads_options") - stringsPipelinesGoogleAdsOptions(c, &ch, x) - } - } - if !n.IsRef("jira_options") { - if x := v.JiraOptions; x != nil { - ch := n.Child("jira_options") - stringsPipelinesJiraConnectorOptions(c, &ch, x) - } - } - if !n.IsRef("kafka_options") { - if x := v.KafkaOptions; x != nil { - ch := n.Child("kafka_options") - stringsPipelinesKafkaOptions(c, &ch, x) - } - } - if !n.IsRef("linkedin_ads_options") { - if x := v.LinkedinAdsOptions; x != nil { - ch := n.Child("linkedin_ads_options") - stringsPipelinesLinkedInAdsOptions(c, &ch, x) - } - } - if !n.IsRef("marketo_options") { - if x := v.MarketoOptions; x != nil { - ch := n.Child("marketo_options") - stringsPipelinesMarketoOptions(c, &ch, x) - } - } - if !n.IsRef("meta_ads_options") { - if x := v.MetaAdsOptions; x != nil { - ch := n.Child("meta_ads_options") - stringsPipelinesMetaMarketingOptions(c, &ch, x) - } - } - if !n.IsRef("onedrive_options") { - if x := v.OnedriveOptions; x != nil { - ch := n.Child("onedrive_options") - stringsPipelinesOneDriveOptions(c, &ch, x) - } - } - if !n.IsRef("outlook_options") { - if x := v.OutlookOptions; x != nil { - ch := n.Child("outlook_options") - stringsPipelinesOutlookOptions(c, &ch, x) - } - } - if !n.IsRef("rabbitmq_options") { - if x := v.RabbitmqOptions; x != nil { - ch := n.Child("rabbitmq_options") - stringsPipelinesRabbitmqOptions(c, &ch, x) - } - } - if !n.IsRef("reddit_ads_options") { - if x := v.RedditAdsOptions; x != nil { - ch := n.Child("reddit_ads_options") - stringsPipelinesRedditAdsOptions(c, &ch, x) - } - } - if !n.IsRef("sharepoint_options") { - if x := v.SharepointOptions; x != nil { - ch := n.Child("sharepoint_options") - stringsPipelinesSharepointOptions(c, &ch, x) - } - } - if !n.IsRef("tiktok_ads_options") { - if x := v.TiktokAdsOptions; x != nil { - ch := n.Child("tiktok_ads_options") - stringsPipelinesTikTokAdsOptions(c, &ch, x) - } - } - if !n.IsRef("zendesk_support_options") { - if x := v.ZendeskSupportOptions; x != nil { - ch := n.Child("zendesk_support_options") - stringsPipelinesZendeskSupportOptions(c, &ch, x) - } - } -} - -func stringsPipelinesIngestionPipelineDefinitionFanoutOptions(c *stringsWalk, n *Node, v *pipelines.IngestionPipelineDefinitionFanoutOptions) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.FanoutBy == "" && Forced(v.ForceSendFields, "FanoutBy") { - ch := n.Child("fanout_by") - c.fn(&ch, "") - } - if s := string(v.FanoutBy); c.match(s) { - ch := n.Child("fanout_by") - if r, ok := c.fn(&ch, s); ok { - v.FanoutBy = (r) - } - } - if !n.IsRef("transforms") { - if len(v.Transforms) > 0 { - cn := n.Child("transforms") - for i := range v.Transforms { - { - ch := cn.Elem(i) - stringsPipelinesTransformer(c, &ch, &v.Transforms[i]) - } - } - } - } -} - -func stringsPipelinesPostgresCatalogConfig(c *stringsWalk, n *Node, v *pipelines.PostgresCatalogConfig) { - if n.isRef() { - return - } - if !n.IsRef("slot_config") { - if x := v.SlotConfig; x != nil { - ch := n.Child("slot_config") - stringsPipelinesPostgresSlotConfig(c, &ch, x) - } - } -} - -func stringsPipelinesIngestionPipelineDefinitionWorkdayReportParametersQueryKeyValue(c *stringsWalk, n *Node, v *pipelines.IngestionPipelineDefinitionWorkdayReportParametersQueryKeyValue) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Key == "" && Forced(v.ForceSendFields, "Key") { - ch := n.Child("key") - c.fn(&ch, "") - } - if s := string(v.Key); c.match(s) { - ch := n.Child("key") - if r, ok := c.fn(&ch, s); ok { - v.Key = (r) - } - } - if c.mode == EmptyFields && v.Value == "" && Forced(v.ForceSendFields, "Value") { - ch := n.Child("value") - c.fn(&ch, "") - } - if s := string(v.Value); c.match(s) { - ch := n.Child("value") - if r, ok := c.fn(&ch, s); ok { - v.Value = (r) - } - } -} - -func stringsMlFieldDefinition(c *stringsWalk, n *Node, v *ml.FieldDefinition) { - if n.isRef() { - return - } - if s := string(v.DataType); c.match(s) { - ch := n.Child("data_type") - if r, ok := c.fn(&ch, s); ok { - v.DataType = ml.ScalarDataType(r) - } - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } -} - -func stringsServingAiGatewayGuardrailPiiBehavior(c *stringsWalk, n *Node, v *serving.AiGatewayGuardrailPiiBehavior) { - if n.isRef() { - return - } - if s := string(v.Behavior); c.match(s) { - ch := n.Child("behavior") - if r, ok := c.fn(&ch, s); ok { - v.Behavior = serving.AiGatewayGuardrailPiiBehaviorBehavior(r) - } - } -} - -func stringsServingAi21LabsConfig(c *stringsWalk, n *Node, v *serving.Ai21LabsConfig) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Ai21labsApiKey == "" && Forced(v.ForceSendFields, "Ai21labsApiKey") { - ch := n.Child("ai21labs_api_key") - c.fn(&ch, "") - } - if s := string(v.Ai21labsApiKey); c.match(s) { - ch := n.Child("ai21labs_api_key") - if r, ok := c.fn(&ch, s); ok { - v.Ai21labsApiKey = (r) - } - } - if c.mode == EmptyFields && v.Ai21labsApiKeyPlaintext == "" && Forced(v.ForceSendFields, "Ai21labsApiKeyPlaintext") { - ch := n.Child("ai21labs_api_key_plaintext") - c.fn(&ch, "") - } - if s := string(v.Ai21labsApiKeyPlaintext); c.match(s) { - ch := n.Child("ai21labs_api_key_plaintext") - if r, ok := c.fn(&ch, s); ok { - v.Ai21labsApiKeyPlaintext = (r) - } - } -} - -func stringsServingAmazonBedrockConfig(c *stringsWalk, n *Node, v *serving.AmazonBedrockConfig) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.AwsAccessKeyId == "" && Forced(v.ForceSendFields, "AwsAccessKeyId") { - ch := n.Child("aws_access_key_id") - c.fn(&ch, "") - } - if s := string(v.AwsAccessKeyId); c.match(s) { - ch := n.Child("aws_access_key_id") - if r, ok := c.fn(&ch, s); ok { - v.AwsAccessKeyId = (r) - } - } - if c.mode == EmptyFields && v.AwsAccessKeyIdPlaintext == "" && Forced(v.ForceSendFields, "AwsAccessKeyIdPlaintext") { - ch := n.Child("aws_access_key_id_plaintext") - c.fn(&ch, "") - } - if s := string(v.AwsAccessKeyIdPlaintext); c.match(s) { - ch := n.Child("aws_access_key_id_plaintext") - if r, ok := c.fn(&ch, s); ok { - v.AwsAccessKeyIdPlaintext = (r) - } - } - if s := string(v.AwsRegion); c.match(s) { - ch := n.Child("aws_region") - if r, ok := c.fn(&ch, s); ok { - v.AwsRegion = (r) - } - } - if c.mode == EmptyFields && v.AwsSecretAccessKey == "" && Forced(v.ForceSendFields, "AwsSecretAccessKey") { - ch := n.Child("aws_secret_access_key") - c.fn(&ch, "") - } - if s := string(v.AwsSecretAccessKey); c.match(s) { - ch := n.Child("aws_secret_access_key") - if r, ok := c.fn(&ch, s); ok { - v.AwsSecretAccessKey = (r) - } - } - if c.mode == EmptyFields && v.AwsSecretAccessKeyPlaintext == "" && Forced(v.ForceSendFields, "AwsSecretAccessKeyPlaintext") { - ch := n.Child("aws_secret_access_key_plaintext") - c.fn(&ch, "") - } - if s := string(v.AwsSecretAccessKeyPlaintext); c.match(s) { - ch := n.Child("aws_secret_access_key_plaintext") - if r, ok := c.fn(&ch, s); ok { - v.AwsSecretAccessKeyPlaintext = (r) - } - } - if s := string(v.BedrockProvider); c.match(s) { - ch := n.Child("bedrock_provider") - if r, ok := c.fn(&ch, s); ok { - v.BedrockProvider = serving.AmazonBedrockConfigBedrockProvider(r) - } - } - if c.mode == EmptyFields && v.InstanceProfileArn == "" && Forced(v.ForceSendFields, "InstanceProfileArn") { - ch := n.Child("instance_profile_arn") - c.fn(&ch, "") - } - if s := string(v.InstanceProfileArn); c.match(s) { - ch := n.Child("instance_profile_arn") - if r, ok := c.fn(&ch, s); ok { - v.InstanceProfileArn = (r) - } - } - if c.mode == EmptyFields && v.UcServiceCredentialName == "" && Forced(v.ForceSendFields, "UcServiceCredentialName") { - ch := n.Child("uc_service_credential_name") - c.fn(&ch, "") - } - if s := string(v.UcServiceCredentialName); c.match(s) { - ch := n.Child("uc_service_credential_name") - if r, ok := c.fn(&ch, s); ok { - v.UcServiceCredentialName = (r) - } - } -} - -func stringsServingAnthropicConfig(c *stringsWalk, n *Node, v *serving.AnthropicConfig) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.AnthropicApiKey == "" && Forced(v.ForceSendFields, "AnthropicApiKey") { - ch := n.Child("anthropic_api_key") - c.fn(&ch, "") - } - if s := string(v.AnthropicApiKey); c.match(s) { - ch := n.Child("anthropic_api_key") - if r, ok := c.fn(&ch, s); ok { - v.AnthropicApiKey = (r) - } - } - if c.mode == EmptyFields && v.AnthropicApiKeyPlaintext == "" && Forced(v.ForceSendFields, "AnthropicApiKeyPlaintext") { - ch := n.Child("anthropic_api_key_plaintext") - c.fn(&ch, "") - } - if s := string(v.AnthropicApiKeyPlaintext); c.match(s) { - ch := n.Child("anthropic_api_key_plaintext") - if r, ok := c.fn(&ch, s); ok { - v.AnthropicApiKeyPlaintext = (r) - } - } -} - -func stringsServingCohereConfig(c *stringsWalk, n *Node, v *serving.CohereConfig) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.CohereApiBase == "" && Forced(v.ForceSendFields, "CohereApiBase") { - ch := n.Child("cohere_api_base") - c.fn(&ch, "") - } - if s := string(v.CohereApiBase); c.match(s) { - ch := n.Child("cohere_api_base") - if r, ok := c.fn(&ch, s); ok { - v.CohereApiBase = (r) - } - } - if c.mode == EmptyFields && v.CohereApiKey == "" && Forced(v.ForceSendFields, "CohereApiKey") { - ch := n.Child("cohere_api_key") - c.fn(&ch, "") - } - if s := string(v.CohereApiKey); c.match(s) { - ch := n.Child("cohere_api_key") - if r, ok := c.fn(&ch, s); ok { - v.CohereApiKey = (r) - } - } - if c.mode == EmptyFields && v.CohereApiKeyPlaintext == "" && Forced(v.ForceSendFields, "CohereApiKeyPlaintext") { - ch := n.Child("cohere_api_key_plaintext") - c.fn(&ch, "") - } - if s := string(v.CohereApiKeyPlaintext); c.match(s) { - ch := n.Child("cohere_api_key_plaintext") - if r, ok := c.fn(&ch, s); ok { - v.CohereApiKeyPlaintext = (r) - } - } -} - -func stringsServingCustomProviderConfig(c *stringsWalk, n *Node, v *serving.CustomProviderConfig) { - if n.isRef() { - return - } - if !n.IsRef("api_key_auth") { - if x := v.ApiKeyAuth; x != nil { - ch := n.Child("api_key_auth") - stringsServingApiKeyAuth(c, &ch, x) - } - } - if !n.IsRef("bearer_token_auth") { - if x := v.BearerTokenAuth; x != nil { - ch := n.Child("bearer_token_auth") - stringsServingBearerTokenAuth(c, &ch, x) - } - } - if s := string(v.CustomProviderUrl); c.match(s) { - ch := n.Child("custom_provider_url") - if r, ok := c.fn(&ch, s); ok { - v.CustomProviderUrl = (r) - } - } -} - -func stringsServingDatabricksModelServingConfig(c *stringsWalk, n *Node, v *serving.DatabricksModelServingConfig) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DatabricksApiToken == "" && Forced(v.ForceSendFields, "DatabricksApiToken") { - ch := n.Child("databricks_api_token") - c.fn(&ch, "") - } - if s := string(v.DatabricksApiToken); c.match(s) { - ch := n.Child("databricks_api_token") - if r, ok := c.fn(&ch, s); ok { - v.DatabricksApiToken = (r) - } - } - if c.mode == EmptyFields && v.DatabricksApiTokenPlaintext == "" && Forced(v.ForceSendFields, "DatabricksApiTokenPlaintext") { - ch := n.Child("databricks_api_token_plaintext") - c.fn(&ch, "") - } - if s := string(v.DatabricksApiTokenPlaintext); c.match(s) { - ch := n.Child("databricks_api_token_plaintext") - if r, ok := c.fn(&ch, s); ok { - v.DatabricksApiTokenPlaintext = (r) - } - } - if s := string(v.DatabricksWorkspaceUrl); c.match(s) { - ch := n.Child("databricks_workspace_url") - if r, ok := c.fn(&ch, s); ok { - v.DatabricksWorkspaceUrl = (r) - } - } -} - -func stringsServingGoogleCloudVertexAiConfig(c *stringsWalk, n *Node, v *serving.GoogleCloudVertexAiConfig) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.PrivateKey == "" && Forced(v.ForceSendFields, "PrivateKey") { - ch := n.Child("private_key") - c.fn(&ch, "") - } - if s := string(v.PrivateKey); c.match(s) { - ch := n.Child("private_key") - if r, ok := c.fn(&ch, s); ok { - v.PrivateKey = (r) - } - } - if c.mode == EmptyFields && v.PrivateKeyPlaintext == "" && Forced(v.ForceSendFields, "PrivateKeyPlaintext") { - ch := n.Child("private_key_plaintext") - c.fn(&ch, "") - } - if s := string(v.PrivateKeyPlaintext); c.match(s) { - ch := n.Child("private_key_plaintext") - if r, ok := c.fn(&ch, s); ok { - v.PrivateKeyPlaintext = (r) - } - } - if s := string(v.ProjectId); c.match(s) { - ch := n.Child("project_id") - if r, ok := c.fn(&ch, s); ok { - v.ProjectId = (r) - } - } - if s := string(v.Region); c.match(s) { - ch := n.Child("region") - if r, ok := c.fn(&ch, s); ok { - v.Region = (r) - } - } -} - -func stringsServingOpenAiConfig(c *stringsWalk, n *Node, v *serving.OpenAiConfig) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.MicrosoftEntraClientId == "" && Forced(v.ForceSendFields, "MicrosoftEntraClientId") { - ch := n.Child("microsoft_entra_client_id") - c.fn(&ch, "") - } - if s := string(v.MicrosoftEntraClientId); c.match(s) { - ch := n.Child("microsoft_entra_client_id") - if r, ok := c.fn(&ch, s); ok { - v.MicrosoftEntraClientId = (r) - } - } - if c.mode == EmptyFields && v.MicrosoftEntraClientSecret == "" && Forced(v.ForceSendFields, "MicrosoftEntraClientSecret") { - ch := n.Child("microsoft_entra_client_secret") - c.fn(&ch, "") - } - if s := string(v.MicrosoftEntraClientSecret); c.match(s) { - ch := n.Child("microsoft_entra_client_secret") - if r, ok := c.fn(&ch, s); ok { - v.MicrosoftEntraClientSecret = (r) - } - } - if c.mode == EmptyFields && v.MicrosoftEntraClientSecretPlaintext == "" && Forced(v.ForceSendFields, "MicrosoftEntraClientSecretPlaintext") { - ch := n.Child("microsoft_entra_client_secret_plaintext") - c.fn(&ch, "") - } - if s := string(v.MicrosoftEntraClientSecretPlaintext); c.match(s) { - ch := n.Child("microsoft_entra_client_secret_plaintext") - if r, ok := c.fn(&ch, s); ok { - v.MicrosoftEntraClientSecretPlaintext = (r) - } - } - if c.mode == EmptyFields && v.MicrosoftEntraTenantId == "" && Forced(v.ForceSendFields, "MicrosoftEntraTenantId") { - ch := n.Child("microsoft_entra_tenant_id") - c.fn(&ch, "") - } - if s := string(v.MicrosoftEntraTenantId); c.match(s) { - ch := n.Child("microsoft_entra_tenant_id") - if r, ok := c.fn(&ch, s); ok { - v.MicrosoftEntraTenantId = (r) - } - } - if c.mode == EmptyFields && v.OpenaiApiBase == "" && Forced(v.ForceSendFields, "OpenaiApiBase") { - ch := n.Child("openai_api_base") - c.fn(&ch, "") - } - if s := string(v.OpenaiApiBase); c.match(s) { - ch := n.Child("openai_api_base") - if r, ok := c.fn(&ch, s); ok { - v.OpenaiApiBase = (r) - } - } - if c.mode == EmptyFields && v.OpenaiApiKey == "" && Forced(v.ForceSendFields, "OpenaiApiKey") { - ch := n.Child("openai_api_key") - c.fn(&ch, "") - } - if s := string(v.OpenaiApiKey); c.match(s) { - ch := n.Child("openai_api_key") - if r, ok := c.fn(&ch, s); ok { - v.OpenaiApiKey = (r) - } - } - if c.mode == EmptyFields && v.OpenaiApiKeyPlaintext == "" && Forced(v.ForceSendFields, "OpenaiApiKeyPlaintext") { - ch := n.Child("openai_api_key_plaintext") - c.fn(&ch, "") - } - if s := string(v.OpenaiApiKeyPlaintext); c.match(s) { - ch := n.Child("openai_api_key_plaintext") - if r, ok := c.fn(&ch, s); ok { - v.OpenaiApiKeyPlaintext = (r) - } - } - if c.mode == EmptyFields && v.OpenaiApiType == "" && Forced(v.ForceSendFields, "OpenaiApiType") { - ch := n.Child("openai_api_type") - c.fn(&ch, "") - } - if s := string(v.OpenaiApiType); c.match(s) { - ch := n.Child("openai_api_type") - if r, ok := c.fn(&ch, s); ok { - v.OpenaiApiType = (r) - } - } - if c.mode == EmptyFields && v.OpenaiApiVersion == "" && Forced(v.ForceSendFields, "OpenaiApiVersion") { - ch := n.Child("openai_api_version") - c.fn(&ch, "") - } - if s := string(v.OpenaiApiVersion); c.match(s) { - ch := n.Child("openai_api_version") - if r, ok := c.fn(&ch, s); ok { - v.OpenaiApiVersion = (r) - } - } - if c.mode == EmptyFields && v.OpenaiDeploymentName == "" && Forced(v.ForceSendFields, "OpenaiDeploymentName") { - ch := n.Child("openai_deployment_name") - c.fn(&ch, "") - } - if s := string(v.OpenaiDeploymentName); c.match(s) { - ch := n.Child("openai_deployment_name") - if r, ok := c.fn(&ch, s); ok { - v.OpenaiDeploymentName = (r) - } - } - if c.mode == EmptyFields && v.OpenaiOrganization == "" && Forced(v.ForceSendFields, "OpenaiOrganization") { - ch := n.Child("openai_organization") - c.fn(&ch, "") - } - if s := string(v.OpenaiOrganization); c.match(s) { - ch := n.Child("openai_organization") - if r, ok := c.fn(&ch, s); ok { - v.OpenaiOrganization = (r) - } - } -} - -func stringsServingPaLmConfig(c *stringsWalk, n *Node, v *serving.PaLmConfig) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.PalmApiKey == "" && Forced(v.ForceSendFields, "PalmApiKey") { - ch := n.Child("palm_api_key") - c.fn(&ch, "") - } - if s := string(v.PalmApiKey); c.match(s) { - ch := n.Child("palm_api_key") - if r, ok := c.fn(&ch, s); ok { - v.PalmApiKey = (r) - } - } - if c.mode == EmptyFields && v.PalmApiKeyPlaintext == "" && Forced(v.ForceSendFields, "PalmApiKeyPlaintext") { - ch := n.Child("palm_api_key_plaintext") - c.fn(&ch, "") - } - if s := string(v.PalmApiKeyPlaintext); c.match(s) { - ch := n.Child("palm_api_key_plaintext") - if r, ok := c.fn(&ch, s); ok { - v.PalmApiKeyPlaintext = (r) - } - } -} - -func stringsCatalogModelServiceConfigExternalModelConfig(c *stringsWalk, n *Node, v *catalog.ModelServiceConfigExternalModelConfig) { - if n.isRef() { - return - } - if s := string(v.ModelProviderService); c.match(s) { - ch := n.Child("model_provider_service") - if r, ok := c.fn(&ch, s); ok { - v.ModelProviderService = (r) - } - } - if !n.IsRef("target") { - { - ch := n.Child("target") - stringsCatalogModelProviderServiceConfigModelTargetConfig(c, &ch, &v.Target) - } - } -} - -func stringsCatalogModelServiceConfigPayPerTokenConfig(c *stringsWalk, n *Node, v *catalog.ModelServiceConfigPayPerTokenConfig) { - if n.isRef() { - return - } - if s := string(v.Model); c.match(s) { - ch := n.Child("model") - if r, ok := c.fn(&ch, s); ok { - v.Model = (r) - } - } -} - -func stringsCatalogModelServiceConfigProvisionedThroughputConfig(c *stringsWalk, n *Node, v *catalog.ModelServiceConfigProvisionedThroughputConfig) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Model == "" && Forced(v.ForceSendFields, "Model") { - ch := n.Child("model") - c.fn(&ch, "") - } - if s := string(v.Model); c.match(s) { - ch := n.Child("model") - if r, ok := c.fn(&ch, s); ok { - v.Model = (r) - } - } - if s := string(v.ModelServingEndpoint); c.match(s) { - ch := n.Child("model_serving_endpoint") - if r, ok := c.fn(&ch, s); ok { - v.ModelServingEndpoint = (r) - } - } -} - -func stringsCatalogModelProviderServiceConfigAwsAccessKey(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigAwsAccessKey) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.AccessKeyId == "" && Forced(v.ForceSendFields, "AccessKeyId") { - ch := n.Child("access_key_id") - c.fn(&ch, "") - } - if s := string(v.AccessKeyId); c.match(s) { - ch := n.Child("access_key_id") - if r, ok := c.fn(&ch, s); ok { - v.AccessKeyId = (r) - } - } - if !n.IsRef("secret_access_key") { - if x := v.SecretAccessKey; x != nil { - ch := n.Child("secret_access_key") - stringsCatalogModelProviderServiceConfigProviderSecret(c, &ch, x) - } - } -} - -func stringsCatalogModelProviderServiceConfigServiceCredential(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigServiceCredential) { - if n.isRef() { - return - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } -} - -func stringsCatalogModelProviderServiceConfigProviderSecret(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigProviderSecret) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Plaintext == "" && Forced(v.ForceSendFields, "Plaintext") { - ch := n.Child("plaintext") - c.fn(&ch, "") - } - if s := string(v.Plaintext); c.match(s) { - ch := n.Child("plaintext") - if r, ok := c.fn(&ch, s); ok { - v.Plaintext = (r) - } - } - if !n.IsRef("secret_reference") { - if x := v.SecretReference; x != nil { - ch := n.Child("secret_reference") - stringsCatalogModelProviderServiceConfigSecretReference(c, &ch, x) - } - } -} - -func stringsCatalogModelProviderServiceConfigEntraServicePrincipal(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigEntraServicePrincipal) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ClientId == "" && Forced(v.ForceSendFields, "ClientId") { - ch := n.Child("client_id") - c.fn(&ch, "") - } - if s := string(v.ClientId); c.match(s) { - ch := n.Child("client_id") - if r, ok := c.fn(&ch, s); ok { - v.ClientId = (r) - } - } - if !n.IsRef("client_secret") { - if x := v.ClientSecret; x != nil { - ch := n.Child("client_secret") - stringsCatalogModelProviderServiceConfigProviderSecret(c, &ch, x) - } - } - if c.mode == EmptyFields && v.TenantId == "" && Forced(v.ForceSendFields, "TenantId") { - ch := n.Child("tenant_id") - c.fn(&ch, "") - } - if s := string(v.TenantId); c.match(s) { - ch := n.Child("tenant_id") - if r, ok := c.fn(&ch, s); ok { - v.TenantId = (r) - } - } -} - -func stringsCatalogModelProviderServiceConfigCustomProviderApiKeyHeaderAuth(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigCustomProviderApiKeyHeaderAuth) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ApiKeyName == "" && Forced(v.ForceSendFields, "ApiKeyName") { - ch := n.Child("api_key_name") - c.fn(&ch, "") - } - if s := string(v.ApiKeyName); c.match(s) { - ch := n.Child("api_key_name") - if r, ok := c.fn(&ch, s); ok { - v.ApiKeyName = (r) - } - } - if !n.IsRef("api_key_value") { - if x := v.ApiKeyValue; x != nil { - ch := n.Child("api_key_value") - stringsCatalogModelProviderServiceConfigProviderSecret(c, &ch, x) - } - } -} - -func stringsJobsSubscriptionAttachmentDataAttachment(c *stringsWalk, n *Node, v *jobs.SubscriptionAttachmentDataAttachment) { - if n.isRef() { - return - } - if s := string(v.FileFormat); c.match(s) { - ch := n.Child("file_format") - if r, ok := c.fn(&ch, s); ok { - v.FileFormat = jobs.SubscriptionAttachmentDataAttachmentFileFormat(r) - } - } - if !n.IsRef("widgets") { - if len(v.Widgets) > 0 { - cn := n.Child("widgets") - for i := range v.Widgets { - { - ch := cn.Elem(i) - stringsJobsSubscriptionAttachmentDataAttachmentWidget(c, &ch, &v.Widgets[i]) - } - } - } - } -} - -func stringsJobsSubscriptionAttachmentPageAttachment(c *stringsWalk, n *Node, v *jobs.SubscriptionAttachmentPageAttachment) { - if n.isRef() { - return - } - if !n.IsRef("page_ids") { - if len(v.PageIds) > 0 { - cn := n.Child("page_ids") - for i := range v.PageIds { - if s := string(v.PageIds[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.PageIds[i] = (r) - } - } - } - } - } - if s := string(v.PageSelection); c.match(s) { - ch := n.Child("page_selection") - if r, ok := c.fn(&ch, s); ok { - v.PageSelection = jobs.SubscriptionAttachmentPageAttachmentPageSelection(r) - } - } -} - -func stringsPipelinesApiSourceConnectorOptions(c *stringsWalk, n *Node, v *pipelines.ApiSourceConnectorOptions) { - if n.isRef() { - return - } - if !n.IsRef("options") { - if len(v.Options) > 0 { - cn := n.Child("options") - for _, k := range sortedKeys(v.Options) { - if s := string(v.Options[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.Options[k] = (r) - } - } - } - } - } -} - -func stringsPipelinesConfluenceConnectorOptions(c *stringsWalk, n *Node, v *pipelines.ConfluenceConnectorOptions) { - if n.isRef() { - return - } - if !n.IsRef("include_confluence_spaces") { - if len(v.IncludeConfluenceSpaces) > 0 { - cn := n.Child("include_confluence_spaces") - for i := range v.IncludeConfluenceSpaces { - if s := string(v.IncludeConfluenceSpaces[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.IncludeConfluenceSpaces[i] = (r) - } - } - } - } - } -} - -func stringsPipelinesGoogleDriveOptions(c *stringsWalk, n *Node, v *pipelines.GoogleDriveOptions) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.EntityType == "" && Forced(v.ForceSendFields, "EntityType") { - ch := n.Child("entity_type") - c.fn(&ch, "") - } - if s := string(v.EntityType); c.match(s) { - ch := n.Child("entity_type") - if r, ok := c.fn(&ch, s); ok { - v.EntityType = pipelines.GoogleDriveOptionsGoogleDriveEntityType(r) - } - } - if !n.IsRef("file_ingestion_options") { - if x := v.FileIngestionOptions; x != nil { - ch := n.Child("file_ingestion_options") - stringsPipelinesFileIngestionOptions(c, &ch, x) - } - } - if c.mode == EmptyFields && v.Url == "" && Forced(v.ForceSendFields, "Url") { - ch := n.Child("url") - c.fn(&ch, "") - } - if s := string(v.Url); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.Url = (r) - } - } -} - -func stringsPipelinesGoogleAdsOptions(c *stringsWalk, n *Node, v *pipelines.GoogleAdsOptions) { - if n.isRef() { - return - } - if !n.IsRef("custom_report_options") { - if x := v.CustomReportOptions; x != nil { - ch := n.Child("custom_report_options") - stringsPipelinesGoogleAdsCustomReportOptions(c, &ch, x) - } - } - if s := string(v.ManagerAccountId); c.match(s) { - ch := n.Child("manager_account_id") - if r, ok := c.fn(&ch, s); ok { - v.ManagerAccountId = (r) - } - } - if c.mode == EmptyFields && v.SyncStartDate == "" && Forced(v.ForceSendFields, "SyncStartDate") { - ch := n.Child("sync_start_date") - c.fn(&ch, "") - } - if s := string(v.SyncStartDate); c.match(s) { - ch := n.Child("sync_start_date") - if r, ok := c.fn(&ch, s); ok { - v.SyncStartDate = (r) - } - } -} - -func stringsPipelinesJiraConnectorOptions(c *stringsWalk, n *Node, v *pipelines.JiraConnectorOptions) { - if n.isRef() { - return - } - if !n.IsRef("include_jira_spaces") { - if len(v.IncludeJiraSpaces) > 0 { - cn := n.Child("include_jira_spaces") - for i := range v.IncludeJiraSpaces { - if s := string(v.IncludeJiraSpaces[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.IncludeJiraSpaces[i] = (r) - } - } - } - } - } -} - -func stringsPipelinesKafkaOptions(c *stringsWalk, n *Node, v *pipelines.KafkaOptions) { - if n.isRef() { - return - } - if !n.IsRef("client_config") { - if len(v.ClientConfig) > 0 { - cn := n.Child("client_config") - for _, k := range sortedKeys(v.ClientConfig) { - if s := string(v.ClientConfig[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.ClientConfig[k] = (r) - } - } - } - } - } - if !n.IsRef("key_transformer") { - if x := v.KeyTransformer; x != nil { - ch := n.Child("key_transformer") - stringsPipelinesTransformer(c, &ch, x) - } - } - if c.mode == EmptyFields && v.StartingOffset == "" && Forced(v.ForceSendFields, "StartingOffset") { - ch := n.Child("starting_offset") - c.fn(&ch, "") - } - if s := string(v.StartingOffset); c.match(s) { - ch := n.Child("starting_offset") - if r, ok := c.fn(&ch, s); ok { - v.StartingOffset = (r) - } - } - if c.mode == EmptyFields && v.TopicPattern == "" && Forced(v.ForceSendFields, "TopicPattern") { - ch := n.Child("topic_pattern") - c.fn(&ch, "") - } - if s := string(v.TopicPattern); c.match(s) { - ch := n.Child("topic_pattern") - if r, ok := c.fn(&ch, s); ok { - v.TopicPattern = (r) - } - } - if !n.IsRef("topics") { - if len(v.Topics) > 0 { - cn := n.Child("topics") - for i := range v.Topics { - if s := string(v.Topics[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Topics[i] = (r) - } - } - } - } - } - if !n.IsRef("value_transformer") { - if x := v.ValueTransformer; x != nil { - ch := n.Child("value_transformer") - stringsPipelinesTransformer(c, &ch, x) - } - } -} - -func stringsPipelinesLinkedInAdsOptions(c *stringsWalk, n *Node, v *pipelines.LinkedInAdsOptions) { - if n.isRef() { - return - } - if !n.IsRef("custom_report_options") { - if x := v.CustomReportOptions; x != nil { - ch := n.Child("custom_report_options") - stringsPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptions(c, &ch, x) - } - } - if c.mode == EmptyFields && v.SyncStartDate == "" && Forced(v.ForceSendFields, "SyncStartDate") { - ch := n.Child("sync_start_date") - c.fn(&ch, "") - } - if s := string(v.SyncStartDate); c.match(s) { - ch := n.Child("sync_start_date") - if r, ok := c.fn(&ch, s); ok { - v.SyncStartDate = (r) - } - } -} - -func stringsPipelinesMarketoOptions(c *stringsWalk, n *Node, v *pipelines.MarketoOptions) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.SyncStartDate == "" && Forced(v.ForceSendFields, "SyncStartDate") { - ch := n.Child("sync_start_date") - c.fn(&ch, "") - } - if s := string(v.SyncStartDate); c.match(s) { - ch := n.Child("sync_start_date") - if r, ok := c.fn(&ch, s); ok { - v.SyncStartDate = (r) - } - } -} - -func stringsPipelinesMetaMarketingOptions(c *stringsWalk, n *Node, v *pipelines.MetaMarketingOptions) { - if n.isRef() { - return - } - if !n.IsRef("action_attribution_windows") { - if len(v.ActionAttributionWindows) > 0 { - cn := n.Child("action_attribution_windows") - for i := range v.ActionAttributionWindows { - if s := string(v.ActionAttributionWindows[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.ActionAttributionWindows[i] = (r) - } - } - } - } - } - if !n.IsRef("action_breakdowns") { - if len(v.ActionBreakdowns) > 0 { - cn := n.Child("action_breakdowns") - for i := range v.ActionBreakdowns { - if s := string(v.ActionBreakdowns[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.ActionBreakdowns[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.ActionReportTime == "" && Forced(v.ForceSendFields, "ActionReportTime") { - ch := n.Child("action_report_time") - c.fn(&ch, "") - } - if s := string(v.ActionReportTime); c.match(s) { - ch := n.Child("action_report_time") - if r, ok := c.fn(&ch, s); ok { - v.ActionReportTime = (r) - } - } - if !n.IsRef("breakdowns") { - if len(v.Breakdowns) > 0 { - cn := n.Child("breakdowns") - for i := range v.Breakdowns { - if s := string(v.Breakdowns[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Breakdowns[i] = (r) - } - } - } - } - } - if !n.IsRef("custom_report_options") { - if x := v.CustomReportOptions; x != nil { - ch := n.Child("custom_report_options") - stringsPipelinesMetaMarketingOptionsMetaMarketingCustomReportOptions(c, &ch, x) - } - } - if c.mode == EmptyFields && v.Level == "" && Forced(v.ForceSendFields, "Level") { - ch := n.Child("level") - c.fn(&ch, "") - } - if s := string(v.Level); c.match(s) { - ch := n.Child("level") - if r, ok := c.fn(&ch, s); ok { - v.Level = (r) - } - } - if c.mode == EmptyFields && v.StartDate == "" && Forced(v.ForceSendFields, "StartDate") { - ch := n.Child("start_date") - c.fn(&ch, "") - } - if s := string(v.StartDate); c.match(s) { - ch := n.Child("start_date") - if r, ok := c.fn(&ch, s); ok { - v.StartDate = (r) - } - } - if c.mode == EmptyFields && v.TimeIncrement == "" && Forced(v.ForceSendFields, "TimeIncrement") { - ch := n.Child("time_increment") - c.fn(&ch, "") - } - if s := string(v.TimeIncrement); c.match(s) { - ch := n.Child("time_increment") - if r, ok := c.fn(&ch, s); ok { - v.TimeIncrement = (r) - } - } -} - -func stringsPipelinesOneDriveOptions(c *stringsWalk, n *Node, v *pipelines.OneDriveOptions) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.EntityType == "" && Forced(v.ForceSendFields, "EntityType") { - ch := n.Child("entity_type") - c.fn(&ch, "") - } - if s := string(v.EntityType); c.match(s) { - ch := n.Child("entity_type") - if r, ok := c.fn(&ch, s); ok { - v.EntityType = pipelines.OneDriveOptionsOneDriveEntityType(r) - } - } - if !n.IsRef("file_ingestion_options") { - if x := v.FileIngestionOptions; x != nil { - ch := n.Child("file_ingestion_options") - stringsPipelinesFileIngestionOptions(c, &ch, x) - } - } - if c.mode == EmptyFields && v.Url == "" && Forced(v.ForceSendFields, "Url") { - ch := n.Child("url") - c.fn(&ch, "") - } - if s := string(v.Url); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.Url = (r) - } - } -} - -func stringsPipelinesOutlookOptions(c *stringsWalk, n *Node, v *pipelines.OutlookOptions) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.AttachmentMode == "" && Forced(v.ForceSendFields, "AttachmentMode") { - ch := n.Child("attachment_mode") - c.fn(&ch, "") - } - if s := string(v.AttachmentMode); c.match(s) { - ch := n.Child("attachment_mode") - if r, ok := c.fn(&ch, s); ok { - v.AttachmentMode = pipelines.OutlookAttachmentMode(r) - } - } - if c.mode == EmptyFields && v.BodyFormat == "" && Forced(v.ForceSendFields, "BodyFormat") { - ch := n.Child("body_format") - c.fn(&ch, "") - } - if s := string(v.BodyFormat); c.match(s) { - ch := n.Child("body_format") - if r, ok := c.fn(&ch, s); ok { - v.BodyFormat = pipelines.OutlookBodyFormat(r) - } - } - if !n.IsRef("folder_filter") { - if len(v.FolderFilter) > 0 { - cn := n.Child("folder_filter") - for i := range v.FolderFilter { - if s := string(v.FolderFilter[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.FolderFilter[i] = (r) - } - } - } - } - } - if !n.IsRef("include_folders") { - if len(v.IncludeFolders) > 0 { - cn := n.Child("include_folders") - for i := range v.IncludeFolders { - if s := string(v.IncludeFolders[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.IncludeFolders[i] = (r) - } - } - } - } - } - if !n.IsRef("include_mailboxes") { - if len(v.IncludeMailboxes) > 0 { - cn := n.Child("include_mailboxes") - for i := range v.IncludeMailboxes { - if s := string(v.IncludeMailboxes[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.IncludeMailboxes[i] = (r) - } - } - } - } - } - if !n.IsRef("include_senders") { - if len(v.IncludeSenders) > 0 { - cn := n.Child("include_senders") - for i := range v.IncludeSenders { - if s := string(v.IncludeSenders[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.IncludeSenders[i] = (r) - } - } - } - } - } - if !n.IsRef("include_subjects") { - if len(v.IncludeSubjects) > 0 { - cn := n.Child("include_subjects") - for i := range v.IncludeSubjects { - if s := string(v.IncludeSubjects[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.IncludeSubjects[i] = (r) - } - } - } - } - } - if !n.IsRef("sender_filter") { - if len(v.SenderFilter) > 0 { - cn := n.Child("sender_filter") - for i := range v.SenderFilter { - if s := string(v.SenderFilter[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.SenderFilter[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.StartDate == "" && Forced(v.ForceSendFields, "StartDate") { - ch := n.Child("start_date") - c.fn(&ch, "") - } - if s := string(v.StartDate); c.match(s) { - ch := n.Child("start_date") - if r, ok := c.fn(&ch, s); ok { - v.StartDate = (r) - } - } - if !n.IsRef("subject_filter") { - if len(v.SubjectFilter) > 0 { - cn := n.Child("subject_filter") - for i := range v.SubjectFilter { - if s := string(v.SubjectFilter[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.SubjectFilter[i] = (r) - } - } - } - } - } -} - -func stringsPipelinesRabbitmqOptions(c *stringsWalk, n *Node, v *pipelines.RabbitmqOptions) { - if n.isRef() { - return - } - if s := string(v.Queue); c.match(s) { - ch := n.Child("queue") - if r, ok := c.fn(&ch, s); ok { - v.Queue = (r) - } - } -} - -func stringsPipelinesRedditAdsOptions(c *stringsWalk, n *Node, v *pipelines.RedditAdsOptions) { - if n.isRef() { - return - } - if !n.IsRef("custom_report_options") { - if x := v.CustomReportOptions; x != nil { - ch := n.Child("custom_report_options") - stringsPipelinesRedditAdsOptionsRedditAdsCustomReportOptions(c, &ch, x) - } - } - if c.mode == EmptyFields && v.SyncStartDate == "" && Forced(v.ForceSendFields, "SyncStartDate") { - ch := n.Child("sync_start_date") - c.fn(&ch, "") - } - if s := string(v.SyncStartDate); c.match(s) { - ch := n.Child("sync_start_date") - if r, ok := c.fn(&ch, s); ok { - v.SyncStartDate = (r) - } - } -} - -func stringsPipelinesSharepointOptions(c *stringsWalk, n *Node, v *pipelines.SharepointOptions) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.EntityType == "" && Forced(v.ForceSendFields, "EntityType") { - ch := n.Child("entity_type") - c.fn(&ch, "") - } - if s := string(v.EntityType); c.match(s) { - ch := n.Child("entity_type") - if r, ok := c.fn(&ch, s); ok { - v.EntityType = pipelines.SharepointOptionsSharepointEntityType(r) - } - } - if !n.IsRef("file_ingestion_options") { - if x := v.FileIngestionOptions; x != nil { - ch := n.Child("file_ingestion_options") - stringsPipelinesFileIngestionOptions(c, &ch, x) - } - } - if c.mode == EmptyFields && v.Url == "" && Forced(v.ForceSendFields, "Url") { - ch := n.Child("url") - c.fn(&ch, "") - } - if s := string(v.Url); c.match(s) { - ch := n.Child("url") - if r, ok := c.fn(&ch, s); ok { - v.Url = (r) - } - } -} - -func stringsPipelinesTikTokAdsOptions(c *stringsWalk, n *Node, v *pipelines.TikTokAdsOptions) { - if n.isRef() { - return - } - if !n.IsRef("custom_report_options") { - if x := v.CustomReportOptions; x != nil { - ch := n.Child("custom_report_options") - stringsPipelinesTikTokAdsOptionsTikTokAdsCustomReportOptions(c, &ch, x) - } - } - if c.mode == EmptyFields && v.DataLevel == "" && Forced(v.ForceSendFields, "DataLevel") { - ch := n.Child("data_level") - c.fn(&ch, "") - } - if s := string(v.DataLevel); c.match(s) { - ch := n.Child("data_level") - if r, ok := c.fn(&ch, s); ok { - v.DataLevel = pipelines.TikTokAdsOptionsTikTokDataLevel(r) - } - } - if !n.IsRef("dimensions") { - if len(v.Dimensions) > 0 { - cn := n.Child("dimensions") - for i := range v.Dimensions { - if s := string(v.Dimensions[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Dimensions[i] = (r) - } - } - } - } - } - if !n.IsRef("metrics") { - if len(v.Metrics) > 0 { - cn := n.Child("metrics") - for i := range v.Metrics { - if s := string(v.Metrics[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Metrics[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.ReportType == "" && Forced(v.ForceSendFields, "ReportType") { - ch := n.Child("report_type") - c.fn(&ch, "") - } - if s := string(v.ReportType); c.match(s) { - ch := n.Child("report_type") - if r, ok := c.fn(&ch, s); ok { - v.ReportType = pipelines.TikTokAdsOptionsTikTokReportType(r) - } - } - if c.mode == EmptyFields && v.SyncStartDate == "" && Forced(v.ForceSendFields, "SyncStartDate") { - ch := n.Child("sync_start_date") - c.fn(&ch, "") - } - if s := string(v.SyncStartDate); c.match(s) { - ch := n.Child("sync_start_date") - if r, ok := c.fn(&ch, s); ok { - v.SyncStartDate = (r) - } - } -} - -func stringsPipelinesZendeskSupportOptions(c *stringsWalk, n *Node, v *pipelines.ZendeskSupportOptions) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.StartDate == "" && Forced(v.ForceSendFields, "StartDate") { - ch := n.Child("start_date") - c.fn(&ch, "") - } - if s := string(v.StartDate); c.match(s) { - ch := n.Child("start_date") - if r, ok := c.fn(&ch, s); ok { - v.StartDate = (r) - } - } -} - -func stringsPipelinesTransformer(c *stringsWalk, n *Node, v *pipelines.Transformer) { - if n.isRef() { - return - } - if !n.IsRef("avro_options") { - if x := v.AvroOptions; x != nil { - ch := n.Child("avro_options") - stringsPipelinesAvroTransformerOptions(c, &ch, x) - } - } - if c.mode == EmptyFields && v.Format == "" && Forced(v.ForceSendFields, "Format") { - ch := n.Child("format") - c.fn(&ch, "") - } - if s := string(v.Format); c.match(s) { - ch := n.Child("format") - if r, ok := c.fn(&ch, s); ok { - v.Format = pipelines.TransformerFormat(r) - } - } - if c.mode == EmptyFields && v.InputColumn == "" && Forced(v.ForceSendFields, "InputColumn") { - ch := n.Child("input_column") - c.fn(&ch, "") - } - if s := string(v.InputColumn); c.match(s) { - ch := n.Child("input_column") - if r, ok := c.fn(&ch, s); ok { - v.InputColumn = (r) - } - } - if !n.IsRef("json_options") { - if x := v.JsonOptions; x != nil { - ch := n.Child("json_options") - stringsPipelinesJsonTransformerOptions(c, &ch, x) - } - } - if c.mode == EmptyFields && v.OutputColumn == "" && Forced(v.ForceSendFields, "OutputColumn") { - ch := n.Child("output_column") - c.fn(&ch, "") - } - if s := string(v.OutputColumn); c.match(s) { - ch := n.Child("output_column") - if r, ok := c.fn(&ch, s); ok { - v.OutputColumn = (r) - } - } - if !n.IsRef("protobuf_options") { - if x := v.ProtobufOptions; x != nil { - ch := n.Child("protobuf_options") - stringsPipelinesProtobufTransformerOptions(c, &ch, x) - } - } -} - -func stringsPipelinesPostgresSlotConfig(c *stringsWalk, n *Node, v *pipelines.PostgresSlotConfig) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.PublicationName == "" && Forced(v.ForceSendFields, "PublicationName") { - ch := n.Child("publication_name") - c.fn(&ch, "") - } - if s := string(v.PublicationName); c.match(s) { - ch := n.Child("publication_name") - if r, ok := c.fn(&ch, s); ok { - v.PublicationName = (r) - } - } - if c.mode == EmptyFields && v.SlotName == "" && Forced(v.ForceSendFields, "SlotName") { - ch := n.Child("slot_name") - c.fn(&ch, "") - } - if s := string(v.SlotName); c.match(s) { - ch := n.Child("slot_name") - if r, ok := c.fn(&ch, s); ok { - v.SlotName = (r) - } - } -} - -func stringsServingApiKeyAuth(c *stringsWalk, n *Node, v *serving.ApiKeyAuth) { - if n.isRef() { - return - } - if s := string(v.Key); c.match(s) { - ch := n.Child("key") - if r, ok := c.fn(&ch, s); ok { - v.Key = (r) - } - } - if c.mode == EmptyFields && v.Value == "" && Forced(v.ForceSendFields, "Value") { - ch := n.Child("value") - c.fn(&ch, "") - } - if s := string(v.Value); c.match(s) { - ch := n.Child("value") - if r, ok := c.fn(&ch, s); ok { - v.Value = (r) - } - } - if c.mode == EmptyFields && v.ValuePlaintext == "" && Forced(v.ForceSendFields, "ValuePlaintext") { - ch := n.Child("value_plaintext") - c.fn(&ch, "") - } - if s := string(v.ValuePlaintext); c.match(s) { - ch := n.Child("value_plaintext") - if r, ok := c.fn(&ch, s); ok { - v.ValuePlaintext = (r) - } - } -} - -func stringsServingBearerTokenAuth(c *stringsWalk, n *Node, v *serving.BearerTokenAuth) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Token == "" && Forced(v.ForceSendFields, "Token") { - ch := n.Child("token") - c.fn(&ch, "") - } - if s := string(v.Token); c.match(s) { - ch := n.Child("token") - if r, ok := c.fn(&ch, s); ok { - v.Token = (r) - } - } - if c.mode == EmptyFields && v.TokenPlaintext == "" && Forced(v.ForceSendFields, "TokenPlaintext") { - ch := n.Child("token_plaintext") - c.fn(&ch, "") - } - if s := string(v.TokenPlaintext); c.match(s) { - ch := n.Child("token_plaintext") - if r, ok := c.fn(&ch, s); ok { - v.TokenPlaintext = (r) - } - } -} - -func stringsCatalogModelProviderServiceConfigSecretReference(c *stringsWalk, n *Node, v *catalog.ModelProviderServiceConfigSecretReference) { - if n.isRef() { - return - } - if s := string(v.Name); c.match(s) { - ch := n.Child("name") - if r, ok := c.fn(&ch, s); ok { - v.Name = (r) - } - } -} - -func stringsJobsSubscriptionAttachmentDataAttachmentWidget(c *stringsWalk, n *Node, v *jobs.SubscriptionAttachmentDataAttachmentWidget) { - if n.isRef() { - return - } - if s := string(v.PageId); c.match(s) { - ch := n.Child("page_id") - if r, ok := c.fn(&ch, s); ok { - v.PageId = (r) - } - } - if s := string(v.WidgetId); c.match(s) { - ch := n.Child("widget_id") - if r, ok := c.fn(&ch, s); ok { - v.WidgetId = (r) - } - } -} - -func stringsPipelinesFileIngestionOptions(c *stringsWalk, n *Node, v *pipelines.FileIngestionOptions) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.CorruptRecordColumn == "" && Forced(v.ForceSendFields, "CorruptRecordColumn") { - ch := n.Child("corrupt_record_column") - c.fn(&ch, "") - } - if s := string(v.CorruptRecordColumn); c.match(s) { - ch := n.Child("corrupt_record_column") - if r, ok := c.fn(&ch, s); ok { - v.CorruptRecordColumn = (r) - } - } - if !n.IsRef("file_filters") { - if len(v.FileFilters) > 0 { - cn := n.Child("file_filters") - for i := range v.FileFilters { - { - ch := cn.Elem(i) - stringsPipelinesFileFilter(c, &ch, &v.FileFilters[i]) - } - } - } - } - if c.mode == EmptyFields && v.Format == "" && Forced(v.ForceSendFields, "Format") { - ch := n.Child("format") - c.fn(&ch, "") - } - if s := string(v.Format); c.match(s) { - ch := n.Child("format") - if r, ok := c.fn(&ch, s); ok { - v.Format = pipelines.FileIngestionOptionsFileFormat(r) - } - } - if !n.IsRef("format_options") { - if len(v.FormatOptions) > 0 { - cn := n.Child("format_options") - for _, k := range sortedKeys(v.FormatOptions) { - if s := string(v.FormatOptions[k]); c.match(s) { - ch := cn.Child(string(k)) - if r, ok := c.fn(&ch, s); ok { - v.FormatOptions[k] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.RescuedDataColumn == "" && Forced(v.ForceSendFields, "RescuedDataColumn") { - ch := n.Child("rescued_data_column") - c.fn(&ch, "") - } - if s := string(v.RescuedDataColumn); c.match(s) { - ch := n.Child("rescued_data_column") - if r, ok := c.fn(&ch, s); ok { - v.RescuedDataColumn = (r) - } - } - if c.mode == EmptyFields && v.SchemaEvolutionMode == "" && Forced(v.ForceSendFields, "SchemaEvolutionMode") { - ch := n.Child("schema_evolution_mode") - c.fn(&ch, "") - } - if s := string(v.SchemaEvolutionMode); c.match(s) { - ch := n.Child("schema_evolution_mode") - if r, ok := c.fn(&ch, s); ok { - v.SchemaEvolutionMode = pipelines.FileIngestionOptionsSchemaEvolutionMode(r) - } - } - if c.mode == EmptyFields && v.SchemaHints == "" && Forced(v.ForceSendFields, "SchemaHints") { - ch := n.Child("schema_hints") - c.fn(&ch, "") - } - if s := string(v.SchemaHints); c.match(s) { - ch := n.Child("schema_hints") - if r, ok := c.fn(&ch, s); ok { - v.SchemaHints = (r) - } - } - if c.mode == EmptyFields && v.SingleVariantColumn == "" && Forced(v.ForceSendFields, "SingleVariantColumn") { - ch := n.Child("single_variant_column") - c.fn(&ch, "") - } - if s := string(v.SingleVariantColumn); c.match(s) { - ch := n.Child("single_variant_column") - if r, ok := c.fn(&ch, s); ok { - v.SingleVariantColumn = (r) - } - } -} - -func stringsPipelinesGoogleAdsCustomReportOptions(c *stringsWalk, n *Node, v *pipelines.GoogleAdsCustomReportOptions) { - if n.isRef() { - return - } - if !n.IsRef("metrics") { - if len(v.Metrics) > 0 { - cn := n.Child("metrics") - for i := range v.Metrics { - if s := string(v.Metrics[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Metrics[i] = (r) - } - } - } - } - } - if s := string(v.Resource); c.match(s) { - ch := n.Child("resource") - if r, ok := c.fn(&ch, s); ok { - v.Resource = (r) - } - } - if !n.IsRef("resource_fields") { - if len(v.ResourceFields) > 0 { - cn := n.Child("resource_fields") - for i := range v.ResourceFields { - if s := string(v.ResourceFields[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.ResourceFields[i] = (r) - } - } - } - } - } - if !n.IsRef("segments") { - if len(v.Segments) > 0 { - cn := n.Child("segments") - for i := range v.Segments { - if s := string(v.Segments[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Segments[i] = (r) - } - } - } - } - } -} - -func stringsPipelinesLinkedInAdsOptionsLinkedInAdsCustomReportOptions(c *stringsWalk, n *Node, v *pipelines.LinkedInAdsOptionsLinkedInAdsCustomReportOptions) { - if n.isRef() { - return - } - if !n.IsRef("entity_granularity") { - if len(v.EntityGranularity) > 0 { - cn := n.Child("entity_granularity") - for i := range v.EntityGranularity { - if s := string(v.EntityGranularity[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.EntityGranularity[i] = pipelines.LinkedInAdsOptionsLinkedInAdsCustomReportOptionsLinkedInAdsEntityGranularity(r) - } - } - } - } - } - if s := string(v.Finder); c.match(s) { - ch := n.Child("finder") - if r, ok := c.fn(&ch, s); ok { - v.Finder = pipelines.LinkedInAdsOptionsLinkedInAdsCustomReportOptionsLinkedInAdsFinder(r) - } - } - if !n.IsRef("metrics") { - if len(v.Metrics) > 0 { - cn := n.Child("metrics") - for i := range v.Metrics { - if s := string(v.Metrics[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Metrics[i] = (r) - } - } - } - } - } - if s := string(v.TimeGranularity); c.match(s) { - ch := n.Child("time_granularity") - if r, ok := c.fn(&ch, s); ok { - v.TimeGranularity = pipelines.LinkedInAdsOptionsLinkedInAdsCustomReportOptionsLinkedInAdsTimeGranularity(r) - } - } -} - -func stringsPipelinesMetaMarketingOptionsMetaMarketingCustomReportOptions(c *stringsWalk, n *Node, v *pipelines.MetaMarketingOptionsMetaMarketingCustomReportOptions) { - if n.isRef() { - return - } - if !n.IsRef("action_attribution_windows") { - if len(v.ActionAttributionWindows) > 0 { - cn := n.Child("action_attribution_windows") - for i := range v.ActionAttributionWindows { - if s := string(v.ActionAttributionWindows[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.ActionAttributionWindows[i] = (r) - } - } - } - } - } - if !n.IsRef("action_breakdowns") { - if len(v.ActionBreakdowns) > 0 { - cn := n.Child("action_breakdowns") - for i := range v.ActionBreakdowns { - if s := string(v.ActionBreakdowns[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.ActionBreakdowns[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.ActionReportTime == "" && Forced(v.ForceSendFields, "ActionReportTime") { - ch := n.Child("action_report_time") - c.fn(&ch, "") - } - if s := string(v.ActionReportTime); c.match(s) { - ch := n.Child("action_report_time") - if r, ok := c.fn(&ch, s); ok { - v.ActionReportTime = (r) - } - } - if !n.IsRef("breakdowns") { - if len(v.Breakdowns) > 0 { - cn := n.Child("breakdowns") - for i := range v.Breakdowns { - if s := string(v.Breakdowns[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Breakdowns[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.Level == "" && Forced(v.ForceSendFields, "Level") { - ch := n.Child("level") - c.fn(&ch, "") - } - if s := string(v.Level); c.match(s) { - ch := n.Child("level") - if r, ok := c.fn(&ch, s); ok { - v.Level = (r) - } - } - if c.mode == EmptyFields && v.TimeIncrement == "" && Forced(v.ForceSendFields, "TimeIncrement") { - ch := n.Child("time_increment") - c.fn(&ch, "") - } - if s := string(v.TimeIncrement); c.match(s) { - ch := n.Child("time_increment") - if r, ok := c.fn(&ch, s); ok { - v.TimeIncrement = (r) - } - } -} - -func stringsPipelinesRedditAdsOptionsRedditAdsCustomReportOptions(c *stringsWalk, n *Node, v *pipelines.RedditAdsOptionsRedditAdsCustomReportOptions) { - if n.isRef() { - return - } - if !n.IsRef("breakdowns") { - if len(v.Breakdowns) > 0 { - cn := n.Child("breakdowns") - for i := range v.Breakdowns { - if s := string(v.Breakdowns[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Breakdowns[i] = (r) - } - } - } - } - } - if !n.IsRef("fields") { - if len(v.Fields) > 0 { - cn := n.Child("fields") - for i := range v.Fields { - if s := string(v.Fields[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Fields[i] = (r) - } - } - } - } - } -} - -func stringsPipelinesTikTokAdsOptionsTikTokAdsCustomReportOptions(c *stringsWalk, n *Node, v *pipelines.TikTokAdsOptionsTikTokAdsCustomReportOptions) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DataLevel == "" && Forced(v.ForceSendFields, "DataLevel") { - ch := n.Child("data_level") - c.fn(&ch, "") - } - if s := string(v.DataLevel); c.match(s) { - ch := n.Child("data_level") - if r, ok := c.fn(&ch, s); ok { - v.DataLevel = pipelines.TikTokAdsOptionsTikTokDataLevel(r) - } - } - if !n.IsRef("dimensions") { - if len(v.Dimensions) > 0 { - cn := n.Child("dimensions") - for i := range v.Dimensions { - if s := string(v.Dimensions[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Dimensions[i] = (r) - } - } - } - } - } - if !n.IsRef("metrics") { - if len(v.Metrics) > 0 { - cn := n.Child("metrics") - for i := range v.Metrics { - if s := string(v.Metrics[i]); c.match(s) { - ch := cn.Elem(i) - if r, ok := c.fn(&ch, s); ok { - v.Metrics[i] = (r) - } - } - } - } - } - if c.mode == EmptyFields && v.ReportType == "" && Forced(v.ForceSendFields, "ReportType") { - ch := n.Child("report_type") - c.fn(&ch, "") - } - if s := string(v.ReportType); c.match(s) { - ch := n.Child("report_type") - if r, ok := c.fn(&ch, s); ok { - v.ReportType = pipelines.TikTokAdsOptionsTikTokReportType(r) - } - } -} - -func stringsPipelinesAvroTransformerOptions(c *stringsWalk, n *Node, v *pipelines.AvroTransformerOptions) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ParseMode == "" && Forced(v.ForceSendFields, "ParseMode") { - ch := n.Child("parse_mode") - c.fn(&ch, "") - } - if s := string(v.ParseMode); c.match(s) { - ch := n.Child("parse_mode") - if r, ok := c.fn(&ch, s); ok { - v.ParseMode = pipelines.ParseMode(r) - } - } - if c.mode == EmptyFields && v.Schema == "" && Forced(v.ForceSendFields, "Schema") { - ch := n.Child("schema") - c.fn(&ch, "") - } - if s := string(v.Schema); c.match(s) { - ch := n.Child("schema") - if r, ok := c.fn(&ch, s); ok { - v.Schema = (r) - } - } - if c.mode == EmptyFields && v.SchemaFilePath == "" && Forced(v.ForceSendFields, "SchemaFilePath") { - ch := n.Child("schema_file_path") - c.fn(&ch, "") - } - if s := string(v.SchemaFilePath); c.match(s) { - ch := n.Child("schema_file_path") - if r, ok := c.fn(&ch, s); ok { - v.SchemaFilePath = (r) - } - } - if !n.IsRef("schema_registry") { - if x := v.SchemaRegistry; x != nil { - ch := n.Child("schema_registry") - stringsPipelinesSchemaRegistryConfig(c, &ch, x) - } - } -} - -func stringsPipelinesJsonTransformerOptions(c *stringsWalk, n *Node, v *pipelines.JsonTransformerOptions) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Schema == "" && Forced(v.ForceSendFields, "Schema") { - ch := n.Child("schema") - c.fn(&ch, "") - } - if s := string(v.Schema); c.match(s) { - ch := n.Child("schema") - if r, ok := c.fn(&ch, s); ok { - v.Schema = (r) - } - } - if c.mode == EmptyFields && v.SchemaEvolutionMode == "" && Forced(v.ForceSendFields, "SchemaEvolutionMode") { - ch := n.Child("schema_evolution_mode") - c.fn(&ch, "") - } - if s := string(v.SchemaEvolutionMode); c.match(s) { - ch := n.Child("schema_evolution_mode") - if r, ok := c.fn(&ch, s); ok { - v.SchemaEvolutionMode = pipelines.FileIngestionOptionsSchemaEvolutionMode(r) - } - } - if c.mode == EmptyFields && v.SchemaFilePath == "" && Forced(v.ForceSendFields, "SchemaFilePath") { - ch := n.Child("schema_file_path") - c.fn(&ch, "") - } - if s := string(v.SchemaFilePath); c.match(s) { - ch := n.Child("schema_file_path") - if r, ok := c.fn(&ch, s); ok { - v.SchemaFilePath = (r) - } - } - if c.mode == EmptyFields && v.SchemaHints == "" && Forced(v.ForceSendFields, "SchemaHints") { - ch := n.Child("schema_hints") - c.fn(&ch, "") - } - if s := string(v.SchemaHints); c.match(s) { - ch := n.Child("schema_hints") - if r, ok := c.fn(&ch, s); ok { - v.SchemaHints = (r) - } - } -} - -func stringsPipelinesProtobufTransformerOptions(c *stringsWalk, n *Node, v *pipelines.ProtobufTransformerOptions) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.DescFilePath == "" && Forced(v.ForceSendFields, "DescFilePath") { - ch := n.Child("desc_file_path") - c.fn(&ch, "") - } - if s := string(v.DescFilePath); c.match(s) { - ch := n.Child("desc_file_path") - if r, ok := c.fn(&ch, s); ok { - v.DescFilePath = (r) - } - } - if c.mode == EmptyFields && v.MessageName == "" && Forced(v.ForceSendFields, "MessageName") { - ch := n.Child("message_name") - c.fn(&ch, "") - } - if s := string(v.MessageName); c.match(s) { - ch := n.Child("message_name") - if r, ok := c.fn(&ch, s); ok { - v.MessageName = (r) - } - } - if c.mode == EmptyFields && v.ParseMode == "" && Forced(v.ForceSendFields, "ParseMode") { - ch := n.Child("parse_mode") - c.fn(&ch, "") - } - if s := string(v.ParseMode); c.match(s) { - ch := n.Child("parse_mode") - if r, ok := c.fn(&ch, s); ok { - v.ParseMode = pipelines.ParseMode(r) - } - } - if !n.IsRef("schema_registry") { - if x := v.SchemaRegistry; x != nil { - ch := n.Child("schema_registry") - stringsPipelinesSchemaRegistryConfig(c, &ch, x) - } - } -} - -func stringsPipelinesFileFilter(c *stringsWalk, n *Node, v *pipelines.FileFilter) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.ModifiedAfter == "" && Forced(v.ForceSendFields, "ModifiedAfter") { - ch := n.Child("modified_after") - c.fn(&ch, "") - } - if s := string(v.ModifiedAfter); c.match(s) { - ch := n.Child("modified_after") - if r, ok := c.fn(&ch, s); ok { - v.ModifiedAfter = (r) - } - } - if c.mode == EmptyFields && v.ModifiedBefore == "" && Forced(v.ForceSendFields, "ModifiedBefore") { - ch := n.Child("modified_before") - c.fn(&ch, "") - } - if s := string(v.ModifiedBefore); c.match(s) { - ch := n.Child("modified_before") - if r, ok := c.fn(&ch, s); ok { - v.ModifiedBefore = (r) - } - } - if c.mode == EmptyFields && v.PathFilter == "" && Forced(v.ForceSendFields, "PathFilter") { - ch := n.Child("path_filter") - c.fn(&ch, "") - } - if s := string(v.PathFilter); c.match(s) { - ch := n.Child("path_filter") - if r, ok := c.fn(&ch, s); ok { - v.PathFilter = (r) - } - } -} - -func stringsPipelinesSchemaRegistryConfig(c *stringsWalk, n *Node, v *pipelines.SchemaRegistryConfig) { - if n.isRef() { - return - } - if !n.IsRef("confluent_options") { - if x := v.ConfluentOptions; x != nil { - ch := n.Child("confluent_options") - stringsPipelinesConfluentSchemaRegistryOptions(c, &ch, x) - } - } - if c.mode == EmptyFields && v.ConnectionName == "" && Forced(v.ForceSendFields, "ConnectionName") { - ch := n.Child("connection_name") - c.fn(&ch, "") - } - if s := string(v.ConnectionName); c.match(s) { - ch := n.Child("connection_name") - if r, ok := c.fn(&ch, s); ok { - v.ConnectionName = (r) - } - } - if c.mode == EmptyFields && v.ProtobufMessageName == "" && Forced(v.ForceSendFields, "ProtobufMessageName") { - ch := n.Child("protobuf_message_name") - c.fn(&ch, "") - } - if s := string(v.ProtobufMessageName); c.match(s) { - ch := n.Child("protobuf_message_name") - if r, ok := c.fn(&ch, s); ok { - v.ProtobufMessageName = (r) - } - } -} - -func stringsPipelinesConfluentSchemaRegistryOptions(c *stringsWalk, n *Node, v *pipelines.ConfluentSchemaRegistryOptions) { - if n.isRef() { - return - } - if c.mode == EmptyFields && v.Subject == "" && Forced(v.ForceSendFields, "Subject") { - ch := n.Child("subject") - c.fn(&ch, "") - } - if s := string(v.Subject); c.match(s) { - ch := n.Child("subject") - if r, ok := c.fn(&ch, s); ok { - v.Subject = (r) - } - } -} - -func stringsResource(c *stringsWalk, n *Node, v *config.Resources, typ, name string) { - switch typ { - case "jobs": - if x := v.Jobs[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesJob(c, &rn, x) - } - case "job_runs": - if x := v.JobRuns[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesJobRun(c, &rn, x) - } - case "pipelines": - if x := v.Pipelines[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesPipeline(c, &rn, x) - } - case "features": - if x := v.Features[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesFeature(c, &rn, x) - } - case "models": - if x := v.Models[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesMlflowModel(c, &rn, x) - } - case "experiments": - if x := v.Experiments[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesMlflowExperiment(c, &rn, x) - } - case "model_serving_endpoints": - if x := v.ModelServingEndpoints[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesModelServingEndpoint(c, &rn, x) - } - case "model_services": - if x := v.ModelServices[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesModelService(c, &rn, x) - } - case "mcp_services": - if x := v.McpServices[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesMcpService(c, &rn, x) - } - case "model_provider_services": - if x := v.ModelProviderServices[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesModelProviderService(c, &rn, x) - } - case "registered_models": - if x := v.RegisteredModels[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesRegisteredModel(c, &rn, x) - } - case "quality_monitors": - if x := v.QualityMonitors[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesQualityMonitor(c, &rn, x) - } - case "catalogs": - if x := v.Catalogs[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesCatalog(c, &rn, x) - } - case "schemas": - if x := v.Schemas[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesSchema(c, &rn, x) - } - case "volumes": - if x := v.Volumes[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesVolume(c, &rn, x) - } - case "external_locations": - if x := v.ExternalLocations[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesExternalLocation(c, &rn, x) - } - case "clusters": - if x := v.Clusters[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesCluster(c, &rn, x) - } - case "dashboards": - if x := v.Dashboards[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesDashboard(c, &rn, x) - } - case "genie_spaces": - if x := v.GenieSpaces[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesGenieSpace(c, &rn, x) - } - case "apps": - if x := v.Apps[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesApp(c, &rn, x) - } - case "secret_scopes": - if x := v.SecretScopes[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesSecretScope(c, &rn, x) - } - case "alerts": - if x := v.Alerts[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesAlert(c, &rn, x) - } - case "sql_warehouses": - if x := v.SqlWarehouses[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesSqlWarehouse(c, &rn, x) - } - case "database_instances": - if x := v.DatabaseInstances[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesDatabaseInstance(c, &rn, x) - } - case "database_catalogs": - if x := v.DatabaseCatalogs[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesDatabaseCatalog(c, &rn, x) - } - case "synced_database_tables": - if x := v.SyncedDatabaseTables[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesSyncedDatabaseTable(c, &rn, x) - } - case "postgres_projects": - if x := v.PostgresProjects[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesPostgresProject(c, &rn, x) - } - case "postgres_branches": - if x := v.PostgresBranches[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesPostgresBranch(c, &rn, x) - } - case "postgres_endpoints": - if x := v.PostgresEndpoints[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesPostgresEndpoint(c, &rn, x) - } - case "postgres_catalogs": - if x := v.PostgresCatalogs[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesPostgresCatalog(c, &rn, x) - } - case "postgres_databases": - if x := v.PostgresDatabases[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesPostgresDatabase(c, &rn, x) - } - case "postgres_roles": - if x := v.PostgresRoles[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesPostgresRole(c, &rn, x) - } - case "postgres_synced_tables": - if x := v.PostgresSyncedTables[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesPostgresSyncedTable(c, &rn, x) - } - case "postgres_snapshot_schedules": - if x := v.PostgresSnapshotSchedules[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesPostgresSnapshotSchedule(c, &rn, x) - } - case "vector_search_endpoints": - if x := v.VectorSearchEndpoints[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesVectorSearchEndpoint(c, &rn, x) - } - case "vector_search_indexes": - if x := v.VectorSearchIndexes[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesVectorSearchIndex(c, &rn, x) - } - case "instance_pools": - if x := v.InstancePools[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesInstancePool(c, &rn, x) - } - case "secrets": - if x := v.Secrets[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesSecret(c, &rn, x) - } - case "cluster_policies": - if x := v.ClusterPolicies[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesClusterPolicy(c, &rn, x) - } - case "internal_immutable_snapshots": - if x := v.Snapshots[name]; x != nil { - ch := n.Child(typ) - rn := ch.Child(name) - stringsResourcesSnapshot(c, &rn, x) - } - } -} diff --git a/bundle/internal/validation/enum.go b/bundle/internal/validation/enum.go deleted file mode 100644 index 3251e21951e..00000000000 --- a/bundle/internal/validation/enum.go +++ /dev/null @@ -1,126 +0,0 @@ -package main - -import ( - "errors" - "fmt" - "reflect" - - "github.com/databricks/cli/libs/structs/structpath" - "github.com/databricks/cli/libs/structs/structtag" - "github.com/databricks/cli/libs/structs/structwalk" -) - -// 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 - if typ.Kind() != reflect.String { - return false - } - - // Check for Values() method on both the type and its pointer type - var valuesMethod reflect.Method - var hasValues bool - - // First check on the type itself - valuesMethod, hasValues = typ.MethodByName("Values") - if !hasValues { - // Then check on the pointer type - ptrType := reflect.PointerTo(typ) - valuesMethod, hasValues = ptrType.MethodByName("Values") - } - - if !hasValues { - return false - } - - // Check method signature: func (T) Values() []T or func (*T) Values() []T - methodType := valuesMethod.Type - if methodType.NumIn() != 1 || methodType.NumOut() != 1 { - return false - } - - // Check return type is slice of the enum type - returnType := methodType.Out(0) - if returnType.Kind() != reflect.Slice { - return false - } - - elementType := returnType.Elem() - return elementType == typ -} - -// getEnumValues extracts enum values by calling the Values() method -func getEnumValues(typ reflect.Type) ([]string, error) { - if !isEnumType(typ) { - return nil, fmt.Errorf("type %s is not an enum type", typ.Name()) - } - - // Create a zero value of the type - enumValue := reflect.Zero(typ) - - // Check if the method is on the type or pointer type - valuesMethod := enumValue.MethodByName("Values") - if !valuesMethod.IsValid() { - // Try on pointer type - enumPtr := reflect.New(typ) - enumPtr.Elem().Set(enumValue) - valuesMethod = enumPtr.MethodByName("Values") - if !valuesMethod.IsValid() { - return nil, fmt.Errorf("Values() method not found on type %s", typ.Name()) - } - } - - results := valuesMethod.Call(nil) - if len(results) != 1 { - return nil, errors.New("Values() method should return exactly one value") - } - - valuesSlice := results[0] - if valuesSlice.Kind() != reflect.Slice { - return nil, errors.New("Values() method should return a slice") - } - - // Extract string values from the slice - var enumStrings []string - for i := range valuesSlice.Len() { - value := valuesSlice.Index(i) - enumStrings = append(enumStrings, value.String()) - } - - return enumStrings, nil -} - -// extractEnumFields walks through a struct type and returns the valid values by the -// pattern of the enum fields. -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 { - if path == nil { - return true - } - - // Do not generate enum validation code for fields that are internal or readonly. - if field != nil { - bundleTag := structtag.BundleTag(field.Tag.Get("bundle")) - if bundleTag.Internal() || bundleTag.ReadOnly() { - return false - } - } - - // Check if this field type is an enum - if isEnumType(fieldType) { - // Get enum values - enumValues, err := getEnumValues(fieldType) - if err != nil { - // Skip this field if we can't get enum values - return true - } - - fieldsByPattern[path.String()] = enumValues - } - return true - }) - - return fieldsByPattern, err -} diff --git a/bundle/internal/validation/main.go b/bundle/internal/validation/main.go index 29f8809f372..070f66e7cca 100644 --- a/bundle/internal/validation/main.go +++ b/bundle/internal/validation/main.go @@ -5,10 +5,11 @@ import ( ) // This package is meant to be run from the root of the CLI repo. It generates typed -// walkers over the bundle configuration: those of the required and enum field -// validators, and the string walker of bundle/config/walk. +// walkers over the bundle configuration: the defaults walker and the string walker of +// bundle/config/walk. The required and enum validators walk by the cached struct +// information of libs/structs/structinfo and need no generated code. func main() { - err := generateWalkers("bundle/config/validate") + err := generateWalkers() if err != nil { log.Fatalf("Error generating walkers: %v", err) } diff --git a/bundle/internal/validation/required.go b/bundle/internal/validation/required.go deleted file mode 100644 index 35580cf7314..00000000000 --- a/bundle/internal/validation/required.go +++ /dev/null @@ -1,86 +0,0 @@ -package main - -import ( - "fmt" - "reflect" - "slices" - "strings" - - "github.com/databricks/cli/libs/structs/structpath" - "github.com/databricks/cli/libs/structs/structtag" - "github.com/databricks/cli/libs/structs/structwalk" -) - -// 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 returns the required fields -// (JSON names) by the pattern of the struct that has them. -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 { - if path == nil || field == nil { - return true - } - - // Fields without a json tag (e.g. anonymous embeds) have no independent - // JSON key and cannot be required. Continue walking their children. - rawTag := field.Tag.Get("json") - if rawTag == "" { - return true - } - - // Do not generate required validation code for fields that are internal or readonly. - bundleTag := structtag.BundleTag(field.Tag.Get("bundle")) - if bundleTag.Internal() || bundleTag.ReadOnly() { - return false - } - - // The "omitempty" tag indicates the field is optional in bundle config. - jsonTag := structtag.JSONTag(rawTag) - if jsonTag.OmitEmpty() { - return true - } - - fieldName, ok := path.StringKey() - if !ok { - return true - } - - // A struct that shadows an embedded field of the same JSON name (e.g. apps' lifecycle - // over BaseResource's) is walked twice, so the same field can be reported twice. - parentPath := path.Parent().String() - if !slices.Contains(fieldsByPattern[parentPath], fieldName) { - fieldsByPattern[parentPath] = append(fieldsByPattern[parentPath], fieldName) - } - return true - }) - - return fieldsByPattern, err -} - -// 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] -} diff --git a/bundle/internal/validation/strings_walker.go b/bundle/internal/validation/strings_walker.go deleted file mode 100644 index 83b55843839..00000000000 --- a/bundle/internal/validation/strings_walker.go +++ /dev/null @@ -1,247 +0,0 @@ -package main - -import ( - "bytes" - "cmp" - "fmt" - "go/format" - "os" - "path" - "reflect" - "slices" - "strings" - - "github.com/databricks/cli/bundle/config" - "github.com/databricks/cli/libs/structs/structvar" -) - -// stringsGen generates the walker visiting every string of the configuration -// (bundle/config/walk/strings_walk.go): one function per struct type that contains -// strings, with plain field access. -type stringsGen struct { - gen - hasStrings map[reflect.Type]bool - names map[reflect.Type]string -} - -// containsStrings reports whether values of type t can contain strings. -func (g *stringsGen) containsStrings(t reflect.Type, visiting map[reflect.Type]bool) bool { - if v, ok := g.hasStrings[t]; ok { - return v - } - switch t.Kind() { - case reflect.String, reflect.Interface: - return true - case reflect.Pointer, reflect.Slice, reflect.Map: - return g.containsStrings(t.Elem(), visiting) - case reflect.Struct: - if structvar.IsSDKNativeType(t) { - return false - } - if visiting[t] { - return false - } - visiting[t] = true - defer delete(visiting, t) - found := false - info := structvar.GetStructInfo(t) - for _, f := range info.List { - if g.containsStrings(t.FieldByIndex(f.Index).Type, visiting) { - found = true - } - } - if len(visiting) == 1 { - g.hasStrings[t] = found - } - return found - default: - return false - } -} - -func (g *stringsGen) funcName(t reflect.Type) string { - if name, ok := g.names[t]; ok { - return name - } - base := "strings" + capitalize(path.Base(t.PkgPath())) + t.Name() - g.gen.names[base]++ - name := base - if n := g.gen.names[base]; n > 1 { - name = fmt.Sprintf("%s%d", base, n) - } - g.names[t] = name - g.pendingTypes = append(g.pendingTypes, t) - return name -} - -// emitStringsStruct writes the function visiting the strings of struct type t. -func (g *stringsGen) emitStringsStruct(t reflect.Type) { - // A value replaced by a pure reference hides what is below it, as in the view; the - // reference itself is in config.Root.References. - fmt.Fprintf(&g.out, "\nfunc %s(c *stringsWalk, n *Node, v *%s) {\n\tif n.isRef() {\n\t\treturn\n\t}\n", g.funcName(t), g.typeName(t)) - info := structvar.GetStructInfo(t) - for _, f := range info.List { - ft := t.FieldByIndex(f.Index).Type - if !g.containsStrings(ft, map[reflect.Type]bool{}) { - continue - } - expr, guards := selector("v", t, f.Index) - if t == reflect.TypeFor[config.Root]() && f.Key == "resources" { - // See walk.StringsWithoutResources. - guards = append(guards, "!c.skipResources") - } - switch ft.Kind() { - case reflect.String, reflect.Interface: - default: - // A field replaced by a pure reference hides what is below it, as in the - // view; the reference itself is in config.Root.References. - guards = append(guards, fmt.Sprintf("!n.IsRef(%q)", f.Key)) - } - if len(guards) > 0 { - fmt.Fprintf(&g.out, "\tif %s {\n", strings.Join(guards, " && ")) - } - g.emitEmptyField(structField("v", t, f.Key), fmt.Sprintf("n.Child(%q)", f.Key)) - g.emitValue("\t", expr, ft, fmt.Sprintf("n.Child(%q)", f.Key), true) - if len(guards) > 0 { - fmt.Fprintf(&g.out, "\t}\n") - } - } - fmt.Fprintf(&g.out, "}\n") -} - -// emitEmptyField writes the code visiting the struct field f in mode EmptyFields if it -// holds an empty string that [structvar.View] finds present: a forced string, a non-nil -// pointer to a string, or an interface. Fields without omitempty are skipped: their -// zero value is always sent. -func (g *stringsGen) emitEmptyField(f field, nodeExpr string) { - if f.forceEmpty { - return - } - var cond string - switch { - case f.typ.Kind() == reflect.String && f.fsf != "": - cond = fmt.Sprintf(`%s == "" && Forced(%s, %q)`, f.expr, f.fsf, f.goName) - case f.typ.Kind() == reflect.Pointer && f.typ.Elem().Kind() == reflect.String: - cond = fmt.Sprintf(`%s != nil && *%s == ""`, f.expr, f.expr) - case f.typ.Kind() == reflect.Interface: - cond = f.expr + ` == ""` - default: - return - } - fmt.Fprintf(&g.out, "\tif c.mode == EmptyFields && %s {\n\t\tch := %s\n\t\tc.fn(&ch, \"\")\n\t}\n", cond, nodeExpr) -} - -// emitValue writes the code visiting the value expr of type t whose node is nodeExpr. -// settable reports whether expr can be assigned to. -func (g *stringsGen) emitValue(indent, expr string, t reflect.Type, nodeExpr string, settable bool) { - switch t.Kind() { - case reflect.String: - conv := "" - if t.PkgPath() != "" { - conv = g.typeName(t) - } - fmt.Fprintf(&g.out, "%sif s := string(%s); c.match(s) {\n%s\tch := %s\n%s\tif r, ok := c.fn(&ch, s); ok {\n", indent, expr, indent, nodeExpr, indent) - if settable { - fmt.Fprintf(&g.out, "%s\t\t%s = %s(r)\n", indent, expr, conv) - } else { - fmt.Fprintf(&g.out, "%s\t\t_ = r\n", indent) - } - fmt.Fprintf(&g.out, "%s\t}\n%s}\n", indent, indent) - case reflect.Interface: - fmt.Fprintf(&g.out, "%sif %s != nil {\n%s\tch := %s\n%s\tc.any(&ch, &%s)\n%s}\n", indent, expr, indent, nodeExpr, indent, expr, indent) - case reflect.Pointer: - et := t.Elem() - if et.Kind() == reflect.Struct { - fmt.Fprintf(&g.out, "%sif x := %s; x != nil {\n%s\tch := %s\n%s\t%s(c, &ch, x)\n%s}\n", indent, expr, indent, nodeExpr, indent, g.funcName(et), indent) - } else { - fmt.Fprintf(&g.out, "%sif x := %s; x != nil {\n", indent, expr) - g.emitValue(indent+"\t", "*x", et, nodeExpr, true) - fmt.Fprintf(&g.out, "%s}\n", indent) - } - case reflect.Struct: - fmt.Fprintf(&g.out, "%s{\n%s\tch := %s\n%s\t%s(c, &ch, &%s)\n%s}\n", indent, indent, nodeExpr, indent, g.funcName(t), expr, indent) - case reflect.Slice: - fmt.Fprintf(&g.out, "%sif len(%s) > 0 {\n%s\tcn := %s\n%s\tfor i := range %s {\n", indent, expr, indent, nodeExpr, indent, expr) - g.emitValue(indent+"\t\t", expr+"[i]", t.Elem(), "cn.Elem(i)", true) - fmt.Fprintf(&g.out, "%s\t}\n%s}\n", indent, indent) - case reflect.Map: - et := t.Elem() - fmt.Fprintf(&g.out, "%sif len(%s) > 0 {\n%s\tcn := %s\n%s\tfor _, k := range sortedKeys(%s) {\n", indent, expr, indent, nodeExpr, indent, expr) - switch { - case et.Kind() == reflect.Pointer: - g.emitValue(indent+"\t\t", expr+"[k]", et, "cn.Child(string(k))", false) - case et.Kind() == reflect.String: - // Map values are not addressable: write the replacement back. - fmt.Fprintf(&g.out, "%s\t\tif s := string(%s[k]); c.match(s) {\n%s\t\t\tch := cn.Child(string(k))\n%s\t\t\tif r, ok := c.fn(&ch, s); ok {\n%s\t\t\t\t%s[k] = %s(r)\n%s\t\t\t}\n%s\t\t}\n", - indent, expr, indent, indent, indent, expr, g.convName(et), indent, indent) - default: - fmt.Fprintf(&g.out, "%s\t\tx := %s[k]\n", indent, expr) - g.emitValue(indent+"\t\t", "x", et, "cn.Child(string(k))", true) - fmt.Fprintf(&g.out, "%s\t\t%s[k] = x\n", indent, expr) - } - fmt.Fprintf(&g.out, "%s\t}\n%s}\n", indent, indent) - default: - panic(fmt.Sprintf("unsupported type %s", t)) - } -} - -// emitResourceDispatch writes stringsResource, which visits the strings of one resource -// by its type and name. -func (g *stringsGen) emitResourceDispatch() { - rt := reflect.TypeFor[config.Resources]() - fmt.Fprintf(&g.out, "\nfunc stringsResource(c *stringsWalk, n *Node, v *config.Resources, typ, name string) {\n\tswitch typ {\n") - for _, f := range structvar.GetStructInfo(rt).List { - ft := rt.FieldByIndex(f.Index) - et := ft.Type.Elem().Elem() - if !g.containsStrings(et, map[reflect.Type]bool{}) { - continue - } - fmt.Fprintf(&g.out, "\tcase %q:\n\t\tif x := v.%s[name]; x != nil {\n\t\t\tch := n.Child(typ)\n\t\t\trn := ch.Child(name)\n\t\t\t%s(c, &rn, x)\n\t\t}\n", f.Key, ft.Name, g.funcName(et)) - } - fmt.Fprintf(&g.out, "\t}\n}\n") -} - -func (g *stringsGen) convName(t reflect.Type) string { - if t.PkgPath() == "" { - return "" - } - return g.typeName(t) -} - -func generateStringsWalker(file string) error { - g := &stringsGen{gen: *newGen("strings", false), hasStrings: map[reflect.Type]bool{}, names: map[reflect.Type]string{}} - g.aliases["strings"] = true - g.aliases["stringsWalk"] = true - root := reflect.TypeFor[config.Root]() - g.funcName(root) - for len(g.pendingTypes) > 0 { - t := g.pendingTypes[0] - g.pendingTypes = g.pendingTypes[1:] - g.emitStringsStruct(t) - } - // After the loop: the resource types are all named by then, so their order stays. - g.emitResourceDispatch() - - var src bytes.Buffer - fmt.Fprintf(&src, "// Code generated by bundle/internal/validation. DO NOT EDIT.\n\npackage walk\n\nimport (\n") - paths := make([]string, 0, len(g.imports)) - for p := range g.imports { - paths = append(paths, p) - } - slices.SortFunc(paths, cmp.Compare) - 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") - src.Write(g.out.Bytes()) - formatted, err := format.Source(src.Bytes()) - if err != nil { - _ = os.WriteFile(file+".broken", src.Bytes(), 0o644) - return fmt.Errorf("failed to format %s: %w", file, err) - } - return os.WriteFile(file, formatted, 0o644) -} diff --git a/bundle/internal/validation/walker.go b/bundle/internal/validation/walker.go index cda81aa7910..db0e3f5c4dd 100644 --- a/bundle/internal/validation/walker.go +++ b/bundle/internal/validation/walker.go @@ -127,10 +127,6 @@ type gen struct { out bytes.Buffer pending []*tnode - // pendingTypes are the struct types whose functions are still to be written - // (strings walker). - pendingTypes []reflect.Type - // walkerType is the name of the type of the walker state (first parameter). walkerType string @@ -490,65 +486,28 @@ func generateWalker(spec walkerSpec) error { return os.WriteFile(file, formatted, 0o644) } -// patternMaps returns the required fields by parent pattern and the enum values by -// field pattern, without targets and environments (they are merged into the root). -func patternMaps() (map[string][]string, map[string][]string, error) { - required, err := extractRequiredFields(reflect.TypeFor[config.Root]()) - if err != nil { - return nil, nil, err - } - enums, err := extractEnumFields(reflect.TypeFor[config.Root]()) - if err != nil { - return nil, nil, err - } - skip := func(p string) bool { - k := getGroupingKey(p) - return k == "targets" || k == "environments" - } - r := map[string][]string{} - for p, fields := range required { - if !skip(p) { - r[p] = fields - } +// 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 "{}" } - e := map[string][]string{} - for p, values := range enums { - if !skip(p) { - e[p] = values - } + + var quoted []string + for _, value := range values { + quoted = append(quoted, fmt.Sprintf("%q", value)) } - return r, e, nil + + return "{" + strings.Join(quoted, ", ") + "}" } -func generateWalkers(dir string) error { - required, enums, err := patternMaps() - if err != nil { - return err - } - err = generateWalker(walkerSpec{ - file: dir + "/required_walk.go", pkg: "validate", prefix: "required", walkerType: "walker", - doc: "requiredWalk reports required fields that are not set.", required: required, - }) - if err != nil { - return err - } - err = generateWalker(walkerSpec{ - file: dir + "/enum_walk.go", pkg: "validate", prefix: "enum", walkerType: "walker", - doc: "enumWalk reports enum fields with invalid values.", enums: enums, - }) - if err != nil { - return err - } - err = generateWalker(walkerSpec{ +func generateWalkers() error { + err := generateWalker(walkerSpec{ file: "bundle/config/mutator/resourcemutator/defaults_walk.go", pkg: "resourcemutator", prefix: "defaults", walkerType: "defaultsWalker", doc: "defaultsWalk calls unset for the fields with a default (resourcedefaults.Defaults) that are not set.", defaults: resourcedefaults.Patterns(), }) if err != nil { return err } - err = generateStringsWalker("bundle/config/walk/strings_walk.go") - if err != nil { - return err - } return generateResourcesIterate("bundle/config/resources_iterate.go") } diff --git a/libs/structs/structinfo/info.go b/libs/structs/structinfo/info.go new file mode 100644 index 00000000000..b60a531b9da --- /dev/null +++ b/libs/structs/structinfo/info.go @@ -0,0 +1,387 @@ +// Package structinfo holds cached, per-type information about the configuration structs +// (field locations, kinds, required fields, enums) so that walks do not use reflection per +// value: a field is reached by adding an offset to the address of its struct. +package structinfo + +import ( + "reflect" + "slices" + "sync" + "unsafe" + + "github.com/databricks/cli/libs/structs/structtag" + "github.com/databricks/cli/libs/structs/structvar" +) + +type Kind uint8 + +const ( + KindOther Kind = iota + KindBool + KindInt + KindFloat + KindString + KindInterface + KindStruct + KindPtr + KindSlice + KindMap +) + +// MapKind classifies a map by the layout of its keys and values. +type MapKind uint8 + +const ( + // MapOther is any other map: use reflection. + MapOther MapKind = iota + // MapStringString is a map with string keys and string values (of any named string + // types): it can be read as map[string]string. + MapStringString + // MapStringPtr is a map with string keys and pointer values: it can be read as + // map[string]unsafe.Pointer. + MapStringPtr +) + +// Rules that a type can have something to do for, as a bit set. +const ( + RuleRequired uint8 = 1 << iota + RuleEnum + // RuleStrings is set for the types that contain strings (or dynamic values that can). + RuleStrings + numRules = 3 +) + +// Step is one hop of a path to a field through a struct embedded by pointer. +type Step struct { + Offset uintptr + Deref bool // the value at Offset is a pointer to the next struct +} + +// Loc locates a field in a struct: Offset from the struct's address, or, if a pointer +// embed is on the way, Steps. +type Loc struct { + Offset uintptr + Steps []Step +} + +// Resolve returns the address of the field in the struct at base, or nil if a pointer +// embed on the way is nil. +func (l *Loc) Resolve(base unsafe.Pointer) unsafe.Pointer { + if l.Steps == nil { + return unsafe.Add(base, l.Offset) + } + p := base + for _, s := range l.Steps { + p = unsafe.Add(p, s.Offset) + if s.Deref { + p = *(*unsafe.Pointer)(p) + if p == nil { + return nil + } + } + } + return p +} + +// Op is a field to visit by a walk, in the compact form the walk loop reads. +type Op struct { + Key string + Offset uintptr + Elem *Type // the type of the field + Idx uint16 + FSF int16 // index in Type.FSFs, or -1 + // FSFOffset is the offset of the governing ForceSendFields if it is directly in the + // struct (FSFDirect). + FSFOffset uintptr + FSFDirect bool + Kind Kind + Slow bool // the field is behind a pointer embed: use Fields[Idx].Loc + Enum bool // the field's type is an enum + // NoOmitEmpty is set for a field without omitempty: its zero value is always sent. + NoOmitEmpty bool +} + +// Field is a JSON field of a struct, with embedded structs flattened. +type Field struct { + Key string + GoName string + Loc Loc + Kind Kind + Required bool // no omitempty + // Hidden is set for internal and read-only fields: the validators skip them and what + // is below them, other walks visit them. + Hidden bool + Typ reflect.Type + Type *Type // the type of the field + FSF int // index in Type.FSFs of the ForceSendFields governing the field, or -1 +} + +// Type is the cached information of a Go type. +type Type struct { + Typ reflect.Type + Kind Kind + Size uintptr + Fields []Field + FSFs []Loc // ForceSendFields slices, referenced by Field.FSF + Elem *Type // pointer target, slice or map element + Enum []string + // MapKind tells how a map can be read without reflection. + MapKind MapKind + + // Has is the set of rules (Rule* bits) with something to do at or below the type. + Has uint8 + // Walk[r] lists the fields that need visiting for rule r: the field has something to + // do itself, or the type below it has. Each entry is small and they are contiguous, + // so that a walk reads one cache line per few fields. + Walk [numRules][]Op + // Required lists the indices of the required Fields. + Required []uint16 +} + +var ( + mu sync.Mutex + cache = map[reflect.Type]*Type{} + all []*Type +) + +// For returns the information of typ, building it (and the types below it) on first use. +func For(typ reflect.Type) *Type { + mu.Lock() + defer mu.Unlock() + if t, ok := cache[typ]; ok { + return t + } + n := len(all) + t := build(typ) + finish(all[n:]) + return t +} + +func kindOf(k reflect.Kind) Kind { + switch k { + case reflect.Bool: + return KindBool + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, + reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return KindInt + case reflect.Float32, reflect.Float64: + return KindFloat + case reflect.String: + return KindString + case reflect.Interface: + return KindInterface + case reflect.Struct: + return KindStruct + case reflect.Pointer: + return KindPtr + case reflect.Slice: + return KindSlice + case reflect.Map: + return KindMap + default: + return KindOther + } +} + +func build(typ reflect.Type) *Type { + if t, ok := cache[typ]; ok { + return t + } + t := &Type{Typ: typ, Kind: kindOf(typ.Kind()), Size: typ.Size()} + cache[typ] = t + all = append(all, t) + switch typ.Kind() { + case reflect.Pointer, reflect.Slice, reflect.Map: + t.Elem = build(typ.Elem()) + if typ.Kind() == reflect.Map && typ.Key().Kind() == reflect.String { + switch t.Elem.Kind { + case KindString: + t.MapKind = MapStringString + case KindPtr: + t.MapKind = MapStringPtr + default: + } + } + case reflect.String: + t.Enum = enumValues(typ) + case reflect.Struct: + buildStruct(t) + default: + } + return t +} + +// enumValues returns the values of an enum type: a string type with a Values method +// returning a slice of the type. +func enumValues(typ reflect.Type) []string { + m, ok := typ.MethodByName("Values") + if !ok { + m, ok = reflect.PointerTo(typ).MethodByName("Values") + } + if !ok || m.Type.NumIn() != 1 || m.Type.NumOut() != 1 { + return nil + } + out := m.Type.Out(0) + if out.Kind() != reflect.Slice || out.Elem() != typ { + return nil + } + recv := reflect.New(typ) + vals := recv.MethodByName("Values").Call(nil)[0] + var res []string + for i := range vals.Len() { + res = append(res, vals.Index(i).String()) + } + return res +} + +// locate returns the location of the field with the index path in typ. +func locate(typ reflect.Type, index []int) Loc { + var steps []Step + deref := false + t := typ + var off uintptr + for i, x := range index { + if i > 0 && t.Kind() == reflect.Pointer { + steps = append(steps, Step{Offset: off, Deref: true}) + off = 0 + t = t.Elem() + deref = true + } + f := t.Field(x) + off += f.Offset + t = f.Type + } + if !deref { + return Loc{Offset: off} + } + return Loc{Steps: append(steps, Step{Offset: off})} +} + +func buildStruct(t *Type) { + info := structvar.GetStructInfo(t.Typ) + for _, g := range info.ForceSendGroups { + t.FSFs = append(t.FSFs, locate(t.Typ, g)) + } + for _, fi := range info.List { + sf := t.Typ.FieldByIndex(fi.Index) + bt := structtag.BundleTag(sf.Tag.Get("bundle")) + f := Field{ + Hidden: bt.Internal() || bt.ReadOnly(), + Key: fi.Key, + GoName: fi.GolangName, + Loc: locate(t.Typ, fi.Index), + Kind: kindOf(sf.Type.Kind()), + Required: fi.ForceEmpty, + Typ: sf.Type, + FSF: fi.ForceSendGroup, + } + f.Type = build(sf.Type) + t.Fields = append(t.Fields, f) + } +} + +// finish computes the rule sets and walk lists of the new types ts to a fixpoint (types +// can be recursive). +func finish(ts []*Type) { + own := func(t *Type, f *Field) uint8 { + var r uint8 + if f.Required { + r |= RuleRequired + } + if f.Type.Enum != nil { + r |= RuleEnum + } + return r + } + for changed := true; changed; { + changed = false + for _, t := range ts { + has := t.Has + switch t.Kind { + case KindStruct: + for i := range t.Fields { + f := &t.Fields[i] + if f.Hidden { + has |= f.Type.Has & RuleStrings + continue + } + has |= own(t, f) | f.Type.Has + } + case KindPtr, KindSlice, KindMap: + has |= t.Elem.Has + case KindString: + has |= RuleStrings + if t.Enum != nil { + has |= RuleEnum + } + case KindInterface: + has |= RuleStrings + default: + } + if t.Kind == KindStruct && structvar.IsSDKNativeType(t.Typ) { + // Represented as a string in the configuration: nothing to visit inside. + has &^= RuleStrings + } + if has != t.Has { + t.Has = has + changed = true + } + } + } + for _, t := range ts { + if t.Kind != KindStruct { + continue + } + for i := range t.Fields { + f := &t.Fields[i] + if f.Required && !f.Hidden { + t.Required = append(t.Required, uint16(i)) + } + for r := range numRules { + bit := uint8(1) << r + if f.Hidden && bit != RuleStrings { + continue + } + if f.Type.Has&bit != 0 { + op := Op{ + Key: f.Key, NoOmitEmpty: f.Required, + Offset: f.Loc.Offset, Elem: f.Type, Idx: uint16(i), FSF: int16(f.FSF), + Kind: f.Kind, Slow: f.Loc.Steps != nil, Enum: f.Type.Enum != nil, + } + if f.FSF >= 0 && t.FSFs[f.FSF].Steps == nil { + op.FSFOffset, op.FSFDirect = t.FSFs[f.FSF].Offset, true + } + t.Walk[r] = append(t.Walk[r], op) + } + } + } + } +} + +// ForcedOp is [Type.Forced] for a walk entry. +func (t *Type) ForcedOp(p unsafe.Pointer, op *Op) bool { + if op.FSF < 0 { + return false + } + if op.FSFDirect && len(*(*[]string)(unsafe.Add(p, op.FSFOffset))) == 0 { + return false + } + return t.Forced(p, &t.Fields[op.Idx]) +} + +// Forced reports whether the Go field name is listed in the ForceSendFields governing f +// in the struct at p. +func (t *Type) Forced(p unsafe.Pointer, f *Field) bool { + if f.FSF < 0 { + return false + } + fp := t.FSFs[f.FSF].Resolve(p) + if fp == nil { + return false + } + fsf := *(*[]string)(fp) + if len(fsf) == 0 { + return false + } + return slices.Contains(fsf, f.GoName) +} diff --git a/libs/structs/structvar/decode.go b/libs/structs/structvar/decode.go index 233b48a948b..bc6400eba76 100644 --- a/libs/structs/structvar/decode.go +++ b/libs/structs/structvar/decode.go @@ -153,11 +153,18 @@ type decoder struct { // dnode is the decoded shape of a value: what the typed value does not hold. type dnode struct { - kind Kind - locs []diag.Location - ref string - keys map[string]*dnode - elems []*dnode + // container is set for a value decoded into a Go map or slice. + container bool + kind Kind + locs []diag.Location + ref string + keys map[string]*dnode + elems []*dnode +} + +// empty reports whether the value is a map or slice written as empty. +func (n *dnode) empty() bool { + return n.container && (n.kind == KindMap && len(n.keys) == 0 || n.kind == KindSequence && len(n.elems) == 0) } // locations returns the locations of the decoded value. @@ -165,7 +172,7 @@ func (n *dnode) locations() *Locations { if n == nil { return nil } - out := &Locations{locs: n.locs} + out := &Locations{locs: n.locs, empty: n.empty()} for k, c := range n.keys { if out.keys == nil { out.keys = make(map[string]*Locations, len(n.keys)) @@ -291,6 +298,7 @@ func (d *decoder) decode(dst reflect.Value, src source, path *structpath.PathNod } return d.decodeStruct(dst, src, path, n, ref) case reflect.Map: + n.container = true switch src.kind() { case KindMap: pairs, err := src.pairs() @@ -326,6 +334,7 @@ func (d *decoder) decode(dst reflect.Value, src source, path *structpath.PathNod d.typeMismatch(KindMap, src, path) return nil, false, nil case reflect.Slice: + n.container = true switch src.kind() { case KindSequence: elems, err := src.elems() diff --git a/libs/structs/structvar/locations.go b/libs/structs/structvar/locations.go index e0e03d3edc6..09029c60012 100644 --- a/libs/structs/structvar/locations.go +++ b/libs/structs/structvar/locations.go @@ -16,6 +16,12 @@ import ( // unchanged subtrees, so copies of a struct holding one can share it safely. // A nil *Locations is an empty tree. type Locations struct { + // empty is set for a map or slice written as empty ({} or []): the typed value is + // then nil or empty, like when it was not written. Scalars and structs are not + // flagged: ForceSendFields records an explicit zero value. The flag says nothing + // about a value that has been filled in since. + empty bool + locs []diag.Location keys map[string]*Locations elems []*Locations @@ -93,6 +99,12 @@ func (l *Locations) Elems() iter.Seq2[int, *Locations] { } } +// IsEmpty reports whether the map or slice was written as empty ({} or []). It says +// nothing about a value that has been filled in since: check that it is still empty. +func (l *Locations) IsEmpty() bool { + return l != nil && l.empty +} + // Get returns the locations recorded for the value itself. func (l *Locations) Get() []diag.Location { if l == nil { @@ -245,6 +257,7 @@ func MergeLocations(a, b *Locations) *Locations { return b.WithLocations(concatLocations(b.locs, a.locs)) } c := a.clone() + c.empty = a.empty && b.empty c.locs = concatLocations(a.locs, b.locs) for k, bv := range b.keys { if c.keys == nil { diff --git a/libs/structs/structvar/structvar_test.go b/libs/structs/structvar/structvar_test.go index f1c2095dc77..1e621f0c936 100644 --- a/libs/structs/structvar/structvar_test.go +++ b/libs/structs/structvar/structvar_test.go @@ -416,3 +416,32 @@ func TestMergeNullIntoValueKeepsIt(t *testing.T) { require.NotNil(t, dst.Queue) assert.True(t, dst.Queue.Enabled) } + +func TestIsEmpty(t *testing.T) { + type sub struct { + Tags []string `json:"tags,omitempty"` + } + type target struct { + List []string `json:"list,omitempty"` + Map map[string]string `json:"map,omitempty"` + Sub *sub `json:"sub,omitempty"` + Other []string `json:"other,omitempty"` + } + var dst target + sv, _, err := structvar.DecodeYAML("a.yml", strings.NewReader("list: []\nmap: {}\nsub: {tags: []}\n"), &dst) + require.NoError(t, err) + + assert.True(t, sv.IsEmpty(structpath.NewPath(nil, "list"))) + assert.True(t, sv.IsEmpty(structpath.NewPath(nil, "map"))) + assert.False(t, sv.IsEmpty(structpath.NewPath(nil, "other"))) + // A struct is not flagged: ForceSendFields records it. A slice in it is. + assert.False(t, sv.IsEmpty(structpath.NewPath(nil, "sub"))) + assert.True(t, sv.IsEmpty(structpath.NewPath(nil, "sub", "tags"))) + + // Both are an empty slice in the typed value: the flag is what tells them apart. + assert.Empty(t, dst.List) + assert.Empty(t, dst.Other) + + require.NoError(t, sv.Delete(structpath.NewPath(nil, "sub"))) + assert.False(t, sv.IsEmpty(structpath.NewPath(nil, "sub", "tags"))) +} diff --git a/libs/structs/structvar/write.go b/libs/structs/structvar/write.go index e5c20c76e01..bc530a34e84 100644 --- a/libs/structs/structvar/write.go +++ b/libs/structs/structvar/write.go @@ -185,6 +185,12 @@ func (sv *StructVar) CopyMetadata(src *StructVar, path *structpath.PathNode) { sv.Refs = refs } +// IsEmpty reports whether the map or slice at path was written as empty ({} or []): a +// typed value cannot tell it from an unset one. See [Locations.IsEmpty]. +func (sv *StructVar) IsEmpty(path *structpath.PathNode) bool { + return sv.Locations.Sub(path).IsEmpty() +} + // SetLocations sets the locations of the value at path and of every value below it, // including values that have no locations yet (e.g. set in Go code). func (sv *StructVar) SetLocations(path *structpath.PathNode, locs []diag.Location) {