in src/Transform/BucketBasic.php [643:695]
public static function toListObjectsV2(OperationOutput $output): Models\ListObjectsV2Result
{
$result = new Models\ListObjectsV2Result();
$customDeserializer = [
static function (Models\ListObjectsV2Result $result, OperationOutput $output) {
$body = $output->getBody() != null ? $output->getBody()->getContents() : '';
Functions::assertXmlRoot($body, 'ListBucketResult');
$xml = Utils::parseXml($body);
$result->encodingType = Functions::tryToString($xml->EncodingType);
$decode = $result->encodingType === 'url';
$result->name = Functions::tryToString($xml->Name);
$result->prefix = Functions::tryUrldecodeString($xml->Prefix, $decode);
$result->startAfter = Functions::tryUrldecodeString($xml->StartAfter, $decode);
$result->continuationToken = Functions::tryUrldecodeString($xml->ContinuationToken, $decode);
$result->maxKeys = Functions::tryToInt($xml->MaxKeys);
$result->delimiter = Functions::tryUrldecodeString($xml->Delimiter, $decode);
$result->isTruncated = Functions::tryToBool($xml->IsTruncated);
$result->nextContinuationToken = Functions::tryUrldecodeString($xml->NextContinuationToken, $decode);
$result->keyCount = Functions::tryToInt($xml->KeyCount);
if (isset($xml->Contents)) {
$result->contents = [];
foreach ($xml->Contents as $content) {
$o = new Models\ObjectProperties();
$o->key = Functions::tryUrldecodeString($content->Key, $decode);
$o->type = Functions::tryToString($content->Type);
$o->size = Functions::tryToInt($content->Size);
$o->etag = Functions::tryToString($content->ETag);
$o->lastModified = Functions::tryToDatetime($content->LastModified, 'Y-m-d\TH:i:s.000\Z');
$o->storageClass = Functions::tryToString($content->StorageClass);
if (isset($content->Owner)) {
$o->owner = new Models\Owner(
Functions::tryToString($content->Owner->ID),
Functions::tryToString($content->Owner->DisplayName)
);
}
$o->restoreInfo = Functions::tryToString($content->RestoreInfo);
$o->transitionTime = Functions::tryToDatetime($content->TransitionTime, 'Y-m-d\TH:i:s.000\Z');
$result->contents[] = $o;
}
}
if (isset($xml->CommonPrefixes)) {
$result->commonPrefixes = [];
foreach ($xml->CommonPrefixes as $commonPrefix) {
$result->commonPrefixes[] = new Models\CommonPrefix(
Functions::tryUrldecodeString($commonPrefix->Prefix, $decode)
);
}
}
},
];
Deserializer::deserializeOutput($result, $output, $customDeserializer);
return $result;
}