package collaboration

import (
	"encoding/json"

	"github.com/tidbcloud/aisupport/packages/sdk-go/contracts/entity/base"
)

type Type string
type Provider string
type GrantStatus string

const (
	TypeChat     Type = "chat"
	TypeMeeting  Type = "meeting"
	TypeDocument Type = "document"

	ProviderLark   Provider = "lark"
	ProviderZoom   Provider = "zoom"
	ProviderGoogle Provider = "google"

	GrantStatusCreated   GrantStatus = "created"
	GrantStatusRequested GrantStatus = "requested"
	GrantStatusGranted   GrantStatus = "granted"
	GrantStatusIgnored   GrantStatus = "ignored"
)

type Resource struct {
	base.Base `json:",inline"`

	Type           Type            `json:"type"`
	Provider       Provider        `json:"provider"`
	ResourceID     string          `json:"resource_id"`
	Name           string          `json:"name"`
	Link           string          `json:"link"`
	Owner          string          `json:"owner"`
	GrantStatus    GrantStatus     `json:"grant_status"`
	GrantRequestID *string         `json:"grant_request_id"`
	Metadata       json.RawMessage `json:"metadata" swaggertype:"object"`
}
