/* Ċ Ġ* ĠCopyright Ġ 2 0 2 2 ĠP era ĠWallet , ĠL DA Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense Ċ Ġ*/ Ċ Ċ package Ġcom . al gor and . android . asset search . data . repository Ċ Ċ import Ġcom . al gor and . android . asset search . data . mapper . Asset Detail DTO Mapper Ċ import Ġcom . al gor and . android . asset search . domain . model . Asset Detail DTO Ċ import Ġcom . al gor and . android . asset search . domain . repository . Asset Search Repository Ċ import Ġcom . al gor and . android . models . Asset Detail Response Ċ import Ġcom . al gor and . android . models . Asset Query Type Ċ import Ġcom . al gor and . android . models . Pagination Ċ import Ġcom . al gor and . android . models . Result Ċ import Ġcom . al gor and . android . network . Mobile Al gor and Api Ċ import Ġcom . al gor and . android . network . request With H ipo ErrorHandler Ċ import Ġcom . hip o . hip o exceptions android . Ret rofit ErrorHandler Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠAsset Search Repository Impl Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġmobile Al gor and Api : ĠMobile Al gor and Api , ĊĠĠĠ Ġprivate Ġval Ġh ipo Api ErrorHandler : ĠRet rofit ErrorHandler , ĊĠĠĠ Ġprivate Ġval Ġasset Detail DTO Mapper : ĠAsset Detail DTO Mapper Ċ ) Ġ: ĠAsset Search Repository Ġ{ ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġsearch Asset ( ĊĠĠĠĠĠĠĠ Ġquery Text : ĠString , ĊĠĠĠĠĠĠĠ Ġquery Type : ĠAsset Query Type , ĊĠĠĠĠĠĠĠ Ġhas Collect ible : ĠBoolean ĊĠĠĠ Ġ): ĠResult < Pagination < Asset Detail DTO >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġrequest With H ipo ErrorHandler ( hip o Api ErrorHandler ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġasset Query Ġ= Ġquery Text . take If Ġ{ Ġit . isNotBlank () Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmobile Al gor and Api . get Assets ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġasset Query Ġ= Ġasset Query , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġstatus Ġ= Ġquery Type . api Name , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Collect ible Ġ= Ġhas Collect ible ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ}. map Ġ{ Ġpagination Data Ġ-> Ġmap To Asset Detail DTO ( pagination Data ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġget Assets By Url ( url : ĠString ): ĠResult < Pagination < Asset Detail DTO >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġrequest With H ipo ErrorHandler ( hip o Api ErrorHandler ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmobile Al gor and Api . get Assets More ( url ) ĊĠĠĠĠĠĠĠ Ġ}. map Ġ{ Ġpagination Data Ġ-> Ġmap To Asset Detail DTO ( pagination Data ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġmap To Asset Detail DTO ( pagination Data : ĠPagination < Asset Detail Response >): ĠPagination < Asset Detail DTO > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġasset Detail DTO Result Ġ= Ġpagination Data . results . map Ġ{ Ġasset Detail DTO Mapper . map To Asset Detail DTO ( it ) Ġ} ĊĠĠĠĠĠĠĠ Ġreturn ĠPagination ( pagination Data . next , Ġasset Detail DTO Result ) ĊĠĠĠ Ġ} Ċ } Ċ