package Ġcom . sy g ic . travel . sdk . common . di Ċ Ċ import Ġandroid . content . Context Ċ import Ġcom . squareup . mos hi . M oshi Ċ import Ġcom . sy g ic . travel . sdk . common . api . S yg ic Travel ApiClient Ċ import Ġcom . sy g ic . travel . sdk . common . api . intercept ors . Headers Interceptor Ċ import Ġcom . sy g ic . travel . sdk . common . api . intercept ors . Locale Interceptor Ċ import Ġcom . sy g ic . travel . sdk . common . api . intercept ors . Locale Interceptor . Companion . LOCAL E _ PLACE HOLDER Ċ import Ġcom . sy g ic . travel . sdk . session . service . Auth Storage Service Ċ import Ġcom . sy g ic . travel . sdk . utils . UserAgent Util Ċ import Ġokhttp 3 . Cache Ċ import Ġokhttp 3 . Ok HttpClient Ċ import Ġokhttp 3 . logging . Http Logging Interceptor Ċ import Ġorg . k oin . dsl . module . module Ċ import Ġretrofit 2 . Ret rofit Ċ import Ġretrofit 2 . converter . mos hi . M oshi Converter Factory Ċ import Ġjava . util . concurrent . TimeUnit Ċ Ċ internal Ġval Ġsy g ic Travel Api Module Ġ= Ġmodule Ġ{ Ċ ĉ single Ġ{ Ċĉ ĉ Headers Interceptor ( Ċĉĉ ĉ auth Storage Service Ġ= Ġ{ Ġget < Auth Storage Service >() Ġ}, Ċĉĉ ĉ apiKey Ġ= ĠgetProperty (" apiKey "), Ċĉĉ ĉ userAgent Ġ= ĠUser Agent Util . create UserAgent ( get < Context >()) Ċĉ ĉ ) Ċ ĉ } Ċ ĉ single Ġ{ Ċĉ ĉ Locale Interceptor ( getProperty (" default Language ")) Ċ ĉ } Ċ ĉ single (" sy g ic Travel HttpClient ") Ġ{ Ċĉ ĉ val Ġbuilder Ġ= ĠOk HttpClient . Builder () Ċĉĉ ĉ . add Interceptor ( get < Headers Interceptor >()) Ċĉĉ ĉ . add Interceptor ( get < Locale Interceptor >()) Ċĉ ĉ if Ġ( getProperty (" debug Mode ")) Ġ{ Ċĉĉ ĉ builder . add Interceptor ( get < Http Logging Interceptor >()) Ċĉ ĉ } Ċĉ ĉ if Ġ( getProperty (" http Cache Enabled ")) Ġ{ Ċĉĉ ĉ builder Ċĉĉĉ ĉ . cache ( get < Cache >()) Ċĉ ĉ } Ċĉ ĉ builder Ċĉĉ ĉ . read Timeout ( 6 0 , ĠTimeUnit . SECONDS ) Ċĉĉ ĉ . build () Ċ ĉ } Ċ ĉ single (" sy g ic Travel Api Ret rofit ") Ġ{ Ċĉ ĉ Ret rofit . Builder () Ċĉĉ ĉ . client ( get < Ok HttpClient >(" sy g ic Travel HttpClient ")) Ċĉĉ ĉ . baseUrl ( getProperty < String >(" sy g ic Travel Api Url ") Ġ+ Ġ"/ $ LOCAL E _ PLACE HOLDER /") Ċĉĉ ĉ . add Converter Factory ( M oshi Converter Factory . create ( get < M oshi > ()). with Null Serialization ()) Ċĉĉ ĉ . build () Ċ ĉ } Ċ ĉ single Ġ{ Ċĉ ĉ get < Ret rofit >(" sy g ic Travel Api Ret rofit "). create ( S yg ic Travel ApiClient :: class . java ) Ċ ĉ } Ċ } Ċ