Skip to content

Commit

Permalink
Updated Go client to v1.195.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Bitmovin OpenApi Bot committed Jun 11, 2024
1 parent b0e31b3 commit 1f43a5f
Show file tree
Hide file tree
Showing 20 changed files with 337 additions and 22 deletions.
3 changes: 3 additions & 0 deletions api/encoding_encodings_live_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
type EncodingEncodingsLiveAPI struct {
apiClient *apiclient.APIClient

// ResetLiveManifestTimeshift communicates with '/encoding/encodings/{encoding_id}/live/reset-live-manifest-timeshift' endpoints
ResetLiveManifestTimeshift *EncodingEncodingsLiveResetLiveManifestTimeshiftAPI
// Hd communicates with '/encoding/encodings/{encoding_id}/live/hd/start' endpoints
Hd *EncodingEncodingsLiveHdAPI
// InsertableContent communicates with '/encoding/encodings/{encoding_id}/live/insertable-content' endpoints
Expand All @@ -30,6 +32,7 @@ func NewEncodingEncodingsLiveAPI(options ...apiclient.APIClientOption) (*Encodin
// NewEncodingEncodingsLiveAPIWithClient constructor for EncodingEncodingsLiveAPI that takes an APIClient as argument
func NewEncodingEncodingsLiveAPIWithClient(apiClient *apiclient.APIClient) *EncodingEncodingsLiveAPI {
a := &EncodingEncodingsLiveAPI{apiClient: apiClient}
a.ResetLiveManifestTimeshift = NewEncodingEncodingsLiveResetLiveManifestTimeshiftAPIWithClient(apiClient)
a.Hd = NewEncodingEncodingsLiveHdAPIWithClient(apiClient)
a.InsertableContent = NewEncodingEncodingsLiveInsertableContentAPIWithClient(apiClient)
a.Scte35Cue = NewEncodingEncodingsLiveScte35CueAPIWithClient(apiClient)
Expand Down
38 changes: 38 additions & 0 deletions api/encoding_encodings_live_reset_live_manifest_timeshift_api.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package api

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

// EncodingEncodingsLiveResetLiveManifestTimeshiftAPI communicates with '/encoding/encodings/{encoding_id}/live/reset-live-manifest-timeshift' endpoints
type EncodingEncodingsLiveResetLiveManifestTimeshiftAPI struct {
apiClient *apiclient.APIClient
}

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

return NewEncodingEncodingsLiveResetLiveManifestTimeshiftAPIWithClient(apiClient), nil
}

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

// Create Reset Live manifest time-shift
func (api *EncodingEncodingsLiveResetLiveManifestTimeshiftAPI) Create(encodingId string, resetLiveManifestTimeShift model.ResetLiveManifestTimeShift) (*model.ResetLiveManifestTimeShift, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["encoding_id"] = encodingId
}

var responseModel model.ResetLiveManifestTimeShift
err := api.apiClient.Post("/encoding/encodings/{encoding_id}/live/reset-live-manifest-timeshift", &resetLiveManifestTimeShift, &responseModel, reqParams)
return &responseModel, err
}
3 changes: 3 additions & 0 deletions api/encoding_filters_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ type EncodingFiltersAPI struct {
Watermark *EncodingFiltersWatermarkAPI
// AudioVolume communicates with '/encoding/filters/audio-volume' endpoints
AudioVolume *EncodingFiltersAudioVolumeAPI
// AzureSpeechToCaptions communicates with '/encoding/filters/azure-speech-to-captions' endpoints
AzureSpeechToCaptions *EncodingFiltersAzureSpeechToCaptionsAPI
// EnhancedWatermark communicates with '/encoding/filters/enhanced-watermark' endpoints
EnhancedWatermark *EncodingFiltersEnhancedWatermarkAPI
// Crop communicates with '/encoding/filters/crop' endpoints
Expand Down Expand Up @@ -61,6 +63,7 @@ func NewEncodingFiltersAPIWithClient(apiClient *apiclient.APIClient) *EncodingFi
a.Conform = NewEncodingFiltersConformAPIWithClient(apiClient)
a.Watermark = NewEncodingFiltersWatermarkAPIWithClient(apiClient)
a.AudioVolume = NewEncodingFiltersAudioVolumeAPIWithClient(apiClient)
a.AzureSpeechToCaptions = NewEncodingFiltersAzureSpeechToCaptionsAPIWithClient(apiClient)
a.EnhancedWatermark = NewEncodingFiltersEnhancedWatermarkAPIWithClient(apiClient)
a.Crop = NewEncodingFiltersCropAPIWithClient(apiClient)
a.Rotate = NewEncodingFiltersRotateAPIWithClient(apiClient)
Expand Down
94 changes: 94 additions & 0 deletions api/encoding_filters_azure_speech_to_captions_api.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
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"
)

// EncodingFiltersAzureSpeechToCaptionsAPI communicates with '/encoding/filters/azure-speech-to-captions' endpoints
type EncodingFiltersAzureSpeechToCaptionsAPI struct {
apiClient *apiclient.APIClient

// Customdata communicates with '/encoding/filters/azure-speech-to-captions/{filter_id}/customData' endpoints
Customdata *EncodingFiltersAzureSpeechToCaptionsCustomdataAPI
}

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

return NewEncodingFiltersAzureSpeechToCaptionsAPIWithClient(apiClient), nil
}

