in src/main/java/com/spotify/github/v3/clients/RepositoryClient.java [686:703]
public CompletableFuture<Repository> createFork(final String organization) {
final String path = String.format(FORK_TEMPLATE, owner, repo);
final ImmutableMap<String, String> params =
(organization == null) ? ImmutableMap.of() : ImmutableMap.of("organization", organization);
final String body = github.json().toJsonUnchecked(params);
return github
.post(path, body)
.thenApply(
response -> {
final Repository repositoryItem =
github
.json()
.fromJsonUnchecked(
GitHubClient.responseBodyUnchecked(response), Repository.class);
return repositoryItem;
});
}