Skip to content

Commit e01ecae

Browse files
committed
Add support for uploadFile, uploadKey updates
1 parent 8637f1d commit e01ecae

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

wscli-php-sdk/src/WsCli.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,18 @@ private function handleFiles($api, $cmd)
379379
);
380380
$this->log->debug(print_r($resp, true));
381381
return $resp;
382+
case "uploadFile":
383+
$error = $this->checkArgs(['apikey', 'idtoken', 'bank', 'filetype', 'filecontents', 'signatures']);
384+
if ($error) {
385+
return $error;
386+
}
387+
$resp = $this->${"api"}->${"cmd"}(
388+
$this->opts['idtoken'],
389+
$this->getBodyParams(),
390+
$this->opts['bank']
391+
);
392+
$this->log->debug(print_r($resp, true));
393+
return $resp;
382394
case "downloadFiles":
383395
$this->opts['<cmd>'] = "listFiles";
384396
$this->opts['<api>'] = "files";
@@ -497,7 +509,7 @@ private function handlePgp($api, $cmd)
497509
$this->log->debug(print_r($resp, true));
498510
return $resp;
499511
case "uploadKey":
500-
$error = $this->checkArgs(['apikey', 'idtoken', 'pgpkeycontents']);
512+
$error = $this->checkArgs(['apikey', 'idtoken', 'pgpkeycontents', 'pgpkeypurpose']);
501513
if ($error) {
502514
return $error;
503515
}
@@ -709,6 +721,10 @@ private function getBodyParams()
709721
'endDate' => array_key_exists('enddate', $this->opts) ? $this->opts['enddate'] : '',
710722
'PgpKey' => array_key_exists('pgpkeycontents', $this->opts) ? $this->opts['pgpkeycontents'] : '',
711723
'PgpKeyId' => array_key_exists('pgpkeyid', $this->opts) ? $this->opts['pgpkeyid'] : '',
724+
'PgpKeyPurpose' => array_key_exists('pgpkeypurpose', $this->opts) ? $this->opts['pgpkeypurpose'] : '',
725+
'FileContents' => array_key_exists('filecontents', $this->opts) ? $this->opts['filecontents'] : '',
726+
'Signatures' => array_key_exists('signatures', $this->opts) ? $this->opts['signatures'] : '',
727+
'FileType' => array_key_exists('filetype', $this->opts) ? $this->opts['filetype'] : ''
712728
];
713729
if (array_key_exists('session', $this->opts) && $this->opts['session']) {
714730
$bodyParams['Session'] = $this->opts['session'];

0 commit comments

Comments
 (0)