diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index 8622b29cac..dfe78790a0 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -a6a317df8327c9b1e5cb59a03a42ffa2aabeef6d \ No newline at end of file +779817ed8d63031f5ea761fbd25ee84f38feec0d \ No newline at end of file diff --git a/go.mod b/go.mod index 1290d6d95f..f0fedabcdc 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22.0 toolchain go1.22.5 require ( - github.com/databricks/databricks-sdk-go v0.54.0 + github.com/databricks/databricks-sdk-go v0.55.0 github.com/golang-jwt/jwt/v4 v4.5.1 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/hcl v1.0.0 @@ -78,7 +78,7 @@ require ( go.opentelemetry.io/otel/trace v1.24.0 // indirect golang.org/x/crypto v0.31.0 // indirect golang.org/x/mod v0.21.0 // indirect - golang.org/x/net v0.28.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/oauth2 v0.22.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.28.0 // indirect diff --git a/go.sum b/go.sum index 96f75b0d06..3b9a2c4645 100644 --- a/go.sum +++ b/go.sum @@ -26,8 +26,8 @@ github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBS github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/databricks/databricks-sdk-go v0.54.0 h1:L8gsA3NXs+uYU3QtW/OUgjxMQxOH24k0MT9JhB3zLlM= -github.com/databricks/databricks-sdk-go v0.54.0/go.mod h1:ds+zbv5mlQG7nFEU5ojLtgN/u0/9YzZmKQES/CfedzU= +github.com/databricks/databricks-sdk-go v0.55.0 h1:ReziD6spzTDltM0ml80LggKo27F3oUjgTinCFDJDnak= +github.com/databricks/databricks-sdk-go v0.55.0/go.mod h1:JpLizplEs+up9/Z4Xf2x++o3sM9eTTWFGzIXAptKJzI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -253,8 +253,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= diff --git a/internal/service/apps_tf/legacy_model.go b/internal/service/apps_tf/legacy_model.go index ce2070da64..93e552ebba 100755 --- a/internal/service/apps_tf/legacy_model.go +++ b/internal/service/apps_tf/legacy_model.go @@ -1616,6 +1616,8 @@ func (o *CreateAppDeploymentRequest_SdkV2) SetAppDeployment(ctx context.Context, // Create an app type CreateAppRequest_SdkV2 struct { App types.List `tfsdk:"app"` + // If true, the app will not be started after creation. + NoCompute types.Bool `tfsdk:"-"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateAppRequest. @@ -1638,7 +1640,8 @@ func (o CreateAppRequest_SdkV2) ToObjectValue(ctx context.Context) basetypes.Obj return types.ObjectValueMust( o.Type(ctx).(basetypes.ObjectType).AttrTypes, map[string]attr.Value{ - "app": o.App, + "app": o.App, + "no_compute": o.NoCompute, }) } @@ -1649,6 +1652,7 @@ func (o CreateAppRequest_SdkV2) Type(ctx context.Context) attr.Type { "app": basetypes.ListType{ ElemType: App_SdkV2{}.Type(ctx), }, + "no_compute": types.BoolType, }, } } diff --git a/internal/service/apps_tf/model.go b/internal/service/apps_tf/model.go index aaa76276e0..4519a21425 100755 --- a/internal/service/apps_tf/model.go +++ b/internal/service/apps_tf/model.go @@ -1605,6 +1605,8 @@ func (o *CreateAppDeploymentRequest) SetAppDeployment(ctx context.Context, v App // Create an app type CreateAppRequest struct { App types.Object `tfsdk:"app"` + // If true, the app will not be started after creation. + NoCompute types.Bool `tfsdk:"-"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in CreateAppRequest. @@ -1627,7 +1629,8 @@ func (o CreateAppRequest) ToObjectValue(ctx context.Context) basetypes.ObjectVal return types.ObjectValueMust( o.Type(ctx).(basetypes.ObjectType).AttrTypes, map[string]attr.Value{ - "app": o.App, + "app": o.App, + "no_compute": o.NoCompute, }) } @@ -1635,7 +1638,8 @@ func (o CreateAppRequest) ToObjectValue(ctx context.Context) basetypes.ObjectVal func (o CreateAppRequest) Type(ctx context.Context) attr.Type { return types.ObjectType{ AttrTypes: map[string]attr.Type{ - "app": App{}.Type(ctx), + "app": App{}.Type(ctx), + "no_compute": types.BoolType, }, } } diff --git a/internal/service/jobs_tf/legacy_model.go b/internal/service/jobs_tf/legacy_model.go index 4bfa898217..888b9c9ff6 100755 --- a/internal/service/jobs_tf/legacy_model.go +++ b/internal/service/jobs_tf/legacy_model.go @@ -38,6 +38,11 @@ type BaseJob_SdkV2 struct { // based on accessible budget policies of the run_as identity on job // creation or modification. EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id"` + // Indicates if the job has more sub-resources (`tasks`, `job_clusters`) + // that are not shown. They can be accessed via :method:jobs/get endpoint. + // It is only relevant for API 2.2 :method:jobs/list requests with + // `expand_tasks=true`. + HasMore types.Bool `tfsdk:"has_more"` // The canonical identifier for this job. JobId types.Int64 `tfsdk:"job_id"` // Settings for this job and all of its runs. These settings can be updated @@ -55,6 +60,7 @@ func (c BaseJob_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.Attri attrs["created_time"] = attrs["created_time"].SetOptional() attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() attrs["effective_budget_policy_id"] = attrs["effective_budget_policy_id"].SetComputed() + attrs["has_more"] = attrs["has_more"].SetOptional() attrs["job_id"] = attrs["job_id"].SetOptional() attrs["settings"] = attrs["settings"].SetOptional() attrs["settings"] = attrs["settings"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) @@ -85,6 +91,7 @@ func (o BaseJob_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue "created_time": o.CreatedTime, "creator_user_name": o.CreatorUserName, "effective_budget_policy_id": o.EffectiveBudgetPolicyId, + "has_more": o.HasMore, "job_id": o.JobId, "settings": o.Settings, }) @@ -97,6 +104,7 @@ func (o BaseJob_SdkV2) Type(ctx context.Context) attr.Type { "created_time": types.Int64Type, "creator_user_name": types.StringType, "effective_budget_policy_id": types.StringType, + "has_more": types.BoolType, "job_id": types.Int64Type, "settings": basetypes.ListType{ ElemType: JobSettings_SdkV2{}.Type(ctx), @@ -180,9 +188,16 @@ type BaseRun_SdkV2 struct { // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. GitSource types.List `tfsdk:"git_source"` + // Indicates if the run has more sub-resources (`tasks`, `job_clusters`) + // that are not shown. They can be accessed via :method:jobs/getrun + // endpoint. It is only relevant for API 2.2 :method:jobs/listruns requests + // with `expand_tasks=true`. + HasMore types.Bool `tfsdk:"has_more"` // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. - // You must declare dependent libraries in task settings. + // You must declare dependent libraries in task settings. If more than 100 + // job clusters are available, you can paginate through them using + // :method:jobs/getrun. JobClusters types.List `tfsdk:"job_clusters"` // The canonical identifier of the job that contains this run. JobId types.Int64 `tfsdk:"job_id"` @@ -244,7 +259,10 @@ type BaseRun_SdkV2 struct { // The current status of the run Status types.List `tfsdk:"status"` // The list of tasks performed by the run. Each task has its own `run_id` - // which you can use to call `JobsGetOutput` to retrieve the run resutls. + // which you can use to call `JobsGetOutput` to retrieve the run resutls. If + // more than 100 tasks are available, you can paginate through them using + // :method:jobs/getrun. Use the `next_page_token` field at the object root + // to determine if more results are available. Tasks types.List `tfsdk:"tasks"` // The type of trigger that fired this run. // @@ -282,6 +300,7 @@ func (c BaseRun_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.Attri attrs["execution_duration"] = attrs["execution_duration"].SetOptional() attrs["git_source"] = attrs["git_source"].SetOptional() attrs["git_source"] = attrs["git_source"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["has_more"] = attrs["has_more"].SetOptional() attrs["job_clusters"] = attrs["job_clusters"].SetOptional() attrs["job_id"] = attrs["job_id"].SetOptional() attrs["job_parameters"] = attrs["job_parameters"].SetOptional() @@ -353,6 +372,7 @@ func (o BaseRun_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue "end_time": o.EndTime, "execution_duration": o.ExecutionDuration, "git_source": o.GitSource, + "has_more": o.HasMore, "job_clusters": o.JobClusters, "job_id": o.JobId, "job_parameters": o.JobParameters, @@ -397,6 +417,7 @@ func (o BaseRun_SdkV2) Type(ctx context.Context) attr.Type { "git_source": basetypes.ListType{ ElemType: GitSource_SdkV2{}.Type(ctx), }, + "has_more": types.BoolType, "job_clusters": basetypes.ListType{ ElemType: JobCluster_SdkV2{}.Type(ctx), }, @@ -1431,7 +1452,9 @@ type CreateJob_SdkV2 struct { Health types.List `tfsdk:"health"` // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. - // You must declare dependent libraries in task settings. + // You must declare dependent libraries in task settings. If more than 100 + // job clusters are available, you can paginate through them using + // :method:jobs/get. JobClusters types.List `tfsdk:"job_cluster"` // An optional maximum allowed number of concurrent runs of the job. Set // this value if you want to be able to execute multiple runs of the same @@ -1471,7 +1494,10 @@ type CreateJob_SdkV2 struct { // limitations as cluster tags. A maximum of 25 tags can be added to the // job. Tags types.Map `tfsdk:"tags"` - // A list of task specifications to be executed by this job. + // A list of task specifications to be executed by this job. If more than + // 100 tasks are available, you can paginate through them using + // :method:jobs/get. Use the `next_page_token` field at the object root to + // determine if more results are available. Tasks types.List `tfsdk:"task"` // An optional timeout applied to each run of this job. A value of `0` means // no timeout. @@ -3515,6 +3541,9 @@ type GetJobRequest_SdkV2 struct { // The canonical identifier of the job to retrieve information about. This // field is required. JobId types.Int64 `tfsdk:"-"` + // Use `next_page_token` returned from the previous GetJob to request the + // next page of the job's sub-resources. + PageToken types.String `tfsdk:"-"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetJobRequest. @@ -3535,7 +3564,8 @@ func (o GetJobRequest_SdkV2) ToObjectValue(ctx context.Context) basetypes.Object return types.ObjectValueMust( o.Type(ctx).(basetypes.ObjectType).AttrTypes, map[string]attr.Value{ - "job_id": o.JobId, + "job_id": o.JobId, + "page_token": o.PageToken, }) } @@ -3543,7 +3573,8 @@ func (o GetJobRequest_SdkV2) ToObjectValue(ctx context.Context) basetypes.Object func (o GetJobRequest_SdkV2) Type(ctx context.Context) attr.Type { return types.ObjectType{ AttrTypes: map[string]attr.Type{ - "job_id": types.Int64Type, + "job_id": types.Int64Type, + "page_token": types.StringType, }, } } @@ -3718,8 +3749,8 @@ type GetRunRequest_SdkV2 struct { IncludeHistory types.Bool `tfsdk:"-"` // Whether to include resolved parameter values in the response. IncludeResolvedValues types.Bool `tfsdk:"-"` - // To list the next page of job tasks, set this field to the value of the - // `next_page_token` returned in the GetJob response. + // Use `next_page_token` returned from the previous GetRun to request the + // next page of the run's sub-resources. PageToken types.String `tfsdk:"-"` // The canonical identifier of the run for which to retrieve the metadata. // This field is required. @@ -3985,8 +4016,15 @@ type Job_SdkV2 struct { // based on accessible budget policies of the run_as identity on job // creation or modification. EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id"` + // Indicates if the job has more sub-resources (`tasks`, `job_clusters`) + // that are not shown. They can be accessed via :method:jobs/get endpoint. + // It is only relevant for API 2.2 :method:jobs/list requests with + // `expand_tasks=true`. + HasMore types.Bool `tfsdk:"has_more"` // The canonical identifier for this job. JobId types.Int64 `tfsdk:"job_id"` + // A token that can be used to list the next page of sub-resources. + NextPageToken types.String `tfsdk:"next_page_token"` // The email of an active workspace user or the application ID of a service // principal that the job runs as. This value can be changed by setting the // `run_as` field when creating or updating a job. @@ -4010,7 +4048,9 @@ func (c Job_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.Attribute attrs["created_time"] = attrs["created_time"].SetOptional() attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() attrs["effective_budget_policy_id"] = attrs["effective_budget_policy_id"].SetComputed() + attrs["has_more"] = attrs["has_more"].SetOptional() attrs["job_id"] = attrs["job_id"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() attrs["run_as_user_name"] = attrs["run_as_user_name"].SetOptional() attrs["settings"] = attrs["settings"].SetOptional() attrs["settings"] = attrs["settings"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) @@ -4041,7 +4081,9 @@ func (o Job_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { "created_time": o.CreatedTime, "creator_user_name": o.CreatorUserName, "effective_budget_policy_id": o.EffectiveBudgetPolicyId, + "has_more": o.HasMore, "job_id": o.JobId, + "next_page_token": o.NextPageToken, "run_as_user_name": o.RunAsUserName, "settings": o.Settings, }) @@ -4054,7 +4096,9 @@ func (o Job_SdkV2) Type(ctx context.Context) attr.Type { "created_time": types.Int64Type, "creator_user_name": types.StringType, "effective_budget_policy_id": types.StringType, + "has_more": types.BoolType, "job_id": types.Int64Type, + "next_page_token": types.StringType, "run_as_user_name": types.StringType, "settings": basetypes.ListType{ ElemType: JobSettings_SdkV2{}.Type(ctx), @@ -5393,7 +5437,9 @@ type JobSettings_SdkV2 struct { Health types.List `tfsdk:"health"` // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. - // You must declare dependent libraries in task settings. + // You must declare dependent libraries in task settings. If more than 100 + // job clusters are available, you can paginate through them using + // :method:jobs/get. JobClusters types.List `tfsdk:"job_cluster"` // An optional maximum allowed number of concurrent runs of the job. Set // this value if you want to be able to execute multiple runs of the same @@ -5433,7 +5479,10 @@ type JobSettings_SdkV2 struct { // limitations as cluster tags. A maximum of 25 tags can be added to the // job. Tags types.Map `tfsdk:"tags"` - // A list of task specifications to be executed by this job. + // A list of task specifications to be executed by this job. If more than + // 100 tasks are available, you can paginate through them using + // :method:jobs/get. Use the `next_page_token` field at the object root to + // determine if more results are available. Tasks types.List `tfsdk:"task"` // An optional timeout applied to each run of this job. A value of `0` means // no timeout. @@ -6391,7 +6440,9 @@ func (o ListJobComplianceRequest_SdkV2) Type(ctx context.Context) attr.Type { // List jobs type ListJobsRequest_SdkV2 struct { - // Whether to include task and cluster details in the response. + // Whether to include task and cluster details in the response. Note that in + // API 2.2, only the first 100 elements will be shown. Use :method:jobs/get + // to paginate through all tasks and clusters. ExpandTasks types.Bool `tfsdk:"-"` // The number of jobs to return. This value must be greater than 0 and less // or equal to 100. The default value is 20. @@ -6554,7 +6605,9 @@ type ListRunsRequest_SdkV2 struct { // results; otherwise, lists both active and completed runs. This field // cannot be `true` when active_only is `true`. CompletedOnly types.Bool `tfsdk:"-"` - // Whether to include task and cluster details in the response. + // Whether to include task and cluster details in the response. Note that in + // API 2.2, only the first 100 elements will be shown. Use + // :method:jobs/getrun to paginate through all tasks and clusters. ExpandTasks types.Bool `tfsdk:"-"` // The job for which to list runs. If omitted, the Jobs service lists runs // from all jobs. @@ -9139,12 +9192,19 @@ type Run_SdkV2 struct { // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. GitSource types.List `tfsdk:"git_source"` + // Indicates if the run has more sub-resources (`tasks`, `job_clusters`) + // that are not shown. They can be accessed via :method:jobs/getrun + // endpoint. It is only relevant for API 2.2 :method:jobs/listruns requests + // with `expand_tasks=true`. + HasMore types.Bool `tfsdk:"has_more"` // Only populated by for-each iterations. The parent for-each task is // located in tasks array. Iterations types.List `tfsdk:"iterations"` // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. - // You must declare dependent libraries in task settings. + // You must declare dependent libraries in task settings. If more than 100 + // job clusters are available, you can paginate through them using + // :method:jobs/getrun. JobClusters types.List `tfsdk:"job_clusters"` // The canonical identifier of the job that contains this run. JobId types.Int64 `tfsdk:"job_id"` @@ -9208,7 +9268,10 @@ type Run_SdkV2 struct { // The current status of the run Status types.List `tfsdk:"status"` // The list of tasks performed by the run. Each task has its own `run_id` - // which you can use to call `JobsGetOutput` to retrieve the run resutls. + // which you can use to call `JobsGetOutput` to retrieve the run resutls. If + // more than 100 tasks are available, you can paginate through them using + // :method:jobs/getrun. Use the `next_page_token` field at the object root + // to determine if more results are available. Tasks types.List `tfsdk:"tasks"` // The type of trigger that fired this run. // @@ -9246,6 +9309,7 @@ func (c Run_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.Attribute attrs["execution_duration"] = attrs["execution_duration"].SetOptional() attrs["git_source"] = attrs["git_source"].SetOptional() attrs["git_source"] = attrs["git_source"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["has_more"] = attrs["has_more"].SetOptional() attrs["iterations"] = attrs["iterations"].SetOptional() attrs["job_clusters"] = attrs["job_clusters"].SetOptional() attrs["job_id"] = attrs["job_id"].SetOptional() @@ -9320,6 +9384,7 @@ func (o Run_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { "end_time": o.EndTime, "execution_duration": o.ExecutionDuration, "git_source": o.GitSource, + "has_more": o.HasMore, "iterations": o.Iterations, "job_clusters": o.JobClusters, "job_id": o.JobId, @@ -9366,6 +9431,7 @@ func (o Run_SdkV2) Type(ctx context.Context) attr.Type { "git_source": basetypes.ListType{ ElemType: GitSource_SdkV2{}.Type(ctx), }, + "has_more": types.BoolType, "iterations": basetypes.ListType{ ElemType: RunTask_SdkV2{}.Type(ctx), }, diff --git a/internal/service/jobs_tf/model.go b/internal/service/jobs_tf/model.go index 89d3d2b076..a7fa90ef95 100755 --- a/internal/service/jobs_tf/model.go +++ b/internal/service/jobs_tf/model.go @@ -37,6 +37,11 @@ type BaseJob struct { // based on accessible budget policies of the run_as identity on job // creation or modification. EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id"` + // Indicates if the job has more sub-resources (`tasks`, `job_clusters`) + // that are not shown. They can be accessed via :method:jobs/get endpoint. + // It is only relevant for API 2.2 :method:jobs/list requests with + // `expand_tasks=true`. + HasMore types.Bool `tfsdk:"has_more"` // The canonical identifier for this job. JobId types.Int64 `tfsdk:"job_id"` // Settings for this job and all of its runs. These settings can be updated @@ -54,6 +59,7 @@ func (c BaseJob) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBu attrs["created_time"] = attrs["created_time"].SetOptional() attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() attrs["effective_budget_policy_id"] = attrs["effective_budget_policy_id"].SetComputed() + attrs["has_more"] = attrs["has_more"].SetOptional() attrs["job_id"] = attrs["job_id"].SetOptional() attrs["settings"] = attrs["settings"].SetOptional() @@ -83,6 +89,7 @@ func (o BaseJob) ToObjectValue(ctx context.Context) basetypes.ObjectValue { "created_time": o.CreatedTime, "creator_user_name": o.CreatorUserName, "effective_budget_policy_id": o.EffectiveBudgetPolicyId, + "has_more": o.HasMore, "job_id": o.JobId, "settings": o.Settings, }) @@ -95,6 +102,7 @@ func (o BaseJob) Type(ctx context.Context) attr.Type { "created_time": types.Int64Type, "creator_user_name": types.StringType, "effective_budget_policy_id": types.StringType, + "has_more": types.BoolType, "job_id": types.Int64Type, "settings": JobSettings{}.Type(ctx), }, @@ -178,9 +186,16 @@ type BaseRun struct { // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. GitSource types.Object `tfsdk:"git_source"` + // Indicates if the run has more sub-resources (`tasks`, `job_clusters`) + // that are not shown. They can be accessed via :method:jobs/getrun + // endpoint. It is only relevant for API 2.2 :method:jobs/listruns requests + // with `expand_tasks=true`. + HasMore types.Bool `tfsdk:"has_more"` // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. - // You must declare dependent libraries in task settings. + // You must declare dependent libraries in task settings. If more than 100 + // job clusters are available, you can paginate through them using + // :method:jobs/getrun. JobClusters types.List `tfsdk:"job_clusters"` // The canonical identifier of the job that contains this run. JobId types.Int64 `tfsdk:"job_id"` @@ -242,7 +257,10 @@ type BaseRun struct { // The current status of the run Status types.Object `tfsdk:"status"` // The list of tasks performed by the run. Each task has its own `run_id` - // which you can use to call `JobsGetOutput` to retrieve the run resutls. + // which you can use to call `JobsGetOutput` to retrieve the run resutls. If + // more than 100 tasks are available, you can paginate through them using + // :method:jobs/getrun. Use the `next_page_token` field at the object root + // to determine if more results are available. Tasks types.List `tfsdk:"tasks"` // The type of trigger that fired this run. // @@ -277,6 +295,7 @@ func (c BaseRun) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBu attrs["end_time"] = attrs["end_time"].SetOptional() attrs["execution_duration"] = attrs["execution_duration"].SetOptional() attrs["git_source"] = attrs["git_source"].SetOptional() + attrs["has_more"] = attrs["has_more"].SetOptional() attrs["job_clusters"] = attrs["job_clusters"].SetOptional() attrs["job_id"] = attrs["job_id"].SetOptional() attrs["job_parameters"] = attrs["job_parameters"].SetOptional() @@ -343,6 +362,7 @@ func (o BaseRun) ToObjectValue(ctx context.Context) basetypes.ObjectValue { "end_time": o.EndTime, "execution_duration": o.ExecutionDuration, "git_source": o.GitSource, + "has_more": o.HasMore, "job_clusters": o.JobClusters, "job_id": o.JobId, "job_parameters": o.JobParameters, @@ -381,6 +401,7 @@ func (o BaseRun) Type(ctx context.Context) attr.Type { "end_time": types.Int64Type, "execution_duration": types.Int64Type, "git_source": GitSource{}.Type(ctx), + "has_more": types.BoolType, "job_clusters": basetypes.ListType{ ElemType: JobCluster{}.Type(ctx), }, @@ -1420,7 +1441,9 @@ type CreateJob struct { Health types.Object `tfsdk:"health"` // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. - // You must declare dependent libraries in task settings. + // You must declare dependent libraries in task settings. If more than 100 + // job clusters are available, you can paginate through them using + // :method:jobs/get. JobClusters types.List `tfsdk:"job_cluster"` // An optional maximum allowed number of concurrent runs of the job. Set // this value if you want to be able to execute multiple runs of the same @@ -1460,7 +1483,10 @@ type CreateJob struct { // limitations as cluster tags. A maximum of 25 tags can be added to the // job. Tags types.Map `tfsdk:"tags"` - // A list of task specifications to be executed by this job. + // A list of task specifications to be executed by this job. If more than + // 100 tasks are available, you can paginate through them using + // :method:jobs/get. Use the `next_page_token` field at the object root to + // determine if more results are available. Tasks types.List `tfsdk:"task"` // An optional timeout applied to each run of this job. A value of `0` means // no timeout. @@ -3490,6 +3516,9 @@ type GetJobRequest struct { // The canonical identifier of the job to retrieve information about. This // field is required. JobId types.Int64 `tfsdk:"-"` + // Use `next_page_token` returned from the previous GetJob to request the + // next page of the job's sub-resources. + PageToken types.String `tfsdk:"-"` } // GetComplexFieldTypes returns a map of the types of elements in complex fields in GetJobRequest. @@ -3510,7 +3539,8 @@ func (o GetJobRequest) ToObjectValue(ctx context.Context) basetypes.ObjectValue return types.ObjectValueMust( o.Type(ctx).(basetypes.ObjectType).AttrTypes, map[string]attr.Value{ - "job_id": o.JobId, + "job_id": o.JobId, + "page_token": o.PageToken, }) } @@ -3518,7 +3548,8 @@ func (o GetJobRequest) ToObjectValue(ctx context.Context) basetypes.ObjectValue func (o GetJobRequest) Type(ctx context.Context) attr.Type { return types.ObjectType{ AttrTypes: map[string]attr.Type{ - "job_id": types.Int64Type, + "job_id": types.Int64Type, + "page_token": types.StringType, }, } } @@ -3693,8 +3724,8 @@ type GetRunRequest struct { IncludeHistory types.Bool `tfsdk:"-"` // Whether to include resolved parameter values in the response. IncludeResolvedValues types.Bool `tfsdk:"-"` - // To list the next page of job tasks, set this field to the value of the - // `next_page_token` returned in the GetJob response. + // Use `next_page_token` returned from the previous GetRun to request the + // next page of the run's sub-resources. PageToken types.String `tfsdk:"-"` // The canonical identifier of the run for which to retrieve the metadata. // This field is required. @@ -3958,8 +3989,15 @@ type Job struct { // based on accessible budget policies of the run_as identity on job // creation or modification. EffectiveBudgetPolicyId types.String `tfsdk:"effective_budget_policy_id"` + // Indicates if the job has more sub-resources (`tasks`, `job_clusters`) + // that are not shown. They can be accessed via :method:jobs/get endpoint. + // It is only relevant for API 2.2 :method:jobs/list requests with + // `expand_tasks=true`. + HasMore types.Bool `tfsdk:"has_more"` // The canonical identifier for this job. JobId types.Int64 `tfsdk:"job_id"` + // A token that can be used to list the next page of sub-resources. + NextPageToken types.String `tfsdk:"next_page_token"` // The email of an active workspace user or the application ID of a service // principal that the job runs as. This value can be changed by setting the // `run_as` field when creating or updating a job. @@ -3983,7 +4021,9 @@ func (c Job) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilde attrs["created_time"] = attrs["created_time"].SetOptional() attrs["creator_user_name"] = attrs["creator_user_name"].SetOptional() attrs["effective_budget_policy_id"] = attrs["effective_budget_policy_id"].SetComputed() + attrs["has_more"] = attrs["has_more"].SetOptional() attrs["job_id"] = attrs["job_id"].SetOptional() + attrs["next_page_token"] = attrs["next_page_token"].SetOptional() attrs["run_as_user_name"] = attrs["run_as_user_name"].SetOptional() attrs["settings"] = attrs["settings"].SetOptional() @@ -4013,7 +4053,9 @@ func (o Job) ToObjectValue(ctx context.Context) basetypes.ObjectValue { "created_time": o.CreatedTime, "creator_user_name": o.CreatorUserName, "effective_budget_policy_id": o.EffectiveBudgetPolicyId, + "has_more": o.HasMore, "job_id": o.JobId, + "next_page_token": o.NextPageToken, "run_as_user_name": o.RunAsUserName, "settings": o.Settings, }) @@ -4026,7 +4068,9 @@ func (o Job) Type(ctx context.Context) attr.Type { "created_time": types.Int64Type, "creator_user_name": types.StringType, "effective_budget_policy_id": types.StringType, + "has_more": types.BoolType, "job_id": types.Int64Type, + "next_page_token": types.StringType, "run_as_user_name": types.StringType, "settings": JobSettings{}.Type(ctx), }, @@ -5363,7 +5407,9 @@ type JobSettings struct { Health types.Object `tfsdk:"health"` // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. - // You must declare dependent libraries in task settings. + // You must declare dependent libraries in task settings. If more than 100 + // job clusters are available, you can paginate through them using + // :method:jobs/get. JobClusters types.List `tfsdk:"job_cluster"` // An optional maximum allowed number of concurrent runs of the job. Set // this value if you want to be able to execute multiple runs of the same @@ -5403,7 +5449,10 @@ type JobSettings struct { // limitations as cluster tags. A maximum of 25 tags can be added to the // job. Tags types.Map `tfsdk:"tags"` - // A list of task specifications to be executed by this job. + // A list of task specifications to be executed by this job. If more than + // 100 tasks are available, you can paginate through them using + // :method:jobs/get. Use the `next_page_token` field at the object root to + // determine if more results are available. Tasks types.List `tfsdk:"task"` // An optional timeout applied to each run of this job. A value of `0` means // no timeout. @@ -6350,7 +6399,9 @@ func (o ListJobComplianceRequest) Type(ctx context.Context) attr.Type { // List jobs type ListJobsRequest struct { - // Whether to include task and cluster details in the response. + // Whether to include task and cluster details in the response. Note that in + // API 2.2, only the first 100 elements will be shown. Use :method:jobs/get + // to paginate through all tasks and clusters. ExpandTasks types.Bool `tfsdk:"-"` // The number of jobs to return. This value must be greater than 0 and less // or equal to 100. The default value is 20. @@ -6513,7 +6564,9 @@ type ListRunsRequest struct { // results; otherwise, lists both active and completed runs. This field // cannot be `true` when active_only is `true`. CompletedOnly types.Bool `tfsdk:"-"` - // Whether to include task and cluster details in the response. + // Whether to include task and cluster details in the response. Note that in + // API 2.2, only the first 100 elements will be shown. Use + // :method:jobs/getrun to paginate through all tasks and clusters. ExpandTasks types.Bool `tfsdk:"-"` // The job for which to list runs. If omitted, the Jobs service lists runs // from all jobs. @@ -9084,12 +9137,19 @@ type Run struct { // Note: dbt and SQL File tasks support only version-controlled sources. If // dbt or SQL File tasks are used, `git_source` must be defined on the job. GitSource types.Object `tfsdk:"git_source"` + // Indicates if the run has more sub-resources (`tasks`, `job_clusters`) + // that are not shown. They can be accessed via :method:jobs/getrun + // endpoint. It is only relevant for API 2.2 :method:jobs/listruns requests + // with `expand_tasks=true`. + HasMore types.Bool `tfsdk:"has_more"` // Only populated by for-each iterations. The parent for-each task is // located in tasks array. Iterations types.List `tfsdk:"iterations"` // A list of job cluster specifications that can be shared and reused by // tasks of this job. Libraries cannot be declared in a shared job cluster. - // You must declare dependent libraries in task settings. + // You must declare dependent libraries in task settings. If more than 100 + // job clusters are available, you can paginate through them using + // :method:jobs/getrun. JobClusters types.List `tfsdk:"job_clusters"` // The canonical identifier of the job that contains this run. JobId types.Int64 `tfsdk:"job_id"` @@ -9153,7 +9213,10 @@ type Run struct { // The current status of the run Status types.Object `tfsdk:"status"` // The list of tasks performed by the run. Each task has its own `run_id` - // which you can use to call `JobsGetOutput` to retrieve the run resutls. + // which you can use to call `JobsGetOutput` to retrieve the run resutls. If + // more than 100 tasks are available, you can paginate through them using + // :method:jobs/getrun. Use the `next_page_token` field at the object root + // to determine if more results are available. Tasks types.List `tfsdk:"tasks"` // The type of trigger that fired this run. // @@ -9188,6 +9251,7 @@ func (c Run) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilde attrs["end_time"] = attrs["end_time"].SetOptional() attrs["execution_duration"] = attrs["execution_duration"].SetOptional() attrs["git_source"] = attrs["git_source"].SetOptional() + attrs["has_more"] = attrs["has_more"].SetOptional() attrs["iterations"] = attrs["iterations"].SetOptional() attrs["job_clusters"] = attrs["job_clusters"].SetOptional() attrs["job_id"] = attrs["job_id"].SetOptional() @@ -9257,6 +9321,7 @@ func (o Run) ToObjectValue(ctx context.Context) basetypes.ObjectValue { "end_time": o.EndTime, "execution_duration": o.ExecutionDuration, "git_source": o.GitSource, + "has_more": o.HasMore, "iterations": o.Iterations, "job_clusters": o.JobClusters, "job_id": o.JobId, @@ -9297,6 +9362,7 @@ func (o Run) Type(ctx context.Context) attr.Type { "end_time": types.Int64Type, "execution_duration": types.Int64Type, "git_source": GitSource{}.Type(ctx), + "has_more": types.BoolType, "iterations": basetypes.ListType{ ElemType: RunTask{}.Type(ctx), }, diff --git a/internal/service/oauth2_tf/legacy_model.go b/internal/service/oauth2_tf/legacy_model.go index 55c16e4377..75f7d2b2ec 100755 --- a/internal/service/oauth2_tf/legacy_model.go +++ b/internal/service/oauth2_tf/legacy_model.go @@ -26,8 +26,9 @@ import ( // Create account federation policy type CreateAccountFederationPolicyRequest_SdkV2 struct { Policy types.List `tfsdk:"policy"` - // The identifier for the federation policy. If unspecified, the id will be - // assigned by Databricks. + // The identifier for the federation policy. The identifier must contain + // only lowercase alphanumeric characters, numbers, hyphens, and slashes. If + // unspecified, the id will be assigned by Databricks. PolicyId types.String `tfsdk:"-"` } @@ -448,8 +449,9 @@ func (o CreatePublishedAppIntegrationOutput_SdkV2) Type(ctx context.Context) att // Create service principal federation policy type CreateServicePrincipalFederationPolicyRequest_SdkV2 struct { Policy types.List `tfsdk:"policy"` - // The identifier for the federation policy. If unspecified, the id will be - // assigned by Databricks. + // The identifier for the federation policy. The identifier must contain + // only lowercase alphanumeric characters, numbers, hyphens, and slashes. 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:"-"` @@ -630,61 +632,9 @@ func (o CreateServicePrincipalSecretResponse_SdkV2) Type(ctx context.Context) at } } -type DataPlaneInfo_SdkV2 struct { - // Authorization details as a string. - AuthorizationDetails types.String `tfsdk:"authorization_details"` - // The URL of the endpoint for this operation in the dataplane. - EndpointUrl types.String `tfsdk:"endpoint_url"` -} - -func (newState *DataPlaneInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataPlaneInfo_SdkV2) { -} - -func (newState *DataPlaneInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState DataPlaneInfo_SdkV2) { -} - -func (c DataPlaneInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - attrs["authorization_details"] = attrs["authorization_details"].SetOptional() - attrs["endpoint_url"] = attrs["endpoint_url"].SetOptional() - - return attrs -} - -// GetComplexFieldTypes returns a map of the types of elements in complex fields in DataPlaneInfo. -// 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 DataPlaneInfo_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, DataPlaneInfo_SdkV2 -// only implements ToObjectValue() and Type(). -func (o DataPlaneInfo_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { - return types.ObjectValueMust( - o.Type(ctx).(basetypes.ObjectType).AttrTypes, - map[string]attr.Value{ - "authorization_details": o.AuthorizationDetails, - "endpoint_url": o.EndpointUrl, - }) -} - -// Type implements basetypes.ObjectValuable. -func (o DataPlaneInfo_SdkV2) Type(ctx context.Context) attr.Type { - return types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "authorization_details": types.StringType, - "endpoint_url": types.StringType, - }, - } -} - // Delete account federation policy type DeleteAccountFederationPolicyRequest_SdkV2 struct { + // The identifier for the federation policy. PolicyId types.String `tfsdk:"-"` } @@ -905,6 +855,7 @@ func (o DeleteResponse_SdkV2) Type(ctx context.Context) attr.Type { // Delete service principal federation policy type DeleteServicePrincipalFederationPolicyRequest_SdkV2 struct { + // The identifier for the federation policy. PolicyId types.String `tfsdk:"-"` // The service principal id for the federation policy. ServicePrincipalId types.Int64 `tfsdk:"-"` @@ -989,9 +940,13 @@ type FederationPolicy_SdkV2 struct { CreateTime types.String `tfsdk:"create_time"` // Description of the federation policy. Description types.String `tfsdk:"description"` - // Name of the federation policy. The name must contain only lowercase - // alphanumeric characters, numbers, and hyphens. It must be unique within - // the account. + // Resource name for the federation policy. Example values include + // `accounts//federationPolicies/my-federation-policy` for + // Account Federation Policies, and + // `accounts//servicePrincipals//federationPolicies/my-federation-policy` + // for Service Principal Federation Policies. Typically an output parameter, + // which does not need to be specified in create or update requests. If + // specified in a request, must match the value in the request URL. Name types.String `tfsdk:"name"` // Specifies the policy to use for validating OIDC claims in your federated // tokens. @@ -1093,6 +1048,7 @@ func (o *FederationPolicy_SdkV2) SetOidcPolicy(ctx context.Context, v OidcFedera // Get account federation policy type GetAccountFederationPolicyRequest_SdkV2 struct { + // The identifier for the federation policy. PolicyId types.String `tfsdk:"-"` } @@ -1739,6 +1695,7 @@ func (o *GetPublishedAppsOutput_SdkV2) SetApps(ctx context.Context, v []Publishe // Get service principal federation policy type GetServicePrincipalFederationPolicyRequest_SdkV2 struct { + // The identifier for the federation policy. PolicyId types.String `tfsdk:"-"` // The service principal id for the federation policy. ServicePrincipalId types.Int64 `tfsdk:"-"` @@ -2576,12 +2533,14 @@ func (o TokenAccessPolicy_SdkV2) Type(ctx context.Context) attr.Type { // Update account federation policy type UpdateAccountFederationPolicyRequest_SdkV2 struct { Policy types.List `tfsdk:"policy"` - + // The identifier for the federation policy. 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). + // The field mask specifies which fields of the policy to update. To specify + // multiple fields in the field mask, use comma as the separator (no space). + // The special value '*' indicates that all fields should be updated (full + // replacement). If unspecified, all fields that are set in the policy + // provided in the update request will overwrite the corresponding fields in + // the existing policy. Example value: 'description,oidc_policy.audiences'. UpdateMask types.String `tfsdk:"-"` } @@ -2936,14 +2895,16 @@ func (o UpdatePublishedAppIntegrationOutput_SdkV2) Type(ctx context.Context) att // Update service principal federation policy type UpdateServicePrincipalFederationPolicyRequest_SdkV2 struct { Policy types.List `tfsdk:"policy"` - + // The identifier for the federation policy. 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). + // The field mask specifies which fields of the policy to update. To specify + // multiple fields in the field mask, use comma as the separator (no space). + // The special value '*' indicates that all fields should be updated (full + // replacement). If unspecified, all fields that are set in the policy + // provided in the update request will overwrite the corresponding fields in + // the existing policy. Example value: 'description,oidc_policy.audiences'. UpdateMask types.String `tfsdk:"-"` } diff --git a/internal/service/oauth2_tf/model.go b/internal/service/oauth2_tf/model.go index 3e7fa74de4..dd08224cb4 100755 --- a/internal/service/oauth2_tf/model.go +++ b/internal/service/oauth2_tf/model.go @@ -25,8 +25,9 @@ import ( // Create account federation policy type CreateAccountFederationPolicyRequest struct { Policy types.Object `tfsdk:"policy"` - // The identifier for the federation policy. If unspecified, the id will be - // assigned by Databricks. + // The identifier for the federation policy. The identifier must contain + // only lowercase alphanumeric characters, numbers, hyphens, and slashes. If + // unspecified, the id will be assigned by Databricks. PolicyId types.String `tfsdk:"-"` } @@ -445,8 +446,9 @@ func (o CreatePublishedAppIntegrationOutput) Type(ctx context.Context) attr.Type // Create service principal federation policy type CreateServicePrincipalFederationPolicyRequest struct { Policy types.Object `tfsdk:"policy"` - // The identifier for the federation policy. If unspecified, the id will be - // assigned by Databricks. + // The identifier for the federation policy. The identifier must contain + // only lowercase alphanumeric characters, numbers, hyphens, and slashes. 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:"-"` @@ -627,61 +629,9 @@ func (o CreateServicePrincipalSecretResponse) Type(ctx context.Context) attr.Typ } } -type DataPlaneInfo struct { - // Authorization details as a string. - AuthorizationDetails types.String `tfsdk:"authorization_details"` - // The URL of the endpoint for this operation in the dataplane. - EndpointUrl types.String `tfsdk:"endpoint_url"` -} - -func (newState *DataPlaneInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataPlaneInfo) { -} - -func (newState *DataPlaneInfo) SyncEffectiveFieldsDuringRead(existingState DataPlaneInfo) { -} - -func (c DataPlaneInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { - attrs["authorization_details"] = attrs["authorization_details"].SetOptional() - attrs["endpoint_url"] = attrs["endpoint_url"].SetOptional() - - return attrs -} - -// GetComplexFieldTypes returns a map of the types of elements in complex fields in DataPlaneInfo. -// 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 DataPlaneInfo) 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, DataPlaneInfo -// only implements ToObjectValue() and Type(). -func (o DataPlaneInfo) ToObjectValue(ctx context.Context) basetypes.ObjectValue { - return types.ObjectValueMust( - o.Type(ctx).(basetypes.ObjectType).AttrTypes, - map[string]attr.Value{ - "authorization_details": o.AuthorizationDetails, - "endpoint_url": o.EndpointUrl, - }) -} - -// Type implements basetypes.ObjectValuable. -func (o DataPlaneInfo) Type(ctx context.Context) attr.Type { - return types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "authorization_details": types.StringType, - "endpoint_url": types.StringType, - }, - } -} - // Delete account federation policy type DeleteAccountFederationPolicyRequest struct { + // The identifier for the federation policy. PolicyId types.String `tfsdk:"-"` } @@ -902,6 +852,7 @@ func (o DeleteResponse) Type(ctx context.Context) attr.Type { // Delete service principal federation policy type DeleteServicePrincipalFederationPolicyRequest struct { + // The identifier for the federation policy. PolicyId types.String `tfsdk:"-"` // The service principal id for the federation policy. ServicePrincipalId types.Int64 `tfsdk:"-"` @@ -986,9 +937,13 @@ type FederationPolicy struct { CreateTime types.String `tfsdk:"create_time"` // Description of the federation policy. Description types.String `tfsdk:"description"` - // Name of the federation policy. The name must contain only lowercase - // alphanumeric characters, numbers, and hyphens. It must be unique within - // the account. + // Resource name for the federation policy. Example values include + // `accounts//federationPolicies/my-federation-policy` for + // Account Federation Policies, and + // `accounts//servicePrincipals//federationPolicies/my-federation-policy` + // for Service Principal Federation Policies. Typically an output parameter, + // which does not need to be specified in create or update requests. If + // specified in a request, must match the value in the request URL. Name types.String `tfsdk:"name"` // Specifies the policy to use for validating OIDC claims in your federated // tokens. @@ -1089,6 +1044,7 @@ func (o *FederationPolicy) SetOidcPolicy(ctx context.Context, v OidcFederationPo // Get account federation policy type GetAccountFederationPolicyRequest struct { + // The identifier for the federation policy. PolicyId types.String `tfsdk:"-"` } @@ -1733,6 +1689,7 @@ func (o *GetPublishedAppsOutput) SetApps(ctx context.Context, v []PublishedAppOu // Get service principal federation policy type GetServicePrincipalFederationPolicyRequest struct { + // The identifier for the federation policy. PolicyId types.String `tfsdk:"-"` // The service principal id for the federation policy. ServicePrincipalId types.Int64 `tfsdk:"-"` @@ -2570,12 +2527,14 @@ func (o TokenAccessPolicy) Type(ctx context.Context) attr.Type { // Update account federation policy type UpdateAccountFederationPolicyRequest struct { Policy types.Object `tfsdk:"policy"` - + // The identifier for the federation policy. 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). + // The field mask specifies which fields of the policy to update. To specify + // multiple fields in the field mask, use comma as the separator (no space). + // The special value '*' indicates that all fields should be updated (full + // replacement). If unspecified, all fields that are set in the policy + // provided in the update request will overwrite the corresponding fields in + // the existing policy. Example value: 'description,oidc_policy.audiences'. UpdateMask types.String `tfsdk:"-"` } @@ -2928,14 +2887,16 @@ func (o UpdatePublishedAppIntegrationOutput) Type(ctx context.Context) attr.Type // Update service principal federation policy type UpdateServicePrincipalFederationPolicyRequest struct { Policy types.Object `tfsdk:"policy"` - + // The identifier for the federation policy. 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). + // The field mask specifies which fields of the policy to update. To specify + // multiple fields in the field mask, use comma as the separator (no space). + // The special value '*' indicates that all fields should be updated (full + // replacement). If unspecified, all fields that are set in the policy + // provided in the update request will overwrite the corresponding fields in + // the existing policy. Example value: 'description,oidc_policy.audiences'. UpdateMask types.String `tfsdk:"-"` } diff --git a/internal/service/pipelines_tf/legacy_model.go b/internal/service/pipelines_tf/legacy_model.go index c30a90cdd1..0af5052956 100755 --- a/internal/service/pipelines_tf/legacy_model.go +++ b/internal/service/pipelines_tf/legacy_model.go @@ -71,6 +71,13 @@ type CreatePipeline_SdkV2 struct { Photon types.Bool `tfsdk:"photon"` // Restart window of this pipeline. RestartWindow types.List `tfsdk:"restart_window"` + // Write-only setting, available only in Create/Update calls. Specifies the + // user or service principal that the pipeline runs as. If not specified, + // the pipeline runs as the user who created the pipeline. + // + // Only `user_name` or `service_principal_name` can be specified. If both + // are specified, an error is thrown. + RunAs types.List `tfsdk:"run_as"` // The default schema (database) where tables are read from or published to. // The presence of this field implies that the pipeline is in direct // publishing mode. @@ -119,6 +126,8 @@ func (c CreatePipeline_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschem attrs["photon"] = attrs["photon"].SetOptional() attrs["restart_window"] = attrs["restart_window"].SetOptional() attrs["restart_window"] = attrs["restart_window"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["run_as"] = attrs["run_as"].SetOptional() + attrs["run_as"] = attrs["run_as"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) attrs["schema"] = attrs["schema"].SetOptional() attrs["serverless"] = attrs["serverless"].SetOptional() attrs["storage"] = attrs["storage"].SetOptional() @@ -147,6 +156,7 @@ func (a CreatePipeline_SdkV2) GetComplexFieldTypes(ctx context.Context) map[stri "libraries": reflect.TypeOf(PipelineLibrary_SdkV2{}), "notifications": reflect.TypeOf(Notifications_SdkV2{}), "restart_window": reflect.TypeOf(RestartWindow_SdkV2{}), + "run_as": reflect.TypeOf(RunAs_SdkV2{}), "trigger": reflect.TypeOf(PipelineTrigger_SdkV2{}), } } @@ -178,6 +188,7 @@ func (o CreatePipeline_SdkV2) ToObjectValue(ctx context.Context) basetypes.Objec "notifications": o.Notifications, "photon": o.Photon, "restart_window": o.RestartWindow, + "run_as": o.RunAs, "schema": o.Schema, "serverless": o.Serverless, "storage": o.Storage, @@ -228,6 +239,9 @@ func (o CreatePipeline_SdkV2) Type(ctx context.Context) attr.Type { "restart_window": basetypes.ListType{ ElemType: RestartWindow_SdkV2{}.Type(ctx), }, + "run_as": basetypes.ListType{ + ElemType: RunAs_SdkV2{}.Type(ctx), + }, "schema": types.StringType, "serverless": types.BoolType, "storage": types.StringType, @@ -473,6 +487,32 @@ func (o *CreatePipeline_SdkV2) SetRestartWindow(ctx context.Context, v RestartWi o.RestartWindow = types.ListValueMust(t, vs) } +// GetRunAs returns the value of the RunAs field in CreatePipeline_SdkV2 as +// a RunAs_SdkV2 value. +// If the field is unknown or null, the boolean return value is false. +func (o *CreatePipeline_SdkV2) GetRunAs(ctx context.Context) (RunAs_SdkV2, bool) { + var e RunAs_SdkV2 + if o.RunAs.IsNull() || o.RunAs.IsUnknown() { + return e, false + } + var v []RunAs_SdkV2 + d := o.RunAs.ElementsAs(ctx, &v, true) + if d.HasError() { + panic(pluginfwcommon.DiagToString(d)) + } + if len(v) == 0 { + return e, false + } + return v[0], true +} + +// SetRunAs sets the value of the RunAs field in CreatePipeline_SdkV2. +func (o *CreatePipeline_SdkV2) SetRunAs(ctx context.Context, v RunAs_SdkV2) { + vs := []attr.Value{v.ToObjectValue(ctx)} + t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["run_as"] + o.RunAs = types.ListValueMust(t, vs) +} + // GetTrigger returns the value of the Trigger field in CreatePipeline_SdkV2 as // a PipelineTrigger_SdkV2 value. // If the field is unknown or null, the boolean return value is false. @@ -817,6 +857,13 @@ type EditPipeline_SdkV2 struct { PipelineId types.String `tfsdk:"pipeline_id"` // Restart window of this pipeline. RestartWindow types.List `tfsdk:"restart_window"` + // Write-only setting, available only in Create/Update calls. Specifies the + // user or service principal that the pipeline runs as. If not specified, + // the pipeline runs as the user who created the pipeline. + // + // Only `user_name` or `service_principal_name` can be specified. If both + // are specified, an error is thrown. + RunAs types.List `tfsdk:"run_as"` // The default schema (database) where tables are read from or published to. // The presence of this field implies that the pipeline is in direct // publishing mode. @@ -866,6 +913,8 @@ func (c EditPipeline_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema. attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() attrs["restart_window"] = attrs["restart_window"].SetOptional() attrs["restart_window"] = attrs["restart_window"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) + attrs["run_as"] = attrs["run_as"].SetOptional() + attrs["run_as"] = attrs["run_as"].(tfschema.ListNestedAttributeBuilder).AddValidator(listvalidator.SizeAtMost(1)).(tfschema.AttributeBuilder) attrs["schema"] = attrs["schema"].SetOptional() attrs["serverless"] = attrs["serverless"].SetOptional() attrs["storage"] = attrs["storage"].SetOptional() @@ -894,6 +943,7 @@ func (a EditPipeline_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string "libraries": reflect.TypeOf(PipelineLibrary_SdkV2{}), "notifications": reflect.TypeOf(Notifications_SdkV2{}), "restart_window": reflect.TypeOf(RestartWindow_SdkV2{}), + "run_as": reflect.TypeOf(RunAs_SdkV2{}), "trigger": reflect.TypeOf(PipelineTrigger_SdkV2{}), } } @@ -926,6 +976,7 @@ func (o EditPipeline_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectV "photon": o.Photon, "pipeline_id": o.PipelineId, "restart_window": o.RestartWindow, + "run_as": o.RunAs, "schema": o.Schema, "serverless": o.Serverless, "storage": o.Storage, @@ -977,6 +1028,9 @@ func (o EditPipeline_SdkV2) Type(ctx context.Context) attr.Type { "restart_window": basetypes.ListType{ ElemType: RestartWindow_SdkV2{}.Type(ctx), }, + "run_as": basetypes.ListType{ + ElemType: RunAs_SdkV2{}.Type(ctx), + }, "schema": types.StringType, "serverless": types.BoolType, "storage": types.StringType, @@ -1222,6 +1276,32 @@ func (o *EditPipeline_SdkV2) SetRestartWindow(ctx context.Context, v RestartWind o.RestartWindow = types.ListValueMust(t, vs) } +// GetRunAs returns the value of the RunAs field in EditPipeline_SdkV2 as +// a RunAs_SdkV2 value. +// If the field is unknown or null, the boolean return value is false. +func (o *EditPipeline_SdkV2) GetRunAs(ctx context.Context) (RunAs_SdkV2, bool) { + var e RunAs_SdkV2 + if o.RunAs.IsNull() || o.RunAs.IsUnknown() { + return e, false + } + var v []RunAs_SdkV2 + d := o.RunAs.ElementsAs(ctx, &v, true) + if d.HasError() { + panic(pluginfwcommon.DiagToString(d)) + } + if len(v) == 0 { + return e, false + } + return v[0], true +} + +// SetRunAs sets the value of the RunAs field in EditPipeline_SdkV2. +func (o *EditPipeline_SdkV2) SetRunAs(ctx context.Context, v RunAs_SdkV2) { + vs := []attr.Value{v.ToObjectValue(ctx)} + t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["run_as"] + o.RunAs = types.ListValueMust(t, vs) +} + // GetTrigger returns the value of the Trigger field in EditPipeline_SdkV2 as // a PipelineTrigger_SdkV2 value. // If the field is unknown or null, the boolean return value is false. @@ -5498,6 +5578,67 @@ func (o *RestartWindow_SdkV2) SetDaysOfWeek(ctx context.Context, v []types.Strin o.DaysOfWeek = types.ListValueMust(t, vs) } +// Write-only setting, available only in Create/Update calls. Specifies the user +// or service principal that the pipeline runs as. If not specified, the +// pipeline runs as the user who created the pipeline. +// +// Only `user_name` or `service_principal_name` can be specified. If both are +// specified, an error is thrown. +type RunAs_SdkV2 struct { + // Application ID of an active service principal. Setting this field + // requires the `servicePrincipal/user` role. + ServicePrincipalName types.String `tfsdk:"service_principal_name"` + // The email of an active workspace user. Users can only set this field to + // their own email. + UserName types.String `tfsdk:"user_name"` +} + +func (newState *RunAs_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunAs_SdkV2) { +} + +func (newState *RunAs_SdkV2) SyncEffectiveFieldsDuringRead(existingState RunAs_SdkV2) { +} + +func (c RunAs_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() + + return attrs +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in RunAs. +// 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 RunAs_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, RunAs_SdkV2 +// only implements ToObjectValue() and Type(). +func (o RunAs_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "service_principal_name": o.ServicePrincipalName, + "user_name": o.UserName, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o RunAs_SdkV2) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "service_principal_name": types.StringType, + "user_name": types.StringType, + }, + } +} + type SchemaSpec_SdkV2 struct { // Required. Destination catalog to store tables. DestinationCatalog types.String `tfsdk:"destination_catalog"` diff --git a/internal/service/pipelines_tf/model.go b/internal/service/pipelines_tf/model.go index 4fc6d79024..bd3bb3b407 100755 --- a/internal/service/pipelines_tf/model.go +++ b/internal/service/pipelines_tf/model.go @@ -70,6 +70,13 @@ type CreatePipeline struct { Photon types.Bool `tfsdk:"photon"` // Restart window of this pipeline. RestartWindow types.Object `tfsdk:"restart_window"` + // Write-only setting, available only in Create/Update calls. Specifies the + // user or service principal that the pipeline runs as. If not specified, + // the pipeline runs as the user who created the pipeline. + // + // Only `user_name` or `service_principal_name` can be specified. If both + // are specified, an error is thrown. + RunAs types.Object `tfsdk:"run_as"` // The default schema (database) where tables are read from or published to. // The presence of this field implies that the pipeline is in direct // publishing mode. @@ -113,6 +120,7 @@ func (c CreatePipeline) ApplySchemaCustomizations(attrs map[string]tfschema.Attr attrs["notifications"] = attrs["notifications"].SetOptional() attrs["photon"] = attrs["photon"].SetOptional() attrs["restart_window"] = attrs["restart_window"].SetOptional() + attrs["run_as"] = attrs["run_as"].SetOptional() attrs["schema"] = attrs["schema"].SetOptional() attrs["serverless"] = attrs["serverless"].SetOptional() attrs["storage"] = attrs["storage"].SetOptional() @@ -140,6 +148,7 @@ func (a CreatePipeline) GetComplexFieldTypes(ctx context.Context) map[string]ref "libraries": reflect.TypeOf(PipelineLibrary{}), "notifications": reflect.TypeOf(Notifications{}), "restart_window": reflect.TypeOf(RestartWindow{}), + "run_as": reflect.TypeOf(RunAs{}), "trigger": reflect.TypeOf(PipelineTrigger{}), } } @@ -171,6 +180,7 @@ func (o CreatePipeline) ToObjectValue(ctx context.Context) basetypes.ObjectValue "notifications": o.Notifications, "photon": o.Photon, "restart_window": o.RestartWindow, + "run_as": o.RunAs, "schema": o.Schema, "serverless": o.Serverless, "storage": o.Storage, @@ -211,6 +221,7 @@ func (o CreatePipeline) Type(ctx context.Context) attr.Type { }, "photon": types.BoolType, "restart_window": RestartWindow{}.Type(ctx), + "run_as": RunAs{}.Type(ctx), "schema": types.StringType, "serverless": types.BoolType, "storage": types.StringType, @@ -464,6 +475,34 @@ func (o *CreatePipeline) SetRestartWindow(ctx context.Context, v RestartWindow) o.RestartWindow = vs } +// GetRunAs returns the value of the RunAs field in CreatePipeline as +// a RunAs value. +// If the field is unknown or null, the boolean return value is false. +func (o *CreatePipeline) GetRunAs(ctx context.Context) (RunAs, bool) { + var e RunAs + if o.RunAs.IsNull() || o.RunAs.IsUnknown() { + return e, false + } + var v []RunAs + d := o.RunAs.As(ctx, &v, basetypes.ObjectAsOptions{ + UnhandledNullAsEmpty: true, + UnhandledUnknownAsEmpty: true, + }) + if d.HasError() { + panic(pluginfwcommon.DiagToString(d)) + } + if len(v) == 0 { + return e, false + } + return v[0], true +} + +// SetRunAs sets the value of the RunAs field in CreatePipeline. +func (o *CreatePipeline) SetRunAs(ctx context.Context, v RunAs) { + vs := v.ToObjectValue(ctx) + o.RunAs = vs +} + // GetTrigger returns the value of the Trigger field in CreatePipeline as // a PipelineTrigger value. // If the field is unknown or null, the boolean return value is false. @@ -809,6 +848,13 @@ type EditPipeline struct { PipelineId types.String `tfsdk:"pipeline_id"` // Restart window of this pipeline. RestartWindow types.Object `tfsdk:"restart_window"` + // Write-only setting, available only in Create/Update calls. Specifies the + // user or service principal that the pipeline runs as. If not specified, + // the pipeline runs as the user who created the pipeline. + // + // Only `user_name` or `service_principal_name` can be specified. If both + // are specified, an error is thrown. + RunAs types.Object `tfsdk:"run_as"` // The default schema (database) where tables are read from or published to. // The presence of this field implies that the pipeline is in direct // publishing mode. @@ -853,6 +899,7 @@ func (c EditPipeline) ApplySchemaCustomizations(attrs map[string]tfschema.Attrib attrs["photon"] = attrs["photon"].SetOptional() attrs["pipeline_id"] = attrs["pipeline_id"].SetOptional() attrs["restart_window"] = attrs["restart_window"].SetOptional() + attrs["run_as"] = attrs["run_as"].SetOptional() attrs["schema"] = attrs["schema"].SetOptional() attrs["serverless"] = attrs["serverless"].SetOptional() attrs["storage"] = attrs["storage"].SetOptional() @@ -880,6 +927,7 @@ func (a EditPipeline) GetComplexFieldTypes(ctx context.Context) map[string]refle "libraries": reflect.TypeOf(PipelineLibrary{}), "notifications": reflect.TypeOf(Notifications{}), "restart_window": reflect.TypeOf(RestartWindow{}), + "run_as": reflect.TypeOf(RunAs{}), "trigger": reflect.TypeOf(PipelineTrigger{}), } } @@ -912,6 +960,7 @@ func (o EditPipeline) ToObjectValue(ctx context.Context) basetypes.ObjectValue { "photon": o.Photon, "pipeline_id": o.PipelineId, "restart_window": o.RestartWindow, + "run_as": o.RunAs, "schema": o.Schema, "serverless": o.Serverless, "storage": o.Storage, @@ -953,6 +1002,7 @@ func (o EditPipeline) Type(ctx context.Context) attr.Type { "photon": types.BoolType, "pipeline_id": types.StringType, "restart_window": RestartWindow{}.Type(ctx), + "run_as": RunAs{}.Type(ctx), "schema": types.StringType, "serverless": types.BoolType, "storage": types.StringType, @@ -1206,6 +1256,34 @@ func (o *EditPipeline) SetRestartWindow(ctx context.Context, v RestartWindow) { o.RestartWindow = vs } +// GetRunAs returns the value of the RunAs field in EditPipeline as +// a RunAs value. +// If the field is unknown or null, the boolean return value is false. +func (o *EditPipeline) GetRunAs(ctx context.Context) (RunAs, bool) { + var e RunAs + if o.RunAs.IsNull() || o.RunAs.IsUnknown() { + return e, false + } + var v []RunAs + d := o.RunAs.As(ctx, &v, basetypes.ObjectAsOptions{ + UnhandledNullAsEmpty: true, + UnhandledUnknownAsEmpty: true, + }) + if d.HasError() { + panic(pluginfwcommon.DiagToString(d)) + } + if len(v) == 0 { + return e, false + } + return v[0], true +} + +// SetRunAs sets the value of the RunAs field in EditPipeline. +func (o *EditPipeline) SetRunAs(ctx context.Context, v RunAs) { + vs := v.ToObjectValue(ctx) + o.RunAs = vs +} + // GetTrigger returns the value of the Trigger field in EditPipeline as // a PipelineTrigger value. // If the field is unknown or null, the boolean return value is false. @@ -5458,6 +5536,67 @@ func (o *RestartWindow) SetDaysOfWeek(ctx context.Context, v []types.String) { o.DaysOfWeek = types.ListValueMust(t, vs) } +// Write-only setting, available only in Create/Update calls. Specifies the user +// or service principal that the pipeline runs as. If not specified, the +// pipeline runs as the user who created the pipeline. +// +// Only `user_name` or `service_principal_name` can be specified. If both are +// specified, an error is thrown. +type RunAs struct { + // Application ID of an active service principal. Setting this field + // requires the `servicePrincipal/user` role. + ServicePrincipalName types.String `tfsdk:"service_principal_name"` + // The email of an active workspace user. Users can only set this field to + // their own email. + UserName types.String `tfsdk:"user_name"` +} + +func (newState *RunAs) SyncEffectiveFieldsDuringCreateOrUpdate(plan RunAs) { +} + +func (newState *RunAs) SyncEffectiveFieldsDuringRead(existingState RunAs) { +} + +func (c RunAs) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["service_principal_name"] = attrs["service_principal_name"].SetOptional() + attrs["user_name"] = attrs["user_name"].SetOptional() + + return attrs +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in RunAs. +// 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 RunAs) 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, RunAs +// only implements ToObjectValue() and Type(). +func (o RunAs) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "service_principal_name": o.ServicePrincipalName, + "user_name": o.UserName, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o RunAs) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "service_principal_name": types.StringType, + "user_name": types.StringType, + }, + } +} + type SchemaSpec struct { // Required. Destination catalog to store tables. DestinationCatalog types.String `tfsdk:"destination_catalog"` diff --git a/internal/service/serving_tf/legacy_model.go b/internal/service/serving_tf/legacy_model.go index 6fc82d372b..5573d72aaa 100755 --- a/internal/service/serving_tf/legacy_model.go +++ b/internal/service/serving_tf/legacy_model.go @@ -17,7 +17,6 @@ import ( pluginfwcommon "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/common" "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" - "github.com/databricks/terraform-provider-databricks/internal/service/oauth2_tf" "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" @@ -1569,6 +1568,59 @@ func (o *CreateServingEndpoint_SdkV2) SetTags(ctx context.Context, v []EndpointT o.Tags = types.ListValueMust(t, vs) } +type DataPlaneInfo_SdkV2 struct { + // Authorization details as a string. + AuthorizationDetails types.String `tfsdk:"authorization_details"` + // The URL of the endpoint for this operation in the dataplane. + EndpointUrl types.String `tfsdk:"endpoint_url"` +} + +func (newState *DataPlaneInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataPlaneInfo_SdkV2) { +} + +func (newState *DataPlaneInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState DataPlaneInfo_SdkV2) { +} + +func (c DataPlaneInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["authorization_details"] = attrs["authorization_details"].SetOptional() + attrs["endpoint_url"] = attrs["endpoint_url"].SetOptional() + + return attrs +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in DataPlaneInfo. +// 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 DataPlaneInfo_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, DataPlaneInfo_SdkV2 +// only implements ToObjectValue() and Type(). +func (o DataPlaneInfo_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "authorization_details": o.AuthorizationDetails, + "endpoint_url": o.EndpointUrl, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o DataPlaneInfo_SdkV2) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "authorization_details": types.StringType, + "endpoint_url": types.StringType, + }, + } +} + type DatabricksModelServingConfig_SdkV2 struct { // The Databricks secret key reference for a Databricks API token that // corresponds to a user or service principal with Can Query access to the @@ -3766,7 +3818,7 @@ func (c ModelDataPlaneInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfs // SDK values. func (a ModelDataPlaneInfo_SdkV2) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { return map[string]reflect.Type{ - "query_info": reflect.TypeOf(oauth2_tf.DataPlaneInfo_SdkV2{}), + "query_info": reflect.TypeOf(DataPlaneInfo_SdkV2{}), } } @@ -3786,21 +3838,21 @@ func (o ModelDataPlaneInfo_SdkV2) Type(ctx context.Context) attr.Type { return types.ObjectType{ AttrTypes: map[string]attr.Type{ "query_info": basetypes.ListType{ - ElemType: oauth2_tf.DataPlaneInfo_SdkV2{}.Type(ctx), + ElemType: DataPlaneInfo_SdkV2{}.Type(ctx), }, }, } } // GetQueryInfo returns the value of the QueryInfo field in ModelDataPlaneInfo_SdkV2 as -// a oauth2_tf.DataPlaneInfo_SdkV2 value. +// a DataPlaneInfo_SdkV2 value. // If the field is unknown or null, the boolean return value is false. -func (o *ModelDataPlaneInfo_SdkV2) GetQueryInfo(ctx context.Context) (oauth2_tf.DataPlaneInfo_SdkV2, bool) { - var e oauth2_tf.DataPlaneInfo_SdkV2 +func (o *ModelDataPlaneInfo_SdkV2) GetQueryInfo(ctx context.Context) (DataPlaneInfo_SdkV2, bool) { + var e DataPlaneInfo_SdkV2 if o.QueryInfo.IsNull() || o.QueryInfo.IsUnknown() { return e, false } - var v []oauth2_tf.DataPlaneInfo_SdkV2 + var v []DataPlaneInfo_SdkV2 d := o.QueryInfo.ElementsAs(ctx, &v, true) if d.HasError() { panic(pluginfwcommon.DiagToString(d)) @@ -3812,7 +3864,7 @@ func (o *ModelDataPlaneInfo_SdkV2) GetQueryInfo(ctx context.Context) (oauth2_tf. } // SetQueryInfo sets the value of the QueryInfo field in ModelDataPlaneInfo_SdkV2. -func (o *ModelDataPlaneInfo_SdkV2) SetQueryInfo(ctx context.Context, v oauth2_tf.DataPlaneInfo_SdkV2) { +func (o *ModelDataPlaneInfo_SdkV2) SetQueryInfo(ctx context.Context, v DataPlaneInfo_SdkV2) { vs := []attr.Value{v.ToObjectValue(ctx)} t := o.Type(ctx).(basetypes.ObjectType).AttrTypes["query_info"] o.QueryInfo = types.ListValueMust(t, vs) diff --git a/internal/service/serving_tf/model.go b/internal/service/serving_tf/model.go index 7421441ba4..480769547f 100755 --- a/internal/service/serving_tf/model.go +++ b/internal/service/serving_tf/model.go @@ -17,7 +17,6 @@ import ( pluginfwcommon "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/common" "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/tfschema" - "github.com/databricks/terraform-provider-databricks/internal/service/oauth2_tf" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -1558,6 +1557,59 @@ func (o *CreateServingEndpoint) SetTags(ctx context.Context, v []EndpointTag) { o.Tags = types.ListValueMust(t, vs) } +type DataPlaneInfo struct { + // Authorization details as a string. + AuthorizationDetails types.String `tfsdk:"authorization_details"` + // The URL of the endpoint for this operation in the dataplane. + EndpointUrl types.String `tfsdk:"endpoint_url"` +} + +func (newState *DataPlaneInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan DataPlaneInfo) { +} + +func (newState *DataPlaneInfo) SyncEffectiveFieldsDuringRead(existingState DataPlaneInfo) { +} + +func (c DataPlaneInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["authorization_details"] = attrs["authorization_details"].SetOptional() + attrs["endpoint_url"] = attrs["endpoint_url"].SetOptional() + + return attrs +} + +// GetComplexFieldTypes returns a map of the types of elements in complex fields in DataPlaneInfo. +// 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 DataPlaneInfo) 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, DataPlaneInfo +// only implements ToObjectValue() and Type(). +func (o DataPlaneInfo) ToObjectValue(ctx context.Context) basetypes.ObjectValue { + return types.ObjectValueMust( + o.Type(ctx).(basetypes.ObjectType).AttrTypes, + map[string]attr.Value{ + "authorization_details": o.AuthorizationDetails, + "endpoint_url": o.EndpointUrl, + }) +} + +// Type implements basetypes.ObjectValuable. +func (o DataPlaneInfo) Type(ctx context.Context) attr.Type { + return types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "authorization_details": types.StringType, + "endpoint_url": types.StringType, + }, + } +} + type DatabricksModelServingConfig struct { // The Databricks secret key reference for a Databricks API token that // corresponds to a user or service principal with Can Query access to the @@ -3740,7 +3792,7 @@ func (c ModelDataPlaneInfo) ApplySchemaCustomizations(attrs map[string]tfschema. // SDK values. func (a ModelDataPlaneInfo) GetComplexFieldTypes(ctx context.Context) map[string]reflect.Type { return map[string]reflect.Type{ - "query_info": reflect.TypeOf(oauth2_tf.DataPlaneInfo{}), + "query_info": reflect.TypeOf(DataPlaneInfo{}), } } @@ -3759,20 +3811,20 @@ func (o ModelDataPlaneInfo) ToObjectValue(ctx context.Context) basetypes.ObjectV func (o ModelDataPlaneInfo) Type(ctx context.Context) attr.Type { return types.ObjectType{ AttrTypes: map[string]attr.Type{ - "query_info": oauth2_tf.DataPlaneInfo{}.Type(ctx), + "query_info": DataPlaneInfo{}.Type(ctx), }, } } // GetQueryInfo returns the value of the QueryInfo field in ModelDataPlaneInfo as -// a oauth2_tf.DataPlaneInfo value. +// a DataPlaneInfo value. // If the field is unknown or null, the boolean return value is false. -func (o *ModelDataPlaneInfo) GetQueryInfo(ctx context.Context) (oauth2_tf.DataPlaneInfo, bool) { - var e oauth2_tf.DataPlaneInfo +func (o *ModelDataPlaneInfo) GetQueryInfo(ctx context.Context) (DataPlaneInfo, bool) { + var e DataPlaneInfo if o.QueryInfo.IsNull() || o.QueryInfo.IsUnknown() { return e, false } - var v []oauth2_tf.DataPlaneInfo + var v []DataPlaneInfo d := o.QueryInfo.As(ctx, &v, basetypes.ObjectAsOptions{ UnhandledNullAsEmpty: true, UnhandledUnknownAsEmpty: true, @@ -3787,7 +3839,7 @@ func (o *ModelDataPlaneInfo) GetQueryInfo(ctx context.Context) (oauth2_tf.DataPl } // SetQueryInfo sets the value of the QueryInfo field in ModelDataPlaneInfo. -func (o *ModelDataPlaneInfo) SetQueryInfo(ctx context.Context, v oauth2_tf.DataPlaneInfo) { +func (o *ModelDataPlaneInfo) SetQueryInfo(ctx context.Context, v DataPlaneInfo) { vs := v.ToObjectValue(ctx) o.QueryInfo = vs } diff --git a/internal/service/sharing_tf/legacy_model.go b/internal/service/sharing_tf/legacy_model.go index 872c8417a9..cc5070bf2e 100755 --- a/internal/service/sharing_tf/legacy_model.go +++ b/internal/service/sharing_tf/legacy_model.go @@ -2419,7 +2419,8 @@ type ShareInfo_SdkV2 struct { // A list of shared data objects within the share. Objects types.List `tfsdk:"object"` // Username of current owner of share. - Owner types.String `tfsdk:"owner"` + Owner types.String `tfsdk:"owner"` + EffectiveOwner types.String `tfsdk:"effective_owner"` // Storage Location URL (full path) for the share. StorageLocation types.String `tfsdk:"storage_location"` // Storage root URL for the share. @@ -2431,9 +2432,15 @@ type ShareInfo_SdkV2 struct { } func (newState *ShareInfo_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan ShareInfo_SdkV2) { + newState.EffectiveOwner = newState.Owner + newState.Owner = plan.Owner } func (newState *ShareInfo_SdkV2) SyncEffectiveFieldsDuringRead(existingState ShareInfo_SdkV2) { + newState.EffectiveOwner = existingState.EffectiveOwner + if existingState.EffectiveOwner.ValueString() == newState.Owner.ValueString() { + newState.Owner = existingState.Owner + } } func (c ShareInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { @@ -2442,7 +2449,8 @@ func (c ShareInfo_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.Att attrs["created_by"] = attrs["created_by"].SetComputed() attrs["name"] = attrs["name"].SetOptional() attrs["object"] = attrs["object"].SetOptional() - attrs["owner"] = attrs["owner"].SetComputed() + attrs["effective_owner"] = attrs["effective_owner"].SetComputed() + attrs["owner"] = attrs["owner"].SetOptional() attrs["storage_location"] = attrs["storage_location"].SetOptional() attrs["storage_root"] = attrs["storage_root"].SetOptional() attrs["updated_at"] = attrs["updated_at"].SetComputed() @@ -2477,6 +2485,7 @@ func (o ShareInfo_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectValu "name": o.Name, "object": o.Objects, "owner": o.Owner, + "effective_owner": o.EffectiveOwner, "storage_location": o.StorageLocation, "storage_root": o.StorageRoot, "updated_at": o.UpdatedAt, @@ -2496,6 +2505,7 @@ func (o ShareInfo_SdkV2) Type(ctx context.Context) attr.Type { ElemType: SharedDataObject_SdkV2{}.Type(ctx), }, "owner": types.StringType, + "effective_owner": types.StringType, "storage_location": types.StringType, "storage_root": types.StringType, "updated_at": types.Int64Type, @@ -3228,7 +3238,8 @@ type UpdateShare_SdkV2 struct { // New name for the share. NewName types.String `tfsdk:"new_name"` // Username of current owner of share. - Owner types.String `tfsdk:"owner"` + Owner types.String `tfsdk:"owner"` + EffectiveOwner types.String `tfsdk:"effective_owner"` // Storage root URL for the share. StorageRoot types.String `tfsdk:"storage_root"` // Array of shared data object updates. @@ -3236,16 +3247,23 @@ type UpdateShare_SdkV2 struct { } func (newState *UpdateShare_SdkV2) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateShare_SdkV2) { + newState.EffectiveOwner = newState.Owner + newState.Owner = plan.Owner } func (newState *UpdateShare_SdkV2) SyncEffectiveFieldsDuringRead(existingState UpdateShare_SdkV2) { + newState.EffectiveOwner = existingState.EffectiveOwner + if existingState.EffectiveOwner.ValueString() == newState.Owner.ValueString() { + newState.Owner = existingState.Owner + } } func (c UpdateShare_SdkV2) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { attrs["comment"] = attrs["comment"].SetOptional() attrs["name"] = attrs["name"].SetRequired() attrs["new_name"] = attrs["new_name"].SetOptional() - attrs["owner"] = attrs["owner"].SetComputed() + attrs["effective_owner"] = attrs["effective_owner"].SetComputed() + attrs["owner"] = attrs["owner"].SetOptional() attrs["storage_root"] = attrs["storage_root"].SetOptional() attrs["updates"] = attrs["updates"].SetOptional() @@ -3272,12 +3290,13 @@ func (o UpdateShare_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectVa return types.ObjectValueMust( o.Type(ctx).(basetypes.ObjectType).AttrTypes, map[string]attr.Value{ - "comment": o.Comment, - "name": o.Name, - "new_name": o.NewName, - "owner": o.Owner, - "storage_root": o.StorageRoot, - "updates": o.Updates, + "comment": o.Comment, + "name": o.Name, + "new_name": o.NewName, + "owner": o.Owner, + "effective_owner": o.EffectiveOwner, + "storage_root": o.StorageRoot, + "updates": o.Updates, }) } @@ -3285,11 +3304,12 @@ func (o UpdateShare_SdkV2) ToObjectValue(ctx context.Context) basetypes.ObjectVa func (o UpdateShare_SdkV2) Type(ctx context.Context) attr.Type { return types.ObjectType{ AttrTypes: map[string]attr.Type{ - "comment": types.StringType, - "name": types.StringType, - "new_name": types.StringType, - "owner": types.StringType, - "storage_root": types.StringType, + "comment": types.StringType, + "name": types.StringType, + "new_name": types.StringType, + "owner": types.StringType, + "effective_owner": types.StringType, + "storage_root": types.StringType, "updates": basetypes.ListType{ ElemType: SharedDataObjectUpdate_SdkV2{}.Type(ctx), }, diff --git a/internal/service/sharing_tf/model.go b/internal/service/sharing_tf/model.go index a521ca68be..4aaa0256f7 100755 --- a/internal/service/sharing_tf/model.go +++ b/internal/service/sharing_tf/model.go @@ -2413,7 +2413,8 @@ type ShareInfo struct { // A list of shared data objects within the share. Objects types.List `tfsdk:"object"` // Username of current owner of share. - Owner types.String `tfsdk:"owner"` + Owner types.String `tfsdk:"owner"` + EffectiveOwner types.String `tfsdk:"effective_owner"` // Storage Location URL (full path) for the share. StorageLocation types.String `tfsdk:"storage_location"` // Storage root URL for the share. @@ -2425,9 +2426,15 @@ type ShareInfo struct { } func (newState *ShareInfo) SyncEffectiveFieldsDuringCreateOrUpdate(plan ShareInfo) { + newState.EffectiveOwner = newState.Owner + newState.Owner = plan.Owner } func (newState *ShareInfo) SyncEffectiveFieldsDuringRead(existingState ShareInfo) { + newState.EffectiveOwner = existingState.EffectiveOwner + if existingState.EffectiveOwner.ValueString() == newState.Owner.ValueString() { + newState.Owner = existingState.Owner + } } func (c ShareInfo) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { @@ -2436,7 +2443,8 @@ func (c ShareInfo) ApplySchemaCustomizations(attrs map[string]tfschema.Attribute attrs["created_by"] = attrs["created_by"].SetComputed() attrs["name"] = attrs["name"].SetOptional() attrs["object"] = attrs["object"].SetOptional() - attrs["owner"] = attrs["owner"].SetComputed() + attrs["effective_owner"] = attrs["effective_owner"].SetComputed() + attrs["owner"] = attrs["owner"].SetOptional() attrs["storage_location"] = attrs["storage_location"].SetOptional() attrs["storage_root"] = attrs["storage_root"].SetOptional() attrs["updated_at"] = attrs["updated_at"].SetComputed() @@ -2471,6 +2479,7 @@ func (o ShareInfo) ToObjectValue(ctx context.Context) basetypes.ObjectValue { "name": o.Name, "object": o.Objects, "owner": o.Owner, + "effective_owner": o.EffectiveOwner, "storage_location": o.StorageLocation, "storage_root": o.StorageRoot, "updated_at": o.UpdatedAt, @@ -2490,6 +2499,7 @@ func (o ShareInfo) Type(ctx context.Context) attr.Type { ElemType: SharedDataObject{}.Type(ctx), }, "owner": types.StringType, + "effective_owner": types.StringType, "storage_location": types.StringType, "storage_root": types.StringType, "updated_at": types.Int64Type, @@ -3219,7 +3229,8 @@ type UpdateShare struct { // New name for the share. NewName types.String `tfsdk:"new_name"` // Username of current owner of share. - Owner types.String `tfsdk:"owner"` + Owner types.String `tfsdk:"owner"` + EffectiveOwner types.String `tfsdk:"effective_owner"` // Storage root URL for the share. StorageRoot types.String `tfsdk:"storage_root"` // Array of shared data object updates. @@ -3227,16 +3238,23 @@ type UpdateShare struct { } func (newState *UpdateShare) SyncEffectiveFieldsDuringCreateOrUpdate(plan UpdateShare) { + newState.EffectiveOwner = newState.Owner + newState.Owner = plan.Owner } func (newState *UpdateShare) SyncEffectiveFieldsDuringRead(existingState UpdateShare) { + newState.EffectiveOwner = existingState.EffectiveOwner + if existingState.EffectiveOwner.ValueString() == newState.Owner.ValueString() { + newState.Owner = existingState.Owner + } } func (c UpdateShare) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { attrs["comment"] = attrs["comment"].SetOptional() attrs["name"] = attrs["name"].SetRequired() attrs["new_name"] = attrs["new_name"].SetOptional() - attrs["owner"] = attrs["owner"].SetComputed() + attrs["effective_owner"] = attrs["effective_owner"].SetComputed() + attrs["owner"] = attrs["owner"].SetOptional() attrs["storage_root"] = attrs["storage_root"].SetOptional() attrs["updates"] = attrs["updates"].SetOptional() @@ -3263,12 +3281,13 @@ func (o UpdateShare) ToObjectValue(ctx context.Context) basetypes.ObjectValue { return types.ObjectValueMust( o.Type(ctx).(basetypes.ObjectType).AttrTypes, map[string]attr.Value{ - "comment": o.Comment, - "name": o.Name, - "new_name": o.NewName, - "owner": o.Owner, - "storage_root": o.StorageRoot, - "updates": o.Updates, + "comment": o.Comment, + "name": o.Name, + "new_name": o.NewName, + "owner": o.Owner, + "effective_owner": o.EffectiveOwner, + "storage_root": o.StorageRoot, + "updates": o.Updates, }) } @@ -3276,11 +3295,12 @@ func (o UpdateShare) ToObjectValue(ctx context.Context) basetypes.ObjectValue { func (o UpdateShare) Type(ctx context.Context) attr.Type { return types.ObjectType{ AttrTypes: map[string]attr.Type{ - "comment": types.StringType, - "name": types.StringType, - "new_name": types.StringType, - "owner": types.StringType, - "storage_root": types.StringType, + "comment": types.StringType, + "name": types.StringType, + "new_name": types.StringType, + "owner": types.StringType, + "effective_owner": types.StringType, + "storage_root": types.StringType, "updates": basetypes.ListType{ ElemType: SharedDataObjectUpdate{}.Type(ctx), }, diff --git a/qa/test_credentials_provider.go b/qa/test_credentials_provider.go index 9d5741d6a8..0df8a80f9d 100644 --- a/qa/test_credentials_provider.go +++ b/qa/test_credentials_provider.go @@ -6,7 +6,7 @@ import ( "net/http" "github.com/databricks/databricks-sdk-go/config" - "github.com/databricks/databricks-sdk-go/credentials" + "github.com/databricks/databricks-sdk-go/config/credentials" ) type testCredentialsProvider struct {