diff --git a/internal/service/compute_tf/legacy_model.go b/internal/service/compute_tf/legacy_model.go index 8aa22622d..ccca65037 100755 --- a/internal/service/compute_tf/legacy_model.go +++ b/internal/service/compute_tf/legacy_model.go @@ -965,9 +965,16 @@ type ClusterAttributes_SdkV2 struct { // Data security mode decides what data governance model to use when // accessing data from a cluster. // - // * `NONE`: No security isolation for multiple users sharing the cluster. - // Data governance features are not available in this mode. * `SINGLE_USER`: - // A secure cluster that can only be exclusively used by a single user + // The following modes can only be used with `kind`. * + // `DATA_SECURITY_MODE_AUTO`: Databricks will choose the most appropriate + // access mode depending on your compute configuration. * + // `DATA_SECURITY_MODE_STANDARD`: Alias for `USER_ISOLATION`. * + // `DATA_SECURITY_MODE_DEDICATED`: Alias for `SINGLE_USER`. + // + // The following modes can be used regardless of `kind`. * `NONE`: No + // security isolation for multiple users sharing the cluster. Data + // governance features are not available in this mode. * `SINGLE_USER`: A + // secure cluster that can only be exclusively used by a single user // specified in `single_user_name`. Most programming languages, cluster // features and data governance features are available in this mode. * // `USER_ISOLATION`: A secure cluster that can be shared by multiple users. @@ -1012,6 +1019,19 @@ type ClusterAttributes_SdkV2 struct { InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` // The optional ID of the instance pool to which the cluster belongs. InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + // This field can only be used with `kind`. + // + // When set to true, Databricks will automatically set single node related + // `custom_tags`, `spark_conf`, and `num_workers` + IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + // The kind of compute described by this compute specification. + // + // Depending on `kind`, different validations and default values will be + // applied. + // + // The first usage of this value is for the simple cluster form where it + // sets `kind = CLASSIC_PREVIEW`. + Kind types.String `tfsdk:"kind" tf:"optional"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A @@ -1059,6 +1079,12 @@ type ClusterAttributes_SdkV2 struct { // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + // This field can only be used with `kind`. + // + // `effective_spark_version` is determined by `spark_version` (DBR release), + // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or + // not. + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` WorkloadType types.List `tfsdk:"workload_type" tf:"optional,object"` } @@ -1114,6 +1140,8 @@ func (o ClusterAttributes_SdkV2) ToObjectValue(ctx context.Context) basetypes.Ob "gcp_attributes": o.GcpAttributes, "init_scripts": o.InitScripts, "instance_pool_id": o.InstancePoolId, + "is_single_node": o.IsSingleNode, + "kind": o.Kind, "node_type_id": o.NodeTypeId, "policy_id": o.PolicyId, "runtime_engine": o.RuntimeEngine, @@ -1122,6 +1150,7 @@ func (o ClusterAttributes_SdkV2) ToObjectValue(ctx context.Context) basetypes.Ob "spark_env_vars": o.SparkEnvVars, "spark_version": o.SparkVersion, "ssh_public_keys": o.SshPublicKeys, + "use_ml_runtime": o.UseMlRuntime, "workload_type": o.WorkloadType, }) } @@ -1159,6 +1188,8 @@ func (o ClusterAttributes_SdkV2) Type(ctx context.Context) attr.Type { ElemType: InitScriptInfo{}.Type(ctx), }, "instance_pool_id": types.StringType, + "is_single_node": types.BoolType, + "kind": types.StringType, "node_type_id": types.StringType, "policy_id": types.StringType, "runtime_engine": types.StringType, @@ -1173,6 +1204,7 @@ func (o ClusterAttributes_SdkV2) Type(ctx context.Context) attr.Type { "ssh_public_keys": basetypes.ListType{ ElemType: types.StringType, }, + "use_ml_runtime": types.BoolType, "workload_type": basetypes.ListType{ ElemType: WorkloadType{}.Type(ctx), }, @@ -1607,9 +1639,16 @@ type ClusterDetails_SdkV2 struct { // Data security mode decides what data governance model to use when // accessing data from a cluster. // - // * `NONE`: No security isolation for multiple users sharing the cluster. - // Data governance features are not available in this mode. * `SINGLE_USER`: - // A secure cluster that can only be exclusively used by a single user + // The following modes can only be used with `kind`. * + // `DATA_SECURITY_MODE_AUTO`: Databricks will choose the most appropriate + // access mode depending on your compute configuration. * + // `DATA_SECURITY_MODE_STANDARD`: Alias for `USER_ISOLATION`. * + // `DATA_SECURITY_MODE_DEDICATED`: Alias for `SINGLE_USER`. + // + // The following modes can be used regardless of `kind`. * `NONE`: No + // security isolation for multiple users sharing the cluster. Data + // governance features are not available in this mode. * `SINGLE_USER`: A + // secure cluster that can only be exclusively used by a single user // specified in `single_user_name`. Most programming languages, cluster // features and data governance features are available in this mode. * // `USER_ISOLATION`: A secure cluster that can be shared by multiple users. @@ -1673,9 +1712,22 @@ type ClusterDetails_SdkV2 struct { InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` // The optional ID of the instance pool to which the cluster belongs. InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + // This field can only be used with `kind`. + // + // When set to true, Databricks will automatically set single node related + // `custom_tags`, `spark_conf`, and `num_workers` + IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` // Port on which Spark JDBC server is listening, in the driver nod. No // service will be listeningon on this port in executor nodes. JdbcPort types.Int64 `tfsdk:"jdbc_port" tf:"optional"` + // The kind of compute described by this compute specification. + // + // Depending on `kind`, different validations and default values will be + // applied. + // + // The first usage of this value is for the simple cluster form where it + // sets `kind = CLASSIC_PREVIEW`. + Kind types.String `tfsdk:"kind" tf:"optional"` // the timestamp that the cluster was started/restarted LastRestartedTime types.Int64 `tfsdk:"last_restarted_time" tf:"optional"` // Time when the cluster driver last lost its state (due to a restart or @@ -1762,6 +1814,12 @@ type ClusterDetails_SdkV2 struct { // Information about why the cluster was terminated. This field only appears // when the cluster is in a `TERMINATING` or `TERMINATED` state. TerminationReason types.List `tfsdk:"termination_reason" tf:"optional,object"` + // This field can only be used with `kind`. + // + // `effective_spark_version` is determined by `spark_version` (DBR release), + // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or + // not. + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` WorkloadType types.List `tfsdk:"workload_type" tf:"optional,object"` } @@ -1834,7 +1892,9 @@ func (o ClusterDetails_SdkV2) ToObjectValue(ctx context.Context) basetypes.Objec "gcp_attributes": o.GcpAttributes, "init_scripts": o.InitScripts, "instance_pool_id": o.InstancePoolId, + "is_single_node": o.IsSingleNode, "jdbc_port": o.JdbcPort, + "kind": o.Kind, "last_restarted_time": o.LastRestartedTime, "last_state_loss_time": o.LastStateLossTime, "node_type_id": o.NodeTypeId, @@ -1853,6 +1913,7 @@ func (o ClusterDetails_SdkV2) ToObjectValue(ctx context.Context) basetypes.Objec "state_message": o.StateMessage, "terminated_time": o.TerminatedTime, "termination_reason": o.TerminationReason, + "use_ml_runtime": o.UseMlRuntime, "workload_type": o.WorkloadType, }) } @@ -1910,7 +1971,9 @@ func (o ClusterDetails_SdkV2) Type(ctx context.Context) attr.Type { ElemType: InitScriptInfo{}.Type(ctx), }, "instance_pool_id": types.StringType, + "is_single_node": types.BoolType, "jdbc_port": types.Int64Type, + "kind": types.StringType, "last_restarted_time": types.Int64Type, "last_state_loss_time": types.Int64Type, "node_type_id": types.StringType, @@ -1939,6 +2002,7 @@ func (o ClusterDetails_SdkV2) Type(ctx context.Context) attr.Type { "termination_reason": basetypes.ListType{ ElemType: TerminationReason{}.Type(ctx), }, + "use_ml_runtime": types.BoolType, "workload_type": basetypes.ListType{ ElemType: WorkloadType{}.Type(ctx), }, @@ -3605,9 +3669,16 @@ type ClusterSpec_SdkV2 struct { // Data security mode decides what data governance model to use when // accessing data from a cluster. // - // * `NONE`: No security isolation for multiple users sharing the cluster. - // Data governance features are not available in this mode. * `SINGLE_USER`: - // A secure cluster that can only be exclusively used by a single user + // The following modes can only be used with `kind`. * + // `DATA_SECURITY_MODE_AUTO`: Databricks will choose the most appropriate + // access mode depending on your compute configuration. * + // `DATA_SECURITY_MODE_STANDARD`: Alias for `USER_ISOLATION`. * + // `DATA_SECURITY_MODE_DEDICATED`: Alias for `SINGLE_USER`. + // + // The following modes can be used regardless of `kind`. * `NONE`: No + // security isolation for multiple users sharing the cluster. Data + // governance features are not available in this mode. * `SINGLE_USER`: A + // secure cluster that can only be exclusively used by a single user // specified in `single_user_name`. Most programming languages, cluster // features and data governance features are available in this mode. * // `USER_ISOLATION`: A secure cluster that can be shared by multiple users. @@ -3652,6 +3723,19 @@ type ClusterSpec_SdkV2 struct { InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` // The optional ID of the instance pool to which the cluster belongs. InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + // This field can only be used with `kind`. + // + // When set to true, Databricks will automatically set single node related + // `custom_tags`, `spark_conf`, and `num_workers` + IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + // The kind of compute described by this compute specification. + // + // Depending on `kind`, different validations and default values will be + // applied. + // + // The first usage of this value is for the simple cluster form where it + // sets `kind = CLASSIC_PREVIEW`. + Kind types.String `tfsdk:"kind" tf:"optional"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A @@ -3710,6 +3794,12 @@ type ClusterSpec_SdkV2 struct { // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + // This field can only be used with `kind`. + // + // `effective_spark_version` is determined by `spark_version` (DBR release), + // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or + // not. + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` WorkloadType types.List `tfsdk:"workload_type" tf:"optional,object"` } @@ -3768,6 +3858,8 @@ func (o ClusterSpec_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectVa "gcp_attributes": o.GcpAttributes, "init_scripts": o.InitScripts, "instance_pool_id": o.InstancePoolId, + "is_single_node": o.IsSingleNode, + "kind": o.Kind, "node_type_id": o.NodeTypeId, "num_workers": o.NumWorkers, "policy_id": o.PolicyId, @@ -3777,6 +3869,7 @@ func (o ClusterSpec_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectVa "spark_env_vars": o.SparkEnvVars, "spark_version": o.SparkVersion, "ssh_public_keys": o.SshPublicKeys, + "use_ml_runtime": o.UseMlRuntime, "workload_type": o.WorkloadType, }) } @@ -3818,6 +3911,8 @@ func (o ClusterSpec_SdkV2) Type(ctx context.Context) attr.Type { ElemType: InitScriptInfo{}.Type(ctx), }, "instance_pool_id": types.StringType, + "is_single_node": types.BoolType, + "kind": types.StringType, "node_type_id": types.StringType, "num_workers": types.Int64Type, "policy_id": types.StringType, @@ -3833,6 +3928,7 @@ func (o ClusterSpec_SdkV2) Type(ctx context.Context) attr.Type { "ssh_public_keys": basetypes.ListType{ ElemType: types.StringType, }, + "use_ml_runtime": types.BoolType, "workload_type": basetypes.ListType{ ElemType: WorkloadType{}.Type(ctx), }, @@ -4515,9 +4611,16 @@ type CreateCluster_SdkV2 struct { // Data security mode decides what data governance model to use when // accessing data from a cluster. // - // * `NONE`: No security isolation for multiple users sharing the cluster. - // Data governance features are not available in this mode. * `SINGLE_USER`: - // A secure cluster that can only be exclusively used by a single user + // The following modes can only be used with `kind`. * + // `DATA_SECURITY_MODE_AUTO`: Databricks will choose the most appropriate + // access mode depending on your compute configuration. * + // `DATA_SECURITY_MODE_STANDARD`: Alias for `USER_ISOLATION`. * + // `DATA_SECURITY_MODE_DEDICATED`: Alias for `SINGLE_USER`. + // + // The following modes can be used regardless of `kind`. * `NONE`: No + // security isolation for multiple users sharing the cluster. Data + // governance features are not available in this mode. * `SINGLE_USER`: A + // secure cluster that can only be exclusively used by a single user // specified in `single_user_name`. Most programming languages, cluster // features and data governance features are available in this mode. * // `USER_ISOLATION`: A secure cluster that can be shared by multiple users. @@ -4562,6 +4665,19 @@ type CreateCluster_SdkV2 struct { InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` // The optional ID of the instance pool to which the cluster belongs. InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + // This field can only be used with `kind`. + // + // When set to true, Databricks will automatically set single node related + // `custom_tags`, `spark_conf`, and `num_workers` + IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + // The kind of compute described by this compute specification. + // + // Depending on `kind`, different validations and default values will be + // applied. + // + // The first usage of this value is for the simple cluster form where it + // sets `kind = CLASSIC_PREVIEW`. + Kind types.String `tfsdk:"kind" tf:"optional"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A @@ -4620,6 +4736,12 @@ type CreateCluster_SdkV2 struct { // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + // This field can only be used with `kind`. + // + // `effective_spark_version` is determined by `spark_version` (DBR release), + // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or + // not. + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` WorkloadType types.List `tfsdk:"workload_type" tf:"optional,object"` } @@ -4680,6 +4802,8 @@ func (o CreateCluster_SdkV2) ToObjectValue(ctx context.Context) basetypes.Object "gcp_attributes": o.GcpAttributes, "init_scripts": o.InitScripts, "instance_pool_id": o.InstancePoolId, + "is_single_node": o.IsSingleNode, + "kind": o.Kind, "node_type_id": o.NodeTypeId, "num_workers": o.NumWorkers, "policy_id": o.PolicyId, @@ -4689,6 +4813,7 @@ func (o CreateCluster_SdkV2) ToObjectValue(ctx context.Context) basetypes.Object "spark_env_vars": o.SparkEnvVars, "spark_version": o.SparkVersion, "ssh_public_keys": o.SshPublicKeys, + "use_ml_runtime": o.UseMlRuntime, "workload_type": o.WorkloadType, }) } @@ -4733,6 +4858,8 @@ func (o CreateCluster_SdkV2) Type(ctx context.Context) attr.Type { ElemType: InitScriptInfo{}.Type(ctx), }, "instance_pool_id": types.StringType, + "is_single_node": types.BoolType, + "kind": types.StringType, "node_type_id": types.StringType, "num_workers": types.Int64Type, "policy_id": types.StringType, @@ -4748,6 +4875,7 @@ func (o CreateCluster_SdkV2) Type(ctx context.Context) attr.Type { "ssh_public_keys": basetypes.ListType{ ElemType: types.StringType, }, + "use_ml_runtime": types.BoolType, "workload_type": basetypes.ListType{ ElemType: WorkloadType{}.Type(ctx), }, @@ -6595,9 +6723,16 @@ type EditCluster_SdkV2 struct { // Data security mode decides what data governance model to use when // accessing data from a cluster. // - // * `NONE`: No security isolation for multiple users sharing the cluster. - // Data governance features are not available in this mode. * `SINGLE_USER`: - // A secure cluster that can only be exclusively used by a single user + // The following modes can only be used with `kind`. * + // `DATA_SECURITY_MODE_AUTO`: Databricks will choose the most appropriate + // access mode depending on your compute configuration. * + // `DATA_SECURITY_MODE_STANDARD`: Alias for `USER_ISOLATION`. * + // `DATA_SECURITY_MODE_DEDICATED`: Alias for `SINGLE_USER`. + // + // The following modes can be used regardless of `kind`. * `NONE`: No + // security isolation for multiple users sharing the cluster. Data + // governance features are not available in this mode. * `SINGLE_USER`: A + // secure cluster that can only be exclusively used by a single user // specified in `single_user_name`. Most programming languages, cluster // features and data governance features are available in this mode. * // `USER_ISOLATION`: A secure cluster that can be shared by multiple users. @@ -6642,6 +6777,19 @@ type EditCluster_SdkV2 struct { InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` // The optional ID of the instance pool to which the cluster belongs. InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + // This field can only be used with `kind`. + // + // When set to true, Databricks will automatically set single node related + // `custom_tags`, `spark_conf`, and `num_workers` + IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + // The kind of compute described by this compute specification. + // + // Depending on `kind`, different validations and default values will be + // applied. + // + // The first usage of this value is for the simple cluster form where it + // sets `kind = CLASSIC_PREVIEW`. + Kind types.String `tfsdk:"kind" tf:"optional"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A @@ -6700,6 +6848,12 @@ type EditCluster_SdkV2 struct { // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + // This field can only be used with `kind`. + // + // `effective_spark_version` is determined by `spark_version` (DBR release), + // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or + // not. + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` WorkloadType types.List `tfsdk:"workload_type" tf:"optional,object"` } @@ -6759,6 +6913,8 @@ func (o EditCluster_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectVa "gcp_attributes": o.GcpAttributes, "init_scripts": o.InitScripts, "instance_pool_id": o.InstancePoolId, + "is_single_node": o.IsSingleNode, + "kind": o.Kind, "node_type_id": o.NodeTypeId, "num_workers": o.NumWorkers, "policy_id": o.PolicyId, @@ -6768,6 +6924,7 @@ func (o EditCluster_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectVa "spark_env_vars": o.SparkEnvVars, "spark_version": o.SparkVersion, "ssh_public_keys": o.SshPublicKeys, + "use_ml_runtime": o.UseMlRuntime, "workload_type": o.WorkloadType, }) } @@ -6810,6 +6967,8 @@ func (o EditCluster_SdkV2) Type(ctx context.Context) attr.Type { ElemType: InitScriptInfo{}.Type(ctx), }, "instance_pool_id": types.StringType, + "is_single_node": types.BoolType, + "kind": types.StringType, "node_type_id": types.StringType, "num_workers": types.Int64Type, "policy_id": types.StringType, @@ -6825,6 +6984,7 @@ func (o EditCluster_SdkV2) Type(ctx context.Context) attr.Type { "ssh_public_keys": basetypes.ListType{ ElemType: types.StringType, }, + "use_ml_runtime": types.BoolType, "workload_type": basetypes.ListType{ ElemType: WorkloadType{}.Type(ctx), }, @@ -15483,9 +15643,16 @@ type UpdateClusterResource_SdkV2 struct { // Data security mode decides what data governance model to use when // accessing data from a cluster. // - // * `NONE`: No security isolation for multiple users sharing the cluster. - // Data governance features are not available in this mode. * `SINGLE_USER`: - // A secure cluster that can only be exclusively used by a single user + // The following modes can only be used with `kind`. * + // `DATA_SECURITY_MODE_AUTO`: Databricks will choose the most appropriate + // access mode depending on your compute configuration. * + // `DATA_SECURITY_MODE_STANDARD`: Alias for `USER_ISOLATION`. * + // `DATA_SECURITY_MODE_DEDICATED`: Alias for `SINGLE_USER`. + // + // The following modes can be used regardless of `kind`. * `NONE`: No + // security isolation for multiple users sharing the cluster. Data + // governance features are not available in this mode. * `SINGLE_USER`: A + // secure cluster that can only be exclusively used by a single user // specified in `single_user_name`. Most programming languages, cluster // features and data governance features are available in this mode. * // `USER_ISOLATION`: A secure cluster that can be shared by multiple users. @@ -15530,6 +15697,19 @@ type UpdateClusterResource_SdkV2 struct { InitScripts types.List `tfsdk:"init_scripts" tf:"optional"` // The optional ID of the instance pool to which the cluster belongs. InstancePoolId types.String `tfsdk:"instance_pool_id" tf:"optional"` + // This field can only be used with `kind`. + // + // When set to true, Databricks will automatically set single node related + // `custom_tags`, `spark_conf`, and `num_workers` + IsSingleNode types.Bool `tfsdk:"is_single_node" tf:"optional"` + // The kind of compute described by this compute specification. + // + // Depending on `kind`, different validations and default values will be + // applied. + // + // The first usage of this value is for the simple cluster form where it + // sets `kind = CLASSIC_PREVIEW`. + Kind types.String `tfsdk:"kind" tf:"optional"` // This field encodes, through a single value, the resources available to // each of the Spark nodes in this cluster. For example, the Spark nodes can // be provisioned and optimized for memory or compute intensive workloads. A @@ -15588,6 +15768,12 @@ type UpdateClusterResource_SdkV2 struct { // cluster. The corresponding private keys can be used to login with the // user name `ubuntu` on port `2200`. Up to 10 keys can be specified. SshPublicKeys types.List `tfsdk:"ssh_public_keys" tf:"optional"` + // This field can only be used with `kind`. + // + // `effective_spark_version` is determined by `spark_version` (DBR release), + // this field `use_ml_runtime`, and whether `node_type_id` is gpu node or + // not. + UseMlRuntime types.Bool `tfsdk:"use_ml_runtime" tf:"optional"` WorkloadType types.List `tfsdk:"workload_type" tf:"optional,object"` } @@ -15645,6 +15831,8 @@ func (o UpdateClusterResource_SdkV2) ToObjectValue(ctx context.Context) basetype "gcp_attributes": o.GcpAttributes, "init_scripts": o.InitScripts, "instance_pool_id": o.InstancePoolId, + "is_single_node": o.IsSingleNode, + "kind": o.Kind, "node_type_id": o.NodeTypeId, "num_workers": o.NumWorkers, "policy_id": o.PolicyId, @@ -15654,6 +15842,7 @@ func (o UpdateClusterResource_SdkV2) ToObjectValue(ctx context.Context) basetype "spark_env_vars": o.SparkEnvVars, "spark_version": o.SparkVersion, "ssh_public_keys": o.SshPublicKeys, + "use_ml_runtime": o.UseMlRuntime, "workload_type": o.WorkloadType, }) } @@ -15694,6 +15883,8 @@ func (o UpdateClusterResource_SdkV2) Type(ctx context.Context) attr.Type { ElemType: InitScriptInfo{}.Type(ctx), }, "instance_pool_id": types.StringType, + "is_single_node": types.BoolType, + "kind": types.StringType, "node_type_id": types.StringType, "num_workers": types.Int64Type, "policy_id": types.StringType, @@ -15709,6 +15900,7 @@ func (o UpdateClusterResource_SdkV2) Type(ctx context.Context) attr.Type { "ssh_public_keys": basetypes.ListType{ ElemType: types.StringType, }, + "use_ml_runtime": types.BoolType, "workload_type": basetypes.ListType{ ElemType: WorkloadType{}.Type(ctx), }, diff --git a/internal/service/compute_tf/model.go b/internal/service/compute_tf/model.go index c120fad99..b62fa06c3 100755 --- a/internal/service/compute_tf/model.go +++ b/internal/service/compute_tf/model.go @@ -1195,9 +1195,7 @@ func (o ClusterAttributes) Type(ctx context.Context) attr.Type { ElemType: types.StringType, }, "use_ml_runtime": types.BoolType, - "workload_type": basetypes.ListType{ - ElemType: WorkloadType{}.Type(ctx), - }, + "workload_type": WorkloadType{}.Type(ctx), }, } } @@ -1815,7 +1813,7 @@ type ClusterDetails struct { TerminatedTime types.Int64 `tfsdk:"terminated_time" tf:"optional"` // Information about why the cluster was terminated. This field only appears // when the cluster is in a `TERMINATING` or `TERMINATED` state. - TerminationReason types.List `tfsdk:"termination_reason" tf:"optional,object"` + TerminationReason types.Object `tfsdk:"termination_reason" tf:"optional,object"` // This field can only be used with `kind`. // // `effective_spark_version` is determined by `spark_version` (DBR release), @@ -1979,17 +1977,13 @@ func (o ClusterDetails) Type(ctx context.Context) attr.Type { "ssh_public_keys": basetypes.ListType{ ElemType: types.StringType, }, - "start_time": types.Int64Type, - "state": types.StringType, - "state_message": types.StringType, - "terminated_time": types.Int64Type, - "termination_reason": basetypes.ListType{ - ElemType: TerminationReason{}.Type(ctx), - }, - "use_ml_runtime": types.BoolType, - "workload_type": basetypes.ListType{ - ElemType: WorkloadType{}.Type(ctx), - }, + "start_time": types.Int64Type, + "state": types.StringType, + "state_message": types.StringType, + "terminated_time": types.Int64Type, + "termination_reason": TerminationReason{}.Type(ctx), + "use_ml_runtime": types.BoolType, + "workload_type": WorkloadType{}.Type(ctx), }, } } @@ -3923,9 +3917,7 @@ func (o ClusterSpec) Type(ctx context.Context) attr.Type { ElemType: types.StringType, }, "use_ml_runtime": types.BoolType, - "workload_type": basetypes.ListType{ - ElemType: WorkloadType{}.Type(ctx), - }, + "workload_type": WorkloadType{}.Type(ctx), }, } } @@ -4870,9 +4862,7 @@ func (o CreateCluster) Type(ctx context.Context) attr.Type { ElemType: types.StringType, }, "use_ml_runtime": types.BoolType, - "workload_type": basetypes.ListType{ - ElemType: WorkloadType{}.Type(ctx), - }, + "workload_type": WorkloadType{}.Type(ctx), }, } } @@ -6983,9 +6973,7 @@ func (o EditCluster) Type(ctx context.Context) attr.Type { ElemType: types.StringType, }, "use_ml_runtime": types.BoolType, - "workload_type": basetypes.ListType{ - ElemType: WorkloadType{}.Type(ctx), - }, + "workload_type": WorkloadType{}.Type(ctx), }, } } @@ -15901,9 +15889,7 @@ func (o UpdateClusterResource) Type(ctx context.Context) attr.Type { ElemType: types.StringType, }, "use_ml_runtime": types.BoolType, - "workload_type": basetypes.ListType{ - ElemType: WorkloadType{}.Type(ctx), - }, + "workload_type": WorkloadType{}.Type(ctx), }, } } diff --git a/internal/service/dashboards_tf/legacy_model.go b/internal/service/dashboards_tf/legacy_model.go index 13e604f40..b1804e48b 100755 --- a/internal/service/dashboards_tf/legacy_model.go +++ b/internal/service/dashboards_tf/legacy_model.go @@ -1998,6 +1998,10 @@ type MigrateDashboardRequest_SdkV2 struct { ParentPath types.String `tfsdk:"parent_path" tf:"optional"` // UUID of the dashboard to be migrated. SourceDashboardId types.String `tfsdk:"source_dashboard_id" tf:""` + // Flag to indicate if mustache parameter syntax ({{ param }}) should be + // auto-updated to named syntax (:param) when converting datasets in the + // dashboard. + UpdateParameterSyntax types.Bool `tfsdk:"update_parameter_syntax" tf:"optional"` } func (newState *MigrateDashboardRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan MigrateDashboardRequest_SdkV2) { @@ -2024,9 +2028,10 @@ func (o MigrateDashboardRequest_SdkV2) ToObjectValue(ctx context.Context) basety return types.ObjectValueMust( o.Type(ctx).(basetypes.ObjectType).AttrTypes, map[string]attr.Value{ - "display_name": o.DisplayName, - "parent_path": o.ParentPath, - "source_dashboard_id": o.SourceDashboardId, + "display_name": o.DisplayName, + "parent_path": o.ParentPath, + "source_dashboard_id": o.SourceDashboardId, + "update_parameter_syntax": o.UpdateParameterSyntax, }) } @@ -2034,9 +2039,10 @@ func (o MigrateDashboardRequest_SdkV2) ToObjectValue(ctx context.Context) basety func (o MigrateDashboardRequest_SdkV2) Type(ctx context.Context) attr.Type { return types.ObjectType{ AttrTypes: map[string]attr.Type{ - "display_name": types.StringType, - "parent_path": types.StringType, - "source_dashboard_id": types.StringType, + "display_name": types.StringType, + "parent_path": types.StringType, + "source_dashboard_id": types.StringType, + "update_parameter_syntax": types.BoolType, }, } } diff --git a/internal/service/jobs_tf/legacy_model.go b/internal/service/jobs_tf/legacy_model.go index c43308080..310948b39 100755 --- a/internal/service/jobs_tf/legacy_model.go +++ b/internal/service/jobs_tf/legacy_model.go @@ -243,6 +243,8 @@ type BaseRun_SdkV2 struct { // failures. * `RUN_JOB_TASK`: Indicates a run that is triggered using a Run // Job task. * `FILE_ARRIVAL`: Indicates a run that is triggered by a file // arrival. * `TABLE`: Indicates a run that is triggered by a table update. + // * `CONTINUOUS_RESTART`: Indicates a run created by user to manually + // restart a continuous job run. Trigger types.String `tfsdk:"trigger" tf:"optional"` // Additional details about what triggered the run TriggerInfo types.List `tfsdk:"trigger_info" tf:"optional,object"` @@ -855,7 +857,7 @@ func (o CancelRunResponse_SdkV2) Type(ctx context.Context) attr.Type { } } -// Stores the run state of the clean room notebook V1 task. +// Stores the run state of the clean rooms notebook task. type CleanRoomTaskRunState_SdkV2 struct { // A value indicating the run's current lifecycle state. This field is // always available in the response. @@ -904,6 +906,92 @@ func (o CleanRoomTaskRunState_SdkV2) Type(ctx context.Context) attr.Type { } } +type CleanRoomsNotebookTask_SdkV2 struct { + // The clean room that the notebook belongs to. + CleanRoomName types.String `tfsdk:"clean_room_name" tf:""` + // Checksum to validate the freshness of the notebook resource (i.e. the + // notebook being run is the latest version). It can be fetched by calling + // the :method:cleanroomassets/get API. + Etag types.String `tfsdk:"etag" tf:"optional"` + // Base parameters to be used for the clean room notebook job. + NotebookBaseParameters types.Map `tfsdk:"notebook_base_parameters" tf:"optional"` + // Name of the notebook being run. + NotebookName types.String `tfsdk:"notebook_name" tf:""` +} + +func (newState *CleanRoomsNotebookTask_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CleanRoomsNotebookTask_SdkV2) { +} + +func (newState *CleanRoomsNotebookTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState CleanRoomsNotebookTask_SdkV2) { +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in CleanRoomsNotebookTask. +// Container types (types.Map, types.List, types.Set) and object types (types.Object) do not carry +// the type information of their elements in the Go type system. This function provides a way to +// retrieve the type information of the elements in complex fields at runtime. The values of the map +// are the reflected types of the contained elements. They must be either primitive values from the +// plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF +// SDK values. +func (a CleanRoomsNotebookTask_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { + return map[string]reflect.Type{ + "notebook_base_parameters": reflect.TypeOf(types.String{}), + } +} + +// TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise +// interfere with how the plugin framework retrieves and sets values in state. Thus, CleanRoomsNotebookTask_SdkV2 +// only implements ToObjectValue() and Type(). +func (o CleanRoomsNotebookTask_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "clean_room_name": o.CleanRoomName, + "etag": o.Etag, + "notebook_base_parameters": o.NotebookBaseParameters, + "notebook_name": o.NotebookName, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o CleanRoomsNotebookTask_SdkV2) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "clean_room_name": types.StringType, + "etag": types.StringType, + "notebook_base_parameters": basetypes.MapType{ + ElemType: types.StringType, + }, + "notebook_name": types.StringType, + }, + } +} + +// GetNotebookBaseParameters returns the value of the NotebookBaseParameters field in CleanRoomsNotebookTask_SdkV2 as +// a map of string to types.String values. +// If the field is unknown or null, the boolean return value is false. +func (o *CleanRoomsNotebookTask_SdkV2) GetNotebookBaseParameters(ctx context.Context) (map[string]types.String, bool) { + if o.NotebookBaseParameters.IsNull() || o.NotebookBaseParameters.IsUnknown() { + return nil, false + } + var v map[string]types.String + d := o.NotebookBaseParameters.ElementsAs(ctx, &v, true) + if d.HasError() { + panic(pluginfwcommon.DiagToString(d)) + } + return v, true +} + +// SetNotebookBaseParameters sets the value of the NotebookBaseParameters field in CleanRoomsNotebookTask_SdkV2. +func (o *CleanRoomsNotebookTask_SdkV2) SetNotebookBaseParameters(ctx context.Context, v map[string]types.String) { + vs := make(map[string]attr.Value, len(v)) + for k, e := range v { + vs[k] = e + } + t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["notebook_base_parameters"] + t = t.(attr.TypeWithElementType).ElementType() + o.NotebookBaseParameters = types.MapValueMust(t, vs) +} + type ClusterInstance_SdkV2 struct { // The canonical identifier for the cluster used by a run. This field is // always available for runs on existing clusters. For runs on new clusters, @@ -5596,13 +5684,13 @@ type JobsHealthRule_SdkV2 struct { // // * `RUN_DURATION_SECONDS`: Expected total time for a run in seconds. * // `STREAMING_BACKLOG_BYTES`: An estimate of the maximum bytes of data - // waiting to be consumed across all streams. This metric is in Private + // waiting to be consumed across all streams. This metric is in Public // Preview. * `STREAMING_BACKLOG_RECORDS`: An estimate of the maximum offset - // lag across all streams. This metric is in Private Preview. * + // lag across all streams. This metric is in Public Preview. * // `STREAMING_BACKLOG_SECONDS`: An estimate of the maximum consumer delay - // across all streams. This metric is in Private Preview. * + // across all streams. This metric is in Public Preview. * // `STREAMING_BACKLOG_FILES`: An estimate of the maximum number of - // outstanding files across all streams. This metric is in Private Preview. + // outstanding files across all streams. This metric is in Public Preview. Metric types.String `tfsdk:"metric" tf:""` // Specifies the operator used to compare the health metric value with the // specified threshold. @@ -8518,6 +8606,8 @@ type Run_SdkV2 struct { // failures. * `RUN_JOB_TASK`: Indicates a run that is triggered using a Run // Job task. * `FILE_ARRIVAL`: Indicates a run that is triggered by a file // arrival. * `TABLE`: Indicates a run that is triggered by a table update. + // * `CONTINUOUS_RESTART`: Indicates a run created by user to manually + // restart a continuous job run. Trigger types.String `tfsdk:"trigger" tf:"optional"` // Additional details about what triggered the run TriggerInfo types.List `tfsdk:"trigger_info" tf:"optional,object"` @@ -10966,6 +11056,11 @@ type RunTask_SdkV2 struct { // retried only until they succeed, and the maximum `attempt_number` is the // same as the `max_retries` value for the job. AttemptNumber types.Int64 `tfsdk:"attempt_number" tf:"optional"` + // The task runs a [clean rooms] notebook when the + // `clean_rooms_notebook_task` field is present. + // + // [clean rooms]: https://docs.databricks.com/en/clean-rooms/index.html + CleanRoomsNotebookTask types.List `tfsdk:"clean_rooms_notebook_task" tf:"optional,object"` // The time in milliseconds it took to terminate the cluster and clean up // any associated artifacts. The duration of a task run is the sum of the // `setup_duration`, `execution_duration`, and the `cleanup_duration`. The @@ -11139,28 +11234,29 @@ func (newState *RunTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunTa // SDK values. func (a RunTask_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { return map[string]reflect.Type{ - "cluster_instance": reflect.TypeOf(ClusterInstance_SdkV2{}), - "condition_task": reflect.TypeOf(RunConditionTask_SdkV2{}), - "dbt_task": reflect.TypeOf(DbtTask_SdkV2{}), - "depends_on": reflect.TypeOf(TaskDependency_SdkV2{}), - "email_notifications": reflect.TypeOf(JobEmailNotifications_SdkV2{}), - "for_each_task": reflect.TypeOf(RunForEachTask_SdkV2{}), - "git_source": reflect.TypeOf(GitSource_SdkV2{}), - "library": reflect.TypeOf(compute_tf.Library_SdkV2{}), - "new_cluster": reflect.TypeOf(compute_tf.ClusterSpec_SdkV2{}), - "notebook_task": reflect.TypeOf(NotebookTask_SdkV2{}), - "notification_settings": reflect.TypeOf(TaskNotificationSettings_SdkV2{}), - "pipeline_task": reflect.TypeOf(PipelineTask_SdkV2{}), - "python_wheel_task": reflect.TypeOf(PythonWheelTask_SdkV2{}), - "resolved_values": reflect.TypeOf(ResolvedValues_SdkV2{}), - "run_job_task": reflect.TypeOf(RunJobTask_SdkV2{}), - "spark_jar_task": reflect.TypeOf(SparkJarTask_SdkV2{}), - "spark_python_task": reflect.TypeOf(SparkPythonTask_SdkV2{}), - "spark_submit_task": reflect.TypeOf(SparkSubmitTask_SdkV2{}), - "sql_task": reflect.TypeOf(SqlTask_SdkV2{}), - "state": reflect.TypeOf(RunState_SdkV2{}), - "status": reflect.TypeOf(RunStatus_SdkV2{}), - "webhook_notifications": reflect.TypeOf(WebhookNotifications_SdkV2{}), + "clean_rooms_notebook_task": reflect.TypeOf(CleanRoomsNotebookTask_SdkV2{}), + "cluster_instance": reflect.TypeOf(ClusterInstance_SdkV2{}), + "condition_task": reflect.TypeOf(RunConditionTask_SdkV2{}), + "dbt_task": reflect.TypeOf(DbtTask_SdkV2{}), + "depends_on": reflect.TypeOf(TaskDependency_SdkV2{}), + "email_notifications": reflect.TypeOf(JobEmailNotifications_SdkV2{}), + "for_each_task": reflect.TypeOf(RunForEachTask_SdkV2{}), + "git_source": reflect.TypeOf(GitSource_SdkV2{}), + "library": reflect.TypeOf(compute_tf.Library_SdkV2{}), + "new_cluster": reflect.TypeOf(compute_tf.ClusterSpec_SdkV2{}), + "notebook_task": reflect.TypeOf(NotebookTask_SdkV2{}), + "notification_settings": reflect.TypeOf(TaskNotificationSettings_SdkV2{}), + "pipeline_task": reflect.TypeOf(PipelineTask_SdkV2{}), + "python_wheel_task": reflect.TypeOf(PythonWheelTask_SdkV2{}), + "resolved_values": reflect.TypeOf(ResolvedValues_SdkV2{}), + "run_job_task": reflect.TypeOf(RunJobTask_SdkV2{}), + "spark_jar_task": reflect.TypeOf(SparkJarTask_SdkV2{}), + "spark_python_task": reflect.TypeOf(SparkPythonTask_SdkV2{}), + "spark_submit_task": reflect.TypeOf(SparkSubmitTask_SdkV2{}), + "sql_task": reflect.TypeOf(SqlTask_SdkV2{}), + "state": reflect.TypeOf(RunState_SdkV2{}), + "status": reflect.TypeOf(RunStatus_SdkV2{}), + "webhook_notifications": reflect.TypeOf(WebhookNotifications_SdkV2{}), } } @@ -11171,45 +11267,46 @@ func (o RunTask_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue return types.ObjectValueMust( o.Type(ctx).(basetypes.ObjectType).AttrTypes, map[string]attr.Value{ - "attempt_number": o.AttemptNumber, - "cleanup_duration": o.CleanupDuration, - "cluster_instance": o.ClusterInstance, - "condition_task": o.ConditionTask, - "dbt_task": o.DbtTask, - "depends_on": o.DependsOn, - "description": o.Description, - "email_notifications": o.EmailNotifications, - "end_time": o.EndTime, - "environment_key": o.EnvironmentKey, - "execution_duration": o.ExecutionDuration, - "existing_cluster_id": o.ExistingClusterId, - "for_each_task": o.ForEachTask, - "git_source": o.GitSource, - "job_cluster_key": o.JobClusterKey, - "library": o.Libraries, - "new_cluster": o.NewCluster, - "notebook_task": o.NotebookTask, - "notification_settings": o.NotificationSettings, - "pipeline_task": o.PipelineTask, - "python_wheel_task": o.PythonWheelTask, - "queue_duration": o.QueueDuration, - "resolved_values": o.ResolvedValues, - "run_duration": o.RunDuration, - "run_id": o.RunId, - "run_if": o.RunIf, - "run_job_task": o.RunJobTask, - "run_page_url": o.RunPageUrl, - "setup_duration": o.SetupDuration, - "spark_jar_task": o.SparkJarTask, - "spark_python_task": o.SparkPythonTask, - "spark_submit_task": o.SparkSubmitTask, - "sql_task": o.SqlTask, - "start_time": o.StartTime, - "state": o.State, - "status": o.Status, - "task_key": o.TaskKey, - "timeout_seconds": o.TimeoutSeconds, - "webhook_notifications": o.WebhookNotifications, + "attempt_number": o.AttemptNumber, + "clean_rooms_notebook_task": o.CleanRoomsNotebookTask, + "cleanup_duration": o.CleanupDuration, + "cluster_instance": o.ClusterInstance, + "condition_task": o.ConditionTask, + "dbt_task": o.DbtTask, + "depends_on": o.DependsOn, + "description": o.Description, + "email_notifications": o.EmailNotifications, + "end_time": o.EndTime, + "environment_key": o.EnvironmentKey, + "execution_duration": o.ExecutionDuration, + "existing_cluster_id": o.ExistingClusterId, + "for_each_task": o.ForEachTask, + "git_source": o.GitSource, + "job_cluster_key": o.JobClusterKey, + "library": o.Libraries, + "new_cluster": o.NewCluster, + "notebook_task": o.NotebookTask, + "notification_settings": o.NotificationSettings, + "pipeline_task": o.PipelineTask, + "python_wheel_task": o.PythonWheelTask, + "queue_duration": o.QueueDuration, + "resolved_values": o.ResolvedValues, + "run_duration": o.RunDuration, + "run_id": o.RunId, + "run_if": o.RunIf, + "run_job_task": o.RunJobTask, + "run_page_url": o.RunPageUrl, + "setup_duration": o.SetupDuration, + "spark_jar_task": o.SparkJarTask, + "spark_python_task": o.SparkPythonTask, + "spark_submit_task": o.SparkSubmitTask, + "sql_task": o.SqlTask, + "start_time": o.StartTime, + "state": o.State, + "status": o.Status, + "task_key": o.TaskKey, + "timeout_seconds": o.TimeoutSeconds, + "webhook_notifications": o.WebhookNotifications, }) } @@ -11217,7 +11314,10 @@ func (o RunTask_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue func (o RunTask_SdkV2) Type(ctx context.Context) attr.Type { return types.ObjectType{ AttrTypes: map[string]attr.Type{ - "attempt_number": types.Int64Type, + "attempt_number": types.Int64Type, + "clean_rooms_notebook_task": basetypes.ListType{ + ElemType: CleanRoomsNotebookTask{}.Type(ctx), + }, "cleanup_duration": types.Int64Type, "cluster_instance": basetypes.ListType{ ElemType: ClusterInstance{}.Type(ctx), @@ -11304,6 +11404,32 @@ func (o RunTask_SdkV2) Type(ctx context.Context) attr.Type { } } +// GetCleanRoomsNotebookTask returns the value of the CleanRoomsNotebookTask field in RunTask_SdkV2 as +// a CleanRoomsNotebookTask_SdkV2 value. +// If the field is unknown or null, the boolean return value is false. +func (o *RunTask_SdkV2) GetCleanRoomsNotebookTask(ctx context.Context) (CleanRoomsNotebookTask_SdkV2, bool) { + var e CleanRoomsNotebookTask_SdkV2 + if o.CleanRoomsNotebookTask.IsNull() || o.CleanRoomsNotebookTask.IsUnknown() { + return e, false + } + var v []CleanRoomsNotebookTask_SdkV2 + d := o.CleanRoomsNotebookTask.ElementsAs(ctx, &v, true) + if d.HasError() { + panic(pluginfwcommon.DiagToString(d)) + } + if len(v) == 0 { + return e, false + } + return v[0], true +} + +// SetCleanRoomsNotebookTask sets the value of the CleanRoomsNotebookTask field in RunTask_SdkV2. +func (o *RunTask_SdkV2) SetCleanRoomsNotebookTask(ctx context.Context, v CleanRoomsNotebookTask_SdkV2) { + vs := []attr.Value{v.ToObjectValue(ctx)} + t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["clean_rooms_notebook_task"] + o.CleanRoomsNotebookTask = types.ListValueMust(t, vs) +} + // GetClusterInstance returns the value of the ClusterInstance field in RunTask_SdkV2 as // a ClusterInstance_SdkV2 value. // If the field is unknown or null, the boolean return value is false. @@ -13700,6 +13826,11 @@ func (o SubmitRunResponse_SdkV2) Type(ctx context.Context) attr.Type { } type SubmitTask_SdkV2 struct { + // The task runs a [clean rooms] notebook when the + // `clean_rooms_notebook_task` field is present. + // + // [clean rooms]: https://docs.databricks.com/en/clean-rooms/index.html + CleanRoomsNotebookTask types.List `tfsdk:"clean_rooms_notebook_task" tf:"optional,object"` // The task evaluates a condition that can be used to control the execution // of other tasks when the `condition_task` field is present. The condition // task does not require a cluster to execute and does not support retries @@ -13814,24 +13945,25 @@ func (newState *SubmitTask_SdkV2) SyncEffectiveFieldsDuringRead(existingState Su // SDK values. func (a SubmitTask_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { return map[string]reflect.Type{ - "condition_task": reflect.TypeOf(ConditionTask_SdkV2{}), - "dbt_task": reflect.TypeOf(DbtTask_SdkV2{}), - "depends_on": reflect.TypeOf(TaskDependency_SdkV2{}), - "email_notifications": reflect.TypeOf(JobEmailNotifications_SdkV2{}), - "for_each_task": reflect.TypeOf(ForEachTask_SdkV2{}), - "health": reflect.TypeOf(JobsHealthRules_SdkV2{}), - "library": reflect.TypeOf(compute_tf.Library_SdkV2{}), - "new_cluster": reflect.TypeOf(compute_tf.ClusterSpec_SdkV2{}), - "notebook_task": reflect.TypeOf(NotebookTask_SdkV2{}), - "notification_settings": reflect.TypeOf(TaskNotificationSettings_SdkV2{}), - "pipeline_task": reflect.TypeOf(PipelineTask_SdkV2{}), - "python_wheel_task": reflect.TypeOf(PythonWheelTask_SdkV2{}), - "run_job_task": reflect.TypeOf(RunJobTask_SdkV2{}), - "spark_jar_task": reflect.TypeOf(SparkJarTask_SdkV2{}), - "spark_python_task": reflect.TypeOf(SparkPythonTask_SdkV2{}), - "spark_submit_task": reflect.TypeOf(SparkSubmitTask_SdkV2{}), - "sql_task": reflect.TypeOf(SqlTask_SdkV2{}), - "webhook_notifications": reflect.TypeOf(WebhookNotifications_SdkV2{}), + "clean_rooms_notebook_task": reflect.TypeOf(CleanRoomsNotebookTask_SdkV2{}), + "condition_task": reflect.TypeOf(ConditionTask_SdkV2{}), + "dbt_task": reflect.TypeOf(DbtTask_SdkV2{}), + "depends_on": reflect.TypeOf(TaskDependency_SdkV2{}), + "email_notifications": reflect.TypeOf(JobEmailNotifications_SdkV2{}), + "for_each_task": reflect.TypeOf(ForEachTask_SdkV2{}), + "health": reflect.TypeOf(JobsHealthRules_SdkV2{}), + "library": reflect.TypeOf(compute_tf.Library_SdkV2{}), + "new_cluster": reflect.TypeOf(compute_tf.ClusterSpec_SdkV2{}), + "notebook_task": reflect.TypeOf(NotebookTask_SdkV2{}), + "notification_settings": reflect.TypeOf(TaskNotificationSettings_SdkV2{}), + "pipeline_task": reflect.TypeOf(PipelineTask_SdkV2{}), + "python_wheel_task": reflect.TypeOf(PythonWheelTask_SdkV2{}), + "run_job_task": reflect.TypeOf(RunJobTask_SdkV2{}), + "spark_jar_task": reflect.TypeOf(SparkJarTask_SdkV2{}), + "spark_python_task": reflect.TypeOf(SparkPythonTask_SdkV2{}), + "spark_submit_task": reflect.TypeOf(SparkSubmitTask_SdkV2{}), + "sql_task": reflect.TypeOf(SqlTask_SdkV2{}), + "webhook_notifications": reflect.TypeOf(WebhookNotifications_SdkV2{}), } } @@ -13842,30 +13974,31 @@ func (o SubmitTask_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectVal return types.ObjectValueMust( o.Type(ctx).(basetypes.ObjectType).AttrTypes, map[string]attr.Value{ - "condition_task": o.ConditionTask, - "dbt_task": o.DbtTask, - "depends_on": o.DependsOn, - "description": o.Description, - "email_notifications": o.EmailNotifications, - "environment_key": o.EnvironmentKey, - "existing_cluster_id": o.ExistingClusterId, - "for_each_task": o.ForEachTask, - "health": o.Health, - "library": o.Libraries, - "new_cluster": o.NewCluster, - "notebook_task": o.NotebookTask, - "notification_settings": o.NotificationSettings, - "pipeline_task": o.PipelineTask, - "python_wheel_task": o.PythonWheelTask, - "run_if": o.RunIf, - "run_job_task": o.RunJobTask, - "spark_jar_task": o.SparkJarTask, - "spark_python_task": o.SparkPythonTask, - "spark_submit_task": o.SparkSubmitTask, - "sql_task": o.SqlTask, - "task_key": o.TaskKey, - "timeout_seconds": o.TimeoutSeconds, - "webhook_notifications": o.WebhookNotifications, + "clean_rooms_notebook_task": o.CleanRoomsNotebookTask, + "condition_task": o.ConditionTask, + "dbt_task": o.DbtTask, + "depends_on": o.DependsOn, + "description": o.Description, + "email_notifications": o.EmailNotifications, + "environment_key": o.EnvironmentKey, + "existing_cluster_id": o.ExistingClusterId, + "for_each_task": o.ForEachTask, + "health": o.Health, + "library": o.Libraries, + "new_cluster": o.NewCluster, + "notebook_task": o.NotebookTask, + "notification_settings": o.NotificationSettings, + "pipeline_task": o.PipelineTask, + "python_wheel_task": o.PythonWheelTask, + "run_if": o.RunIf, + "run_job_task": o.RunJobTask, + "spark_jar_task": o.SparkJarTask, + "spark_python_task": o.SparkPythonTask, + "spark_submit_task": o.SparkSubmitTask, + "sql_task": o.SqlTask, + "task_key": o.TaskKey, + "timeout_seconds": o.TimeoutSeconds, + "webhook_notifications": o.WebhookNotifications, }) } @@ -13873,6 +14006,9 @@ func (o SubmitTask_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectVal func (o SubmitTask_SdkV2) Type(ctx context.Context) attr.Type { return types.ObjectType{ AttrTypes: map[string]attr.Type{ + "clean_rooms_notebook_task": basetypes.ListType{ + ElemType: CleanRoomsNotebookTask{}.Type(ctx), + }, "condition_task": basetypes.ListType{ ElemType: ConditionTask{}.Type(ctx), }, @@ -13937,6 +14073,32 @@ func (o SubmitTask_SdkV2) Type(ctx context.Context) attr.Type { } } +// GetCleanRoomsNotebookTask returns the value of the CleanRoomsNotebookTask field in SubmitTask_SdkV2 as +// a CleanRoomsNotebookTask_SdkV2 value. +// If the field is unknown or null, the boolean return value is false. +func (o *SubmitTask_SdkV2) GetCleanRoomsNotebookTask(ctx context.Context) (CleanRoomsNotebookTask_SdkV2, bool) { + var e CleanRoomsNotebookTask_SdkV2 + if o.CleanRoomsNotebookTask.IsNull() || o.CleanRoomsNotebookTask.IsUnknown() { + return e, false + } + var v []CleanRoomsNotebookTask_SdkV2 + d := o.CleanRoomsNotebookTask.ElementsAs(ctx, &v, true) + if d.HasError() { + panic(pluginfwcommon.DiagToString(d)) + } + if len(v) == 0 { + return e, false + } + return v[0], true +} + +// SetCleanRoomsNotebookTask sets the value of the CleanRoomsNotebookTask field in SubmitTask_SdkV2. +func (o *SubmitTask_SdkV2) SetCleanRoomsNotebookTask(ctx context.Context, v CleanRoomsNotebookTask_SdkV2) { + vs := []attr.Value{v.ToObjectValue(ctx)} + t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["clean_rooms_notebook_task"] + o.CleanRoomsNotebookTask = types.ListValueMust(t, vs) +} + // GetConditionTask returns the value of the ConditionTask field in SubmitTask_SdkV2 as // a ConditionTask_SdkV2 value. // If the field is unknown or null, the boolean return value is false. @@ -14496,6 +14658,11 @@ func (o *TableUpdateTriggerConfiguration_SdkV2) SetTableNames(ctx context.Contex } type Task_SdkV2 struct { + // The task runs a [clean rooms] notebook when the + // `clean_rooms_notebook_task` field is present. + // + // [clean rooms]: https://docs.databricks.com/en/clean-rooms/index.html + CleanRoomsNotebookTask types.List `tfsdk:"clean_rooms_notebook_task" tf:"optional,object"` // The task evaluates a condition that can be used to control the execution // of other tasks when the `condition_task` field is present. The condition // task does not require a cluster to execute and does not support retries @@ -14633,24 +14800,25 @@ func (newState *Task_SdkV2) SyncEffectiveFieldsDuringRead(existingState Task_Sdk // SDK values. func (a Task_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { return map[string]reflect.Type{ - "condition_task": reflect.TypeOf(ConditionTask_SdkV2{}), - "dbt_task": reflect.TypeOf(DbtTask_SdkV2{}), - "depends_on": reflect.TypeOf(TaskDependency_SdkV2{}), - "email_notifications": reflect.TypeOf(TaskEmailNotifications_SdkV2{}), - "for_each_task": reflect.TypeOf(ForEachTask_SdkV2{}), - "health": reflect.TypeOf(JobsHealthRules_SdkV2{}), - "library": reflect.TypeOf(compute_tf.Library_SdkV2{}), - "new_cluster": reflect.TypeOf(compute_tf.ClusterSpec_SdkV2{}), - "notebook_task": reflect.TypeOf(NotebookTask_SdkV2{}), - "notification_settings": reflect.TypeOf(TaskNotificationSettings_SdkV2{}), - "pipeline_task": reflect.TypeOf(PipelineTask_SdkV2{}), - "python_wheel_task": reflect.TypeOf(PythonWheelTask_SdkV2{}), - "run_job_task": reflect.TypeOf(RunJobTask_SdkV2{}), - "spark_jar_task": reflect.TypeOf(SparkJarTask_SdkV2{}), - "spark_python_task": reflect.TypeOf(SparkPythonTask_SdkV2{}), - "spark_submit_task": reflect.TypeOf(SparkSubmitTask_SdkV2{}), - "sql_task": reflect.TypeOf(SqlTask_SdkV2{}), - "webhook_notifications": reflect.TypeOf(WebhookNotifications_SdkV2{}), + "clean_rooms_notebook_task": reflect.TypeOf(CleanRoomsNotebookTask_SdkV2{}), + "condition_task": reflect.TypeOf(ConditionTask_SdkV2{}), + "dbt_task": reflect.TypeOf(DbtTask_SdkV2{}), + "depends_on": reflect.TypeOf(TaskDependency_SdkV2{}), + "email_notifications": reflect.TypeOf(TaskEmailNotifications_SdkV2{}), + "for_each_task": reflect.TypeOf(ForEachTask_SdkV2{}), + "health": reflect.TypeOf(JobsHealthRules_SdkV2{}), + "library": reflect.TypeOf(compute_tf.Library_SdkV2{}), + "new_cluster": reflect.TypeOf(compute_tf.ClusterSpec_SdkV2{}), + "notebook_task": reflect.TypeOf(NotebookTask_SdkV2{}), + "notification_settings": reflect.TypeOf(TaskNotificationSettings_SdkV2{}), + "pipeline_task": reflect.TypeOf(PipelineTask_SdkV2{}), + "python_wheel_task": reflect.TypeOf(PythonWheelTask_SdkV2{}), + "run_job_task": reflect.TypeOf(RunJobTask_SdkV2{}), + "spark_jar_task": reflect.TypeOf(SparkJarTask_SdkV2{}), + "spark_python_task": reflect.TypeOf(SparkPythonTask_SdkV2{}), + "spark_submit_task": reflect.TypeOf(SparkSubmitTask_SdkV2{}), + "sql_task": reflect.TypeOf(SqlTask_SdkV2{}), + "webhook_notifications": reflect.TypeOf(WebhookNotifications_SdkV2{}), } } @@ -14661,6 +14829,7 @@ func (o Task_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { return types.ObjectValueMust( o.Type(ctx).(basetypes.ObjectType).AttrTypes, map[string]attr.Value{ + "clean_rooms_notebook_task": o.CleanRoomsNotebookTask, "condition_task": o.ConditionTask, "dbt_task": o.DbtTask, "depends_on": o.DependsOn, @@ -14697,6 +14866,9 @@ func (o Task_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { func (o Task_SdkV2) Type(ctx context.Context) attr.Type { return types.ObjectType{ AttrTypes: map[string]attr.Type{ + "clean_rooms_notebook_task": basetypes.ListType{ + ElemType: CleanRoomsNotebookTask{}.Type(ctx), + }, "condition_task": basetypes.ListType{ ElemType: ConditionTask{}.Type(ctx), }, @@ -14766,6 +14938,32 @@ func (o Task_SdkV2) Type(ctx context.Context) attr.Type { } } +// GetCleanRoomsNotebookTask returns the value of the CleanRoomsNotebookTask field in Task_SdkV2 as +// a CleanRoomsNotebookTask_SdkV2 value. +// If the field is unknown or null, the boolean return value is false. +func (o *Task_SdkV2) GetCleanRoomsNotebookTask(ctx context.Context) (CleanRoomsNotebookTask_SdkV2, bool) { + var e CleanRoomsNotebookTask_SdkV2 + if o.CleanRoomsNotebookTask.IsNull() || o.CleanRoomsNotebookTask.IsUnknown() { + return e, false + } + var v []CleanRoomsNotebookTask_SdkV2 + d := o.CleanRoomsNotebookTask.ElementsAs(ctx, &v, true) + if d.HasError() { + panic(pluginfwcommon.DiagToString(d)) + } + if len(v) == 0 { + return e, false + } + return v[0], true +} + +// SetCleanRoomsNotebookTask sets the value of the CleanRoomsNotebookTask field in Task_SdkV2. +func (o *Task_SdkV2) SetCleanRoomsNotebookTask(ctx context.Context, v CleanRoomsNotebookTask_SdkV2) { + vs := []attr.Value{v.ToObjectValue(ctx)} + t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["clean_rooms_notebook_task"] + o.CleanRoomsNotebookTask = types.ListValueMust(t, vs) +} + // GetConditionTask returns the value of the ConditionTask field in Task_SdkV2 as // a ConditionTask_SdkV2 value. // If the field is unknown or null, the boolean return value is false. diff --git a/internal/service/jobs_tf/model.go b/internal/service/jobs_tf/model.go index 454866837..954b2faec 100755 --- a/internal/service/jobs_tf/model.go +++ b/internal/service/jobs_tf/model.go @@ -11060,7 +11060,7 @@ type RunTask struct { // `clean_rooms_notebook_task` field is present. // // [clean rooms]: https://docs.databricks.com/en/clean-rooms/index.html - CleanRoomsNotebookTask types.List `tfsdk:"clean_rooms_notebook_task" tf:"optional,object"` + CleanRoomsNotebookTask types.Object `tfsdk:"clean_rooms_notebook_task" tf:"optional,object"` // The time in milliseconds it took to terminate the cluster and clean up // any associated artifacts. The duration of a task run is the sum of the // `setup_duration`, `execution_duration`, and the `cleanup_duration`. The @@ -11314,14 +11314,12 @@ func (o RunTask) ToObjectValue(ctx context.Context) basetypes.ObjectValue { func (o RunTask) Type(ctx context.Context) attr.Type { return types.ObjectType{ AttrTypes: map[string]attr.Type{ - "attempt_number": types.Int64Type, - "clean_rooms_notebook_task": basetypes.ListType{ - ElemType: CleanRoomsNotebookTask{}.Type(ctx), - }, - "cleanup_duration": types.Int64Type, - "cluster_instance": ClusterInstance{}.Type(ctx), - "condition_task": RunConditionTask{}.Type(ctx), - "dbt_task": DbtTask{}.Type(ctx), + "attempt_number": types.Int64Type, + "clean_rooms_notebook_task": CleanRoomsNotebookTask{}.Type(ctx), + "cleanup_duration": types.Int64Type, + "cluster_instance": ClusterInstance{}.Type(ctx), + "condition_task": RunConditionTask{}.Type(ctx), + "dbt_task": DbtTask{}.Type(ctx), "depends_on": basetypes.ListType{ ElemType: TaskDependency{}.Type(ctx), }, @@ -11373,7 +11371,10 @@ func (o *RunTask) GetCleanRoomsNotebookTask(ctx context.Context) (CleanRoomsNote return e, false } var v []CleanRoomsNotebookTask - d := o.CleanRoomsNotebookTask.ElementsAs(ctx, &v, true) + d := o.CleanRoomsNotebookTask.As(ctx, &v, basetypes.ObjectAsOptions{ + UnhandledNullAsEmpty: true, + UnhandledUnknownAsEmpty: true, + }) if d.HasError() { panic(pluginfwcommon.DiagToString(d)) } @@ -11385,9 +11386,8 @@ func (o *RunTask) GetCleanRoomsNotebookTask(ctx context.Context) (CleanRoomsNote // SetCleanRoomsNotebookTask sets the value of the CleanRoomsNotebookTask field in RunTask. func (o *RunTask) SetCleanRoomsNotebookTask(ctx context.Context, v CleanRoomsNotebookTask) { - vs := []attr.Value{v.ToObjectValue(ctx)} - t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["clean_rooms_notebook_task"] - o.CleanRoomsNotebookTask = types.ListValueMust(t, vs) + vs := v.ToObjectValue(ctx) + o.CleanRoomsNotebookTask = vs } // GetClusterInstance returns the value of the ClusterInstance field in RunTask as @@ -13830,7 +13830,7 @@ type SubmitTask struct { // `clean_rooms_notebook_task` field is present. // // [clean rooms]: https://docs.databricks.com/en/clean-rooms/index.html - CleanRoomsNotebookTask types.List `tfsdk:"clean_rooms_notebook_task" tf:"optional,object"` + CleanRoomsNotebookTask types.Object `tfsdk:"clean_rooms_notebook_task" tf:"optional,object"` // The task evaluates a condition that can be used to control the execution // of other tasks when the `condition_task` field is present. The condition // task does not require a cluster to execute and does not support retries @@ -14006,15 +14006,9 @@ func (o SubmitTask) ToObjectValue(ctx context.Context) basetypes.ObjectValue { func (o SubmitTask) Type(ctx context.Context) attr.Type { return types.ObjectType{ AttrTypes: map[string]attr.Type{ - "clean_rooms_notebook_task": basetypes.ListType{ - ElemType: CleanRoomsNotebookTask{}.Type(ctx), - }, - "condition_task": basetypes.ListType{ - ElemType: ConditionTask{}.Type(ctx), - }, - "dbt_task": basetypes.ListType{ - ElemType: DbtTask{}.Type(ctx), - }, + "clean_rooms_notebook_task": CleanRoomsNotebookTask{}.Type(ctx), + "condition_task": ConditionTask{}.Type(ctx), + "dbt_task": DbtTask{}.Type(ctx), "depends_on": basetypes.ListType{ ElemType: TaskDependency{}.Type(ctx), }, @@ -14054,7 +14048,10 @@ func (o *SubmitTask) GetCleanRoomsNotebookTask(ctx context.Context) (CleanRoomsN return e, false } var v []CleanRoomsNotebookTask - d := o.CleanRoomsNotebookTask.ElementsAs(ctx, &v, true) + d := o.CleanRoomsNotebookTask.As(ctx, &v, basetypes.ObjectAsOptions{ + UnhandledNullAsEmpty: true, + UnhandledUnknownAsEmpty: true, + }) if d.HasError() { panic(pluginfwcommon.DiagToString(d)) } @@ -14066,9 +14063,8 @@ func (o *SubmitTask) GetCleanRoomsNotebookTask(ctx context.Context) (CleanRoomsN // SetCleanRoomsNotebookTask sets the value of the CleanRoomsNotebookTask field in SubmitTask. func (o *SubmitTask) SetCleanRoomsNotebookTask(ctx context.Context, v CleanRoomsNotebookTask) { - vs := []attr.Value{v.ToObjectValue(ctx)} - t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["clean_rooms_notebook_task"] - o.CleanRoomsNotebookTask = types.ListValueMust(t, vs) + vs := v.ToObjectValue(ctx) + o.CleanRoomsNotebookTask = vs } // GetConditionTask returns the value of the ConditionTask field in SubmitTask as @@ -14666,7 +14662,7 @@ type Task struct { // `clean_rooms_notebook_task` field is present. // // [clean rooms]: https://docs.databricks.com/en/clean-rooms/index.html - CleanRoomsNotebookTask types.List `tfsdk:"clean_rooms_notebook_task" tf:"optional,object"` + CleanRoomsNotebookTask types.Object `tfsdk:"clean_rooms_notebook_task" tf:"optional,object"` // The task evaluates a condition that can be used to control the execution // of other tasks when the `condition_task` field is present. The condition // task does not require a cluster to execute and does not support retries @@ -14870,15 +14866,9 @@ func (o Task) ToObjectValue(ctx context.Context) basetypes.ObjectValue { func (o Task) Type(ctx context.Context) attr.Type { return types.ObjectType{ AttrTypes: map[string]attr.Type{ - "clean_rooms_notebook_task": basetypes.ListType{ - ElemType: CleanRoomsNotebookTask{}.Type(ctx), - }, - "condition_task": basetypes.ListType{ - ElemType: ConditionTask{}.Type(ctx), - }, - "dbt_task": basetypes.ListType{ - ElemType: DbtTask{}.Type(ctx), - }, + "clean_rooms_notebook_task": CleanRoomsNotebookTask{}.Type(ctx), + "condition_task": ConditionTask{}.Type(ctx), + "dbt_task": DbtTask{}.Type(ctx), "depends_on": basetypes.ListType{ ElemType: TaskDependency{}.Type(ctx), }, @@ -14923,7 +14913,10 @@ func (o *Task) GetCleanRoomsNotebookTask(ctx context.Context) (CleanRoomsNoteboo return e, false } var v []CleanRoomsNotebookTask - d := o.CleanRoomsNotebookTask.ElementsAs(ctx, &v, true) + d := o.CleanRoomsNotebookTask.As(ctx, &v, basetypes.ObjectAsOptions{ + UnhandledNullAsEmpty: true, + UnhandledUnknownAsEmpty: true, + }) if d.HasError() { panic(pluginfwcommon.DiagToString(d)) } @@ -14935,9 +14928,8 @@ func (o *Task) GetCleanRoomsNotebookTask(ctx context.Context) (CleanRoomsNoteboo // SetCleanRoomsNotebookTask sets the value of the CleanRoomsNotebookTask field in Task. func (o *Task) SetCleanRoomsNotebookTask(ctx context.Context, v CleanRoomsNotebookTask) { - vs := []attr.Value{v.ToObjectValue(ctx)} - t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["clean_rooms_notebook_task"] - o.CleanRoomsNotebookTask = types.ListValueMust(t, vs) + vs := v.ToObjectValue(ctx) + o.CleanRoomsNotebookTask = vs } // GetConditionTask returns the value of the ConditionTask field in Task as diff --git a/internal/service/oauth2_tf/legacy_model.go b/internal/service/oauth2_tf/legacy_model.go index 93de2a186..c0ce880c3 100755 --- a/internal/service/oauth2_tf/legacy_model.go +++ b/internal/service/oauth2_tf/legacy_model.go @@ -21,6 +21,83 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types/basetypes" ) +// Create account federation policy +type CreateAccountFederationPolicyRequest_SdkV2 struct { + Policy types.List `tfsdk:"policy" tf:"optional,object"` + // The identifier for the federation policy. If unspecified, the id will be + // assigned by Databricks. + PolicyId types.String `tfsdk:"-"` +} + +func (newState *CreateAccountFederationPolicyRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateAccountFederationPolicyRequest_SdkV2) { +} + +func (newState *CreateAccountFederationPolicyRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateAccountFederationPolicyRequest_SdkV2) { +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateAccountFederationPolicyRequest. +// Container types (types.Map, types.List, types.Set) and object types (types.Object) do not carry +// the type information of their elements in the Go type system. This function provides a way to +// retrieve the type information of the elements in complex fields at runtime. The values of the map +// are the reflected types of the contained elements. They must be either primitive values from the +// plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF +// SDK values. +func (a CreateAccountFederationPolicyRequest_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { + return map[string]reflect.Type{ + "policy": reflect.TypeOf(FederationPolicy_SdkV2{}), + } +} + +// TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise +// interfere with how the plugin framework retrieves and sets values in state. Thus, CreateAccountFederationPolicyRequest_SdkV2 +// only implements ToObjectValue() and Type(). +func (o CreateAccountFederationPolicyRequest_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "policy": o.Policy, + "policy_id": o.PolicyId, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o CreateAccountFederationPolicyRequest_SdkV2) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "policy": basetypes.ListType{ + ElemType: FederationPolicy{}.Type(ctx), + }, + "policy_id": types.StringType, + }, + } +} + +// GetPolicy returns the value of the Policy field in CreateAccountFederationPolicyRequest_SdkV2 as +// a FederationPolicy_SdkV2 value. +// If the field is unknown or null, the boolean return value is false. +func (o *CreateAccountFederationPolicyRequest_SdkV2) GetPolicy(ctx context.Context) (FederationPolicy_SdkV2, bool) { + var e FederationPolicy_SdkV2 + if o.Policy.IsNull() || o.Policy.IsUnknown() { + return e, false + } + var v []FederationPolicy_SdkV2 + d := o.Policy.ElementsAs(ctx, &v, true) + if d.HasError() { + panic(pluginfwcommon.DiagToString(d)) + } + if len(v) == 0 { + return e, false + } + return v[0], true +} + +// SetPolicy sets the value of the Policy field in CreateAccountFederationPolicyRequest_SdkV2. +func (o *CreateAccountFederationPolicyRequest_SdkV2) SetPolicy(ctx context.Context, v FederationPolicy_SdkV2) { + vs := []attr.Value{v.ToObjectValue(ctx)} + t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["policy"] + o.Policy = types.ListValueMust(t, vs) +} + type CreateCustomAppIntegration_SdkV2 struct { // This field indicates whether an OAuth client secret is required to // authenticate this client. @@ -339,6 +416,87 @@ func (o CreatePublishedAppIntegrationOutput_SdkV2) Type(ctx context.Context) att } } +// Create service principal federation policy +type CreateServicePrincipalFederationPolicyRequest_SdkV2 struct { + Policy types.List `tfsdk:"policy" tf:"optional,object"` + // The identifier for the federation policy. If unspecified, the id will be + // assigned by Databricks. + PolicyId types.String `tfsdk:"-"` + // The service principal id for the federation policy. + ServicePrincipalId types.Int64 `tfsdk:"-"` +} + +func (newState *CreateServicePrincipalFederationPolicyRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan CreateServicePrincipalFederationPolicyRequest_SdkV2) { +} + +func (newState *CreateServicePrincipalFederationPolicyRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState CreateServicePrincipalFederationPolicyRequest_SdkV2) { +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateServicePrincipalFederationPolicyRequest. +// Container types (types.Map, types.List, types.Set) and object types (types.Object) do not carry +// the type information of their elements in the Go type system. This function provides a way to +// retrieve the type information of the elements in complex fields at runtime. The values of the map +// are the reflected types of the contained elements. They must be either primitive values from the +// plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF +// SDK values. +func (a CreateServicePrincipalFederationPolicyRequest_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { + return map[string]reflect.Type{ + "policy": reflect.TypeOf(FederationPolicy_SdkV2{}), + } +} + +// TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise +// interfere with how the plugin framework retrieves and sets values in state. Thus, CreateServicePrincipalFederationPolicyRequest_SdkV2 +// only implements ToObjectValue() and Type(). +func (o CreateServicePrincipalFederationPolicyRequest_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "policy": o.Policy, + "policy_id": o.PolicyId, + "service_principal_id": o.ServicePrincipalId, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o CreateServicePrincipalFederationPolicyRequest_SdkV2) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "policy": basetypes.ListType{ + ElemType: FederationPolicy{}.Type(ctx), + }, + "policy_id": types.StringType, + "service_principal_id": types.Int64Type, + }, + } +} + +// GetPolicy returns the value of the Policy field in CreateServicePrincipalFederationPolicyRequest_SdkV2 as +// a FederationPolicy_SdkV2 value. +// If the field is unknown or null, the boolean return value is false. +func (o *CreateServicePrincipalFederationPolicyRequest_SdkV2) GetPolicy(ctx context.Context) (FederationPolicy_SdkV2, bool) { + var e FederationPolicy_SdkV2 + if o.Policy.IsNull() || o.Policy.IsUnknown() { + return e, false + } + var v []FederationPolicy_SdkV2 + d := o.Policy.ElementsAs(ctx, &v, true) + if d.HasError() { + panic(pluginfwcommon.DiagToString(d)) + } + if len(v) == 0 { + return e, false + } + return v[0], true +} + +// SetPolicy sets the value of the Policy field in CreateServicePrincipalFederationPolicyRequest_SdkV2. +func (o *CreateServicePrincipalFederationPolicyRequest_SdkV2) SetPolicy(ctx context.Context, v FederationPolicy_SdkV2) { + vs := []attr.Value{v.ToObjectValue(ctx)} + t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["policy"] + o.Policy = types.ListValueMust(t, vs) +} + // Create service principal secret type CreateServicePrincipalSecretRequest_SdkV2 struct { // The service principal ID. @@ -490,6 +648,48 @@ func (o DataPlaneInfo_SdkV2) Type(ctx context.Context) attr.Type { } } +// Delete account federation policy +type DeleteAccountFederationPolicyRequest_SdkV2 struct { + PolicyId types.String `tfsdk:"-"` +} + +func (newState *DeleteAccountFederationPolicyRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteAccountFederationPolicyRequest_SdkV2) { +} + +func (newState *DeleteAccountFederationPolicyRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteAccountFederationPolicyRequest_SdkV2) { +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteAccountFederationPolicyRequest. +// Container types (types.Map, types.List, types.Set) and object types (types.Object) do not carry +// the type information of their elements in the Go type system. This function provides a way to +// retrieve the type information of the elements in complex fields at runtime. The values of the map +// are the reflected types of the contained elements. They must be either primitive values from the +// plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF +// SDK values. +func (a DeleteAccountFederationPolicyRequest_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { + return map[string]reflect.Type{} +} + +// TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise +// interfere with how the plugin framework retrieves and sets values in state. Thus, DeleteAccountFederationPolicyRequest_SdkV2 +// only implements ToObjectValue() and Type(). +func (o DeleteAccountFederationPolicyRequest_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "policy_id": o.PolicyId, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o DeleteAccountFederationPolicyRequest_SdkV2) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "policy_id": types.StringType, + }, + } +} + type DeleteCustomAppIntegrationOutput_SdkV2 struct { } @@ -682,6 +882,52 @@ func (o DeleteResponse_SdkV2) Type(ctx context.Context) attr.Type { } } +// Delete service principal federation policy +type DeleteServicePrincipalFederationPolicyRequest_SdkV2 struct { + PolicyId types.String `tfsdk:"-"` + // The service principal id for the federation policy. + ServicePrincipalId types.Int64 `tfsdk:"-"` +} + +func (newState *DeleteServicePrincipalFederationPolicyRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DeleteServicePrincipalFederationPolicyRequest_SdkV2) { +} + +func (newState *DeleteServicePrincipalFederationPolicyRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState DeleteServicePrincipalFederationPolicyRequest_SdkV2) { +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in DeleteServicePrincipalFederationPolicyRequest. +// Container types (types.Map, types.List, types.Set) and object types (types.Object) do not carry +// the type information of their elements in the Go type system. This function provides a way to +// retrieve the type information of the elements in complex fields at runtime. The values of the map +// are the reflected types of the contained elements. They must be either primitive values from the +// plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF +// SDK values. +func (a DeleteServicePrincipalFederationPolicyRequest_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { + return map[string]reflect.Type{} +} + +// TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise +// interfere with how the plugin framework retrieves and sets values in state. Thus, DeleteServicePrincipalFederationPolicyRequest_SdkV2 +// only implements ToObjectValue() and Type(). +func (o DeleteServicePrincipalFederationPolicyRequest_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "policy_id": o.PolicyId, + "service_principal_id": o.ServicePrincipalId, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o DeleteServicePrincipalFederationPolicyRequest_SdkV2) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "policy_id": types.StringType, + "service_principal_id": types.Int64Type, + }, + } +} + // Delete service principal secret type DeleteServicePrincipalSecretRequest_SdkV2 struct { // The secret ID. @@ -729,6 +975,143 @@ func (o DeleteServicePrincipalSecretRequest_SdkV2) Type(ctx context.Context) att } } +type FederationPolicy_SdkV2 struct { + // Creation time of the federation policy. + CreateTime types.String `tfsdk:"create_time" tf:"computed"` + // Description of the federation policy. + Description types.String `tfsdk:"description" tf:"optional"` + // Name of the federation policy. The name must contain only lowercase + // alphanumeric characters, numbers, and hyphens. It must be unique within + // the account. + Name types.String `tfsdk:"name" tf:"optional"` + // Specifies the policy to use for validating OIDC claims in your federated + // tokens. + OidcPolicy types.List `tfsdk:"oidc_policy" tf:"optional,object"` + // Unique, immutable id of the federation policy. + Uid types.String `tfsdk:"uid" tf:"computed"` + // Last update time of the federation policy. + UpdateTime types.String `tfsdk:"update_time" tf:"computed"` +} + +func (newState *FederationPolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan FederationPolicy_SdkV2) { +} + +func (newState *FederationPolicy_SdkV2) SyncEffectiveFieldsDuringRead(existingState FederationPolicy_SdkV2) { +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in FederationPolicy. +// Container types (types.Map, types.List, types.Set) and object types (types.Object) do not carry +// the type information of their elements in the Go type system. This function provides a way to +// retrieve the type information of the elements in complex fields at runtime. The values of the map +// are the reflected types of the contained elements. They must be either primitive values from the +// plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF +// SDK values. +func (a FederationPolicy_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { + return map[string]reflect.Type{ + "oidc_policy": reflect.TypeOf(OidcFederationPolicy_SdkV2{}), + } +} + +// TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise +// interfere with how the plugin framework retrieves and sets values in state. Thus, FederationPolicy_SdkV2 +// only implements ToObjectValue() and Type(). +func (o FederationPolicy_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "create_time": o.CreateTime, + "description": o.Description, + "name": o.Name, + "oidc_policy": o.OidcPolicy, + "uid": o.Uid, + "update_time": o.UpdateTime, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o FederationPolicy_SdkV2) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "create_time": types.StringType, + "description": types.StringType, + "name": types.StringType, + "oidc_policy": basetypes.ListType{ + ElemType: OidcFederationPolicy{}.Type(ctx), + }, + "uid": types.StringType, + "update_time": types.StringType, + }, + } +} + +// GetOidcPolicy returns the value of the OidcPolicy field in FederationPolicy_SdkV2 as +// a OidcFederationPolicy_SdkV2 value. +// If the field is unknown or null, the boolean return value is false. +func (o *FederationPolicy_SdkV2) GetOidcPolicy(ctx context.Context) (OidcFederationPolicy_SdkV2, bool) { + var e OidcFederationPolicy_SdkV2 + if o.OidcPolicy.IsNull() || o.OidcPolicy.IsUnknown() { + return e, false + } + var v []OidcFederationPolicy_SdkV2 + d := o.OidcPolicy.ElementsAs(ctx, &v, true) + if d.HasError() { + panic(pluginfwcommon.DiagToString(d)) + } + if len(v) == 0 { + return e, false + } + return v[0], true +} + +// SetOidcPolicy sets the value of the OidcPolicy field in FederationPolicy_SdkV2. +func (o *FederationPolicy_SdkV2) SetOidcPolicy(ctx context.Context, v OidcFederationPolicy_SdkV2) { + vs := []attr.Value{v.ToObjectValue(ctx)} + t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["oidc_policy"] + o.OidcPolicy = types.ListValueMust(t, vs) +} + +// Get account federation policy +type GetAccountFederationPolicyRequest_SdkV2 struct { + PolicyId types.String `tfsdk:"-"` +} + +func (newState *GetAccountFederationPolicyRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetAccountFederationPolicyRequest_SdkV2) { +} + +func (newState *GetAccountFederationPolicyRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetAccountFederationPolicyRequest_SdkV2) { +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in GetAccountFederationPolicyRequest. +// Container types (types.Map, types.List, types.Set) and object types (types.Object) do not carry +// the type information of their elements in the Go type system. This function provides a way to +// retrieve the type information of the elements in complex fields at runtime. The values of the map +// are the reflected types of the contained elements. They must be either primitive values from the +// plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF +// SDK values. +func (a GetAccountFederationPolicyRequest_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { + return map[string]reflect.Type{} +} + +// TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise +// interfere with how the plugin framework retrieves and sets values in state. Thus, GetAccountFederationPolicyRequest_SdkV2 +// only implements ToObjectValue() and Type(). +func (o GetAccountFederationPolicyRequest_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "policy_id": o.PolicyId, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o GetAccountFederationPolicyRequest_SdkV2) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "policy_id": types.StringType, + }, + } +} + type GetCustomAppIntegrationOutput_SdkV2 struct { // The client id of the custom OAuth app ClientId types.String `tfsdk:"client_id" tf:"optional"` @@ -1302,34 +1685,126 @@ func (o *GetPublishedAppsOutput_SdkV2) SetApps(ctx context.Context, v []Publishe o.Apps = types.ListValueMust(t, vs) } -// Get custom oauth app integrations -type ListCustomAppIntegrationsRequest_SdkV2 struct { - IncludeCreatorUsername types.Bool `tfsdk:"-"` - - PageSize types.Int64 `tfsdk:"-"` - - PageToken types.String `tfsdk:"-"` +// Get service principal federation policy +type GetServicePrincipalFederationPolicyRequest_SdkV2 struct { + PolicyId types.String `tfsdk:"-"` + // The service principal id for the federation policy. + ServicePrincipalId types.Int64 `tfsdk:"-"` } -func (newState *ListCustomAppIntegrationsRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListCustomAppIntegrationsRequest_SdkV2) { +func (newState *GetServicePrincipalFederationPolicyRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan GetServicePrincipalFederationPolicyRequest_SdkV2) { } -func (newState *ListCustomAppIntegrationsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListCustomAppIntegrationsRequest_SdkV2) { +func (newState *GetServicePrincipalFederationPolicyRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState GetServicePrincipalFederationPolicyRequest_SdkV2) { } -// GetComplexFieldTypes returns a map of the types of elements in complex fields in ListCustomAppIntegrationsRequest. +// GetComplexFieldTypes returns a map of the types of elements in complex fields in GetServicePrincipalFederationPolicyRequest. // Container types (types.Map, types.List, types.Set) and object types (types.Object) do not carry // the type information of their elements in the Go type system. This function provides a way to // retrieve the type information of the elements in complex fields at runtime. The values of the map // are the reflected types of the contained elements. They must be either primitive values from the // plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF // SDK values. -func (a ListCustomAppIntegrationsRequest_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { +func (a GetServicePrincipalFederationPolicyRequest_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { return map[string]reflect.Type{} } // TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise -// interfere with how the plugin framework retrieves and sets values in state. Thus, ListCustomAppIntegrationsRequest_SdkV2 +// interfere with how the plugin framework retrieves and sets values in state. Thus, GetServicePrincipalFederationPolicyRequest_SdkV2 +// only implements ToObjectValue() and Type(). +func (o GetServicePrincipalFederationPolicyRequest_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "policy_id": o.PolicyId, + "service_principal_id": o.ServicePrincipalId, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o GetServicePrincipalFederationPolicyRequest_SdkV2) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "policy_id": types.StringType, + "service_principal_id": types.Int64Type, + }, + } +} + +// List account federation policies +type ListAccountFederationPoliciesRequest_SdkV2 struct { + PageSize types.Int64 `tfsdk:"-"` + + PageToken types.String `tfsdk:"-"` +} + +func (newState *ListAccountFederationPoliciesRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListAccountFederationPoliciesRequest_SdkV2) { +} + +func (newState *ListAccountFederationPoliciesRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListAccountFederationPoliciesRequest_SdkV2) { +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in ListAccountFederationPoliciesRequest. +// Container types (types.Map, types.List, types.Set) and object types (types.Object) do not carry +// the type information of their elements in the Go type system. This function provides a way to +// retrieve the type information of the elements in complex fields at runtime. The values of the map +// are the reflected types of the contained elements. They must be either primitive values from the +// plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF +// SDK values. +func (a ListAccountFederationPoliciesRequest_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { + return map[string]reflect.Type{} +} + +// TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise +// interfere with how the plugin framework retrieves and sets values in state. Thus, ListAccountFederationPoliciesRequest_SdkV2 +// only implements ToObjectValue() and Type(). +func (o ListAccountFederationPoliciesRequest_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "page_size": o.PageSize, + "page_token": o.PageToken, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o ListAccountFederationPoliciesRequest_SdkV2) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "page_size": types.Int64Type, + "page_token": types.StringType, + }, + } +} + +// Get custom oauth app integrations +type ListCustomAppIntegrationsRequest_SdkV2 struct { + IncludeCreatorUsername types.Bool `tfsdk:"-"` + + PageSize types.Int64 `tfsdk:"-"` + + PageToken types.String `tfsdk:"-"` +} + +func (newState *ListCustomAppIntegrationsRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListCustomAppIntegrationsRequest_SdkV2) { +} + +func (newState *ListCustomAppIntegrationsRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListCustomAppIntegrationsRequest_SdkV2) { +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in ListCustomAppIntegrationsRequest. +// Container types (types.Map, types.List, types.Set) and object types (types.Object) do not carry +// the type information of their elements in the Go type system. This function provides a way to +// retrieve the type information of the elements in complex fields at runtime. The values of the map +// are the reflected types of the contained elements. They must be either primitive values from the +// plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF +// SDK values. +func (a ListCustomAppIntegrationsRequest_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { + return map[string]reflect.Type{} +} + +// TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise +// interfere with how the plugin framework retrieves and sets values in state. Thus, ListCustomAppIntegrationsRequest_SdkV2 // only implements ToObjectValue() and Type(). func (o ListCustomAppIntegrationsRequest_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { return types.ObjectValueMust( @@ -1352,6 +1827,81 @@ func (o ListCustomAppIntegrationsRequest_SdkV2) Type(ctx context.Context) attr.T } } +type ListFederationPoliciesResponse_SdkV2 struct { + NextPageToken types.String `tfsdk:"next_page_token" tf:"optional"` + + Policies types.List `tfsdk:"policies" tf:"optional"` +} + +func (newState *ListFederationPoliciesResponse_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListFederationPoliciesResponse_SdkV2) { +} + +func (newState *ListFederationPoliciesResponse_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListFederationPoliciesResponse_SdkV2) { +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in ListFederationPoliciesResponse. +// Container types (types.Map, types.List, types.Set) and object types (types.Object) do not carry +// the type information of their elements in the Go type system. This function provides a way to +// retrieve the type information of the elements in complex fields at runtime. The values of the map +// are the reflected types of the contained elements. They must be either primitive values from the +// plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF +// SDK values. +func (a ListFederationPoliciesResponse_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { + return map[string]reflect.Type{ + "policies": reflect.TypeOf(FederationPolicy_SdkV2{}), + } +} + +// TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise +// interfere with how the plugin framework retrieves and sets values in state. Thus, ListFederationPoliciesResponse_SdkV2 +// only implements ToObjectValue() and Type(). +func (o ListFederationPoliciesResponse_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "next_page_token": o.NextPageToken, + "policies": o.Policies, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o ListFederationPoliciesResponse_SdkV2) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "next_page_token": types.StringType, + "policies": basetypes.ListType{ + ElemType: FederationPolicy{}.Type(ctx), + }, + }, + } +} + +// GetPolicies returns the value of the Policies field in ListFederationPoliciesResponse_SdkV2 as +// a slice of FederationPolicy_SdkV2 values. +// If the field is unknown or null, the boolean return value is false. +func (o *ListFederationPoliciesResponse_SdkV2) GetPolicies(ctx context.Context) ([]FederationPolicy_SdkV2, bool) { + if o.Policies.IsNull() || o.Policies.IsUnknown() { + return nil, false + } + var v []FederationPolicy_SdkV2 + d := o.Policies.ElementsAs(ctx, &v, true) + if d.HasError() { + panic(pluginfwcommon.DiagToString(d)) + } + return v, true +} + +// SetPolicies sets the value of the Policies field in ListFederationPoliciesResponse_SdkV2. +func (o *ListFederationPoliciesResponse_SdkV2) SetPolicies(ctx context.Context, v []FederationPolicy_SdkV2) { + vs := make([]attr.Value, 0, len(v)) + for _, e := range v { + vs = append(vs, e.ToObjectValue(ctx)) + } + t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["policies"] + t = t.(attr.TypeWithElementType).ElementType() + o.Policies = types.ListValueMust(t, vs) +} + // Get all the published OAuth apps type ListOAuthPublishedAppsRequest_SdkV2 struct { // The max number of OAuth published apps to return in one page. @@ -1445,6 +1995,56 @@ func (o ListPublishedAppIntegrationsRequest_SdkV2) Type(ctx context.Context) att } } +// List service principal federation policies +type ListServicePrincipalFederationPoliciesRequest_SdkV2 struct { + PageSize types.Int64 `tfsdk:"-"` + + PageToken types.String `tfsdk:"-"` + // The service principal id for the federation policy. + ServicePrincipalId types.Int64 `tfsdk:"-"` +} + +func (newState *ListServicePrincipalFederationPoliciesRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ListServicePrincipalFederationPoliciesRequest_SdkV2) { +} + +func (newState *ListServicePrincipalFederationPoliciesRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState ListServicePrincipalFederationPoliciesRequest_SdkV2) { +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in ListServicePrincipalFederationPoliciesRequest. +// Container types (types.Map, types.List, types.Set) and object types (types.Object) do not carry +// the type information of their elements in the Go type system. This function provides a way to +// retrieve the type information of the elements in complex fields at runtime. The values of the map +// are the reflected types of the contained elements. They must be either primitive values from the +// plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF +// SDK values. +func (a ListServicePrincipalFederationPoliciesRequest_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { + return map[string]reflect.Type{} +} + +// TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise +// interfere with how the plugin framework retrieves and sets values in state. Thus, ListServicePrincipalFederationPoliciesRequest_SdkV2 +// only implements ToObjectValue() and Type(). +func (o ListServicePrincipalFederationPoliciesRequest_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "page_size": o.PageSize, + "page_token": o.PageToken, + "service_principal_id": o.ServicePrincipalId, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o ListServicePrincipalFederationPoliciesRequest_SdkV2) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "page_size": types.Int64Type, + "page_token": types.StringType, + "service_principal_id": types.Int64Type, + }, + } +} + // List service principal secrets type ListServicePrincipalSecretsRequest_SdkV2 struct { // An opaque page token which was the `next_page_token` in the response of @@ -1576,6 +2176,109 @@ func (o *ListServicePrincipalSecretsResponse_SdkV2) SetSecrets(ctx context.Conte o.Secrets = types.ListValueMust(t, vs) } +// Specifies the policy to use for validating OIDC claims in your federated +// tokens. +type OidcFederationPolicy_SdkV2 struct { + // The allowed token audiences, as specified in the 'aud' claim of federated + // tokens. The audience identifier is intended to represent the recipient of + // the token. Can be any non-empty string value. As long as the audience in + // the token matches at least one audience in the policy, the token is + // considered a match. If audiences is unspecified, defaults to your + // Databricks account id. + Audiences types.List `tfsdk:"audiences" tf:"optional"` + // The required token issuer, as specified in the 'iss' claim of federated + // tokens. + Issuer types.String `tfsdk:"issuer" tf:"optional"` + // The public keys used to validate the signature of federated tokens, in + // JWKS format. If unspecified (recommended), Databricks automatically + // fetches the public keys from your issuer’s well known endpoint. + // Databricks strongly recommends relying on your issuer’s well known + // endpoint for discovering public keys. + JwksJson types.String `tfsdk:"jwks_json" tf:"optional"` + // The required token subject, as specified in the subject claim of + // federated tokens. Must be specified for service principal federation + // policies. Must not be specified for account federation policies. + Subject types.String `tfsdk:"subject" tf:"optional"` + // The claim that contains the subject of the token. If unspecified, the + // default value is 'sub'. + SubjectClaim types.String `tfsdk:"subject_claim" tf:"optional"` +} + +func (newState *OidcFederationPolicy_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan OidcFederationPolicy_SdkV2) { +} + +func (newState *OidcFederationPolicy_SdkV2) SyncEffectiveFieldsDuringRead(existingState OidcFederationPolicy_SdkV2) { +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in OidcFederationPolicy. +// Container types (types.Map, types.List, types.Set) and object types (types.Object) do not carry +// the type information of their elements in the Go type system. This function provides a way to +// retrieve the type information of the elements in complex fields at runtime. The values of the map +// are the reflected types of the contained elements. They must be either primitive values from the +// plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF +// SDK values. +func (a OidcFederationPolicy_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { + return map[string]reflect.Type{ + "audiences": reflect.TypeOf(types.String{}), + } +} + +// TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise +// interfere with how the plugin framework retrieves and sets values in state. Thus, OidcFederationPolicy_SdkV2 +// only implements ToObjectValue() and Type(). +func (o OidcFederationPolicy_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "audiences": o.Audiences, + "issuer": o.Issuer, + "jwks_json": o.JwksJson, + "subject": o.Subject, + "subject_claim": o.SubjectClaim, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o OidcFederationPolicy_SdkV2) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "audiences": basetypes.ListType{ + ElemType: types.StringType, + }, + "issuer": types.StringType, + "jwks_json": types.StringType, + "subject": types.StringType, + "subject_claim": types.StringType, + }, + } +} + +// GetAudiences returns the value of the Audiences field in OidcFederationPolicy_SdkV2 as +// a slice of types.String values. +// If the field is unknown or null, the boolean return value is false. +func (o *OidcFederationPolicy_SdkV2) GetAudiences(ctx context.Context) ([]types.String, bool) { + if o.Audiences.IsNull() || o.Audiences.IsUnknown() { + return nil, false + } + var v []types.String + d := o.Audiences.ElementsAs(ctx, &v, true) + if d.HasError() { + panic(pluginfwcommon.DiagToString(d)) + } + return v, true +} + +// SetAudiences sets the value of the Audiences field in OidcFederationPolicy_SdkV2. +func (o *OidcFederationPolicy_SdkV2) SetAudiences(ctx context.Context, v []types.String) { + vs := make([]attr.Value, 0, len(v)) + for _, e := range v { + vs = append(vs, e) + } + t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["audiences"] + t = t.(attr.TypeWithElementType).ElementType() + o.Audiences = types.ListValueMust(t, vs) +} + type PublishedAppOutput_SdkV2 struct { // Unique ID of the published OAuth app. AppId types.String `tfsdk:"app_id" tf:"optional"` @@ -1807,6 +2510,89 @@ func (o TokenAccessPolicy_SdkV2) Type(ctx context.Context) attr.Type { } } +// Update account federation policy +type UpdateAccountFederationPolicyRequest_SdkV2 struct { + Policy types.List `tfsdk:"policy" tf:"optional,object"` + + PolicyId types.String `tfsdk:"-"` + // Field mask is required to be passed into the PATCH request. Field mask + // specifies which fields of the setting payload will be updated. The field + // mask needs to be supplied as single string. To specify multiple fields in + // the field mask, use comma as the separator (no space). + UpdateMask types.String `tfsdk:"-"` +} + +func (newState *UpdateAccountFederationPolicyRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateAccountFederationPolicyRequest_SdkV2) { +} + +func (newState *UpdateAccountFederationPolicyRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateAccountFederationPolicyRequest_SdkV2) { +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateAccountFederationPolicyRequest. +// Container types (types.Map, types.List, types.Set) and object types (types.Object) do not carry +// the type information of their elements in the Go type system. This function provides a way to +// retrieve the type information of the elements in complex fields at runtime. The values of the map +// are the reflected types of the contained elements. They must be either primitive values from the +// plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF +// SDK values. +func (a UpdateAccountFederationPolicyRequest_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { + return map[string]reflect.Type{ + "policy": reflect.TypeOf(FederationPolicy_SdkV2{}), + } +} + +// TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise +// interfere with how the plugin framework retrieves and sets values in state. Thus, UpdateAccountFederationPolicyRequest_SdkV2 +// only implements ToObjectValue() and Type(). +func (o UpdateAccountFederationPolicyRequest_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "policy": o.Policy, + "policy_id": o.PolicyId, + "update_mask": o.UpdateMask, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o UpdateAccountFederationPolicyRequest_SdkV2) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "policy": basetypes.ListType{ + ElemType: FederationPolicy{}.Type(ctx), + }, + "policy_id": types.StringType, + "update_mask": types.StringType, + }, + } +} + +// GetPolicy returns the value of the Policy field in UpdateAccountFederationPolicyRequest_SdkV2 as +// a FederationPolicy_SdkV2 value. +// If the field is unknown or null, the boolean return value is false. +func (o *UpdateAccountFederationPolicyRequest_SdkV2) GetPolicy(ctx context.Context) (FederationPolicy_SdkV2, bool) { + var e FederationPolicy_SdkV2 + if o.Policy.IsNull() || o.Policy.IsUnknown() { + return e, false + } + var v []FederationPolicy_SdkV2 + d := o.Policy.ElementsAs(ctx, &v, true) + if d.HasError() { + panic(pluginfwcommon.DiagToString(d)) + } + if len(v) == 0 { + return e, false + } + return v[0], true +} + +// SetPolicy sets the value of the Policy field in UpdateAccountFederationPolicyRequest_SdkV2. +func (o *UpdateAccountFederationPolicyRequest_SdkV2) SetPolicy(ctx context.Context, v FederationPolicy_SdkV2) { + vs := []attr.Value{v.ToObjectValue(ctx)} + t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["policy"] + o.Policy = types.ListValueMust(t, vs) +} + type UpdateCustomAppIntegration_SdkV2 struct { IntegrationId types.String `tfsdk:"-"` // List of OAuth redirect urls to be updated in the custom OAuth app @@ -2062,3 +2848,90 @@ func (o UpdatePublishedAppIntegrationOutput_SdkV2) Type(ctx context.Context) att AttrTypes: map[string]attr.Type{}, } } + +// Update service principal federation policy +type UpdateServicePrincipalFederationPolicyRequest_SdkV2 struct { + Policy types.List `tfsdk:"policy" tf:"optional,object"` + + PolicyId types.String `tfsdk:"-"` + // The service principal id for the federation policy. + ServicePrincipalId types.Int64 `tfsdk:"-"` + // Field mask is required to be passed into the PATCH request. Field mask + // specifies which fields of the setting payload will be updated. The field + // mask needs to be supplied as single string. To specify multiple fields in + // the field mask, use comma as the separator (no space). + UpdateMask types.String `tfsdk:"-"` +} + +func (newState *UpdateServicePrincipalFederationPolicyRequest_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateServicePrincipalFederationPolicyRequest_SdkV2) { +} + +func (newState *UpdateServicePrincipalFederationPolicyRequest_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateServicePrincipalFederationPolicyRequest_SdkV2) { +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in UpdateServicePrincipalFederationPolicyRequest. +// Container types (types.Map, types.List, types.Set) and object types (types.Object) do not carry +// the type information of their elements in the Go type system. This function provides a way to +// retrieve the type information of the elements in complex fields at runtime. The values of the map +// are the reflected types of the contained elements. They must be either primitive values from the +// plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF +// SDK values. +func (a UpdateServicePrincipalFederationPolicyRequest_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { + return map[string]reflect.Type{ + "policy": reflect.TypeOf(FederationPolicy_SdkV2{}), + } +} + +// TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise +// interfere with how the plugin framework retrieves and sets values in state. Thus, UpdateServicePrincipalFederationPolicyRequest_SdkV2 +// only implements ToObjectValue() and Type(). +func (o UpdateServicePrincipalFederationPolicyRequest_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "policy": o.Policy, + "policy_id": o.PolicyId, + "service_principal_id": o.ServicePrincipalId, + "update_mask": o.UpdateMask, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o UpdateServicePrincipalFederationPolicyRequest_SdkV2) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "policy": basetypes.ListType{ + ElemType: FederationPolicy{}.Type(ctx), + }, + "policy_id": types.StringType, + "service_principal_id": types.Int64Type, + "update_mask": types.StringType, + }, + } +} + +// GetPolicy returns the value of the Policy field in UpdateServicePrincipalFederationPolicyRequest_SdkV2 as +// a FederationPolicy_SdkV2 value. +// If the field is unknown or null, the boolean return value is false. +func (o *UpdateServicePrincipalFederationPolicyRequest_SdkV2) GetPolicy(ctx context.Context) (FederationPolicy_SdkV2, bool) { + var e FederationPolicy_SdkV2 + if o.Policy.IsNull() || o.Policy.IsUnknown() { + return e, false + } + var v []FederationPolicy_SdkV2 + d := o.Policy.ElementsAs(ctx, &v, true) + if d.HasError() { + panic(pluginfwcommon.DiagToString(d)) + } + if len(v) == 0 { + return e, false + } + return v[0], true +} + +// SetPolicy sets the value of the Policy field in UpdateServicePrincipalFederationPolicyRequest_SdkV2. +func (o *UpdateServicePrincipalFederationPolicyRequest_SdkV2) SetPolicy(ctx context.Context, v FederationPolicy_SdkV2) { + vs := []attr.Value{v.ToObjectValue(ctx)} + t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["policy"] + o.Policy = types.ListValueMust(t, vs) +} diff --git a/internal/service/pipelines_tf/legacy_model.go b/internal/service/pipelines_tf/legacy_model.go index f05c51af9..308b91f35 100755 --- a/internal/service/pipelines_tf/legacy_model.go +++ b/internal/service/pipelines_tf/legacy_model.go @@ -5014,7 +5014,7 @@ type RestartWindow_SdkV2 struct { // Days of week in which the restart is allowed to happen (within a // five-hour window starting at start_hour). If not specified all days of // the week will be used. - DaysOfWeek types.String `tfsdk:"days_of_week" tf:"optional"` + DaysOfWeek types.List `tfsdk:"days_of_week" tf:"optional"` // An integer between 0 and 23 denoting the start hour for the restart // window in the 24-hour day. Continuous pipeline restart is triggered only // within a five-hour window starting at this hour. @@ -5039,7 +5039,9 @@ func (newState *RestartWindow_SdkV2) SyncEffectiveFieldsDuringRead(existingState // plugin framework type system (types.String{}, types.Bool{}, types.Int64{}, types.Float64{}) or TF // SDK values. func (a RestartWindow_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { - return map[string]reflect.Type{} + return map[string]reflect.Type{ + "days_of_week": reflect.TypeOf(types.String{}), + } } // TFSDK types cannot implement the ObjectValuable interface directly, as it would otherwise @@ -5059,13 +5061,41 @@ func (o RestartWindow_SdkV2) ToObjectValue(ctx context.Context) basetypes.Object func (o RestartWindow_SdkV2) Type(ctx context.Context) attr.Type { return types.ObjectType{ AttrTypes: map[string]attr.Type{ - "days_of_week": types.StringType, + "days_of_week": basetypes.ListType{ + ElemType: types.StringType, + }, "start_hour": types.Int64Type, "time_zone_id": types.StringType, }, } } +// GetDaysOfWeek returns the value of the DaysOfWeek field in RestartWindow_SdkV2 as +// a slice of types.String values. +// If the field is unknown or null, the boolean return value is false. +func (o *RestartWindow_SdkV2) GetDaysOfWeek(ctx context.Context) ([]types.String, bool) { + if o.DaysOfWeek.IsNull() || o.DaysOfWeek.IsUnknown() { + return nil, false + } + var v []types.String + d := o.DaysOfWeek.ElementsAs(ctx, &v, true) + if d.HasError() { + panic(pluginfwcommon.DiagToString(d)) + } + return v, true +} + +// SetDaysOfWeek sets the value of the DaysOfWeek field in RestartWindow_SdkV2. +func (o *RestartWindow_SdkV2) SetDaysOfWeek(ctx context.Context, v []types.String) { + vs := make([]attr.Value, 0, len(v)) + for _, e := range v { + vs = append(vs, e) + } + t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["days_of_week"] + t = t.(attr.TypeWithElementType).ElementType() + o.DaysOfWeek = types.ListValueMust(t, vs) +} + type SchemaSpec_SdkV2 struct { // Required. Destination catalog to store tables. DestinationCatalog types.String `tfsdk:"destination_catalog" tf:"optional"`