-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathapi_tags.go
134 lines (108 loc) · 3.61 KB
/
api_tags.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
/*
* api.video
*
* api.video is an API that encodes on the go to facilitate immediate playback, enhancing viewer streaming experiences across multiple devices and platforms. You can stream live or on-demand online videos within minutes.
*
* API version: 1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package apivideosdk
import (
"context"
"net/http"
"net/url"
)
// Linger please
var (
_ context.Context
)
type TagsApiListRequest struct {
value *string
sortBy *string
sortOrder *string
currentPage *int32
pageSize *int32
}
func (r TagsApiListRequest) Value(value string) TagsApiListRequest {
r.value = &value
return r
}
func (r TagsApiListRequest) SortBy(sortBy string) TagsApiListRequest {
r.sortBy = &sortBy
return r
}
func (r TagsApiListRequest) SortOrder(sortOrder string) TagsApiListRequest {
r.sortOrder = &sortOrder
return r
}
func (r TagsApiListRequest) CurrentPage(currentPage int32) TagsApiListRequest {
r.currentPage = ¤tPage
return r
}
func (r TagsApiListRequest) PageSize(pageSize int32) TagsApiListRequest {
r.pageSize = &pageSize
return r
}
type TagsServiceI interface {
/*
* List List all video tags
* @return TagsApiListRequest
*/
List(r TagsApiListRequest) (*ListTagsResponse, error)
/*
* List List all video tags
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return TagsApiListRequest
*/
ListWithContext(ctx context.Context, r TagsApiListRequest) (*ListTagsResponse, error)
}
// TagsService communicating with the Tags
// endpoints of the api.video API
type TagsService struct {
client *Client
}
/*
* List List all video tags
* This endpoint enables you to search for video tags in a project and see how many videos are tagged with them. If you do not define any query parameters, the endpoint lists all video tags and the numbers of times they are used in a project.
* @return TagsApiListRequest
*/
func (s *TagsService) List(r TagsApiListRequest) (*ListTagsResponse, error) {
return s.ListWithContext(context.Background(), r)
}
/*
* List List all video tags
* This endpoint enables you to search for video tags in a project and see how many videos are tagged with them. If you do not define any query parameters, the endpoint lists all video tags and the numbers of times they are used in a project.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return TagsApiListRequest
*/
func (s *TagsService) ListWithContext(ctx context.Context, r TagsApiListRequest) (*ListTagsResponse, error) {
var localVarPostBody interface{}
localVarPath := "/tags"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
if r.value != nil {
localVarQueryParams.Add("value", parameterToString(*r.value, ""))
}
if r.sortBy != nil {
localVarQueryParams.Add("sortBy", parameterToString(*r.sortBy, ""))
}
if r.sortOrder != nil {
localVarQueryParams.Add("sortOrder", parameterToString(*r.sortOrder, ""))
}
if r.currentPage != nil {
localVarQueryParams.Add("currentPage", parameterToString(*r.currentPage, ""))
}
if r.pageSize != nil {
localVarQueryParams.Add("pageSize", parameterToString(*r.pageSize, ""))
}
req, err := s.client.prepareRequest(ctx, http.MethodGet, localVarPath, localVarPostBody, localVarHeaderParams, localVarQueryParams)
if err != nil {
return nil, err
}
res := new(ListTagsResponse)
_, err = s.client.do(req, res)
if err != nil {
return nil, err
}
return res, nil
}