package host

import (
	"context"
	"encoding/json"
)

func (c Core) FindTalkUrl(ctx context.Context, in *FindTalkInput) (*FinTalkOutput, error) {
	marshal, err := json.Marshal(in)
	if err != nil {
		return nil, err
	}
	result, err := c.Plugin.CallHost("findTalkUrl", marshal)

	if err != nil {
		return nil, err
	}

	out := FinTalkOutput{}
	if err = json.Unmarshal(result, &out); err != nil {
		return nil, err
	}
	return &out, nil
}
