diff --git a/api_drm_configurations.go b/api_drm_configurations.go new file mode 100644 index 0000000..8722961 --- /dev/null +++ b/api_drm_configurations.go @@ -0,0 +1,179 @@ +// 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 DRMConfigurationsApiService service + +func (a *DRMConfigurationsApiService) GetDrmConfiguration(dRMCONFIGURATIONID string, opts ...APIOption) (DrmConfigurationResponse, error) { + var ( + localVarAPIOptions = new(APIOptions) + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue DrmConfigurationResponse + ) + + for _, opt := range opts { + opt(localVarAPIOptions) + } + + // create path and map variables + localVarPath := a.client.cfg.basePath + "/video/v1/drm-configurations/{DRM_CONFIGURATION_ID}" + localVarPath = strings.Replace(localVarPath, "{"+"DRM_CONFIGURATION_ID"+"}", fmt.Sprintf("%v", dRMCONFIGURATIONID), -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 +} + +type ListDrmConfigurationsParams struct { + Page int32 + Limit int32 +} + +// ListDrmConfigurations optionally accepts the APIOption of WithParams(*ListDrmConfigurationsParams). +func (a *DRMConfigurationsApiService) ListDrmConfigurations(opts ...APIOption) (ListDrmConfigurationsResponse, error) { + var ( + localVarAPIOptions = new(APIOptions) + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ListDrmConfigurationsResponse + ) + + for _, opt := range opts { + opt(localVarAPIOptions) + } + + localVarOptionals, ok := localVarAPIOptions.params.(*ListDrmConfigurationsParams) + if localVarAPIOptions.params != nil && !ok { + return localVarReturnValue, reportError("provided params were not of type *ListDrmConfigurationsParams") + } + + // create path and map variables + localVarPath := a.client.cfg.basePath + "/video/v1/drm-configurations" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && isSet(localVarOptionals.Page) { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page, "")) + } + if localVarOptionals != nil && isSet(localVarOptionals.Limit) { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit, "")) + } + // 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 +} diff --git a/client.go b/client.go index e42253e..143079a 100644 --- a/client.go +++ b/client.go @@ -38,6 +38,7 @@ type APIClient struct { // API Services AssetsApi *AssetsApiService + DRMConfigurationsApi *DRMConfigurationsApiService DeliveryUsageApi *DeliveryUsageApiService DimensionsApi *DimensionsApiService DirectUploadsApi *DirectUploadsApiService @@ -74,6 +75,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { // API Services c.AssetsApi = (*AssetsApiService)(&c.common) + c.DRMConfigurationsApi = (*DRMConfigurationsApiService)(&c.common) c.DeliveryUsageApi = (*DeliveryUsageApiService)(&c.common) c.DimensionsApi = (*DimensionsApiService)(&c.common) c.DirectUploadsApi = (*DirectUploadsApiService)(&c.common) diff --git a/configuration.go b/configuration.go index 33fc37b..9cf7001 100644 --- a/configuration.go +++ b/configuration.go @@ -22,7 +22,7 @@ type ConfigurationOption func(*Configuration) func NewConfiguration(opts ...ConfigurationOption) *Configuration { cfg := &Configuration{ basePath: "https://api.mux.com", - userAgent: "Mux Go | 5.5.0", + userAgent: "Mux Go | 5.6.0", } for _, opt := range opts { opt(cfg) diff --git a/docs/CreateAssetRequest.md b/docs/CreateAssetRequest.md index aa5b5d8..9cd0778 100644 --- a/docs/CreateAssetRequest.md +++ b/docs/CreateAssetRequest.md @@ -4,7 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **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] +**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). * `\"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] +**AdvancedPlaybackPolicies** | [**[]CreatePlaybackIdRequest**](CreatePlaybackIDRequest.md) | An array of playback policy objects that you want applied to this asset and available through `playback_ids`. `advanced_playback_policies` must be used instead of `playback_policy` when creating a DRM playback ID. | [optional] **PerTitleEncode** | **bool** | | [optional] **Passthrough** | **string** | Arbitrary user-supplied 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 of support for mp4 playback. * 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). MP4 files are not produced for `none` (default). 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 videos guide](https://docs.mux.com/guides/enable-static-mp4-renditions) for more information. | [optional] diff --git a/docs/CreateLiveStreamRequest.md b/docs/CreateLiveStreamRequest.md index cbc967b..a8eb504 100644 --- a/docs/CreateLiveStreamRequest.md +++ b/docs/CreateLiveStreamRequest.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **PlaybackPolicy** | [**[]PlaybackPolicy**](PlaybackPolicy.md) | | [optional] +**AdvancedPlaybackPolicies** | [**[]CreatePlaybackIdRequest**](CreatePlaybackIDRequest.md) | An array of playback policy objects that you want applied to this asset and available through `playback_ids`. `advanced_playback_policies` must be used instead of `playback_policy` when creating a DRM playback ID. | [optional] **NewAssetSettings** | [**CreateAssetRequest**](CreateAssetRequest.md) | | [optional] **ReconnectWindow** | **float32** | When live streaming software disconnects from Mux, either intentionally or due to a drop in the network, the Reconnect Window is the time in seconds that Mux should wait for the streaming software to reconnect before considering the live stream finished and completing the recorded asset. Defaults to 60 seconds on the API if not specified. If not specified directly, Standard Latency streams have a Reconnect Window of 60 seconds; Reduced and Low Latency streams have a default of 0 seconds, or no Reconnect Window. For that reason, we suggest specifying a value other than zero for Reduced and Low Latency streams. Reduced and Low Latency streams with a Reconnect Window greater than zero will insert slate media into the recorded asset while waiting for the streaming software to reconnect or when there are brief interruptions in the live stream media. When using a Reconnect Window setting higher than 60 seconds with a Standard Latency stream, we highly recommend enabling slate with the `use_slate_for_standard_latency` option. | [optional] [default to 60] **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] diff --git a/docs/CreatePlaybackIdRequest.md b/docs/CreatePlaybackIdRequest.md index 62eab74..0aadfd6 100644 --- a/docs/CreatePlaybackIdRequest.md +++ b/docs/CreatePlaybackIdRequest.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Policy** | [**PlaybackPolicy**](PlaybackPolicy.md) | | [optional] +**DrmConfigurationId** | **string** | The DRM configuration used by this playback ID. Must only be set when `policy` is set to `drm`. | [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) diff --git a/docs/CreateUploadRequest.md b/docs/CreateUploadRequest.md index 29d1521..73cfb31 100644 --- a/docs/CreateUploadRequest.md +++ b/docs/CreateUploadRequest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **Timeout** | **int32** | Max time in seconds for the signed upload URL to be valid. If a successful upload has not occurred before the timeout limit, the direct upload is marked `timed_out` | [optional] [default to 3600] **CorsOrigin** | **string** | If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers. | [optional] **NewAssetSettings** | [**CreateAssetRequest**](CreateAssetRequest.md) | | [optional] -**Test** | **bool** | | [optional] +**Test** | **bool** | Indicates if this is a test Direct Upload, in which case the Asset that gets created will be a `test` 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) diff --git a/docs/DRMConfigurationsApi.md b/docs/DRMConfigurationsApi.md new file mode 100644 index 0000000..a1c2d5f --- /dev/null +++ b/docs/DRMConfigurationsApi.md @@ -0,0 +1,74 @@ +# \DRMConfigurationsApi + +All URIs are relative to *https://api.mux.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetDrmConfiguration**](DRMConfigurationsApi.md#GetDrmConfiguration) | **Get** /video/v1/drm-configurations/{DRM_CONFIGURATION_ID} | Retrieve a DRM Configuration +[**ListDrmConfigurations**](DRMConfigurationsApi.md#ListDrmConfigurations) | **Get** /video/v1/drm-configurations | List DRM Configurations + + +# **GetDrmConfiguration** +> DrmConfigurationResponse GetDrmConfiguration(ctx, dRMCONFIGURATIONID) +Retrieve a DRM Configuration + +Retrieves a single DRM Configuration. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **dRMCONFIGURATIONID** | **string**| The DRM Configuration ID. | + +### Return type + +[**DrmConfigurationResponse**](DRMConfigurationResponse.md) + +### Authorization + +[accessToken](../README.md#accessToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **ListDrmConfigurations** +> ListDrmConfigurationsResponse ListDrmConfigurations(ctx, optional) +List DRM Configurations + +Returns a list of DRM Configurations + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***ListDrmConfigurationsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ListDrmConfigurationsOpts struct + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **optional.Int32**| Offset by this many pages, of the size of `limit` | [default to 1] + **limit** | **optional.Int32**| Number of items to include in the response | [default to 25] + +### Return type + +[**ListDrmConfigurationsResponse**](ListDRMConfigurationsResponse.md) + +### Authorization + +[accessToken](../README.md#accessToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + diff --git a/docs/DrmConfiguration.md b/docs/DrmConfiguration.md new file mode 100644 index 0000000..a3d923a --- /dev/null +++ b/docs/DrmConfiguration.md @@ -0,0 +1,10 @@ +# DrmConfiguration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | Unique identifier for the DRM Configuration. Max 255 characters. | [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) + + diff --git a/docs/DrmConfigurationResponse.md b/docs/DrmConfigurationResponse.md new file mode 100644 index 0000000..e5f941d --- /dev/null +++ b/docs/DrmConfigurationResponse.md @@ -0,0 +1,10 @@ +# DrmConfigurationResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**DrmConfiguration**](DRMConfiguration.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) + + diff --git a/docs/ListDrmConfigurationsResponse.md b/docs/ListDrmConfigurationsResponse.md new file mode 100644 index 0000000..b993abe --- /dev/null +++ b/docs/ListDrmConfigurationsResponse.md @@ -0,0 +1,10 @@ +# ListDrmConfigurationsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**[]DrmConfiguration**](DRMConfiguration.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) + + diff --git a/docs/MetricsApi.md b/docs/MetricsApi.md index 7b83120..8dc0de9 100644 --- a/docs/MetricsApi.md +++ b/docs/MetricsApi.md @@ -34,7 +34,7 @@ Name | Type | Description | Notes **timeframe** | [**optional.Interface of []string**](string.md)| Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. `timeframe[]=1498867200&timeframe[]=1498953600` * duration string e.g. `timeframe[]=24:hours or timeframe[]=7:days` | **filters** | [**optional.Interface of []string**](string.md)| Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter. To exclude rows that match a certain condition, prepend a `!` character to the dimension. Possible filter names are the same as returned by the List Filters endpoint. Example: * `filters[]=operating_system:windows&filters[]=!country:US` | **metricFilters** | [**optional.Interface of []string**](string.md)| Limit the results to rows that match inequality conditions from provided metric comparison clauses. Must be provided as an array query string parameter. Possible filterable metrics are the same as the set of metric ids, with the exceptions of `exits_before_video_start`, `unique_viewers`, `video_startup_failure_percentage`, and `views`. Example: * `metric_filters[]=aggregate_startup_time>=1000` | - **measurement** | **optional.String**| Measurement for the provided metric. If omitted, the default for the metric will be used. | + **measurement** | **optional.String**| Measurement for the provided metric. If omitted, the default for the metric will be used. The default measurement for each metric is: \"sum\" : `ad_attempt_count`, `ad_break_count`, `ad_break_error_count`, `ad_error_count`, `ad_impression_count`, `playing_time` \"median\" : `ad_preroll_startup_time`, `ad_watch_time`, `aggregate_startup_time`, `content_startup_time`, `content_watch_time`, `max_downscale_percentage`, `max_upscale_percentage`, `page_load_time`, `player_average_live_latency`, `player_startup_time`, `rebuffer_count`, `rebuffer_duration`, `requests_for_first_preroll`, `video_startup_preroll_load_time`, `video_startup_preroll_request_time`, `video_startup_time`, `view_average_request_latency`, `view_average_request_throughput`, `view_max_request_latency`, `weighted_average_bitrate` \"avg\" : `ad_break_error_percentage`, `ad_error_percentage`, `ad_exit_before_start_count`, `ad_exit_before_start_percentage`, `ad_playback_failure_percentage`, `ad_startup_error_count`, `ad_startup_error_percentage`, `content_playback_failure_percentage`, `downscale_percentage`, `exits_before_video_start`, `playback_business_exception_percentage`, `playback_failure_percentage`, `playback_success_score`, `rebuffer_frequency`, `rebuffer_percentage`, `seek_latency`, `smoothness_score`, `startup_time_score`, `upscale_percentage`, `video_quality_score`, `video_startup_business_exception_percentage`, `video_startup_failure_percentage`, `viewer_experience_score` \"count\" : `started_views`, `unique_viewers` | **orderDirection** | **optional.String**| Sort order. | **groupBy** | **optional.String**| Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the timeframe. For timeframes of less than 90 minutes, the default granularity is `minute`. Between 90 minutes and 6 hours, the default granularity is `ten_minutes`. Between 6 hours and 15 days inclusive, the default granularity is `hour`. The granularity of timeframes that exceed 15 days is `day`. This default behavior is subject to change; it is strongly suggested that you explicitly specify the granularity. | @@ -76,7 +76,7 @@ Name | Type | Description | Notes **timeframe** | [**optional.Interface of []string**](string.md)| Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. `timeframe[]=1498867200&timeframe[]=1498953600` * duration string e.g. `timeframe[]=24:hours or timeframe[]=7:days` | **filters** | [**optional.Interface of []string**](string.md)| Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter. To exclude rows that match a certain condition, prepend a `!` character to the dimension. Possible filter names are the same as returned by the List Filters endpoint. Example: * `filters[]=operating_system:windows&filters[]=!country:US` | **metricFilters** | [**optional.Interface of []string**](string.md)| Limit the results to rows that match inequality conditions from provided metric comparison clauses. Must be provided as an array query string parameter. Possible filterable metrics are the same as the set of metric ids, with the exceptions of `exits_before_video_start`, `unique_viewers`, `video_startup_failure_percentage`, and `views`. Example: * `metric_filters[]=aggregate_startup_time>=1000` | - **measurement** | **optional.String**| Measurement for the provided metric. If omitted, the default for the metric will be used. | + **measurement** | **optional.String**| Measurement for the provided metric. If omitted, the default for the metric will be used. The default measurement for each metric is: \"sum\" : `ad_attempt_count`, `ad_break_count`, `ad_break_error_count`, `ad_error_count`, `ad_impression_count`, `playing_time` \"median\" : `ad_preroll_startup_time`, `ad_watch_time`, `aggregate_startup_time`, `content_startup_time`, `content_watch_time`, `max_downscale_percentage`, `max_upscale_percentage`, `page_load_time`, `player_average_live_latency`, `player_startup_time`, `rebuffer_count`, `rebuffer_duration`, `requests_for_first_preroll`, `video_startup_preroll_load_time`, `video_startup_preroll_request_time`, `video_startup_time`, `view_average_request_latency`, `view_average_request_throughput`, `view_max_request_latency`, `weighted_average_bitrate` \"avg\" : `ad_break_error_percentage`, `ad_error_percentage`, `ad_exit_before_start_count`, `ad_exit_before_start_percentage`, `ad_playback_failure_percentage`, `ad_startup_error_count`, `ad_startup_error_percentage`, `content_playback_failure_percentage`, `downscale_percentage`, `exits_before_video_start`, `playback_business_exception_percentage`, `playback_failure_percentage`, `playback_success_score`, `rebuffer_frequency`, `rebuffer_percentage`, `seek_latency`, `smoothness_score`, `startup_time_score`, `upscale_percentage`, `video_quality_score`, `video_startup_business_exception_percentage`, `video_startup_failure_percentage`, `viewer_experience_score` \"count\" : `started_views`, `unique_viewers` | ### Return type @@ -153,7 +153,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupBy** | **optional.String**| Breakdown value to group the results by | - **measurement** | **optional.String**| Measurement for the provided metric. If omitted, the default for the metric will be used. | + **measurement** | **optional.String**| Measurement for the provided metric. If omitted, the default for the metric will be used. The default measurement for each metric is: \"sum\" : `ad_attempt_count`, `ad_break_count`, `ad_break_error_count`, `ad_error_count`, `ad_impression_count`, `playing_time` \"median\" : `ad_preroll_startup_time`, `ad_watch_time`, `aggregate_startup_time`, `content_startup_time`, `content_watch_time`, `max_downscale_percentage`, `max_upscale_percentage`, `page_load_time`, `player_average_live_latency`, `player_startup_time`, `rebuffer_count`, `rebuffer_duration`, `requests_for_first_preroll`, `video_startup_preroll_load_time`, `video_startup_preroll_request_time`, `video_startup_time`, `view_average_request_latency`, `view_average_request_throughput`, `view_max_request_latency`, `weighted_average_bitrate` \"avg\" : `ad_break_error_percentage`, `ad_error_percentage`, `ad_exit_before_start_count`, `ad_exit_before_start_percentage`, `ad_playback_failure_percentage`, `ad_startup_error_count`, `ad_startup_error_percentage`, `content_playback_failure_percentage`, `downscale_percentage`, `exits_before_video_start`, `playback_business_exception_percentage`, `playback_failure_percentage`, `playback_success_score`, `rebuffer_frequency`, `rebuffer_percentage`, `seek_latency`, `smoothness_score`, `startup_time_score`, `upscale_percentage`, `video_quality_score`, `video_startup_business_exception_percentage`, `video_startup_failure_percentage`, `viewer_experience_score` \"count\" : `started_views`, `unique_viewers` | **filters** | [**optional.Interface of []string**](string.md)| Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter. To exclude rows that match a certain condition, prepend a `!` character to the dimension. Possible filter names are the same as returned by the List Filters endpoint. Example: * `filters[]=operating_system:windows&filters[]=!country:US` | **metricFilters** | [**optional.Interface of []string**](string.md)| Limit the results to rows that match inequality conditions from provided metric comparison clauses. Must be provided as an array query string parameter. Possible filterable metrics are the same as the set of metric ids, with the exceptions of `exits_before_video_start`, `unique_viewers`, `video_startup_failure_percentage`, and `views`. Example: * `metric_filters[]=aggregate_startup_time>=1000` | **limit** | **optional.Int32**| Number of items to include in the response | [default to 25] @@ -197,7 +197,7 @@ Optional parameters are passed through a pointer to a ListInsightsOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **measurement** | **optional.String**| Measurement for the provided metric. If omitted, the default for the metric will be used. | + **measurement** | **optional.String**| Measurement for the provided metric. If omitted, the default for the metric will be used. The default measurement for each metric is: \"sum\" : `ad_attempt_count`, `ad_break_count`, `ad_break_error_count`, `ad_error_count`, `ad_impression_count`, `playing_time` \"median\" : `ad_preroll_startup_time`, `ad_watch_time`, `aggregate_startup_time`, `content_startup_time`, `content_watch_time`, `max_downscale_percentage`, `max_upscale_percentage`, `page_load_time`, `player_average_live_latency`, `player_startup_time`, `rebuffer_count`, `rebuffer_duration`, `requests_for_first_preroll`, `video_startup_preroll_load_time`, `video_startup_preroll_request_time`, `video_startup_time`, `view_average_request_latency`, `view_average_request_throughput`, `view_max_request_latency`, `weighted_average_bitrate` \"avg\" : `ad_break_error_percentage`, `ad_error_percentage`, `ad_exit_before_start_count`, `ad_exit_before_start_percentage`, `ad_playback_failure_percentage`, `ad_startup_error_count`, `ad_startup_error_percentage`, `content_playback_failure_percentage`, `downscale_percentage`, `exits_before_video_start`, `playback_business_exception_percentage`, `playback_failure_percentage`, `playback_success_score`, `rebuffer_frequency`, `rebuffer_percentage`, `seek_latency`, `smoothness_score`, `startup_time_score`, `upscale_percentage`, `video_quality_score`, `video_startup_business_exception_percentage`, `video_startup_failure_percentage`, `viewer_experience_score` \"count\" : `started_views`, `unique_viewers` | **orderDirection** | **optional.String**| Sort order. | **timeframe** | [**optional.Interface of []string**](string.md)| Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. `timeframe[]=1498867200&timeframe[]=1498953600` * duration string e.g. `timeframe[]=24:hours or timeframe[]=7:days` | **filters** | [**optional.Interface of []string**](string.md)| Limit the results to rows that match conditions from provided key:value pairs. Must be provided as an array query string parameter. To exclude rows that match a certain condition, prepend a `!` character to the dimension. Possible filter names are the same as returned by the List Filters endpoint. Example: * `filters[]=operating_system:windows&filters[]=!country:US` | diff --git a/docs/PlaybackId.md b/docs/PlaybackId.md index 6a1063b..2b5a366 100644 --- a/docs/PlaybackId.md +++ b/docs/PlaybackId.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Id** | **string** | Unique identifier for the PlaybackID | [optional] **Policy** | [**PlaybackPolicy**](PlaybackPolicy.md) | | [optional] +**DrmConfigurationId** | **string** | The DRM configuration used by this playback ID. Must only be set when `policy` is set to `drm`. | [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) diff --git a/model_create_asset_request.go b/model_create_asset_request.go index 4bb7020..74c8726 100644 --- a/model_create_asset_request.go +++ b/model_create_asset_request.go @@ -6,9 +6,11 @@ package muxgo type CreateAssetRequest struct { // 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. Input []InputSettings `json:"input,omitempty"` - // 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. + // 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). * `\"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. PlaybackPolicy []PlaybackPolicy `json:"playback_policy,omitempty"` - PerTitleEncode bool `json:"per_title_encode,omitempty"` + // An array of playback policy objects that you want applied to this asset and available through `playback_ids`. `advanced_playback_policies` must be used instead of `playback_policy` when creating a DRM playback ID. + AdvancedPlaybackPolicies []CreatePlaybackIdRequest `json:"advanced_playback_policies,omitempty"` + PerTitleEncode bool `json:"per_title_encode,omitempty"` // Arbitrary user-supplied 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**. Passthrough string `json:"passthrough,omitempty"` // Specify what level of support for mp4 playback. * 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). MP4 files are not produced for `none` (default). 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 videos guide](https://docs.mux.com/guides/enable-static-mp4-renditions) for more information. diff --git a/model_create_live_stream_request.go b/model_create_live_stream_request.go index 44f9dff..059ff0e 100644 --- a/model_create_live_stream_request.go +++ b/model_create_live_stream_request.go @@ -4,8 +4,10 @@ package muxgo type CreateLiveStreamRequest struct { - PlaybackPolicy []PlaybackPolicy `json:"playback_policy,omitempty"` - NewAssetSettings CreateAssetRequest `json:"new_asset_settings,omitempty"` + PlaybackPolicy []PlaybackPolicy `json:"playback_policy,omitempty"` + // An array of playback policy objects that you want applied to this asset and available through `playback_ids`. `advanced_playback_policies` must be used instead of `playback_policy` when creating a DRM playback ID. + AdvancedPlaybackPolicies []CreatePlaybackIdRequest `json:"advanced_playback_policies,omitempty"` + NewAssetSettings CreateAssetRequest `json:"new_asset_settings,omitempty"` // When live streaming software disconnects from Mux, either intentionally or due to a drop in the network, the Reconnect Window is the time in seconds that Mux should wait for the streaming software to reconnect before considering the live stream finished and completing the recorded asset. Defaults to 60 seconds on the API if not specified. If not specified directly, Standard Latency streams have a Reconnect Window of 60 seconds; Reduced and Low Latency streams have a default of 0 seconds, or no Reconnect Window. For that reason, we suggest specifying a value other than zero for Reduced and Low Latency streams. Reduced and Low Latency streams with a Reconnect Window greater than zero will insert slate media into the recorded asset while waiting for the streaming software to reconnect or when there are brief interruptions in the live stream media. When using a Reconnect Window setting higher than 60 seconds with a Standard Latency stream, we highly recommend enabling slate with the `use_slate_for_standard_latency` option. ReconnectWindow float32 `json:"reconnect_window,omitempty"` // 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. diff --git a/model_create_playback_id_request.go b/model_create_playback_id_request.go index bb3a00e..5133b01 100644 --- a/model_create_playback_id_request.go +++ b/model_create_playback_id_request.go @@ -5,4 +5,6 @@ package muxgo type CreatePlaybackIdRequest struct { Policy PlaybackPolicy `json:"policy,omitempty"` + // The DRM configuration used by this playback ID. Must only be set when `policy` is set to `drm`. + DrmConfigurationId string `json:"drm_configuration_id,omitempty"` } diff --git a/model_create_upload_request.go b/model_create_upload_request.go index d2a9e5a..5db461f 100644 --- a/model_create_upload_request.go +++ b/model_create_upload_request.go @@ -9,5 +9,6 @@ type CreateUploadRequest struct { // If the upload URL will be used in a browser, you must specify the origin in order for the signed URL to have the correct CORS headers. CorsOrigin string `json:"cors_origin,omitempty"` NewAssetSettings CreateAssetRequest `json:"new_asset_settings,omitempty"` - Test bool `json:"test,omitempty"` + // Indicates if this is a test Direct Upload, in which case the Asset that gets created will be a `test` Asset. + Test bool `json:"test,omitempty"` } diff --git a/model_drm_configuration.go b/model_drm_configuration.go new file mode 100644 index 0000000..aa8a228 --- /dev/null +++ b/model_drm_configuration.go @@ -0,0 +1,9 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +type DrmConfiguration struct { + // Unique identifier for the DRM Configuration. Max 255 characters. + Id string `json:"id,omitempty"` +} diff --git a/model_drm_configuration_response.go b/model_drm_configuration_response.go new file mode 100644 index 0000000..fae537d --- /dev/null +++ b/model_drm_configuration_response.go @@ -0,0 +1,8 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +type DrmConfigurationResponse struct { + Data DrmConfiguration `json:"data,omitempty"` +} diff --git a/model_list_drm_configurations_response.go b/model_list_drm_configurations_response.go new file mode 100644 index 0000000..aa81524 --- /dev/null +++ b/model_list_drm_configurations_response.go @@ -0,0 +1,8 @@ +// Mux Go - Copyright 2019 Mux Inc. +// NOTE: This file is auto generated. Do not edit this file manually. + +package muxgo + +type ListDrmConfigurationsResponse struct { + Data []DrmConfiguration `json:"data,omitempty"` +} diff --git a/model_playback_id.go b/model_playback_id.go index 8799ac1..3e343db 100644 --- a/model_playback_id.go +++ b/model_playback_id.go @@ -7,4 +7,6 @@ type PlaybackId struct { // Unique identifier for the PlaybackID Id string `json:"id,omitempty"` Policy PlaybackPolicy `json:"policy,omitempty"` + // The DRM configuration used by this playback ID. Must only be set when `policy` is set to `drm`. + DrmConfigurationId string `json:"drm_configuration_id,omitempty"` } diff --git a/model_playback_policy.go b/model_playback_policy.go index 0f426ee..6d0d123 100644 --- a/model_playback_policy.go +++ b/model_playback_policy.go @@ -10,4 +10,5 @@ type PlaybackPolicy string const ( PUBLIC PlaybackPolicy = "public" SIGNED PlaybackPolicy = "signed" + DRM PlaybackPolicy = "drm" )