// NewEncodingFiltersAzureSpeechToCaptionsAPIWithClient constructor for EncodingFiltersAzureSpeechToCaptionsAPI that takes an APIClient as argument
func NewEncodingFiltersAzureSpeechToCaptionsAPIWithClient(apiClient *apiclient.APIClient) *EncodingFiltersAzureSpeechToCaptionsAPI {
a := &EncodingFiltersAzureSpeechToCaptionsAPI{apiClient: apiClient}
a.Customdata = NewEncodingFiltersAzureSpeechToCaptionsCustomdataAPIWithClient(apiClient)

return a
}

// Create Azure Speech to captions Filter
// This filter uses the Azure Speech Services - Speech to captions feature to transcribe an audio stream in real-time. - Required for this filter is an Azure account with an Azure Speech service resource. - Your own Azure speech service subscription key is required. - This filter only works for Live Encodings. - This filter transforms an audio input stream into a captions stream. - The filter must be applied to a stream that has an audio input. - The stream's codec configuration must be a subtitle or caption format (WebVtt, TTML, ..).
func (api *EncodingFiltersAzureSpeechToCaptionsAPI) Create(azureSpeechToCaptionsFilter model.AzureSpeechToCaptionsFilter) (*model.AzureSpeechToCaptionsFilter, error) {
reqParams := func(params *apiclient.RequestParams) {
}

var responseModel model.AzureSpeechToCaptionsFilter
err := api.apiClient.Post("/encoding/filters/azure-speech-to-captions", &azureSpeechToCaptionsFilter, &responseModel, reqParams)
return &responseModel, err
}

// Delete Azure Speech to captions Filter
func (api *EncodingFiltersAzureSpeechToCaptionsAPI) Delete(filterId string) (*model.BitmovinResponse, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["filter_id"] = filterId
}

var responseModel model.BitmovinResponse
err := api.apiClient.Delete("/encoding/filters/azure-speech-to-captions/{filter_id}", nil, &responseModel, reqParams)
return &responseModel, err
}

// Get Azure Speech to captions Filter details
func (api *EncodingFiltersAzureSpeechToCaptionsAPI) Get(filterId string) (*model.AzureSpeechToCaptionsFilter, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["filter_id"] = filterId
}

var responseModel model.AzureSpeechToCaptionsFilter
err := api.apiClient.Get("/encoding/filters/azure-speech-to-captions/{filter_id}", nil, &responseModel, reqParams)
return &responseModel, err
}

// List Azure Speech to captions Filters
func (api *EncodingFiltersAzureSpeechToCaptionsAPI) List(queryParams ...func(*EncodingFiltersAzureSpeechToCaptionsAPIListQueryParams)) (*pagination.AzureSpeechToCaptionsFiltersListPagination, error) {
queryParameters := &EncodingFiltersAzureSpeechToCaptionsAPIListQueryParams{}
for _, queryParam := range queryParams {
queryParam(queryParameters)
}

reqParams := func(params *apiclient.RequestParams) {
params.QueryParams = queryParameters
}

var responseModel pagination.AzureSpeechToCaptionsFiltersListPagination
err := api.apiClient.Get("/encoding/filters/azure-speech-to-captions", nil, &responseModel, reqParams)
return &responseModel, err
}

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

