|
16 | 16 | (function(root, factory) { |
17 | 17 | if (typeof define === 'function' && define.amd) { |
18 | 18 | // AMD. Register as an anonymous module. |
19 | | - define(['ApiClient', 'model/Edit', 'model/QueuedResponse', 'model/RenderResponse'], factory); |
| 19 | + define(['ApiClient', 'model/Edit', 'model/ProbeResponse', 'model/QueuedResponse', 'model/RenderResponse'], factory); |
20 | 20 | } else if (typeof module === 'object' && module.exports) { |
21 | 21 | // CommonJS-like environments that support module.exports, like Node. |
22 | | - module.exports = factory(require('../ApiClient'), require('../model/Edit'), require('../model/QueuedResponse'), require('../model/RenderResponse')); |
| 22 | + module.exports = factory(require('../ApiClient'), require('../model/Edit'), require('../model/ProbeResponse'), require('../model/QueuedResponse'), require('../model/RenderResponse')); |
23 | 23 | } else { |
24 | 24 | // Browser globals (root is window) |
25 | 25 | if (!root.ShotstackSdk) { |
26 | 26 | root.ShotstackSdk = {}; |
27 | 27 | } |
28 | | - root.ShotstackSdk.EditApi = factory(root.ShotstackSdk.ApiClient, root.ShotstackSdk.Edit, root.ShotstackSdk.QueuedResponse, root.ShotstackSdk.RenderResponse); |
| 28 | + root.ShotstackSdk.EditApi = factory(root.ShotstackSdk.ApiClient, root.ShotstackSdk.Edit, root.ShotstackSdk.ProbeResponse, root.ShotstackSdk.QueuedResponse, root.ShotstackSdk.RenderResponse); |
29 | 29 | } |
30 | | -}(this, function(ApiClient, Edit, QueuedResponse, RenderResponse) { |
| 30 | +}(this, function(ApiClient, Edit, ProbeResponse, QueuedResponse, RenderResponse) { |
31 | 31 | 'use strict'; |
32 | 32 |
|
33 | 33 | /** |
|
50 | 50 |
|
51 | 51 | /** |
52 | 52 | * Get Render Status |
53 | | - * Get the rendering status, temporary asset url and details of a render by ID. **base URL:** https://api.shotstack.io/{version} |
| 53 | + * Get the rendering status, temporary asset url and details of a render by ID. **Base URL:** https://api.shotstack.io/{version} |
54 | 54 | * @param {String} id The id of the timeline render task in UUID format |
| 55 | + * @param {Object} opts Optional parameters |
| 56 | + * @param {Boolean} opts.data Include the data parameter in the response. The data parameter includes the original timeline, output and other settings sent to the API.<br><br><b>Note:</b> the default is currently `true`, this is deprecated and the default will soon be `false`. If you rely on the data being returned in the response you should explicitly set the parameter to `true`. |
| 57 | + * @param {Boolean} opts.merged Used when data is set to true, it will show the [merge fields](#tocs_mergefield) merged in to the data response. |
55 | 58 | * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/RenderResponse} and HTTP response |
56 | 59 | */ |
57 | | - this.getRenderWithHttpInfo = function(id) { |
| 60 | + this.getRenderWithHttpInfo = function(id, opts) { |
| 61 | + opts = opts || {}; |
58 | 62 | var postBody = null; |
59 | 63 | // verify the required parameter 'id' is set |
60 | 64 | if (id === undefined || id === null) { |
|
65 | 69 | 'id': id |
66 | 70 | }; |
67 | 71 | var queryParams = { |
| 72 | + 'data': opts['data'], |
| 73 | + 'merged': opts['merged'], |
68 | 74 | }; |
69 | 75 | var collectionQueryParams = { |
70 | 76 | }; |
|
86 | 92 |
|
87 | 93 | /** |
88 | 94 | * Get Render Status |
89 | | - * Get the rendering status, temporary asset url and details of a render by ID. **base URL:** https://api.shotstack.io/{version} |
| 95 | + * Get the rendering status, temporary asset url and details of a render by ID. **Base URL:** https://api.shotstack.io/{version} |
90 | 96 | * @param {String} id The id of the timeline render task in UUID format |
| 97 | + * @param {Object} opts Optional parameters |
| 98 | + * @param {Boolean} opts.data Include the data parameter in the response. The data parameter includes the original timeline, output and other settings sent to the API.<br><br><b>Note:</b> the default is currently `true`, this is deprecated and the default will soon be `false`. If you rely on the data being returned in the response you should explicitly set the parameter to `true`. |
| 99 | + * @param {Boolean} opts.merged Used when data is set to true, it will show the [merge fields](#tocs_mergefield) merged in to the data response. |
91 | 100 | * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/RenderResponse} |
92 | 101 | */ |
93 | | - this.getRender = function(id) { |
94 | | - return this.getRenderWithHttpInfo(id) |
| 102 | + this.getRender = function(id, opts) { |
| 103 | + return this.getRenderWithHttpInfo(id, opts) |
95 | 104 | .then(function(response_and_data) { |
96 | 105 | return response_and_data.data; |
97 | 106 | }); |
|
100 | 109 |
|
101 | 110 | /** |
102 | 111 | * Render Asset |
103 | | - * Queue and render the contents of a timeline as a video, image or audio file. |
104 | | - * @param {module:model/Edit} edit The video, image or audio edit specified using JSON. **base URL:** https://api.shotstack.io/{version} |
| 112 | + * Queue and render the contents of a timeline as a video, image or audio file. **Base URL:** https://api.shotstack.io/{version} |
| 113 | + * @param {module:model/Edit} edit The video, image or audio edit specified using JSON. |
105 | 114 | * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/QueuedResponse} and HTTP response |
106 | 115 | */ |
107 | 116 | this.postRenderWithHttpInfo = function(edit) { |
|
135 | 144 |
|
136 | 145 | /** |
137 | 146 | * Render Asset |
138 | | - * Queue and render the contents of a timeline as a video, image or audio file. |
139 | | - * @param {module:model/Edit} edit The video, image or audio edit specified using JSON. **base URL:** https://api.shotstack.io/{version} |
| 147 | + * Queue and render the contents of a timeline as a video, image or audio file. **Base URL:** https://api.shotstack.io/{version} |
| 148 | + * @param {module:model/Edit} edit The video, image or audio edit specified using JSON. |
140 | 149 | * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/QueuedResponse} |
141 | 150 | */ |
142 | 151 | this.postRender = function(edit) { |
|
145 | 154 | return response_and_data.data; |
146 | 155 | }); |
147 | 156 | } |
| 157 | + |
| 158 | + |
| 159 | + /** |
| 160 | + * Inspect Media |
| 161 | + * Inspects any media asset (image, video, audio) on the internet using a hosted version of [FFprobe](https://ffmpeg.org/ffprobe.html). The probe endpoint returns useful information about an asset such as width, height, duration, rotation, framerate, etc... **Base URL:** https://api.shotstack.io/{version} |
| 162 | + * @param {String} url The URL of the media to inspect, must be **URL encoded**. |
| 163 | + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ProbeResponse} and HTTP response |
| 164 | + */ |
| 165 | + this.probeWithHttpInfo = function(url) { |
| 166 | + var postBody = null; |
| 167 | + // verify the required parameter 'url' is set |
| 168 | + if (url === undefined || url === null) { |
| 169 | + throw new Error("Missing the required parameter 'url' when calling probe"); |
| 170 | + } |
| 171 | + |
| 172 | + var pathParams = { |
| 173 | + 'url': url |
| 174 | + }; |
| 175 | + var queryParams = { |
| 176 | + }; |
| 177 | + var collectionQueryParams = { |
| 178 | + }; |
| 179 | + var headerParams = { |
| 180 | + }; |
| 181 | + var formParams = { |
| 182 | + }; |
| 183 | + |
| 184 | + var authNames = ['DeveloperKey']; |
| 185 | + var contentTypes = []; |
| 186 | + var accepts = ['application/json']; |
| 187 | + var returnType = ProbeResponse; |
| 188 | + return this.apiClient.callApi( |
| 189 | + '/probe/{url}', 'GET', |
| 190 | + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, |
| 191 | + authNames, contentTypes, accepts, returnType, null |
| 192 | + ); |
| 193 | + } |
| 194 | + |
| 195 | + /** |
| 196 | + * Inspect Media |
| 197 | + * Inspects any media asset (image, video, audio) on the internet using a hosted version of [FFprobe](https://ffmpeg.org/ffprobe.html). The probe endpoint returns useful information about an asset such as width, height, duration, rotation, framerate, etc... **Base URL:** https://api.shotstack.io/{version} |
| 198 | + * @param {String} url The URL of the media to inspect, must be **URL encoded**. |
| 199 | + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ProbeResponse} |
| 200 | + */ |
| 201 | + this.probe = function(url) { |
| 202 | + return this.probeWithHttpInfo(url) |
| 203 | + .then(function(response_and_data) { |
| 204 | + return response_and_data.data; |
| 205 | + }); |
| 206 | + } |
148 | 207 | }; |
149 | 208 |
|
150 | 209 | return exports; |
|
0 commit comments