package Ġcom . aw al ide ck . m oo v ies . data . network Ċ Ċ import Ġcom . aw al ide ck . m oo v ies . Build Config Ċ import Ġcom . aw al ide ck . m oo v ies . models . Pop ular Movies Ċ import Ġcom . squareup . mos hi . M oshi Ċ import Ġcom . squareup . mos hi . kotlin . reflect . Kotlin Json Adapter Factory Ċ 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 Ċ Ċ private Ġconst Ġval ĠBASE _ URL Ġ= Ġ" https :// api . the mov ied b . org /" Ċ Ċ private Ġval Ġm oshi Ġ= ĠM oshi . Builder () ĊĠĠĠ Ġ. add ( Kotlin Json Adapter Factory ()) ĊĠĠĠ Ġ. build () Ċ Ċ private Ġval Ġretrofit Ġ= ĠRet rofit . Builder () ĊĠĠĠ Ġ. add Converter Factory ( M oshi Converter Factory . create ( mos hi )) ĊĠĠĠ Ġ. baseUrl ( BASE _ URL ) ĊĠĠĠ Ġ. build () Ċ Ċ interface ĠMovie ApiService Ġ{ ĊĊĠĠĠ Ġ@ GET (" 3 / movie /{ category }? api _ key =${ Build Config . MO VI ED B _ KEY }& language = en - US & page = 1 ") ĊĠĠĠ Ġsuspend Ġfun Ġget Pop ular Movies (@ Path (" category ") Ġcategory : ĠString ): ĠPop ular Movies ĊĊĠĠĠ Ġ@ GET (" 3 / movie /{ movie Id }? api _ key =${ Build Config . MO VI ED B _ KEY }& language = en - US ") ĊĠĠĠ Ġsuspend Ġfun Ġget Movie Details (@ Path (" movie Id ") Ġmovie Id : ĠInt ): ĠMovie Details Ċ } Ċ Ċ object ĠMovie Api Ġ{ ĊĠĠĠ Ġval Ġretrofit Service : ĠMovie ApiService Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ Ġretrofit . create ( Movie ApiService :: class . java ) ĊĠĠĠ Ġ} Ċ }