| 1 |
<?php |
| 2 |
|
| 3 |
namespace Aws\S3\S3Transfer\Models; |
| 4 |
|
| 5 |
use Throwable; |
| 6 |
|
| 7 |
final class DownloadDirectoryResult |
| 8 |
{ |
| 9 |
|
| 10 |
private int $objectsDownloaded; |
| 11 |
|
| 12 |
|
| 13 |
private int $objectsFailed; |
| 14 |
|
| 15 |
|
| 16 |
private ?\Throwable $reason; |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
public function __construct( |
| 24 |
int $objectsDownloaded, |
| 25 |
int $objectsFailed, |
| 26 |
?Throwable $reason = null |
| 27 |
) { |
| 28 |
$this->objectsDownloaded = $objectsDownloaded; |
| 29 |
$this->objectsFailed = $objectsFailed; |
| 30 |
$this->reason = $reason; |
| 31 |
} |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
public function getObjectsDownloaded(): int |
| 37 |
{ |
| 38 |
return $this->objectsDownloaded; |
| 39 |
} |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
public function getObjectsFailed(): int |
| 45 |
{ |
| 46 |
return $this->objectsFailed; |
| 47 |
} |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
public function getReason(): ?Throwable |
| 53 |
{ |
| 54 |
return $this->reason; |
| 55 |
} |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
public function __toString(): string |
| 61 |
{ |
| 62 |
return sprintf( |
| 63 |
"DownloadDirectoryResult: %d objects downloaded, %d objects failed", |
| 64 |
$this->objectsDownloaded, |
| 65 |
$this->objectsFailed |
| 66 |
); |
| 67 |
} |
| 68 |
} |