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: transport_http.go
    path of file: ./repos/pipeline/internal/helm/helmdriver
    
    the code of the file until where you have to start completion: // Copyright Â© 2020 Banzai Cloud
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the L
    
func encodeGetReleasesHTTPResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error {
	releases, ok := response.(GetReleasesRestAPIResponse)
	if !ok {
		return errors.New("invalid release list response")
	}

	if releases.Err != nil {
		return errors.WrapIf(releases.Err, "failed to retrieve releases")
	}

	resp := make([]pkgHelm.ListDeploymentResponse, 0, len(releases.ReleaseList))
	for _, release := range releases.ReleaseList {
		resp = append(resp, pkgHelm.ListDeploymentResponse{
			Name:         release.ReleaseName,
			Chart:        release.ChartName,
			ChartName:    release.ChartName,
			ChartVersion: release.Version,
			Version:      release.ReleaseVersion,
			UpdatedAt:    release.ReleaseInfo.LastDeployed,
			Status:       release.ReleaseInfo.Status,
			Namespace:    release.Namespace,
			CreatedAt:    release.ReleaseInfo.FirstDeployed,
			Supported:    release.Supported,
			WhiteListed:  release.Whitelisted,
			Rejected:     release.Rejected,
		})
	}

	return kitxhttp.JSONResponseEncoder(ctx, w, resp)
}