package common

import (
	"fmt"
	"time"
	"github.com/fiskerinc/cloud-services/pkg/common/dbbasemodel"
)

type APIToken struct {
	Token       string     `json:"token" validate:"required,max=1000" pg:",pk"`
	Roles       string     `json:"roles" validate:"required,max=10000"`
	Description string     `json:"description" validate:"required,max=1000"`
	ExpiresAt   *time.Time `json:"expires_at" pg:"expires_at"`
	dbbasemodel.DBModelBase
}

func (a *APIToken) String() string {
	return fmt.Sprintf("APIToken<%s>", a.Token)
}
