Skip to content

Commit e3b6c96

Browse files
committed
Generate the property type for generated objects
1 parent 77ebc34 commit e3b6c96

File tree

876 files changed

+7038
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

876 files changed

+7038
-1
lines changed

src/CodeGenerator/src/Generator/CodeGenerator/PopulatorGenerator.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ private function generateProperties(StructureShape $shape, ClassBuilder $classBu
133133
$nullable = false;
134134
} elseif ($member->isStreaming()) {
135135
$returnType = ResultStream::class;
136-
$parameterType = ResultStream::class;
136+
$parameterType = 'ResultStream';
137137
$memberClassNames = [];
138+
$classBuilder->addUse(ResultStream::class);
138139
$nullable = false;
139140
}
140141

@@ -161,6 +162,9 @@ private function generateProperties(StructureShape $shape, ClassBuilder $classBu
161162
$method->addComment('@return ' . $parameterType . ($nullable ? '|null' : ''));
162163
}
163164
$method->setReturnNullable($nullable);
165+
if ($parameterType) {
166+
$property->addComment('@var ' . $parameterType . ($nullable ? '|null' : ''));
167+
}
164168
}
165169

166170
if ($forEndpoint) {

src/CodeGenerator/src/Generator/ObjectGenerator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ private function addProperties(StructureShape $shape, ClassBuilder $classBuilder
310310
$method->addComment('@return ' . $parameterType . ($nullable ? '|null' : ''));
311311
}
312312
$method->setReturnNullable($nullable);
313+
if ($parameterType) {
314+
$property->addComment('@var ' . $parameterType . ($nullable ? '|null' : ''));
315+
}
313316
}
314317

