Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before.
This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.
- API version: v1
- Package version: 1.0.0-rc.1
- Build package: org.openapitools.codegen.languages.GoClientCodegen
Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
Put the package under your project folder and add the following in import:
import sw "./muxgo"
To use a proxy, set the environment variable HTTP_PROXY
:
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
Default configuration comes with Servers
field that contains server objects as defined in the OpenAPI specification.
For using other server than the one defined on index 0 set context value sw.ContextServerIndex
of type int
.
ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1)
Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables
of type map[string]string
.
ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{
"basePath": "v2",
})
Note, enum values are always validated and all unused variables are silently ignored.
Each operation can use different server URL defined using OperationServers
map in the Configuration
.
An operation is uniquely identifield by "{classname}Service.{nickname}"
string.
Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices
and sw.ContextOperationServerVariables
context maps.
ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
All URIs are relative to https://api.mux.com
Class | Method | HTTP request | Description |
---|---|---|---|
AssetsApi | CreateAsset | Post /video/v1/assets | Create an asset |
AssetsApi | CreateAssetPlaybackId | Post /video/v1/assets/{ASSET_ID}/playback-ids | Create a playback ID |
AssetsApi | CreateAssetTrack | Post /video/v1/assets/{ASSET_ID}/tracks | Create an asset track |
AssetsApi | DeleteAsset | Delete /video/v1/assets/{ASSET_ID} | Delete an asset |
AssetsApi | DeleteAssetPlaybackId | Delete /video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID} | Delete a playback ID |
AssetsApi | DeleteAssetTrack | Delete /video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID} | Delete an asset track |
AssetsApi | GetAsset | Get /video/v1/assets/{ASSET_ID} | Retrieve an asset |
AssetsApi | GetAssetInputInfo | Get /video/v1/assets/{ASSET_ID}/input-info | Retrieve asset input info |
AssetsApi | GetAssetPlaybackId | Get /video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID} | Retrieve a playback ID |
AssetsApi | ListAssets | Get /video/v1/assets | List assets |
AssetsApi | UpdateAssetMasterAccess | Put /video/v1/assets/{ASSET_ID}/master-access | Update master access |
AssetsApi | UpdateAssetMp4Support | Put /video/v1/assets/{ASSET_ID}/mp4-support | Update MP4 support |
DeliveryUsageApi | ListDeliveryUsage | Get /video/v1/delivery-usage | List Usage |
DimensionsApi | ListDimensionValues | Get /data/v1/dimensions/{DIMENSION_ID} | Lists the values for a specific dimension |
DimensionsApi | ListDimensions | Get /data/v1/dimensions | List Dimensions |
DirectUploadsApi | CancelDirectUpload | Put /video/v1/uploads/{UPLOAD_ID}/cancel | Cancel a direct upload |
DirectUploadsApi | CreateDirectUpload | Post /video/v1/uploads | Create a new direct upload URL |
DirectUploadsApi | GetDirectUpload | Get /video/v1/uploads/{UPLOAD_ID} | Retrieve a single direct upload's info |
DirectUploadsApi | ListDirectUploads | Get /video/v1/uploads | List direct uploads |
ErrorsApi | ListErrors | Get /data/v1/errors | List Errors |
ExportsApi | ListExports | Get /data/v1/exports | List property video view export links |
FiltersApi | ListFilterValues | Get /data/v1/filters/{FILTER_ID} | Lists values for a specific filter |
FiltersApi | ListFilters | Get /data/v1/filters | List Filters |
IncidentsApi | GetIncident | Get /data/v1/incidents/{INCIDENT_ID} | Get an Incident |
IncidentsApi | ListIncidents | Get /data/v1/incidents | List Incidents |
IncidentsApi | ListRelatedIncidents | Get /data/v1/incidents/{INCIDENT_ID}/related | List Related Incidents |
LiveStreamsApi | CreateLiveStream | Post /video/v1/live-streams | Create a live stream |
LiveStreamsApi | CreateLiveStreamPlaybackId | Post /video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids | Create a live stream playback ID |
LiveStreamsApi | CreateLiveStreamSimulcastTarget | Post /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets | Create a live stream simulcast target |
LiveStreamsApi | DeleteLiveStream | Delete /video/v1/live-streams/{LIVE_STREAM_ID} | Delete a live stream |
LiveStreamsApi | DeleteLiveStreamPlaybackId | Delete /video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids/{PLAYBACK_ID} | Delete a live stream playback ID |
LiveStreamsApi | DeleteLiveStreamSimulcastTarget | Delete /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Delete a Live Stream Simulcast Target |
LiveStreamsApi | DisableLiveStream | Put /video/v1/live-streams/{LIVE_STREAM_ID}/disable | Disable a live stream |
LiveStreamsApi | EnableLiveStream | Put /video/v1/live-streams/{LIVE_STREAM_ID}/enable | Enable a live stream |
LiveStreamsApi | GetLiveStream | Get /video/v1/live-streams/{LIVE_STREAM_ID} | Retrieve a live stream |
LiveStreamsApi | GetLiveStreamSimulcastTarget | Get /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Retrieve a Live Stream Simulcast Target |
LiveStreamsApi | ListLiveStreams | Get /video/v1/live-streams | List live streams |
LiveStreamsApi | ResetStreamKey | Post /video/v1/live-streams/{LIVE_STREAM_ID}/reset-stream-key | Reset a live stream’s stream key |
LiveStreamsApi | SignalLiveStreamComplete | Put /video/v1/live-streams/{LIVE_STREAM_ID}/complete | Signal a live stream is finished |
MetricsApi | GetMetricTimeseriesData | Get /data/v1/metrics/{METRIC_ID}/timeseries | Get metric timeseries data |
MetricsApi | GetOverallValues | Get /data/v1/metrics/{METRIC_ID}/overall | Get Overall values |
MetricsApi | ListAllMetricValues | Get /data/v1/metrics/comparison | List all metric values |
MetricsApi | ListBreakdownValues | Get /data/v1/metrics/{METRIC_ID}/breakdown | List breakdown values |
MetricsApi | ListInsights | Get /data/v1/metrics/{METRIC_ID}/insights | List Insights |
PlaybackIDApi | GetAssetOrLivestreamId | Get /video/v1/playback-ids/{PLAYBACK_ID} | Retrieve an Asset or Live Stream ID |
RealTimeApi | GetRealtimeBreakdown | Get /data/v1/realtime/metrics/{REALTIME_METRIC_ID}/breakdown | Get Real-Time Breakdown |
RealTimeApi | GetRealtimeHistogramTimeseries | Get /data/v1/realtime/metrics/{REALTIME_HISTOGRAM_METRIC_ID}/histogram-timeseries | Get Real-Time Histogram Timeseries |
RealTimeApi | GetRealtimeTimeseries | Get /data/v1/realtime/metrics/{REALTIME_METRIC_ID}/timeseries | Get Real-Time Timeseries |
RealTimeApi | ListRealtimeDimensions | Get /data/v1/realtime/dimensions | List Real-Time Dimensions |
RealTimeApi | ListRealtimeMetrics | Get /data/v1/realtime/metrics | List Real-Time Metrics |
URLSigningKeysApi | CreateUrlSigningKey | Post /video/v1/signing-keys | Create a URL signing key |
URLSigningKeysApi | DeleteUrlSigningKey | Delete /video/v1/signing-keys/{SIGNING_KEY_ID} | Delete a URL signing key |
URLSigningKeysApi | GetUrlSigningKey | Get /video/v1/signing-keys/{SIGNING_KEY_ID} | Retrieve a URL signing key |
URLSigningKeysApi | ListUrlSigningKeys | Get /video/v1/signing-keys | List URL signing keys |
VideoViewsApi | GetVideoView | Get /data/v1/video-views/{VIDEO_VIEW_ID} | Get a Video View |
VideoViewsApi | ListVideoViews | Get /data/v1/video-views | List Video Views |
- AbridgedVideoView
- Asset
- AssetErrors
- AssetMaster
- AssetNonStandardInputReasons
- AssetRecordingTimes
- AssetResponse
- AssetStaticRenditions
- AssetStaticRenditionsFiles
- BreakdownValue
- CreateAssetRequest
- CreateLiveStreamRequest
- CreatePlaybackIDRequest
- CreatePlaybackIDResponse
- CreateSimulcastTargetRequest
- CreateTrackRequest
- CreateTrackResponse
- CreateUploadRequest
- DeliveryReport
- DimensionValue
- DisableLiveStreamResponse
- EnableLiveStreamResponse
- Error
- FilterValue
- GetAssetInputInfoResponse
- GetAssetOrLiveStreamIdResponse
- GetAssetOrLiveStreamIdResponseData
- GetAssetOrLiveStreamIdResponseDataObject
- GetAssetPlaybackIDResponse
- GetMetricTimeseriesDataResponse
- GetOverallValuesResponse
- GetRealTimeBreakdownResponse
- GetRealTimeHistogramTimeseriesResponse
- GetRealTimeHistogramTimeseriesResponseMeta
- GetRealTimeTimeseriesResponse
- Incident
- IncidentBreakdown
- IncidentNotification
- IncidentNotificationRule
- IncidentResponse
- InputFile
- InputInfo
- InputSettings
- InputSettingsOverlaySettings
- InputTrack
- Insight
- ListAllMetricValuesResponse
- ListAssetsResponse
- ListBreakdownValuesResponse
- ListDeliveryUsageResponse
- ListDimensionValuesResponse
- ListDimensionsResponse
- ListErrorsResponse
- ListExportsResponse
- ListFilterValuesResponse
- ListFiltersResponse
- ListFiltersResponseData
- ListIncidentsResponse
- ListInsightsResponse
- ListLiveStreamsResponse
- ListRealTimeDimensionsResponse
- ListRealTimeDimensionsResponseData
- ListRealTimeMetricsResponse
- ListRelatedIncidentsResponse
- ListSigningKeysResponse
- ListUploadsResponse
- ListVideoViewsResponse
- LiveStream
- LiveStreamResponse
- Metric
- NotificationRule
- OverallValues
- PlaybackID
- PlaybackPolicy
- RealTimeBreakdownValue
- RealTimeHistogramTimeseriesBucket
- RealTimeHistogramTimeseriesBucketValues
- RealTimeHistogramTimeseriesDatapoint
- RealTimeTimeseriesDatapoint
- Score
- SignalLiveStreamCompleteResponse
- SigningKey
- SigningKeyResponse
- SimulcastTarget
- SimulcastTargetResponse
- Track
- UpdateAssetMP4SupportRequest
- UpdateAssetMasterAccessRequest
- Upload
- UploadError
- UploadResponse
- VideoView
- VideoViewEvent
- VideoViewResponse
- Type: HTTP basic authentication
Example
auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
UserName: "username",
Password: "password",
})
r, err := client.Service.Operation(auth, args)
Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:
PtrBool
PtrInt
PtrInt32
PtrInt64
PtrFloat
PtrFloat32
PtrFloat64
PtrString
PtrTime