-
Notifications
You must be signed in to change notification settings - Fork 5
/
bitmovin_api.go
50 lines (43 loc) · 1.7 KB
/
bitmovin_api.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
package bitmovin
import (
"github.com/bitmovin/bitmovin-api-sdk-go/api"
"github.com/bitmovin/bitmovin-api-sdk-go/apiclient"
)
// BitmovinAPI intermediary API object with no endpoints
type BitmovinAPI struct {
apiClient *apiclient.APIClient
// Account intermediary API object with no endpoints
Account *api.AccountAPI
// Analytics intermediary API object with no endpoints
Analytics *api.AnalyticsAPI
// Encoding intermediary API object with no endpoints
Encoding *api.EncodingAPI
// General intermediary API object with no endpoints
General *api.GeneralAPI
// Notifications communicates with '/notifications' endpoints
Notifications *api.NotificationsAPI
// Player intermediary API object with no endpoints
Player *api.PlayerAPI
// Streams intermediary API object with no endpoints
Streams *api.StreamsAPI
}
// NewBitmovinAPI constructor for BitmovinAPI that takes options as argument
func NewBitmovinAPI(options ...apiclient.APIClientOption) (*BitmovinAPI, error) {
apiClient, err := apiclient.NewAPIClient(options...)
if err != nil {
return nil, err
}
return NewBitmovinAPIWithClient(apiClient), nil
}
// NewBitmovinAPIWithClient constructor for BitmovinAPI that takes an APIClient as argument
func NewBitmovinAPIWithClient(apiClient *apiclient.APIClient) *BitmovinAPI {
a := &BitmovinAPI{apiClient: apiClient}
a.Account = api.NewAccountAPIWithClient(apiClient)
a.Analytics = api.NewAnalyticsAPIWithClient(apiClient)
a.Encoding = api.NewEncodingAPIWithClient(apiClient)
a.General = api.NewGeneralAPIWithClient(apiClient)
a.Notifications = api.NewNotificationsAPIWithClient(apiClient)
a.Player = api.NewPlayerAPIWithClient(apiClient)
a.Streams = api.NewStreamsAPIWithClient(apiClient)
return a
}