Skip to content

Commit

Permalink
GC-1583: updated sdk (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthpant92 authored Oct 13, 2023
1 parent 72baa82 commit 8780ae7
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 1,365 deletions.
24 changes: 11 additions & 13 deletions lib/Api/BuckslipsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,17 @@ public function createWithHttpInfo($buckslip_editable, $front = null)
$options = $this->createHttpClientOption();
$requestError = null;
try {
if(file != null) {
$response = $this->client->request(
'POST',
$request->getUri()->__toString(),
[
'multipart' => [[
'name' => 'file',
'contents' => Utils::tryFopen($file, 'r')
]],
'auth' => $options['auth']
]
);
}
$response = $this->client->request(
'POST',
$request->getUri()->__toString(),
[
'multipart' => [[
'name' => 'file',
'contents' => Utils::tryFopen($file, 'r')
]],
'auth' => $options['auth']
]
);
} catch (RequestException $e) {
$errorBody = json_decode($e->getResponse()->getBody()->getContents())->error;
$requestError = new LobError();
Expand Down
27 changes: 11 additions & 16 deletions lib/Api/LettersApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,22 +340,17 @@ public function createWithHttpInfo($letter_editable, $idempotency_key = null, $f
$options = $this->createHttpClientOption();
$requestError = null;
try {
if($file != null) {
$response = $this->client->request(
'POST',
$request->getUri()->__toString(),
[
'multipart' => [[
'name' => 'file',
'contents' => Utils::tryFopen($file, 'r')
]],
'auth' => $options['auth']
]
);
}
else {
$response = $this->client->send($request, $options);
}
$response = $this->client->request(
'POST',
$request->getUri()->__toString(),
[
'multipart' => [[
'name' => 'file',
'contents' => Utils::tryFopen($file, 'r')
]],
'auth' => $options['auth']
]
);
} catch (RequestException $e) {
$errorBody = json_decode($e->getResponse()->getBody()->getContents())->error;
$requestError = new LobError();
Expand Down
24 changes: 11 additions & 13 deletions lib/Api/UploadsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -955,19 +955,17 @@ public function upload_fileWithHttpInfo($upl_id, $file)
$options = $this->createHttpClientOption();
$requestError = null;
try {
if(file != null) {
$response = $this->client->request(
'POST',
$request->getUri()->__toString(),
[
'multipart' => [[
'name' => 'file',
'contents' => Utils::tryFopen($file, 'r')
]],
'auth' => $options['auth']
]
);
}
$response = $this->client->request(
'POST',
$request->getUri()->__toString(),
[
'multipart' => [[
'name' => 'file',
'contents' => Utils::tryFopen($file, 'r')
]],
'auth' => $options['auth']
]
);
} catch (RequestException $e) {
$errorBody = json_decode($e->getResponse()->getBody()->getContents())->error;
$requestError = new LobError();
Expand Down
Loading

0 comments on commit 8780ae7

Please sign in to comment.