Skip to content

Commit 5856759

Browse files
authored
Regen from latest OpenAPI spec (#55)
1 parent 8b1b71b commit 5856759

25 files changed

+341
-175
lines changed

api_assets.go

+78
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,84 @@ func (a *AssetsApiService) DeleteAssetTrack(aSSETID string, tRACKID string, opts
439439
return nil
440440
}
441441

442+
func (a *AssetsApiService) GenerateAssetTrackSubtitles(aSSETID string, tRACKID string, generateTrackSubtitlesRequest GenerateTrackSubtitlesRequest, opts ...APIOption) (GenerateTrackSubtitlesResponse, error) {
443+
var (
444+
localVarAPIOptions = new(APIOptions)
445+
localVarHttpMethod = strings.ToUpper("Post")
446+
localVarPostBody interface{}
447+
localVarFormFileName string
448+
localVarFileName string
449+
localVarFileBytes []byte
450+
localVarReturnValue GenerateTrackSubtitlesResponse
451+
)
452+
453+
for _, opt := range opts {
454+
opt(localVarAPIOptions)
455+
}
456+
457+
// create path and map variables
458+
localVarPath := a.client.cfg.basePath + "/video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID}/generate-subtitles"
459+
localVarPath = strings.Replace(localVarPath, "{"+"ASSET_ID"+"}", fmt.Sprintf("%v", aSSETID), -1)
460+
localVarPath = strings.Replace(localVarPath, "{"+"TRACK_ID"+"}", fmt.Sprintf("%v", tRACKID), -1)
461+
462+
localVarHeaderParams := make(map[string]string)
463+
localVarQueryParams := url.Values{}
464+
localVarFormParams := url.Values{}
465+
466+
// to determine the Content-Type header
467+
localVarHttpContentTypes := []string{"application/json"}
468+
469+
// set Content-Type header
470+
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
471+
if localVarHttpContentType != "" {
472+
localVarHeaderParams["Content-Type"] = localVarHttpContentType
473+
}
474+
475+
// to determine the Accept header
476+
localVarHttpHeaderAccepts := []string{"application/json"}
477+
478+
// set Accept header
479+
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
480+
if localVarHttpHeaderAccept != "" {
481+
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
482+
}
483+
// body params
484+
localVarPostBody = &generateTrackSubtitlesRequest
485+
486+
r, err := a.client.prepareRequest(localVarAPIOptions, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
487+
if err != nil {
488+
return localVarReturnValue, err
489+
}
490+
491+
localVarHttpResponse, err := a.client.callAPI(r)
492+
if err != nil || localVarHttpResponse == nil {
493+
return localVarReturnValue, err
494+
}
495+
496+
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
497+
localVarHttpResponse.Body.Close()
498+
if err != nil {
499+
return localVarReturnValue, err
500+
}
501+
502+
// Check for common HTTP error status codes
503+
err = CheckForHttpError(localVarHttpResponse.StatusCode, localVarBody)
504+
if err != nil {
505+
return localVarReturnValue, err
506+
}
507+
508+
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
509+
if err != nil {
510+
newErr := GenericOpenAPIError{
511+
body: localVarBody,
512+
error: err.Error(),
513+
}
514+
return localVarReturnValue, newErr
515+
}
516+
517+
return localVarReturnValue, nil
518+
}
519+
442520
func (a *AssetsApiService) GetAsset(aSSETID string, opts ...APIOption) (AssetResponse, error) {
443521
var (
444522
localVarAPIOptions = new(APIOptions)

configuration.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type ConfigurationOption func(*Configuration)
2222
func NewConfiguration(opts ...ConfigurationOption) *Configuration {
2323
cfg := &Configuration{
2424
basePath: "https://api.mux.com",
25-
userAgent: "Mux Go | 5.2.0",
25+
userAgent: "Mux Go | 5.3.0",
2626
}
2727
for _, opt := range opts {
2828
opt(cfg)

docs/Asset.md

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Name | Type | Description | Notes
3030
**RecordingTimes** | [**[]AssetRecordingTimes**](Asset_recording_times.md) | An array of individual live stream recording sessions. A recording session is created on each encoder connection during the live stream. Additionally any time slate media is inserted during brief interruptions in the live stream media or times when the live streaming software disconnects, a recording session representing the slate media will be added with a \"slate\" type. | [optional]
3131
**NonStandardInputReasons** | [**AssetNonStandardInputReasons**](Asset_non_standard_input_reasons.md) | | [optional]
3232
**Test** | **bool** | True means this live stream is a test asset. A test asset can help evaluate the Mux Video APIs without incurring any cost. There is no limit on number of test assets created. Test assets are watermarked with the Mux logo, limited to 10 seconds, and deleted after 24 hrs. | [optional]
33+
**IngestType** | **string** | The type of ingest used to create the asset. | [optional]
3334

3435
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
3536

docs/AssetsApi.md

+33-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ Method | HTTP request | Description
1010
[**DeleteAsset**](AssetsApi.md#DeleteAsset) | **Delete** /video/v1/assets/{ASSET_ID} | Delete an asset
1111
[**DeleteAssetPlaybackId**](AssetsApi.md#DeleteAssetPlaybackId) | **Delete** /video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID} | Delete a playback ID
1212
[**DeleteAssetTrack**](AssetsApi.md#DeleteAssetTrack) | **Delete** /video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID} | Delete an asset track
13+
[**GenerateAssetTrackSubtitles**](AssetsApi.md#GenerateAssetTrackSubtitles) | **Post** /video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID}/generate-subtitles | Generate track subtitles
1314
[**GetAsset**](AssetsApi.md#GetAsset) | **Get** /video/v1/assets/{ASSET_ID} | Retrieve an asset
1415
[**GetAssetInputInfo**](AssetsApi.md#GetAssetInputInfo) | **Get** /video/v1/assets/{ASSET_ID}/input-info | Retrieve asset input info
1516
[**GetAssetPlaybackId**](AssetsApi.md#GetAssetPlaybackId) | **Get** /video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID} | Retrieve a playback ID
1617
[**ListAssets**](AssetsApi.md#ListAssets) | **Get** /video/v1/assets | List assets
17-
[**UpdateAsset**](AssetsApi.md#UpdateAsset) | **Patch** /video/v1/assets/{ASSET_ID} | Update an Asset
18+
[**UpdateAsset**](AssetsApi.md#UpdateAsset) | **Patch** /video/v1/assets/{ASSET_ID} | Update an asset
1819
[**UpdateAssetMasterAccess**](AssetsApi.md#UpdateAssetMasterAccess) | **Put** /video/v1/assets/{ASSET_ID}/master-access | Update master access
1920
[**UpdateAssetMp4Support**](AssetsApi.md#UpdateAssetMp4Support) | **Put** /video/v1/assets/{ASSET_ID}/mp4-support | Update MP4 support
2021

@@ -191,6 +192,36 @@ Name | Type | Description | Notes
191192

192193
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
193194

195+
# **GenerateAssetTrackSubtitles**
196+
> GenerateTrackSubtitlesResponse GenerateAssetTrackSubtitles(ctx, aSSETID, tRACKID, generateTrackSubtitlesRequest)
197+
Generate track subtitles
198+
199+
Generates subtitles (captions) for a given audio track. This API can be used for up to 7 days after an asset is created.
200+
201+
### Required Parameters
202+
203+
Name | Type | Description | Notes
204+
------------- | ------------- | ------------- | -------------
205+
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
206+
**aSSETID** | **string**| The asset ID. |
207+
**tRACKID** | **string**| The track ID. |
208+
**generateTrackSubtitlesRequest** | [**GenerateTrackSubtitlesRequest**](GenerateTrackSubtitlesRequest.md)| |
209+
210+
### Return type
211+
212+
[**GenerateTrackSubtitlesResponse**](GenerateTrackSubtitlesResponse.md)
213+
214+
### Authorization
215+
216+
[accessToken](../README.md#accessToken)
217+
218+
### HTTP request headers
219+
220+
- **Content-Type**: application/json
221+
- **Accept**: application/json
222+
223+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
224+
194225
# **GetAsset**
195226
> AssetResponse GetAsset(ctx, aSSETID)
196227
Retrieve an asset
@@ -316,7 +347,7 @@ Name | Type | Description | Notes
316347

317348
# **UpdateAsset**
318349
> AssetResponse UpdateAsset(ctx, aSSETID, updateAssetRequest)
319-
Update an Asset
350+
Update an asset
320351

321352
Updates the details of an already-created Asset with the provided Asset ID. This currently supports only the `passthrough` field.
322353

docs/CreateSimulcastTargetRequest.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**Passthrough** | **string** | Arbitrary user-supplied metadata set by you when creating a simulcast target. | [optional]
7-
**StreamKey** | **string** | Stream Key represents a stream identifier on the third party live streaming service to send the parent live stream to. | [optional]
8-
**Url** | **string** | RTMP hostname including application name for the third party live streaming service. Example: `rtmp://live.example.com/app`. | [optional]
7+
**StreamKey** | **string** | Stream Key represents a stream identifier on the third party live streaming service to send the parent live stream to. Only used for RTMP(s) simulcast destinations. | [optional]
8+
**Url** | **string** | The RTMP(s) or SRT endpoint for a simulcast destination. * For RTMP(s) destinations, this should include the application name for the third party live streaming service, for example: `rtmp://live.example.com/app`. * For SRT destinations, this should be a fully formed SRT connection string, for example: `srt://srt-live.example.com:1234?streamid={stream_key}&passphrase={srt_passphrase}`. Note: SRT simulcast targets can only be used when an source is connected over SRT. | [optional]
99

1010
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1111

docs/Error.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Name | Type | Description | Notes
1111
**Description** | **string** | Description of the error. | [optional]
1212
**Count** | **int64** | The total number of views that experienced this error. | [optional]
1313
**Code** | **int64** | The error code | [optional]
14+
**PlayerErrorCode** | **string** | The string version of the error code | [optional]
1415

1516
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1617

docs/GenerateTrackSubtitlesRequest.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# GenerateTrackSubtitlesRequest
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**GeneratedSubtitles** | [**[]AssetGeneratedSubtitleSettings**](AssetGeneratedSubtitleSettings.md) | Generate subtitle tracks using automatic speech recognition with this configuration. | [optional]
7+
8+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
9+
10+
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# GenerateTrackSubtitlesResponse
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**Data** | [**Track**](Track.md) | | [optional]
7+
8+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
9+
10+

docs/InputSettings.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**Url** | **string** | The URL of the file that Mux should download and use. * For the main input file, this should be the URL to the muxed file for Mux to download, for example an MP4, MOV, MKV, or TS file. Mux supports most audio/video file formats and codecs, but for fastest processing, you should [use standard inputs wherever possible](https://docs.mux.com/guides/minimize-processing-time). * For `audio` tracks, the URL is the location of the audio file for Mux to download, for example an M4A, WAV, or MP3 file. Mux supports most audio file formats and codecs, but for fastest processing, you should [use standard inputs wherever possible](https://docs.mux.com/guides/minimize-processing-time). * For `text` tracks, the URL is the location of subtitle/captions file. Mux supports [SubRip Text (SRT)](https://en.wikipedia.org/wiki/SubRip) and [Web Video Text Tracks](https://www.w3.org/TR/webvtt1/) formats for ingesting Subtitles and Closed Captions. * For Watermarking or Overlay, the URL is the location of the watermark image. The maximum size is 4096x4096. * When creating clips from existing Mux assets, the URL is defined with `mux://assets/{asset_id}` template where `asset_id` is the Asset Identifier for creating the clip from. The url property may be omitted on the first input object when providing asset settings for LiveStream and Upload objects, in order to configure settings related to the primary (live stream or direct upload) input. | [optional]
77
**OverlaySettings** | [**InputSettingsOverlaySettings**](InputSettings_overlay_settings.md) | | [optional]
8-
**GeneratedSubtitles** | [**[]AssetGeneratedSubtitleSettings**](AssetGeneratedSubtitleSettings.md) | Generate subtitle tracks using automatic speech recognition using this configuration. This may only be provided for the first input object (the main input file). For direct uploads, this first input should omit the url parameter, as the main input file is provided via the direct upload. This will create subtitles based on the audio track ingested from that main input file. Note that subtitle generation happens after initial ingest, so the generated tracks will be in the `preparing` state when the asset transitions to `ready`. | [optional]
8+
**GeneratedSubtitles** | [**[]AssetGeneratedSubtitleSettings**](AssetGeneratedSubtitleSettings.md) | Generate subtitle tracks using automatic speech recognition with this configuration. This may only be provided for the first input object (the main input file). For direct uploads, this first input should omit the url parameter, as the main input file is provided via the direct upload. This will create subtitles based on the audio track ingested from that main input file. Note that subtitle generation happens after initial ingest, so the generated tracks will be in the `preparing` state when the asset transitions to `ready`. | [optional]
99
**StartTime** | **float64** | The time offset in seconds from the beginning of the video indicating the clip's starting marker. The default value is 0 when not included. This parameter is only applicable for creating clips when `input.url` has `mux://assets/{asset_id}` format. | [optional]
1010
**EndTime** | **float64** | The time offset in seconds from the beginning of the video, indicating the clip's ending marker. The default value is the duration of the video when not included. This parameter is only applicable for creating clips when `input.url` has `mux://assets/{asset_id}` format. | [optional]
1111
**Type** | **string** | This parameter is required for `text` type tracks. | [optional]

docs/LiveStream.md

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Name | Type | Description | Notes
2525
**Test** | **bool** | True means this live stream is a test live stream. Test live streams can be used to help evaluate the Mux Video APIs for free. There is no limit on the number of test live streams, but they are watermarked with the Mux logo, and limited to 5 minutes. The test live stream is disabled after the stream is active for 5 mins and the recorded asset also deleted after 24 hours. | [optional]
2626
**MaxContinuousDuration** | **int32** | The time in seconds a live stream may be continuously active before being disconnected. Defaults to 12 hours. | [optional] [default to 43200]
2727
**SrtPassphrase** | **string** | Unique key used for encrypting a stream to a Mux SRT endpoint. | [optional]
28+
**ActiveIngestProtocol** | **string** | The protocol used for the active ingest stream. This is only set when the live stream is active. | [optional]
2829

2930
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
3031

docs/LiveStreamsApi.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ Method | HTTP request | Description
99
[**CreateLiveStreamSimulcastTarget**](LiveStreamsApi.md#CreateLiveStreamSimulcastTarget) | **Post** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets | Create a live stream simulcast target
1010
[**DeleteLiveStream**](LiveStreamsApi.md#DeleteLiveStream) | **Delete** /video/v1/live-streams/{LIVE_STREAM_ID} | Delete a live stream
1111
[**DeleteLiveStreamPlaybackId**](LiveStreamsApi.md#DeleteLiveStreamPlaybackId) | **Delete** /video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids/{PLAYBACK_ID} | Delete a live stream playback ID
12-
[**DeleteLiveStreamSimulcastTarget**](LiveStreamsApi.md#DeleteLiveStreamSimulcastTarget) | **Delete** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Delete a Live Stream Simulcast Target
12+
[**DeleteLiveStreamSimulcastTarget**](LiveStreamsApi.md#DeleteLiveStreamSimulcastTarget) | **Delete** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Delete a live stream simulcast target
1313
[**DisableLiveStream**](LiveStreamsApi.md#DisableLiveStream) | **Put** /video/v1/live-streams/{LIVE_STREAM_ID}/disable | Disable a live stream
1414
[**EnableLiveStream**](LiveStreamsApi.md#EnableLiveStream) | **Put** /video/v1/live-streams/{LIVE_STREAM_ID}/enable | Enable a live stream
1515
[**GetLiveStream**](LiveStreamsApi.md#GetLiveStream) | **Get** /video/v1/live-streams/{LIVE_STREAM_ID} | Retrieve a live stream
1616
[**GetLiveStreamPlaybackId**](LiveStreamsApi.md#GetLiveStreamPlaybackId) | **Get** /video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids/{PLAYBACK_ID} | Retrieve a live stream playback ID
17-
[**GetLiveStreamSimulcastTarget**](LiveStreamsApi.md#GetLiveStreamSimulcastTarget) | **Get** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Retrieve a Live Stream Simulcast Target
17+
[**GetLiveStreamSimulcastTarget**](LiveStreamsApi.md#GetLiveStreamSimulcastTarget) | **Get** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Retrieve a live stream simulcast target
1818
[**ListLiveStreams**](LiveStreamsApi.md#ListLiveStreams) | **Get** /video/v1/live-streams | List live streams
1919
[**ResetStreamKey**](LiveStreamsApi.md#ResetStreamKey) | **Post** /video/v1/live-streams/{LIVE_STREAM_ID}/reset-stream-key | Reset a live stream's stream key
2020
[**SignalLiveStreamComplete**](LiveStreamsApi.md#SignalLiveStreamComplete) | **Put** /video/v1/live-streams/{LIVE_STREAM_ID}/complete | Signal a live stream is finished
@@ -168,7 +168,7 @@ Name | Type | Description | Notes
168168

169169
# **DeleteLiveStreamSimulcastTarget**
170170
> DeleteLiveStreamSimulcastTarget(ctx, lIVESTREAMID, sIMULCASTTARGETID)
171-
Delete a Live Stream Simulcast Target
171+
Delete a live stream simulcast target
172172

173173
Delete the simulcast target using the simulcast target ID returned when creating the simulcast target. Simulcast Target can only be deleted when the parent live stream is in idle state.
174174

@@ -310,7 +310,7 @@ Name | Type | Description | Notes
310310

311311
# **GetLiveStreamSimulcastTarget**
312312
> SimulcastTargetResponse GetLiveStreamSimulcastTarget(ctx, lIVESTREAMID, sIMULCASTTARGETID)
313-
Retrieve a Live Stream Simulcast Target
313+
Retrieve a live stream simulcast target
314314

315315
Retrieves the details of the simulcast target created for the parent live stream. Supply the unique live stream ID and simulcast target ID that was returned in the response of create simulcast target request, and Mux will return the corresponding information.
316316

docs/MonitoringBreakdownTimeseriesDatapoint.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Name | Type | Description | Notes
66
**Value** | **string** | | [optional]
77
**MetricValue** | **float64** | | [optional]
88
**ConcurrentViewers** | **int64** | | [optional]
9+
**StartingUpViewers** | **int64** | | [optional]
910

1011
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1112

docs/PlaybackIDApi.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ All URIs are relative to *https://api.mux.com*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7-
[**GetAssetOrLivestreamId**](PlaybackIDApi.md#GetAssetOrLivestreamId) | **Get** /video/v1/playback-ids/{PLAYBACK_ID} | Retrieve an Asset or Live Stream ID
7+
[**GetAssetOrLivestreamId**](PlaybackIDApi.md#GetAssetOrLivestreamId) | **Get** /video/v1/playback-ids/{PLAYBACK_ID} | Retrieve an asset or live stream ID
88

99

1010
# **GetAssetOrLivestreamId**
1111
> GetAssetOrLiveStreamIdResponse GetAssetOrLivestreamId(ctx, pLAYBACKID)
12-
Retrieve an Asset or Live Stream ID
12+
Retrieve an asset or live stream ID
1313

1414
Retrieves the Identifier of the Asset or Live Stream associated with the Playback ID.
1515

0 commit comments

Comments
 (0)