Skip to content

Commit

Permalink
Update generated code (#833)
Browse files Browse the repository at this point in the history
* update generated code

* Update src/Service/Ses/CHANGELOG.md

Co-authored-by: Tobias Nyholm <[email protected]>
  • Loading branch information
async-aws-bot and Nyholm authored Oct 30, 2020
1 parent 3c28616 commit 03c457e
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NOT RELEASED

### Added

- Enables customers to manage their own contact lists and end-user subscription preferences

## 1.2.0

### Added
Expand Down
26 changes: 26 additions & 0 deletions src/Input/SendEmailRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use AsyncAws\Ses\ValueObject\Content;
use AsyncAws\Ses\ValueObject\Destination;
use AsyncAws\Ses\ValueObject\EmailContent;
use AsyncAws\Ses\ValueObject\ListManagementOptions;
use AsyncAws\Ses\ValueObject\Message;
use AsyncAws\Ses\ValueObject\MessageTag;
use AsyncAws\Ses\ValueObject\Template;
Expand Down Expand Up @@ -88,6 +89,14 @@ final class SendEmailRequest extends Input
*/
private $ConfigurationSetName;

/**
* An object used to specify a list or topic to which an email belongs, which will be used when a contact chooses to
* unsubscribe.
*
* @var ListManagementOptions|null
*/
private $ListManagementOptions;

/**
* @param array{
* FromEmailAddress?: string,
Expand All @@ -99,6 +108,7 @@ final class SendEmailRequest extends Input
* Content?: EmailContent|array,
* EmailTags?: MessageTag[],
* ConfigurationSetName?: string,
* ListManagementOptions?: ListManagementOptions|array,
* @region?: string,
* } $input
*/
Expand All @@ -113,6 +123,7 @@ public function __construct(array $input = [])
$this->Content = isset($input['Content']) ? EmailContent::create($input['Content']) : null;
$this->EmailTags = isset($input['EmailTags']) ? array_map([MessageTag::class, 'create'], $input['EmailTags']) : null;
$this->ConfigurationSetName = $input['ConfigurationSetName'] ?? null;
$this->ListManagementOptions = isset($input['ListManagementOptions']) ? ListManagementOptions::create($input['ListManagementOptions']) : null;
parent::__construct($input);
}

Expand Down Expand Up @@ -164,6 +175,11 @@ public function getFromEmailAddressIdentityArn(): ?string
return $this->FromEmailAddressIdentityArn;
}

public function getListManagementOptions(): ?ListManagementOptions
{
return $this->ListManagementOptions;
}

/**
* @return string[]
*/
Expand Down Expand Up @@ -253,6 +269,13 @@ public function setFromEmailAddressIdentityArn(?string $value): self
return $this;
}

public function setListManagementOptions(?ListManagementOptions $value): self
{
$this->ListManagementOptions = $value;

return $this;
}

/**
* @param string[] $value
*/
Expand Down Expand Up @@ -304,6 +327,9 @@ private function requestBody(): array
if (null !== $v = $this->ConfigurationSetName) {
$payload['ConfigurationSetName'] = $v;
}
if (null !== $v = $this->ListManagementOptions) {
$payload['ListManagementOptions'] = $v->requestBody();
}

return $payload;
}
Expand Down
2 changes: 2 additions & 0 deletions src/SesClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use AsyncAws\Ses\Result\SendEmailResponse;
use AsyncAws\Ses\ValueObject\Destination;
use AsyncAws\Ses\ValueObject\EmailContent;
use AsyncAws\Ses\ValueObject\ListManagementOptions;
use AsyncAws\Ses\ValueObject\MessageTag;

class SesClient extends AbstractApi
Expand All @@ -30,6 +31,7 @@ class SesClient extends AbstractApi
* Content: EmailContent|array,
* EmailTags?: MessageTag[],
* ConfigurationSetName?: string,
* ListManagementOptions?: ListManagementOptions|array,
* @region?: string,
* }|SendEmailRequest $input
*/
Expand Down
62 changes: 62 additions & 0 deletions src/ValueObject/ListManagementOptions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php

namespace AsyncAws\Ses\ValueObject;

use AsyncAws\Core\Exception\InvalidArgument;

final class ListManagementOptions
{
/**
* The name of the contact list.
*/
private $ContactListName;

/**
* The name of the topic.
*/
private $TopicName;

/**
* @param array{
* ContactListName: string,
* TopicName?: null|string,
* } $input
*/
public function __construct(array $input)
{
$this->ContactListName = $input['ContactListName'] ?? null;
$this->TopicName = $input['TopicName'] ?? null;
}

public static function create($input): self
{
return $input instanceof self ? $input : new self($input);
}

public function getContactListName(): string
{
return $this->ContactListName;
}

public function getTopicName(): ?string
{
return $this->TopicName;
}

/**
* @internal
*/
public function requestBody(): array
{
$payload = [];
if (null === $v = $this->ContactListName) {
throw new InvalidArgument(sprintf('Missing parameter "ContactListName" for "%s". The value cannot be null.', __CLASS__));
}
$payload['ContactListName'] = $v;
if (null !== $v = $this->TopicName) {
$payload['TopicName'] = $v;
}

return $payload;
}
}

0 comments on commit 03c457e

Please sign in to comment.