-
Notifications
You must be signed in to change notification settings - Fork 135
Expand file tree
/
Copy pathCommentsApi.php
More file actions
235 lines (213 loc) · 7.2 KB
/
CommentsApi.php
File metadata and controls
235 lines (213 loc) · 7.2 KB
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<?php
/**
* CommentsApi
* PHP version 5
*
* @category Class
* @package DocuSign\eSign
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* DocuSign REST API
*
* The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
*
* OpenAPI spec version: v2
* Contact: devcenter@docusign.com
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace DocuSign\eSign\Api\CommentsApi;
class GetCommentsTranscriptOptions
{
/**
* $encoding
* @var string
*/
protected $encoding;
/**
* Gets encoding
* @return string
*/
public function getEncoding()
{
return $this->encoding;
}
/**
* Sets encoding
* @param string $encoding
* @return $this
*/
public function setEncoding($encoding)
{
$this->encoding = $encoding;
return $this;
}
}
namespace DocuSign\eSign\Api;
use \DocuSign\eSign\Client\ApiClient;
use \DocuSign\eSign\Client\ApiException;
use \DocuSign\eSign\Configuration;
use \DocuSign\eSign\ObjectSerializer;
/**
* CommentsApi Class Doc Comment
*
* @category Class
* @package DocuSign\eSign
* @author Swagger Codegen team
* @link https://github.com/swagger-api/swagger-codegen
*/
class CommentsApi
{
/**
* API Client
*
* @var \DocuSign\eSign\Client\ApiClient instance of the ApiClient
*/
protected $apiClient;
/**
* Constructor
*
* @param \DocuSign\eSign\Client\ApiClient|null $apiClient The api client to use
*/
public function __construct(?\DocuSign\eSign\Client\ApiClient $apiClient = null)
{
if ($apiClient === null) {
$apiClient = new ApiClient();
}
$this->apiClient = $apiClient;
}
/**
* Get API client
*
* @return \DocuSign\eSign\Client\ApiClient get the API client
*/
public function getApiClient()
{
return $this->apiClient;
}
/**
* Set the API client
*
* @param \DocuSign\eSign\Client\ApiClient $apiClient set the API client
*
* @return CommentsApi
*/
public function setApiClient(?\DocuSign\eSign\Client\ApiClient $apiClient)
{
$this->apiClient = $apiClient;
return $this;
}
/**
* Operation getCommentsTranscript
*
* Gets comment transcript for envelope and user
*
* @param string $account_id The external account number (int) or account ID Guid.
* @param string $envelope_id The envelopeId Guid of the envelope being accessed.
* @param $options Options for modifying the behavior of the function. (optional)
* @throws \DocuSign\eSign\Client\ApiException on non-2xx response
* @return \SplFileObject
*/
public function getCommentsTranscript($account_id, $envelope_id, ?CommentsApi\GetCommentsTranscriptOptions $options = null)
{
list($response) = $this->getCommentsTranscriptWithHttpInfo($account_id, $envelope_id, $options);
return $response;
}
/**
* Operation getCommentsTranscriptWithHttpInfo
*
* Gets comment transcript for envelope and user
*
* @param string $account_id The external account number (int) or account ID Guid.
* @param string $envelope_id The envelopeId Guid of the envelope being accessed.
* @param $options Options for modifying the behavior of the function. (optional)
* @throws \DocuSign\eSign\Client\ApiException on non-2xx response
* @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings)
*/
public function getCommentsTranscriptWithHttpInfo($account_id, $envelope_id, ?CommentsApi\GetCommentsTranscriptOptions $options = null)
{
// verify the required parameter 'account_id' is set
if ($account_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $account_id when calling getCommentsTranscript');
}
// verify the required parameter 'envelope_id' is set
if ($envelope_id === null) {
throw new \InvalidArgumentException('Missing the required parameter $envelope_id when calling getCommentsTranscript');
}
// parse inputs
$resourcePath = "/v2/accounts/{accountId}/envelopes/{envelopeId}/comments/transcript";
$httpBody = '';
$queryParams = [];
$headerParams = [];
$formParams = [];
$_header_accept = $this->apiClient->selectHeaderAccept(['application/pdf']);
if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept;
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]);
if ($options != null)
{
// query params
// query params
if ($options->getEncoding() !== null) {
$queryParams['encoding'] = $this->apiClient->getSerializer()->toQueryValue($options->getEncoding());
}
}
// path params
if ($account_id !== null) {
$resourcePath = str_replace(
"{" . "accountId" . "}",
$this->apiClient->getSerializer()->toPathValue($account_id),
$resourcePath
);
}
// path params
if ($envelope_id !== null) {
$resourcePath = str_replace(
"{" . "envelopeId" . "}",
$this->apiClient->getSerializer()->toPathValue($envelope_id),
$resourcePath
);
}
// default format to json
$resourcePath = str_replace("{format}", "json", $resourcePath);
// for model (json/xml)
if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
} elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form)
}
// make the API Call
try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath,
'GET',
$queryParams,
$httpBody,
$headerParams,
'\SplFileObject',
'/v2/accounts/{accountId}/envelopes/{envelopeId}/comments/transcript'
);
return [$this->apiClient->getSerializer()->deserialize($response, '\SplFileObject', $httpHeader), $statusCode, $httpHeader];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SplFileObject', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
case 400:
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\DocuSign\eSign\Model\ErrorDetails', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
}
throw $e;
}
}
}