Skip to content

Commit

Permalink
Mark the remaining objects as preview
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jmichalak committed Dec 12, 2024
1 parent 37b17e1 commit 27ee0b9
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 40 deletions.
10 changes: 10 additions & 0 deletions pkg/provider/previewfeatures/preview_features.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ const (
FailoverGroupsDatasource feature = "snowflake_failover_groups_datasource"
FileFormatResource feature = "snowflake_file_format_resource"
FileFormatsDatasource feature = "snowflake_file_formats_datasource"
FunctionJavaResource feature = "snowflake_function_java_resource"
FunctionJavascriptResource feature = "snowflake_function_javascript_resource"
FunctionPythonResource feature = "snowflake_function_python_resource"
FunctionScalaResource feature = "snowflake_function_scala_resource"
FunctionSqlResource feature = "snowflake_function_sql_resource"
FunctionsDatasource feature = "snowflake_functions_datasource"
ManagedAccountResource feature = "snowflake_managed_account_resource"
MaterializedViewResource feature = "snowflake_materialized_view_resource"
Expand All @@ -43,6 +48,11 @@ const (
PasswordPolicyResource feature = "snowflake_password_policy_resource"
PipeResource feature = "snowflake_pipe_resource"
PipesDatasource feature = "snowflake_pipes_datasource"
ProcedureJavaResource feature = "snowflake_procecure_java_resource"
ProcedureJavascriptResource feature = "snowflake_procecure_javascript_resource"
ProcedurePythonResource feature = "snowflake_procecure_python_resource"
ProcedureScalaResource feature = "snowflake_procecure_scala_resource"
ProcedureSqlResource feature = "snowflake_procecure_sql_resource"
ProceduresDatasource feature = "snowflake_procedures_datasource"
CurrentRoleDatasource feature = "snowflake_current_role_datasource"
SequenceResource feature = "snowflake_sequence_resource"
Expand Down
9 changes: 5 additions & 4 deletions pkg/resources/function_java.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/helpers"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/collections"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/provider"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/previewfeatures"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/resources"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/schemas"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk"
Expand All @@ -20,10 +21,10 @@ import (

func FunctionJava() *schema.Resource {
return &schema.Resource{
CreateContext: TrackingCreateWrapper(resources.FunctionJava, CreateContextFunctionJava),
ReadContext: TrackingReadWrapper(resources.FunctionJava, ReadContextFunctionJava),
UpdateContext: TrackingUpdateWrapper(resources.FunctionJava, UpdateFunction("JAVA", ReadContextFunctionJava)),
DeleteContext: TrackingDeleteWrapper(resources.FunctionJava, DeleteFunction),
CreateContext: PreviewFeatureCreateContextWrapper(string(previewfeatures.FunctionJavaResource), TrackingCreateWrapper(resources.FunctionJava, CreateContextFunctionJava)),
ReadContext: PreviewFeatureReadContextWrapper(string(previewfeatures.FunctionJavaResource), TrackingReadWrapper(resources.FunctionJava, ReadContextFunctionJava)),
UpdateContext: PreviewFeatureUpdateContextWrapper(string(previewfeatures.FunctionJavaResource), TrackingUpdateWrapper(resources.FunctionJava, UpdateFunction("JAVA", ReadContextFunctionJava))),
DeleteContext: PreviewFeatureDeleteContextWrapper(string(previewfeatures.FunctionJavaResource), TrackingDeleteWrapper(resources.FunctionJava, DeleteFunction)),
Description: "Resource used to manage java function objects. For more information, check [function documentation](https://docs.snowflake.com/en/sql-reference/sql/create-function).",

CustomizeDiff: TrackingCustomDiffWrapper(resources.FunctionJava, customdiff.All(
Expand Down
9 changes: 5 additions & 4 deletions pkg/resources/function_javascript.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/helpers"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/collections"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/provider"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/previewfeatures"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/resources"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/schemas"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk"
Expand All @@ -20,10 +21,10 @@ import (

func FunctionJavascript() *schema.Resource {
return &schema.Resource{
CreateContext: TrackingCreateWrapper(resources.FunctionJavascript, CreateContextFunctionJavascript),
ReadContext: TrackingReadWrapper(resources.FunctionJavascript, ReadContextFunctionJavascript),
UpdateContext: TrackingUpdateWrapper(resources.FunctionJavascript, UpdateFunction("JAVASCRIPT", ReadContextFunctionJavascript)),
DeleteContext: TrackingDeleteWrapper(resources.FunctionJavascript, DeleteFunction),
CreateContext: PreviewFeatureCreateContextWrapper(string(previewfeatures.FunctionJavascriptResource), TrackingCreateWrapper(resources.FunctionJavascript, CreateContextFunctionJavascript)),
ReadContext: PreviewFeatureReadContextWrapper(string(previewfeatures.FunctionJavascriptResource), TrackingReadWrapper(resources.FunctionJavascript, ReadContextFunctionJavascript)),
UpdateContext: PreviewFeatureUpdateContextWrapper(string(previewfeatures.FunctionJavascriptResource), TrackingUpdateWrapper(resources.FunctionJavascript, UpdateFunction("JAVASCRIPT", ReadContextFunctionJavascript))),
DeleteContext: PreviewFeatureDeleteContextWrapper(string(previewfeatures.FunctionJavascriptResource), TrackingDeleteWrapper(resources.FunctionJavascript, DeleteFunction)),
Description: "Resource used to manage javascript function objects. For more information, check [function documentation](https://docs.snowflake.com/en/sql-reference/sql/create-function).",

CustomizeDiff: TrackingCustomDiffWrapper(resources.FunctionJavascript, customdiff.All(
Expand Down
9 changes: 5 additions & 4 deletions pkg/resources/function_python.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/helpers"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/collections"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/provider"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/previewfeatures"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/resources"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/schemas"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk"
Expand All @@ -20,10 +21,10 @@ import (

func FunctionPython() *schema.Resource {
return &schema.Resource{
CreateContext: TrackingCreateWrapper(resources.FunctionPython, CreateContextFunctionPython),
ReadContext: TrackingReadWrapper(resources.FunctionPython, ReadContextFunctionPython),
UpdateContext: TrackingUpdateWrapper(resources.FunctionPython, UpdateFunction("PYTHON", ReadContextFunctionPython)),
DeleteContext: TrackingDeleteWrapper(resources.FunctionPython, DeleteFunction),
CreateContext: PreviewFeatureCreateContextWrapper(string(previewfeatures.FunctionPythonResource), TrackingCreateWrapper(resources.FunctionPython, CreateContextFunctionPython)),
ReadContext: PreviewFeatureReadContextWrapper(string(previewfeatures.FunctionPythonResource), TrackingReadWrapper(resources.FunctionPython, ReadContextFunctionPython)),
UpdateContext: PreviewFeatureUpdateContextWrapper(string(previewfeatures.FunctionPythonResource), TrackingUpdateWrapper(resources.FunctionPython, UpdateFunction("PYTHON", ReadContextFunctionPython))),
DeleteContext: PreviewFeatureDeleteContextWrapper(string(previewfeatures.FunctionPythonResource), TrackingDeleteWrapper(resources.FunctionPython, DeleteFunction)),
Description: "Resource used to manage python function objects. For more information, check [function documentation](https://docs.snowflake.com/en/sql-reference/sql/create-function).",

CustomizeDiff: TrackingCustomDiffWrapper(resources.FunctionPython, customdiff.All(
Expand Down
9 changes: 5 additions & 4 deletions pkg/resources/function_scala.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/helpers"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/collections"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/provider"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/previewfeatures"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/resources"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/schemas"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk"
Expand All @@ -20,10 +21,10 @@ import (

func FunctionScala() *schema.Resource {
return &schema.Resource{
CreateContext: TrackingCreateWrapper(resources.FunctionScala, CreateContextFunctionScala),
ReadContext: TrackingReadWrapper(resources.FunctionScala, ReadContextFunctionScala),
UpdateContext: TrackingUpdateWrapper(resources.FunctionScala, UpdateFunction("SCALA", ReadContextFunctionScala)),
DeleteContext: TrackingDeleteWrapper(resources.FunctionScala, DeleteFunction),
CreateContext: PreviewFeatureCreateContextWrapper(string(previewfeatures.FunctionScalaResource), TrackingCreateWrapper(resources.FunctionScala, CreateContextFunctionScala)),
ReadContext: PreviewFeatureReadContextWrapper(string(previewfeatures.FunctionScalaResource), TrackingReadWrapper(resources.FunctionScala, ReadContextFunctionScala)),
UpdateContext: PreviewFeatureUpdateContextWrapper(string(previewfeatures.FunctionScalaResource), TrackingUpdateWrapper(resources.FunctionScala, UpdateFunction("SCALA", ReadContextFunctionScala))),
DeleteContext: PreviewFeatureDeleteContextWrapper(string(previewfeatures.FunctionScalaResource), TrackingDeleteWrapper(resources.FunctionScala, DeleteFunction)),
Description: "Resource used to manage scala function objects. For more information, check [function documentation](https://docs.snowflake.com/en/sql-reference/sql/create-function).",

CustomizeDiff: TrackingCustomDiffWrapper(resources.FunctionScala, customdiff.All(
Expand Down
9 changes: 5 additions & 4 deletions pkg/resources/function_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/helpers"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/collections"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/provider"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/previewfeatures"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/resources"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/schemas"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk"
Expand All @@ -20,10 +21,10 @@ import (

func FunctionSql() *schema.Resource {
return &schema.Resource{
CreateContext: TrackingCreateWrapper(resources.FunctionSql, CreateContextFunctionSql),
ReadContext: TrackingReadWrapper(resources.FunctionSql, ReadContextFunctionSql),
UpdateContext: TrackingUpdateWrapper(resources.FunctionSql, UpdateFunction("SQL", ReadContextFunctionSql)),
DeleteContext: TrackingDeleteWrapper(resources.FunctionSql, DeleteFunction),
CreateContext: PreviewFeatureCreateContextWrapper(string(previewfeatures.FunctionSqlResource), TrackingCreateWrapper(resources.FunctionSql, CreateContextFunctionSql)),
ReadContext: PreviewFeatureReadContextWrapper(string(previewfeatures.FunctionSqlResource), TrackingReadWrapper(resources.FunctionSql, ReadContextFunctionSql)),
UpdateContext: PreviewFeatureUpdateContextWrapper(string(previewfeatures.FunctionSqlResource), TrackingUpdateWrapper(resources.FunctionSql, UpdateFunction("SQL", ReadContextFunctionSql))),
DeleteContext: PreviewFeatureDeleteContextWrapper(string(previewfeatures.FunctionSqlResource), TrackingDeleteWrapper(resources.FunctionSql, DeleteFunction)),
Description: "Resource used to manage sql function objects. For more information, check [function documentation](https://docs.snowflake.com/en/sql-reference/sql/create-function).",

CustomizeDiff: TrackingCustomDiffWrapper(resources.FunctionSql, customdiff.All(
Expand Down
9 changes: 5 additions & 4 deletions pkg/resources/procedure_java.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/helpers"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/collections"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/provider"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/previewfeatures"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/resources"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/schemas"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk"
Expand All @@ -21,10 +22,10 @@ import (

func ProcedureJava() *schema.Resource {
return &schema.Resource{
CreateContext: TrackingCreateWrapper(resources.ProcedureJava, CreateContextProcedureJava),
ReadContext: TrackingReadWrapper(resources.ProcedureJava, ReadContextProcedureJava),
UpdateContext: TrackingUpdateWrapper(resources.ProcedureJava, UpdateProcedure("JAVA", ReadContextProcedureJava)),
DeleteContext: TrackingDeleteWrapper(resources.ProcedureJava, DeleteProcedure),
CreateContext: PreviewFeatureCreateContextWrapper(string(previewfeatures.ProcedureJavaResource), TrackingCreateWrapper(resources.ProcedureJava, CreateContextProcedureJava)),
ReadContext: PreviewFeatureReadContextWrapper(string(previewfeatures.ProcedureJavaResource), TrackingReadWrapper(resources.ProcedureJava, ReadContextProcedureJava)),
UpdateContext: PreviewFeatureUpdateContextWrapper(string(previewfeatures.ProcedureJavaResource), TrackingUpdateWrapper(resources.ProcedureJava, UpdateProcedure("JAVA", ReadContextProcedureJava))),
DeleteContext: PreviewFeatureDeleteContextWrapper(string(previewfeatures.ProcedureJavaResource), TrackingDeleteWrapper(resources.ProcedureJava, DeleteProcedure)),
Description: "Resource used to manage java procedure objects. For more information, check [procedure documentation](https://docs.snowflake.com/en/sql-reference/sql/create-procedure).",

CustomizeDiff: TrackingCustomDiffWrapper(resources.ProcedureJava, customdiff.All(
Expand Down
9 changes: 5 additions & 4 deletions pkg/resources/procedure_javascript.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/helpers"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/collections"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/provider"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/previewfeatures"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/resources"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/schemas"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk"
Expand All @@ -20,10 +21,10 @@ import (

func ProcedureJavascript() *schema.Resource {
return &schema.Resource{
CreateContext: TrackingCreateWrapper(resources.ProcedureJavascript, CreateContextProcedureJavascript),
ReadContext: TrackingReadWrapper(resources.ProcedureJavascript, ReadContextProcedureJavascript),
UpdateContext: TrackingUpdateWrapper(resources.ProcedureJavascript, UpdateProcedure("JAVASCRIPT", ReadContextProcedureJavascript)),
DeleteContext: TrackingDeleteWrapper(resources.ProcedureJavascript, DeleteProcedure),
CreateContext: PreviewFeatureCreateContextWrapper(string(previewfeatures.ProcedureJavascriptResource), TrackingCreateWrapper(resources.ProcedureJavascript, CreateContextProcedureJavascript)),
ReadContext: PreviewFeatureReadContextWrapper(string(previewfeatures.ProcedureJavascriptResource), TrackingReadWrapper(resources.ProcedureJavascript, ReadContextProcedureJavascript)),
UpdateContext: PreviewFeatureUpdateContextWrapper(string(previewfeatures.ProcedureJavascriptResource), TrackingUpdateWrapper(resources.ProcedureJavascript, UpdateProcedure("JAVASCRIPT", ReadContextProcedureJavascript))),
DeleteContext: PreviewFeatureDeleteContextWrapper(string(previewfeatures.ProcedureJavascriptResource), TrackingDeleteWrapper(resources.ProcedureJavascript, DeleteProcedure)),
Description: "Resource used to manage javascript procedure objects. For more information, check [procedure documentation](https://docs.snowflake.com/en/sql-reference/sql/create-procedure).",

CustomizeDiff: TrackingCustomDiffWrapper(resources.ProcedureJavascript, customdiff.All(
Expand Down
9 changes: 5 additions & 4 deletions pkg/resources/procedure_python.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/helpers"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/collections"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/provider"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/previewfeatures"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/resources"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/schemas"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk"
Expand All @@ -21,10 +22,10 @@ import (

func ProcedurePython() *schema.Resource {
return &schema.Resource{
CreateContext: TrackingCreateWrapper(resources.ProcedurePython, CreateContextProcedurePython),
ReadContext: TrackingReadWrapper(resources.ProcedurePython, ReadContextProcedurePython),
UpdateContext: TrackingUpdateWrapper(resources.ProcedurePython, UpdateProcedure("PYTHON", ReadContextProcedurePython)),
DeleteContext: TrackingDeleteWrapper(resources.ProcedurePython, DeleteProcedure),
CreateContext: PreviewFeatureCreateContextWrapper(string(previewfeatures.ProcedurePythonResource), TrackingCreateWrapper(resources.ProcedurePython, CreateContextProcedurePython)),
ReadContext: PreviewFeatureReadContextWrapper(string(previewfeatures.ProcedurePythonResource), TrackingReadWrapper(resources.ProcedurePython, ReadContextProcedurePython)),
UpdateContext: PreviewFeatureUpdateContextWrapper(string(previewfeatures.ProcedurePythonResource), TrackingUpdateWrapper(resources.ProcedurePython, UpdateProcedure("PYTHON", ReadContextProcedurePython))),
DeleteContext: PreviewFeatureDeleteContextWrapper(string(previewfeatures.ProcedurePythonResource), TrackingDeleteWrapper(resources.ProcedurePython, DeleteProcedure)),
Description: "Resource used to manage python procedure objects. For more information, check [procedure documentation](https://docs.snowflake.com/en/sql-reference/sql/create-procedure).",

CustomizeDiff: TrackingCustomDiffWrapper(resources.ProcedurePython, customdiff.All(
Expand Down
Loading

0 comments on commit 27ee0b9

Please sign in to comment.