diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c49e27..6bb7526 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All changes to this project will be documented in this file. +## [1.4.3] - 2024-09-30 +- Add /tags API endpoint + ## [1.4.2] - 2024-09-16 - Add discarded video endpoints diff --git a/README.md b/README.md index 2935b5c..9aca834 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ - [Chapters](#chapters) - [LiveStreams](#livestreams) - [PlayerThemes](#playerthemes) + - [Tags](#tags) - [UploadTokens](#uploadtokens) - [Videos](#videos) - [Watermarks](#watermarks) @@ -230,6 +231,22 @@ Method | HTTP request | Description [**DeleteLogo**](https://github.com/apivideo/api.video-go-client/blob/main/docs/PlayerThemes.md#DeleteLogo) | **Delete** `/players/{playerId}/logo` | Delete logo +#### Tags + + +##### Retrieve an instance of the Tags API: +```golang +client := apivideosdk.ClientBuilder("API_VIDEO_KEY").Build() +tagsApi := client.Tags +``` + +##### Endpoints + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**List**](https://github.com/apivideo/api.video-go-client/blob/main/docs/Tags.md#List) | **Get** `/tags` | List all video tags + + #### UploadTokens @@ -345,6 +362,8 @@ Method | HTTP request | Description - [FilterBy1](https://github.com/apivideo/api.video-go-client/blob/main/docs/FilterBy1.md) - [FilterBy2](https://github.com/apivideo/api.video-go-client/blob/main/docs/FilterBy2.md) - [Link](https://github.com/apivideo/api.video-go-client/blob/main/docs/Link.md) + - [ListTagsResponse](https://github.com/apivideo/api.video-go-client/blob/main/docs/ListTagsResponse.md) + - [ListTagsResponseData](https://github.com/apivideo/api.video-go-client/blob/main/docs/ListTagsResponseData.md) - [LiveStream](https://github.com/apivideo/api.video-go-client/blob/main/docs/LiveStream.md) - [LiveStreamAssets](https://github.com/apivideo/api.video-go-client/blob/main/docs/LiveStreamAssets.md) - [LiveStreamCreationPayload](https://github.com/apivideo/api.video-go-client/blob/main/docs/LiveStreamCreationPayload.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 3642844..7335f0d 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -974,6 +974,163 @@ paths: code: | // First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started // Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideosAPI.md#create + /tags: + get: + description: 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. + operationId: LIST-tags + parameters: + - description: | + Use this parameter to search for specific video tags. The API filters results even on partial values, and ignores accents, uppercase, and lowercase. + explode: true + in: query + name: value + required: false + schema: + type: string + style: form + - description: | + Use this parameter to choose which field the API will use to sort the response data. The default is `value`. + + These are the available fields to sort by: + + - `value`: Sorts the results based on tag values in alphabetic order. + - `videoCount`: Sorts the results based on the number of times a video tag is used. + example: value + explode: true + in: query + name: sortBy + required: false + schema: + enum: + - value + - videoCount + type: string + style: form + - description: Use this parameter to sort results. `asc` is ascending and sorts + from A to Z. `desc` is descending and sorts from Z to A. + example: asc + explode: true + in: query + name: sortOrder + required: false + schema: + enum: + - asc + - desc + type: string + style: form + - description: 'Choose the number of search results to return per page. Minimum + value: 1' + example: 2 + explode: true + in: query + name: currentPage + required: false + schema: + default: 1 + type: integer + style: form + - description: Results per page. Allowed values 1-100, default is 25. + example: 30 + explode: true + in: query + name: pageSize + required: false + schema: + default: 25 + type: integer + style: form + responses: + "200": + content: + application/json: + examples: + response: + value: + data: + - value: maths + videoCount: "33" + - value: tutorials + videoCount: "10" + pagination: + currentPage: 1 + pageSize: 25 + pagesTotal: 1 + itemsTotal: 2 + currentPageItems: 2 + links: + - rel: self + uri: /tags?currentPage=1&pageSize=25 + - rel: first + uri: /tags?currentPage=1&pageSize=25 + - rel: last + uri: /tags?currentPage=1&pageSize=25 + schema: + $ref: '#/components/schemas/list-tags-response' + description: Success + headers: + X-RateLimit-Limit: + description: The request limit per minute. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Remaining: + description: The number of available requests left for the current time + window. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Retry-After: + description: The number of seconds left until the current rate limit + window resets. + explode: false + schema: + type: integer + style: simple + "429": + content: + application/json: + examples: + Too many requests: + value: + type: https://docs.api.video/reference/too-many-requests + title: Too many requests. + status: 429 + schema: + $ref: '#/components/schemas/too-many-requests' + description: Too Many Requests + headers: + X-RateLimit-Limit: + description: The request limit per minute. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Remaining: + description: The number of available requests left for the current time + window. + explode: false + schema: + type: integer + style: simple + X-RateLimit-Retry-After: + description: The number of seconds left until the current rate limit + window resets. + explode: false + schema: + type: integer + style: simple + summary: List all video tags + tags: + - Tags + x-client-action: list + x-group-parameters: true + x-client-paginated: true /videos/{videoId}/source: post: description: Ingest a video from a source or file. @@ -13450,17 +13607,19 @@ paths: events: - video.encoding.quality.completed url: http://clientnotificationserver.com/notif?myquery=query + signatureSecret: sig_sec_Abcd12348RLP7VPLi7nYVh - webhookId: webhook_XXXXXXXXXYYYYYY createdAt: 2021-01-12T12:12:12+00:00 events: - video.encoding.quality.completed url: http://clientnotificationserver.com/notif?myquery=query2 + signatureSecret: sig_sec_Abcd12358RLP7VPLi7nYVy pagination: currentPage: 1 pageSize: 25 pagesTotal: 1 - itemsTotal: 11 - currentPageItems: 11 + itemsTotal: 2 + currentPageItems: 2 links: - rel: self uri: https://ws.api.video/webhooks?currentPage=1 @@ -14765,6 +14924,41 @@ components: - videoId title: Video type: object + list-tags-response: + example: + pagination: + itemsTotal: 123 + pagesTotal: 7 + pageSize: 20 + currentPage: 3 + currentPageItems: 20 + links: + first: + rel: first + uri: /videos/search?currentPage=1&pageSize=20 + previous: + rel: previous + uri: /videos/search?currentPage=2&pageSize=20 + next: + rel: next + uri: /videos/search?currentPage=4&pageSize=20 + last: + rel: last + uri: /videos/search?currentPage=6&pageSize=20 + data: + - videoCount: 0 + value: value + - videoCount: 0 + value: value + properties: + data: + items: + $ref: '#/components/schemas/list_tags_response_data' + type: array + pagination: + $ref: '#/components/schemas/pagination' + title: Tags + type: object watermark: example: watermarkId: watermark_1BWr2L5MTQwxGkuxKjzh6i @@ -15213,26 +15407,33 @@ components: webhookId: webhook_XXXXXXXXXXXXXXX events: '["video.encoding.quality.completed"]' url: http://clientnotificationserver.com/notif?myquery=query + signatureSecret: signatureSecret properties: webhookId: - description: Unique identifier of the webhook + description: A unique identifier of the webhook you subscribed to. example: webhook_XXXXXXXXXXXXXXX type: string createdAt: - description: When an webhook was created, presented in ATOM UTC format. + description: The time and date when you created this webhook subscription, + in ATOM UTC format. example: 2019-06-24T11:45:01Z format: date-time type: string events: - description: A list of events that will trigger the webhook. + description: A list of events that you subscribed to. When these events + occur, the API triggers a webhook call to the URL you provided. example: '["video.encoding.quality.completed"]' items: type: string type: array url: - description: URL of the webhook + description: The URL where the API sends the webhook. example: http://clientnotificationserver.com/notif?myquery=query type: string + signatureSecret: + description: A secret key for the webhook you subscribed to. You can use + it to verify the origin of the webhook call that you receive. + type: string title: Webhook type: object video-status: @@ -16368,10 +16569,12 @@ components: webhookId: webhook_XXXXXXXXXXXXXXX events: '["video.encoding.quality.completed"]' url: http://clientnotificationserver.com/notif?myquery=query + signatureSecret: signatureSecret - createdAt: 2019-06-24T11:45:01Z webhookId: webhook_XXXXXXXXXXXXXXX events: '["video.encoding.quality.completed"]' url: http://clientnotificationserver.com/notif?myquery=query + signatureSecret: signatureSecret properties: data: items: @@ -16903,6 +17106,18 @@ components: type: string type: object x-is-deep-object: true + list_tags_response_data: + example: + videoCount: 0 + value: value + properties: + value: + description: Returns the value of a video tag used in your project. + type: string + videoCount: + description: Returns the number of times a video tag is used. + type: integer + type: object player_theme_assets: example: link: path/to/my/logo/mylogo.jpg @@ -17100,3 +17315,213 @@ x-doctave: - node - php - python +x-webhooks: + live-stream.broadcast.started: + post: + tags: + - Webhooks + summary: Live stream started + description: This webhook triggers when a live stream broadcast is started. + operationId: POST-webhooks + parameters: + - in: header + name: X-Api-Video-WebhookID + schema: + type: string + description: The unique ID of your webhook. + required: true + - in: header + name: X-Api-Video-Signature + schema: + type: string + description: The webhook's body encrypted using the webhook's signature secret, + in HMAC SHA256. Use this hash to verify that api.video is the origin of + this webhook notification. + required: true + requestBody: + content: + application/json: + schema: + type: object + properties: + type: + type: string + description: The name of the webhook event that occured. + example: live-stream.broadcast.started + emittedAt: + description: Returns the date-time when the webhook event occurred. + type: string + format: date-time + example: 2024-08-151T10:18:47+00:00 + liveStreamId: + description: The ID of the live stream that started broadcasting. + type: string + example: li400mYKSgQ6xs7taUeSaEap + responses: + "202": + summary: Accepted + description: Your webhook server may return this response to api.video to + signal that the webhook is accepted. + live-stream.broadcast.ended: + post: + tags: + - Webhooks + summary: Live stream ended + description: This webhook triggers when a live stream broadcast is ended. + operationId: POST-webhooks + parameters: + - in: header + name: X-Api-Video-WebhookID + schema: + type: string + description: The unique ID of your webhook. + required: true + - in: header + name: X-Api-Video-Signature + schema: + type: string + description: The webhook's body encrypted using the webhook's signature secret, + in HMAC SHA256. Use this hash to verify that api.video is the origin of + this webhook notification. + required: true + requestBody: + content: + application/json: + schema: + type: object + properties: + type: + type: string + description: The name of the webhook event that occured. + example: live-stream.broadcast.ended + emittedAt: + description: Returns the date-time when the webhook event occurred. + type: string + format: date-time + example: 2024-08-151T10:18:47+00:00 + liveStreamId: + description: The ID of the live stream that ended broadcasting. + type: string + example: li400mYKSgQ6xs7taUeSaEap + responses: + "202": + summary: Accepted + description: Your webhook server may return this response to api.video to + signal that the webhook is accepted. + video.source.recorded: + post: + tags: + - Webhooks + summary: Video source recorded + description: This webhook triggers when a live stream broadcast is completed + and the recording of the stream is ready for transcoding. This means that + the video is in queue for transcoding. + operationId: POST-webhooks + parameters: + - in: header + name: X-Api-Video-WebhookID + schema: + type: string + description: The unique ID of your webhook. + required: true + - in: header + name: X-Api-Video-Signature + schema: + type: string + description: The webhook's body encrypted using the webhook's signature secret, + in HMAC SHA256. Use this hash to verify that api.video is the origin of + this webhook notification. + required: true + requestBody: + content: + application/json: + schema: + type: object + properties: + type: + type: string + description: The name of the webhook event that occured. + example: video.source.recorded + emittedAt: + description: Returns the date-time when the webhook event occurred. + type: string + format: date-time + example: 2024-08-151T10:18:47+00:00 + liveStreamId: + description: The ID of the live stream that ended broadcasting. + type: string + example: li400mYKSgQ6xs7taUeSaEap + videoId: + description: The video ID of the live stream recording. + type: string + example: vi4blUQJFrYWbaG44NChkH11 + responses: + "202": + summary: Accepted + description: Your webhook server may return this response to api.video to + signal that the webhook is accepted. + video.encoding.quality.completed: + post: + tags: + - Webhooks + summary: Video encoding completed + description: This webhook triggers when a new video is uploaded into your account, + and all HLS and mp4 quality versions are encoded. + operationId: POST-webhooks + parameters: + - in: header + name: X-Api-Video-WebhookID + schema: + type: string + description: The unique ID of your webhook. + required: true + - in: header + name: X-Api-Video-Signature + schema: + type: string + description: The webhook's body encrypted using the webhook's signature secret, + in HMAC SHA256. Use this hash to verify that api.video is the origin of + this webhook notification. + required: true + requestBody: + content: + application/json: + schema: + type: object + properties: + type: + type: string + description: The name of the webhook event that occured. + example: video.encoding.quality.completed + emittedAt: + description: Returns the date-time when the webhook event occurred. + type: string + format: date-time + example: 2024-08-151T10:18:47+00:00 + videoId: + description: The ID of the video where a certain quality version's + encoding is finished. + type: string + example: vi4blUQJFrYWbaG44NChkH11 + encoding: + description: The type of encoding that is finished. + type: string + enum: + - hls + - mp4 + example: hls + quality: + description: The quality version of encoding that is finished. + type: string + enum: + - 240p + - 360p + - 480p + - 720p + - 1080p + example: 1080p + responses: + "202": + summary: Accepted + description: Your webhook server may return this response to api.video to + signal that the webhook is accepted. diff --git a/api_tags.go b/api_tags.go new file mode 100644 index 0000000..12f0a84 --- /dev/null +++ b/api_tags.go @@ -0,0 +1,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 + +} diff --git a/client.go b/client.go index 7436733..707b21b 100644 --- a/client.go +++ b/client.go @@ -36,6 +36,7 @@ type Client struct { Chapters ChaptersServiceI LiveStreams LiveStreamsServiceI PlayerThemes PlayerThemesServiceI + Tags TagsServiceI UploadTokens UploadTokensServiceI Videos VideosServiceI Watermarks WatermarksServiceI @@ -183,6 +184,7 @@ func (cb *Builder) Build() *Client { c.Chapters = &ChaptersService{client: c} c.LiveStreams = &LiveStreamsService{client: c} c.PlayerThemes = &PlayerThemesService{client: c} + c.Tags = &TagsService{client: c} c.UploadTokens = &UploadTokensService{client: c} c.Videos = &VideosService{client: c} c.Watermarks = &WatermarksService{client: c} @@ -255,7 +257,7 @@ func (c *Client) prepareRequest( req.Header.Set("AV-Origin-Sdk", originSdkHeaderValue) } - req.Header.Set("AV-Origin-Client", "go:1.4.2") + req.Header.Set("AV-Origin-Client", "go:1.4.3") for headerName := range headerParams { req.Header.Set(headerName, headerParams[headerName]) @@ -530,7 +532,7 @@ func (c *Client) auth(req *http.Request) (*http.Request, error) { req.Header.Set("AV-Origin-Sdk", originSdkHeaderValue) } - req.Header.Set("AV-Origin-Client", "go:1.4.2") + req.Header.Set("AV-Origin-Client", "go:1.4.3") resp, err := c.httpClient.Do(req) diff --git a/docs/ListTagsResponse.md b/docs/ListTagsResponse.md new file mode 100644 index 0000000..fa82046 --- /dev/null +++ b/docs/ListTagsResponse.md @@ -0,0 +1,82 @@ +# ListTagsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | Pointer to [**[]ListTagsResponseData**](ListTagsResponseData.md) | | [optional] +**Pagination** | Pointer to [**Pagination**](Pagination.md) | | [optional] + +## Methods + +### NewListTagsResponse + +`func NewListTagsResponse() *ListTagsResponse` + +NewListTagsResponse instantiates a new ListTagsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListTagsResponseWithDefaults + +`func NewListTagsResponseWithDefaults() *ListTagsResponse` + +NewListTagsResponseWithDefaults instantiates a new ListTagsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListTagsResponse) GetData() []ListTagsResponseData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListTagsResponse) GetDataOk() (*[]ListTagsResponseData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListTagsResponse) SetData(v []ListTagsResponseData)` + +SetData sets Data field to given value. + +### HasData + +`func (o *ListTagsResponse) HasData() bool` + +HasData returns a boolean if a field has been set. + +### GetPagination + +`func (o *ListTagsResponse) GetPagination() Pagination` + +GetPagination returns the Pagination field if non-nil, zero value otherwise. + +### GetPaginationOk + +`func (o *ListTagsResponse) GetPaginationOk() (*Pagination, bool)` + +GetPaginationOk returns a tuple with the Pagination field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPagination + +`func (o *ListTagsResponse) SetPagination(v Pagination)` + +SetPagination sets Pagination field to given value. + +### HasPagination + +`func (o *ListTagsResponse) HasPagination() bool` + +HasPagination returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListTagsResponseData.md b/docs/ListTagsResponseData.md new file mode 100644 index 0000000..dbbaa30 --- /dev/null +++ b/docs/ListTagsResponseData.md @@ -0,0 +1,82 @@ +# ListTagsResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | Pointer to **string** | Returns the value of a video tag used in your project. | [optional] +**VideoCount** | Pointer to **int32** | Returns the number of times a video tag is used. | [optional] + +## Methods + +### NewListTagsResponseData + +`func NewListTagsResponseData() *ListTagsResponseData` + +NewListTagsResponseData instantiates a new ListTagsResponseData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListTagsResponseDataWithDefaults + +`func NewListTagsResponseDataWithDefaults() *ListTagsResponseData` + +NewListTagsResponseDataWithDefaults instantiates a new ListTagsResponseData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetValue + +`func (o *ListTagsResponseData) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *ListTagsResponseData) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *ListTagsResponseData) SetValue(v string)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *ListTagsResponseData) HasValue() bool` + +HasValue returns a boolean if a field has been set. + +### GetVideoCount + +`func (o *ListTagsResponseData) GetVideoCount() int32` + +GetVideoCount returns the VideoCount field if non-nil, zero value otherwise. + +### GetVideoCountOk + +`func (o *ListTagsResponseData) GetVideoCountOk() (*int32, bool)` + +GetVideoCountOk returns a tuple with the VideoCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVideoCount + +`func (o *ListTagsResponseData) SetVideoCount(v int32)` + +SetVideoCount sets VideoCount field to given value. + +### HasVideoCount + +`func (o *ListTagsResponseData) HasVideoCount() bool` + +HasVideoCount returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Tags.md b/docs/Tags.md new file mode 100644 index 0000000..23cf4e7 --- /dev/null +++ b/docs/Tags.md @@ -0,0 +1,81 @@ +# \Tags + +All URIs are relative to *https://ws.api.video* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**List**](Tags.md#List) | **Get** /tags | List all video tags + + + +## List + +> List(r TagsApiListRequest) (*ListTagsResponse, error) + + +> ListWithContext(ctx context.Context, r TagsApiListRequest) (*ListTagsResponse, error) + + + +List all video tags + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + apivideosdk "github.com/apivideo/api.video-go-client" +) + +func main() { + client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build() + // if you rather like to use the sandbox environment: + // client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_KEY").Build() + req := apivideosdk.TagsApiListRequest{} + + req.Value("value_example") // string | Use this parameter to search for specific video tags. The API filters results even on partial values, and ignores accents, uppercase, and lowercase. + req.SortBy("value") // string | Use this parameter to choose which field the API will use to sort the response data. The default is `value`. These are the available fields to sort by: - `value`: Sorts the results based on tag values in alphabetic order. - `videoCount`: Sorts the results based on the number of times a video tag is used. + req.SortOrder("asc") // string | Use this parameter to sort results. `asc` is ascending and sorts from A to Z. `desc` is descending and sorts from Z to A. + req.CurrentPage(int32(2)) // int32 | Choose the number of search results to return per page. Minimum value: 1 (default to 1) + req.PageSize(int32(30)) // int32 | Results per page. Allowed values 1-100, default is 25. (default to 25) + + res, err := client.Tags.List(req) + + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `Tags.List``: %v\n", err) + } + // response from `List`: ListTagsResponse + fmt.Fprintf(os.Stdout, "Response from `Tags.List`: %v\n", res) +} +``` +### Path Parameters + + + +### Other Parameters + + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**value** | **string** | Use this parameter to search for specific video tags. The API filters results even on partial values, and ignores accents, uppercase, and lowercase. | +**sortBy** | **string** | Use this parameter to choose which field the API will use to sort the response data. The default is `value`. These are the available fields to sort by: - `value`: Sorts the results based on tag values in alphabetic order. - `videoCount`: Sorts the results based on the number of times a video tag is used. | +**sortOrder** | **string** | Use this parameter to sort results. `asc` is ascending and sorts from A to Z. `desc` is descending and sorts from Z to A. | +**currentPage** | **int32** | Choose the number of search results to return per page. Minimum value: 1 | [default to 1] +**pageSize** | **int32** | Results per page. Allowed values 1-100, default is 25. | [default to 25] + +### Return type + +[**ListTagsResponse**](ListTagsResponse.md) + +[[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) + diff --git a/docs/Webhook.md b/docs/Webhook.md index 474a627..3115beb 100644 --- a/docs/Webhook.md +++ b/docs/Webhook.md @@ -4,10 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**WebhookId** | Pointer to **string** | Unique identifier of the webhook | [optional] -**CreatedAt** | Pointer to **string** | When an webhook was created, presented in ATOM UTC format. | [optional] -**Events** | Pointer to **[]string** | A list of events that will trigger the webhook. | [optional] -**Url** | Pointer to **string** | URL of the webhook | [optional] +**WebhookId** | Pointer to **string** | A unique identifier of the webhook you subscribed to. | [optional] +**CreatedAt** | Pointer to **string** | The time and date when you created this webhook subscription, in ATOM UTC format. | [optional] +**Events** | Pointer to **[]string** | A list of events that you subscribed to. When these events occur, the API triggers a webhook call to the URL you provided. | [optional] +**Url** | Pointer to **string** | The URL where the API sends the webhook. | [optional] +**SignatureSecret** | Pointer to **string** | A secret key for the webhook you subscribed to. You can use it to verify the origin of the webhook call that you receive. | [optional] ## Methods @@ -128,6 +129,31 @@ SetUrl sets Url field to given value. HasUrl returns a boolean if a field has been set. +### GetSignatureSecret + +`func (o *Webhook) GetSignatureSecret() string` + +GetSignatureSecret returns the SignatureSecret field if non-nil, zero value otherwise. + +### GetSignatureSecretOk + +`func (o *Webhook) GetSignatureSecretOk() (*string, bool)` + +GetSignatureSecretOk returns a tuple with the SignatureSecret field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSignatureSecret + +`func (o *Webhook) SetSignatureSecret(v string)` + +SetSignatureSecret sets SignatureSecret field to given value. + +### HasSignatureSecret + +`func (o *Webhook) HasSignatureSecret() bool` + +HasSignatureSecret returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/model_list_tags_response.go b/model_list_tags_response.go new file mode 100644 index 0000000..e3f455d --- /dev/null +++ b/model_list_tags_response.go @@ -0,0 +1,129 @@ +/* + * 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 ( +//"encoding/json" +) + +// ListTagsResponse struct for ListTagsResponse +type ListTagsResponse struct { + Data *[]ListTagsResponseData `json:"data,omitempty"` + Pagination *Pagination `json:"pagination,omitempty"` +} + +// NewListTagsResponse instantiates a new ListTagsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListTagsResponse() *ListTagsResponse { + this := ListTagsResponse{} + return &this +} + +// NewListTagsResponseWithDefaults instantiates a new ListTagsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListTagsResponseWithDefaults() *ListTagsResponse { + this := ListTagsResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *ListTagsResponse) GetData() []ListTagsResponseData { + if o == nil || o.Data == nil { + var ret []ListTagsResponseData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListTagsResponse) GetDataOk() (*[]ListTagsResponseData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *ListTagsResponse) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given []ListTagsResponseData and assigns it to the Data field. +func (o *ListTagsResponse) SetData(v []ListTagsResponseData) { + o.Data = &v +} + +// GetPagination returns the Pagination field value if set, zero value otherwise. +func (o *ListTagsResponse) GetPagination() Pagination { + if o == nil || o.Pagination == nil { + var ret Pagination + return ret + } + return *o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListTagsResponse) GetPaginationOk() (*Pagination, bool) { + if o == nil || o.Pagination == nil { + return nil, false + } + return o.Pagination, true +} + +// HasPagination returns a boolean if a field has been set. +func (o *ListTagsResponse) HasPagination() bool { + if o != nil && o.Pagination != nil { + return true + } + + return false +} + +// SetPagination gets a reference to the given Pagination and assigns it to the Pagination field. +func (o *ListTagsResponse) SetPagination(v Pagination) { + o.Pagination = &v +} + +type NullableListTagsResponse struct { + value *ListTagsResponse + isSet bool +} + +func (v NullableListTagsResponse) Get() *ListTagsResponse { + return v.value +} + +func (v *NullableListTagsResponse) Set(val *ListTagsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListTagsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListTagsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListTagsResponse(val *ListTagsResponse) *NullableListTagsResponse { + return &NullableListTagsResponse{value: val, isSet: true} +} diff --git a/model_list_tags_response_data.go b/model_list_tags_response_data.go new file mode 100644 index 0000000..0f36ffb --- /dev/null +++ b/model_list_tags_response_data.go @@ -0,0 +1,131 @@ +/* + * 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 ( +//"encoding/json" +) + +// ListTagsResponseData struct for ListTagsResponseData +type ListTagsResponseData struct { + // Returns the value of a video tag used in your project. + Value *string `json:"value,omitempty"` + // Returns the number of times a video tag is used. + VideoCount *int32 `json:"videoCount,omitempty"` +} + +// NewListTagsResponseData instantiates a new ListTagsResponseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListTagsResponseData() *ListTagsResponseData { + this := ListTagsResponseData{} + return &this +} + +// NewListTagsResponseDataWithDefaults instantiates a new ListTagsResponseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListTagsResponseDataWithDefaults() *ListTagsResponseData { + this := ListTagsResponseData{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *ListTagsResponseData) GetValue() string { + if o == nil || o.Value == nil { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListTagsResponseData) GetValueOk() (*string, bool) { + if o == nil || o.Value == nil { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *ListTagsResponseData) HasValue() bool { + if o != nil && o.Value != nil { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *ListTagsResponseData) SetValue(v string) { + o.Value = &v +} + +// GetVideoCount returns the VideoCount field value if set, zero value otherwise. +func (o *ListTagsResponseData) GetVideoCount() int32 { + if o == nil || o.VideoCount == nil { + var ret int32 + return ret + } + return *o.VideoCount +} + +// GetVideoCountOk returns a tuple with the VideoCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListTagsResponseData) GetVideoCountOk() (*int32, bool) { + if o == nil || o.VideoCount == nil { + return nil, false + } + return o.VideoCount, true +} + +// HasVideoCount returns a boolean if a field has been set. +func (o *ListTagsResponseData) HasVideoCount() bool { + if o != nil && o.VideoCount != nil { + return true + } + + return false +} + +// SetVideoCount gets a reference to the given int32 and assigns it to the VideoCount field. +func (o *ListTagsResponseData) SetVideoCount(v int32) { + o.VideoCount = &v +} + +type NullableListTagsResponseData struct { + value *ListTagsResponseData + isSet bool +} + +func (v NullableListTagsResponseData) Get() *ListTagsResponseData { + return v.value +} + +func (v *NullableListTagsResponseData) Set(val *ListTagsResponseData) { + v.value = val + v.isSet = true +} + +func (v NullableListTagsResponseData) IsSet() bool { + return v.isSet +} + +func (v *NullableListTagsResponseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListTagsResponseData(val *ListTagsResponseData) *NullableListTagsResponseData { + return &NullableListTagsResponseData{value: val, isSet: true} +} diff --git a/model_webhook.go b/model_webhook.go index c512b6a..284996f 100644 --- a/model_webhook.go +++ b/model_webhook.go @@ -16,14 +16,16 @@ import ( // Webhook struct for Webhook type Webhook struct { - // Unique identifier of the webhook + // A unique identifier of the webhook you subscribed to. WebhookId *string `json:"webhookId,omitempty"` - // When an webhook was created, presented in ATOM UTC format. + // The time and date when you created this webhook subscription, in ATOM UTC format. CreatedAt *string `json:"createdAt,omitempty"` - // A list of events that will trigger the webhook. + // A list of events that you subscribed to. When these events occur, the API triggers a webhook call to the URL you provided. Events *[]string `json:"events,omitempty"` - // URL of the webhook + // The URL where the API sends the webhook. Url *string `json:"url,omitempty"` + // A secret key for the webhook you subscribed to. You can use it to verify the origin of the webhook call that you receive. + SignatureSecret *string `json:"signatureSecret,omitempty"` } // NewWebhook instantiates a new Webhook object @@ -171,6 +173,38 @@ func (o *Webhook) SetUrl(v string) { o.Url = &v } +// GetSignatureSecret returns the SignatureSecret field value if set, zero value otherwise. +func (o *Webhook) GetSignatureSecret() string { + if o == nil || o.SignatureSecret == nil { + var ret string + return ret + } + return *o.SignatureSecret +} + +// GetSignatureSecretOk returns a tuple with the SignatureSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Webhook) GetSignatureSecretOk() (*string, bool) { + if o == nil || o.SignatureSecret == nil { + return nil, false + } + return o.SignatureSecret, true +} + +// HasSignatureSecret returns a boolean if a field has been set. +func (o *Webhook) HasSignatureSecret() bool { + if o != nil && o.SignatureSecret != nil { + return true + } + + return false +} + +// SetSignatureSecret gets a reference to the given string and assigns it to the SignatureSecret field. +func (o *Webhook) SetSignatureSecret(v string) { + o.SignatureSecret = &v +} + type NullableWebhook struct { value *Webhook isSet bool