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: yandex.go
    path of file: ./repos/pocketbase/tools/auth
    
    the code of the file until where you have to start completion: package auth

import (
	"context"
	"encoding/json"

	"github.com/pocketbase/pocketbase/tools/types"
	"golang.org/x/oauth2"
	"golang.org/x/oauth2/yandex"
)

var _ Provider = (*Yandex)(nil)

// NameYandex is the unique name of the Yandex provider.
const NameYandex string = "yandex"

// Yandex allows authentication via Yandex OAuth2.
type Yandex struct {
	*baseProvider
}

// NewYandexProvider creates new Yandex provider instance with some defaults.
//
// Docs: https://yandex.ru/dev/id/doc/en/
func NewYandexProvider() *Yandex {
	return &Yandex{
    
func (p *Yandex) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) {
	data, err := p.FetchRawUserData(token)
	if err != nil {
		return nil, err
	}

	rawUser := map[string]any{}
	if err := json.Unmarshal(data, &rawUser); err != nil {
		return nil, err
	}

	extracted := struct {
		Id            string `json:"id"`
		Name          string `json:"real_name"`
		Username      string `json:"login"`
		Email         string `json:"default_email"`
		IsAvatarEmpty bool   `json:"is_avatar_empty"`
		AvatarId      string `json:"default_avatar_id"`
	}{}
	if err := json.Unmarshal(data, &extracted); err != nil {
		return nil, err
	}

	user := &AuthUser{
		Id:           extracted.Id,
		Name:         extracted.Name,
		Username:     extracted.Username,
		Email:        extracted.Email,
		RawUser:      rawUser,
		AccessToken:  token.AccessToken,
		RefreshToken: token.RefreshToken,
	}

	user.Expiry, _ = types.ParseDateTime(token.Expiry)

	if !extracted.IsAvatarEmpty {
		user.AvatarUrl = "https://avatars.yandex.net/get-yapic/" + extracted.AvatarId + "/islands-200"
	}

	return user, nil
}