package Ġcom . sdk . application . data manager Ċ Ċ import Ġcom . sdk . common .* Ċ import Ġcom . sdk . application .* Ċ import Ġkotlinx . coroutines . Deferred Ċ import Ġokhttp 3 . ResponseBody Ċ import Ġokhttp 3 . Interceptor Ċ import Ġokhttp 3 . logging . Http Logging Interceptor Ċ import Ġretrofit 2 . Response ĊĊ Ċ class ĠUser DataManager Class ( val Ġconfig : ĠApplication Config ) Ġ: ĠBase Repository () Ġ{ ĊĠĠĠĠĊĠĠĠ Ġprivate Ġval Ġuser Api List Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ Ġgenerate user Api List () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġgenerate user Api List (): ĠUser Api List ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġinterceptor Map Ġ= ĠHashMap < String , ĠList < Interceptor >>() ĊĠĠĠĠĠĠĠ Ġval Ġheader Interceptor Ġ= ĠApplication Header Interceptor ( config ) ĊĠĠĠĠĠĠĠ Ġval Ġrequest Signer Interceptor Ġ= ĠRequest Signer Interceptor () ĊĠĠĠĠĠĠĠ Ġval Ġinterceptor List Ġ= ĠArrayList < Interceptor >() ĊĠĠĠĠĠĠĠ Ġinterceptor List . add ( header Interceptor ) ĊĠĠĠĠĠĠĠ Ġinterceptor List . add ( request Signer Interceptor ) ĊĠĠĠĠĠĠĠ Ġinterceptor Map [" interceptor "] Ġ= Ġinterceptor List ĊĠĠĠĠĠĠĠ ĠHttpClient . set Debug gable ( config . debug gable ) ĊĠĠĠĠĠĠĠ Ġval Ġretrofit HttpClient Ġ= ĠHttpClient . initialize ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠbaseUrl Ġ= Ġconfig . domain , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġinterceptor List Ġ= Ġinterceptor Map , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnamespace Ġ= Ġ" Application User ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġpersistent Cookie Store Ġ= Ġconfig . persistent Cookie Store ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġreturn Ġretrofit HttpClient ?. initialize RestClient ( User Api List :: class . java ) Ġas ? ĠUser Api List ĊĠĠĠ Ġ} ĊĠĠĠĠĊĠĠĠ Ġfun Ġlogin With Facebook ( platform : ĠString ?= null , Ġbody : ĠOAuth Request Schema ): ĠDeferred < Response < Auth Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. login With Facebook ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġlogin With Google ( platform : ĠString ?= null , Ġbody : ĠOAuth Request Schema ): ĠDeferred < Response < Auth Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. login With Google ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġlogin With Google Android ( platform : ĠString ?= null , Ġbody : ĠOAuth Request Schema ): ĠDeferred < Response < Auth Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. login With Google Android ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġlogin With Google IOS ( platform : ĠString ?= null , Ġbody : ĠOAuth Request Schema ): ĠDeferred < Response < Auth Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. login With Google IOS ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġlogin With Apple IOS ( platform : ĠString ?= null , Ġbody : ĠOAuth Request Apple Schema ): ĠDeferred < Response < Auth Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. login With Apple IOS ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġlogin With OTP ( platform : ĠString ?= null , Ġbody : ĠSend O tp Request Schema ): ĠDeferred < Response < Send O tp Response >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. login With OTP ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġlogin With Email And Password ( body : ĠPassword Login Request Schema ): ĠDeferred < Response < Login Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. login With Email And Password ( body Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġsend Reset Password Email ( platform : ĠString ?= null , Ġbody : ĠSend Reset Password Email Request Schema ): ĠDeferred < Response < Reset Password Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. send Reset Password Email ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġforgot Password ( body : ĠF orgot Password Request Schema ): ĠDeferred < Response < Login Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. forgot Password ( body Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġsend Reset Token ( body : ĠCode RequestBody Schema ): ĠDeferred < Response < Reset Password Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. send Reset Token ( body Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġlogin With Token ( body : ĠToken RequestBody Schema ): ĠDeferred < Response < Login Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. login With Token ( body Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġregister With Form ( platform : ĠString ?= null , Ġbody : ĠForm Register Request Schema ): ĠDeferred < Response < Register Form Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. register With Form ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġverify Email ( body : ĠCode RequestBody Schema ): ĠDeferred < Response < Verify Email Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. verify Email ( body Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġverify Mobile ( body : ĠCode RequestBody Schema ): ĠDeferred < Response < Verify Email Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. verify Mobile ( body Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġhas Password (): ĠDeferred < Response < Has Password Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. has Password ()} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġupdate Password ( body : ĠUpdate Password Request Schema ): ĠDeferred < Response < Verify Email Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. update Password ( body Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġlogout (): ĠDeferred < Response < Logout Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. logout ()} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġsend OTP On Mobile ( platform : ĠString ?= null , Ġbody : ĠSend Mobile O tp Request Schema ): ĠDeferred < Response < O tp Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. send OTP On Mobile ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġverify Mobile OTP ( platform : ĠString ?= null , Ġbody : ĠVerify O tp Request Schema ): ĠDeferred < Response < Verify O tp Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. verify Mobile OTP ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġsend OTP On Email ( platform : ĠString ?= null , Ġbody : ĠSend Email O tp Request Schema ): ĠDeferred < Response < Email O tp Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. send OTP On Email ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġverify Email OTP ( platform : ĠString ?= null , Ġbody : ĠVerify Email O tp Request Schema ): ĠDeferred < Response < Verify O tp Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. verify Email OTP ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġget LoggedIn User (): ĠDeferred < Response < User Object Schema >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. get LoggedIn User ()} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġget ListOf Active Sessions (): ĠDeferred < Response < Session List Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. get ListOf Active Sessions ()} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġget Platform Config ( name : ĠString ?= null ): ĠDeferred < Response < Platform Schema >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. get Platform Config ( name Ġ= Ġname )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġupdate Profile ( platform : ĠString ?= null , Ġbody : ĠEdit Profile Request Schema ): ĠDeferred < Response < Profile Edit Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. update Profile ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġadd Mobile Number ( platform : ĠString ?= null , Ġbody : ĠEdit Mobile Request Schema ): ĠDeferred < Response < Verify Mobile OT PS uccess >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. add Mobile Number ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġdelete Mobile Number ( platform : ĠString ?= null , Ġactive : ĠBoolean , Ġprimary : ĠBoolean , Ġverified : ĠBoolean , Ġcountry Code : ĠString , Ġphone : ĠString ): ĠDeferred < Response < Login Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. delete Mobile Number ( platform Ġ= Ġplatform , Ġactive Ġ= Ġactive , Ġprimary Ġ= Ġprimary , Ġverified Ġ= Ġverified , Ġcountry Code Ġ= Ġcountry Code , Ġphone Ġ= Ġphone )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġset Mobile Number As Primary ( body : ĠSend Verification Link Mobile Request Schema ): ĠDeferred < Response < Login Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. set Mobile Number As Primary ( body Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġsend Verification Link To Mobile ( platform : ĠString ?= null , Ġbody : ĠSend Verification Link Mobile Request Schema ): ĠDeferred < Response < Send Mobile Verify Link Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. send Verification Link To Mobile ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġadd Email ( platform : ĠString ?= null , Ġbody : ĠEdit Email Request Schema ): ĠDeferred < Response < Verify Email OT PS uccess >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. add Email ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġdelete Email ( platform : ĠString ?= null , Ġactive : ĠBoolean , Ġprimary : ĠBoolean , Ġverified : ĠBoolean , Ġemail : ĠString ): ĠDeferred < Response < Login Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. delete Email ( platform Ġ= Ġplatform , Ġactive Ġ= Ġactive , Ġprimary Ġ= Ġprimary , Ġverified Ġ= Ġverified , Ġemail Ġ= Ġemail )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġset Email As Primary ( body : ĠEdit Email Request Schema ): ĠDeferred < Response < Login Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. set Email As Primary ( body Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠĊĠĠĠ Ġfun Ġsend Verification Link To Email ( platform : ĠString ?= null , Ġbody : ĠEdit Email Request Schema ): ĠDeferred < Response < Send Email Verify Link Success >> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Api List ?. send Verification Link To Email ( platform Ġ= Ġplatform , Ġbody Ġ= Ġbody )} ĊĊĠĠĠĠ ĊĠĠĠĠ Ċ } Ċ