-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathanalytics_api.go
55 lines (48 loc) · 2.05 KB
/
analytics_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
51
52
53
54
55
package api
import (
"github.com/bitmovin/bitmovin-api-sdk-go/apiclient"
)
// AnalyticsAPI intermediary API object with no endpoints
type AnalyticsAPI struct {
apiClient *apiclient.APIClient
// Exports communicates with '/analytics/exports' endpoints
Exports *AnalyticsExportsAPI
// Impressions communicates with '/analytics/impressions' endpoints
Impressions *AnalyticsImpressionsAPI
// Insights intermediary API object with no endpoints
Insights *AnalyticsInsightsAPI
// Metrics intermediary API object with no endpoints
Metrics *AnalyticsMetricsAPI
// Ads intermediary API object with no endpoints
Ads *AnalyticsAdsAPI
// Queries intermediary API object with no endpoints
Queries *AnalyticsQueriesAPI
// Licenses communicates with '/analytics/licenses' endpoints
Licenses *AnalyticsLicensesAPI
// VirtualLicenses communicates with '/analytics/virtual-licenses' endpoints
VirtualLicenses *AnalyticsVirtualLicensesAPI
// Outputs intermediary API object with no endpoints
Outputs *AnalyticsOutputsAPI
}
// NewAnalyticsAPI constructor for AnalyticsAPI that takes options as argument
func NewAnalyticsAPI(options ...apiclient.APIClientOption) (*AnalyticsAPI, error) {
apiClient, err := apiclient.NewAPIClient(options...)
if err != nil {
return nil, err
}
return NewAnalyticsAPIWithClient(apiClient), nil
}
// NewAnalyticsAPIWithClient constructor for AnalyticsAPI that takes an APIClient as argument
func NewAnalyticsAPIWithClient(apiClient *apiclient.APIClient) *AnalyticsAPI {
a := &AnalyticsAPI{apiClient: apiClient}
a.Exports = NewAnalyticsExportsAPIWithClient(apiClient)
a.Impressions = NewAnalyticsImpressionsAPIWithClient(apiClient)
a.Insights = NewAnalyticsInsightsAPIWithClient(apiClient)
a.Metrics = NewAnalyticsMetricsAPIWithClient(apiClient)
a.Ads = NewAnalyticsAdsAPIWithClient(apiClient)
a.Queries = NewAnalyticsQueriesAPIWithClient(apiClient)
a.Licenses = NewAnalyticsLicensesAPIWithClient(apiClient)
a.VirtualLicenses = NewAnalyticsVirtualLicensesAPIWithClient(apiClient)
a.Outputs = NewAnalyticsOutputsAPIWithClient(apiClient)
return a
}