Skip to content

Commit 9c9a355

Browse files
committed
Added render get method and small refactor
1 parent 4ef8445 commit 9c9a355

File tree

10 files changed

+867
-40
lines changed

10 files changed

+867
-40
lines changed

src/Api/RenderApi.php

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,106 @@ public function postRenderWithHttpInfo($edit)
189189
}
190190
}
191191

192+
/**
193+
* getRender
194+
*
195+
*
196+
*
197+
* @param string $id The id of the timeline render task in UUID format (required)
198+
* @return \Shotstack\Model\RenderResponse
199+
* @throws \Shotstack\ApiException on non-2xx response
200+
*/
201+
public function getRender($id)
202+
{
203+
list($response, $statusCode, $httpHeader) = $this->getRenderWithHttpInfo ($id);
204+
return $response;
205+
}
206+
207+
208+
/**
209+
* getRenderWithHttpInfo
210+
*
211+
*
212+
*
213+
* @param string $id The id of the timeline render task in UUID format (required)
214+
* @return Array of \Shotstack\Model\RenderResponse, HTTP status code, HTTP response headers (array of strings)
215+
* @throws \Shotstack\ApiException on non-2xx response
216+
*/
217+
public function getRenderWithHttpInfo($id)
218+
{
219+
220+
// verify the required parameter 'id' is set
221+
if ($id === null) {
222+
throw new \InvalidArgumentException('Missing the required parameter $id when calling getRender');
223+
}
224+
225+
// parse inputs
226+
$resourcePath = "/render/{id}";
227+
$httpBody = '';
228+
$queryParams = array();
229+
$headerParams = array();
230+
$formParams = array();
231+
$_header_accept = ApiClient::selectHeaderAccept(array('application/json'));
232+
if (!is_null($_header_accept)) {
233+
$headerParams['Accept'] = $_header_accept;
234+
}
235+
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
236+
237+
238+
239+
// path params
240+
241+
if ($id !== null) {
242+
$resourcePath = str_replace(
243+
"{" . "id" . "}",
244+
$this->apiClient->getSerializer()->toPathValue($id),
245+
$resourcePath
246+
);
247+
}
248+
// default format to json
249+
$resourcePath = str_replace("{format}", "json", $resourcePath);
250+
251+
252+
253+
254+
// for model (json/xml)
255+
if (isset($_tempBody)) {
256+
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
257+
} elseif (count($formParams) > 0) {
258+
$httpBody = $formParams; // for HTTP post (form)
259+
}
260+
261+
// this endpoint requires API key authentication
262+
$apiKey = $this->apiClient->getApiKeyWithPrefix('x-api-key');
263+
if (strlen($apiKey) !== 0) {
264+
$headerParams['x-api-key'] = $apiKey;
265+
}
266+
267+
268+
// make the API Call
269+
try {
270+
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
271+
$resourcePath, 'GET',
272+
$queryParams, $httpBody,
273+
$headerParams, '\Shotstack\Model\RenderResponse'
274+
);
275+
276+
if (!$response) {
277+
return array(null, $statusCode, $httpHeader);
278+
}
279+
280+
return array(\Shotstack\ObjectSerializer::deserialize($response, '\Shotstack\Model\RenderResponse', $httpHeader), $statusCode, $httpHeader);
281+
282+
} catch (ApiException $e) {
283+
switch ($e->getCode()) {
284+
case 200:
285+
$data = \Shotstack\ObjectSerializer::deserialize($e->getResponseBody(), '\Shotstack\Model\RenderResponse', $e->getResponseHeaders());
286+
$e->setResponseObject($data);
287+
break;
288+
}
289+
290+
throw $e;
291+
}
292+
}
293+
192294
}

src/Configuration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class Configuration
110110
*
111111
* @var string
112112
*/
113-
protected $userAgent = "PHP-Swagger/0.0.2";
113+
protected $userAgent = "PHP-Swagger/0.0.3";
114114

