package Ġbr . com . well ing ton cost a . coroutines . app . config Ċ Ċ import Ġbr . com . well ing ton cost a . coroutines . Build Config Ċ import Ġcom . jak ew h art on . ret rofit 2 . adapter . kotlin . coroutines . Coroutine Call Adapter Factory Ċ import Ġcom . squareup . mos hi . M oshi Ċ import Ġcom . squareup . mos hi . kotlin . reflect . Kotlin Json Adapter Factory Ċ import Ġokhttp 3 . Ok HttpClient Ċ import Ġokhttp 3 . logging . Http Logging Interceptor Ċ import Ġretrofit 2 . Ret rofit Ċ import Ġretrofit 2 . converter . mos hi . M oshi Converter Factory Ċ import Ġjava . util . concurrent . TimeUnit Ċ Ċ const Ġval ĠAPI _ URL Ġ= Ġ" https :// api . github . com " Ċ Ċ const Ġval ĠCONNECTION _ TIMEOUT Ġ= Ġ 6 0 0 0 0 L Ċ Ċ internal Ġfun Ġprovide Ok HttpClient (): ĠOk HttpClient Ġ{ ĊĠĠĠ Ġval Ġclient Ġ= ĠOk HttpClient . Builder () ĊĠĠĠĠĠĠĠ Ġ. connect Timeout ( CONNECTION _ TIMEOUT , ĠTimeUnit . MILLISECONDS ) ĊĠĠĠĠĠĠĠ Ġ. read Timeout ( CONNECTION _ TIMEOUT , ĠTimeUnit . MILLISECONDS ) ĊĠĠĠĠĠĠĠ Ġ. write Timeout ( CONNECTION _ TIMEOUT , ĠTimeUnit . MILLISECONDS ) ĊĊĠĠĠ Ġif ( Build Config . DEBUG ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlogging Ġ= ĠHttp Logging Interceptor () ĊĠĠĠĠĠĠĠ Ġlogging . level Ġ= ĠHttp Logging Interceptor . Level . BODY ĊĠĠĠĠĠĠĠ Ġclient . add Interceptor ( logging ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġreturn Ġclient . build () Ċ } Ċ Ċ internal Ġfun Ġcreate M oshi () Ġ= ĠM oshi . Builder () ĊĠĠĠ Ġ. add ( Kotlin Json Adapter Factory ()) ĊĠĠĠ Ġ. build () Ċ Ċ internal Ġfun Ġprovide Ret rofit ( ok HttpClient : ĠOk HttpClient ) Ġ= ĠRet rofit . Builder () ĊĠĠĠ Ġ. baseUrl ( API _ URL ) ĊĠĠĠ Ġ. add Call Adapter Factory ( Coroutine Call Adapter Factory ()) ĊĠĠĠ Ġ. add Converter Factory ( M oshi Converter Factory . create ( create M oshi ())) ĊĠĠĠ Ġ. client ( ok HttpClient ) ĊĠĠĠ Ġ. build () Ċ Ċ internal Ġinline Ġfun Ġ< re ified ĠT > Ġcreate Api ( ret rofit : ĠRet rofit ) Ġ= Ġretrofit . create ( T :: class . java ) Ċ