-
Notifications
You must be signed in to change notification settings - Fork 26
/
crm.go
53 lines (48 loc) · 1.34 KB
/
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
44
45
46
47
48
49
50
51
52
53
package hubspot
import "fmt"
const (
crmBasePath = "crm"
objectsBasePath = "objects"
)
type CRM struct {
Contact ContactService
Company CompanyService
Deal DealService
Imports CrmImportsService
Schemas CrmSchemasService
Properties CrmPropertiesService
Tickets CrmTicketsServivce
}
func newCRM(c *Client) *CRM {
crmPath := fmt.Sprintf("%s/%s", crmBasePath, c.apiVersion)
return &CRM{
Contact: &ContactServiceOp{
contactPath: fmt.Sprintf("%s/%s/%s", crmPath, objectsBasePath, contactBasePath),
client: c,
},
Company: &CompanyServiceOp{
companyPath: fmt.Sprintf("%s/%s/%s", crmPath, objectsBasePath, companyBasePath),
client: c,
},
Deal: &DealServiceOp{
dealPath: fmt.Sprintf("%s/%s/%s", crmPath, objectsBasePath, dealBasePath),
client: c,
},
Imports: &CrmImportsServiceOp{
crmImportsPath: fmt.Sprintf("%s/%s", crmPath, crmImportsBasePath),
client: c,
},
Schemas: &CrmSchemasServiceOp{
crmSchemasPath: fmt.Sprintf("%s/%s", crmPath, crmSchemasPath),
client: c,
},
Properties: &CrmPropertiesServiceOp{
crmPropertiesPath: fmt.Sprintf("%s/%s", crmPath, crmPropertiesPath),
client: c,
},
Tickets: &CrmTicketsServivceOp{
crmTicketsPath: fmt.Sprintf("%s/%s/%s", crmPath, objectsBasePath, crmTicketsBasePath),
client: c,
},
}
}