Skip to content

Allow updating a service with endpoint rules and tests. #3496

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

Merged
merged 1 commit into from
Oct 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ private UpdateServiceMain() {
requiredOption("maven-project-root", "The root directory for the maven project."),
requiredOption("service-json", "The service-2.json file for the service."),
optionalOption("paginators-json", "The paginators-1.json file for the service."),
optionalOption("waiters-json", "The waiters-2.json file for the service."));
optionalOption("waiters-json", "The waiters-2.json file for the service."),
optionalOption("endpoint-rule-set-json", "The endpoint-rule-set.json file for the service."),
optionalOption("endpoint-tests-json", "The endpoint-tests.json file for the service."));
}

public static void main(String[] args) {
Expand All @@ -67,6 +69,8 @@ private static class ServiceUpdater {
private final Path serviceJson;
private final Path paginatorsJson;
private final Path waitersJson;
private final Path endpointRuleSetJson;
private final Path endpointTestsJson;

private ServiceUpdater(CommandLine commandLine) {
this.mavenProjectRoot = Paths.get(commandLine.getOptionValue("maven-project-root").trim());
Expand All @@ -75,6 +79,8 @@ private ServiceUpdater(CommandLine commandLine) {
this.serviceJson = Paths.get(commandLine.getOptionValue("service-json").trim());
this.paginatorsJson = optionalPath(commandLine.getOptionValue("paginators-json"));
this.waitersJson = optionalPath(commandLine.getOptionValue("waiters-json"));
this.endpointRuleSetJson = optionalPath(commandLine.getOptionValue("endpoint-rule-set-json"));
this.endpointTestsJson = optionalPath(commandLine.getOptionValue("endpoint-tests-json"));
}

private Path optionalPath(String path) {
Expand All @@ -93,6 +99,8 @@ public void run() throws Exception {
copyFile(serviceJson, codegenFileLocation.resolve("service-2.json"));
copyFile(paginatorsJson, codegenFileLocation.resolve("paginators-1.json"));
copyFile(waitersJson, codegenFileLocation.resolve("waiters-2.json"));
copyFile(endpointRuleSetJson, codegenFileLocation.resolve("endpoint-rule-set.json"));
copyFile(endpointTestsJson, codegenFileLocation.resolve("endpoint-tests.json"));
}

private Path codegenFileLocation(String serviceModuleName, String serviceId) {
Expand Down