Ċ Ċ import Ġcom . example . nb ag am ere ady . network . nb a api . Games Ċ import Ġcom . example . nb ag am ere ady . network . nb a api _ teams . Teams Ċ 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 Ġretrofit 2 . http . GET Ċ import Ġretrofit 2 . http . Path Ċ import Ġretrofit 2 . Call Ċ import Ġretrofit 2 . http . Query Ċ Ċ private Ġconst Ġval ĠBASE _ URL Ġ= Ġ" https :// api - nb a - v 1 . p . rapid api . com /" ĊĊ Ċ /*** Ċ Ġ* ĠOk http Ġfor Ġnetwork Ġlogging Ċ Ġ*/ Ċ Ċ private Ġval Ġnetwork Logging Interceptor Ġ= ĊĠĠĠ ĠHttp Logging Interceptor (). setLevel ( Http Logging Interceptor . Level . BODY ) ĊĊ Ċ /*** Ċ Ġ* ĠBuilding Ġthe Ġm oshi Ġobject Ġthat ĠRet rofit Ġwill Ġbe Ġusing . ĠAdding Ġin Ġthe Ġfull Ċ Ġ* Ġkotlin Ġcompatibility . Ċ Ġ*/ Ċ private Ġval Ġm oshi Ġ= ĠM oshi . Builder () ĊĠĠĠ Ġ. add ( Kotlin Json Adapter Factory ()) ĊĠĠĠ Ġ. build () ĊĊ Ċ /*** Ċ Ġ* ĠMain Ġentry Ġpoint Ġfor Ġnetwork Ġaccess Ċ Ġ*/ Ċ private Ġval Ġretrofit Ġ= ĠRet rofit . Builder () ĊĠĠĠ Ġ. client ( Ok HttpClient . Builder (). add Interceptor ( network Logging Interceptor ). build ()) ĊĠĠĠ Ġ. add Converter Factory ( M oshi Converter Factory . create ( mos hi )) ĊĠĠĠ Ġ. baseUrl ( BASE _ URL ) ĊĠĠĠ Ġ. build () Ċ Ċ /*** Ċ Ġ* ĠA Ġretrofit Ġservice Ġto Ġfetch Ġn ba Ġgame Ġdata Ċ Ġ*/ Ċ interface ĠN ba ApiService Ġ{ ĊĠĠĠ Ġ@ GET (" games / live /") ĊĠĠĠ Ġfun Ġget Live Games (@ Query (" rapid api - key ") Ġsecret Value : String ): ĠCall < Games > ĊĊĠĠĠ Ġ@ GET (" games / date /{ current Date For Api }/ ") ĊĠĠĠĠ Ġfun Ġget Games (@ Path (" current Date For Api ") Ġcurrent Date For Api : ĠString , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ@ Query (" rapid api - key ") Ġsecret Value : String ): ĠCall < Games > ĊĊĠĠĠ Ġ@ GET (" teams / league / standard /") ĊĠĠĠ Ġfun Ġget Teams (@ Query (" rapid api - key ") Ġsecret Value : String ): ĠCall < Teams > ĊĊ Ċ } ĊĊ Ċ object ĠN ba Api Ġ{ ĊĠĠĠ Ġval Ġretrofit Service : ĠN ba ApiService Ġby Ġlazy Ġ{ Ġretrofit . create ( N ba ApiService :: class . java ) Ġ} Ċ }