diff --git a/internal/providers/pluginfw/products/app/data_app.go b/internal/providers/pluginfw/products/app/data_app.go index d93b0cb42..2d36537fa 100644 --- a/internal/providers/pluginfw/products/app/data_app.go +++ b/internal/providers/pluginfw/products/app/data_app.go @@ -24,8 +24,15 @@ type dataSourceApp struct { } type dataApp struct { - Name types.String `tfsdk:"name" tf:"required"` - App types.Object `tfsdk:"app" tf:"computed"` + Name types.String `tfsdk:"name"` + App types.Object `tfsdk:"app"` +} + +func (dataApp) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["name"] = attrs["name"].SetRequired() + attrs["app"] = attrs["app"].SetComputed() + + return attrs } func (dataApp) GetComplexFieldTypes(context.Context) map[string]reflect.Type { diff --git a/internal/providers/pluginfw/products/catalog/data_functions.go b/internal/providers/pluginfw/products/catalog/data_functions.go index 4ce99e5b5..d7fa94457 100644 --- a/internal/providers/pluginfw/products/catalog/data_functions.go +++ b/internal/providers/pluginfw/products/catalog/data_functions.go @@ -32,10 +32,19 @@ type FunctionsDataSource struct { } type FunctionsData struct { - CatalogName types.String `tfsdk:"catalog_name" tf:"required"` - SchemaName types.String `tfsdk:"schema_name" tf:"required"` - IncludeBrowse types.Bool `tfsdk:"include_browse" tf:"optional"` - Functions types.List `tfsdk:"functions" tf:"optional,computed"` + CatalogName types.String `tfsdk:"catalog_name"` + SchemaName types.String `tfsdk:"schema_name"` + IncludeBrowse types.Bool `tfsdk:"include_browse"` + Functions types.List `tfsdk:"functions"` +} + +func (FunctionsData) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetRequired() + attrs["schema_name"] = attrs["schema_name"].SetRequired() + attrs["include_browse"] = attrs["include_browse"].SetOptional() + attrs["functions"] = attrs["functions"].SetOptional().SetComputed() + + return attrs } func (FunctionsData) GetComplexFieldTypes(context.Context) map[string]reflect.Type { diff --git a/internal/providers/pluginfw/products/registered_model/data_registered_model.go b/internal/providers/pluginfw/products/registered_model/data_registered_model.go index 02b808b84..6dd8257b7 100644 --- a/internal/providers/pluginfw/products/registered_model/data_registered_model.go +++ b/internal/providers/pluginfw/products/registered_model/data_registered_model.go @@ -34,10 +34,18 @@ type RegisteredModelDataSource struct { } type RegisteredModelData struct { - FullName types.String `tfsdk:"full_name" tf:"required"` - IncludeAliases types.Bool `tfsdk:"include_aliases" tf:"optional"` - IncludeBrowse types.Bool `tfsdk:"include_browse" tf:"optional"` - ModelInfo types.List `tfsdk:"model_info" tf:"optional,computed"` + FullName types.String `tfsdk:"full_name"` + IncludeAliases types.Bool `tfsdk:"include_aliases"` + IncludeBrowse types.Bool `tfsdk:"include_browse"` + ModelInfo types.List `tfsdk:"model_info"` +} + +func (RegisteredModelData) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["full_name"] = attrs["full_name"].SetRequired() + attrs["include_aliases"] = attrs["include_aliases"].SetOptional() + attrs["include_browse"] = attrs["include_browse"].SetOptional() + attrs["model_info"] = attrs["model_info"].SetOptional().SetComputed() + return attrs } func (RegisteredModelData) GetComplexFieldTypes(context.Context) map[string]reflect.Type { diff --git a/internal/providers/pluginfw/products/registered_model/data_registered_model_versions.go b/internal/providers/pluginfw/products/registered_model/data_registered_model_versions.go index febc5152e..3d17b589a 100644 --- a/internal/providers/pluginfw/products/registered_model/data_registered_model_versions.go +++ b/internal/providers/pluginfw/products/registered_model/data_registered_model_versions.go @@ -27,8 +27,14 @@ type RegisteredModelVersionsDataSource struct { } type RegisteredModelVersionsData struct { - FullName types.String `tfsdk:"full_name" tf:"required"` - ModelVersions types.List `tfsdk:"model_versions" tf:"optional,computed"` + FullName types.String `tfsdk:"full_name"` + ModelVersions types.List `tfsdk:"model_versions"` +} + +func (RegisteredModelVersionsData) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["full_name"] = attrs["full_name"].SetRequired() + attrs["model_versions"] = attrs["model_versions"].SetOptional().SetComputed() + return attrs } func (RegisteredModelVersionsData) GetComplexFieldTypes(context.Context) map[string]reflect.Type { diff --git a/internal/providers/pluginfw/products/volume/data_volumes.go b/internal/providers/pluginfw/products/volume/data_volumes.go index 64593ecb2..e5772cce4 100644 --- a/internal/providers/pluginfw/products/volume/data_volumes.go +++ b/internal/providers/pluginfw/products/volume/data_volumes.go @@ -31,9 +31,16 @@ type VolumesDataSource struct { } type VolumesList struct { - CatalogName types.String `tfsdk:"catalog_name" tf:"required"` - SchemaName types.String `tfsdk:"schema_name" tf:"required"` - Ids types.List `tfsdk:"ids" tf:"optional,computed"` + CatalogName types.String `tfsdk:"catalog_name"` + SchemaName types.String `tfsdk:"schema_name"` + Ids types.List `tfsdk:"ids"` +} + +func (VolumesList) ApplySchemaCustomizations(attrs map[string]tfschema.AttributeBuilder) map[string]tfschema.AttributeBuilder { + attrs["catalog_name"] = attrs["catalog_name"].SetRequired() + attrs["schema_name"] = attrs["schema_name"].SetRequired() + attrs["ids"] = attrs["ids"].SetOptional().SetComputed() + return attrs } func (VolumesList) GetComplexFieldTypes(context.Context) map[string]reflect.Type {