-
Notifications
You must be signed in to change notification settings - Fork 853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(CopySourceRequestInS3): Updated codegen to customize the request before calling service #5244
Conversation
fb488a1
to
d70d43c
Compare
…before sending, instead of using interceptors. This change ensures that customized parameters are available for EndpointResolveInterceptors during beforeExecution.
d70d43c
to
3bf3f76
Compare
...src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/query/customization.config
Outdated
Show resolved
Hide resolved
codegen/src/main/java/software/amazon/awssdk/codegen/model/service/RequestCustomizer.java
Outdated
Show resolved
Hide resolved
codegen/src/main/java/software/amazon/awssdk/codegen/model/service/RequestCustomizer.java
Outdated
Show resolved
Hide resolved
...main/java/software/amazon/awssdk/codegen/model/config/customization/CustomizationConfig.java
Outdated
Show resolved
Hide resolved
codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/SyncClientClass.java
Outdated
Show resolved
Hide resolved
*/ | ||
@SdkInternalApi | ||
public final class CopySourceInterceptor implements ExecutionInterceptor { | ||
public final class RequestModifierUtils { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to keep a reference to CopySource
in this class name, CopySourceModifierUtils
maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the name as CustomRequestTransformerUtils since in future if we need to do similar customization to any API then we can just add an API in this class.
Thus this class will have broader scope of all the RequestTransformer rather than just CopySource
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh you were thinking of reusing this class for other things. I see. Would it be better to keep this class only for CopySource purpose or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of using this class to hold the static APIs that do the requests transformations via customization.
In this case we have two API copyObject
and UploadPartCopy
.
Since this utils is created to hold the CustomRequestTransformers thart will be used in Customizations I was thinking to keep its scope at this level rather than CopySource which is just a Field which gets transformed.
@@ -21,5 +21,11 @@ | |||
} | |||
} | |||
} | |||
] | |||
], | |||
"customRequestTransformerMap": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I would drop the map
suffix (everything is a map in json), simply customRequestTransformers
sounds more clear to me. Other keys, like customOperationContextParams
don't have the map suffix, it would make the customization file more consistent. But it is not a blocker for me.
*/ | ||
@SdkInternalApi | ||
public final class CopySourceInterceptor implements ExecutionInterceptor { | ||
public final class RequestModifierUtils { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh you were thinking of reusing this class for other things. I see. Would it be better to keep this class only for CopySource purpose or not?
Quality Gate passedIssues Measures |
…before calling service (aws#5244) * fix(CopySourceRequestInS3): Updated codegen to customize the request before sending, instead of using interceptors. This change ensures that customized parameters are available for EndpointResolveInterceptors during beforeExecution. * Handle review comments * Handle review comments 2 * Handle review comments 3 * Added change log
Updated codegen to customize the request before sending, instead of using interceptors. This change ensures that customized parameters are available for EndpointResolveInterceptors during execution.
Motivation and Context
Modifications
Will result in
Testing
Screenshots (if appropriate)
Types of changes
License