Skip to content

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

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/S3/S3Transfer/Exceptions/ProgressTrackerException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Aws\S3\S3Transfer\Exceptions;

class ProgressTrackerException extends \RuntimeException
{

}
7 changes: 7 additions & 0 deletions src/S3/S3Transfer/Exceptions/S3TransferException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Aws\S3\S3Transfer\Exceptions;

class S3TransferException extends \RuntimeException
{
}
47 changes: 47 additions & 0 deletions src/S3/S3Transfer/Models/DownloadDirectoryResponse.php
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
);
}
}
33 changes: 33 additions & 0 deletions src/S3/S3Transfer/Models/DownloadResponse.php
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;
}
}
38 changes: 38 additions & 0 deletions src/S3/S3Transfer/Models/UploadDirectoryResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace Aws\S3\S3Transfer\Models;

class UploadDirectoryResponse
{
/** @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;
}
}
21 changes: 21 additions & 0 deletions src/S3/S3Transfer/Models/UploadResponse.php
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;
}
}
Loading