use of io.micronaut.starter.api.create.github.client.oauth.AccessToken in project micronaut-starter by micronaut-projects.
the class GitHubCreateService method creatApp.
protected GitHubRepository creatApp(@NonNull ApplicationType type, @NonNull String name, @Nullable List<String> features, @Nullable BuildTool buildTool, @Nullable TestFramework testFramework, @Nullable Language lang, @Nullable JdkVersion javaVersion, @NonNull String code, @NonNull String state, @Nullable String userAgent) {
AccessToken accessToken = getGitHubAccessToken(code, state);
String authToken = TOKEN_PREFIX + accessToken.getAccessToken();
GitHubUser gitHubUser = getGitHubUser(authToken);
GeneratorContext generatorContext = createProjectGeneratorContext(type, name, features, buildTool, testFramework, lang, javaVersion, userAgent);
String repoName = generatorContext.getProject().getName();
String repoDescription = String.format("Micronaut %s Application", generatorContext.getProject().getNaturalName());
GitHubRepository githubRepository = createGitHubRepository(authToken, repoName, repoDescription, gitHubUser);
pushToGithubRepository(generatorContext, gitHubUser, githubRepository, accessToken);
return githubRepository;
}
Aggregations