File tree Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 77- AWS api-change: Added ` us-isof-east-1 ` and ` us-isof-south-1 ` regions
88- AWS api-change: Added ` us-iso-east-1-fips ` region
99- ```
10+ - AWS api-change: Define list of supported region
1011
1112## 1.1.0
1213
Original file line number Diff line number Diff line change 66use AsyncAws \Core \AwsError \AwsErrorFactoryInterface ;
77use AsyncAws \Core \AwsError \JsonRpcAwsErrorFactory ;
88use AsyncAws \Core \Configuration ;
9+ use AsyncAws \Core \Exception \UnsupportedRegion ;
910use AsyncAws \Core \RequestContext ;
1011use AsyncAws \Translate \Exception \DetectedLanguageLowConfidenceException ;
1112use AsyncAws \Translate \Exception \InternalServerException ;
@@ -77,6 +78,29 @@ protected function getEndpointMetadata(?string $region): array
7778 }
7879
7980 switch ($ region ) {
81+ case 'ap-east-1 ' :
82+ case 'ap-northeast-1 ' :
83+ case 'ap-northeast-2 ' :
84+ case 'ap-south-1 ' :
85+ case 'ap-southeast-1 ' :
86+ case 'ap-southeast-2 ' :
87+ case 'ca-central-1 ' :
88+ case 'eu-central-1 ' :
89+ case 'eu-north-1 ' :
90+ case 'eu-west-1 ' :
91+ case 'eu-west-2 ' :
92+ case 'eu-west-3 ' :
93+ case 'us-east-1 ' :
94+ case 'us-east-2 ' :
95+ case 'us-gov-west-1 ' :
96+ case 'us-west-1 ' :
97+ case 'us-west-2 ' :
98+ return [
99+ 'endpoint ' => "https://translate. $ region.amazonaws.com " ,
100+ 'signRegion ' => $ region ,
101+ 'signService ' => 'translate ' ,
102+ 'signVersions ' => ['v4 ' ],
103+ ];
80104 case 'us-east-1-fips ' :
81105 return [
82106 'endpoint ' => 'https://translate-fips.us-east-1.amazonaws.com ' ,
@@ -136,11 +160,6 @@ protected function getEndpointMetadata(?string $region): array
136160 ];
137161 }
138162
139- return [
140- 'endpoint ' => "https://translate. $ region.amazonaws.com " ,
141- 'signRegion ' => $ region ,
142- 'signService ' => 'translate ' ,
143- 'signVersions ' => ['v4 ' ],
144- ];
163+ throw new UnsupportedRegion (\sprintf ('The region "%s" is not supported by "Translate". ' , $ region ));
145164 }
146165}
You can’t perform that action at this time.
0 commit comments