@@ -47,86 +47,89 @@ public List<RuntimeClientPlugin> getClientPlugins() {
47
47
// Note that order is significant because configurations might
48
48
// rely on previously resolved values.
49
49
return ListUtils .of (
50
- RuntimeClientPlugin .builder ()
51
- .withConventions (TypeScriptDependency .CONFIG_RESOLVER .dependency , "Region" , HAS_CONFIG )
52
- .servicePredicate ((m , s ) -> isAwsService (s ) || isSigV4Service (s ))
53
- .build (),
54
- // Only one of Endpoints or CustomEndpoints should be used
55
- RuntimeClientPlugin .builder ()
56
- .withConventions (TypeScriptDependency .CONFIG_RESOLVER .dependency , "Endpoints" , HAS_CONFIG )
57
- .servicePredicate ((m , s ) -> isAwsService (s ) && !isEndpointsV2Service (s ))
58
- .build (),
59
- RuntimeClientPlugin .builder ()
60
- .withConventions (TypeScriptDependency .CONFIG_RESOLVER .dependency , "CustomEndpoints" , HAS_CONFIG )
61
- .servicePredicate ((m , s ) -> !isAwsService (s ) && !isEndpointsV2Service (s ))
62
- .build (),
63
- RuntimeClientPlugin .builder ()
64
- .withConventions (TypeScriptDependency .MIDDLEWARE_ENDPOINTS_V2 .dependency , "Endpoint" , HAS_CONFIG )
65
- .servicePredicate ((m , s ) -> isAwsService (s ) && isEndpointsV2Service (s ))
66
- .build (),
67
- RuntimeClientPlugin .builder ()
68
- .withConventions (TypeScriptDependency .MIDDLEWARE_RETRY .dependency , "Retry" )
69
- .build (),
70
- RuntimeClientPlugin .builder ()
71
- .withConventions (TypeScriptDependency .MIDDLEWARE_CONTENT_LENGTH .dependency , "ContentLength" ,
72
- HAS_MIDDLEWARE )
73
- .build (),
74
- RuntimeClientPlugin .builder ()
75
- .withConventions (AwsDependency .ACCEPT_HEADER .dependency , "AcceptHeader" ,
76
- HAS_MIDDLEWARE )
77
- .servicePredicate ((m , s ) -> testServiceId (s , "API Gateway" ))
78
- .build (),
79
- RuntimeClientPlugin .builder ()
80
- .withConventions (AwsDependency .GLACIER_MIDDLEWARE .dependency ,
81
- "Glacier" , HAS_MIDDLEWARE )
82
- .servicePredicate ((m , s ) -> testServiceId (s , "Glacier" ))
83
- .build (),
84
- RuntimeClientPlugin .builder ()
85
- .withConventions (AwsDependency .EC2_MIDDLEWARE .dependency ,
86
- "CopySnapshotPresignedUrl" , HAS_MIDDLEWARE )
87
- .operationPredicate ((m , s , o ) -> o .getId ().getName (s ).equals ("CopySnapshot" )
88
- && testServiceId (s , "EC2" ))
89
- .build (),
90
- RuntimeClientPlugin .builder ()
91
- .withConventions (AwsDependency .MACHINELEARNING_MIDDLEWARE .dependency , "PredictEndpoint" ,
92
- HAS_MIDDLEWARE )
93
- .operationPredicate ((m , s , o ) -> o .getId ().getName (s ).equals ("Predict" )
94
- && testServiceId (s , "Machine Learning" ))
95
- .build (),
96
- RuntimeClientPlugin .builder ()
97
- .withConventions (AwsDependency .ROUTE53_MIDDLEWARE .dependency ,
98
- "ChangeResourceRecordSets" , HAS_MIDDLEWARE )
99
- .operationPredicate ((m , s , o ) -> o .getId ().getName (s ).equals ("ChangeResourceRecordSets" )
100
- && testServiceId (s , "Route 53" ))
101
- .build (),
102
- RuntimeClientPlugin .builder ()
103
- .withConventions (AwsDependency .ROUTE53_MIDDLEWARE .dependency , "IdNormalizer" ,
104
- HAS_MIDDLEWARE )
105
- .operationPredicate ((m , s , o ) -> testInputContainsMember (m , o , ROUTE_53_ID_MEMBERS )
106
- && testServiceId (s , "Route 53" ))
107
- .build (),
108
- RuntimeClientPlugin .builder ()
109
- .withConventions (AwsDependency .MIDDLEWARE_HOST_HEADER .dependency , "HostHeader" )
110
- .build (),
111
- RuntimeClientPlugin .builder ()
112
- .withConventions (AwsDependency .MIDDLEWARE_LOGGER .dependency , "Logger" , HAS_MIDDLEWARE )
113
- .build (),
114
- RuntimeClientPlugin .builder ()
115
- .withConventions (AwsDependency .RECURSION_DETECTION_MIDDLEWARE .dependency ,
116
- "RecursionDetection" , HAS_MIDDLEWARE )
117
- .build ()
50
+ RuntimeClientPlugin .builder ()
51
+ .withConventions (TypeScriptDependency .CONFIG_RESOLVER .dependency , "Region" , HAS_CONFIG )
52
+ .servicePredicate ((m , s ) -> isAwsService (s ) || isSigV4Service (s ))
53
+ .build (),
54
+ // Only one of Endpoints or CustomEndpoints should be used
55
+ RuntimeClientPlugin .builder ()
56
+ .withConventions (
57
+ TypeScriptDependency .CONFIG_RESOLVER .dependency , "Endpoints" , HAS_CONFIG )
58
+ .servicePredicate ((m , s ) -> isAwsService (s ) && !isEndpointsV2Service (s ))
59
+ .build (),
60
+ RuntimeClientPlugin .builder ()
61
+ .withConventions (
62
+ TypeScriptDependency .CONFIG_RESOLVER .dependency , "CustomEndpoints" , HAS_CONFIG )
63
+ .servicePredicate ((m , s ) -> !isAwsService (s ) && !isEndpointsV2Service (s ))
64
+ .build (),
65
+ RuntimeClientPlugin .builder ()
66
+ .withConventions (
67
+ TypeScriptDependency .MIDDLEWARE_ENDPOINTS_V2 .dependency , "Endpoint" , HAS_CONFIG )
68
+ .servicePredicate ((m , s ) -> isAwsService (s ) && isEndpointsV2Service (s ))
69
+ .build (),
70
+ RuntimeClientPlugin .builder ()
71
+ .withConventions (TypeScriptDependency .MIDDLEWARE_RETRY .dependency , "Retry" )
72
+ .build (),
73
+ RuntimeClientPlugin .builder ()
74
+ .withConventions (TypeScriptDependency .MIDDLEWARE_CONTENT_LENGTH .dependency , "ContentLength" ,
75
+ HAS_MIDDLEWARE )
76
+ .build (),
77
+ RuntimeClientPlugin .builder ()
78
+ .withConventions (AwsDependency .ACCEPT_HEADER .dependency , "AcceptHeader" ,
79
+ HAS_MIDDLEWARE )
80
+ .servicePredicate ((m , s ) -> testServiceId (s , "API Gateway" ))
81
+ .build (),
82
+ RuntimeClientPlugin .builder ()
83
+ .withConventions (AwsDependency .GLACIER_MIDDLEWARE .dependency ,
84
+ "Glacier" , HAS_MIDDLEWARE )
85
+ .servicePredicate ((m , s ) -> testServiceId (s , "Glacier" ))
86
+ .build (),
87
+ RuntimeClientPlugin .builder ()
88
+ .withConventions (AwsDependency .EC2_MIDDLEWARE .dependency ,
89
+ "CopySnapshotPresignedUrl" , HAS_MIDDLEWARE )
90
+ .operationPredicate ((m , s , o ) -> o .getId ().getName (s ).equals ("CopySnapshot" )
91
+ && testServiceId (s , "EC2" ))
92
+ .build (),
93
+ RuntimeClientPlugin .builder ()
94
+ .withConventions (AwsDependency .MACHINELEARNING_MIDDLEWARE .dependency , "PredictEndpoint" ,
95
+ HAS_MIDDLEWARE )
96
+ .operationPredicate ((m , s , o ) -> o .getId ().getName (s ).equals ("Predict" )
97
+ && testServiceId (s , "Machine Learning" ))
98
+ .build (),
99
+ RuntimeClientPlugin .builder ()
100
+ .withConventions (AwsDependency .ROUTE53_MIDDLEWARE .dependency ,
101
+ "ChangeResourceRecordSets" , HAS_MIDDLEWARE )
102
+ .operationPredicate ((m , s , o ) -> o .getId ().getName (s ).equals ("ChangeResourceRecordSets" )
103
+ && testServiceId (s , "Route 53" ))
104
+ .build (),
105
+ RuntimeClientPlugin .builder ()
106
+ .withConventions (AwsDependency .ROUTE53_MIDDLEWARE .dependency , "IdNormalizer" ,
107
+ HAS_MIDDLEWARE )
108
+ .operationPredicate ((m , s , o ) -> testInputContainsMember (m , o , ROUTE_53_ID_MEMBERS )
109
+ && testServiceId (s , "Route 53" ))
110
+ .build (),
111
+ RuntimeClientPlugin .builder ()
112
+ .withConventions (AwsDependency .MIDDLEWARE_HOST_HEADER .dependency , "HostHeader" )
113
+ .build (),
114
+ RuntimeClientPlugin .builder ()
115
+ .withConventions (AwsDependency .MIDDLEWARE_LOGGER .dependency , "Logger" , HAS_MIDDLEWARE )
116
+ .build (),
117
+ RuntimeClientPlugin .builder ()
118
+ .withConventions (AwsDependency .RECURSION_DETECTION_MIDDLEWARE .dependency ,
119
+ "RecursionDetection" , HAS_MIDDLEWARE )
120
+ .build ()
118
121
);
119
122
}
120
123
121
124
private static boolean testInputContainsMember (
122
- Model model ,
123
- OperationShape operationShape ,
124
- Set <String > expectedMemberNames
125
+ Model model ,
126
+ OperationShape operationShape ,
127
+ Set <String > expectedMemberNames
125
128
) {
126
129
OperationIndex operationIndex = OperationIndex .of (model );
127
130
return operationIndex .getInput (operationShape )
128
- .filter (input -> input .getMemberNames ().stream ().anyMatch (expectedMemberNames ::contains ))
129
- .isPresent ();
131
+ .filter (input -> input .getMemberNames ().stream ().anyMatch (expectedMemberNames ::contains ))
132
+ .isPresent ();
130
133
}
131
134
132
135
private static boolean testServiceId (Shape serviceShape , String expectedId ) {
0 commit comments