Skip to content

Commit 59c45af

Browse files
committed
php library was updated
1 parent ad6bbf9 commit 59c45af

File tree

1 file changed

+66
-10
lines changed

1 file changed

+66
-10
lines changed

src/DatabunkerproApi.php

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,13 @@ public function addUserToGroup($mode, $identity, $groupname, $rolename = null, $
292292
} else {
293293
$data['groupname'] = $groupname;
294294
}
295-
296295
if ($rolename) {
297296
if (is_numeric($rolename) && intval($rolename) == $rolename) {
298297
$data['roleid'] = $rolename;
299298
} else {
300299
$data['rolename'] = $rolename;
301300
}
302301
}
303-
304302
return $this->makeRequest('GroupAddUser', 'POST', $data, $requestMetadata);
305303
}
306304

@@ -328,14 +326,6 @@ public function deleteToken($token, $requestMetadata = null) {
328326
return $this->makeRequest('TokenDelete', 'POST', ['token' => $token], $requestMetadata);
329327
}
330328

331-
public function listTokensBulk($tokens, $requestMetadata = null) {
332-
return $this->makeRequest('TokenListBulk', 'POST', ['tokens' => $tokens], $requestMetadata);
333-
}
334-
335-
public function deleteTokensBulk($tokens, $requestMetadata = null) {
336-
return $this->makeRequest('TokenDeleteBulk', 'POST', ['tokens' => $tokens], $requestMetadata);
337-
}
338-
339329
// Audit Management
340330
public function listUserAuditEvents($mode, $identity, $offset = 0, $limit = 10, $requestMetadata = null) {
341331
return $this->makeRequest('AuditListUserEvents', 'POST', ['mode' => $mode, 'identity' => $identity, 'offset' => $offset, 'limit' => $limit], $requestMetadata);
@@ -427,6 +417,28 @@ public function bulkListAuditEvents($unlockuuid, $offset = 0, $limit = 10, $requ
427417
return $this->makeRequest('BulkListAuditEvents', 'POST', ['unlockuuid' => $unlockuuid, 'offset' => $offset, 'limit' => $limit], $requestMetadata);
428418
}
429419

420+
/**
421+
* Lists multiple tokens in bulk
422+
* @param string $unlockuuid UUID for the bulk operation
423+
* @param array $tokens Array of tokens to list
424+
* @param array|null $requestMetadata Additional metadata to include with the request
425+
* @return array The list of tokens information
426+
*/
427+
public function bulkListTokens($unlockuuid, $tokens, $requestMetadata = null) {
428+
return $this->makeRequest('BulkListTokens', 'POST', ['unlockuuid' => $unlockuuid, 'tokens' => $tokens], $requestMetadata);
429+
}
430+
431+
/**
432+
* Deletes multiple tokens in bulk
433+
* @param string $unlockuuid UUID for the bulk operation
434+
* @param array $tokens Array of tokens to delete
435+
* @param array|null $requestMetadata Additional metadata to include with the request
436+
* @return array The result of the bulk deletion operation
437+
*/
438+
public function bulkDeleteTokens($unlockuuid, $tokens, $requestMetadata = null) {
439+
return $this->makeRequest('BulkDeleteTokens', 'POST', ['unlockuuid' => $unlockuuid, 'tokens' => $tokens], $requestMetadata);
440+
}
441+
430442
// System Configuration
431443
public function getUIConf() {
432444
return $this->makeRequest('TenantGetUIConf', 'POST');
@@ -534,4 +546,48 @@ public function getSystemMetrics($requestMetadata = null) {
534546
return [];
535547
}
536548
}
549+
550+
/**
551+
* Creates a shared record for a user
552+
* @param string $mode User identification mode (e.g., 'email', 'phone', 'token')
553+
* @param string $identity User's identifier corresponding to the mode
554+
* @param array $options Optional parameters for shared record creation
555+
* @param string|null $options['fields'] A string containing names of fields to share separated by commas
556+
* @param string|null $options['partner'] It is used as a reference to partner name. It is not enforced.
557+
* @param string|null $options['appname'] If defined, shows fields from the user app record instead user profile
558+
* @param string|null $options['finaltime'] Expiration time for the shared record
559+
* @param array|null $requestMetadata Additional metadata to include with the request
560+
* @return array The created shared record information
561+
*/
562+
public function createSharedRecord($mode, $identity, $options = [], $requestMetadata = null) {
563+
$data = [
564+
'mode' => $mode,
565+
'identity' => $identity
566+
];
567+
568+
if (isset($options['fields'])) {
569+
$data['fields'] = $options['fields'];
570+
}
571+
if (isset($options['partner'])) {
572+
$data['partner'] = $options['partner'];
573+
}
574+
if (isset($options['appname'])) {
575+
$data['appname'] = $options['appname'];
576+
}
577+
if (isset($options['finaltime'])) {
578+
$data['finaltime'] = $options['finaltime'];
579+
}
580+
581+
return $this->makeRequest('SharedRecordCreate', 'POST', $data, $requestMetadata);
582+
}
583+
584+
/**
585+
* Gets a shared record by its UUID
586+
* @param string $recorduuid UUID of the shared record to retrieve
587+
* @param array|null $requestMetadata Additional metadata to include with the request
588+
* @return array The shared record information
589+
*/
590+
public function getSharedRecord($recorduuid, $requestMetadata = null) {
591+
return $this->makeRequest('SharedRecordGet', 'POST', ['recorduuid' => $recorduuid], $requestMetadata);
592+
}
537593
}

0 commit comments

Comments
 (0)