-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
part of github.common; | ||
|
||
class PublicKey { | ||
final GitHub github; | ||
|
||
int id; | ||
String key; | ||
String title; | ||
|
||
PublicKey(this.github); | ||
|
||
static PublicKey fromJSON(GitHub github, input) { | ||
if (input == null) return null; | ||
return new PublicKey(github) | ||
..id = input['id'] | ||
..key = input['key'] | ||
..title = input['title']; | ||
} | ||
} | ||
|
||
class CreatePublicKey { | ||
final String title; | ||
final String key; | ||
|
||
CreatePublicKey(this.title, this.key); | ||
|
||
String toJSON() { | ||
var map = {}; | ||
putValue("title", title, map); | ||
putValue("key", key, map); | ||
return JSON.encode(map); | ||
} | ||
} |