Skip to content

Commit f79a7bd

Browse files
authored
Add supports for multi-region (#466)
* Allow custom region at run time * Regenerate code * Add changelog entry * Add docbloc on Input without members
1 parent e351af4 commit f79a7bd

File tree

5 files changed

+23
-8
lines changed

5 files changed

+23
-8
lines changed

src/Input/AddLayerVersionPermissionRequest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use AsyncAws\Core\Request;
88
use AsyncAws\Core\Stream\StreamFactory;
99

10-
final class AddLayerVersionPermissionRequest implements Input
10+
final class AddLayerVersionPermissionRequest extends Input
1111
{
1212
/**
1313
* The name or Amazon Resource Name (ARN) of the layer.
@@ -78,6 +78,7 @@ final class AddLayerVersionPermissionRequest implements Input
7878
* Principal?: string,
7979
* OrganizationId?: string,
8080
* RevisionId?: string,
81+
* @region?: string,
8182
* } $input
8283
*/
8384
public function __construct(array $input = [])
@@ -89,6 +90,7 @@ public function __construct(array $input = [])
8990
$this->Principal = $input['Principal'] ?? null;
9091
$this->OrganizationId = $input['OrganizationId'] ?? null;
9192
$this->RevisionId = $input['RevisionId'] ?? null;
93+
parent::__construct($input);
9294
}
9395

9496
public static function create($input): self

src/Input/InvocationRequest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use AsyncAws\Lambda\Enum\InvocationType;
1010
use AsyncAws\Lambda\Enum\LogType;
1111

12-
final class InvocationRequest implements Input
12+
final class InvocationRequest extends Input
1313
{
1414
/**
1515
* The name of the Lambda function, version, or alias.
@@ -63,6 +63,7 @@ final class InvocationRequest implements Input
6363
* ClientContext?: string,
6464
* Payload?: string,
6565
* Qualifier?: string,
66+
* @region?: string,
6667
* } $input
6768
*/
6869
public function __construct(array $input = [])
@@ -73,6 +74,7 @@ public function __construct(array $input = [])
7374
$this->ClientContext = $input['ClientContext'] ?? null;
7475
$this->Payload = $input['Payload'] ?? null;
7576
$this->Qualifier = $input['Qualifier'] ?? null;
77+
parent::__construct($input);
7678
}
7779

7880
public static function create($input): self

src/Input/ListLayerVersionsRequest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use AsyncAws\Core\Stream\StreamFactory;
99
use AsyncAws\Lambda\Enum\Runtime;
1010

11-
final class ListLayerVersionsRequest implements Input
11+
final class ListLayerVersionsRequest extends Input
1212
{
1313
/**
1414
* A runtime identifier. For example, `go1.x`.
@@ -46,6 +46,7 @@ final class ListLayerVersionsRequest implements Input
4646
* LayerName?: string,
4747
* Marker?: string,
4848
* MaxItems?: int,
49+
* @region?: string,
4950
* } $input
5051
*/
5152
public function __construct(array $input = [])
@@ -54,6 +55,7 @@ public function __construct(array $input = [])
5455
$this->LayerName = $input['LayerName'] ?? null;
5556
$this->Marker = $input['Marker'] ?? null;
5657
$this->MaxItems = $input['MaxItems'] ?? null;
58+
parent::__construct($input);
5759
}
5860

5961
public static function create($input): self

src/Input/PublishLayerVersionRequest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use AsyncAws\Lambda\Enum\Runtime;
1010
use AsyncAws\Lambda\ValueObject\LayerVersionContentInput;
1111

12-
final class PublishLayerVersionRequest implements Input
12+
final class PublishLayerVersionRequest extends Input
1313
{
1414
/**
1515
* The name or Amazon Resource Name (ARN) of the layer.
@@ -59,6 +59,7 @@ final class PublishLayerVersionRequest implements Input
5959
* Content?: \AsyncAws\Lambda\ValueObject\LayerVersionContentInput|array,
6060
* CompatibleRuntimes?: list<\AsyncAws\Lambda\Enum\Runtime::*>,
6161
* LicenseInfo?: string,
62+
* @region?: string,
6263
* } $input
6364
*/
6465
public function __construct(array $input = [])
@@ -68,6 +69,7 @@ public function __construct(array $input = [])
6869
$this->Content = isset($input['Content']) ? LayerVersionContentInput::create($input['Content']) : null;
6970
$this->CompatibleRuntimes = $input['CompatibleRuntimes'] ?? [];
7071
$this->LicenseInfo = $input['LicenseInfo'] ?? null;
72+
parent::__construct($input);
7173
}
7274

7375
public static function create($input): self

src/LambdaClient.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ class LambdaClient extends AbstractApi
3131
* Principal: string,
3232
* OrganizationId?: string,
3333
* RevisionId?: string,
34+
* @region?: string,
3435
* }|AddLayerVersionPermissionRequest $input
3536
*/
3637
public function addLayerVersionPermission($input): AddLayerVersionPermissionResponse
3738
{
38-
$response = $this->getResponse(AddLayerVersionPermissionRequest::create($input)->request(), new RequestContext(['operation' => 'AddLayerVersionPermission']));
39+
$input = AddLayerVersionPermissionRequest::create($input);
40+
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'AddLayerVersionPermission', 'region' => $input->getRegion()]));
3941

4042
return new AddLayerVersionPermissionResponse($response);
4143
}
@@ -53,11 +55,13 @@ public function addLayerVersionPermission($input): AddLayerVersionPermissionResp
5355
* ClientContext?: string,
5456
* Payload?: string,
5557
* Qualifier?: string,
58+
* @region?: string,
5659
* }|InvocationRequest $input
5760
*/
5861
public function invoke($input): InvocationResponse
5962
{
60-
$response = $this->getResponse(InvocationRequest::create($input)->request(), new RequestContext(['operation' => 'Invoke']));
63+
$input = InvocationRequest::create($input);
64+
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'Invoke', 'region' => $input->getRegion()]));
6165

6266
return new InvocationResponse($response);
6367
}
@@ -75,12 +79,13 @@ public function invoke($input): InvocationResponse
7579
* LayerName: string,
7680
* Marker?: string,
7781
* MaxItems?: int,
82+
* @region?: string,
7883
* }|ListLayerVersionsRequest $input
7984
*/
8085
public function listLayerVersions($input): ListLayerVersionsResponse
8186
{
8287
$input = ListLayerVersionsRequest::create($input);
83-
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'ListLayerVersions']));
88+
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'ListLayerVersions', 'region' => $input->getRegion()]));
8489

8590
return new ListLayerVersionsResponse($response, $this, $input);
8691
}
@@ -98,11 +103,13 @@ public function listLayerVersions($input): ListLayerVersionsResponse
98103
* Content: \AsyncAws\Lambda\ValueObject\LayerVersionContentInput|array,
99104
* CompatibleRuntimes?: list<\AsyncAws\Lambda\Enum\Runtime::*>,
100105
* LicenseInfo?: string,
106+
* @region?: string,
101107
* }|PublishLayerVersionRequest $input
102108
*/
103109
public function publishLayerVersion($input): PublishLayerVersionResponse
104110
{
105-
$response = $this->getResponse(PublishLayerVersionRequest::create($input)->request(), new RequestContext(['operation' => 'PublishLayerVersion']));
111+
$input = PublishLayerVersionRequest::create($input);
112+
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'PublishLayerVersion', 'region' => $input->getRegion()]));
106113

107114
return new PublishLayerVersionResponse($response);
108115
}

0 commit comments

Comments
 (0)