Skip to content

Commit

Permalink
Replace 'tfslices.Chunks' with 'slices.Chunk' - connect.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Sep 4, 2024
1 parent 1331885 commit e56ae32
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/service/connect/routing_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"fmt"
"log"
"slices"
"strings"

"github.com/aws/aws-sdk-go-v2/aws"
Expand All @@ -20,7 +21,6 @@ import (
"github.com/hashicorp/terraform-provider-aws/internal/enum"
"github.com/hashicorp/terraform-provider-aws/internal/errs"
"github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag"
tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices"
tftags "github.com/hashicorp/terraform-provider-aws/internal/tags"
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
"github.com/hashicorp/terraform-provider-aws/internal/verify"
Expand Down Expand Up @@ -361,8 +361,7 @@ func updateRoutingProfileQueueAssociations(ctx context.Context, conn *connect.Cl
// the respective queues based on the diff detected

// disassociate first since Queue and channel type combination cannot be duplicated
chunks := tfslices.Chunks(del, routingProfileQueueAssociationChunkSize)
for _, chunk := range chunks {
for chunk := range slices.Chunk(del, routingProfileQueueAssociationChunkSize) {
var queueReferences []awstypes.RoutingProfileQueueReference
for _, v := range chunk {
if v := v.QueueReference; v != nil {
Expand All @@ -385,8 +384,7 @@ func updateRoutingProfileQueueAssociations(ctx context.Context, conn *connect.Cl
}
}

chunks = tfslices.Chunks(add, routingProfileQueueAssociationChunkSize)
for _, chunk := range chunks {
for chunk := range slices.Chunk(add, routingProfileQueueAssociationChunkSize) {
input := &connect.AssociateRoutingProfileQueuesInput{
InstanceId: aws.String(instanceID),
QueueConfigs: chunk,
Expand Down

0 comments on commit e56ae32

Please sign in to comment.