Skip to content

Commit

Permalink
Updated Go client to v1.58.0-alpha.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Bitmovin OpenApi Bot committed Feb 2, 2021
1 parent f453761 commit 92d2bfc
Show file tree
Hide file tree
Showing 14 changed files with 298 additions and 6 deletions.
3 changes: 3 additions & 0 deletions api/encoding_encodings_streams_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ type EncodingEncodingsStreamsAPI struct {
Filters *EncodingEncodingsStreamsFiltersAPI
// BurnInSubtitles intermediary API object with no endpoints
BurnInSubtitles *EncodingEncodingsStreamsBurnInSubtitlesAPI
// Watermarking intermediary API object with no endpoints
Watermarking *EncodingEncodingsStreamsWatermarkingAPI
// Captions intermediary API object with no endpoints
Captions *EncodingEncodingsStreamsCaptionsAPI
// Bifs communicates with '/encoding/encodings/{encoding_id}/streams/{stream_id}/bifs' endpoints
Expand Down Expand Up @@ -52,6 +54,7 @@ func NewEncodingEncodingsStreamsAPIWithClient(apiClient *apiclient.APIClient) *E
a.Inputs = NewEncodingEncodingsStreamsInputsAPIWithClient(apiClient)
a.Filters = NewEncodingEncodingsStreamsFiltersAPIWithClient(apiClient)
a.BurnInSubtitles = NewEncodingEncodingsStreamsBurnInSubtitlesAPIWithClient(apiClient)
a.Watermarking = NewEncodingEncodingsStreamsWatermarkingAPIWithClient(apiClient)
a.Captions = NewEncodingEncodingsStreamsCaptionsAPIWithClient(apiClient)
a.Bifs = NewEncodingEncodingsStreamsBifsAPIWithClient(apiClient)
a.Hdr = NewEncodingEncodingsStreamsHdrAPIWithClient(apiClient)
Expand Down
31 changes: 31 additions & 0 deletions api/encoding_encodings_streams_watermarking_api.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package api

import (
"github.com/bitmovin/bitmovin-api-sdk-go/apiclient"
)

// EncodingEncodingsStreamsWatermarkingAPI intermediary API object with no endpoints
type EncodingEncodingsStreamsWatermarkingAPI struct {
apiClient *apiclient.APIClient

// NexguardFileMarker communicates with '/encoding/encodings/{encoding_id}/streams/{stream_id}/watermarking/nexguard-file-marker' endpoints
NexguardFileMarker *EncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPI
}

// NewEncodingEncodingsStreamsWatermarkingAPI constructor for EncodingEncodingsStreamsWatermarkingAPI that takes options as argument
func NewEncodingEncodingsStreamsWatermarkingAPI(options ...apiclient.APIClientOption) (*EncodingEncodingsStreamsWatermarkingAPI, error) {
apiClient, err := apiclient.NewAPIClient(options...)
if err != nil {
return nil, err
}

return NewEncodingEncodingsStreamsWatermarkingAPIWithClient(apiClient), nil
}

// NewEncodingEncodingsStreamsWatermarkingAPIWithClient constructor for EncodingEncodingsStreamsWatermarkingAPI that takes an APIClient as argument
func NewEncodingEncodingsStreamsWatermarkingAPIWithClient(apiClient *apiclient.APIClient) *EncodingEncodingsStreamsWatermarkingAPI {
a := &EncodingEncodingsStreamsWatermarkingAPI{apiClient: apiClient}
a.NexguardFileMarker = NewEncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPIWithClient(apiClient)

return a
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
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"
)

// EncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPI communicates with '/encoding/encodings/{encoding_id}/streams/{stream_id}/watermarking/nexguard-file-marker' endpoints
type EncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPI struct {
apiClient *apiclient.APIClient

// Customdata communicates with '/encoding/encodings/{encoding_id}/streams/{stream_id}/watermarking/nexguard-file-marker/{nexguard_id}/customData' endpoints
Customdata *EncodingEncodingsStreamsWatermarkingNexguardFileMarkerCustomdataAPI
}

// NewEncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPI constructor for EncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPI that takes options as argument
func NewEncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPI(options ...apiclient.APIClientOption) (*EncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPI, error) {
apiClient, err := apiclient.NewAPIClient(options...)
if err != nil {
return nil, err
}

return NewEncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPIWithClient(apiClient), nil
}

// NewEncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPIWithClient constructor for EncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPI that takes an APIClient as argument
func NewEncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPIWithClient(apiClient *apiclient.APIClient) *EncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPI {
a := &EncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPI{apiClient: apiClient}
a.Customdata = NewEncodingEncodingsStreamsWatermarkingNexguardFileMarkerCustomdataAPIWithClient(apiClient)

return a
}

// Create Add a nexguard file marker watermarking configurations
// Nexguard FileMarker watermarking has several restrictions on the shape of your streams and muxings. The supported muxings are currently fMP4, TS and WebM; segment naming must follow `<filename>_<number>.<extension>`; init segment naming must follow `<filename>_init.<extension>` Supported framerates: * 23.976 * 24.000 * 25.000 * 29.970 * 30.000 * 48.000 * 50.000 * 59.940 * 60.000 Resolution: * 320 <= width <= 5120 * 240 <= height <= 3200 And the GOP size has to be 2 or 2.002 seconds. Please note that our api requires the gop size to be in frames.
func (api *EncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPI) Create(encodingId string, streamId string, nexGuardFileMarker model.NexGuardFileMarker) (*model.NexGuardFileMarker, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["encoding_id"] = encodingId
params.PathParams["stream_id"] = streamId
}

var responseModel model.NexGuardFileMarker
err := api.apiClient.Post("/encoding/encodings/{encoding_id}/streams/{stream_id}/watermarking/nexguard-file-marker", &nexGuardFileMarker, &responseModel, reqParams)
return &responseModel, err
}

