Skip to content

Commit

Permalink
Merge branch 'main' into driver-for-snowflake-mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
u110 authored Feb 23, 2025
2 parents 82b14bb + 05511c5 commit 188a916
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions internal/provider/bigquery_datamart_definition_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"strconv"

"terraform-provider-trocco/internal/client"
troccoModel "terraform-provider-trocco/internal/provider/model"
troccoPlanModifier "terraform-provider-trocco/internal/provider/planmodifier"
troccoValidator "terraform-provider-trocco/internal/provider/validator"

Expand Down Expand Up @@ -54,7 +53,7 @@ type bigqueryDatamartDefinitionModel struct {
Location types.String `tfsdk:"location"`
Notifications []datamartNotificationModel `tfsdk:"notifications"`
Schedules []scheduleModel `tfsdk:"schedules"`
Labels []troccoModel.LabelModel `tfsdk:"labels"`
Labels []labelModel `tfsdk:"labels"`
}

type customVariableSettingModel struct {
Expand Down Expand Up @@ -88,6 +87,11 @@ type scheduleModel struct {
TimeZone types.String `tfsdk:"time_zone"`
}

type labelModel struct {
ID types.Int64 `tfsdk:"id"`
Name types.String `tfsdk:"name"`
}

func (r *bigqueryDatamartDefinitionResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
resp.TypeName = req.ProviderTypeName + "_bigquery_datamart_definition"
}
Expand Down Expand Up @@ -1009,9 +1013,9 @@ func parseToBigqueryDatamartDefinitionModel(response client.DatamartDefinition)
model.Schedules = schedules
}
if response.Labels != nil {
labels := make([]troccoModel.LabelModel, len(response.Labels))
labels := make([]labelModel, len(response.Labels))
for i, v := range response.Labels {
labels[i] = troccoModel.LabelModel{
labels[i] = labelModel{
ID: types.Int64Value(v.ID),
Name: types.StringValue(v.Name),
}
Expand Down

0 comments on commit 188a916

Please sign in to comment.