forked from belong-inc/go-hubspot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
crm.go
43 lines (38 loc) · 974 Bytes
/
crm.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package hubspot
import "fmt"
const (
crmBasePath = "crm"
objectsBasePath = "objects"
)
type CRM struct {
Company CompanyService
Contact ContactService
Deal DealService
Owner OwnerService
Pipeline PipelineService
}
func newCRM(c *Client) *CRM {
crmPath := fmt.Sprintf("%s/%s", crmBasePath, c.apiVersion)
return &CRM{
Company: &CompanyServiceOp{
companyPath: fmt.Sprintf("%s/%s/%s", crmPath, objectsBasePath, companyBasePath),
client: c,
},
Contact: &ContactServiceOp{
contactPath: fmt.Sprintf("%s/%s/%s", crmPath, objectsBasePath, contactBasePath),
client: c,
},
Deal: &DealServiceOp{
dealPath: fmt.Sprintf("%s/%s/%s", crmPath, objectsBasePath, dealBasePath),
client: c,
},
Owner: &OwnerServiceOp{
ownerPath: fmt.Sprintf("%s/%s", crmPath, ownerBasePath),
client: c,
},
Pipeline: &PipelineServiceOp{
pipelinePath: fmt.Sprintf("%s/%s", crmPath, pipelineBasePath),
client: c,
},
}
}