package survey

//import (
//	"context"
//	"encoding/json"
//	"errors"
//	"fmt"
//	"time"
//
//	"github.com/tidbcloud/account/central/utils"
//	"github.com/tidbcloud/tiinf/monitor/tilog"
//	"go.uber.org/zap"
//)
//
//var (
//	hubSpotUrlFormat = "https://api.hubapi.com/contacts/v1/contact/email/%s/profile?propertyMode=value_only&showListMemberships=false"
//	hubSpotToken     = "pat-na1-d3be2f82-50ad-452d-9ade-04512372ccf9"
//)
//
//func getHubSpotCompanyInfo(ctx context.Context, email string) (*HubSpotCompanyInfo, error) {
//	url := fmt.Sprintf(hubSpotUrlFormat, email)
//	header := &map[string]string{
//		"Authorization": fmt.Sprintf("Bearer %s", hubSpotToken),
//	}
//	resp, code, err := utils.GetWithHeaderTimeout(url, nil, header, time.Second*2)
//	tilog.Info(ctx, "getEmailExistCompanyInfoOnHubSpot result", zap.Any("code", code), zap.Any("resp", resp), zap.Any("err", err))
//	if err != nil {
//		return nil, err
//	}
//	if resp == "" {
//		return nil, errors.New("hubspot return resp empty")
//	}
//	var result hubSpotProfileResult
//	err = json.Unmarshal([]byte(resp), &result)
//	if err != nil {
//		return nil, err
//	}
//	companyInfo := HubSpotCompanyInfo{
//		CompanyName: result.Properties.Company.Value,
//		CompanyURL:  "",
//	}
//	return &companyInfo, nil
//}
//
//type hubSpotProfileResult struct {
//	Vid        uint64                 `json:"vid"`
//	PortalId   uint64                 `json:"portal-id"`
//	Properties hubSpotCompanyProperty `json:"properties"`
//}
//
//type hubSpotCompanyProperty struct {
//	Company  hubSpotPropertyValue `json:"company"`
//	Jobtitle hubSpotPropertyValue `json:"jobtitle"`
//}
//
//type hubSpotPropertyValue struct {
//	Value string `json:"value"`
//}
