Skip to content

Commit

Permalink
Set DTO classes Final (async-aws#467)
Browse files Browse the repository at this point in the history
* Make DTO objects final

* Regenerate code

* Add entry in changelogs
  • Loading branch information
jderusse authored Apr 4, 2020
1 parent 8cf2c45 commit 8ed632c
Show file tree
Hide file tree
Showing 179 changed files with 179 additions and 169 deletions.
1 change: 1 addition & 0 deletions src/CodeGenerator/src/Generator/EnumGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public function generate(Shape $shape): ClassName

$namespace = new PhpNamespace($className->getNamespace());
$class = $namespace->addClass($className->getName());
$class->setFinal();

$consts = [];
foreach ($shape->getEnum() as $value) {
Expand Down
1 change: 1 addition & 0 deletions src/CodeGenerator/src/Generator/InputGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public function generate(Operation $operation): ClassName

$namespace = new PhpNamespace($className->getNamespace());
$class = $namespace->addClass($className->getName());
$class->setFinal();

$constructorBody = '';

Expand Down
1 change: 1 addition & 0 deletions src/CodeGenerator/src/Generator/ObjectGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public function generate(StructureShape $shape): ClassName

$namespace = new PhpNamespace($className->getNamespace());
$class = $namespace->addClass($className->getName());
$class->setFinal();

// Named constructor
$this->namedConstructor($shape, $class);
Expand Down
1 change: 1 addition & 0 deletions src/Core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Changed

- The `StreamableBodyInterface::getChunks` now returns a iterrable of string.
- The `AsyncAws\Core\Sts\Input\*` and `AsyncAws\Core\Sts\ValueObject*` classes are marked final.

## 0.4.0

Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Sts/Input/AssumeRoleRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use AsyncAws\Core\Sts\ValueObject\PolicyDescriptorType;
use AsyncAws\Core\Sts\ValueObject\Tag;

class AssumeRoleRequest implements Input
final class AssumeRoleRequest implements Input
{
/**
* The Amazon Resource Name (ARN) of the role to assume.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use AsyncAws\Core\Stream\StreamFactory;
use AsyncAws\Core\Sts\ValueObject\PolicyDescriptorType;

class AssumeRoleWithWebIdentityRequest implements Input
final class AssumeRoleWithWebIdentityRequest implements Input
{
/**
* The Amazon Resource Name (ARN) of the role that the caller is assuming.
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Sts/Input/GetCallerIdentityRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use AsyncAws\Core\Request;
use AsyncAws\Core\Stream\StreamFactory;

class GetCallerIdentityRequest implements Input
final class GetCallerIdentityRequest implements Input
{
public static function create($input): self
{
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Sts/ValueObject/AssumedRoleUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\Core\Sts\ValueObject;

class AssumedRoleUser
final class AssumedRoleUser
{
/**
* A unique identifier that contains the role ID and the role session name of the role that is being assumed. The role
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Sts/ValueObject/Credentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\Core\Sts\ValueObject;

class Credentials
final class Credentials
{
/**
* The access key ID that identifies the temporary security credentials.
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Sts/ValueObject/PolicyDescriptorType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\Core\Sts\ValueObject;

class PolicyDescriptorType
final class PolicyDescriptorType
{
/**
* The Amazon Resource Name (ARN) of the IAM managed policy to use as a session policy for the role. For more
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Sts/ValueObject/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use AsyncAws\Core\Exception\InvalidArgument;

class Tag
final class Tag
{
/**
* The key for a session tag.
Expand Down
1 change: 1 addition & 0 deletions src/Service/CloudFormation/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Moved value objects to a dedicated namespace.
- Results' `populateResult()` has only one argument. It takes a `AsyncAws\Core\Response`.
- Using `DateTimeImmutable` instead of `DateTimeInterface`
- The `AsyncAws\CloudFormation\Enum\*`, `AsyncAws\CloudFormation\Input\*` and `AsyncAws\CloudFormation\ValueObject*` classes are marked final.

### Removed

Expand Down
2 changes: 1 addition & 1 deletion src/Service/CloudFormation/src/Enum/Capability.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\CloudFormation\Enum;

class Capability
final class Capability
{
public const CAPABILITY_AUTO_EXPAND = 'CAPABILITY_AUTO_EXPAND';
public const CAPABILITY_IAM = 'CAPABILITY_IAM';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/CloudFormation/src/Enum/ResourceStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\CloudFormation\Enum;

class ResourceStatus
final class ResourceStatus
{
public const CREATE_COMPLETE = 'CREATE_COMPLETE';
public const CREATE_FAILED = 'CREATE_FAILED';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/CloudFormation/src/Enum/StackDriftStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\CloudFormation\Enum;

class StackDriftStatus
final class StackDriftStatus
{
public const DRIFTED = 'DRIFTED';
public const IN_SYNC = 'IN_SYNC';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/CloudFormation/src/Enum/StackStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\CloudFormation\Enum;

class StackStatus
final class StackStatus
{
public const CREATE_COMPLETE = 'CREATE_COMPLETE';
public const CREATE_FAILED = 'CREATE_FAILED';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use AsyncAws\Core\Request;
use AsyncAws\Core\Stream\StreamFactory;

class DescribeStackEventsInput implements Input
final class DescribeStackEventsInput implements Input
{
/**
* The name or the unique stack ID that is associated with the stack, which are not always interchangeable:.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use AsyncAws\Core\Request;
use AsyncAws\Core\Stream\StreamFactory;

class DescribeStacksInput implements Input
final class DescribeStacksInput implements Input
{
/**
* The name or the unique stack ID that is associated with the stack, which are not always interchangeable:.
Expand Down
2 changes: 1 addition & 1 deletion src/Service/CloudFormation/src/ValueObject/Output.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\CloudFormation\ValueObject;

class Output
final class Output
{
/**
* The key associated with the output.
Expand Down
2 changes: 1 addition & 1 deletion src/Service/CloudFormation/src/ValueObject/Parameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\CloudFormation\ValueObject;

class Parameter
final class Parameter
{
/**
* The key associated with the parameter. If you don't specify a key and value for a particular parameter, AWS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\CloudFormation\ValueObject;

class RollbackConfiguration
final class RollbackConfiguration
{
/**
* The triggers to monitor during stack creation or update actions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\CloudFormation\ValueObject;

class RollbackTrigger
final class RollbackTrigger
{
/**
* The Amazon Resource Name (ARN) of the rollback trigger.
Expand Down
2 changes: 1 addition & 1 deletion src/Service/CloudFormation/src/ValueObject/Stack.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use AsyncAws\CloudFormation\Enum\Capability;
use AsyncAws\CloudFormation\Enum\StackStatus;

class Stack
final class Stack
{
/**
* Unique identifier of the stack.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use AsyncAws\CloudFormation\Enum\StackDriftStatus;

class StackDriftInformation
final class StackDriftInformation
{
/**
* Status of the stack's actual configuration compared to its expected template configuration.
Expand Down
2 changes: 1 addition & 1 deletion src/Service/CloudFormation/src/ValueObject/StackEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use AsyncAws\CloudFormation\Enum\ResourceStatus;

class StackEvent
final class StackEvent
{
/**
* The unique ID name of the instance of the stack.
Expand Down
2 changes: 1 addition & 1 deletion src/Service/CloudFormation/src/ValueObject/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\CloudFormation\ValueObject;

class Tag
final class Tag
{
/**
* *Required*. A string used to identify this tag. You can specify a maximum of 128 characters for a tag key. Tags owned
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Enum/AttributeAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class AttributeAction
final class AttributeAction
{
public const ADD = 'ADD';
public const DELETE = 'DELETE';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Enum/BillingMode.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class BillingMode
final class BillingMode
{
public const PAY_PER_REQUEST = 'PAY_PER_REQUEST';
public const PROVISIONED = 'PROVISIONED';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Enum/ComparisonOperator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class ComparisonOperator
final class ComparisonOperator
{
public const BEGINS_WITH = 'BEGINS_WITH';
public const BETWEEN = 'BETWEEN';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Enum/ConditionalOperator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class ConditionalOperator
final class ConditionalOperator
{
public const AND = 'AND';
public const OR = 'OR';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Enum/IndexStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class IndexStatus
final class IndexStatus
{
public const ACTIVE = 'ACTIVE';
public const CREATING = 'CREATING';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Enum/KeyType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class KeyType
final class KeyType
{
public const HASH = 'HASH';
public const RANGE = 'RANGE';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Enum/ProjectionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class ProjectionType
final class ProjectionType
{
public const ALL = 'ALL';
public const INCLUDE = 'INCLUDE';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Enum/ReplicaStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class ReplicaStatus
final class ReplicaStatus
{
public const ACTIVE = 'ACTIVE';
public const CREATING = 'CREATING';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Enum/ReturnConsumedCapacity.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class ReturnConsumedCapacity
final class ReturnConsumedCapacity
{
public const INDEXES = 'INDEXES';
public const NONE = 'NONE';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class ReturnItemCollectionMetrics
final class ReturnItemCollectionMetrics
{
public const NONE = 'NONE';
public const SIZE = 'SIZE';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Enum/ReturnValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class ReturnValue
final class ReturnValue
{
public const ALL_NEW = 'ALL_NEW';
public const ALL_OLD = 'ALL_OLD';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Enum/SSEStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class SSEStatus
final class SSEStatus
{
public const DISABLED = 'DISABLED';
public const DISABLING = 'DISABLING';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Enum/SSEType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class SSEType
final class SSEType
{
public const AES256 = 'AES256';
public const KMS = 'KMS';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Enum/ScalarAttributeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class ScalarAttributeType
final class ScalarAttributeType
{
public const B = 'B';
public const N = 'N';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Enum/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class Select
final class Select
{
public const ALL_ATTRIBUTES = 'ALL_ATTRIBUTES';
public const ALL_PROJECTED_ATTRIBUTES = 'ALL_PROJECTED_ATTRIBUTES';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Enum/StreamViewType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class StreamViewType
final class StreamViewType
{
public const KEYS_ONLY = 'KEYS_ONLY';
public const NEW_AND_OLD_IMAGES = 'NEW_AND_OLD_IMAGES';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Enum/TableStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AsyncAws\DynamoDb\Enum;

class TableStatus
final class TableStatus
{
public const ACTIVE = 'ACTIVE';
public const ARCHIVED = 'ARCHIVED';
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Input/CreateTableInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use AsyncAws\DynamoDb\ValueObject\StreamSpecification;
use AsyncAws\DynamoDb\ValueObject\Tag;

class CreateTableInput implements Input
final class CreateTableInput implements Input
{
/**
* An array of attributes that describe the key schema for the table and indexes.
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/src/Input/DeleteItemInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use AsyncAws\DynamoDb\ValueObject\AttributeValue;
use AsyncAws\DynamoDb\ValueObject\ExpectedAttributeValue;

class DeleteItemInput implements Input
final class DeleteItemInput implements Input
{
/**
* The name of the table from which to delete the item.
Expand Down
Loading

0 comments on commit 8ed632c

Please sign in to comment.