package Ġcom . example . snap _ to _ road s Ċ Ċ import Ġcom . example . snap _ to _ road s . remote . api . Snap To Ro ads Api Ċ import Ġcom . example . snap _ to _ road s . remote . repository . Snap To Ro ads Repository Ċ import Ġcom . google . android . gms . maps . model . LatLng Ċ import Ġokhttp 3 . Ok HttpClient Ċ import Ġokhttp 3 . logging . Http Logging Interceptor Ċ import Ġretrofit 2 . Ret rofit Ċ import Ġretrofit 2 . converter . gson . Gson Converter Factory Ċ Ċ class ĠSnap To Ro ads ( apiKey : ĠString ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġsnap To Ro ads Repository : ĠSnap To Ro ads Repository ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsnap To Ro ads Api Ġ= Ġprovide Snap To Ro ads Api () ĊĠĠĠĠĠĠĠ Ġsnap To Ro ads Repository Ġ= Ġprovide Snap To Ro ads Repository ( snap To Ro ads Api , ĠapiKey ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġget Sn apped To Ro ads Path ( path : ĠList < LatLng >): ĠList < LatLng > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġsnap To Ro ads Repository . get Sn apped To Ro ads Path ( path ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġprovide Snap To Ro ads Api (): ĠSnap To Ro ads Api Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlogging Interceptor Ġ= ĠHttp Logging Interceptor () ĊĠĠĠĠĠĠĠ Ġlogging Interceptor . level Ġ= ĠHttp Logging Interceptor . Level . BODY ĊĊĠĠĠĠĠĠĠ Ġval Ġclient Ġ= ĠOk HttpClient . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. add Interceptor ( logging Interceptor ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠĠĠĠĠ Ġreturn ĠRet rofit . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. baseUrl (" https :// road s . googleapis . com /") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. add Converter Factory ( Gson Converter Factory . create ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. client ( client ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. create ( Snap To Ro ads Api :: class . java ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġprovide Snap To Ro ads Repository ( snap To Ro ads Api : ĠSnap To Ro ads Api , ĠapiKey : ĠString ) Ġ: ĠSnap To Ro ads Repository Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠSnap To Ro ads Repository ( snap To Ro ads Api , ĠapiKey ) ĊĠĠĠ Ġ} Ċ }