-
Notifications
You must be signed in to change notification settings - Fork 804
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
Adds list of string to endpoint/auth scheme parameters and support for JmesPath-defined operation context parameters #5168
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0332975
feat(StringArrayEndpointParams) Codegen String Array Enpoint params a…
joviegas 63ec189
Merge branch 'feature/StringArrayEndpointParams' of github.com:aws/aw…
joviegas ef78d9b
Merge Conflicts resolved after accoiunt Id
joviegas 7886aaf
Support Customization string array endpoint params for S3 access gran…
joviegas b85710c
new(StringArrayEndpointParams) Codegeneration of OperationContextPara…
joviegas a92efd3
Merge branch 'master' into feature/StringArrayEndpointParams
joviegas 0afffa3
new(StringArrayEndpointParams) Customization of Operation Context par…
joviegas 5fbba7a
Revert "new(StringArrayEndpointParams) Customization of Operation Con…
joviegas 0323b8f
Extracting existing JMESPath runtime to a separate class (#5155)
cenedhryn 5bb2346
new(StringArrayEndpointParams) Customization of Operation Context par…
joviegas ffb1cfa
Converts endpoint param list of string to list of value (#5169)
cenedhryn f9724c3
Generates JmesPath expressions for operation context parameters (#5172)
cenedhryn 14dd8d1
Supporting wildcard and keys fn in JmesPathRuntime (#5198)
cenedhryn 9821b9d
Adds functional tests for list of string auth params (#5216)
cenedhryn 6545dd5
Changelog
cenedhryn 6ec1c69
Merge branch 'master' into feature/StringArrayEndpointParams
cenedhryn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"type": "feature", | ||
"category": "AWS SDK for Java v2", | ||
"contributor": "", | ||
"description": "Adds capability to resolve endpoint and auth scheme parameters of type list of string as well as new functions to JmesPath runtime (keys and wildcard)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...main/java/software/amazon/awssdk/codegen/emitters/tasks/JmesPathRuntimeGeneratorTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package software.amazon.awssdk.codegen.emitters.tasks; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.UncheckedIOException; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import software.amazon.awssdk.codegen.emitters.GeneratorTask; | ||
import software.amazon.awssdk.codegen.emitters.GeneratorTaskParams; | ||
import software.amazon.awssdk.codegen.emitters.SimpleGeneratorTask; | ||
import software.amazon.awssdk.utils.IoUtils; | ||
|
||
public final class JmesPathRuntimeGeneratorTask extends BaseGeneratorTasks { | ||
public static final String RUNTIME_CLASS_NAME = "JmesPathRuntime"; | ||
|
||
private final String runtimeClassDir; | ||
private final String runtimePackageName; | ||
private final String fileHeader; | ||
private final String runtimeClassCode; | ||
|
||
public JmesPathRuntimeGeneratorTask(GeneratorTaskParams generatorTaskParams) { | ||
super(generatorTaskParams); | ||
this.runtimeClassDir = generatorTaskParams.getPathProvider().getJmesPathInternalDirectory(); | ||
this.runtimePackageName = generatorTaskParams.getModel().getMetadata().getFullInternalJmesPathPackageName(); | ||
this.fileHeader = generatorTaskParams.getModel().getFileHeader(); | ||
this.runtimeClassCode = loadRuntimeCode(); | ||
} | ||
|
||
@Override | ||
protected List<GeneratorTask> createTasks() throws Exception { | ||
String codeContents = | ||
"package " + runtimePackageName + ";\n" + | ||
"\n" | ||
+ runtimeClassCode; | ||
|
||
String fileName = RUNTIME_CLASS_NAME + ".java"; | ||
return Collections.singletonList(new SimpleGeneratorTask(runtimeClassDir, fileName, fileHeader, | ||
() -> codeContents)); | ||
} | ||
|
||
private static String loadRuntimeCode() { | ||
try { | ||
InputStream is = JmesPathRuntimeGeneratorTask.class.getResourceAsStream( | ||
String.format("/software/amazon/awssdk/codegen/jmespath/%s.java.resource", RUNTIME_CLASS_NAME)); | ||
return IoUtils.toUtf8String(is); | ||
} catch (IOException ioe) { | ||
throw new UncheckedIOException(ioe); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...c/main/java/software/amazon/awssdk/codegen/model/service/CustomOperationContextParam.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package software.amazon.awssdk.codegen.model.service; | ||
|
||
|
||
import java.util.Map; | ||
import software.amazon.awssdk.annotations.SdkInternalApi; | ||
|
||
@SdkInternalApi | ||
public class CustomOperationContextParam { | ||
Map<String, OperationContextParam> operationContextParamsMap; | ||
|
||
String operationName; | ||
|
||
public Map<String, OperationContextParam> getOperationContextParamsMap() { | ||
return operationContextParamsMap; | ||
} | ||
|
||
public void setOperationContextParamsMap(Map<String, OperationContextParam> operationContextParamsMap) { | ||
this.operationContextParamsMap = operationContextParamsMap; | ||
} | ||
|
||
public String getOperationName() { | ||
return operationName; | ||
} | ||
|
||
public void setOperationName(String operationName) { | ||
this.operationName = operationName; | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Adding handling this TODO to the fast-follow cleanup task.