amo/amocrm.go

35 lines
557 B
Go
Raw Permalink Normal View History

2024-01-15 00:04:00 +03:00
package amo
import (
2024-05-19 21:00:41 +03:00
"surdeus.su/core/amo/api"
"surdeus.su/core/amo/leads"
"surdeus.su/core/amo/companies"
"surdeus.su/core/amo/contacts"
"surdeus.su/core/amo/events"
2024-01-15 00:04:00 +03:00
)
type Lead = leads.Lead
type Company = companies.Company
type Contact = contacts.Contact
type Event = events.Event
2024-05-30 11:43:10 +03:00
const (
2024-06-04 23:16:12 +03:00
MEPR = api.MaxEntitiesPerRequest
2024-05-30 11:43:10 +03:00
)
2024-01-15 03:48:01 +03:00
2024-01-15 00:04:00 +03:00
type Client struct {
2024-05-30 11:43:10 +03:00
API *api.Client
2024-01-15 00:04:00 +03:00
}
2024-05-30 11:43:10 +03:00
func NewClient(secretPath string) (*Client, error) {
apiClient, err := api.NewAPI(secretPath)
2024-01-15 00:04:00 +03:00
if err != nil {
return nil, err
2024-01-15 00:04:00 +03:00
}
return &Client{
2024-05-30 11:43:10 +03:00
API: apiClient,
}, nil
2024-01-15 00:04:00 +03:00
}