getDeployKey method

Future<PublicKey> getDeployKey(
  1. RepositorySlug slug, {
  2. required int id,
})

Get a deploy key.

  • id: id of the key to retrieve.

https://developer.github.com/v3/repos/keys/#get

Implementation

Future<PublicKey> getDeployKey(RepositorySlug slug, {required int id}) async {
  ArgumentError.checkNotNull(slug);
  ArgumentError.checkNotNull(id);
  return github.getJSON<Map<String, dynamic>, PublicKey>(
    '/repos/${slug.fullName}/keys/$id',
    statusCode: StatusCodes.OK,
    convert: (i) => PublicKey.fromJson(i),
  );
}