115115
/**
116116
* Debug switch (default set to false)
@@ -516,8 +516,8 @@ public static function toDebugReport()
516516
$report = "PHP SDK (Shotstack) Debug Report:\n";
517517
$report .= " OS: ".php_uname()."\n";
518518
$report .= " PHP Version: ".phpversion()."\n";
519-
$report .= " OpenAPI Spec Version: 0.0.2\n";
520-
$report .= " SDK Package Version: 0.0.2\n";
519+
$report .= " OpenAPI Spec Version: 0.0.3\n";
520+
$report .= " SDK Package Version: 0.0.3\n";
521521
$report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath()."\n";
522522

523523
return $report;

src/Model/QueuedResponse.php

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ class QueuedResponse implements ArrayAccess
5151
* @var string[]
5252
*/
5353
static $swaggerTypes = array(
54-
'data' => '\Shotstack\Model\Queued',
5554
'message' => 'string',
55+
'response' => '\Shotstack\Model\QueuedResponseData',
5656
'success' => 'bool'
5757
);
5858

@@ -61,8 +61,8 @@ class QueuedResponse implements ArrayAccess
6161
* @var string[]
6262
*/
6363
static $attributeMap = array(
64-
'data' => 'data',
6564
'message' => 'message',
65+
'response' => 'response',
6666
'success' => 'success'
6767
);
6868

@@ -71,8 +71,8 @@ class QueuedResponse implements ArrayAccess
7171
* @var string[]
7272
*/
7373
static $setters = array(
74-
'data' => 'setData',
7574
'message' => 'setMessage',
75+
'response' => 'setResponse',
7676
'success' => 'setSuccess'
7777
);
7878

@@ -81,24 +81,24 @@ class QueuedResponse implements ArrayAccess
8181
* @var string[]
8282
*/
8383
static $getters = array(
84-
'data' => 'getData',
8584
'message' => 'getMessage',
85+
'response' => 'getResponse',
8686
'success' => 'getSuccess'
8787
);
8888

8989

90-
/**
91-
* $data
92-
* @var \Shotstack\Model\Queued
93-
*/
94-
protected $data;
95-
9690
/**
9791
* $message
9892
* @var string
9993
*/
10094
protected $message;
10195

96+
/**
97+
* $response
98+
* @var \Shotstack\Model\QueuedResponseData
99+
*/
100+
protected $response;
101+
102102
/**
103103
* $success
104104
* @var bool
@@ -113,51 +113,51 @@ class QueuedResponse implements ArrayAccess
113113
public function __construct(array $data = null)
114114
{
115115
if ($data != null) {
116-
$this->data = $data["data"];
117116
$this->message = $data["message"];
117+
$this->response = $data["response"];
118118
$this->success = $data["success"];
119119
}
120120
}
121121

122122
/**
123-
* Gets data
124-
* @return \Shotstack\Model\Queued
123+
* Gets message
124+
* @return string
125125
*/
126-
public function getData()
126+
public function getMessage()
127127
{
128-
return $this->data;
128+
return $this->message;
129129
}
130130

131131
/**
132-
* Sets data
133-
* @param \Shotstack\Model\Queued $data
132+
* Sets message
133+
* @param string $message
134134
* @return $this
135135
*/
136-
public function setData($data)
136+
public function setMessage($message)
137137
{
138138

139-
$this->data = $data;
139+
$this->message = $message;
140140
return $this;
141141
}
142142

143143
/**
144-
* Gets message
145-
* @return string
144+
* Gets response
145+
* @return \Shotstack\Model\QueuedResponseData
146146
*/
147-
public function getMessage()
147+
public function getResponse()
148148
{
149-
return $this->message;
149+
return $this->response;
150150
}
151151

152152
/**
153-
* Sets message
154-
* @param string $message
153+
* Sets response
154+
* @param \Shotstack\Model\QueuedResponseData $response
155155
* @return $this
156156
*/
157-
public function setMessage($message)
157+
public function setResponse($response)
158158
{
159159

160-
$this->message = $message;
160+
$this->response = $response;
161161
return $this;
162162
}
163163

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Queued
3+
* QueuedResponseData
44
*
55
* PHP version 5
66
*
@@ -35,16 +35,16 @@
3535

3636
use \ArrayAccess;
3737
/**
38-
* Queued Class Doc Comment
38+
* QueuedResponseData Class Doc Comment
3939
*
4040
* @category Class
41-
* @description Model for Queued
41+
* @description Model for QueuedResponseData
4242
* @package Shotstack
4343
* @author http://github.com/swagger-api/swagger-codegen
4444
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
4545
* @link https://github.com/swagger-api/swagger-codegen
4646
*/
47-
class Queued implements ArrayAccess
47+
class QueuedResponseData implements ArrayAccess
4848
{
4949
/**
5050
* Array of property to type mappings. Used for (de)serialization

0 commit comments

Comments
 (0)