-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Go client to v1.101.0-alpha.0
- Loading branch information
Bitmovin OpenApi Bot
committed
Jan 18, 2022
1 parent
4519b95
commit 48e5c97
Showing
9 changed files
with
103 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package api | ||
|
||
import ( | ||
"github.com/bitmovin/bitmovin-api-sdk-go/apiclient" | ||
"github.com/bitmovin/bitmovin-api-sdk-go/model" | ||
"github.com/bitmovin/bitmovin-api-sdk-go/pagination" | ||
) | ||
|
||
// EncodingStatisticsEncodingsVodDailyAPI communicates with '/encoding/statistics/encodings/vod/daily/{from}/{to}' endpoints | ||
type EncodingStatisticsEncodingsVodDailyAPI struct { | ||
apiClient *apiclient.APIClient | ||
} | ||
|
||
// NewEncodingStatisticsEncodingsVodDailyAPI constructor for EncodingStatisticsEncodingsVodDailyAPI that takes options as argument | ||
func NewEncodingStatisticsEncodingsVodDailyAPI(options ...apiclient.APIClientOption) (*EncodingStatisticsEncodingsVodDailyAPI, error) { | ||
apiClient, err := apiclient.NewAPIClient(options...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return NewEncodingStatisticsEncodingsVodDailyAPIWithClient(apiClient), nil | ||
} | ||
|
||
// NewEncodingStatisticsEncodingsVodDailyAPIWithClient constructor for EncodingStatisticsEncodingsVodDailyAPI that takes an APIClient as argument | ||
func NewEncodingStatisticsEncodingsVodDailyAPIWithClient(apiClient *apiclient.APIClient) *EncodingStatisticsEncodingsVodDailyAPI { | ||
a := &EncodingStatisticsEncodingsVodDailyAPI{apiClient: apiClient} | ||
return a | ||
} | ||
|
||
// ListByDateRange List daily VoD encoding statistics within specific dates | ||
func (api *EncodingStatisticsEncodingsVodDailyAPI) ListByDateRange(from model.Date, to model.Date) (*pagination.EncodingStatisticssListByDateRangePagination, error) { | ||
reqParams := func(params *apiclient.RequestParams) { | ||
params.PathParams["from"] = from.String() | ||
params.PathParams["to"] = to.String() | ||
} | ||
|
||
var responseModel pagination.EncodingStatisticssListByDateRangePagination | ||
err := api.apiClient.Get("/encoding/statistics/encodings/vod/daily/{from}/{to}", nil, &responseModel, reqParams) | ||
return &responseModel, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package model | ||
|
||
// AnalyticsExportFileFormat : Analytics Export File Format | ||
type AnalyticsExportFileFormat string | ||
|
||
// List of possible AnalyticsExportFileFormat values | ||
const ( | ||
AnalyticsExportFileFormat_CSV AnalyticsExportFileFormat = "CSV" | ||
AnalyticsExportFileFormat_PARQUET AnalyticsExportFileFormat = "PARQUET" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
pagination/encoding_statisticss_list_by_date_range_pagination.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package pagination | ||
|
||
import ( | ||
"encoding/json" | ||
"github.com/bitmovin/bitmovin-api-sdk-go/bitutils" | ||
"github.com/bitmovin/bitmovin-api-sdk-go/model" | ||
) | ||
|
||
// EncodingStatisticssListByDateRangePagination model | ||
type EncodingStatisticssListByDateRangePagination struct { | ||
TotalCount int64 `json:"totalCount,omitempty"` | ||
Offset int32 `json:"offset,omitempty"` | ||
Limit int32 `json:"limit,omitempty"` | ||
Previous string `json:"previous,omitempty"` | ||
Next string `json:"next,omitempty"` | ||
Items []model.EncodingStatistics `json:"items,omitempty"` | ||
} | ||
|
||
// UnmarshalJSON unmarshals pagination model EncodingStatisticssListByDateRangePagination from a JSON structure | ||
func (m *EncodingStatisticssListByDateRangePagination) UnmarshalJSON(b []byte) error { | ||
var pageResp model.PaginationResponse | ||
if err := json.Unmarshal(b, &pageResp); err != nil { | ||
return err | ||
} | ||
|
||
var items []model.EncodingStatistics | ||
if err := json.Unmarshal(pageResp.Items, &items); err != nil { | ||
return err | ||
} | ||
var result EncodingStatisticssListByDateRangePagination | ||
|
||
result.TotalCount = bitutils.Int64Value(pageResp.TotalCount) | ||
result.Offset = bitutils.Int32Value(pageResp.Offset) | ||
result.Limit = bitutils.Int32Value(pageResp.Limit) | ||
result.Previous = bitutils.StringValue(pageResp.Previous) | ||
result.Next = bitutils.StringValue(pageResp.Next) | ||
result.Items = items | ||
|
||
*m = result | ||
|
||
return nil | ||
} |