-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathclient.go
78 lines (73 loc) · 2.9 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// This file was auto-generated by Fern from our API Definition.
package client
import (
accesscodesclient "github.com/seamapi/go/accesscodes/client"
acsclient "github.com/seamapi/go/acs/client"
actionattempts "github.com/seamapi/go/actionattempts"
clientsessions "github.com/seamapi/go/clientsessions"
connectedaccounts "github.com/seamapi/go/connectedaccounts"
connectwebviews "github.com/seamapi/go/connectwebviews"
core "github.com/seamapi/go/core"
devicesclient "github.com/seamapi/go/devices/client"
events "github.com/seamapi/go/events"
locks "github.com/seamapi/go/locks"
networks "github.com/seamapi/go/networks"
noisesensorsclient "github.com/seamapi/go/noisesensors/client"
option "github.com/seamapi/go/option"
phonesclient "github.com/seamapi/go/phones/client"
thermostatsclient "github.com/seamapi/go/thermostats/client"
useridentitiesclient "github.com/seamapi/go/useridentities/client"
webhooks "github.com/seamapi/go/webhooks"
workspaces "github.com/seamapi/go/workspaces"
http "net/http"
)
type Client struct {
baseURL string
caller *core.Caller
header http.Header
AccessCodes *accesscodesclient.Client
ActionAttempts *actionattempts.Client
ClientSessions *clientsessions.Client
ConnectWebviews *connectwebviews.Client
ConnectedAccounts *connectedaccounts.Client
Devices *devicesclient.Client
Events *events.Client
Locks *locks.Client
Networks *networks.Client
Phones *phonesclient.Client
Thermostats *thermostatsclient.Client
UserIdentities *useridentitiesclient.Client
Webhooks *webhooks.Client
Workspaces *workspaces.Client
Acs *acsclient.Client
NoiseSensors *noisesensorsclient.Client
}
func NewClient(opts ...option.RequestOption) *Client {
options := core.NewRequestOptions(opts...)
return &Client{
baseURL: options.BaseURL,
caller: core.NewCaller(
&core.CallerParams{
Client: options.HTTPClient,
MaxAttempts: options.MaxAttempts,
},
),
header: options.ToHeader(),
AccessCodes: accesscodesclient.NewClient(opts...),
ActionAttempts: actionattempts.NewClient(opts...),
ClientSessions: clientsessions.NewClient(opts...),
ConnectWebviews: connectwebviews.NewClient(opts...),
ConnectedAccounts: connectedaccounts.NewClient(opts...),
Devices: devicesclient.NewClient(opts...),
Events: events.NewClient(opts...),
Locks: locks.NewClient(opts...),
Networks: networks.NewClient(opts...),
Phones: phonesclient.NewClient(opts...),
Thermostats: thermostatsclient.NewClient(opts...),
UserIdentities: useridentitiesclient.NewClient(opts...),
Webhooks: webhooks.NewClient(opts...),
Workspaces: workspaces.NewClient(opts...),
Acs: acsclient.NewClient(opts...),
NoiseSensors: noisesensorsclient.NewClient(opts...),
}
}