package Ġcom . h ic zp . ca er ule um . test Ċ Ċ import Ġcom . google . gson . Json Element Ċ import Ġcom . h ic zp . ca er ule um . annotation . BaseUrl Ċ import Ġcom . h ic zp . ca er ule um . annotation . Get Ċ import Ġcom . h ic zp . ca er ule um . annotation . Path Ċ import Ġcom . h ic zp . ca er ule um . create Ċ import Ġio . ktor . client . HttpClient Ċ import Ġio . ktor . client . engine . c io . C IO Ċ import Ġio . ktor . client . features . json . Gson Serializer Ċ import Ġio . ktor . client . features . json . Json Feature Ċ import Ġio . ktor . client . features . logging . LogLevel Ċ import Ġio . ktor . client . features . logging . Logging Ċ import Ġio . ktor . util . K tor Experimental API Ċ import Ġkotlinx . coroutines . Deferred Ċ import Ġkotlinx . coroutines . run Blocking Ċ Ċ @ BaseUrl (" https :// api . github . com /") Ċ interface ĠGitHub Service Ġ{ ĊĠĠĠ Ġ@ Get (" users /{ user }/ repos ") ĊĠĠĠ Ġfun Ġlist Repos Async (@ Path Ġuser : ĠString ): ĠDeferred < Json Element > ĊĊĠĠĠ Ġ@ Get (" users /{ user }/ repos ") ĊĠĠĠ Ġsuspend Ġfun Ġlist Repos (@ Path Ġuser : ĠString ): ĠJson Element Ċ } Ċ Ċ @ Opt In ( K tor Experimental API :: class ) Ċ val ĠhttpClient Ġ= ĠHttpClient ( C IO ) Ġ{ ĊĠĠĠ Ġinstall ( Json Feature ) Ġ{ ĊĠĠĠĠĠĠĠ Ġserializer Ġ= ĠGson Serializer () ĊĠĠĠ Ġ} ĊĠĠĠ Ġinstall ( Logging ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlevel Ġ= ĠLogLevel . ALL ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun Ġmain () Ġ{ ĊĠĠĠ Ġval Ġgithub Service Ġ= ĠhttpClient . create < GitHub Service >() ĊĠĠĠ Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġgithub Service . list Repos Async (" cz p 3 0 0 9 "). await (). run (:: println ) ĊĠĠĠĠĠĠĠ Ġgithub Service . list Repos (" cz p 3 0 0 9 "). run (:: println ) ĊĠĠĠ Ġ} Ċ } Ċ