// Delete nexguard file marker watermarking configurations
func (api *EncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPI) Delete(encodingId string, streamId string, nexguardId string) (*model.BitmovinResponse, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["encoding_id"] = encodingId
params.PathParams["stream_id"] = streamId
params.PathParams["nexguard_id"] = nexguardId
}

var responseModel model.BitmovinResponse
err := api.apiClient.Delete("/encoding/encodings/{encoding_id}/streams/{stream_id}/watermarking/nexguard-file-marker/{nexguard_id}", nil, &responseModel, reqParams)
return &responseModel, err
}

// Get Nexguard file marker watermarking configurations details
func (api *EncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPI) Get(encodingId string, streamId string, nexguardId string) (*model.NexGuardFileMarker, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["encoding_id"] = encodingId
params.PathParams["stream_id"] = streamId
params.PathParams["nexguard_id"] = nexguardId
}

var responseModel model.NexGuardFileMarker
err := api.apiClient.Get("/encoding/encodings/{encoding_id}/streams/{stream_id}/watermarking/nexguard-file-marker/{nexguard_id}", nil, &responseModel, reqParams)
return &responseModel, err
}

// List nexguard file marker watermarking configurations
func (api *EncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPI) List(encodingId string, streamId string, queryParams ...func(*EncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPIListQueryParams)) (*pagination.NexGuardFileMarkersListPagination, error) {
queryParameters := &EncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPIListQueryParams{}
for _, queryParam := range queryParams {
queryParam(queryParameters)
}

reqParams := func(params *apiclient.RequestParams) {
params.PathParams["encoding_id"] = encodingId
params.PathParams["stream_id"] = streamId
params.QueryParams = queryParameters
}

var responseModel pagination.NexGuardFileMarkersListPagination
err := api.apiClient.Get("/encoding/encodings/{encoding_id}/streams/{stream_id}/watermarking/nexguard-file-marker", nil, &responseModel, reqParams)
return &responseModel, err
}

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

// Params will return a map of query parameters
func (q *EncodingEncodingsStreamsWatermarkingNexguardFileMarkerAPIListQueryParams) Params() map[string]string {
return apiclient.GetParamsMap(q)
}
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"
)

// EncodingEncodingsStreamsWatermarkingNexguardFileMarkerCustomdataAPI communicates with '/encoding/encodings/{encoding_id}/streams/{stream_id}/watermarking/nexguard-file-marker/{nexguard_id}/customData' endpoints
type EncodingEncodingsStreamsWatermarkingNexguardFileMarkerCustomdataAPI struct {
apiClient *apiclient.APIClient
}

// NewEncodingEncodingsStreamsWatermarkingNexguardFileMarkerCustomdataAPI constructor for EncodingEncodingsStreamsWatermarkingNexguardFileMarkerCustomdataAPI that takes options as argument
func NewEncodingEncodingsStreamsWatermarkingNexguardFileMarkerCustomdataAPI(options ...apiclient.APIClientOption) (*EncodingEncodingsStreamsWatermarkingNexguardFileMarkerCustomdataAPI, error) {
apiClient, err := apiclient.NewAPIClient(options...)
if err != nil {
return nil, err
}

return NewEncodingEncodingsStreamsWatermarkingNexguardFileMarkerCustomdataAPIWithClient(apiClient), nil
}

