Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"variables": {
"${LATEST}": "3.342.19"
"${LATEST}": "3.342.20"
},
"endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json",
"services": {
Expand Down
4 changes: 4 additions & 0 deletions src/Service/AppSync/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NOT RELEASED

### Added

- AWS api-change: TODO

## 3.1.1

### Changed
Expand Down
2 changes: 1 addition & 1 deletion src/Service/AppSync/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "3.1-dev"
"dev-master": "3.2-dev"
}
}
}
42 changes: 36 additions & 6 deletions src/Service/AppSync/src/AppSyncClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
use AsyncAws\Core\AwsError\AwsErrorFactoryInterface;
use AsyncAws\Core\AwsError\JsonRestAwsErrorFactory;
use AsyncAws\Core\Configuration;
use AsyncAws\Core\Exception\UnsupportedRegion;
use AsyncAws\Core\RequestContext;

class AppSyncClient extends AbstractApi
Expand Down Expand Up @@ -395,6 +396,40 @@ protected function getEndpointMetadata(?string $region): array
}

switch ($region) {
case 'af-south-1':
case 'ap-east-1':
case 'ap-northeast-1':
case 'ap-northeast-2':
case 'ap-northeast-3':
case 'ap-south-1':
case 'ap-south-2':
case 'ap-southeast-1':
case 'ap-southeast-2':
case 'ap-southeast-3':
case 'ap-southeast-4':
case 'ca-central-1':
case 'eu-central-1':
case 'eu-central-2':
case 'eu-north-1':
case 'eu-south-1':
case 'eu-south-2':
case 'eu-west-1':
case 'eu-west-2':
case 'eu-west-3':
case 'il-central-1':
case 'me-central-1':
case 'me-south-1':
case 'sa-east-1':
case 'us-east-1':
case 'us-east-2':
case 'us-west-1':
case 'us-west-2':
return [
'endpoint' => "https://appsync.$region.amazonaws.com",
'signRegion' => $region,
'signService' => 'appsync',
'signVersions' => ['v4'],
];
case 'cn-north-1':
case 'cn-northwest-1':
return [
Expand All @@ -405,11 +440,6 @@ protected function getEndpointMetadata(?string $region): array
];
}

return [
'endpoint' => "https://appsync.$region.amazonaws.com",
'signRegion' => $region,
'signService' => 'appsync',
'signVersions' => ['v4'],
];
throw new UnsupportedRegion(\sprintf('The region "%s" is not supported by "AppSync".', $region));
}
}
4 changes: 4 additions & 0 deletions src/Service/Route53/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NOT RELEASED

### Added

- AWS api-change: Added us-gov-east-1 and us-gov-west-1 as valid Latency Based Routing regions for change-resource-record-sets.

## 2.8.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/Service/Route53/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
"dev-master": "2.9-dev"
}
}
}
4 changes: 4 additions & 0 deletions src/Service/Route53/src/Enum/ResourceRecordSetRegion.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ final class ResourceRecordSetRegion
public const SA_EAST_1 = 'sa-east-1';
public const US_EAST_1 = 'us-east-1';
public const US_EAST_2 = 'us-east-2';
public const US_GOV_EAST_1 = 'us-gov-east-1';
public const US_GOV_WEST_1 = 'us-gov-west-1';
public const US_WEST_1 = 'us-west-1';
public const US_WEST_2 = 'us-west-2';

Expand Down Expand Up @@ -74,6 +76,8 @@ public static function exists(string $value): bool
self::SA_EAST_1 => true,
self::US_EAST_1 => true,
self::US_EAST_2 => true,
self::US_GOV_EAST_1 => true,
self::US_GOV_WEST_1 => true,
self::US_WEST_1 => true,
self::US_WEST_2 => true,
][$value]);
Expand Down
4 changes: 4 additions & 0 deletions src/Service/Ses/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NOT RELEASED

### Added

- AWS api-change: This release enables customers to provide attachments in the SESv2 SendEmail and SendBulkEmail APIs.

## 1.11.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/Service/Ses/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.11-dev"
"dev-master": "1.12-dev"
}
}
}
17 changes: 17 additions & 0 deletions src/Service/Ses/src/Enum/AttachmentContentDisposition.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace AsyncAws\Ses\Enum;

final class AttachmentContentDisposition
{
public const ATTACHMENT = 'ATTACHMENT';
public const INLINE = 'INLINE';

public static function exists(string $value): bool
{
return isset([
self::ATTACHMENT => true,
self::INLINE => true,
][$value]);
}
}
19 changes: 19 additions & 0 deletions src/Service/Ses/src/Enum/AttachmentContentTransferEncoding.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace AsyncAws\Ses\Enum;

final class AttachmentContentTransferEncoding
{
public const BASE64 = 'BASE64';
public const QUOTED_PRINTABLE = 'QUOTED_PRINTABLE';
public const SEVEN_BIT = 'SEVEN_BIT';

public static function exists(string $value): bool
{
return isset([
self::BASE64 => true,
self::QUOTED_PRINTABLE => true,
self::SEVEN_BIT => true,
][$value]);
}
}
192 changes: 192 additions & 0 deletions src/Service/Ses/src/ValueObject/Attachment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
<?php

namespace AsyncAws\Ses\ValueObject;

use AsyncAws\Core\Exception\InvalidArgument;
use AsyncAws\Ses\Enum\AttachmentContentDisposition;
use AsyncAws\Ses\Enum\AttachmentContentTransferEncoding;

