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: logical_system_custom_messages.go
    path of file: ./repos/vault/vault
    
    the code of the file until where you have to start completion: // Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1

package vault

import (
	"context"
	"encoding/base64"
	"errors"
	"fmt"
	"net/http"
	"time"

	"github.com/hashicorp/vault/sdk/framework"
	"github.com/hashicorp/vault/sdk/logical"
	uicustommessages "github.com/hashicorp/vault/vault/ui_custom_messages"
)

// uiCustomMessagePaths returns a slice of *framework.Path elements that are
// added to the receiver SystemBackend.
func (b *SystemBackend) uiCustomMessagePaths() []*framework.Path {
	return []*framework.Path{
		{
			Pattern: "config/ui/custom-messages/$",

			DisplayAttrs: &framework.DisplayAttributes{
				OperationPrefix: "ui-config",
				OperationVerb:   "list",
				OperationSuffix: "custom-messages",
			},
			Fields: map[string]*framework.FieldSchema{
				"authenticated": {
					Type:     framework.TypeBool,
					Required: false,
				},
				"active": {
					Type:     framework.TypeBool,
					Required: false,
				},
				"type": {
					Type:     framewo
    
func validateLinkMap(linkMap map[string]any) (*uicustommessages.MessageLink, *logical.Response) {
	if len(linkMap) > 1 {
		return nil, logical.ErrorResponse("invalid number of elements in link parameter value; only a single element can be provided")
	}

	for k, v := range linkMap {
		href, ok := v.(string)

		switch {
		case !ok:
			// href value is not a string, so return an error
			return nil, logical.ErrorResponse(fmt.Sprintf("invalid url for %q key in link parameter value", k))
		case len(k) == 0 && len(href) > 0:
			// no title key, but there's an href value, so return an error
			return nil, logical.ErrorResponse("missing title key in link parameter value")
		case len(k) > 0 && len(href) == 0:
			// no href value, but there's a title key, so return an error
			return nil, logical.ErrorResponse(fmt.Sprintf("missing url for %q key in link parameter value", k))
		case len(k) != 0 && len(href) != 0:
			// when title key and href value are not empty, return a MessageLink
			// pointer
			return &uicustommessages.MessageLink{
				Title: k,
				Href:  href,
			}, nil
		}

	}

	// no title key and no href value, treat it as if no link was specified
	return nil, nil
}