feat: implementing getting lead tuples.

This commit is contained in:
Andrey Parhomenko 2024-06-05 22:24:06 +05:00
parent 7d8afae5a5
commit a8a0331890
2 changed files with 35 additions and 0 deletions

33
cmd/amocli/getleadtup.go Normal file
View file

@ -0,0 +1,33 @@
package main
import "surdeus.su/core/cli/mtool"
import "surdeus.su/core/amo"
import "surdeus.su/core/ss/urlenc"
type LeadTupleGetter struct{}
func (l LeadTupleGetter) GetValues(
c *amo.Client,
opts ...urlenc.Builder,
) (
[]amo.LeadTuple,
amo.NextFunc[[]amo.LeadTuple],
error,
) {
return c.GetLeadTuples(opts...)
}
func (l LeadTupleGetter) GetNameMul() string {
return "lead tuples"
}
func (l LeadTupleGetter) GetFuncName() string {
return "amo.GetLeadTuples"
}
var getLeadTuple = mtool.T("get-lead-tuples").Func(func(
flags *mtool.Flags,
){
RunGetter(LeadTupleGetter{}, flags)
}).Usage(
"[id1 id2 ... idN]",
)

View file

@ -17,6 +17,8 @@ var tool = mtool.T("amocli").Subs(
updateComs,
getContacts,
getLeadTuple,
mtool.T("version").Func(func(flags *mtool.Flags){
bi, ok := debug.ReadBuildInfo()
if !ok {