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: update_notification_config.go
    path of file: ./repos/porter/api/server/handlers/notifications
    
    the code of the file until where you have to start completion: package notifications

import (
	"encoding/json"
	"fmt"
	"net/http"

	"connectrpc.com/connect"

	"github.com/porter-dev/porter/api/server/shared/requestutils"

	porterv1 "github.com/porter-dev/api-contracts/generated/go/porter/v1"
	"github.com/porter-dev/porter/api/server/shared/apierrors"
	"github.com/porter-dev/porter/api/types"
	"github.com/porter-dev/porter/internal/models"
	"github.com/porter-dev/porter/internal/telemetry"

	"github.com/porter-dev/porter/api/server/handlers"
	"github.com/porter-dev/porter/api/server/shared"
	"github.com/porter-dev/porter/api/server/shared/config"
)

// UpdateNotificationConfigHandler is the handler for the POST /notifications/config/{notification_config_id} endpoint
type UpdateNotificationConfigHandler struct {
	handlers.PorterHandlerReadWriter
}

// NewUpdateNotificationConfigHandler returns a new UpdateNotificationConfigHandler
func NewUpdateNotificationConfigHand
    
func configToProto(config Config) (*porterv1.NotificationConfig, error) {
	statusMap := map[string]bool{}

	by, err := json.Marshal(config.Statuses)
	if err != nil {
		return nil, fmt.Errorf("error marshalling statuses: %s", err)
	}

	err = json.Unmarshal(by, &statusMap)
	if err != nil {
		return nil, fmt.Errorf("error unmarshalling statuses: %s", err)
	}

	var statuses []*porterv1.NotificationStatusEnabled
	for status, enabled := range statusMap {
		if protoStatus, ok := transformStatusStringToProto[status]; ok {
			statuses = append(statuses, &porterv1.NotificationStatusEnabled{
				Status:  protoStatus,
				Enabled: enabled,
			})
		}
	}

	typeMap := map[string]bool{}

	by, err = json.Marshal(config.Types)
	if err != nil {
		return nil, fmt.Errorf("error marshalling types: %s", err)
	}

	err = json.Unmarshal(by, &typeMap)
	if err != nil {
		return nil, fmt.Errorf("error unmarshalling types: %s", err)
	}

	var types []*porterv1.NotificationTypeEnabled
	for t, enabled := range typeMap {
		if protoType, ok := transformTypeStringToProto[t]; ok {
			types = append(types, &porterv1.NotificationTypeEnabled{
				Type:    protoType,
				Enabled: enabled,
			})
		}
	}

	protoConfig := &porterv1.NotificationConfig{
		EnabledStatuses: statuses,
		EnabledTypes:    types,
		SlackConfig:     &porterv1.SlackConfig{Mentions: []string{config.Mention}},
	}

	return protoConfig, nil
}