/**
* Contains metadata and attachment raw content.
*/
final class Attachment
{
/**
* The raw data of the attachment. It needs to be base64-encoded if you are accessing Amazon SES directly through the
* HTTPS interface. If you are accessing Amazon SES using an Amazon Web Services SDK, the SDK takes care of the base
* 64-encoding for you.
*
* @var string
*/
private $rawContent;

/**
* A standard descriptor indicating how the attachment should be rendered in the email. Supported values: `ATTACHMENT`
* or `INLINE`.
*
* @var AttachmentContentDisposition::*|null
*/
private $contentDisposition;

/**
* The file name for the attachment as it will appear in the email. Amazon SES restricts certain file extensions. To
* ensure attachments are accepted, check the Unsupported attachment types [^1] in the Amazon SES Developer Guide.
*
* [^1]: https://docs.aws.amazon.com/ses/latest/dg/mime-types.html
*
* @var string
*/
private $fileName;

/**
* A brief description of the attachment content.
*
* @var string|null
*/
private $contentDescription;

/**
* Unique identifier for the attachment, used for referencing attachments with INLINE disposition in HTML content.
*
* @var string|null
*/
private $contentId;

/**
* Specifies how the attachment is encoded. Supported values: `BASE64`, `QUOTED_PRINTABLE`, `SEVEN_BIT`.
*
* @var AttachmentContentTransferEncoding::*|null
*/
private $contentTransferEncoding;

/**
* The MIME type of the attachment.
*
* > Example: `application/pdf`, `image/jpeg`
*
* @var string|null
*/
private $contentType;

/**
* @param array{
* RawContent: string,
* ContentDisposition?: null|AttachmentContentDisposition::*,
* FileName: string,
* ContentDescription?: null|string,
* ContentId?: null|string,
* ContentTransferEncoding?: null|AttachmentContentTransferEncoding::*,
* ContentType?: null|string,
* } $input
*/
public function __construct(array $input)
{
$this->rawContent = $input['RawContent'] ?? $this->throwException(new InvalidArgument('Missing required field "RawContent".'));
$this->contentDisposition = $input['ContentDisposition'] ?? null;
$this->fileName = $input['FileName'] ?? $this->throwException(new InvalidArgument('Missing required field "FileName".'));
$this->contentDescription = $input['ContentDescription'] ?? null;
$this->contentId = $input['ContentId'] ?? null;
$this->contentTransferEncoding = $input['ContentTransferEncoding'] ?? null;
$this->contentType = $input['ContentType'] ?? null;
}

/**
* @param array{
* RawContent: string,
* ContentDisposition?: null|AttachmentContentDisposition::*,
* FileName: string,
* ContentDescription?: null|string,
* ContentId?: null|string,
* ContentTransferEncoding?: null|AttachmentContentTransferEncoding::*,
* ContentType?: null|string,
* }|Attachment $input
*/
public static function create($input): self
{
return $input instanceof self ? $input : new self($input);
}

public function getContentDescription(): ?string
{
return $this->contentDescription;
}

/**
* @return AttachmentContentDisposition::*|null
*/
public function getContentDisposition(): ?string
{
return $this->contentDisposition;
}

public function getContentId(): ?string
{
return $this->contentId;
}

/**
* @return AttachmentContentTransferEncoding::*|null
*/
public function getContentTransferEncoding(): ?string
{
return $this->contentTransferEncoding;
}

public function getContentType(): ?string
{
return $this->contentType;
}

public function getFileName(): string
{
return $this->fileName;
}

public function getRawContent(): string
{
return $this->rawContent;
}

/**
* @internal
*/
public function requestBody(): array
{
$payload = [];
$v = $this->rawContent;
$payload['RawContent'] = base64_encode($v);
if (null !== $v = $this->contentDisposition) {
if (!AttachmentContentDisposition::exists($v)) {
throw new InvalidArgument(\sprintf('Invalid parameter "ContentDisposition" for "%s". The value "%s" is not a valid "AttachmentContentDisposition".', __CLASS__, $v));
}
$payload['ContentDisposition'] = $v;
}
$v = $this->fileName;
$payload['FileName'] = $v;
if (null !== $v = $this->contentDescription) {
$payload['ContentDescription'] = $v;
}
if (null !== $v = $this->contentId) {
$payload['ContentId'] = $v;
}
if (null !== $v = $this->contentTransferEncoding) {
if (!AttachmentContentTransferEncoding::exists($v)) {
throw new InvalidArgument(\sprintf('Invalid parameter "ContentTransferEncoding" for "%s". The value "%s" is not a valid "AttachmentContentTransferEncoding".', __CLASS__, $v));
}
$payload['ContentTransferEncoding'] = $v;
}
if (null !== $v = $this->contentType) {
$payload['ContentType'] = $v;
}

return $payload;
}

/**
* @return never
*/
private function throwException(\Throwable $exception)
{
throw $exception;
}
}
10 changes: 5 additions & 5 deletions src/Service/Ses/src/ValueObject/EmailContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
namespace AsyncAws\Ses\ValueObject;

/**
* An object that defines the entire content of the email, including the message headers and the body content. You can
* create a simple email message, in which you specify the subject and the text and HTML versions of the message body.
* You can also create raw messages, in which you specify a complete MIME-formatted message. Raw messages can include
* attachments and custom headers.
* An object that defines the entire content of the email, including the message headers, body content, and attachments.
* For a simple email message, you specify the subject and provide both text and HTML versions of the message body. You
* can also add attachments to simple and templated messages. For a raw message, you provide a complete MIME-formatted
* message, which can include custom headers and attachments.
*/
final class EmailContent
{
/**
* The simple email message. The message consists of a subject and a message body.
* The simple email message. The message consists of a subject, message body and attachments list.
*
* @var Message|null
*/
Expand Down
Loading
Loading