Skip to content

Commit

Permalink
chore: improve variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
thatsddr committed May 27, 2022
1 parent d8eb0c5 commit 96840ad
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions awsmt/source_location_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,26 +128,26 @@ func getSegmentDeliveryConfigurations(d *schema.ResourceData) []*mediatailor.Seg
}

func getCreateSourceLocationInput(d *schema.ResourceData) mediatailor.CreateSourceLocationInput {
var params mediatailor.CreateSourceLocationInput
var inputParams mediatailor.CreateSourceLocationInput

if a := getAccessConfiguration(d); a != nil {
params.AccessConfiguration = a
inputParams.AccessConfiguration = a
}

if v, ok := d.GetOk("default_segment_delivery_configuration_url"); ok {
params.DefaultSegmentDeliveryConfiguration = &mediatailor.DefaultSegmentDeliveryConfiguration{BaseUrl: aws.String(v.(string))}
inputParams.DefaultSegmentDeliveryConfiguration = &mediatailor.DefaultSegmentDeliveryConfiguration{BaseUrl: aws.String(v.(string))}
}

if v, ok := d.GetOk("http_configuration_url"); ok {
params.HttpConfiguration = &mediatailor.HttpConfiguration{BaseUrl: aws.String(v.(string))}
inputParams.HttpConfiguration = &mediatailor.HttpConfiguration{BaseUrl: aws.String(v.(string))}
}

if s := getSegmentDeliveryConfigurations(d); s != nil {
params.SegmentDeliveryConfigurations = s
inputParams.SegmentDeliveryConfigurations = s
}

if v, ok := d.GetOk("source_location_name"); ok {
params.SourceLocationName = aws.String(v.(string))
inputParams.SourceLocationName = aws.String(v.(string))
}

outputMap := make(map[string]*string)
Expand All @@ -158,34 +158,34 @@ func getCreateSourceLocationInput(d *schema.ResourceData) mediatailor.CreateSour
outputMap[k] = &temp
}
}
params.Tags = outputMap
inputParams.Tags = outputMap

return params
return inputParams

}

func getUpdateSourceLocationInput(d *schema.ResourceData) mediatailor.UpdateSourceLocationInput {
var params mediatailor.UpdateSourceLocationInput
var updateParams mediatailor.UpdateSourceLocationInput

if a := getAccessConfiguration(d); a != nil {
params.AccessConfiguration = a
updateParams.AccessConfiguration = a
}

if v, ok := d.GetOk("default_segment_delivery_configuration_url"); ok {
params.DefaultSegmentDeliveryConfiguration = &mediatailor.DefaultSegmentDeliveryConfiguration{BaseUrl: aws.String(v.(string))}
updateParams.DefaultSegmentDeliveryConfiguration = &mediatailor.DefaultSegmentDeliveryConfiguration{BaseUrl: aws.String(v.(string))}
}

if v, ok := d.GetOk("http_configuration_url"); ok {
params.HttpConfiguration = &mediatailor.HttpConfiguration{BaseUrl: aws.String(v.(string))}
updateParams.HttpConfiguration = &mediatailor.HttpConfiguration{BaseUrl: aws.String(v.(string))}
}

if s := getSegmentDeliveryConfigurations(d); s != nil {
params.SegmentDeliveryConfigurations = s
updateParams.SegmentDeliveryConfigurations = s
}

if v, ok := d.GetOk("source_location_name"); ok {
params.SourceLocationName = aws.String(v.(string))
updateParams.SourceLocationName = aws.String(v.(string))
}

return params
return updateParams
}

0 comments on commit 96840ad

Please sign in to comment.