Skip to content

Commit

Permalink
Regen from latest OpenAPI spec (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
philcluff authored Mar 14, 2024
1 parent 8b1b71b commit 5856759
Show file tree
Hide file tree
Showing 25 changed files with 341 additions and 175 deletions.
78 changes: 78 additions & 0 deletions api_assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,84 @@ func (a *AssetsApiService) DeleteAssetTrack(aSSETID string, tRACKID string, opts
return nil
}

func (a *AssetsApiService) GenerateAssetTrackSubtitles(aSSETID string, tRACKID string, generateTrackSubtitlesRequest GenerateTrackSubtitlesRequest, opts ...APIOption) (GenerateTrackSubtitlesResponse, error) {
var (
localVarAPIOptions = new(APIOptions)
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue GenerateTrackSubtitlesResponse
)

for _, opt := range opts {
opt(localVarAPIOptions)
}

// create path and map variables
localVarPath := a.client.cfg.basePath + "/video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID}/generate-subtitles"
localVarPath = strings.Replace(localVarPath, "{"+"ASSET_ID"+"}", fmt.Sprintf("%v", aSSETID), -1)
localVarPath = strings.Replace(localVarPath, "{"+"TRACK_ID"+"}", fmt.Sprintf("%v", tRACKID), -1)

localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}

// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json"}

// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}

// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json"}

// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &generateTrackSubtitlesRequest

r, err := a.client.prepareRequest(localVarAPIOptions, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, err
}

localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, err
}

localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, err
}

// Check for common HTTP error status codes
err = CheckForHttpError(localVarHttpResponse.StatusCode, localVarBody)
if err != nil {
return localVarReturnValue, err
}

err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, newErr
}

return localVarReturnValue, nil
}

