Files
github-templates/lambda/src/com/amazon/ask/githubtemplates/handlers/github/GithubAPI.java
Julien Lengrand-Lambert 53cdfb79b7 Minor improvements
2021-03-17 10:56:20 +01:00

35 lines
1.1 KiB
Java

package com.amazon.ask.githubtemplates.handlers.github;
import org.javatuples.Pair;
import org.kohsuke.github.GitHub;
import org.kohsuke.github.GitHubBuilder;
import java.io.IOException;
import java.util.Map;
public class GithubAPI {
public static final Map<String, Pair<String, String>> TEMPLATES =
Map.of(
"java", new Pair<>("Spring-Boot-Framework", "Spring-Boot-Application-Template"),
"typescript", new Pair<>("carsonfarmer", "ts-template"),
"javascript", new Pair<>("jlengrand", "openwc-template"),
"HTML", new Pair<>("jlengrand", "openwc-template"),
"elm", new Pair<>("jlengrand", "elm-firebase")
);
private GitHub github;
public GithubAPI() throws GithubInitException {
try {
github = GitHubBuilder.fromEnvironment().build();
} catch (IOException e) {
throw new GithubInitException("Impossible to login the Github API");
}
}
public GitHub getGithub() {
return github;
}
}