// NewEncodingEncodingsStreamsWatermarkingNexguardFileMarkerCustomdataAPIWithClient constructor for EncodingEncodingsStreamsWatermarkingNexguardFileMarkerCustomdataAPI that takes an APIClient as argument
func NewEncodingEncodingsStreamsWatermarkingNexguardFileMarkerCustomdataAPIWithClient(apiClient *apiclient.APIClient) *EncodingEncodingsStreamsWatermarkingNexguardFileMarkerCustomdataAPI {
a := &EncodingEncodingsStreamsWatermarkingNexguardFileMarkerCustomdataAPI{apiClient: apiClient}
return a
}

// Get Nexguard file marker watermarking configuration Custom Data
func (api *EncodingEncodingsStreamsWatermarkingNexguardFileMarkerCustomdataAPI) Get(encodingId string, streamId string, nexguardId string) (*model.CustomData, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["encoding_id"] = encodingId
params.PathParams["stream_id"] = streamId
params.PathParams["nexguard_id"] = nexguardId
}

var responseModel model.CustomData
err := api.apiClient.Get("/encoding/encodings/{encoding_id}/streams/{stream_id}/watermarking/nexguard-file-marker/{nexguard_id}/customData", 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.57.0-alpha.0"
const APIClientVersion = "1.58.0-alpha.0"
const APIClientName = "bitmovin-api-sdk-go"
const NoAPIKeyErrorMsg = "there was no api key provided"

Expand Down
5 changes: 3 additions & 2 deletions model/billable_encoding_minutes.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type BillableEncodingMinutes struct {
// Indicates if the stream was part of a live encoding.
Live *bool `json:"live,omitempty"`
// Indicates if an enhanced interlace filter was used.
EnhancedDeinterlace *bool `json:"enhancedDeinterlace,omitempty"`
BillableMinutes *BillableEncodingMinutesDetails `json:"billableMinutes,omitempty"`
EnhancedDeinterlace *bool `json:"enhancedDeinterlace,omitempty"`
NexGuardABWatermarkingType *NexGuardAbWatermarkingFeature `json:"nexGuardABWatermarkingType,omitempty"`
BillableMinutes *BillableEncodingMinutesDetails `json:"billableMinutes,omitempty"`
}
10 changes: 10 additions & 0 deletions model/nex_guard_ab_watermarking_feature.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package model

// NexGuardAbWatermarkingFeature : NexGuardAbWatermarkingFeature model
type NexGuardAbWatermarkingFeature string

// List of possible NexGuardABWatermarkingFeature values
const (
NexGuardAbWatermarkingFeature_OTT NexGuardAbWatermarkingFeature = "OTT"
NexGuardAbWatermarkingFeature_DUPLICATED NexGuardAbWatermarkingFeature = "DUPLICATED"
)
27 changes: 27 additions & 0 deletions model/nex_guard_file_marker.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package model

// NexGuardFileMarker model
type NexGuardFileMarker struct {
// Name of the resource. Can be freely chosen by the user.
Name *string `json:"name,omitempty"`
// Description of the resource. Can be freely chosen by the user.
Description *string `json:"description,omitempty"`
// Creation timestamp, returned as UTC expressed in ISO 8601 format: YYYY-MM-DDThh:mm:ssZ
CreatedAt *DateTime `json:"createdAt,omitempty"`
// Modified timestamp, returned as UTC expressed in ISO 8601 format: YYYY-MM-DDThh:mm:ssZ
ModifiedAt *DateTime `json:"modifiedAt,omitempty"`
// User-specific meta data. This can hold anything.
CustomData *map[string]interface{} `json:"customData,omitempty"`
// Id of the resource (required)
Id *string `json:"id,omitempty"`
// Use the base64 license string that Nagra provides you. (required)
License *string `json:"license,omitempty"`
// The type of watermarking to be used. Usually, OTT is the one recommended in production.
WatermarkType NexGuardWatermarkingType `json:"watermarkType,omitempty"`
// Specify the payload ID that you want to be associated with this output. Valid values vary depending on your Nagra NexGuard forensic watermarking workflow. For PreRelease Content (NGPR), specify an integer from 1 through 4,194,303. You must generate a unique ID for each asset you watermark, and keep a record of th ID. Neither Nagra nor Bitmovin keep track of this for you.
Payload *int32 `json:"payload,omitempty"`
// Enter one of the watermarking preset strings that Nagra provides you.
Preset *string `json:"preset,omitempty"`
// Optional. Ignore this setting unless Nagra support directs you to specify a value. When you don't specify a value here, the Nagra NexGuard library uses its default value.
Strength NexGuardWatermarkingStrength `json:"strength,omitempty"`
}
13 changes: 13 additions & 0 deletions model/nex_guard_watermarking_strength.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package model

// NexGuardWatermarkingStrength : NexGuardWatermarkingStrength model
type NexGuardWatermarkingStrength string

// List of possible NexGuardWatermarkingStrength values
const (
NexGuardWatermarkingStrength_LIGHTEST NexGuardWatermarkingStrength = "LIGHTEST"
NexGuardWatermarkingStrength_LIGHTER NexGuardWatermarkingStrength = "LIGHTER"
NexGuardWatermarkingStrength_DEFAULT NexGuardWatermarkingStrength = "DEFAULT"
NexGuardWatermarkingStrength_STRONGER NexGuardWatermarkingStrength = "STRONGER"
NexGuardWatermarkingStrength_STRONGEST NexGuardWatermarkingStrength = "STRONGEST"
)
10 changes: 10 additions & 0 deletions model/nex_guard_watermarking_type.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package model

// NexGuardWatermarkingType : NexGuardWatermarkingType model
type NexGuardWatermarkingType string

// List of possible NexGuardWatermarkingType values
const (
NexGuardWatermarkingType_OTT NexGuardWatermarkingType = "OTT"
NexGuardWatermarkingType_DUPLICATED NexGuardWatermarkingType = "DUPLICATED"
)
7 changes: 5 additions & 2 deletions model/statistics_per_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ type StatisticsPerStream struct {
// Indicates if an enhanced interlace filter was used.
EnhancedDeinterlace *bool `json:"enhancedDeinterlace,omitempty"`
// The output minutes multiplicator for streams using an enhanced deinterlace filter.
EnhancedDeinterlaceMultiplicator *float64 `json:"enhancedDeinterlaceMultiplicator,omitempty"`
InputFactor *InputFactor `json:"inputFactor,omitempty"`
EnhancedDeinterlaceMultiplicator *float64 `json:"enhancedDeinterlaceMultiplicator,omitempty"`
NexGuardABWatermarkingType *NexGuardAbWatermarkingFeature `json:"nexGuardABWatermarkingType,omitempty"`
// The output minutes multiplicator for streams using a NexGuard A/B Watermarking.
NexGuardABWatermarkingMultiplicator *float64 `json:"nexGuardABWatermarkingMultiplicator,omitempty"`
InputFactor *InputFactor `json:"inputFactor,omitempty"`
}
3 changes: 2 additions & 1 deletion model/web_vtt_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ type WebVttConfiguration struct {
// If set to true, the hours section on webvtt timestamp values will explicitely have zeroes instead of being omitted for values where hours = 0.
AppendOptionalZeroHour *bool `json:"appendOptionalZeroHour,omitempty"`
// If set to true, the region information of the resulting webvtt file will be omitted. Defaults to false.
IgnoreRegion *bool `json:"ignoreRegion,omitempty"`
IgnoreRegion *bool `json:"ignoreRegion,omitempty"`
CueIdentifierPolicy WebVttCueIdentifierPolicy `json:"cueIdentifierPolicy,omitempty"`
}

func (m WebVttConfiguration) CodecConfigType() CodecConfigType {
Expand Down
10 changes: 10 additions & 0 deletions model/web_vtt_cue_identifier_policy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package model

// WebVttCueIdentifierPolicy : WebVttCueIdentifierPolicy model
type WebVttCueIdentifierPolicy string

// List of possible WebVttCueIdentifierPolicy values
const (
WebVttCueIdentifierPolicy_INCLUDE_IDENTIFIERS WebVttCueIdentifierPolicy = "INCLUDE_IDENTIFIERS"
WebVttCueIdentifierPolicy_OMIT_IDENTIFIERS WebVttCueIdentifierPolicy = "OMIT_IDENTIFIERS"
)
42 changes: 42 additions & 0 deletions pagination/nex_guard_file_markers_list_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"
)

// NexGuardFileMarkersListPagination model
type NexGuardFileMarkersListPagination 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.NexGuardFileMarker `json:"items,omitempty"`
}

// UnmarshalJSON unmarshals pagination model NexGuardFileMarkersListPagination from a JSON structure
func (m *NexGuardFileMarkersListPagination) UnmarshalJSON(b []byte) error {
var pageResp model.PaginationResponse
if err := json.Unmarshal(b, &pageResp); err != nil {
return err
}

var items []model.NexGuardFileMarker
if err := json.Unmarshal(pageResp.Items, &items); err != nil {
return err
}
var result NexGuardFileMarkersListPagination

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 92d2bfc

Please sign in to comment.