package Ġio . h nd rs . slack . api . spring . group . users Ċ Ċ /** Ċ Ġ* Ġhttps :// api . slack . com / methods / users . lookup By Email Ċ Ġ*/ Ċ import Ġio . h nd rs . slack . api . contract . jackson . group . users . Error Lookup By Email Response Ċ import Ġio . h nd rs . slack . api . contract . jackson . group . users . Lookup By Email Response Ċ import Ġio . h nd rs . slack . api . contract . jackson . group . users . Successful Lookup By Email Response Ċ import Ġio . h nd rs . slack . api . group . Api Call Result Ċ import Ġio . h nd rs . slack . api . group . users . Users Lookup By Email Method Ċ import Ġio . h nd rs . slack . api . group . users . Users Method Group Ċ import Ġio . h nd rs . slack . api . spring . group . Rest Template Factory Ċ import Ġio . h nd rs . slack . api . spring . group . Slack RequestBuilder Ċ import Ġorg . springframework . web . client . Rest Template ĊĊ Ċ /** Ċ Ġ* ĠSpring Ġbased Ġimplementation Ġof Ġ[ Users Method Group . lookup By Email ] Ċ Ġ*/ Ċ @ Suppress (" UN CHECK ED _ CAST ") Ċ class ĠSpring Users Lookup By Email Method ( ĊĠĠĠ Ġprivate Ġval Ġauth Token : ĠString , ĊĠĠĠ Ġval Ġrest Template : ĠRest Template Ġ= Ġio . h nd rs . slack . api . spring . group . Rest Template Factory . slack Template () Ċ ) Ġ: Ġio . h nd rs . slack . api . group . users . Users Lookup By Email Method () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġrequest (): Ġio . h nd rs . slack . api . group . Api Call Result < Successful Lookup By Email Response , ĠError Lookup By Email Response > Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= ĠSlack RequestBuilder < Lookup By Email Response >( auth Token , Ġrest Template ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. to Method (" users . lookup By Email ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. return As Type ( Lookup By Email Response :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. post Url Encoded ( this . params . to Request Map ()) ĊĊĠĠĠĠĠĠĠ Ġreturn Ġwhen Ġ( response . body !! ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠSuccessful Lookup By Email Response Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġresponse Entity Ġ= Ġresponse . body Ġas ĠSuccessful Lookup By Email Response ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . on Success ?. invoke ( response Entity ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġio . h nd rs . slack . api . group . Api Call Result ( success Ġ= Ġresponse Entity ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠError Lookup By Email Response Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġresponse Entity Ġ= Ġresponse . body Ġas ĠError Lookup By Email Response ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . on Failure ?. invoke ( response Entity ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġio . h nd rs . slack . api . group . Api Call Result ( failure Ġ= Ġresponse Entity ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