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: sso_token_provider.go
    path of file: ./repos/sliver/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds
    
    the code of the file until where you have to start completion: package ssocreds

import (
	"context"
	"fmt"
	"os"
	"time"

	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/internal/sdk"
	"github.com/aws/aws-sdk-go-v2/service/ssooidc"
	"github.com/aws/smithy-go/auth/bearer"
)

// CreateTokenAPIClient provides the interface for the SSOTokenProvider's API
// client for calling CreateToken operation to refresh the SSO token.
type CreateTokenAPIClient interface {
	CreateToken(context.Context, *ssooidc.CreateToke
    
func (p SSOTokenProvider) refreshToken(ctx context.Context, cachedToken token) (token, error) {
	if cachedToken.ClientSecret == "" || cachedToken.ClientID == "" || cachedToken.RefreshToken == "" {
		return token{}, fmt.Errorf("cached SSO token is expired, or not present, and cannot be refreshed")
	}

	createResult, err := p.options.Client.CreateToken(ctx, &ssooidc.CreateTokenInput{
		ClientId:     &cachedToken.ClientID,
		ClientSecret: &cachedToken.ClientSecret,
		RefreshToken: &cachedToken.RefreshToken,
		GrantType:    aws.String("refresh_token"),
	}, p.options.ClientOptions...)
	if err != nil {
		return token{}, fmt.Errorf("unable to refresh SSO token, %w", err)
	}

	expiresAt := sdk.NowTime().Add(time.Duration(createResult.ExpiresIn) * time.Second)

	cachedToken.AccessToken = aws.ToString(createResult.AccessToken)
	cachedToken.ExpiresAt = (*rfc3339)(&expiresAt)
	cachedToken.RefreshToken = aws.ToString(createResult.RefreshToken)

	fileInfo, err := os.Stat(p.options.CachedTokenFilepath)
	if err != nil {
		return token{}, fmt.Errorf("failed to stat cached SSO token file %w", err)
	}

	if err = storeCachedToken(p.options.CachedTokenFilepath, cachedToken, fileInfo.Mode()); err != nil {
		return token{}, fmt.Errorf("unable to cache refreshed SSO token, %w", err)
	}

	return cachedToken, nil
}