-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: s3 transfer manager v2 #3079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 19 commits
3093732
5950c31
1c82ab5
237fc7b
c28c165
34321b2
5289f7c
c6c0780
034b50d
bc15ac3
e681d10
1f094cd
464b498
09e493f
f10522b
a55e1b3
b271897
f4f1c88
d987aff
6d000f1
27570d0
1dde7fc
060e0e1
ee0fefb
9f639f1
bdce369
cd2133a
0426e11
a548ce2
5a25ad8
64fc3f6
908b4a0
1e643e5
48a2822
02b43f0
153227b
31dbd19
aeed758
26d2469
10928ca
632ece9
6efcc0a
b0c5f75
44f6ff4
83ccd9b
039a67b
50715d1
3034ad8
cfe4ab5
f4c42e0
9fb03f1
4268266
59a8aa4
45ac289
20ada71
e7842ed
7c52a2f
fa664b1
d2d4688
e6a141f
e80eeff
ec383d2
7fd10b6
0c427ca
b8a27c9
89d2c48
39d5e20
dd5f694
19f4436
91c636b
d9c5a54
d9d274f
3071ed2
7230ed2
c24bdc0
e1a6a43
bd03604
edb5496
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <?php | ||
|
|
||
| namespace Aws\S3\S3Transfer\Exceptions; | ||
|
|
||
| class ProgressTrackerException extends \RuntimeException | ||
| { | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <?php | ||
|
|
||
| namespace Aws\S3\S3Transfer\Exceptions; | ||
|
|
||
| class S3TransferException extends \RuntimeException | ||
stobrien89 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| <?php | ||
|
|
||
| namespace Aws\S3\S3Transfer\Models; | ||
|
|
||
| class DownloadDirectoryResponse | ||
|
||
| { | ||
| /** @var int */ | ||
| private int $objectsDownloaded; | ||
|
|
||
| /** @var int */ | ||
| private int $objectsFailed; | ||
|
|
||
| /** | ||
| * @param int $objectsUploaded | ||
| * @param int $objectsFailed | ||
| */ | ||
| public function __construct(int $objectsUploaded, int $objectsFailed) | ||
| { | ||
| $this->objectsDownloaded = $objectsUploaded; | ||
| $this->objectsFailed = $objectsFailed; | ||
| } | ||
|
|
||
| /** | ||
| * @return int | ||
| */ | ||
| public function getObjectsDownloaded(): int | ||
| { | ||
| return $this->objectsDownloaded; | ||
| } | ||
|
|
||
| /** | ||
| * @return int | ||
| */ | ||
| public function getObjectsFailed(): int | ||
| { | ||
| return $this->objectsFailed; | ||
| } | ||
|
|
||
| public function __toString(): string | ||
| { | ||
| return sprintf( | ||
| "DownloadDirectoryResponse: %d objects downloaded, %d objects failed", | ||
| $this->objectsDownloaded, | ||
| $this->objectsFailed | ||
| ); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| <?php | ||
|
|
||
| namespace Aws\S3\S3Transfer\Models; | ||
|
|
||
| use Psr\Http\Message\StreamInterface; | ||
|
|
||
| class DownloadResponse | ||
| { | ||
| /** | ||
| * @param StreamInterface $data | ||
| * @param array $metadata | ||
| */ | ||
| public function __construct( | ||
| private readonly StreamInterface $data, | ||
| private readonly array $metadata = [] | ||
| ) {} | ||
|
|
||
| /** | ||
| * @return StreamInterface | ||
| */ | ||
| public function getData(): StreamInterface | ||
| { | ||
| return $this->data; | ||
| } | ||
|
|
||
| /** | ||
| * @return array | ||
| */ | ||
| public function getMetadata(): array | ||
| { | ||
| return $this->metadata; | ||
| } | ||
| } |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it also be possible to rename to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would be the use case for UploadDirectoryResult to extend Aws\Result? Right now this class just has two counting properties, one for successful uploads and one for failed uploads. Like: class UploadDirectoryResult {
int $failedUploads;
int $successfulUploads;
} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| <?php | ||
|
|
||
| namespace Aws\S3\S3Transfer\Models; | ||
|
|
||
| class UploadDirectoryResponse | ||
yenfryherrerafeliz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| /** @var int */ | ||
| private int $objectsUploaded; | ||
|
|
||
| /** @var int */ | ||
| private int $objectsFailed; | ||
|
|
||
| /** | ||
| * @param int $objectsUploaded | ||
| * @param int $objectsFailed | ||
| */ | ||
| public function __construct(int $objectsUploaded, int $objectsFailed) | ||
| { | ||
| $this->objectsUploaded = $objectsUploaded; | ||
| $this->objectsFailed = $objectsFailed; | ||
| } | ||
|
|
||
| /** | ||
| * @return int | ||
| */ | ||
| public function getObjectsUploaded(): int | ||
| { | ||
| return $this->objectsUploaded; | ||
| } | ||
|
|
||
| /** | ||
| * @return int | ||
| */ | ||
| public function getObjectsFailed(): int | ||
| { | ||
| return $this->objectsFailed; | ||
| } | ||
| } | ||
yenfryherrerafeliz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <?php | ||
|
|
||
| namespace Aws\S3\S3Transfer\Models; | ||
|
|
||
| class UploadResponse | ||
| { | ||
| private array $uploadResponse; | ||
|
|
||
| /** | ||
| * @param array $uploadResponse | ||
| */ | ||
| public function __construct(array $uploadResponse) | ||
| { | ||
| $this->uploadResponse = $uploadResponse; | ||
| } | ||
|
|
||
| public function getUploadResponse(): array | ||
| { | ||
| return $this->uploadResponse; | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.