package larkcli

import (
	"github.com/tidbcloud/escalation-base/support-autoshift/pkg/infra/config"
	"github.com/tidbcloud/escalation-base/support-autoshift/pkg/infra/larkcli/notify"

	lark "github.com/larksuite/oapi-sdk-go/v3"
)

type LarkClient struct {
	Raw    *lark.Client
	Notify notify.Notification
}

func New(conf *config.RootConfig) *LarkClient {
	raw := lark.NewClient(conf.Lark.AppCode, conf.Lark.AppSecret)

	return &LarkClient{
		Raw:    raw,
		Notify: notify.New(raw),
	}
}
