Skip to content

Commit

Permalink
Updated Go client to v1.101.0-alpha.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Bitmovin OpenApi Bot committed Jan 18, 2022
1 parent 4519b95 commit 48e5c97
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 38 deletions.
2 changes: 1 addition & 1 deletion api/encoding_encodings_live_insertable_content_stop_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func NewEncodingEncodingsLiveInsertableContentStopAPIWithClient(apiClient *apicl
return a
}

// Create Stops Currently Running Inserted Content
// Create Stops currently running Inserted Content
func (api *EncodingEncodingsLiveInsertableContentStopAPI) Create(encodingId string) error {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["encoding_id"] = encodingId
Expand Down
19 changes: 1 addition & 18 deletions api/encoding_statistics_daily_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,10 @@ func (api *EncodingStatisticsDailyAPI) List(queryParams ...func(*EncodingStatist
}

// ListByDateRange List daily statistics within specific dates
func (api *EncodingStatisticsDailyAPI) ListByDateRange(from model.Date, to model.Date, queryParams ...func(*EncodingStatisticsDailyAPIListByDateRangeQueryParams)) (*pagination.DailyStatisticssListByDateRangePagination, error) {
queryParameters := &EncodingStatisticsDailyAPIListByDateRangeQueryParams{}
for _, queryParam := range queryParams {
queryParam(queryParameters)
}

func (api *EncodingStatisticsDailyAPI) ListByDateRange(from model.Date, to model.Date) (*pagination.DailyStatisticssListByDateRangePagination, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["from"] = from.String()
params.PathParams["to"] = to.String()
params.QueryParams = queryParameters
}

var responseModel pagination.DailyStatisticssListByDateRangePagination
Expand All @@ -71,14 +65,3 @@ type EncodingStatisticsDailyAPIListQueryParams struct {
func (q *EncodingStatisticsDailyAPIListQueryParams) Params() map[string]string {
return apiclient.GetParamsMap(q)
}

// EncodingStatisticsDailyAPIListByDateRangeQueryParams contains all query parameters for the ListByDateRange endpoint
type EncodingStatisticsDailyAPIListByDateRangeQueryParams struct {
Offset int32 `query:"offset"`
Limit int32 `query:"limit"`
}

// Params will return a map of query parameters
func (q *EncodingStatisticsDailyAPIListByDateRangeQueryParams) Params() map[string]string {
return apiclient.GetParamsMap(q)
}
19 changes: 1 addition & 18 deletions api/encoding_statistics_encodings_live_daily_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,13 @@ func NewEncodingStatisticsEncodingsLiveDailyAPIWithClient(apiClient *apiclient.A
}

// ListByDateRange List daily live encoding statistics within specific dates
func (api *EncodingStatisticsEncodingsLiveDailyAPI) ListByDateRange(from model.Date, to model.Date, queryParams ...func(*EncodingStatisticsEncodingsLiveDailyAPIListByDateRangeQueryParams)) (*pagination.EncodingStatisticsLivesListByDateRangePagination, error) {
queryParameters := &EncodingStatisticsEncodingsLiveDailyAPIListByDateRangeQueryParams{}
for _, queryParam := range queryParams {
queryParam(queryParameters)
}

func (api *EncodingStatisticsEncodingsLiveDailyAPI) ListByDateRange(from model.Date, to model.Date) (*pagination.EncodingStatisticsLivesListByDateRangePagination, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["from"] = from.String()
params.PathParams["to"] = to.String()
params.QueryParams = queryParameters
}

var responseModel pagination.EncodingStatisticsLivesListByDateRangePagination
err := api.apiClient.Get("/encoding/statistics/encodings/live/daily/{from}/{to}", nil, &responseModel, reqParams)
return &responseModel, err
}

// EncodingStatisticsEncodingsLiveDailyAPIListByDateRangeQueryParams contains all query parameters for the ListByDateRange endpoint
type EncodingStatisticsEncodingsLiveDailyAPIListByDateRangeQueryParams struct {
Offset int32 `query:"offset"`
Limit int32 `query:"limit"`
}

// Params will return a map of query parameters
func (q *EncodingStatisticsEncodingsLiveDailyAPIListByDateRangeQueryParams) Params() map[string]string {
return apiclient.GetParamsMap(q)
}
5 changes: 5 additions & 0 deletions api/encoding_statistics_encodings_vod_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import (
// EncodingStatisticsEncodingsVodAPI communicates with '/encoding/statistics/encodings/vod' endpoints
type EncodingStatisticsEncodingsVodAPI struct {
apiClient *apiclient.APIClient

// Daily communicates with '/encoding/statistics/encodings/vod/daily/{from}/{to}' endpoints
Daily *EncodingStatisticsEncodingsVodDailyAPI
}

// NewEncodingStatisticsEncodingsVodAPI constructor for EncodingStatisticsEncodingsVodAPI that takes options as argument
Expand All @@ -24,6 +27,8 @@ func NewEncodingStatisticsEncodingsVodAPI(options ...apiclient.APIClientOption)
// NewEncodingStatisticsEncodingsVodAPIWithClient constructor for EncodingStatisticsEncodingsVodAPI that takes an APIClient as argument
func NewEncodingStatisticsEncodingsVodAPIWithClient(apiClient *apiclient.APIClient) *EncodingStatisticsEncodingsVodAPI {
a := &EncodingStatisticsEncodingsVodAPI{apiClient: apiClient}
a.Daily = NewEncodingStatisticsEncodingsVodDailyAPIWithClient(apiClient)

return a
}

Expand Down
40 changes: 40 additions & 0 deletions api/encoding_statistics_encodings_vod_daily_api.go
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
}
2 changes: 1 addition & 1 deletion apiclient/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type PathParams map[string]interface{}
const QueryParamTagName = "query"
const DefaultAPIBaseURL = "https://api.bitmovin.com/v1"
const ContentTypeJson = "application/json"
const APIClientVersion = "1.100.0-alpha.0"
const APIClientVersion = "1.101.0-alpha.0"
const APIClientName = "bitmovin-api-sdk-go"
const NoAPIKeyErrorMsg = "there was no api key provided"

Expand Down
10 changes: 10 additions & 0 deletions model/analytics_export_file_format.go
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"
)
2 changes: 2 additions & 0 deletions model/analytics_export_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ type AnalyticsExportTask struct {
FinishedAt *DateTime `json:"finishedAt,omitempty"`
Type AnalyticsExportType `json:"type,omitempty"`
Columns []string `json:"columns,omitempty"`
// File format of export file
FileFormat AnalyticsExportFileFormat `json:"fileFormat,omitempty"`
}
42 changes: 42 additions & 0 deletions pagination/encoding_statisticss_list_by_date_range_pagination.go
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
}

0 comments on commit 48e5c97

Please sign in to comment.