Skip to content

Commit

Permalink
refactor: separating live and vod source schemas due to schema incomp…
Browse files Browse the repository at this point in the history
…atibility
  • Loading branch information
isadoral committed Nov 27, 2023
1 parent 139e1c5 commit b58a2e6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions awsmt/data_source_vod_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ 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{
"id": computedString,
"arn": computedString,
"creation_time": computedString,
"id": computedString,
"source_location_name": requiredString,
"http_package_configurations": schema.ListNestedAttribute{
Computed: true,
NestedObject: schema.NestedAttributeObject{
Expand All @@ -47,10 +49,11 @@ func (d *dataSourceVodSource) Schema(_ context.Context, _ datasource.SchemaReque
},
},
},
"creation_time": computedString,
"tags": computedMap,
"last_modified_time": computedString,
"arn": computedString,
"name": requiredString,
"source_location_name": requiredString,
"tags": computedMap,
"ad_break_opportunities_offset_millis": computedMap,
},
}
Expand Down

0 comments on commit b58a2e6

Please sign in to comment.