231 lines
7.7 KiB
PHP
231 lines
7.7 KiB
PHP
<?php
|
|
|
|
namespace AsyncAws\S3\Result;
|
|
|
|
use AsyncAws\Core\Response;
|
|
use AsyncAws\Core\Result;
|
|
use AsyncAws\S3\Enum\RequestCharged;
|
|
use AsyncAws\S3\Enum\ServerSideEncryption;
|
|
|
|
class PutObjectOutput extends Result
|
|
{
|
|
/**
|
|
* If the expiration is configured for the object (see PutBucketLifecycleConfiguration), the response includes this
|
|
* header. It includes the `expiry-date` and `rule-id` key-value pairs that provide information about object expiration.
|
|
* The value of the `rule-id` is URL-encoded.
|
|
*
|
|
* @see https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html
|
|
*/
|
|
private $expiration;
|
|
|
|
/**
|
|
* Entity tag for the uploaded object.
|
|
*/
|
|
private $etag;
|
|
|
|
/**
|
|
* The base64-encoded, 32-bit CRC32 checksum of the object. This will only be present if it was uploaded with the
|
|
* object. With multipart uploads, this may not be a checksum value of the object. For more information about how
|
|
* checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*.
|
|
*
|
|
* @see https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums
|
|
*/
|
|
private $checksumCrc32;
|
|
|
|
/**
|
|
* The base64-encoded, 32-bit CRC32C checksum of the object. This will only be present if it was uploaded with the
|
|
* object. With multipart uploads, this may not be a checksum value of the object. For more information about how
|
|
* checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*.
|
|
*
|
|
* @see https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums
|
|
*/
|
|
private $checksumCrc32C;
|
|
|
|
/**
|
|
* The base64-encoded, 160-bit SHA-1 digest of the object. This will only be present if it was uploaded with the object.
|
|
* With multipart uploads, this may not be a checksum value of the object. For more information about how checksums are
|
|
* calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*.
|
|
*
|
|
* @see https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums
|
|
*/
|
|
private $checksumSha1;
|
|
|
|
/**
|
|
* The base64-encoded, 256-bit SHA-256 digest of the object. This will only be present if it was uploaded with the
|
|
* object. With multipart uploads, this may not be a checksum value of the object. For more information about how
|
|
* checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*.
|
|
*
|
|
* @see https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums
|
|
*/
|
|
private $checksumSha256;
|
|
|
|
/**
|
|
* If you specified server-side encryption either with an Amazon Web Services KMS key or Amazon S3-managed encryption
|
|
* key in your PUT request, the response includes this header. It confirms the encryption algorithm that Amazon S3 used
|
|
* to encrypt the object.
|
|
*/
|
|
private $serverSideEncryption;
|
|
|
|
/**
|
|
* Version of the object.
|
|
*/
|
|
private $versionId;
|
|
|
|
/**
|
|
* If server-side encryption with a customer-provided encryption key was requested, the response will include this
|
|
* header confirming the encryption algorithm used.
|
|
*/
|
|
private $sseCustomerAlgorithm;
|
|
|
|
/**
|
|
* If server-side encryption with a customer-provided encryption key was requested, the response will include this
|
|
* header to provide round-trip message integrity verification of the customer-provided encryption key.
|
|
*/
|
|
private $sseCustomerKeyMd5;
|
|
|
|
/**
|
|
* If `x-amz-server-side-encryption` is present and has the value of `aws:kms`, this header specifies the ID of the
|
|
* Amazon Web Services Key Management Service (Amazon Web Services KMS) symmetric customer managed key that was used for
|
|
* the object.
|
|
*/
|
|
private $sseKmsKeyId;
|
|
|
|
/**
|
|
* If present, specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this
|
|
* header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.
|
|
*/
|
|
private $sseKmsEncryptionContext;
|
|
|
|
/**
|
|
* Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Amazon Web Services KMS
|
|
* (SSE-KMS).
|
|
*/
|
|
private $bucketKeyEnabled;
|
|
|
|
private $requestCharged;
|
|
|
|
public function getBucketKeyEnabled(): ?bool
|
|
{
|
|
$this->initialize();
|
|
|
|
return $this->bucketKeyEnabled;
|
|
}
|
|
|
|
public function getChecksumCrc32(): ?string
|
|
{
|
|
$this->initialize();
|
|
|
|
return $this->checksumCrc32;
|
|
}
|
|
|
|
public function getChecksumCrc32C(): ?string
|
|
{
|
|
$this->initialize();
|
|
|
|
return $this->checksumCrc32C;
|
|
}
|
|
|
|
public function getChecksumSha1(): ?string
|
|
{
|
|
$this->initialize();
|
|
|
|
return $this->checksumSha1;
|
|
}
|
|
|
|
public function getChecksumSha256(): ?string
|
|
{
|
|
$this->initialize();
|
|
|
|
return $this->checksumSha256;
|
|
}
|
|
|
|
public function getEtag(): ?string
|
|
{
|
|
$this->initialize();
|
|
|
|
return $this->etag;
|
|
}
|
|
|
|
public function getExpiration(): ?string
|
|
{
|
|
$this->initialize();
|
|
|
|
return $this->expiration;
|
|
}
|
|
|
|
/**
|
|
* @return RequestCharged::*|null
|
|
*/
|
|
public function getRequestCharged(): ?string
|
|
{
|
|
$this->initialize();
|
|
|
|
return $this->requestCharged;
|
|
}
|
|
|
|
/**
|
|
* @return ServerSideEncryption::*|null
|
|
*/
|
|
public function getServerSideEncryption(): ?string
|
|
{
|
|
$this->initialize();
|
|
|
|
return $this->serverSideEncryption;
|
|
}
|
|
|
|
public function getSseCustomerAlgorithm(): ?string
|
|
{
|
|
$this->initialize();
|
|
|
|
return $this->sseCustomerAlgorithm;
|
|
}
|
|
|
|
public function getSseCustomerKeyMd5(): ?string
|
|
{
|
|
$this->initialize();
|
|
|
|
return $this->sseCustomerKeyMd5;
|
|
}
|
|
|
|
public function getSseKmsEncryptionContext(): ?string
|
|
{
|
|
$this->initialize();
|
|
|
|
return $this->sseKmsEncryptionContext;
|
|
}
|
|
|
|
public function getSseKmsKeyId(): ?string
|
|
{
|
|
$this->initialize();
|
|
|
|
return $this->sseKmsKeyId;
|
|
}
|
|
|
|
public function getVersionId(): ?string
|
|
{
|
|
$this->initialize();
|
|
|
|
return $this->versionId;
|
|
}
|
|
|
|
protected function populateResult(Response $response): void
|
|
{
|
|
$headers = $response->getHeaders();
|
|
|
|
$this->expiration = $headers['x-amz-expiration'][0] ?? null;
|
|
$this->etag = $headers['etag'][0] ?? null;
|
|
$this->checksumCrc32 = $headers['x-amz-checksum-crc32'][0] ?? null;
|
|
$this->checksumCrc32C = $headers['x-amz-checksum-crc32c'][0] ?? null;
|
|
$this->checksumSha1 = $headers['x-amz-checksum-sha1'][0] ?? null;
|
|
$this->checksumSha256 = $headers['x-amz-checksum-sha256'][0] ?? null;
|
|
$this->serverSideEncryption = $headers['x-amz-server-side-encryption'][0] ?? null;
|
|
$this->versionId = $headers['x-amz-version-id'][0] ?? null;
|
|
$this->sseCustomerAlgorithm = $headers['x-amz-server-side-encryption-customer-algorithm'][0] ?? null;
|
|
$this->sseCustomerKeyMd5 = $headers['x-amz-server-side-encryption-customer-key-md5'][0] ?? null;
|
|
$this->sseKmsKeyId = $headers['x-amz-server-side-encryption-aws-kms-key-id'][0] ?? null;
|
|
$this->sseKmsEncryptionContext = $headers['x-amz-server-side-encryption-context'][0] ?? null;
|
|
$this->bucketKeyEnabled = isset($headers['x-amz-server-side-encryption-bucket-key-enabled'][0]) ? filter_var($headers['x-amz-server-side-encryption-bucket-key-enabled'][0], \FILTER_VALIDATE_BOOLEAN) : null;
|
|
$this->requestCharged = $headers['x-amz-request-charged'][0] ?? null;
|
|
}
|
|
}
|