diff --git a/awsmt/helpers_common.go b/awsmt/helpers_common.go index e6da88a..d18165e 100644 --- a/awsmt/helpers_common.go +++ b/awsmt/helpers_common.go @@ -9,7 +9,7 @@ import ( "strings" ) -func v2Untag(client *mediatailorV2.Client, oldTags map[string]string, resourceArn string) error { +func untag(client *mediatailorV2.Client, oldTags map[string]string, resourceArn string) error { var removeTags []string for k := range oldTags { removeTags = append(removeTags, k) @@ -23,7 +23,7 @@ func v2Untag(client *mediatailorV2.Client, oldTags map[string]string, resourceAr return nil } -func v2Tag(client *mediatailorV2.Client, newTags map[string]string, resourceArn string) error { +func tag(client *mediatailorV2.Client, newTags map[string]string, resourceArn string) error { if len(newTags) == 0 { return nil } @@ -33,12 +33,12 @@ func v2Tag(client *mediatailorV2.Client, newTags map[string]string, resourceArn return nil } -func V2UpdatesTags(client *mediatailorV2.Client, oldTags map[string]string, newTags map[string]string, resourceArn string) error { +func UpdatesTags(client *mediatailorV2.Client, oldTags map[string]string, newTags map[string]string, resourceArn string) error { if !tagsEqual(oldTags, newTags) { - if err := v2Untag(client, oldTags, resourceArn); err != nil { + if err := untag(client, oldTags, resourceArn); err != nil { return err } - if err := v2Tag(client, newTags, resourceArn); err != nil { + if err := tag(client, newTags, resourceArn); err != nil { return err } } diff --git a/awsmt/resource_channel.go b/awsmt/resource_channel.go index 29124e0..954a688 100644 --- a/awsmt/resource_channel.go +++ b/awsmt/resource_channel.go @@ -223,7 +223,7 @@ func (r *resourceChannel) Update(ctx context.Context, req resource.UpdateRequest ) } - err = V2UpdatesTags(r.client, channel.Tags, plan.Tags, *channel.Arn) + err = UpdatesTags(r.client, channel.Tags, plan.Tags, *channel.Arn) if err != nil { resp.Diagnostics.AddError( "Error while updating channel tags"+err.Error(), diff --git a/awsmt/resource_live_source.go b/awsmt/resource_live_source.go index fe73179..1ba1cd1 100644 --- a/awsmt/resource_live_source.go +++ b/awsmt/resource_live_source.go @@ -127,7 +127,7 @@ func (r *resourceLiveSource) Update(ctx context.Context, req resource.UpdateRequ } // Update tags - err = V2UpdatesTags(r.client, liveSource.Tags, plan.Tags, *liveSource.Arn) + err = UpdatesTags(r.client, liveSource.Tags, plan.Tags, *liveSource.Arn) if err != nil { resp.Diagnostics.AddError( "Error while updating live source tags"+err.Error(), diff --git a/awsmt/resource_playback_configuration.go b/awsmt/resource_playback_configuration.go index 0eab18a..99b9367 100644 --- a/awsmt/resource_playback_configuration.go +++ b/awsmt/resource_playback_configuration.go @@ -241,7 +241,7 @@ func (r *resourcePlaybackConfiguration) Update(ctx context.Context, req resource // the PutPlaybackConfiguration method to add and update tags. We use this approach for every resource in the provider. // Consequences: The Update function logic is now more complicated, but tag removal is supported. - err = V2UpdatesTags(r.client, playbackConfiguration.Tags, plan.Tags, *playbackConfiguration.PlaybackConfigurationArn) + err = UpdatesTags(r.client, playbackConfiguration.Tags, plan.Tags, *playbackConfiguration.PlaybackConfigurationArn) if err != nil { resp.Diagnostics.AddError( "Error while updating playback configuration tags"+err.Error(), diff --git a/awsmt/resource_source_location.go b/awsmt/resource_source_location.go index 5fa8b02..c7f7bd8 100644 --- a/awsmt/resource_source_location.go +++ b/awsmt/resource_source_location.go @@ -163,7 +163,7 @@ func (r *resourceSourceLocation) Update(ctx context.Context, req resource.Update return } - err = V2UpdatesTags(r.client, sourceLocation.Tags, plan.Tags, *sourceLocation.Arn) + err = UpdatesTags(r.client, sourceLocation.Tags, plan.Tags, *sourceLocation.Arn) if err != nil { resp.Diagnostics.AddError( "Error while updating playback configuration tags"+err.Error(), diff --git a/awsmt/resource_vod_source.go b/awsmt/resource_vod_source.go index 8869923..b007a93 100644 --- a/awsmt/resource_vod_source.go +++ b/awsmt/resource_vod_source.go @@ -136,7 +136,7 @@ func (r *resourceVodSource) Update(ctx context.Context, req resource.UpdateReque } // Update tags - err = V2UpdatesTags(r.client, vodSource.Tags, plan.Tags, *vodSource.Arn) + err = UpdatesTags(r.client, vodSource.Tags, plan.Tags, *vodSource.Arn) if err != nil { resp.Diagnostics.AddError( "Error while updating vod source tags"+err.Error(),