// Params will return a map of query parameters
func (q *EncodingFiltersAzureSpeechToCaptionsAPIListQueryParams) Params() map[string]string {
return apiclient.GetParamsMap(q)
}
38 changes: 38 additions & 0 deletions api/encoding_filters_azure_speech_to_captions_customdata_api.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package api

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

// EncodingFiltersAzureSpeechToCaptionsCustomdataAPI communicates with '/encoding/filters/azure-speech-to-captions/{filter_id}/customData' endpoints
type EncodingFiltersAzureSpeechToCaptionsCustomdataAPI struct {
apiClient *apiclient.APIClient
}

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

return NewEncodingFiltersAzureSpeechToCaptionsCustomdataAPIWithClient(apiClient), nil
}

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

// Get Azure Speech to captions Filter Custom Data
func (api *EncodingFiltersAzureSpeechToCaptionsCustomdataAPI) Get(filterId string) (*model.CustomData, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["filter_id"] = filterId
}

var responseModel model.CustomData
err := api.apiClient.Get("/encoding/filters/azure-speech-to-captions/{filter_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.194.0"
const APIClientVersion = "1.195.0"
const APIClientName = "bitmovin-api-sdk-go"
const NoAPIKeyErrorMsg = "there was no api key provided"

Expand Down
7 changes: 7 additions & 0 deletions model/azure_speech_services_credentials.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package model

// AzureSpeechServicesCredentials model
type AzureSpeechServicesCredentials struct {
// Azure Speech Services resource key (required)
SubscriptionKey *string `json:"subscriptionKey,omitempty"`
}
37 changes: 37 additions & 0 deletions model/azure_speech_to_captions_filter.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package model

import (
"encoding/json"
)

// AzureSpeechToCaptionsFilter model
type AzureSpeechToCaptionsFilter struct {
// Id of the resource (required)
Id *string `json:"id,omitempty"`
// 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"`
AzureSpeechToCaptionsSettings *AzureSpeechToCaptionsSettings `json:"azureSpeechToCaptionsSettings,omitempty"`
}

func (m AzureSpeechToCaptionsFilter) FilterType() FilterType {
return FilterType_AZURE_SPEECH_TO_CAPTIONS
}
func (m AzureSpeechToCaptionsFilter) MarshalJSON() ([]byte, error) {
type M AzureSpeechToCaptionsFilter
x := struct {
Type string `json:"type"`
M
}{M: M(m)}

x.Type = "AZURE_SPEECH_TO_CAPTIONS"

return json.Marshal(x)
}
11 changes: 11 additions & 0 deletions model/azure_speech_to_captions_profanity.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package model

// AzureSpeechToCaptionsProfanity : AzureSpeechToCaptionsProfanity model
type AzureSpeechToCaptionsProfanity string

// List of possible AzureSpeechToCaptionsProfanity values
const (
AzureSpeechToCaptionsProfanity_MASKED AzureSpeechToCaptionsProfanity = "MASKED"
AzureSpeechToCaptionsProfanity_REMOVED AzureSpeechToCaptionsProfanity = "REMOVED"
AzureSpeechToCaptionsProfanity_RAW AzureSpeechToCaptionsProfanity = "RAW"
)
23 changes: 23 additions & 0 deletions model/azure_speech_to_captions_settings.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package model

// AzureSpeechToCaptionsSettings model
type AzureSpeechToCaptionsSettings struct {
// Credential settings to access Azure Speech Services
AzureSpeechServicesCredentials *AzureSpeechServicesCredentials `json:"azureSpeechServicesCredentials,omitempty"`
// Azure Speech Services Region Identifier. The list of speech service supported regions can be found at Azure's official documentation.
Region *string `json:"region,omitempty"`
// Azure Speech Services API endpoint. This information can be found in Azure's Speech resource data.
ApiEndpoint *string `json:"apiEndpoint,omitempty"`
// Azure Speech to captions supported language (IETF BCP 47 language tag). The list of supported languages can be found at Azure's official documentation.
Language *string `json:"language,omitempty"`
// How many MILLISECONDS to delay the display of each caption, to mimic a real-time experience. The minimum value is 0.
CaptionDelay *int64 `json:"captionDelay,omitempty"`
// How many MILLISECONDS a caption should remain on screen if it is not replaced by another. The minimum value is 0.
CaptionRemainTime *int64 `json:"captionRemainTime,omitempty"`
// The maximum number of characters per line for a caption. The minimum value is 20.
CaptionMaxLineLength *int64 `json:"captionMaxLineLength,omitempty"`
// The number of lines for a caption. The minimum value is 1.
CaptionLines *int64 `json:"captionLines,omitempty"`
// The profanity filter options are: - Masked: Replaces letters in profane words with asterisk (*) characters. - Raw: Include the profane words verbatim. - Removed: Removes profane words.
ProfanityOption AzureSpeechToCaptionsProfanity `json:"profanityOption,omitempty"`
}
2 changes: 1 addition & 1 deletion model/chunked_text_muxing.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type ChunkedTextMuxing struct {
SegmentLength *float64 `json:"segmentLength,omitempty"`
// Segment naming policy
SegmentNaming *string `json:"segmentNaming,omitempty"`
// Segment naming template with placeholders which will be replaced during the encoding. The result will be saved in segmentNaming. {rand:4} gets replaced with an alphanumeric string of length specified after the colon. Defaults to 32. If this field is set, segmentNaming must not be specified.
// Segment naming policy containing one or both of the following placeholders: - '{rand_chars:x}', which will be replaced by a random alphanumeric string of length x (default 32) on each (re)start of the encoding. The resulting string will be copied to the segmentNaming property. Intended to avoid re-use of segment names after restarting a live encoding. - '{segment_rand_chars:x}', which will be replaced by a random alphanumeric string of length x (default 32) for each different segment. This is intended to avoid guessing segment URLs by replacing segment numbers. If segmentNamingTemplate is set, segmentNaming must not be set.
SegmentNamingTemplate *string `json:"segmentNamingTemplate,omitempty"`
// Offset of MPEG-TS timestamps in seconds. This only affects streams with [WebVttConfiguration](#/Encoding/PostEncodingConfigurationsSubtitlesWebVtt). If set, the X-TIMESTAMP-MAP will be added as described in the [HLS specification](https://datatracker.ietf.org/doc/html/rfc8216#section-3.5). For example, if set to 10 seconds, *X-TIMESTAMP-MAP=MPEGTS:900000,LOCAL:00:00:00.000* will be added after each *WEBVTT* header. The default for ChunkedTextMuxing is that the X-TIMESTAMP-MAP will not be written. Important to note is that the default for `startOffset` for [TsMuxings](#/Encoding/PostEncodingEncodingsMuxingsTsByEncodingId) and [ProgressiveTsMuxings](#/Encoding/PostEncodingEncodingsMuxingsProgressiveTsByEncodingId) is 10 seconds. If the output of this muxing is used for HLS together with video/audio streams using TsMuxings and ProgressiveTsMuxings, this value should be set to the same `startOffset`.
StartOffset *int32 `json:"startOffset,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion model/cmaf_muxing.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type CmafMuxing struct {
SegmentLength *float64 `json:"segmentLength,omitempty"`
// Segment naming policy
SegmentNaming *string `json:"segmentNaming,omitempty"`
// Segment naming policy containing a placeholder of the format '{rand_chars:x}', which will be replaced by a random alphanumeric string of length x (default 32) on each (re)start of the encoding. The resulting string will be copied to the segmentNaming property. Intended to avoid re-use of segment names after restarting a live encoding. If segmentNamingTemplate is set, segmentNaming must not be set.
// Segment naming policy containing one or both of the following placeholders: - '{rand_chars:x}', which will be replaced by a random alphanumeric string of length x (default 32) on each (re)start of the encoding. The resulting string will be copied to the segmentNaming property. Intended to avoid re-use of segment names after restarting a live encoding. - '{segment_rand_chars:x}', which will be replaced by a random alphanumeric string of length x (default 32) for each different segment. This is intended to avoid guessing segment URLs by replacing segment numbers. If segmentNamingTemplate is set, segmentNaming must not be set.
SegmentNamingTemplate *string `json:"segmentNamingTemplate,omitempty"`
// Init segment name
InitSegmentName *string `json:"initSegmentName,omitempty"`
Expand Down
7 changes: 7 additions & 0 deletions model/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,13 @@ func unmarshalFilter(data []byte, consumer bitutils.Consumer) (Filter, error) {
}
return result, nil

case "AZURE_SPEECH_TO_CAPTIONS":
var result AzureSpeechToCaptionsFilter
if err := consumer.Consume(buf2, &result); err != nil {
return nil, err
}
return result, nil

default:
return baseType, nil
}
Expand Down
Loading

0 comments on commit 1f43a5f

Please sign in to comment.