Skip to content

Commit

Permalink
Ed/clipping (muxinc#26)
Browse files Browse the repository at this point in the history
* added go module

* updated generated code

* test updates

* docs + code gen

* clip test

* removed gopkg; did a go mod vendor

* updated ci workflow to no longer use dep
  • Loading branch information
eropple authored Mar 17, 2021
1 parent 7aa8af2 commit a394469
Show file tree
Hide file tree
Showing 42 changed files with 458 additions and 254 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,11 @@ jobs:
path: ${{env.CHECKOUT_LOCATION}}
- name: Install Go
uses: actions/setup-go@v2
- name: Install Dep
run: |
mkdir -p $GOPATH/bin
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- name: Install Go Dependencies
run: |
cd $CHECKOUT_LOCATION
export PATH=$PATH:$(go env GOPATH)/bin
dep ensure
go install
- name: Run Integration Tests
run: |
cd $CHECKOUT_LOCATION
Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
golang 1.15.6
67 changes: 0 additions & 67 deletions Gopkg.lock

This file was deleted.

42 changes: 0 additions & 42 deletions Gopkg.toml

This file was deleted.

88 changes: 88 additions & 0 deletions api_playback_id.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// Mux Go - Copyright 2019 Mux Inc.
// NOTE: This file is auto generated. Do not edit this file manually.

package muxgo

import (
"fmt"
"io/ioutil"
"net/url"
"strings"
)

type PlaybackIDApiService service

func (a *PlaybackIDApiService) GetAssetOrLivestreamId(pLAYBACKID string, opts ...APIOption) (GetAssetOrLiveStreamIdResponse, error) {
var (
localVarAPIOptions = new(APIOptions)
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue GetAssetOrLiveStreamIdResponse
)

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

// create path and map variables
localVarPath := a.client.cfg.basePath + "/video/v1/playback-ids/{PLAYBACK_ID}"
localVarPath = strings.Replace(localVarPath, "{"+"PLAYBACK_ID"+"}", fmt.Sprintf("%v", pLAYBACKID), -1)

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

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

// 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
}

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
}
2 changes: 2 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type APIClient struct {
IncidentsApi *IncidentsApiService
LiveStreamsApi *LiveStreamsApiService
MetricsApi *MetricsApiService
PlaybackIDApi *PlaybackIDApiService
RealTimeApi *RealTimeApiService
URLSigningKeysApi *URLSigningKeysApiService
VideoViewsApi *VideoViewsApiService
Expand Down Expand Up @@ -76,6 +77,7 @@ func NewAPIClient(cfg *Configuration) *APIClient {
c.IncidentsApi = (*IncidentsApiService)(&c.common)
c.LiveStreamsApi = (*LiveStreamsApiService)(&c.common)
c.MetricsApi = (*MetricsApiService)(&c.common)
c.PlaybackIDApi = (*PlaybackIDApiService)(&c.common)
c.RealTimeApi = (*RealTimeApiService)(&c.common)
c.URLSigningKeysApi = (*URLSigningKeysApiService)(&c.common)
c.VideoViewsApi = (*VideoViewsApiService)(&c.common)
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 | 0.11.0",
userAgent: "Mux Go | 0.12.0",
}
for _, opt := range opts {
opt(cfg)
Expand Down
25 changes: 13 additions & 12 deletions docs/Asset.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,30 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **string** | | [optional]
**CreatedAt** | **string** | | [optional]
**Id** | **string** | Unique identifier for the Asset. | [optional]
**CreatedAt** | **string** | Time at which the object was created. Measured in seconds since the Unix epoch. | [optional]
**DeletedAt** | **string** | | [optional]
**Status** | **string** | | [optional]
**Duration** | **float64** | | [optional]
**MaxStoredResolution** | **string** | | [optional]
**MaxStoredFrameRate** | **float64** | | [optional]
**AspectRatio** | **string** | | [optional]
**Status** | **string** | The status of the asset. | [optional]
**Duration** | **float64** | The duration of the asset in seconds (max duration for a single asset is 24 hours). | [optional]
**MaxStoredResolution** | **string** | The maximum resolution that has been stored for the asset. The asset may be delivered at lower resolutions depending on the device and bandwidth, however it cannot be delivered at a higher value than is stored. | [optional]
**MaxStoredFrameRate** | **float64** | The maximum frame rate that has been stored for the asset. The asset may be delivered at lower frame rates depending on the device and bandwidth, however it cannot be delivered at a higher value than is stored. This field may return -1 if the frame rate of the input cannot be reliably determined. | [optional]
**AspectRatio** | **string** | The aspect ratio of the asset in the form of `width:height`, for example `16:9`. | [optional]
**PlaybackIds** | [**[]PlaybackId**](PlaybackID.md) | | [optional]
**Tracks** | [**[]Track**](Track.md) | | [optional]
**Errors** | [**AssetErrors**](Asset_errors.md) | | [optional]
**PerTitleEncode** | **bool** | | [optional]
**IsLive** | **bool** | | [optional]
**Passthrough** | **string** | | [optional]
**LiveStreamId** | **string** | | [optional]
**IsLive** | **bool** | Whether the asset is created from a live stream and the live stream is currently `active` and not in `idle` state. | [optional]
**Passthrough** | **string** | Arbitrary metadata set for the asset. Max 255 characters. | [optional]
**LiveStreamId** | **string** | Unique identifier for the live stream. This is an optional parameter added when the asset is created from a live stream. | [optional]
**Master** | [**AssetMaster**](Asset_master.md) | | [optional]
**MasterAccess** | **string** | | [optional] [default to MASTER_ACCESS_NONE]
**Mp4Support** | **string** | | [optional] [default to MP4_SUPPORT_NONE]
**NormalizeAudio** | **bool** | | [optional] [default to false]
**SourceAssetId** | **string** | Asset Identifier of the video used as the source for creating the clip. | [optional]
**NormalizeAudio** | **bool** | Normalize the audio track loudness level. This parameter is only applicable to on-demand (not live) assets. | [optional] [default to false]
**StaticRenditions** | [**AssetStaticRenditions**](Asset_static_renditions.md) | | [optional]
**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 | [optional]
**NonStandardInputReasons** | [**AssetNonStandardInputReasons**](Asset_non_standard_input_reasons.md) | | [optional]
**Test** | **bool** | | [optional]
**Test** | **bool** | Indicates this asset is a test asset if the value is `true`. 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]

[[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/AssetErrors.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Type** | **string** | | [optional]
**Messages** | **[]string** | | [optional]
**Type** | **string** | The type of error that occurred for this asset. | [optional]
**Messages** | **[]string** | Error messages with more details. | [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
18 changes: 9 additions & 9 deletions docs/AssetNonStandardInputReasons.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**VideoCodec** | **string** | The video codec used on the input file | [optional]
**AudioCodec** | **string** | The audio codec used on the input file | [optional]
**VideoGopSize** | **string** | The video key frame Interval (also called as Group of Picture or GOP) of the input file | [optional]
**VideoFrameRate** | **string** | The video frame rate of the input file | [optional]
**VideoResolution** | **string** | The video resolution of the input file | [optional]
**PixelAspectRatio** | **string** | The video pixel aspect ratio of the input file | [optional]
**VideoEditList** | **string** | Video Edit List reason indicates that the input file's video track contains a complex Edit Decision List | [optional]
**AudioEditList** | **string** | Audio Edit List reason indicates that the input file's audio track contains a complex Edit Decision List | [optional]
**UnexpectedMediaFileParameters** | **string** | A catch-all reason when the input file in created with non-standard encoding parameters | [optional]
**VideoCodec** | **string** | The video codec used on the input file. | [optional]
**AudioCodec** | **string** | The audio codec used on the input file. | [optional]
**VideoGopSize** | **string** | The video key frame Interval (also called as Group of Picture or GOP) of the input file. | [optional]
**VideoFrameRate** | **string** | The video frame rate of the input file. | [optional]
**VideoResolution** | **string** | The video resolution of the input file. | [optional]
**PixelAspectRatio** | **string** | The video pixel aspect ratio of the input file. | [optional]
**VideoEditList** | **string** | Video Edit List reason indicates that the input file's video track contains a complex Edit Decision List. | [optional]
**AudioEditList** | **string** | Audio Edit List reason indicates that the input file's audio track contains a complex Edit Decision List. | [optional]
**UnexpectedMediaFileParameters** | **string** | A catch-all reason when the input file in created with non-standard encoding parameters. | [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/AssetRecordingTimes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**StartedAt** | [**time.Time**](time.Time.md) | The time at which the recording for the live stream started. The time value is Unix epoch time represented in ISO 8601 format | [optional]
**Duration** | **float64** | The duration of the live stream recorded. The time value is in seconds | [optional]
**StartedAt** | [**time.Time**](time.Time.md) | The time at which the recording for the live stream started. The time value is Unix epoch time represented in ISO 8601 format. | [optional]
**Duration** | **float64** | The duration of the live stream recorded. The time value is in seconds. | [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
2 changes: 1 addition & 1 deletion docs/AssetStaticRenditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Status** | **string** | * `ready`: All MP4s are downloadable * `preparing`: We are preparing the MP4s * `disabled`: MP4 support was not requested or has been removed * `errored`: There was a Mux internal error that prevented the MP4s from being created | [optional] [default to STATUS_DISABLED]
**Status** | **string** | Indicates the status of downloadable MP4 versions of this asset. | [optional] [default to STATUS_DISABLED]
**Files** | [**[]AssetStaticRenditionsFiles**](Asset_static_renditions_files.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)
Expand Down
4 changes: 4 additions & 0 deletions docs/AssetsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ Name | Type | Description | Notes
> DeleteAsset(ctx, aSSETID)
Delete an asset

Deletes a video asset and all its data

### Required Parameters

Name | Type | Description | Notes
Expand Down Expand Up @@ -267,6 +269,8 @@ Name | Type | Description | Notes
> ListAssetsResponse ListAssets(ctx, optional)
List assets

List all Mux assets.

### Required Parameters

Name | Type | Description | Notes
Expand Down
12 changes: 6 additions & 6 deletions docs/CreateAssetRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Input** | [**[]InputSettings**](InputSettings.md) | | [optional]
**PlaybackPolicy** | [**[]PlaybackPolicy**](PlaybackPolicy.md) | | [optional]
**Input** | [**[]InputSettings**](InputSettings.md) | An array of objects that each describe an input file to be used to create the asset. As a shortcut, input can also be a string URL for a file when only one input file is used. See `input[].url` for requirements. | [optional]
**PlaybackPolicy** | [**[]PlaybackPolicy**](PlaybackPolicy.md) | An array of playback policy names that you want applied to this asset and available through `playback_ids`. Options include: `\"public\"` (anyone with the playback URL can stream the asset). And `\"signed\"` (an additional access token is required to play the asset). If no playback_policy is set, the asset will have no playback IDs and will therefore not be playable. For simplicity, a single string name can be used in place of the array in the case of only one playback policy. | [optional]
**PerTitleEncode** | **bool** | | [optional]
**Passthrough** | **string** | | [optional]
**Mp4Support** | **string** | | [optional]
**Passthrough** | **string** | Arbitrary metadata that will be included in the asset details and related webhooks. Can be used to store your own ID for a video along with the asset. **Max: 255 characters**. | [optional]
**Mp4Support** | **string** | Specify what level (if any) of support for mp4 playback. In most cases you should use our default HLS-based streaming playback ({playback_id}.m3u8) which can automatically adjust to viewers' connection speeds, but an mp4 can be useful for some legacy devices or downloading for offline playback. See the [Download your vidoes guide](/guides/video/download-your-videos) for more information. | [optional]
**NormalizeAudio** | **bool** | Normalize the audio track loudness level. This parameter is only applicable to on-demand (not live) assets. | [optional] [default to false]
**MasterAccess** | **string** | | [optional]
**Test** | **bool** | | [optional]
**MasterAccess** | **string** | Specify what level (if any) of support for master access. Master access can be enabled temporarily for your asset to be downloaded. See the [Download your vidoes guide](/guides/video/download-your-videos) for more information. | [optional]
**Test** | **bool** | Marks the asset as a test asset when the value is set to true. 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 asset are watermarked with the Mux logo, limited to 10 seconds, deleted after 24 hrs. | [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
Loading

0 comments on commit a394469

Please sign in to comment.