package Ġcom . cs osa . f nt est . di Ċ Ċ import Ġcom . cs osa . f nt est . data . remote . api . FN Test ApiService Ċ import Ġcom . cs osa . f nt est . data . remote . api . Google Maps ApiService Ċ import Ġcom . facebook . ste tho . okhttp 3 . St eth o Interceptor Ċ import Ġokhttp 3 . Ok HttpClient Ċ import Ġokhttp 3 . logging . Http Logging Interceptor Ċ import Ġorg . k oin . core . qual ifier . named Ċ import Ġorg . k oin . dsl . module Ċ import Ġretrofit 2 . Ret rofit Ċ import Ġretrofit 2 . converter . mos hi . M oshi Converter Factory Ċ import Ġjava . util . concurrent . TimeUnit Ċ Ċ val Ġnetwork Module Ġ= Ġmodule Ġ{ ĊĊĠĠĠ Ġsingle Ġ{ Ġprovide FN Test ApiService ( ret rofit Ġ= Ġget ( named (" my - tax i "))) Ġ} ĊĊĠĠĠ Ġsingle Ġ{ Ġprovide Google Maps ApiService ( ret rofit Ġ= Ġget ( named (" google - apis "))) Ġ} ĊĊĠĠĠ Ġsingle ( named (" my - tax i ")) Ġ{ Ġprovide Ret rofit ( ok HttpClient Ġ= Ġget (), Ġurl Ġ= Ġ" https :// fake - poi - api . my tax i . com /") Ġ} ĊĊĠĠĠ Ġsingle ( named (" google - apis ")) Ġ{ Ġprovide Ret rofit ( ok HttpClient Ġ= Ġget (), Ġurl Ġ= Ġ" https :// maps . googleapis . com /") Ġ} ĊĊĠĠĠ Ġsingle Ġ{ Ġprovide Ok HttpClient () Ġ} Ċ } Ċ Ċ internal Ġfun Ġprovide Ok HttpClient (): ĠOk HttpClient Ġ{ ĊĠĠĠ Ġval Ġhttp Logging Interceptor Ġ= ĠHttp Logging Interceptor (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġlevel Ġ= ĠHttp Logging Interceptor . Level . BODY ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġreturn ĠOk HttpClient . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. connect Timeout ( 6 0 L , ĠTimeUnit . SECONDS ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. read Timeout ( 6 0 L , ĠTimeUnit . SECONDS ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. add Interceptor ( http Logging Interceptor ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. add Network Interceptor ( St eth o Interceptor ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () Ċ } Ċ Ċ internal Ġfun Ġprovide Ret rofit ( ok HttpClient : ĠOk HttpClient , Ġurl : ĠString ): ĠRet rofit Ġ{ ĊĠĠĠ Ġreturn ĠRet rofit . Builder () ĊĠĠĠĠĠĠĠ Ġ. baseUrl ( url ) ĊĠĠĠĠĠĠĠ Ġ. client ( ok HttpClient ) ĊĠĠĠĠĠĠĠ Ġ. add Converter Factory ( M oshi Converter Factory . create ()) ĊĠĠĠĠĠĠĠ Ġ. build () Ċ } Ċ Ċ internal Ġfun Ġprovide FN Test ApiService ( ret rofit : ĠRet rofit ): ĠFN Test ApiService Ġ= ĊĠĠĠ Ġretrofit . create ( FN Test ApiService :: class . java ) Ċ Ċ internal Ġfun Ġprovide Google Maps ApiService ( ret rofit : ĠRet rofit ): ĠGoogle Maps ApiService Ġ= ĊĠĠĠ Ġretrofit . create ( Google Maps ApiService :: class . java ) Ċ