1
+ #
2
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License").
5
+ # You may not use this file except in compliance with the License.
6
+ # A copy of the License is located at
7
+ #
8
+ # http://aws.amazon.com/apache2.0
9
+ #
10
+ # or in the "license" file accompanying this file. This file is distributed
11
+ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12
+ # express or implied. See the License for the specific language governing
13
+ # permissions and limitations under the License.
14
+ #
15
+ # # TODO: support retry policy, signer and throttledRetries
16
+ ---
17
+ type : specs.openrewrite.org/v1beta/recipe
18
+ name : software.amazon.awssdk.ChangeConfigTypes
19
+ displayName : Change region related classes
20
+ recipeList :
21
+ - org.openrewrite.java.ChangeMethodName :
22
+ methodPattern : com.amazonaws.ClientConfiguration withRequestTimeout(int)
23
+ newMethodName : withApiCallAttemptTimeout
24
+ - org.openrewrite.java.ChangeMethodName :
25
+ methodPattern : com.amazonaws.ClientConfiguration setRequestTimeout(int)
26
+ newMethodName : withApiCallAttemptTimeout
27
+ - software.amazon.awssdk.migration.internal.recipe.NumberToDuration :
28
+ methodPattern : com.amazonaws.ClientConfiguration withApiCallAttemptTimeout(int)
29
+
30
+ - org.openrewrite.java.ChangeMethodName :
31
+ methodPattern : com.amazonaws.ClientConfiguration withClientExecutionTimeout(int)
32
+ newMethodName : withApiCallTimeout
33
+ - org.openrewrite.java.ChangeMethodName :
34
+ methodPattern : com.amazonaws.ClientConfiguration setClientExecutionTimeout(int)
35
+ newMethodName : withApiCallTimeout
36
+ - software.amazon.awssdk.migration.internal.recipe.NumberToDuration :
37
+ methodPattern : com.amazonaws.ClientConfiguration withApiCallTimeout(int)
38
+
39
+ - org.openrewrite.java.ChangeMethodName :
40
+ methodPattern : com.amazonaws.ClientConfiguration withRetryMode(..)
41
+ newMethodName : withRetryPolicy
42
+ - org.openrewrite.java.ChangeMethodName :
43
+ methodPattern : com.amazonaws.ClientConfiguration setRetryMode(..)
44
+ newMethodName : withRetryPolicy
45
+ - org.openrewrite.java.ChangeMethodName :
46
+ methodPattern : com.amazonaws.ClientConfiguration withHeader(String, String)
47
+ newMethodName : withPutHeader
48
+ - org.openrewrite.java.ChangeMethodName :
49
+ methodPattern : com.amazonaws.ClientConfiguration setHeader(String, String)
50
+ newMethodName : withPutHeader
51
+
52
+ # # Add comment to unsupported options
53
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
54
+ methodPattern : com.amazonaws.ClientConfiguration setMaxConsecutiveRetriesBeforeThrottling(int)
55
+ comment : maxConsecutiveRetriesBeforeThrottling is deprecated and not supported in v2. Consider removing it or using a custom RetryPolicy.
56
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
57
+ methodPattern : com.amazonaws.ClientConfiguration withMaxConsecutiveRetriesBeforeThrottling(int)
58
+ comment : maxConsecutiveRetriesBeforeThrottling is deprecated and not supported in v2. Consider removing it or using a custom RetryPolicy.
59
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
60
+ methodPattern : com.amazonaws.ClientConfiguration setCacheResponseMetadata(boolean)
61
+ comment : cacheResponseMetadata is deprecated and not supported in v2. Consider removing it.
62
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
63
+ methodPattern : com.amazonaws.ClientConfiguration withCacheResponseMetadata(boolean)
64
+ comment : cacheResponseMetadata is deprecated and not supported in v2. Consider removing it.
65
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
66
+ methodPattern : com.amazonaws.ClientConfiguration withDisableHostPrefixInjection(boolean)
67
+ comment : disableHostPrefixInjection is deprecated and not supported removed in v2. Consider removing it.
68
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
69
+ methodPattern : com.amazonaws.ClientConfiguration setDisableHostPrefixInjection(boolean)
70
+ comment : disableHostPrefixInjection is deprecated and not supported in v2. Consider removing it.
71
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
72
+ methodPattern : com.amazonaws.ClientConfiguration setDnsResolver(..)
73
+ comment : dnsResolver is not supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues
74
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
75
+ methodPattern : com.amazonaws.ClientConfiguration withDnsResolver(..)
76
+ comment : dnsResolver is not supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues
77
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
78
+ methodPattern : com.amazonaws.ClientConfiguration setGzip(boolean)
79
+ comment : gzip is not supported in v2 tracking in https://github.com/aws/aws-sdk-java-v2/issues/866. Consider removing it.
80
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
81
+ methodPattern : com.amazonaws.ClientConfiguration withGzip(boolean)
82
+ comment : gzip is not supported in v2 tracking in https://github.com/aws/aws-sdk-java-v2/issues/866. Consider removing it.
83
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
84
+ methodPattern : com.amazonaws.ClientConfiguration setLocalAddress(..)
85
+ comment : localAddress is not supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues
86
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
87
+ methodPattern : com.amazonaws.ClientConfiguration withLocalAddress(..)
88
+ comment : localAddress is not supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues
89
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
90
+ methodPattern : com.amazonaws.ClientConfiguration setSecureRandom(.*)
91
+ comment : secureRandom is not supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues
92
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
93
+ methodPattern : com.amazonaws.ClientConfiguration withSecureRandom(.*)
94
+ comment : secureRandom is supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues
95
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
96
+ methodPattern : com.amazonaws.ClientConfiguration setUseExpectContinue(boolean)
97
+ comment : useExpectContinue is removed in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues
98
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
99
+ methodPattern : com.amazonaws.ClientConfiguration withUseExpectContinue(boolean)
100
+ comment : useExpectContinue is removed in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues
101
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
102
+ methodPattern : com.amazonaws.ClientConfiguration withProtocol(.*)
103
+ comment : protocol is deprecated and not supported in v2. Consider using endpointOverride to specify HTTP scheme.
104
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
105
+ methodPattern : com.amazonaws.ClientConfiguration setProtocol(.*)
106
+ comment : protocol is deprecated and not supported in v2. Consider using endpointOverride to specify HTTP scheme.
107
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
108
+ methodPattern : com.amazonaws.ClientConfiguration withUserAgent(String)
109
+ comment : userAgent override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName).
110
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
111
+ methodPattern : com.amazonaws.ClientConfiguration setUserAgent(String)
112
+ comment : userAgent override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName).
113
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
114
+ methodPattern : com.amazonaws.ClientConfiguration withUserAgentPrefix(String)
115
+ comment : userAgentPrefix override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName).
116
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
117
+ methodPattern : com.amazonaws.ClientConfiguration setUserAgentPrefix(String)
118
+ comment : userAgentPrefix override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName).
119
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
120
+ methodPattern : com.amazonaws.ClientConfiguration withUserAgentSuffix(String)
121
+ comment : userAgentSuffix override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName).
122
+ - software.amazon.awssdk.migration.internal.recipe.AddCommentToMethod :
123
+ methodPattern : com.amazonaws.ClientConfiguration setUserAgentSuffix(String)
124
+ comment : userAgentSuffix override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName).
125
+
126
+ # # The following change needs to be the last step
127
+ - org.openrewrite.java.ChangeType :
128
+ oldFullyQualifiedTypeName : com.amazonaws.ClientConfiguration
129
+ newFullyQualifiedTypeName : software.amazon.awssdk.core.client.config.ClientOverrideConfiguration
130
+ - org.openrewrite.java.ChangeType :
131
+ oldFullyQualifiedTypeName : com.amazonaws.retry.RetryMode
132
+ newFullyQualifiedTypeName : software.amazon.awssdk.core.retry.RetryMode
0 commit comments