-
Notifications
You must be signed in to change notification settings - Fork 2
/
client.go
41 lines (33 loc) · 1.29 KB
/
client.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
package google
import (
"go.autokitteh.dev/autokitteh/internal/kittehs"
"go.autokitteh.dev/autokitteh/sdk/sdkintegrations"
"go.autokitteh.dev/autokitteh/sdk/sdkmodule"
"go.autokitteh.dev/autokitteh/sdk/sdkservices"
"go.autokitteh.dev/autokitteh/sdk/sdktypes"
"go.autokitteh.dev/autokitteh/integrations/google/gmail"
"go.autokitteh.dev/autokitteh/integrations/google/sheets"
)
var integrationID = sdktypes.NewIntegrationIDFromName("google")
var desc = kittehs.Must1(sdktypes.StrictIntegrationFromProto(&sdktypes.IntegrationPB{
IntegrationId: integrationID.String(),
UniqueName: "google",
DisplayName: "Google (All APIs)",
Description: "Aggregation of all available Google APIs.",
LogoUrl: "/static/images/google.svg",
UserLinks: map[string]string{
"1 REST API reference": "https://developers.google.com/apis-explorer",
"2 Go client API": "https://pkg.go.dev/google.golang.org/api",
},
ConnectionUrl: "/google/connect",
}))
func New(sec sdkservices.Vars) sdkservices.Integration {
scope := desc.UniqueName().String()
// TODO: Calendar.
// TODO: Chat.
// TODO: Drive.
// TODO: Forms.
opts := gmail.ExportedFunctions(sec, scope, true)
opts = append(opts, sheets.ExportedFunctions(sec, scope, true)...)
return sdkintegrations.NewIntegration(desc, sdkmodule.New(opts...))
}