File tree 3 files changed +26
-7
lines changed
3 files changed +26
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## NOT RELEASED
4
4
5
+ ### Added
6
+
7
+ - AWS api-change: rework regions definition
8
+
5
9
### Changed
6
10
7
11
- Sort exception alphabetically.
Original file line number Diff line number Diff line change 27
27
},
28
28
"extra" : {
29
29
"branch-alias" : {
30
- "dev-master" : " 1.3 -dev"
30
+ "dev-master" : " 1.4 -dev"
31
31
}
32
32
}
33
33
}
Original file line number Diff line number Diff line change 11
11
use AsyncAws \Core \AwsError \AwsErrorFactoryInterface ;
12
12
use AsyncAws \Core \AwsError \JsonRpcAwsErrorFactory ;
13
13
use AsyncAws \Core \Configuration ;
14
+ use AsyncAws \Core \Exception \UnsupportedRegion ;
14
15
use AsyncAws \Core \RequestContext ;
15
16
16
17
class ComprehendClient extends AbstractApi
@@ -57,6 +58,25 @@ protected function getEndpointMetadata(?string $region): array
57
58
}
58
59
59
60
switch ($ region ) {
61
+ case 'ap-northeast-1 ' :
62
+ case 'ap-northeast-2 ' :
63
+ case 'ap-south-1 ' :
64
+ case 'ap-southeast-1 ' :
65
+ case 'ap-southeast-2 ' :
66
+ case 'ca-central-1 ' :
67
+ case 'eu-central-1 ' :
68
+ case 'eu-west-1 ' :
69
+ case 'eu-west-2 ' :
70
+ case 'us-east-1 ' :
71
+ case 'us-east-2 ' :
72
+ case 'us-gov-west-1 ' :
73
+ case 'us-west-2 ' :
74
+ return [
75
+ 'endpoint ' => "https://comprehend. $ region.amazonaws.com " ,
76
+ 'signRegion ' => $ region ,
77
+ 'signService ' => 'comprehend ' ,
78
+ 'signVersions ' => ['v4 ' ],
79
+ ];
60
80
case 'fips-ca-central-1 ' :
61
81
return [
62
82
'endpoint ' => 'https://comprehend-fips.ca-central-1.amazonaws.com ' ,
@@ -116,11 +136,6 @@ protected function getEndpointMetadata(?string $region): array
116
136
];
117
137
}
118
138
119
- return [
120
- 'endpoint ' => "https://comprehend. $ region.amazonaws.com " ,
121
- 'signRegion ' => $ region ,
122
- 'signService ' => 'comprehend ' ,
123
- 'signVersions ' => ['v4 ' ],
124
- ];
139
+ throw new UnsupportedRegion (\sprintf ('The region "%s" is not supported by "Comprehend". ' , $ region ));
125
140
}
126
141
}
You can’t perform that action at this time.
0 commit comments