func (a *AssetsApiService) GetAsset(aSSETID string, opts ...APIOption) (AssetResponse, error) {
var (
localVarAPIOptions = new(APIOptions)
Expand Down
2 changes: 1 addition & 1 deletion configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type ConfigurationOption func(*Configuration)
func NewConfiguration(opts ...ConfigurationOption) *Configuration {
cfg := &Configuration{
basePath: "https://api.mux.com",
userAgent: "Mux Go | 5.2.0",
userAgent: "Mux Go | 5.3.0",
}
for _, opt := range opts {
opt(cfg)
Expand Down
1 change: 1 addition & 0 deletions docs/Asset.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Name | Type | Description | Notes
**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]
**NonStandardInputReasons** | [**AssetNonStandardInputReasons**](Asset_non_standard_input_reasons.md) | | [optional]
**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]
**IngestType** | **string** | The type of ingest used to create the asset. | [optional]

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

Expand Down
35 changes: 33 additions & 2 deletions docs/AssetsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ Method | HTTP request | Description
[**DeleteAsset**](AssetsApi.md#DeleteAsset) | **Delete** /video/v1/assets/{ASSET_ID} | Delete an asset
[**DeleteAssetPlaybackId**](AssetsApi.md#DeleteAssetPlaybackId) | **Delete** /video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID} | Delete a playback ID
[**DeleteAssetTrack**](AssetsApi.md#DeleteAssetTrack) | **Delete** /video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID} | Delete an asset track
[**GenerateAssetTrackSubtitles**](AssetsApi.md#GenerateAssetTrackSubtitles) | **Post** /video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID}/generate-subtitles | Generate track subtitles
[**GetAsset**](AssetsApi.md#GetAsset) | **Get** /video/v1/assets/{ASSET_ID} | Retrieve an asset
[**GetAssetInputInfo**](AssetsApi.md#GetAssetInputInfo) | **Get** /video/v1/assets/{ASSET_ID}/input-info | Retrieve asset input info
[**GetAssetPlaybackId**](AssetsApi.md#GetAssetPlaybackId) | **Get** /video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID} | Retrieve a playback ID
[**ListAssets**](AssetsApi.md#ListAssets) | **Get** /video/v1/assets | List assets
[**UpdateAsset**](AssetsApi.md#UpdateAsset) | **Patch** /video/v1/assets/{ASSET_ID} | Update an Asset
[**UpdateAsset**](AssetsApi.md#UpdateAsset) | **Patch** /video/v1/assets/{ASSET_ID} | Update an asset
[**UpdateAssetMasterAccess**](AssetsApi.md#UpdateAssetMasterAccess) | **Put** /video/v1/assets/{ASSET_ID}/master-access | Update master access
[**UpdateAssetMp4Support**](AssetsApi.md#UpdateAssetMp4Support) | **Put** /video/v1/assets/{ASSET_ID}/mp4-support | Update MP4 support

Expand Down Expand Up @@ -191,6 +192,36 @@ Name | Type | Description | Notes

[[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)

# **GenerateAssetTrackSubtitles**
> GenerateTrackSubtitlesResponse GenerateAssetTrackSubtitles(ctx, aSSETID, tRACKID, generateTrackSubtitlesRequest)
Generate track subtitles

Generates subtitles (captions) for a given audio track. This API can be used for up to 7 days after an asset is created.

### Required Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**aSSETID** | **string**| The asset ID. |
**tRACKID** | **string**| The track ID. |
**generateTrackSubtitlesRequest** | [**GenerateTrackSubtitlesRequest**](GenerateTrackSubtitlesRequest.md)| |

### Return type

[**GenerateTrackSubtitlesResponse**](GenerateTrackSubtitlesResponse.md)

### Authorization

[accessToken](../README.md#accessToken)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[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)

# **GetAsset**
> AssetResponse GetAsset(ctx, aSSETID)
Retrieve an asset
Expand Down Expand Up @@ -316,7 +347,7 @@ Name | Type | Description | Notes

# **UpdateAsset**
> AssetResponse UpdateAsset(ctx, aSSETID, updateAssetRequest)
Update an Asset
Update an asset

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

Expand Down
4 changes: 2 additions & 2 deletions docs/CreateSimulcastTargetRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Passthrough** | **string** | Arbitrary user-supplied metadata set by you when creating a simulcast target. | [optional]
**StreamKey** | **string** | Stream Key represents a stream identifier on the third party live streaming service to send the parent live stream to. | [optional]
**Url** | **string** | RTMP hostname including application name for the third party live streaming service. Example: `rtmp://live.example.com/app`. | [optional]
**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]
**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]

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

Expand Down
1 change: 1 addition & 0 deletions docs/Error.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Name | Type | Description | Notes
**Description** | **string** | Description of the error. | [optional]
**Count** | **int64** | The total number of views that experienced this error. | [optional]
**Code** | **int64** | The error code | [optional]
**PlayerErrorCode** | **string** | The string version of the error code | [optional]

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

Expand Down
10 changes: 10 additions & 0 deletions docs/GenerateTrackSubtitlesRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# GenerateTrackSubtitlesRequest

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**GeneratedSubtitles** | [**[]AssetGeneratedSubtitleSettings**](AssetGeneratedSubtitleSettings.md) | Generate subtitle tracks using automatic speech recognition with this configuration. | [optional]

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


10 changes: 10 additions & 0 deletions docs/GenerateTrackSubtitlesResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# GenerateTrackSubtitlesResponse

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Data** | [**Track**](Track.md) | | [optional]

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


2 changes: 1 addition & 1 deletion docs/InputSettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**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]
**OverlaySettings** | [**InputSettingsOverlaySettings**](InputSettings_overlay_settings.md) | | [optional]
**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]
**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]
**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]
**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]
**Type** | **string** | This parameter is required for `text` type tracks. | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/LiveStream.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Name | Type | Description | Notes
**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]
**MaxContinuousDuration** | **int32** | The time in seconds a live stream may be continuously active before being disconnected. Defaults to 12 hours. | [optional] [default to 43200]
**SrtPassphrase** | **string** | Unique key used for encrypting a stream to a Mux SRT endpoint. | [optional]
**ActiveIngestProtocol** | **string** | The protocol used for the active ingest stream. This is only set when the live stream is active. | [optional]

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

Expand Down
8 changes: 4 additions & 4 deletions docs/LiveStreamsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ Method | HTTP request | Description
[**CreateLiveStreamSimulcastTarget**](LiveStreamsApi.md#CreateLiveStreamSimulcastTarget) | **Post** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets | Create a live stream simulcast target
[**DeleteLiveStream**](LiveStreamsApi.md#DeleteLiveStream) | **Delete** /video/v1/live-streams/{LIVE_STREAM_ID} | Delete a live stream
[**DeleteLiveStreamPlaybackId**](LiveStreamsApi.md#DeleteLiveStreamPlaybackId) | **Delete** /video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids/{PLAYBACK_ID} | Delete a live stream playback ID
[**DeleteLiveStreamSimulcastTarget**](LiveStreamsApi.md#DeleteLiveStreamSimulcastTarget) | **Delete** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Delete a Live Stream Simulcast Target
[**DeleteLiveStreamSimulcastTarget**](LiveStreamsApi.md#DeleteLiveStreamSimulcastTarget) | **Delete** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Delete a live stream simulcast target
[**DisableLiveStream**](LiveStreamsApi.md#DisableLiveStream) | **Put** /video/v1/live-streams/{LIVE_STREAM_ID}/disable | Disable a live stream
[**EnableLiveStream**](LiveStreamsApi.md#EnableLiveStream) | **Put** /video/v1/live-streams/{LIVE_STREAM_ID}/enable | Enable a live stream
[**GetLiveStream**](LiveStreamsApi.md#GetLiveStream) | **Get** /video/v1/live-streams/{LIVE_STREAM_ID} | Retrieve a live stream
[**GetLiveStreamPlaybackId**](LiveStreamsApi.md#GetLiveStreamPlaybackId) | **Get** /video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids/{PLAYBACK_ID} | Retrieve a live stream playback ID
[**GetLiveStreamSimulcastTarget**](LiveStreamsApi.md#GetLiveStreamSimulcastTarget) | **Get** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Retrieve a Live Stream Simulcast Target
[**GetLiveStreamSimulcastTarget**](LiveStreamsApi.md#GetLiveStreamSimulcastTarget) | **Get** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Retrieve a live stream simulcast target
[**ListLiveStreams**](LiveStreamsApi.md#ListLiveStreams) | **Get** /video/v1/live-streams | List live streams
[**ResetStreamKey**](LiveStreamsApi.md#ResetStreamKey) | **Post** /video/v1/live-streams/{LIVE_STREAM_ID}/reset-stream-key | Reset a live stream's stream key
[**SignalLiveStreamComplete**](LiveStreamsApi.md#SignalLiveStreamComplete) | **Put** /video/v1/live-streams/{LIVE_STREAM_ID}/complete | Signal a live stream is finished
Expand Down Expand Up @@ -168,7 +168,7 @@ Name | Type | Description | Notes

# **DeleteLiveStreamSimulcastTarget**
> DeleteLiveStreamSimulcastTarget(ctx, lIVESTREAMID, sIMULCASTTARGETID)
Delete a Live Stream Simulcast Target
Delete a live stream simulcast target

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.

Expand Down Expand Up @@ -310,7 +310,7 @@ Name | Type | Description | Notes

# **GetLiveStreamSimulcastTarget**
> SimulcastTargetResponse GetLiveStreamSimulcastTarget(ctx, lIVESTREAMID, sIMULCASTTARGETID)
Retrieve a Live Stream Simulcast Target
Retrieve a live stream simulcast target

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.

Expand Down
1 change: 1 addition & 0 deletions docs/MonitoringBreakdownTimeseriesDatapoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Name | Type | Description | Notes
**Value** | **string** | | [optional]
**MetricValue** | **float64** | | [optional]
**ConcurrentViewers** | **int64** | | [optional]
**StartingUpViewers** | **int64** | | [optional]

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

Expand Down
4 changes: 2 additions & 2 deletions docs/PlaybackIDApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ All URIs are relative to *https://api.mux.com*

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


# **GetAssetOrLivestreamId**
> GetAssetOrLiveStreamIdResponse GetAssetOrLivestreamId(ctx, pLAYBACKID)
Retrieve an Asset or Live Stream ID
Retrieve an asset or live stream ID

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

Expand Down
Loading

0 comments on commit 5856759

Please sign in to comment.