-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathencoding_manifests_dash_api.go
156 lines (128 loc) · 6.23 KB
/
encoding_manifests_dash_api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
package api
import (
"github.com/bitmovin/bitmovin-api-sdk-go/apiclient"
"github.com/bitmovin/bitmovin-api-sdk-go/model"
"github.com/bitmovin/bitmovin-api-sdk-go/pagination"
)
// EncodingManifestsDashAPI communicates with '/encoding/manifests/dash' endpoints
type EncodingManifestsDashAPI struct {
apiClient *apiclient.APIClient
// Default communicates with '/encoding/manifests/dash/default' endpoints
Default *EncodingManifestsDashDefaultAPI
// Customdata communicates with '/encoding/manifests/dash/{manifest_id}/customData' endpoints
Customdata *EncodingManifestsDashCustomdataAPI
// Periods communicates with '/encoding/manifests/dash/{manifest_id}/periods' endpoints
Periods *EncodingManifestsDashPeriodsAPI
}
// NewEncodingManifestsDashAPI constructor for EncodingManifestsDashAPI that takes options as argument
func NewEncodingManifestsDashAPI(options ...apiclient.APIClientOption) (*EncodingManifestsDashAPI, error) {
apiClient, err := apiclient.NewAPIClient(options...)
if err != nil {
return nil, err
}
return NewEncodingManifestsDashAPIWithClient(apiClient), nil
}
// NewEncodingManifestsDashAPIWithClient constructor for EncodingManifestsDashAPI that takes an APIClient as argument
func NewEncodingManifestsDashAPIWithClient(apiClient *apiclient.APIClient) *EncodingManifestsDashAPI {
a := &EncodingManifestsDashAPI{apiClient: apiClient}
a.Default = NewEncodingManifestsDashDefaultAPIWithClient(apiClient)
a.Customdata = NewEncodingManifestsDashCustomdataAPIWithClient(apiClient)
a.Periods = NewEncodingManifestsDashPeriodsAPIWithClient(apiClient)
return a
}
// Create Custom DASH Manifest
// A Custom DASH Manifest gives you full control over its contents. Add Periods, Adaptation Sets, Representations, Content Protections or Custom XML Elements via the respective endpoints. If you need a simpler solution, create a Default Manifest resource instead. See [documentation](https://developer.bitmovin.com/encoding/docs/default-vs-custom-manifest) page for a comparison
func (api *EncodingManifestsDashAPI) Create(dashManifest model.DashManifest) (*model.DashManifest, error) {
reqParams := func(params *apiclient.RequestParams) {
}
var responseModel model.DashManifest
err := api.apiClient.Post("/encoding/manifests/dash", &dashManifest, &responseModel, reqParams)
return &responseModel, err
}
// Delete DASH Manifest
func (api *EncodingManifestsDashAPI) Delete(manifestId string) (*model.BitmovinResponse, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["manifest_id"] = manifestId
}
var responseModel model.BitmovinResponse
err := api.apiClient.Delete("/encoding/manifests/dash/{manifest_id}", nil, &responseModel, reqParams)
return &responseModel, err
}
// Get DASH Manifest Details
func (api *EncodingManifestsDashAPI) Get(manifestId string) (*model.DashManifest, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["manifest_id"] = manifestId
}
var responseModel model.DashManifest
err := api.apiClient.Get("/encoding/manifests/dash/{manifest_id}", nil, &responseModel, reqParams)
return &responseModel, err
}
// GetStartRequest Manifest Start Details
func (api *EncodingManifestsDashAPI) GetStartRequest(manifestId string) (*model.StartManifestRequest, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["manifest_id"] = manifestId
}
var responseModel model.StartManifestRequest
err := api.apiClient.Get("/encoding/manifests/dash/{manifest_id}/start", nil, &responseModel, reqParams)
return &responseModel, err
}
// List DASH Manifests
func (api *EncodingManifestsDashAPI) List(queryParams ...func(*EncodingManifestsDashAPIListQueryParams)) (*pagination.DashManifestsListPagination, error) {
queryParameters := &EncodingManifestsDashAPIListQueryParams{}
for _, queryParam := range queryParams {
queryParam(queryParameters)
}
reqParams := func(params *apiclient.RequestParams) {
params.QueryParams = queryParameters
}
var responseModel pagination.DashManifestsListPagination
err := api.apiClient.Get("/encoding/manifests/dash", nil, &responseModel, reqParams)
return &responseModel, err
}
// Start DASH manifest generation
func (api *EncodingManifestsDashAPI) Start(manifestId string) (*model.BitmovinResponse, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["manifest_id"] = manifestId
}
var responseModel model.BitmovinResponse
err := api.apiClient.Post("/encoding/manifests/dash/{manifest_id}/start", nil, &responseModel, reqParams)
return &responseModel, err
}
// Start DASH manifest generation
func (api *EncodingManifestsDashAPI) StartWithRequestBody(manifestId string, startManifestRequest model.StartManifestRequest) (*model.BitmovinResponse, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["manifest_id"] = manifestId
}
var responseModel model.BitmovinResponse
err := api.apiClient.Post("/encoding/manifests/dash/{manifest_id}/start", &startManifestRequest, &responseModel, reqParams)
return &responseModel, err
}
// Status DASH manifest generation status
func (api *EncodingManifestsDashAPI) Status(manifestId string) (*model.ModelTask, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["manifest_id"] = manifestId
}
var responseModel model.ModelTask
err := api.apiClient.Get("/encoding/manifests/dash/{manifest_id}/status", nil, &responseModel, reqParams)
return &responseModel, err
}
// Stop DASH manifest generation
func (api *EncodingManifestsDashAPI) Stop(manifestId string) (*model.BitmovinResponse, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["manifest_id"] = manifestId
}
var responseModel model.BitmovinResponse
err := api.apiClient.Post("/encoding/manifests/dash/{manifest_id}/stop", nil, &responseModel, reqParams)
return &responseModel, err
}
// EncodingManifestsDashAPIListQueryParams contains all query parameters for the List endpoint
type EncodingManifestsDashAPIListQueryParams struct {
Offset int32 `query:"offset"`
Limit int32 `query:"limit"`
Sort string `query:"sort"`
EncodingId string `query:"encodingId"`
}
// Params will return a map of query parameters
func (q *EncodingManifestsDashAPIListQueryParams) Params() map[string]string {
return apiclient.GetParamsMap(q)
}