Skip to content

Commit

Permalink
Upgraded to TF provider 1.61.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnester committed Dec 13, 2024
1 parent 61b0c59 commit ef0a820
Show file tree
Hide file tree
Showing 20 changed files with 153 additions and 378 deletions.
10 changes: 7 additions & 3 deletions bundle/internal/tf/codegen/generator/walker.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package generator

import (
"fmt"
"strings"

"slices"
"strings"

tfjson "github.com/hashicorp/terraform-json"
"github.com/iancoleman/strcase"
Expand Down Expand Up @@ -92,7 +91,12 @@ func (w *walker) walk(block *tfjson.SchemaBlock, name []string) error {

// Assert the attribute type is always set.
if v.AttributeType == cty.NilType {
return fmt.Errorf("unexpected nil type for attribute %s", k)
// If the attribute is a nested type, the type is an object.
if v.AttributeNestedType != nil {
v.AttributeType = cty.Object(map[string]cty.Type{})
} else {
return fmt.Errorf("unexpected nil type for attribute %s", k)
}
}

// Collect field properties.
Expand Down
2 changes: 1 addition & 1 deletion bundle/internal/tf/codegen/schema/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package schema

const ProviderVersion = "1.59.0"
const ProviderVersion = "1.61.0"
8 changes: 8 additions & 0 deletions bundle/internal/tf/schema/data_source_app.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Generated from Databricks Terraform provider schema. DO NOT EDIT.

package schema

type DataSourceApp struct {
App any `json:"app,omitempty"`
Name string `json:"name"`
}
7 changes: 7 additions & 0 deletions bundle/internal/tf/schema/data_source_apps.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Generated from Databricks Terraform provider schema. DO NOT EDIT.

package schema

type DataSourceApps struct {
App any `json:"app,omitempty"`
}
96 changes: 4 additions & 92 deletions bundle/internal/tf/schema/data_source_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,97 +2,9 @@

package schema

type DataSourceFunctionsFunctionsInputParamsParameters struct {
Comment string `json:"comment,omitempty"`
Name string `json:"name"`
ParameterDefault string `json:"parameter_default,omitempty"`
ParameterMode string `json:"parameter_mode,omitempty"`
ParameterType string `json:"parameter_type,omitempty"`
Position int `json:"position"`
TypeIntervalType string `json:"type_interval_type,omitempty"`
TypeJson string `json:"type_json,omitempty"`
TypeName string `json:"type_name"`
TypePrecision int `json:"type_precision,omitempty"`
TypeScale int `json:"type_scale,omitempty"`
TypeText string `json:"type_text"`
}

type DataSourceFunctionsFunctionsInputParams struct {
Parameters []DataSourceFunctionsFunctionsInputParamsParameters `json:"parameters,omitempty"`
}

type DataSourceFunctionsFunctionsReturnParamsParameters struct {
Comment string `json:"comment,omitempty"`
Name string `json:"name"`
ParameterDefault string `json:"parameter_default,omitempty"`
ParameterMode string `json:"parameter_mode,omitempty"`
ParameterType string `json:"parameter_type,omitempty"`
Position int `json:"position"`
TypeIntervalType string `json:"type_interval_type,omitempty"`
TypeJson string `json:"type_json,omitempty"`
TypeName string `json:"type_name"`
TypePrecision int `json:"type_precision,omitempty"`
TypeScale int `json:"type_scale,omitempty"`
TypeText string `json:"type_text"`
}

type DataSourceFunctionsFunctionsReturnParams struct {
Parameters []DataSourceFunctionsFunctionsReturnParamsParameters `json:"parameters,omitempty"`
}

type DataSourceFunctionsFunctionsRoutineDependenciesDependenciesFunction struct {
FunctionFullName string `json:"function_full_name"`
}

type DataSourceFunctionsFunctionsRoutineDependenciesDependenciesTable struct {
TableFullName string `json:"table_full_name"`
}

type DataSourceFunctionsFunctionsRoutineDependenciesDependencies struct {
Function []DataSourceFunctionsFunctionsRoutineDependenciesDependenciesFunction `json:"function,omitempty"`
Table []DataSourceFunctionsFunctionsRoutineDependenciesDependenciesTable `json:"table,omitempty"`
}

type DataSourceFunctionsFunctionsRoutineDependencies struct {
Dependencies []DataSourceFunctionsFunctionsRoutineDependenciesDependencies `json:"dependencies,omitempty"`
}

type DataSourceFunctionsFunctions struct {
BrowseOnly bool `json:"browse_only,omitempty"`
CatalogName string `json:"catalog_name,omitempty"`
Comment string `json:"comment,omitempty"`
CreatedAt int `json:"created_at,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
DataType string `json:"data_type,omitempty"`
ExternalLanguage string `json:"external_language,omitempty"`
ExternalName string `json:"external_name,omitempty"`
FullDataType string `json:"full_data_type,omitempty"`
FullName string `json:"full_name,omitempty"`
FunctionId string `json:"function_id,omitempty"`
IsDeterministic bool `json:"is_deterministic,omitempty"`
IsNullCall bool `json:"is_null_call,omitempty"`
MetastoreId string `json:"metastore_id,omitempty"`
Name string `json:"name,omitempty"`
Owner string `json:"owner,omitempty"`
ParameterStyle string `json:"parameter_style,omitempty"`
Properties string `json:"properties,omitempty"`
RoutineBody string `json:"routine_body,omitempty"`
RoutineDefinition string `json:"routine_definition,omitempty"`
SchemaName string `json:"schema_name,omitempty"`
SecurityType string `json:"security_type,omitempty"`
SpecificName string `json:"specific_name,omitempty"`
SqlDataAccess string `json:"sql_data_access,omitempty"`
SqlPath string `json:"sql_path,omitempty"`
UpdatedAt int `json:"updated_at,omitempty"`
UpdatedBy string `json:"updated_by,omitempty"`
InputParams []DataSourceFunctionsFunctionsInputParams `json:"input_params,omitempty"`
ReturnParams []DataSourceFunctionsFunctionsReturnParams `json:"return_params,omitempty"`
RoutineDependencies []DataSourceFunctionsFunctionsRoutineDependencies `json:"routine_dependencies,omitempty"`
}

type DataSourceFunctions struct {
CatalogName string `json:"catalog_name"`
IncludeBrowse bool `json:"include_browse,omitempty"`
SchemaName string `json:"schema_name"`
Functions []DataSourceFunctionsFunctions `json:"functions,omitempty"`
CatalogName string `json:"catalog_name"`
Functions any `json:"functions,omitempty"`
IncludeBrowse bool `json:"include_browse,omitempty"`
SchemaName string `json:"schema_name"`
}
5 changes: 3 additions & 2 deletions bundle/internal/tf/schema/data_source_jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package schema

type DataSourceJobs struct {
Id string `json:"id,omitempty"`
Ids map[string]string `json:"ids,omitempty"`
Id string `json:"id,omitempty"`
Ids map[string]string `json:"ids,omitempty"`
JobNameContains string `json:"job_name_contains,omitempty"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@

package schema

type DataSourceNotificationDestinationsNotificationDestinations struct {
DestinationType string `json:"destination_type,omitempty"`
DisplayName string `json:"display_name,omitempty"`
Id string `json:"id,omitempty"`
}

type DataSourceNotificationDestinations struct {
DisplayNameContains string `json:"display_name_contains,omitempty"`
Type string `json:"type,omitempty"`
NotificationDestinations []DataSourceNotificationDestinationsNotificationDestinations `json:"notification_destinations,omitempty"`
DisplayNameContains string `json:"display_name_contains,omitempty"`
NotificationDestinations any `json:"notification_destinations,omitempty"`
Type string `json:"type,omitempty"`
}
30 changes: 4 additions & 26 deletions bundle/internal/tf/schema/data_source_registered_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,9 @@

package schema

type DataSourceRegisteredModelModelInfoAliases struct {
AliasName string `json:"alias_name,omitempty"`
VersionNum int `json:"version_num,omitempty"`
}

type DataSourceRegisteredModelModelInfo struct {
BrowseOnly bool `json:"browse_only,omitempty"`
CatalogName string `json:"catalog_name,omitempty"`
Comment string `json:"comment,omitempty"`
CreatedAt int `json:"created_at,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
FullName string `json:"full_name,omitempty"`
MetastoreId string `json:"metastore_id,omitempty"`
Name string `json:"name,omitempty"`
Owner string `json:"owner,omitempty"`
SchemaName string `json:"schema_name,omitempty"`
StorageLocation string `json:"storage_location,omitempty"`
UpdatedAt int `json:"updated_at,omitempty"`
UpdatedBy string `json:"updated_by,omitempty"`
Aliases []DataSourceRegisteredModelModelInfoAliases `json:"aliases,omitempty"`
}

type DataSourceRegisteredModel struct {
FullName string `json:"full_name"`
IncludeAliases bool `json:"include_aliases,omitempty"`
IncludeBrowse bool `json:"include_browse,omitempty"`
ModelInfo []DataSourceRegisteredModelModelInfo `json:"model_info,omitempty"`
FullName string `json:"full_name"`
IncludeAliases bool `json:"include_aliases,omitempty"`
IncludeBrowse bool `json:"include_browse,omitempty"`
ModelInfo any `json:"model_info,omitempty"`
}
48 changes: 2 additions & 46 deletions bundle/internal/tf/schema/data_source_registered_model_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,7 @@

package schema

type DataSourceRegisteredModelVersionsModelVersionsAliases struct {
AliasName string `json:"alias_name,omitempty"`
VersionNum int `json:"version_num,omitempty"`
}

type DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependenciesFunction struct {
FunctionFullName string `json:"function_full_name"`
}

type DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependenciesTable struct {
TableFullName string `json:"table_full_name"`
}

type DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependencies struct {
Function []DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependenciesFunction `json:"function,omitempty"`
Table []DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependenciesTable `json:"table,omitempty"`
}

type DataSourceRegisteredModelVersionsModelVersionsModelVersionDependencies struct {
Dependencies []DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependencies `json:"dependencies,omitempty"`
}

type DataSourceRegisteredModelVersionsModelVersions struct {
BrowseOnly bool `json:"browse_only,omitempty"`
CatalogName string `json:"catalog_name,omitempty"`
Comment string `json:"comment,omitempty"`
CreatedAt int `json:"created_at,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
Id string `json:"id,omitempty"`
MetastoreId string `json:"metastore_id,omitempty"`
ModelName string `json:"model_name,omitempty"`
RunId string `json:"run_id,omitempty"`
RunWorkspaceId int `json:"run_workspace_id,omitempty"`
SchemaName string `json:"schema_name,omitempty"`
Source string `json:"source,omitempty"`
Status string `json:"status,omitempty"`
StorageLocation string `json:"storage_location,omitempty"`
UpdatedAt int `json:"updated_at,omitempty"`
UpdatedBy string `json:"updated_by,omitempty"`
Version int `json:"version,omitempty"`
Aliases []DataSourceRegisteredModelVersionsModelVersionsAliases `json:"aliases,omitempty"`
ModelVersionDependencies []DataSourceRegisteredModelVersionsModelVersionsModelVersionDependencies `json:"model_version_dependencies,omitempty"`
}

type DataSourceRegisteredModelVersions struct {
FullName string `json:"full_name"`
ModelVersions []DataSourceRegisteredModelVersionsModelVersions `json:"model_versions,omitempty"`
FullName string `json:"full_name"`
ModelVersions any `json:"model_versions,omitempty"`
}
Loading

0 comments on commit ef0a820

Please sign in to comment.