package Ġcom . example . android . mar sp hot os . network Ċ Ċ 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 ĊĊ Ċ private Ġconst Ġval ĠBASE _ URL Ġ= Ġ" https :// countries now . space /" Ċ Ċ 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 ĠApi Service { ĊĠĠĠ Ġ@ GET (" api / v 0 . 1 / countries / flag / images ") ĊĠĠĠ Ġsuspend Ġfun Ġget Photos (): Ġphoto Res pos modul Ċ } Ċ object Ġ Ġcountry Api Ġ{ ĊĠĠĠ Ġval Ġretrofit Service Ġ: ĠApi Service Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ Ġretrofit . create ( ApiService :: class . java ) ĊĠĠĠ Ġ} Ċ } Ċ