You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: list_aws.go
    path of file: ./repos/porter/api/server/handlers/project_integration
    
    the code of the file until where you have to start completion: package project_integration

import (
	"fmt"
	"net/http"

	"github.com/porter-dev/porter/api/server/handlers"
	"github.com/porter-dev/porter/api/server/shared"
	"github.com/porter-dev/porter/api/server/shared/apierrors"
	"github.com/porter-dev/porter/api/server/shared/config"
	"github.com/porter-dev/porter/api/types"
	"github.com/porter-dev/porter/internal/models"
)

type ListAWSHandler struct {
	handlers.PorterHandlerWriter
}

func NewListAWSHandler(
	config *config.Config,
	writer shared.ResultWriter,
) *ListAWSHandler {
	return &ListAWSHandler{
		PorterHandlerWriter: handlers.NewDefaultPorterHandler(config, nil, writer),
	}
}

// ListAWSAssumeRoleLink summarises the responses for AWS assume role chain links.
// This is only intended for CAPI projects
type ListAWSAssumeRoleLink struct {
	// ID is the ID of the assume role chain in the db. UUID as a 
    
func (p *ListAWSHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	ctx := r.Context()
	project, _ := ctx.Value(types.ProjectScope).(*models.Project)

	if project.GetFeatureFlag(models.CapiProvisionerEnabled, p.Config().LaunchDarklyClient) {
		dblinks, err := p.Repo().AWSAssumeRoleChainer().List(ctx, project.ID)
		if err != nil {
			e := fmt.Errorf("unable to find assume role chain links: %w", err)
			p.HandleAPIError(w, r, apierrors.NewErrInternal(e))
			return
		}

		var links []ListAWSAssumeRoleLink
		for _, link := range dblinks {
			links = append(links, ListAWSAssumeRoleLink{
				ID:        link.ID.String(),
				ARN:       link.TargetARN,
				ProjectID: link.ProjectID,
			})
		}
		p.WriteResult(w, r, links)
		w.WriteHeader(http.StatusOK)
		return
	}

	awsInts, err := p.Repo().AWSIntegration().ListAWSIntegrationsByProjectID(project.ID)
	if err != nil {
		p.HandleAPIError(w, r, apierrors.NewErrInternal(err))
		return
	}

	var res types.ListAWSResponse = make([]*types.AWSIntegration, 0)
	for _, awsInt := range awsInts {
		res = append(res, awsInt.ToAWSIntegrationType())
	}

	p.WriteResult(w, r, res)
}