create method
Creates a Pull Request based on the given request
.
API docs: https://developer.github.com/v3/pulls/#create-a-pull-request
Implementation
Future<PullRequest> create(RepositorySlug slug, CreatePullRequest request) {
return github.postJSON(
'/repos/${slug.fullName}/pulls',
convert: PullRequest.fromJson,
body: GitHubJson.encode(request),
preview: request.draft!
? 'application/vnd.github.shadow-cat-preview+json'
: null,
);
}