315318
foreach ($forEndpointProps as $key => $ok) {

src/Core/src/Sts/Result/AssumeRoleResponse.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class AssumeRoleResponse extends Result
1919
*
2020
* > The size of the security token that STS API operations return is not fixed. We strongly recommend that you make no
2121
* > assumptions about the maximum size.
22+
*
23+
* @var Credentials|null
2224
*/
2325
private $credentials;
2426

@@ -27,13 +29,17 @@ class AssumeRoleResponse extends Result
2729
* resulting temporary security credentials. For example, you can reference these credentials as a principal in a
2830
* resource-based policy by using the ARN or assumed role ID. The ARN and ID include the `RoleSessionName` that you
2931
* specified when you called `AssumeRole`.
32+
*
33+
* @var AssumedRoleUser|null
3034
*/
3135
private $assumedRoleUser;
3236

3337
/**
3438
* A percentage value that indicates the packed size of the session policies and session tags combined passed in the
3539
* request. The request fails if the packed size is greater than 100 percent, which means the policies and tags exceeded
3640
* the allowed space.
41+
*
42+
* @var int|null
3743
*/
3844
private $packedPolicySize;
3945

@@ -50,6 +56,8 @@ class AssumeRoleResponse extends Result
5056
* characters with no spaces. You can also include underscores or any of the following characters: =,.@-
5157
*
5258
* [^1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html
59+
*
60+
* @var string|null
5361
*/
5462
private $sourceIdentity;
5563

src/Core/src/Sts/Result/AssumeRoleWithWebIdentityResponse.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class AssumeRoleWithWebIdentityResponse extends Result
1818
*
1919
* > The size of the security token that STS API operations return is not fixed. We strongly recommend that you make no
2020
* > assumptions about the maximum size.
21+
*
22+
* @var Credentials|null
2123
*/
2224
private $credentials;
2325

@@ -26,6 +28,8 @@ class AssumeRoleWithWebIdentityResponse extends Result
2628
* `WebIdentityToken` that was submitted with the `AssumeRoleWithWebIdentity` call. The identifier is typically unique
2729
* to the user and the application that acquired the `WebIdentityToken` (pairwise identifier). For OpenID Connect ID
2830
* tokens, this field contains the value returned by the identity provider as the token's `sub` (Subject) claim.
31+
*
32+
* @var string|null
2933
*/
3034
private $subjectFromWebIdentityToken;
3135

@@ -34,26 +38,34 @@ class AssumeRoleWithWebIdentityResponse extends Result
3438
* resulting temporary security credentials. For example, you can reference these credentials as a principal in a
3539
* resource-based policy by using the ARN or assumed role ID. The ARN and ID include the `RoleSessionName` that you
3640
* specified when you called `AssumeRole`.
41+
*
42+
* @var AssumedRoleUser|null
3743
*/
3844
private $assumedRoleUser;
3945

4046
/**
4147
* A percentage value that indicates the packed size of the session policies and session tags combined passed in the
4248
* request. The request fails if the packed size is greater than 100 percent, which means the policies and tags exceeded
4349
* the allowed space.
50+
*
51+
* @var int|null
4452
*/
4553
private $packedPolicySize;
4654

4755
/**
4856
* The issuing authority of the web identity token presented. For OpenID Connect ID tokens, this contains the value of
4957
* the `iss` field. For OAuth 2.0 access tokens, this contains the value of the `ProviderId` parameter that was passed
5058
* in the `AssumeRoleWithWebIdentity` request.
59+
*
60+
* @var string|null
5161
*/
5262
private $provider;
5363

5464
/**
5565
* The intended audience (also known as client ID) of the web identity token. This is traditionally the client
5666
* identifier issued to the application that requested the web identity token.
67+
*
68+
* @var string|null
5769
*/
5870
private $audience;
5971

@@ -76,6 +88,8 @@ class AssumeRoleWithWebIdentityResponse extends Result
7688
* [^1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining
7789
* [^2]: https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html
7890
* [^3]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html
91+
*
92+
* @var string|null
7993
*/
8094
private $sourceIdentity;
8195

src/Core/src/Sts/Result/GetCallerIdentityResponse.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,22 @@ class GetCallerIdentityResponse extends Result
1717
* Variables** reference page in the *IAM User Guide*.
1818
*
1919
* [^1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable
20+
*
21+
* @var string|null
2022
*/
2123
private $userId;
2224

2325
/**
2426
* The Amazon Web Services account ID number of the account that owns or contains the calling entity.
27+
*
28+
* @var string|null
2529
*/
2630
private $account;
2731

2832
/**
2933
* The Amazon Web Services ARN associated with the calling entity.
34+
*
35+
* @var string|null
3036
*/
3137
private $arn;
3238

src/Core/src/Sts/ValueObject/AssumedRoleUser.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ final class AssumedRoleUser
1010
/**
1111
* A unique identifier that contains the role ID and the role session name of the role that is being assumed. The role
1212
* ID is generated by Amazon Web Services when the role is created.
13+
*
14+
* @var string
1315
*/
1416
private $assumedRoleId;
1517

@@ -18,6 +20,8 @@ final class AssumedRoleUser
1820
* about ARNs and how to use them in policies, see IAM Identifiers [^1] in the *IAM User Guide*.
1921
*
2022
* [^1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html
23+
*
24+
* @var string
2125
*/
2226
private $arn;
2327

src/Core/src/Sts/ValueObject/Credentials.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,29 @@ final class Credentials
99
{
1010
/**
1111
* The access key ID that identifies the temporary security credentials.
12+
*
13+
* @var string
1214
*/
1315
private $accessKeyId;
1416

1517
/**
1618
* The secret access key that can be used to sign requests.
19+
*
20+
* @var string
1721
*/
1822
private $secretAccessKey;
1923

2024
/**
2125
* The token that users must pass to the service API to use the temporary credentials.
26+
*
27+
* @var string
2228
*/
2329
private $sessionToken;
2430

2531
/**
2632
* The date on which the current credentials expire.
33+
*
34+
* @var \DateTimeImmutable
2735
*/
2836
private $expiration;
2937

src/Core/src/Sts/ValueObject/PolicyDescriptorType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ final class PolicyDescriptorType
1414
* *Amazon Web Services General Reference*.
1515
*
1616
* [^1]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
17+
*
18+
* @var string|null
1719
*/
1820
private $arn;
1921

src/Core/src/Sts/ValueObject/Tag.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ final class Tag
2020
* additional limits, see IAM and STS Character Limits [^1] in the *IAM User Guide*.
2121
*
2222
* [^1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
23+
*
24+
* @var string
2325
*/
2426
private $key;
2527

@@ -30,6 +32,8 @@ final class Tag
3032
* additional limits, see IAM and STS Character Limits [^1] in the *IAM User Guide*.
3133
*
3234
* [^1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
35+
*
36+
* @var string
3337
*/
3438
private $value;
3539

src/Service/AppSync/src/Exception/BadRequestException.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@
1515
*/
1616
final class BadRequestException extends ClientException
1717
{
18+
/**
19+
* @var BadRequestReason::*|null
20+
*/
1821
private $reason;
1922

23+
/**
24+
* @var BadRequestDetail|null
25+
*/
2026
private $detail;
2127

2228
public function getDetail(): ?BadRequestDetail

0 commit comments

Comments
 (0)