| 1 | <?php |
| 2 | namespace Aws\S3; |
| 3 | |
| 4 | use Aws\AwsClientInterface; |
| 5 | use Aws\CommandInterface; |
| 6 | use Aws\ResultInterface; |
| 7 | use Aws\S3\Exception\S3Exception; |
| 8 | use GuzzleHttp\Promise\PromiseInterface; |
| 9 | use Psr\Http\Message\RequestInterface; |
| 10 | |
| 11 | /** |
| 12 | * **Amazon Simple Storage Service** client. |
| 13 | * |
| 14 | * @method \Aws\Result abortMultipartUpload(array $args = []) |
| 15 | * @method \GuzzleHttp\Promise\Promise abortMultipartUploadAsync(array $args = []) |
| 16 | * @method \Aws\Result completeMultipartUpload(array $args = []) |
| 17 | * @method \GuzzleHttp\Promise\Promise completeMultipartUploadAsync(array $args = []) |
| 18 | * @method \Aws\Result copyObject(array $args = []) |
| 19 | * @method \GuzzleHttp\Promise\Promise copyObjectAsync(array $args = []) |
| 20 | * @method \Aws\Result createBucket(array $args = []) |
| 21 | * @method \GuzzleHttp\Promise\Promise createBucketAsync(array $args = []) |
| 22 | * @method \Aws\Result createBucketMetadataConfiguration(array $args = []) |
| 23 | * @method \GuzzleHttp\Promise\Promise createBucketMetadataConfigurationAsync(array $args = []) |
| 24 | * @method \Aws\Result createBucketMetadataTableConfiguration(array $args = []) |
| 25 | * @method \GuzzleHttp\Promise\Promise createBucketMetadataTableConfigurationAsync(array $args = []) |
| 26 | * @method \Aws\Result createMultipartUpload(array $args = []) |
| 27 | * @method \GuzzleHttp\Promise\Promise createMultipartUploadAsync(array $args = []) |
| 28 | * @method \Aws\Result createSession(array $args = []) |
| 29 | * @method \GuzzleHttp\Promise\Promise createSessionAsync(array $args = []) |
| 30 | * @method \Aws\Result deleteBucket(array $args = []) |
| 31 | * @method \GuzzleHttp\Promise\Promise deleteBucketAsync(array $args = []) |
| 32 | * @method \Aws\Result deleteBucketAnalyticsConfiguration(array $args = []) |
| 33 | * @method \GuzzleHttp\Promise\Promise deleteBucketAnalyticsConfigurationAsync(array $args = []) |
| 34 | * @method \Aws\Result deleteBucketCors(array $args = []) |
| 35 | * @method \GuzzleHttp\Promise\Promise deleteBucketCorsAsync(array $args = []) |
| 36 | * @method \Aws\Result deleteBucketEncryption(array $args = []) |
| 37 | * @method \GuzzleHttp\Promise\Promise deleteBucketEncryptionAsync(array $args = []) |
| 38 | * @method \Aws\Result deleteBucketIntelligentTieringConfiguration(array $args = []) |
| 39 | * @method \GuzzleHttp\Promise\Promise deleteBucketIntelligentTieringConfigurationAsync(array $args = []) |
| 40 | * @method \Aws\Result deleteBucketInventoryConfiguration(array $args = []) |
| 41 | * @method \GuzzleHttp\Promise\Promise deleteBucketInventoryConfigurationAsync(array $args = []) |
| 42 | * @method \Aws\Result deleteBucketLifecycle(array $args = []) |
| 43 | * @method \GuzzleHttp\Promise\Promise deleteBucketLifecycleAsync(array $args = []) |
| 44 | * @method \Aws\Result deleteBucketMetadataConfiguration(array $args = []) |
| 45 | * @method \GuzzleHttp\Promise\Promise deleteBucketMetadataConfigurationAsync(array $args = []) |
| 46 | * @method \Aws\Result deleteBucketMetadataTableConfiguration(array $args = []) |
| 47 | * @method \GuzzleHttp\Promise\Promise deleteBucketMetadataTableConfigurationAsync(array $args = []) |
| 48 | * @method \Aws\Result deleteBucketMetricsConfiguration(array $args = []) |
| 49 | * @method \GuzzleHttp\Promise\Promise deleteBucketMetricsConfigurationAsync(array $args = []) |
| 50 | * @method \Aws\Result deleteBucketOwnershipControls(array $args = []) |
| 51 | * @method \GuzzleHttp\Promise\Promise deleteBucketOwnershipControlsAsync(array $args = []) |
| 52 | * @method \Aws\Result deleteBucketPolicy(array $args = []) |
| 53 | * @method \GuzzleHttp\Promise\Promise deleteBucketPolicyAsync(array $args = []) |
| 54 | * @method \Aws\Result deleteBucketReplication(array $args = []) |
| 55 | * @method \GuzzleHttp\Promise\Promise deleteBucketReplicationAsync(array $args = []) |
| 56 | * @method \Aws\Result deleteBucketTagging(array $args = []) |
| 57 | * @method \GuzzleHttp\Promise\Promise deleteBucketTaggingAsync(array $args = []) |
| 58 | * @method \Aws\Result deleteBucketWebsite(array $args = []) |
| 59 | * @method \GuzzleHttp\Promise\Promise deleteBucketWebsiteAsync(array $args = []) |
| 60 | * @method \Aws\Result deleteObject(array $args = []) |
| 61 | * @method \GuzzleHttp\Promise\Promise deleteObjectAsync(array $args = []) |
| 62 | * @method \Aws\Result deleteObjectTagging(array $args = []) |
| 63 | * @method \GuzzleHttp\Promise\Promise deleteObjectTaggingAsync(array $args = []) |
| 64 | * @method \Aws\Result deleteObjects(array $args = []) |
| 65 | * @method \GuzzleHttp\Promise\Promise deleteObjectsAsync(array $args = []) |
| 66 | * @method \Aws\Result deletePublicAccessBlock(array $args = []) |
| 67 | * @method \GuzzleHttp\Promise\Promise deletePublicAccessBlockAsync(array $args = []) |
| 68 | * @method \Aws\Result getBucketAbac(array $args = []) |
| 69 | * @method \GuzzleHttp\Promise\Promise getBucketAbacAsync(array $args = []) |
| 70 | * @method \Aws\Result getBucketAccelerateConfiguration(array $args = []) |
| 71 | * @method \GuzzleHttp\Promise\Promise getBucketAccelerateConfigurationAsync(array $args = []) |
| 72 | * @method \Aws\Result getBucketAcl(array $args = []) |
| 73 | * @method \GuzzleHttp\Promise\Promise getBucketAclAsync(array $args = []) |
| 74 | * @method \Aws\Result getBucketAnalyticsConfiguration(array $args = []) |
| 75 | * @method \GuzzleHttp\Promise\Promise getBucketAnalyticsConfigurationAsync(array $args = []) |
| 76 | * @method \Aws\Result getBucketCors(array $args = []) |
| 77 | * @method \GuzzleHttp\Promise\Promise getBucketCorsAsync(array $args = []) |
| 78 | * @method \Aws\Result getBucketEncryption(array $args = []) |
| 79 | * @method \GuzzleHttp\Promise\Promise getBucketEncryptionAsync(array $args = []) |
| 80 | * @method \Aws\Result getBucketIntelligentTieringConfiguration(array $args = []) |
| 81 | * @method \GuzzleHttp\Promise\Promise getBucketIntelligentTieringConfigurationAsync(array $args = []) |
| 82 | * @method \Aws\Result getBucketInventoryConfiguration(array $args = []) |
| 83 | * @method \GuzzleHttp\Promise\Promise getBucketInventoryConfigurationAsync(array $args = []) |
| 84 | * @method \Aws\Result getBucketLifecycle(array $args = []) |
| 85 | * @method \GuzzleHttp\Promise\Promise getBucketLifecycleAsync(array $args = []) |
| 86 | * @method \Aws\Result getBucketLifecycleConfiguration(array $args = []) |
| 87 | * @method \GuzzleHttp\Promise\Promise getBucketLifecycleConfigurationAsync(array $args = []) |
| 88 | * @method \Aws\Result getBucketLocation(array $args = []) |
| 89 | * @method \GuzzleHttp\Promise\Promise getBucketLocationAsync(array $args = []) |
| 90 | * @method \Aws\Result getBucketLogging(array $args = []) |
| 91 | * @method \GuzzleHttp\Promise\Promise getBucketLoggingAsync(array $args = []) |
| 92 | * @method \Aws\Result getBucketMetadataConfiguration(array $args = []) |
| 93 | * @method \GuzzleHttp\Promise\Promise getBucketMetadataConfigurationAsync(array $args = []) |
| 94 | * @method \Aws\Result getBucketMetadataTableConfiguration(array $args = []) |
| 95 | * @method \GuzzleHttp\Promise\Promise getBucketMetadataTableConfigurationAsync(array $args = []) |
| 96 | * @method \Aws\Result getBucketMetricsConfiguration(array $args = []) |
| 97 | * @method \GuzzleHttp\Promise\Promise getBucketMetricsConfigurationAsync(array $args = []) |
| 98 | * @method \Aws\Result getBucketNotification(array $args = []) |
| 99 | * @method \GuzzleHttp\Promise\Promise getBucketNotificationAsync(array $args = []) |
| 100 | * @method \Aws\Result getBucketNotificationConfiguration(array $args = []) |
| 101 | * @method \GuzzleHttp\Promise\Promise getBucketNotificationConfigurationAsync(array $args = []) |
| 102 | * @method \Aws\Result getBucketOwnershipControls(array $args = []) |
| 103 | * @method \GuzzleHttp\Promise\Promise getBucketOwnershipControlsAsync(array $args = []) |
| 104 | * @method \Aws\Result getBucketPolicy(array $args = []) |
| 105 | * @method \GuzzleHttp\Promise\Promise getBucketPolicyAsync(array $args = []) |
| 106 | * @method \Aws\Result getBucketPolicyStatus(array $args = []) |
| 107 | * @method \GuzzleHttp\Promise\Promise getBucketPolicyStatusAsync(array $args = []) |
| 108 | * @method \Aws\Result getBucketReplication(array $args = []) |
| 109 | * @method \GuzzleHttp\Promise\Promise getBucketReplicationAsync(array $args = []) |
| 110 | * @method \Aws\Result getBucketRequestPayment(array $args = []) |
| 111 | * @method \GuzzleHttp\Promise\Promise getBucketRequestPaymentAsync(array $args = []) |
| 112 | * @method \Aws\Result getBucketTagging(array $args = []) |
| 113 | * @method \GuzzleHttp\Promise\Promise getBucketTaggingAsync(array $args = []) |
| 114 | * @method \Aws\Result getBucketVersioning(array $args = []) |
| 115 | * @method \GuzzleHttp\Promise\Promise getBucketVersioningAsync(array $args = []) |
| 116 | * @method \Aws\Result getBucketWebsite(array $args = []) |
| 117 | * @method \GuzzleHttp\Promise\Promise getBucketWebsiteAsync(array $args = []) |
| 118 | * @method \Aws\Result getObject(array $args = []) |
| 119 | * @method \GuzzleHttp\Promise\Promise getObjectAsync(array $args = []) |
| 120 | * @method \Aws\Result getObjectAcl(array $args = []) |
| 121 | * @method \GuzzleHttp\Promise\Promise getObjectAclAsync(array $args = []) |
| 122 | * @method \Aws\Result getObjectAttributes(array $args = []) |
| 123 | * @method \GuzzleHttp\Promise\Promise getObjectAttributesAsync(array $args = []) |
| 124 | * @method \Aws\Result getObjectLegalHold(array $args = []) |
| 125 | * @method \GuzzleHttp\Promise\Promise getObjectLegalHoldAsync(array $args = []) |
| 126 | * @method \Aws\Result getObjectLockConfiguration(array $args = []) |
| 127 | * @method \GuzzleHttp\Promise\Promise getObjectLockConfigurationAsync(array $args = []) |
| 128 | * @method \Aws\Result getObjectRetention(array $args = []) |
| 129 | * @method \GuzzleHttp\Promise\Promise getObjectRetentionAsync(array $args = []) |
| 130 | * @method \Aws\Result getObjectTagging(array $args = []) |
| 131 | * @method \GuzzleHttp\Promise\Promise getObjectTaggingAsync(array $args = []) |
| 132 | * @method \Aws\Result getObjectTorrent(array $args = []) |
| 133 | * @method \GuzzleHttp\Promise\Promise getObjectTorrentAsync(array $args = []) |
| 134 | * @method \Aws\Result getPublicAccessBlock(array $args = []) |
| 135 | * @method \GuzzleHttp\Promise\Promise getPublicAccessBlockAsync(array $args = []) |
| 136 | * @method \Aws\Result headBucket(array $args = []) |
| 137 | * @method \GuzzleHttp\Promise\Promise headBucketAsync(array $args = []) |
| 138 | * @method \Aws\Result headObject(array $args = []) |
| 139 | * @method \GuzzleHttp\Promise\Promise headObjectAsync(array $args = []) |
| 140 | * @method \Aws\Result listBucketAnalyticsConfigurations(array $args = []) |
| 141 | * @method \GuzzleHttp\Promise\Promise listBucketAnalyticsConfigurationsAsync(array $args = []) |
| 142 | * @method \Aws\Result listBucketIntelligentTieringConfigurations(array $args = []) |
| 143 | * @method \GuzzleHttp\Promise\Promise listBucketIntelligentTieringConfigurationsAsync(array $args = []) |
| 144 | * @method \Aws\Result listBucketInventoryConfigurations(array $args = []) |
| 145 | * @method \GuzzleHttp\Promise\Promise listBucketInventoryConfigurationsAsync(array $args = []) |
| 146 | * @method \Aws\Result listBucketMetricsConfigurations(array $args = []) |
| 147 | * @method \GuzzleHttp\Promise\Promise listBucketMetricsConfigurationsAsync(array $args = []) |
| 148 | * @method \Aws\Result listBuckets(array $args = []) |
| 149 | * @method \GuzzleHttp\Promise\Promise listBucketsAsync(array $args = []) |
| 150 | * @method \Aws\Result listDirectoryBuckets(array $args = []) |
| 151 | * @method \GuzzleHttp\Promise\Promise listDirectoryBucketsAsync(array $args = []) |
| 152 | * @method \Aws\Result listMultipartUploads(array $args = []) |
| 153 | * @method \GuzzleHttp\Promise\Promise listMultipartUploadsAsync(array $args = []) |
| 154 | * @method \Aws\Result listObjectVersions(array $args = []) |
| 155 | * @method \GuzzleHttp\Promise\Promise listObjectVersionsAsync(array $args = []) |
| 156 | * @method \Aws\Result listObjects(array $args = []) |
| 157 | * @method \GuzzleHttp\Promise\Promise listObjectsAsync(array $args = []) |
| 158 | * @method \Aws\Result listObjectsV2(array $args = []) |
| 159 | * @method \GuzzleHttp\Promise\Promise listObjectsV2Async(array $args = []) |
| 160 | * @method \Aws\Result listParts(array $args = []) |
| 161 | * @method \GuzzleHttp\Promise\Promise listPartsAsync(array $args = []) |
| 162 | * @method \Aws\Result putBucketAbac(array $args = []) |
| 163 | * @method \GuzzleHttp\Promise\Promise putBucketAbacAsync(array $args = []) |
| 164 | * @method \Aws\Result putBucketAccelerateConfiguration(array $args = []) |
| 165 | * @method \GuzzleHttp\Promise\Promise putBucketAccelerateConfigurationAsync(array $args = []) |
| 166 | * @method \Aws\Result putBucketAcl(array $args = []) |
| 167 | * @method \GuzzleHttp\Promise\Promise putBucketAclAsync(array $args = []) |
| 168 | * @method \Aws\Result putBucketAnalyticsConfiguration(array $args = []) |
| 169 | * @method \GuzzleHttp\Promise\Promise putBucketAnalyticsConfigurationAsync(array $args = []) |
| 170 | * @method \Aws\Result putBucketCors(array $args = []) |
| 171 | * @method \GuzzleHttp\Promise\Promise putBucketCorsAsync(array $args = []) |
| 172 | * @method \Aws\Result putBucketEncryption(array $args = []) |
| 173 | * @method \GuzzleHttp\Promise\Promise putBucketEncryptionAsync(array $args = []) |
| 174 | * @method \Aws\Result putBucketIntelligentTieringConfiguration(array $args = []) |
| 175 | * @method \GuzzleHttp\Promise\Promise putBucketIntelligentTieringConfigurationAsync(array $args = []) |
| 176 | * @method \Aws\Result putBucketInventoryConfiguration(array $args = []) |
| 177 | * @method \GuzzleHttp\Promise\Promise putBucketInventoryConfigurationAsync(array $args = []) |
| 178 | * @method \Aws\Result putBucketLifecycle(array $args = []) |
| 179 | * @method \GuzzleHttp\Promise\Promise putBucketLifecycleAsync(array $args = []) |
| 180 | * @method \Aws\Result putBucketLifecycleConfiguration(array $args = []) |
| 181 | * @method \GuzzleHttp\Promise\Promise putBucketLifecycleConfigurationAsync(array $args = []) |
| 182 | * @method \Aws\Result putBucketLogging(array $args = []) |
| 183 | * @method \GuzzleHttp\Promise\Promise putBucketLoggingAsync(array $args = []) |
| 184 | * @method \Aws\Result putBucketMetricsConfiguration(array $args = []) |
| 185 | * @method \GuzzleHttp\Promise\Promise putBucketMetricsConfigurationAsync(array $args = []) |
| 186 | * @method \Aws\Result putBucketNotification(array $args = []) |
| 187 | * @method \GuzzleHttp\Promise\Promise putBucketNotificationAsync(array $args = []) |
| 188 | * @method \Aws\Result putBucketNotificationConfiguration(array $args = []) |
| 189 | * @method \GuzzleHttp\Promise\Promise putBucketNotificationConfigurationAsync(array $args = []) |
| 190 | * @method \Aws\Result putBucketOwnershipControls(array $args = []) |
| 191 | * @method \GuzzleHttp\Promise\Promise putBucketOwnershipControlsAsync(array $args = []) |
| 192 | * @method \Aws\Result putBucketPolicy(array $args = []) |
| 193 | * @method \GuzzleHttp\Promise\Promise putBucketPolicyAsync(array $args = []) |
| 194 | * @method \Aws\Result putBucketReplication(array $args = []) |
| 195 | * @method \GuzzleHttp\Promise\Promise putBucketReplicationAsync(array $args = []) |
| 196 | * @method \Aws\Result putBucketRequestPayment(array $args = []) |
| 197 | * @method \GuzzleHttp\Promise\Promise putBucketRequestPaymentAsync(array $args = []) |
| 198 | * @method \Aws\Result putBucketTagging(array $args = []) |
| 199 | * @method \GuzzleHttp\Promise\Promise putBucketTaggingAsync(array $args = []) |
| 200 | * @method \Aws\Result putBucketVersioning(array $args = []) |
| 201 | * @method \GuzzleHttp\Promise\Promise putBucketVersioningAsync(array $args = []) |
| 202 | * @method \Aws\Result putBucketWebsite(array $args = []) |
| 203 | * @method \GuzzleHttp\Promise\Promise putBucketWebsiteAsync(array $args = []) |
| 204 | * @method \Aws\Result putObject(array $args = []) |
| 205 | * @method \GuzzleHttp\Promise\Promise putObjectAsync(array $args = []) |
| 206 | * @method \Aws\Result putObjectAcl(array $args = []) |
| 207 | * @method \GuzzleHttp\Promise\Promise putObjectAclAsync(array $args = []) |
| 208 | * @method \Aws\Result putObjectLegalHold(array $args = []) |
| 209 | * @method \GuzzleHttp\Promise\Promise putObjectLegalHoldAsync(array $args = []) |
| 210 | * @method \Aws\Result putObjectLockConfiguration(array $args = []) |
| 211 | * @method \GuzzleHttp\Promise\Promise putObjectLockConfigurationAsync(array $args = []) |
| 212 | * @method \Aws\Result putObjectRetention(array $args = []) |
| 213 | * @method \GuzzleHttp\Promise\Promise putObjectRetentionAsync(array $args = []) |
| 214 | * @method \Aws\Result putObjectTagging(array $args = []) |
| 215 | * @method \GuzzleHttp\Promise\Promise putObjectTaggingAsync(array $args = []) |
| 216 | * @method \Aws\Result putPublicAccessBlock(array $args = []) |
| 217 | * @method \GuzzleHttp\Promise\Promise putPublicAccessBlockAsync(array $args = []) |
| 218 | * @method \Aws\Result renameObject(array $args = []) |
| 219 | * @method \GuzzleHttp\Promise\Promise renameObjectAsync(array $args = []) |
| 220 | * @method \Aws\Result restoreObject(array $args = []) |
| 221 | * @method \GuzzleHttp\Promise\Promise restoreObjectAsync(array $args = []) |
| 222 | * @method \Aws\Result selectObjectContent(array $args = []) |
| 223 | * @method \GuzzleHttp\Promise\Promise selectObjectContentAsync(array $args = []) |
| 224 | * @method \Aws\Result updateBucketMetadataInventoryTableConfiguration(array $args = []) |
| 225 | * @method \GuzzleHttp\Promise\Promise updateBucketMetadataInventoryTableConfigurationAsync(array $args = []) |
| 226 | * @method \Aws\Result updateBucketMetadataJournalTableConfiguration(array $args = []) |
| 227 | * @method \GuzzleHttp\Promise\Promise updateBucketMetadataJournalTableConfigurationAsync(array $args = []) |
| 228 | * @method \Aws\Result updateObjectEncryption(array $args = []) |
| 229 | * @method \GuzzleHttp\Promise\Promise updateObjectEncryptionAsync(array $args = []) |
| 230 | * @method \Aws\Result uploadPart(array $args = []) |
| 231 | * @method \GuzzleHttp\Promise\Promise uploadPartAsync(array $args = []) |
| 232 | * @method \Aws\Result uploadPartCopy(array $args = []) |
| 233 | * @method \GuzzleHttp\Promise\Promise uploadPartCopyAsync(array $args = []) |
| 234 | * @method \Aws\Result writeGetObjectResponse(array $args = []) |
| 235 | * @method \GuzzleHttp\Promise\Promise writeGetObjectResponseAsync(array $args = []) |
| 236 | */ |
| 237 | interface S3ClientInterface extends AwsClientInterface |
| 238 | { |
| 239 | /** |
| 240 | * Create a pre-signed URL for the given S3 command object. |
| 241 | * |
| 242 | * @param CommandInterface $command Command to create a pre-signed |
| 243 | * URL for. |
| 244 | * @param int|string|\DateTimeInterface $expires The time at which the URL should |
| 245 | * expire. This can be a Unix |
| 246 | * timestamp, a PHP DateTime object, |
| 247 | * or a string that can be evaluated |
| 248 | * by strtotime(). |
| 249 | * |
| 250 | * @return RequestInterface |
| 251 | */ |
| 252 | public function createPresignedRequest(CommandInterface $command, $expires, array $options = []); |
| 253 | |
| 254 | /** |
| 255 | * Returns the URL to an object identified by its bucket and key. |
| 256 | * |
| 257 | * The URL returned by this method is not signed nor does it ensure that the |
| 258 | * bucket and key given to the method exist. If you need a signed URL, then |
| 259 | * use the {@see \Aws\S3\S3Client::createPresignedRequest} method and get |
| 260 | * the URI of the signed request. |
| 261 | * |
| 262 | * @param string $bucket The name of the bucket where the object is located |
| 263 | * @param string $key The key of the object |
| 264 | * |
| 265 | * @return string The URL to the object |
| 266 | */ |
| 267 | public function getObjectUrl($bucket, $key); |
| 268 | |
| 269 | /** |
| 270 | * @deprecated Use doesBucketExistV2() instead |
| 271 | * |
| 272 | * Determines whether or not a bucket exists by name. |
| 273 | * |
| 274 | * @param string $bucket The name of the bucket |
| 275 | * |
| 276 | * @return bool |
| 277 | */ |
| 278 | public function doesBucketExist($bucket); |
| 279 | |
| 280 | /** |
| 281 | * Determines whether or not a bucket exists by name. This method uses S3's |
| 282 | * HeadBucket operation and requires the relevant bucket permissions in the |
| 283 | * default case to prevent errors. |
| 284 | * |
| 285 | * @param string $bucket The name of the bucket |
| 286 | * @param bool $accept403 Set to true for this method to return true in the case of |
| 287 | * invalid bucket-level permissions. Credentials MUST be valid |
| 288 | * to avoid inaccuracies. Using the default value of false will |
| 289 | * cause an exception to be thrown instead. |
| 290 | * |
| 291 | * @return bool |
| 292 | * @throws S3Exception|\Exception if there is an unhandled exception |
| 293 | */ |
| 294 | public function doesBucketExistV2($bucket, $accept403); |
| 295 | |
| 296 | /** |
| 297 | * @deprecated Use doesObjectExistV2() instead |
| 298 | * |
| 299 | * Determines whether or not an object exists by name. |
| 300 | * |
| 301 | * @param string $bucket The name of the bucket |
| 302 | * @param string $key The key of the object |
| 303 | * @param array $options Additional options available in the HeadObject |
| 304 | * operation (e.g., VersionId). |
| 305 | * |
| 306 | * @return bool |
| 307 | */ |
| 308 | public function doesObjectExist($bucket, $key, array $options = []); |
| 309 | |
| 310 | /** |
| 311 | * Determines whether or not an object exists by name. This method uses S3's HeadObject |
| 312 | * operation and requires the relevant bucket and object permissions to prevent errors. |
| 313 | * |
| 314 | * @param string $bucket The name of the bucket |
| 315 | * @param string $key The key of the object |
| 316 | * @param bool $includeDeleteMarkers Set to true to consider delete markers |
| 317 | * existing objects. Using the default value |
| 318 | * of false will ignore delete markers and |
| 319 | * return false. |
| 320 | * @param array $options Additional options available in the HeadObject |
| 321 | * operation (e.g., VersionId). |
| 322 | * |
| 323 | * @return bool |
| 324 | * @throws S3Exception|\Exception if there is an unhandled exception |
| 325 | */ |
| 326 | public function doesObjectExistV2($bucket, $key, $includeDeleteMarkers = false, array $options = []); |
| 327 | |
| 328 | /** |
| 329 | * Register the Amazon S3 stream wrapper with this client instance. |
| 330 | */ |
| 331 | public function registerStreamWrapper(); |
| 332 | |
| 333 | /** |
| 334 | * Registers the Amazon S3 stream wrapper with this client instance. |
| 335 | * |
| 336 | *This version uses doesObjectExistV2 and doesBucketExistV2 to check |
| 337 | * resource existence. |
| 338 | */ |
| 339 | public function registerStreamWrapperV2(); |
| 340 | |
| 341 | /** |
| 342 | * Deletes objects from Amazon S3 that match the result of a ListObjects |
| 343 | * operation. For example, this allows you to do things like delete all |
| 344 | * objects that match a specific key prefix. |
| 345 | * |
| 346 | * @param string $bucket Bucket that contains the object keys |
| 347 | * @param string $prefix Optionally delete only objects under this key prefix |
| 348 | * @param string $regex Delete only objects that match this regex |
| 349 | * @param array $options Aws\S3\BatchDelete options array. |
| 350 | * |
| 351 | * @see Aws\S3\S3Client::listObjects |
| 352 | * @throws \RuntimeException if no prefix and no regex is given |
| 353 | */ |
| 354 | public function deleteMatchingObjects( |
| 355 | $bucket, |
| 356 | $prefix = '', |
| 357 | $regex = '', |
| 358 | array $options = [] |
| 359 | ); |
| 360 | |
| 361 | /** |
| 362 | * Deletes objects from Amazon S3 that match the result of a ListObjects |
| 363 | * operation. For example, this allows you to do things like delete all |
| 364 | * objects that match a specific key prefix. |
| 365 | * |
| 366 | * @param string $bucket Bucket that contains the object keys |
| 367 | * @param string $prefix Optionally delete only objects under this key prefix |
| 368 | * @param string $regex Delete only objects that match this regex |
| 369 | * @param array $options Aws\S3\BatchDelete options array. |
| 370 | * |
| 371 | * @see Aws\S3\S3Client::listObjects |
| 372 | * |
| 373 | * @return PromiseInterface A promise that is settled when matching |
| 374 | * objects are deleted. |
| 375 | */ |
| 376 | public function deleteMatchingObjectsAsync( |
| 377 | $bucket, |
| 378 | $prefix = '', |
| 379 | $regex = '', |
| 380 | array $options = [] |
| 381 | ); |
| 382 | |
| 383 | /** |
| 384 | * Upload a file, stream, or string to a bucket. |
| 385 | * |
| 386 | * If the upload size exceeds the specified threshold, the upload will be |
| 387 | * performed using concurrent multipart uploads. |
| 388 | * |
| 389 | * The options array accepts the following options: |
| 390 | * |
| 391 | * - before_upload: (callable) Callback to invoke before any upload |
| 392 | * operations during the upload process. The callback should have a |
| 393 | * function signature like `function (Aws\Command $command) {...}`. |
| 394 | * - concurrency: (int, default=int(3)) Maximum number of concurrent |
| 395 | * `UploadPart` operations allowed during a multipart upload. |
| 396 | * - mup_threshold: (int, default=int(16777216)) The size, in bytes, allowed |
| 397 | * before the upload must be sent via a multipart upload. Default: 16 MB. |
| 398 | * - params: (array, default=array([])) Custom parameters to use with the |
| 399 | * upload. For single uploads, they must correspond to those used for the |
| 400 | * `PutObject` operation. For multipart uploads, they correspond to the |
| 401 | * parameters of the `CreateMultipartUpload` operation. |
| 402 | * - part_size: (int) Part size to use when doing a multipart upload. |
| 403 | * |
| 404 | * @param string $bucket Bucket to upload the object. |
| 405 | * @param string $key Key of the object. |
| 406 | * @param mixed $body Object data to upload. Can be a |
| 407 | * StreamInterface, PHP stream resource, or a |
| 408 | * string of data to upload. |
| 409 | * @param string $acl ACL to apply to the object (default: private). |
| 410 | * @param array $options Options used to configure the upload process. |
| 411 | * |
| 412 | * @see Aws\S3\MultipartUploader for more info about multipart uploads. |
| 413 | * @return ResultInterface Returns the result of the upload. |
| 414 | */ |
| 415 | public function upload( |
| 416 | $bucket, |
| 417 | $key, |
| 418 | $body, |
| 419 | $acl = 'private', |
| 420 | array $options = [] |
| 421 | ); |
| 422 | |
| 423 | /** |
| 424 | * Upload a file, stream, or string to a bucket asynchronously. |
| 425 | * |
| 426 | * @param string $bucket Bucket to upload the object. |
| 427 | * @param string $key Key of the object. |
| 428 | * @param mixed $body Object data to upload. Can be a |
| 429 | * StreamInterface, PHP stream resource, or a |
| 430 | * string of data to upload. |
| 431 | * @param string $acl ACL to apply to the object (default: private). |
| 432 | * @param array $options Options used to configure the upload process. |
| 433 | * |
| 434 | * @see self::upload |
| 435 | * @return PromiseInterface Returns a promise that will be fulfilled |
| 436 | * with the result of the upload. |
| 437 | */ |
| 438 | public function uploadAsync( |
| 439 | $bucket, |
| 440 | $key, |
| 441 | $body, |
| 442 | $acl = 'private', |
| 443 | array $options = [] |
| 444 | ); |
| 445 | |
| 446 | /** |
| 447 | * Copy an object of any size to a different location. |
| 448 | * |
| 449 | * If the upload size exceeds the maximum allowable size for direct S3 |
| 450 | * copying, a multipart copy will be used. |
| 451 | * |
| 452 | * The options array accepts the following options: |
| 453 | * |
| 454 | * - before_upload: (callable) Callback to invoke before any upload |
| 455 | * operations during the upload process. The callback should have a |
| 456 | * function signature like `function (Aws\Command $command) {...}`. |
| 457 | * - concurrency: (int, default=int(5)) Maximum number of concurrent |
| 458 | * `UploadPart` operations allowed during a multipart upload. |
| 459 | * - params: (array, default=array([])) Custom parameters to use with the |
| 460 | * upload. For single uploads, they must correspond to those used for the |
| 461 | * `CopyObject` operation. For multipart uploads, they correspond to the |
| 462 | * parameters of the `CreateMultipartUpload` operation. |
| 463 | * - part_size: (int) Part size to use when doing a multipart upload. |
| 464 | * |
| 465 | * @param string $fromBucket Bucket where the copy source resides. |
| 466 | * @param string $fromKey Key of the copy source. |
| 467 | * @param string $destBucket Bucket to which to copy the object. |
| 468 | * @param string $destKey Key to which to copy the object. |
| 469 | * @param string $acl ACL to apply to the copy (default: private). |
| 470 | * @param array $options Options used to configure the upload process. |
| 471 | * |
| 472 | * @see Aws\S3\MultipartCopy for more info about multipart uploads. |
| 473 | * @return ResultInterface Returns the result of the copy. |
| 474 | */ |
| 475 | public function copy( |
| 476 | $fromBucket, |
| 477 | $fromKey, |
| 478 | $destBucket, |
| 479 | $destKey, |
| 480 | $acl = 'private', |
| 481 | array $options = [] |
| 482 | ); |
| 483 | |
| 484 | /** |
| 485 | * Copy an object of any size to a different location asynchronously. |
| 486 | * |
| 487 | * @param string $fromBucket Bucket where the copy source resides. |
| 488 | * @param string $fromKey Key of the copy source. |
| 489 | * @param string $destBucket Bucket to which to copy the object. |
| 490 | * @param string $destKey Key to which to copy the object. |
| 491 | * @param string $acl ACL to apply to the copy (default: private). |
| 492 | * @param array $options Options used to configure the upload process. |
| 493 | * |
| 494 | * @see self::copy for more info about the parameters above. |
| 495 | * @return PromiseInterface Returns a promise that will be fulfilled |
| 496 | * with the result of the copy. |
| 497 | */ |
| 498 | public function copyAsync( |
| 499 | $fromBucket, |
| 500 | $fromKey, |
| 501 | $destBucket, |
| 502 | $destKey, |
| 503 | $acl = 'private', |
| 504 | array $options = [] |
| 505 | ); |
| 506 | |
| 507 | /** |
| 508 | * Recursively uploads all files in a given directory to a given bucket. |
| 509 | * |
| 510 | * @param string $directory Full path to a directory to upload |
| 511 | * @param string $bucket Name of the bucket |
| 512 | * @param string $keyPrefix Virtual directory key prefix to add to each upload |
| 513 | * @param array $options Options available in Aws\S3\Transfer::__construct |
| 514 | * |
| 515 | * @see Aws\S3\Transfer for more options and customization |
| 516 | */ |
| 517 | public function uploadDirectory( |
| 518 | $directory, |
| 519 | $bucket, |
| 520 | $keyPrefix = null, |
| 521 | array $options = [] |
| 522 | ); |
| 523 | |
| 524 | /** |
| 525 | * Recursively uploads all files in a given directory to a given bucket. |
| 526 | * |
| 527 | * @param string $directory Full path to a directory to upload |
| 528 | * @param string $bucket Name of the bucket |
| 529 | * @param string $keyPrefix Virtual directory key prefix to add to each upload |
| 530 | * @param array $options Options available in Aws\S3\Transfer::__construct |
| 531 | * |
| 532 | * @see Aws\S3\Transfer for more options and customization |
| 533 | * |
| 534 | * @return PromiseInterface A promise that is settled when the upload is |
| 535 | * complete. |
| 536 | */ |
| 537 | public function uploadDirectoryAsync( |
| 538 | $directory, |
| 539 | $bucket, |
| 540 | $keyPrefix = null, |
| 541 | array $options = [] |
| 542 | ); |
| 543 | |
| 544 | /** |
| 545 | * Downloads a bucket to the local filesystem |
| 546 | * |
| 547 | * @param string $directory Directory to download to |
| 548 | * @param string $bucket Bucket to download from |
| 549 | * @param string $keyPrefix Only download objects that use this key prefix |
| 550 | * @param array $options Options available in Aws\S3\Transfer::__construct |
| 551 | */ |
| 552 | public function downloadBucket( |
| 553 | $directory, |
| 554 | $bucket, |
| 555 | $keyPrefix = '', |
| 556 | array $options = [] |
| 557 | ); |
| 558 | |
| 559 | /** |
| 560 | * Downloads a bucket to the local filesystem |
| 561 | * |
| 562 | * @param string $directory Directory to download to |
| 563 | * @param string $bucket Bucket to download from |
| 564 | * @param string $keyPrefix Only download objects that use this key prefix |
| 565 | * @param array $options Options available in Aws\S3\Transfer::__construct |
| 566 | * |
| 567 | * @return PromiseInterface A promise that is settled when the download is |
| 568 | * complete. |
| 569 | */ |
| 570 | public function downloadBucketAsync( |
| 571 | $directory, |
| 572 | $bucket, |
| 573 | $keyPrefix = '', |
| 574 | array $options = [] |
| 575 | ); |
| 576 | |
| 577 | /** |
| 578 | * Returns the region in which a given bucket is located. |
| 579 | * |
| 580 | * @param string $bucketName |
| 581 | * |
| 582 | * @return string |
| 583 | */ |
| 584 | public function determineBucketRegion($bucketName); |
| 585 | |
| 586 | /** |
| 587 | * Returns a promise fulfilled with the region in which a given bucket is |
| 588 | * located. |
| 589 | * |
| 590 | * @param string $bucketName |
| 591 | * |
| 592 | * @return PromiseInterface |
| 593 | */ |
| 594 | public function determineBucketRegionAsync($bucketName); |
| 595 | } |