-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathencoding_outputs_api.go
135 lines (117 loc) · 5.64 KB
/
encoding_outputs_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
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"
)
// EncodingOutputsAPI communicates with '/encoding/outputs' endpoints
type EncodingOutputsAPI struct {
apiClient *apiclient.APIClient
// Type communicates with '/encoding/outputs/{output_id}/type' endpoints
Type *EncodingOutputsTypeAPI
// S3 communicates with '/encoding/outputs/s3' endpoints
S3 *EncodingOutputsS3API
// S3RoleBased communicates with '/encoding/outputs/s3-role-based' endpoints
S3RoleBased *EncodingOutputsS3RoleBasedAPI
// GenericS3 communicates with '/encoding/outputs/generic-s3' endpoints
GenericS3 *EncodingOutputsGenericS3API
// Local communicates with '/encoding/outputs/local' endpoints
Local *EncodingOutputsLocalAPI
// Gcs communicates with '/encoding/outputs/gcs' endpoints
Gcs *EncodingOutputsGcsAPI
// GcsServiceAccount communicates with '/encoding/outputs/gcs-service-account' endpoints
GcsServiceAccount *EncodingOutputsGcsServiceAccountAPI
// Azure communicates with '/encoding/outputs/azure' endpoints
Azure *EncodingOutputsAzureAPI
// Ftp communicates with '/encoding/outputs/ftp' endpoints
Ftp *EncodingOutputsFtpAPI
// Sftp communicates with '/encoding/outputs/sftp' endpoints
Sftp *EncodingOutputsSftpAPI
// AkamaiMsl communicates with '/encoding/outputs/akamai-msl' endpoints
AkamaiMsl *EncodingOutputsAkamaiMslAPI
// AkamaiNetstorage communicates with '/encoding/outputs/akamai-netstorage' endpoints
AkamaiNetstorage *EncodingOutputsAkamaiNetstorageAPI
// LiveMediaIngest communicates with '/encoding/outputs/live-media-ingest' endpoints
LiveMediaIngest *EncodingOutputsLiveMediaIngestAPI
// Cdn communicates with '/encoding/outputs/cdn' endpoints
Cdn *EncodingOutputsCdnAPI
}
// NewEncodingOutputsAPI constructor for EncodingOutputsAPI that takes options as argument
func NewEncodingOutputsAPI(options ...apiclient.APIClientOption) (*EncodingOutputsAPI, error) {
apiClient, err := apiclient.NewAPIClient(options...)
if err != nil {
return nil, err
}
return NewEncodingOutputsAPIWithClient(apiClient), nil
}
// NewEncodingOutputsAPIWithClient constructor for EncodingOutputsAPI that takes an APIClient as argument
func NewEncodingOutputsAPIWithClient(apiClient *apiclient.APIClient) *EncodingOutputsAPI {
a := &EncodingOutputsAPI{apiClient: apiClient}
a.Type = NewEncodingOutputsTypeAPIWithClient(apiClient)
a.S3 = NewEncodingOutputsS3APIWithClient(apiClient)
a.S3RoleBased = NewEncodingOutputsS3RoleBasedAPIWithClient(apiClient)
a.GenericS3 = NewEncodingOutputsGenericS3APIWithClient(apiClient)
a.Local = NewEncodingOutputsLocalAPIWithClient(apiClient)
a.Gcs = NewEncodingOutputsGcsAPIWithClient(apiClient)
a.GcsServiceAccount = NewEncodingOutputsGcsServiceAccountAPIWithClient(apiClient)
a.Azure = NewEncodingOutputsAzureAPIWithClient(apiClient)
a.Ftp = NewEncodingOutputsFtpAPIWithClient(apiClient)
a.Sftp = NewEncodingOutputsSftpAPIWithClient(apiClient)
a.AkamaiMsl = NewEncodingOutputsAkamaiMslAPIWithClient(apiClient)
a.AkamaiNetstorage = NewEncodingOutputsAkamaiNetstorageAPIWithClient(apiClient)
a.LiveMediaIngest = NewEncodingOutputsLiveMediaIngestAPIWithClient(apiClient)
a.Cdn = NewEncodingOutputsCdnAPIWithClient(apiClient)
return a
}
// CheckPermissions Check output permissions (S3 only)
func (api *EncodingOutputsAPI) CheckPermissions(outputId string) (*model.CheckOutputPermissionsResponse, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["output_id"] = outputId
}
var responseModel model.CheckOutputPermissionsResponse
err := api.apiClient.Post("/encoding/outputs/{output_id}/check-permissions", nil, &responseModel, reqParams)
return &responseModel, err
}
// CheckPermissions Check output permissions (S3 only)
func (api *EncodingOutputsAPI) CheckPermissionsWithRequestBody(outputId string, checkOutputPermissionsRequest model.CheckOutputPermissionsRequest) (*model.CheckOutputPermissionsResponse, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["output_id"] = outputId
}
var responseModel model.CheckOutputPermissionsResponse
err := api.apiClient.Post("/encoding/outputs/{output_id}/check-permissions", &checkOutputPermissionsRequest, &responseModel, reqParams)
return &responseModel, err
}
// Get Output Details
func (api *EncodingOutputsAPI) Get(outputId string) (*model.Output, error) {
reqParams := func(params *apiclient.RequestParams) {
params.PathParams["output_id"] = outputId
}
var responseModel model.Output
err := api.apiClient.Get("/encoding/outputs/{output_id}", nil, &responseModel, reqParams)
return &responseModel, err
}
// List all Outputs
func (api *EncodingOutputsAPI) List(queryParams ...func(*EncodingOutputsAPIListQueryParams)) (*pagination.OutputsListPagination, error) {
queryParameters := &EncodingOutputsAPIListQueryParams{}
for _, queryParam := range queryParams {
queryParam(queryParameters)
}
reqParams := func(params *apiclient.RequestParams) {
params.QueryParams = queryParameters
}
var responseModel pagination.OutputsListPagination
err := api.apiClient.Get("/encoding/outputs", nil, &responseModel, reqParams)
return &responseModel, err
}
// EncodingOutputsAPIListQueryParams contains all query parameters for the List endpoint
type EncodingOutputsAPIListQueryParams struct {
Offset int32 `query:"offset"`
Limit int32 `query:"limit"`
Name string `query:"name"`
Sort string `query:"sort"`
Type_ model.OutputType `query:"type"`
}
// Params will return a map of query parameters
func (q *EncodingOutputsAPIListQueryParams) Params() map[string]string {
return apiclient.GetParamsMap(q)
}