-
Notifications
You must be signed in to change notification settings - Fork 0
/
api_misc_consumptions.go
36 lines (28 loc) · 1.1 KB
/
api_misc_consumptions.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
package broadpeakio
type AggregateConsumptionOutput struct {
ServiceIds []uint `json:"serviceIds,omitempty"`
From string `json:"from,omitempty"`
To string `json:"to,omitempty"`
Egress float32 `json:"egress,omitempty"`
VirtualChannel float32 `json:"virtualChannel,omitempty"`
ContentReplacement float32 `json:"contentReplacement,omitempty"`
InsertedAds float32 `json:"insertedAds,omitempty"`
}
type AggregateConsumptionInput struct {
ServiceIds []uint `json:"serviceIds,omitempty"`
From string `json:"from,omitempty"`
To string `json:"to,omitempty"`
}
func (client BroadpeakClient) GetAggregateConsumption(options AggregateConsumptionInput) (AggregateConsumptionOutput, error) {
url := baseUrl + "consumption"
resp, err := httpGetRequest(client, url)
if err != nil {
return AggregateConsumptionOutput{}, err
}
var consumptionApiResponse AggregateConsumptionOutput
err = deserialiseApiResponse(resp, &consumptionApiResponse)
if err != nil {
return AggregateConsumptionOutput{}, err
}
return consumptionApiResponse, nil
}