Skip to content

Commit 9d5b611

Browse files
authored
feat(hubspot): Update to SDK V4 (#11965)
Closes #11964
1 parent bc8ef17 commit 9d5b611

35 files changed

+159
-97
lines changed

plugins/source/hubspot/client/client.go

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import (
66
"os"
77

88
"github.com/clarkmcc/go-hubspot"
9-
"github.com/cloudquery/plugin-pb-go/specs"
10-
"github.com/cloudquery/plugin-sdk/v3/plugins/source"
11-
"github.com/cloudquery/plugin-sdk/v3/schema"
9+
"github.com/cloudquery/plugin-sdk/v4/schema"
1210
"github.com/rs/zerolog"
1311
"golang.org/x/time/rate"
1412
)
@@ -44,15 +42,7 @@ func (c *Client) withObjectType(objectType string) *Client {
4442
return &newClient
4543
}
4644

47-
func New(ctx context.Context, logger zerolog.Logger, s specs.Source, _ source.Options) (schema.ClientMeta, error) {
48-
var hubspotSpec Spec
49-
50-
if err := s.UnmarshalSpec(&hubspotSpec); err != nil {
51-
return nil, fmt.Errorf("failed to unmarshal plugin spec: %w", err)
52-
}
53-
54-
hubspotSpec.setDefaults()
55-
45+
func New(ctx context.Context, logger zerolog.Logger, s Spec) (schema.ClientMeta, error) {
5646
authToken := os.Getenv("HUBSPOT_APP_TOKEN")
5747
if authToken == "" {
5848
return nil, fmt.Errorf("failed to get hubspot auth token. Please provide an auth-token (see https://www.cloudquery.io/docs/plugins/sources/hubspot/overview#authentication)")
@@ -61,9 +51,9 @@ func New(ctx context.Context, logger zerolog.Logger, s specs.Source, _ source.Op
6151
return &Client{
6252
Logger: logger,
6353
Authorizer: hubspot.NewTokenAuthorizer(authToken),
64-
Spec: hubspotSpec,
54+
Spec: s,
6555
RateLimiter: rate.NewLimiter(
66-
/* r= */ rate.Limit(*hubspotSpec.MaxRequestsPerSecond),
56+
/* r= */ rate.Limit(*s.MaxRequestsPerSecond),
6757
/* b= */ 1,
6858
),
6959
}, nil

plugins/source/hubspot/client/multiplex.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package client
22

3-
import "github.com/cloudquery/plugin-sdk/v3/schema"
3+
import "github.com/cloudquery/plugin-sdk/v4/schema"
44

55
func ObjectTypeMultiplex(objectTypes []string) func(schema.ClientMeta) []schema.ClientMeta {
66
return func(meta schema.ClientMeta) []schema.ClientMeta {

plugins/source/hubspot/client/resolvers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package client
33
import (
44
"context"
55

6-
"github.com/cloudquery/plugin-sdk/v3/schema"
6+
"github.com/cloudquery/plugin-sdk/v4/schema"
77
)
88

99
func ResolveObjectType(_ context.Context, meta schema.ClientMeta, r *schema.Resource, _ schema.Column) error {

plugins/source/hubspot/client/spec.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
package client
22

3+
const (
4+
defaultConcurrency = 1000
5+
)
6+
37
type Spec struct {
48
MaxRequestsPerSecond *int `yaml:"max_requests_per_second,omitempty" json:"max_requests_per_second,omitempty"`
59
TableOptions TableOptions `yaml:"table_options,omitempty" json:"table_options,omitempty"`
10+
Concurrency int `yaml:"concurrency,omitempty" json:"concurrency,omitempty"`
611
}
712

813
type TableOptions map[string]*TableOptionsSpec
@@ -12,7 +17,7 @@ type TableOptionsSpec struct {
1217
Associations []string `yaml:"associations,omitempty" json:"associations,omitempty"`
1318
}
1419

15-
func (spec *Spec) setDefaults() {
20+
func (spec *Spec) SetDefaults() {
1621
// https://developers.hubspot.com/docs/api/usage-details#rate-limits
1722
// Hubspot, for Pro and Enterprise, accounts, has rate limits of:
1823
// - 15 requests / second / private-app
@@ -24,6 +29,10 @@ func (spec *Spec) setDefaults() {
2429
if spec.MaxRequestsPerSecond == nil || *spec.MaxRequestsPerSecond == 0 {
2530
spec.MaxRequestsPerSecond = &defaultRateLimitPerSecond
2631
}
32+
33+
if spec.Concurrency == 0 {
34+
spec.Concurrency = defaultConcurrency
35+
}
2736
}
2837

2938
func (ts TableOptions) ForTable(name string) *TableOptionsSpec {

plugins/source/hubspot/go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ go 1.19
55
require (
66
github.com/apache/arrow/go/v13 v13.0.0-20230630125530-5a06b2ec2a8e
77
github.com/clarkmcc/go-hubspot v0.0.0-20221010213350-20c2f9cbf936
8-
github.com/cloudquery/plugin-pb-go v1.6.0
9-
github.com/cloudquery/plugin-sdk/v3 v3.10.6
8+
github.com/cloudquery/plugin-sdk/v4 v4.7.1-rc1
109
github.com/rs/zerolog v1.29.1
1110
golang.org/x/time v0.3.0
1211
)
1312

1413
replace github.com/apache/arrow/go/v13 => github.com/cloudquery/arrow/go/v13 v13.0.0-20230703001435-df3b664a289d
1514

1615
require (
16+
github.com/cloudquery/plugin-pb-go v1.6.0 // indirect
1717
github.com/cloudquery/plugin-sdk/v2 v2.7.0 // indirect
1818
github.com/davecgh/go-spew v1.1.1 // indirect
1919
github.com/getsentry/sentry-go v0.20.0 // indirect
@@ -25,13 +25,13 @@ require (
2525
github.com/grpc-ecosystem/go-grpc-middleware/providers/zerolog/v2 v2.0.0-rc.3 // indirect
2626
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.3 // indirect
2727
github.com/inconshreveable/mousetrap v1.1.0 // indirect
28-
github.com/klauspost/compress v1.16.0 // indirect
28+
github.com/klauspost/compress v1.16.6 // indirect
2929
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
30+
github.com/kr/pretty v0.3.0 // indirect
3031
github.com/mattn/go-colorable v0.1.13 // indirect
3132
github.com/mattn/go-isatty v0.0.19 // indirect
3233
github.com/pierrec/lz4/v4 v4.1.17 // indirect
3334
github.com/pmezard/go-difflib v1.0.0 // indirect
34-
github.com/spf13/cast v1.5.0 // indirect
3535
github.com/spf13/cobra v1.6.1 // indirect
3636
github.com/spf13/pflag v1.0.5 // indirect
3737
github.com/stretchr/testify v1.8.4 // indirect

plugins/source/hubspot/go.sum

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,14 @@ github.com/cloudquery/plugin-pb-go v1.6.0 h1:4g+tPhRAQUWpGyQBMcj6D3yVwKqwEN3nynv
4747
github.com/cloudquery/plugin-pb-go v1.6.0/go.mod h1:R0Wse6NbJDZIHcRQjJ1sZGYDo3mrIDm4k3El1YUrvGA=
4848
github.com/cloudquery/plugin-sdk/v2 v2.7.0 h1:hRXsdEiaOxJtsn/wZMFQC9/jPfU1MeMK3KF+gPGqm7U=
4949
github.com/cloudquery/plugin-sdk/v2 v2.7.0/go.mod h1:pAX6ojIW99b/Vg4CkhnsGkRIzNaVEceYMR+Bdit73ug=
50-
github.com/cloudquery/plugin-sdk/v3 v3.10.6 h1:KqTsLZ6OA1h8BUMeMcU6BAD6TBW6ojgQaC4zDZMgvu0=
51-
github.com/cloudquery/plugin-sdk/v3 v3.10.6/go.mod h1:QhBaVgiNyQ3P6uAzJWOYpYykHXL+WDZffwg1riTwv60=
50+
github.com/cloudquery/plugin-sdk/v4 v4.7.1-rc1 h1:de3TwdcKEO+bjfPjOvmNfaOBfrIkEOiK8TeS54yj86I=
51+
github.com/cloudquery/plugin-sdk/v4 v4.7.1-rc1/go.mod h1:Y5HzxesZrpmSTUrbvR8EmGCK5wXDAhqSqzNEXC2ouvI=
5252
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
5353
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
5454
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
5555
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
5656
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
57+
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
5758
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5859
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
5960
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -62,7 +63,6 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m
6263
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
6364
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
6465
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
65-
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
6666
github.com/getsentry/sentry-go v0.20.0 h1:bwXW98iMRIWxn+4FgPW7vMrjmbym6HblXALmhjHmQaQ=
6767
github.com/getsentry/sentry-go v0.20.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY=
6868
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
@@ -146,15 +146,17 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
146146
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
147147
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
148148
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
149-
github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4=
150-
github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
149+
github.com/klauspost/compress v1.16.6 h1:91SKEy4K37vkp255cJ8QesJhjyRO0hn9i9G0GoUwLsk=
150+
github.com/klauspost/compress v1.16.6/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
151151
github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
152152
github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
153153
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
154154
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
155+
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
155156
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
156157
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
157158
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
159+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
158160
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
159161
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
160162
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
@@ -173,15 +175,14 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
173175
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
174176
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
175177
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
178+
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
176179
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
177180
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
178181
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
179182
github.com/rs/zerolog v1.19.0/go.mod h1:IzD0RJ65iWH0w97OQQebJEvTZYvsCUm9WVLWBQrJRjo=
180183
github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc=
181184
github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU=
182185
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
183-
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
184-
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
185186
github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
186187
github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
187188
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=

plugins/source/hubspot/main.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
package main
22

33
import (
4+
"context"
5+
"log"
6+
47
"github.com/cloudquery/cloudquery/plugins/source/hubspot/resources/plugin"
5-
"github.com/cloudquery/plugin-sdk/v3/serve"
8+
"github.com/cloudquery/plugin-sdk/v4/serve"
69
)
710

811
const sentryDsn = "https://[email protected]/4504559739011072"
912

1013
func main() {
11-
serve.Source(plugin.Plugin(), serve.WithSourceSentryDSN(sentryDsn))
14+
if err := serve.Plugin(plugin.Plugin(), serve.WithPluginSentryDSN(sentryDsn)).Serve(context.Background()); err != nil {
15+
log.Fatal(err)
16+
}
1217
}
Lines changed: 97 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
package plugin
22

33
import (
4+
"context"
5+
"encoding/json"
6+
"fmt"
7+
48
"github.com/cloudquery/cloudquery/plugins/source/hubspot/client"
59
"github.com/cloudquery/cloudquery/plugins/source/hubspot/resources/services/crm"
6-
"github.com/cloudquery/plugin-sdk/v3/caser"
7-
"github.com/cloudquery/plugin-sdk/v3/plugins/source"
8-
"github.com/cloudquery/plugin-sdk/v3/schema"
10+
"github.com/cloudquery/plugin-sdk/v4/caser"
11+
"github.com/cloudquery/plugin-sdk/v4/docs"
12+
"github.com/cloudquery/plugin-sdk/v4/message"
13+
"github.com/cloudquery/plugin-sdk/v4/plugin"
14+
"github.com/cloudquery/plugin-sdk/v4/scheduler"
15+
"github.com/cloudquery/plugin-sdk/v4/schema"
16+
"github.com/cloudquery/plugin-sdk/v4/transformers"
17+
"github.com/rs/zerolog"
918
)
1019

1120
var (
@@ -17,37 +26,103 @@ var customExceptions = map[string]string{
1726
"hubspot": "HubSpot",
1827
}
1928

20-
func titleTransformer(table *schema.Table) string {
29+
func titleTransformer(table *schema.Table) {
2130
if table.Title != "" {
22-
return table.Title
31+
return
2332
}
2433
exceptions := make(map[string]string)
25-
for k, v := range source.DefaultTitleExceptions {
34+
for k, v := range docs.DefaultTitleExceptions {
2635
exceptions[k] = v
2736
}
2837
for k, v := range customExceptions {
2938
exceptions[k] = v
3039
}
3140
csr := caser.New(caser.WithCustomExceptions(exceptions))
32-
return csr.ToTitle(table.Name)
41+
table.Title = csr.ToTitle(table.Name)
42+
for _, rel := range table.Relations {
43+
titleTransformer(rel)
44+
}
45+
}
46+
47+
type Client struct {
48+
plugin.UnimplementedDestination
49+
schduler *scheduler.Scheduler
50+
syncClient *client.Client
51+
options plugin.NewClientOptions
52+
}
53+
54+
func newClient(ctx context.Context, logger zerolog.Logger, specBytes []byte, options plugin.NewClientOptions) (plugin.Client, error) {
55+
c := &Client{
56+
options: options,
57+
}
58+
if options.NoConnection {
59+
return c, nil
60+
}
61+
spec := &client.Spec{}
62+
if err := json.Unmarshal(specBytes, spec); err != nil {
63+
return nil, err
64+
}
65+
spec.SetDefaults()
66+
syncClient, err := client.New(ctx, logger, *spec)
67+
if err != nil {
68+
return nil, err
69+
}
70+
c.syncClient = syncClient.(*client.Client)
71+
c.schduler = scheduler.NewScheduler(scheduler.WithLogger(logger), scheduler.WithConcurrency(uint64(spec.Concurrency)))
72+
return c, nil
73+
}
74+
75+
func (*Client) Close(ctx context.Context) error {
76+
return nil
77+
}
78+
79+
func (*Client) Tables(ctx context.Context, options plugin.TableOptions) (schema.Tables, error) {
80+
tables := getTables()
81+
tables, err := tables.FilterDfs(options.Tables, options.SkipTables, options.SkipDependentTables)
82+
if err != nil {
83+
return nil, err
84+
}
85+
return tables, nil
86+
}
87+
88+
func (c *Client) Sync(ctx context.Context, options plugin.SyncOptions, res chan<- message.SyncMessage) error {
89+
if c.options.NoConnection {
90+
return fmt.Errorf("no connection")
91+
}
92+
tables := getTables()
93+
tables, err := tables.FilterDfs(options.Tables, options.SkipTables, options.SkipDependentTables)
94+
if err != nil {
95+
return err
96+
}
97+
return c.schduler.Sync(ctx, c.syncClient, tables, res)
98+
}
99+
100+
func getTables() schema.Tables {
101+
tables := schema.Tables{
102+
crm.Contacts(),
103+
crm.Companies(),
104+
crm.Deals(),
105+
crm.LineItems(),
106+
crm.Products(),
107+
crm.Tickets(),
108+
crm.Quotes(),
109+
crm.Owners(),
110+
crm.Pipelines(),
111+
}
112+
if err := transformers.TransformTables(tables); err != nil {
113+
panic(err)
114+
}
115+
for _, table := range tables {
116+
schema.AddCqIDs(table)
117+
titleTransformer(table)
118+
}
119+
return tables
33120
}
34121

35-
func Plugin() *source.Plugin {
36-
return source.NewPlugin(
122+
func Plugin() *plugin.Plugin {
123+
return plugin.NewPlugin(
37124
"cloudquery-hubspot",
38125
Version,
39-
schema.Tables{
40-
crm.Contacts(),
41-
crm.Companies(),
42-
crm.Deals(),
43-
crm.LineItems(),
44-
crm.Products(),
45-
crm.Tickets(),
46-
crm.Quotes(),
47-
crm.Owners(),
48-
crm.Pipelines(),
49-
},
50-
client.New,
51-
source.WithTitleTransformer(titleTransformer),
126+
newClient,
52127
)
53128
}

plugins/source/hubspot/resources/services/crm/companies.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package crm
22

33
import (
44
"github.com/clarkmcc/go-hubspot/generated/v3/companies"
5-
"github.com/cloudquery/plugin-sdk/v3/schema"
6-
"github.com/cloudquery/plugin-sdk/v3/transformers"
5+
"github.com/cloudquery/plugin-sdk/v4/schema"
6+
"github.com/cloudquery/plugin-sdk/v4/transformers"
77
)
88

99
func Companies() *schema.Table {

plugins/source/hubspot/resources/services/crm/companies_fetch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"github.com/clarkmcc/go-hubspot"
77
"github.com/clarkmcc/go-hubspot/generated/v3/companies"
88
"github.com/cloudquery/cloudquery/plugins/source/hubspot/client"
9-
"github.com/cloudquery/plugin-sdk/v3/schema"
9+
"github.com/cloudquery/plugin-sdk/v4/schema"
1010
)
1111

1212
func fetchCompanies(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- any) error {

0 commit comments

Comments
 (0)