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: printer.go
    path of file: ./repos/cerbos/internal/printer
    
    the code of the file until where you have to start completion: // Copyright 2021-2024 Zenauth Ltd.
// SPDX-License-Identifier: Apache-2.0

package printer

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"strings"

	"github.com/alecthomas/chroma/v2"
	"github.com/alecthomas/chroma/v2/formatters"
	"github.com/alecth
    
func (p *Printer) PrintProtoYAML(message proto.Message, colorLevel outputcolor.Level, indent int) error {
	data, err := protojson.MarshalOptions{Multiline: true}.Marshal(message)
	if err != nil {
		return fmt.Errorf("failed to encode JSON: %w", err)
	}

	yamlBytes, err := yaml.JSONToYAML(data)
	if err != nil {
		return fmt.Errorf("failed to convert data to YAML: %w", err)
	}

	if colorLevel.Enabled() {
		yamlBytes, err = p.coloredYAML(string(yamlBytes), colorLevel)
		if err != nil {
			return err
		}
	}

	for _, line := range strings.Split(strings.TrimSuffix(string(yamlBytes), "\n"), "\n") {
		fmt.Fprintf(p.stdout, "%s%s\n", strings.Repeat("  ", indent), line)
	}

	return nil
}