Skip to content

Commit

Permalink
v5.5.0 (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsanford8 committed May 7, 2024
1 parent 8368488 commit bbabb8b
Show file tree
Hide file tree
Showing 25 changed files with 225 additions and 7 deletions.
77 changes: 77 additions & 0 deletions api_playback_restrictions.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,3 +395,80 @@ func (a *PlaybackRestrictionsApiService) UpdateReferrerDomainRestriction(pLAYBAC

return localVarReturnValue, nil
}

func (a *PlaybackRestrictionsApiService) UpdateUserAgentRestriction(pLAYBACKRESTRICTIONID string, updateUserAgentRestrictionRequest UpdateUserAgentRestrictionRequest, opts ...APIOption) (PlaybackRestrictionResponse, error) {
var (
localVarAPIOptions = new(APIOptions)
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue PlaybackRestrictionResponse
)

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

// create path and map variables
localVarPath := a.client.cfg.basePath + "/video/v1/playback-restrictions/{PLAYBACK_RESTRICTION_ID}/user_agent"
localVarPath = strings.Replace(localVarPath, "{"+"PLAYBACK_RESTRICTION_ID"+"}", fmt.Sprintf("%v", pLAYBACKRESTRICTIONID), -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 = &updateUserAgentRestrictionRequest

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: 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.4.0",
userAgent: "Mux Go | 5.5.0",
}
for _, opt := range opts {
opt(cfg)
Expand Down
1 change: 1 addition & 0 deletions docs/AbridgedVideoView.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Name | Type | Description | Notes
**ViewEnd** | **string** | | [optional]
**ViewerExperienceScore** | **float32** | | [optional]
**WatchTime** | **int32** | | [optional]
**PlaybackFailure** | **bool** | | [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/CreatePlaybackRestrictionRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Referrer** | [**ReferrerDomainRestriction**](ReferrerDomainRestriction.md) | | [optional]
**UserAgent** | [**UserAgentRestrictionRequest**](UserAgentRestrictionRequest.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
1 change: 1 addition & 0 deletions docs/DeliveryReport.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Name | Type | Description | Notes
**AssetState** | **string** | The state of the asset. | [optional]
**AssetDuration** | **float64** | The duration of the asset in seconds. | [optional]
**AssetResolutionTier** | **string** | The resolution tier that the asset was ingested at, affecting billing for ingest & storage | [optional]
**AssetEncodingTier** | **string** | The encoding tier that the asset was ingested at. [See the encoding tiers guide for more details.](https://docs.mux.com/guides/use-encoding-tiers) | [optional]
**DeliveredSeconds** | **float64** | Total number of delivered seconds during this time window. | [optional]
**DeliveredSecondsByResolution** | [**DeliveryReportDeliveredSecondsByResolution**](DeliveryReport_delivered_seconds_by_resolution.md) | | [optional]

Expand Down
2 changes: 1 addition & 1 deletion docs/GenerateTrackSubtitlesResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Data** | [**Track**](Track.md) | | [optional]
**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)

Expand Down
1 change: 1 addition & 0 deletions docs/PlaybackRestriction.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Name | Type | Description | Notes
**CreatedAt** | **string** | Time the Playback Restriction was created, defined as a Unix timestamp (seconds since epoch). | [optional]
**UpdatedAt** | **string** | Time the Playback Restriction was last updated, defined as a Unix timestamp (seconds since epoch). | [optional]
**Referrer** | [**ReferrerDomainRestriction**](ReferrerDomainRestriction.md) | | [optional]
**UserAgent** | [**UserAgentRestrictionSettings**](UserAgentRestrictionSettings.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
30 changes: 30 additions & 0 deletions docs/PlaybackRestrictionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Method | HTTP request | Description
[**GetPlaybackRestriction**](PlaybackRestrictionsApi.md#GetPlaybackRestriction) | **Get** /video/v1/playback-restrictions/{PLAYBACK_RESTRICTION_ID} | Retrieve a Playback Restriction
[**ListPlaybackRestrictions**](PlaybackRestrictionsApi.md#ListPlaybackRestrictions) | **Get** /video/v1/playback-restrictions | List Playback Restrictions
[**UpdateReferrerDomainRestriction**](PlaybackRestrictionsApi.md#UpdateReferrerDomainRestriction) | **Put** /video/v1/playback-restrictions/{PLAYBACK_RESTRICTION_ID}/referrer | Update the Referrer Playback Restriction
[**UpdateUserAgentRestriction**](PlaybackRestrictionsApi.md#UpdateUserAgentRestriction) | **Put** /video/v1/playback-restrictions/{PLAYBACK_RESTRICTION_ID}/user_agent | Update the User Agent Restriction


# **CreatePlaybackRestriction**
Expand Down Expand Up @@ -160,3 +161,32 @@ 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)

# **UpdateUserAgentRestriction**
> PlaybackRestrictionResponse UpdateUserAgentRestriction(ctx, pLAYBACKRESTRICTIONID, updateUserAgentRestrictionRequest)
Update the User Agent Restriction

Allows you to modify how Mux validates playback requests with different user agents. Please see [Using User-Agent HTTP header for validation](https://docs.mux.com/guides/secure-video-playback#using-user-agent-http-header-for-validation) for more details on this feature.

### Required Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**pLAYBACKRESTRICTIONID** | **string**| ID of the Playback Restriction. |
**updateUserAgentRestrictionRequest** | [**UpdateUserAgentRestrictionRequest**](UpdateUserAgentRestrictionRequest.md)| |

### Return type

[**PlaybackRestrictionResponse**](PlaybackRestrictionResponse.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)

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

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Mp4Support** | **string** | Specify what level of support for mp4 playback should be added to new assets generated from this live stream. * The `none` option disables MP4 support for new assets. MP4 files will not be produced for an asset generated from this live stream. * The `capped-1080p` option produces a single MP4 file, called `capped-1080p.mp4`, with the video resolution capped at 1080p. This option produces an `audio.m4a` file for an audio-only asset. * The `audio-only` option produces a single M4A file, called `audio.m4a` for a video or an audio-only asset. MP4 generation will error when this option is specified for a video-only asset. * The `audio-only,capped-1080p` option produces both the `audio.m4a` and `capped-1080p.mp4` files. Only the `capped-1080p.mp4` file is produced for a video-only asset, while only the `audio.m4a` file is produced for an audio-only asset. * The `standard`(deprecated) option produces up to three MP4 files with different levels of resolution (`high.mp4`, `medium.mp4`, `low.mp4`, or `audio.m4a` for an audio-only 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)


1 change: 1 addition & 0 deletions docs/UpdateLiveStreamRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Name | Type | Description | Notes
**UseSlateForStandardLatency** | **bool** | By default, Standard Latency live streams do not have slate media inserted while waiting for live streaming software to reconnect to Mux. Setting this to true enables slate insertion on a Standard Latency stream. | [optional] [default to false]
**ReconnectSlateUrl** | **string** | The URL of the image file that Mux should download and use as slate media during interruptions of the live stream media. This file will be downloaded each time a new recorded asset is created from the live stream. Set this to a blank string to clear the value so that the default slate media will be used. | [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]
**NewAssetSettings** | [**UpdateLiveStreamNewAssetSettings**](UpdateLiveStreamNewAssetSettings.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
11 changes: 11 additions & 0 deletions docs/UpdateUserAgentRestrictionRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# UpdateUserAgentRestrictionRequest

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AllowNoUserAgent** | **bool** | Whether or not to allow views without a `User-Agent` HTTP request header. | [optional] [default to true]
**AllowHighRiskUserAgent** | **bool** | Whether or not to allow high risk user agents. The high risk user agents are defined by Mux. | [optional] [default to true]

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


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

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AllowNoUserAgent** | **bool** | Whether or not to allow views without a `User-Agent` HTTP request header. | [optional] [default to true]
**AllowHighRiskUserAgent** | **bool** | Whether or not to allow high risk user agents. The high risk user agents are defined by Mux. | [optional] [default to true]

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


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

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AllowNoUserAgent** | **bool** | Whether or not to allow views without a `User-Agent` HTTP request header. | [optional] [default to true]
**AllowHighRiskUserAgent** | **bool** | Whether or not to allow high risk user agents. The high risk user agents are defined by Mux. | [optional] [default to true]

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


6 changes: 6 additions & 0 deletions docs/VideoView.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ Name | Type | Description | Notes
**PlaybackFailureErrorTypeId** | **int32** | | [optional]
**PlaybackBusinessExceptionErrorTypeId** | **int32** | | [optional]
**VideoStartupBusinessExceptionErrorTypeId** | **int32** | | [optional]
**PlaybackFailure** | **bool** | | [optional]
**AdPlaybackFailureErrorTypeId** | **int32** | | [optional]
**ViewContentStartupTime** | **int32** | | [optional]
**AdPrerollStartupTime** | **int32** | | [optional]
**AdWatchTime** | **int32** | | [optional]
**ViewContentWatchTime** | **int32** | | [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 model_abridged_video_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ type AbridgedVideoView struct {
ViewEnd string `json:"view_end,omitempty"`
ViewerExperienceScore float32 `json:"viewer_experience_score,omitempty"`
WatchTime int32 `json:"watch_time,omitempty"`
PlaybackFailure bool `json:"playback_failure,omitempty"`
}
3 changes: 2 additions & 1 deletion model_create_playback_restriction_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
package muxgo

type CreatePlaybackRestrictionRequest struct {
Referrer ReferrerDomainRestriction `json:"referrer,omitempty"`
Referrer ReferrerDomainRestriction `json:"referrer,omitempty"`
UserAgent UserAgentRestrictionRequest `json:"user_agent,omitempty"`
}
2 changes: 2 additions & 0 deletions model_delivery_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ type DeliveryReport struct {
AssetDuration float64 `json:"asset_duration,omitempty"`
// The resolution tier that the asset was ingested at, affecting billing for ingest & storage
AssetResolutionTier string `json:"asset_resolution_tier,omitempty"`
// The encoding tier that the asset was ingested at. [See the encoding tiers guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
AssetEncodingTier string `json:"asset_encoding_tier,omitempty"`
// Total number of delivered seconds during this time window.
DeliveredSeconds float64 `json:"delivered_seconds,omitempty"`
DeliveredSecondsByResolution DeliveryReportDeliveredSecondsByResolution `json:"delivered_seconds_by_resolution,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion model_generate_track_subtitles_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
package muxgo

type GenerateTrackSubtitlesResponse struct {
Data Track `json:"data,omitempty"`
Data []Track `json:"data,omitempty"`
}
5 changes: 3 additions & 2 deletions model_playback_restriction.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type PlaybackRestriction struct {
// Time the Playback Restriction was created, defined as a Unix timestamp (seconds since epoch).
CreatedAt string `json:"created_at,omitempty"`
// Time the Playback Restriction was last updated, defined as a Unix timestamp (seconds since epoch).
UpdatedAt string `json:"updated_at,omitempty"`
Referrer ReferrerDomainRestriction `json:"referrer,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
Referrer ReferrerDomainRestriction `json:"referrer,omitempty"`
UserAgent UserAgentRestrictionSettings `json:"user_agent,omitempty"`
}
10 changes: 10 additions & 0 deletions model_update_live_stream_new_asset_settings.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Mux Go - Copyright 2019 Mux Inc.
// NOTE: This file is auto generated. Do not edit this file manually.

package muxgo

// Updates the new asset settings to use to generate a new asset for this live stream. Only the `mp4_support` setting may be updated.
type UpdateLiveStreamNewAssetSettings struct {
// Specify what level of support for mp4 playback should be added to new assets generated from this live stream. * The `none` option disables MP4 support for new assets. MP4 files will not be produced for an asset generated from this live stream. * The `capped-1080p` option produces a single MP4 file, called `capped-1080p.mp4`, with the video resolution capped at 1080p. This option produces an `audio.m4a` file for an audio-only asset. * The `audio-only` option produces a single M4A file, called `audio.m4a` for a video or an audio-only asset. MP4 generation will error when this option is specified for a video-only asset. * The `audio-only,capped-1080p` option produces both the `audio.m4a` and `capped-1080p.mp4` files. Only the `capped-1080p.mp4` file is produced for a video-only asset, while only the `audio.m4a` file is produced for an audio-only asset. * The `standard`(deprecated) option produces up to three MP4 files with different levels of resolution (`high.mp4`, `medium.mp4`, `low.mp4`, or `audio.m4a` for an audio-only asset).
Mp4Support string `json:"mp4_support,omitempty"`
}
3 changes: 2 additions & 1 deletion model_update_live_stream_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ type UpdateLiveStreamRequest struct {
// The URL of the image file that Mux should download and use as slate media during interruptions of the live stream media. This file will be downloaded each time a new recorded asset is created from the live stream. Set this to a blank string to clear the value so that the default slate media will be used.
ReconnectSlateUrl string `json:"reconnect_slate_url,omitempty"`
// The time in seconds a live stream may be continuously active before being disconnected. Defaults to 12 hours.
MaxContinuousDuration int32 `json:"max_continuous_duration,omitempty"`
MaxContinuousDuration int32 `json:"max_continuous_duration,omitempty"`
NewAssetSettings UpdateLiveStreamNewAssetSettings `json:"new_asset_settings,omitempty"`
}
11 changes: 11 additions & 0 deletions model_update_user_agent_restriction_request.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Mux Go - Copyright 2019 Mux Inc.
// NOTE: This file is auto generated. Do not edit this file manually.

package muxgo

type UpdateUserAgentRestrictionRequest struct {
// Whether or not to allow views without a `User-Agent` HTTP request header.
AllowNoUserAgent bool `json:"allow_no_user_agent,omitempty"`
// Whether or not to allow high risk user agents. The high risk user agents are defined by Mux.
AllowHighRiskUserAgent bool `json:"allow_high_risk_user_agent,omitempty"`
}
12 changes: 12 additions & 0 deletions model_user_agent_restriction_request.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Mux Go - Copyright 2019 Mux Inc.
// NOTE: This file is auto generated. Do not edit this file manually.

package muxgo

// Rules that control what user agents are allowed to play your videos. Please see [Using User-Agent HTTP header for validation](https://docs.mux.com/guides/secure-video-playback#using-user-agent-http-header-for-validation) for more details on this feature.
type UserAgentRestrictionRequest struct {
// Whether or not to allow views without a `User-Agent` HTTP request header.
AllowNoUserAgent bool `json:"allow_no_user_agent,omitempty"`
// Whether or not to allow high risk user agents. The high risk user agents are defined by Mux.
AllowHighRiskUserAgent bool `json:"allow_high_risk_user_agent,omitempty"`
}
12 changes: 12 additions & 0 deletions model_user_agent_restriction_settings.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Mux Go - Copyright 2019 Mux Inc.
// NOTE: This file is auto generated. Do not edit this file manually.

package muxgo

// Rules that control what user agents are allowed to play your videos. Please see [Using User-Agent HTTP header for validation](https://docs.mux.com/guides/secure-video-playback#using-user-agent-http-header-for-validation) for more details on this feature.
type UserAgentRestrictionSettings struct {
// Whether or not to allow views without a `User-Agent` HTTP request header.
AllowNoUserAgent bool `json:"allow_no_user_agent,omitempty"`
// Whether or not to allow high risk user agents. The high risk user agents are defined by Mux.
AllowHighRiskUserAgent bool `json:"allow_high_risk_user_agent,omitempty"`
}
Loading

0 comments on commit bbabb8b

Please sign in to comment.