Skip to content

Commit

Permalink
fix: vod source data source ad_break_opportunities_offset_millis type
Browse files Browse the repository at this point in the history
OTT-6230
  • Loading branch information
thatsddr committed Jul 13, 2024
1 parent b24abaf commit 85ca571
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion awsmt/data_source_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (d *dataSourceChannel) Schema(_ context.Context, _ datasource.SchemaRequest
"hls_playlist_settings": schema.SingleNestedAttribute{
Computed: true,
Attributes: map[string]schema.Attribute{
"ad_markup_type": computedList,
"ad_markup_type": computedStringList,
"manifest_window_seconds": computedInt64,
},
},
Expand Down
5 changes: 1 addition & 4 deletions awsmt/data_source_vod_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ func (d *dataSourceVodSource) Metadata(_ context.Context, req datasource.Metadat
resp.TypeName = req.ProviderTypeName + "_vod_source"
}

// @ADR
// Context: The schemas for the VOD Source and the LIVE source are almost identical, except for one field.
// Decision: We decided to make the duplication undetectable for SonarCloud
func (d *dataSourceVodSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
resp.Schema = schema.Schema{
Attributes: map[string]schema.Attribute{
Expand All @@ -38,7 +35,7 @@ func (d *dataSourceVodSource) Schema(_ context.Context, _ datasource.SchemaReque
"last_modified_time": computedString,
"arn": computedString,
"name": requiredString,
"ad_break_opportunities_offset_millis": computedMap,
"ad_break_opportunities_offset_millis": computedInt64List,
},
}
}
Expand Down
7 changes: 6 additions & 1 deletion awsmt/schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ var computedMap = schema.MapAttribute{
ElementType: types.StringType,
}

var computedList = schema.ListAttribute{
var computedStringList = schema.ListAttribute{
Computed: true,
ElementType: types.StringType,
}

var computedInt64List = schema.ListAttribute{
Computed: true,
ElementType: types.Int64Type,
}

var computedBool = schema.BoolAttribute{
Computed: true,
}
Expand Down

0 comments on commit 85ca571

Please sign in to comment.