package Ġcom . sy g ic . travel . sdk . tri ps . api Ċ Ċ import Ġcom . sy g ic . travel . sdk . tri ps . api . model . Api Trip Item Request Ċ import Ġcom . sy g ic . travel . sdk . tri ps . api . model . Api Trip Item Response Ċ import Ġcom . sy g ic . travel . sdk . tri ps . api . model . Api Trip ListItem Response Ċ import Ġcom . sy g ic . travel . sdk . tri ps . model . Trip Ċ import Ġcom . sy g ic . travel . sdk . tri ps . model . Trip Base Ċ import Ġcom . sy g ic . travel . sdk . tri ps . model . Trip Media Ċ import Ġcom . sy g ic . travel . sdk . tri ps . model . Trip Privacy Level Ċ import Ġcom . sy g ic . travel . sdk . tri ps . model . Trip Privileges Ċ import Ġorg . th reet en . bp . LocalDate Ċ import Ġorg . th reet en . bp . Offset DateTime Ċ import Ġorg . th reet en . bp . Zone Offset Ċ import Ġorg . th reet en . bp . format . DateTime Formatter Ċ Ċ @ Suppress (" DE PREC ATION ") Ċ internal Ġclass ĠTrip Converter Ġconstructor ( Ċ ĉ private Ġval Ġtrip Day Converter : ĠTrip Day Converter Ċ ) Ġ{ Ċ ĉ fun Ġfrom Api ( api Trip : ĠApi Trip ListItem Response ): ĠTrip Base Ġ{ Ċĉ ĉ return ĠTrip Base ( Ċĉĉ ĉ id Ġ= Ġapi Trip . id , Ċĉĉ ĉ name Ġ= Ġapi Trip . name , Ċĉĉ ĉ starts On Ġ= Ġapi Trip . starts _ on ?. let Ġ{ ĠLocalDate . parse ( it ) Ġ}, Ċĉĉ ĉ privacy Level Ġ= Ġfrom Api Privacy Level ( api Trip . privacy _ level ), Ċĉĉ ĉ url Ġ= Ġapi Trip . url , Ċĉĉ ĉ priv ileges Ġ= ĠTrip Privileges ( Ċĉĉĉ ĉ edit Ġ= Ġapi Trip . priv ileges . edit , Ċĉĉĉ ĉ manage Ġ= Ġapi Trip . priv ileges . manage , Ċĉĉĉ ĉ delete Ġ= Ġapi Trip . priv ileges . delete Ċĉĉ ĉ ), Ċĉĉ ĉ is User Sub scribed Ġ= Ġapi Trip . user _ is _ subscribed , Ċĉĉ ĉ is Deleted Ġ= Ġapi Trip . is _ deleted , Ċĉĉ ĉ media Ġ= Ġfrom Api Media ( api Trip . media ), Ċĉĉ ĉ updatedAt Ġ= ĠOffset DateTime . parse ( api Trip . updated _ at ). to Instant (), Ċĉĉ ĉ is Changed Ġ= Ġfalse , Ċĉĉ ĉ owner Id Ġ= Ġapi Trip . owner _ id , Ċĉĉ ĉ version Ġ= Ġapi Trip . version , Ċĉĉ ĉ days Count Ġ= Ġapi Trip . day _ count Ċĉ ĉ ) Ċ ĉ } ĊĊ ĉ fun Ġfrom Api ( api Trip : ĠApi Trip Item Response ): ĠTrip Ġ{ Ċĉ ĉ return ĠTrip ( Ċĉĉ ĉ id Ġ= Ġapi Trip . id , Ċĉĉ ĉ name Ġ= Ġapi Trip . name , Ċĉĉ ĉ starts On Ġ= Ġapi Trip . starts _ on ?. let Ġ{ ĠLocalDate . parse ( it ) Ġ}, Ċĉĉ ĉ privacy Level Ġ= Ġfrom Api Privacy Level ( api Trip . privacy _ level ), Ċĉĉ ĉ url Ġ= Ġapi Trip . url , Ċĉĉ ĉ priv ileges Ġ= ĠTrip Privileges ( Ċĉĉĉ ĉ edit Ġ= Ġapi Trip . priv ileges . edit , Ċĉĉĉ ĉ manage Ġ= Ġapi Trip . priv ileges . manage , Ċĉĉĉ ĉ delete Ġ= Ġapi Trip . priv ileges . delete Ċĉĉ ĉ ), Ċĉĉ ĉ is User Sub scribed Ġ= Ġapi Trip . user _ is _ subscribed , Ċĉĉ ĉ is Deleted Ġ= Ġapi Trip . is _ deleted , Ċĉĉ ĉ media Ġ= Ġfrom Api Media ( api Trip . media ), Ċĉĉ ĉ updatedAt Ġ= ĠOffset DateTime . parse ( api Trip . updated _ at ). to Instant (), Ċĉĉ ĉ is Changed Ġ= Ġfalse , Ċĉĉ ĉ owner Id Ġ= Ġapi Trip . owner _ id , Ċĉĉ ĉ version Ġ= Ġapi Trip . version , Ċĉĉ ĉ dest inations Ġ= ĠArrayList ( api Trip . dest inations ), Ċĉĉ ĉ days Ġ= Ġapi Trip . days . map Ġ{ Ġtrip Day Converter . from Api ( it ) Ġ} Ċĉ ĉ ) Ċ ĉ } ĊĊ ĉ fun Ġto Api ( local Trip : ĠTrip ): ĠApi Trip Item Request Ġ{ Ċĉ ĉ return ĠApi Trip Item Request ( Ċĉĉ ĉ name Ġ= Ġlocal Trip . name , Ċĉĉ ĉ base _ version Ġ= Ġlocal Trip . version , Ċĉĉ ĉ updated _ at Ġ= Ġlocal Trip . updatedAt !!. at Offset ( Zone Offset . UTC ). format ( DateTime Formatter . ISO _ OFFSET _ DATE _ TIME ), Ċĉĉ ĉ is _ deleted Ġ= Ġlocal Trip . is Deleted , Ċĉĉ ĉ privacy _ level Ġ= Ġwhen Ġ( local Trip . privacy Level ) Ġ{ Ċĉĉĉ ĉ Trip Privacy Level . PUBLIC Ġ-> ĠApi Trip ListItem Response . PRIV ACY _ PUBLIC Ċĉĉĉ ĉ Trip Privacy Level . PRIVATE Ġ-> ĠApi Trip ListItem Response . PRIV ACY _ PRIVATE Ċĉĉĉ ĉ Trip Privacy Level . SHARE ABLE Ġ-> ĠApi Trip ListItem Response . PRIV ACY _ SHARE ABLE Ċĉĉ ĉ }, Ċĉĉ ĉ starts _ on Ġ= Ġlocal Trip . starts On ?. format ( DateTime Formatter . ISO _ LOCAL _ DATE ), Ċĉĉ ĉ dest inations Ġ= Ġlocal Trip . dest inations , Ċĉĉ ĉ days Ġ= Ġlocal Trip . days . map Ġ{ Ġtrip Day Converter . to Api ( it ) Ġ} Ċĉ ĉ ) Ċ ĉ } ĊĊ ĉ private Ġfun Ġfrom Api Privacy Level ( privacy Level : ĠString ): ĠTrip Privacy Level Ġ{ Ċĉ ĉ return Ġwhen Ġ( privacy Level ) Ġ{ Ċĉĉ ĉ Api Trip ListItem Response . PRIV ACY _ PUBLIC Ġ-> ĠTrip Privacy Level . PUBLIC Ċĉĉ ĉ Api Trip ListItem Response . PRIV ACY _ PRIVATE Ġ-> ĠTrip Privacy Level . PRIVATE Ċĉĉ ĉ Api Trip ListItem Response . PRIV ACY _ SHARE ABLE Ġ-> ĠTrip Privacy Level . SHARE ABLE Ċĉĉ ĉ else Ġ-> ĠTrip Privacy Level . PRIVATE Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ private Ġfun Ġfrom Api Media ( media : ĠApi Trip ListItem Response . Media ?): ĠTrip Media ? Ġ{ Ċĉ ĉ return Ġif Ġ( media Ġ!= Ġnull ) ĠTrip Media ( Ċĉĉ ĉ square Media Id Ġ= Ġmedia . square . id , Ċĉĉ ĉ square Url Template Ġ= Ġmedia . square . url _ template , Ċĉĉ ĉ land scape Media Id Ġ= Ġmedia . land scape . id , Ċĉĉ ĉ land scape Url Template Ġ= Ġmedia . land scape . url _ template , Ċĉĉ ĉ portrait Id Ġ= Ġmedia . portrait . id , Ċĉĉ ĉ portrait Url Template Ġ= Ġmedia . portrait . url _ template , Ċĉĉ ĉ video Preview Id Ġ= Ġmedia . video _ preview ?. id , Ċĉĉ ĉ video Preview Url Template Ġ= Ġmedia . video _ preview ?. url _ template Ċĉ ĉ ) Ġelse Ġnull Ċ ĉ } Ċ } Ċ