-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
336 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
|
||
|
Oops, something went wrong.