Skip to content

Commit 9127c0c

Browse files
Update generated code (#1527)
update generated code
1 parent 4c08d24 commit 9127c0c

File tree

5 files changed

+114
-1
lines changed

5 files changed

+114
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Support for LocationService
88
- Support for hostPrefix in requests
9+
- AWS api-change: API updates for the AWS Security Token Service
910

1011
## 1.19.0
1112

src/Sts/Input/AssumeRoleRequest.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use AsyncAws\Core\Request;
88
use AsyncAws\Core\Stream\StreamFactory;
99
use AsyncAws\Core\Sts\ValueObject\PolicyDescriptorType;
10+
use AsyncAws\Core\Sts\ValueObject\ProvidedContext;
1011
use AsyncAws\Core\Sts\ValueObject\Tag;
1112

1213
final class AssumeRoleRequest extends Input
@@ -228,6 +229,13 @@ final class AssumeRoleRequest extends Input
228229
*/
229230
private $sourceIdentity;
230231

232+
/**
233+
* Reserved for future use.
234+
*
235+
* @var ProvidedContext[]|null
236+
*/
237+
private $providedContexts;
238+
231239
/**
232240
* @param array{
233241
* RoleArn?: string,
@@ -241,6 +249,7 @@ final class AssumeRoleRequest extends Input
241249
* SerialNumber?: string,
242250
* TokenCode?: string,
243251
* SourceIdentity?: string,
252+
* ProvidedContexts?: array<ProvidedContext|array>,
244253
* '@region'?: string|null,
245254
* } $input
246255
*/
@@ -257,6 +266,7 @@ public function __construct(array $input = [])
257266
$this->serialNumber = $input['SerialNumber'] ?? null;
258267
$this->tokenCode = $input['TokenCode'] ?? null;
259268
$this->sourceIdentity = $input['SourceIdentity'] ?? null;
269+
$this->providedContexts = isset($input['ProvidedContexts']) ? array_map([ProvidedContext::class, 'create'], $input['ProvidedContexts']) : null;
260270
parent::__construct($input);
261271
}
262272

@@ -273,6 +283,7 @@ public function __construct(array $input = [])
273283
* SerialNumber?: string,
274284
* TokenCode?: string,
275285
* SourceIdentity?: string,
286+
* ProvidedContexts?: array<ProvidedContext|array>,
276287
* '@region'?: string|null,
277288
* }|AssumeRoleRequest $input
278289
*/
@@ -304,6 +315,14 @@ public function getPolicyArns(): array
304315
return $this->policyArns ?? [];
305316
}
306317

318+
/**
319+
* @return ProvidedContext[]
320+
*/
321+
public function getProvidedContexts(): array
322+
{
323+
return $this->providedContexts ?? [];
324+
}
325+
307326
public function getRoleArn(): ?string
308327
{
309328
return $this->roleArn;
@@ -397,6 +416,16 @@ public function setPolicyArns(array $value): self
397416
return $this;
398417
}
399418

419+
/**
420+
* @param ProvidedContext[] $value
421+
*/
422+
public function setProvidedContexts(array $value): self
423+
{
424+
$this->providedContexts = $value;
425+
426+
return $this;
427+
}
428+
400429
public function setRoleArn(?string $value): self
401430
{
402431
$this->roleArn = $value;
@@ -506,6 +535,15 @@ private function requestBody(): array
506535
if (null !== $v = $this->sourceIdentity) {
507536
$payload['SourceIdentity'] = $v;
508537
}
538+
if (null !== $v = $this->providedContexts) {
539+
$index = 0;
540+
foreach ($v as $mapValue) {
541+
++$index;
542+
foreach ($mapValue->requestBody() as $bodyKey => $bodyValue) {
543+
$payload["ProvidedContexts.member.$index.$bodyKey"] = $bodyValue;
544+
}
545+
}
546+
}
509547

510548
return $payload;
511549
}

src/Sts/Input/AssumeRoleWithWebIdentityRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class AssumeRoleWithWebIdentityRequest extends Input
3737
/**
3838
* The OAuth 2.0 access token or OpenID Connect ID token that is provided by the identity provider. Your application
3939
* must get this token by authenticating the user who is using your application with a web identity provider before the
40-
* application makes an `AssumeRoleWithWebIdentity` call.
40+
* application makes an `AssumeRoleWithWebIdentity` call. Only tokens with RSA algorithms (RS256) are supported.
4141
*
4242
* @required
4343
*

src/Sts/StsClient.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use AsyncAws\Core\Sts\Result\AssumeRoleWithWebIdentityResponse;
2121
use AsyncAws\Core\Sts\Result\GetCallerIdentityResponse;
2222
use AsyncAws\Core\Sts\ValueObject\PolicyDescriptorType;
23+
use AsyncAws\Core\Sts\ValueObject\ProvidedContext;
2324
use AsyncAws\Core\Sts\ValueObject\Tag;
2425

2526
class StsClient extends AbstractApi
@@ -121,6 +122,7 @@ class StsClient extends AbstractApi
121122
* SerialNumber?: string,
122123
* TokenCode?: string,
123124
* SourceIdentity?: string,
125+
* ProvidedContexts?: array<ProvidedContext|array>,
124126
* '@region'?: string|null,
125127
* }|AssumeRoleRequest $input
126128
*
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?php
2+
3+
namespace AsyncAws\Core\Sts\ValueObject;
4+
5+
/**
6+
* Reserved for future use.
7+
*/
8+
final class ProvidedContext
9+
{
10+
/**
11+
* Reserved for future use.
12+
*
13+
* @var string|null
14+
*/
15+
private $providerArn;
16+
17+
/**
18+
* Reserved for future use.
19+
*
20+
* @var string|null
21+
*/
22+
private $contextAssertion;
23+
24+
/**
25+
* @param array{
26+
* ProviderArn?: null|string,
27+
* ContextAssertion?: null|string,
28+
* } $input
29+
*/
30+
public function __construct(array $input)
31+
{
32+
$this->providerArn = $input['ProviderArn'] ?? null;
33+
$this->contextAssertion = $input['ContextAssertion'] ?? null;
34+
}
35+
36+
/**
37+
* @param array{
38+
* ProviderArn?: null|string,
39+
* ContextAssertion?: null|string,
40+
* }|ProvidedContext $input
41+
*/
42+
public static function create($input): self
43+
{
44+
return $input instanceof self ? $input : new self($input);
45+
}
46+
47+
public function getContextAssertion(): ?string
48+
{
49+
return $this->contextAssertion;
50+
}
51+
52+
public function getProviderArn(): ?string
53+
{
54+
return $this->providerArn;
55+
}
56+
57+
/**
58+
* @internal
59+
*/
60+
public function requestBody(): array
61+
{
62+
$payload = [];
63+
if (null !== $v = $this->providerArn) {
64+
$payload['ProviderArn'] = $v;
65+
}
66+
if (null !== $v = $this->contextAssertion) {
67+
$payload['ContextAssertion'] = $v;
68+
}
69+
70+
return $payload;
71+
}
72+
}

0 commit comments

Comments
 (0)