createDeployKey method
Adds a deploy key for a repository.
API docs: https://developer.github.com/v3/repos/keys/#create
Implementation
Future<PublicKey> createDeployKey(
RepositorySlug slug, CreatePublicKey key) async {
ArgumentError.checkNotNull(slug);
ArgumentError.checkNotNull(key);
return github.postJSON<Map<String, dynamic>, PublicKey>(
'/repos/${slug.fullName}/keys',
body: GitHubJson.encode(key),
statusCode: StatusCodes.CREATED,
convert: PublicKey.fromJson,
);
}