2024-01-15 00:04:00 +03:00
|
|
|
package amo
|
|
|
|
|
|
|
|
import (
|
2024-05-19 21:00:41 +03:00
|
|
|
"surdeus.su/core/amo/api"
|
2024-05-31 13:50:28 +03:00
|
|
|
"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
|
|
|
)
|
|
|
|
|
2024-05-31 13:50:28 +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 {
|
2024-01-19 08:14:23 +03:00
|
|
|
return nil, err
|
2024-01-15 00:04:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return &Client{
|
2024-05-30 11:43:10 +03:00
|
|
|
API: apiClient,
|
2024-01-19 08:14:23 +03:00
|
|
|
}, nil
|
2024-01-15 00:04:00 +03:00
|
|
|
}
|
|
|
|
|