package Ġcom . k re ait . slack . api . spring . group . channels ĊĊ Ċ import Ġcom . k re ait . slack . api . contract . jackson . group . channels . Channel Un archive Response Ċ import Ġcom . k re ait . slack . api . contract . jackson . group . channels . Error Channel Un archive Response Ċ import Ġcom . k re ait . slack . api . contract . jackson . group . channels . Successful Channel Un archive Response Ċ import Ġcom . k re ait . slack . api . group . Api Call Result Ċ import Ġcom . k re ait . slack . api . group . channels . Channels Un archive Method Ċ import Ġcom . k re ait . slack . api . spring . group . Rest Template Factory Ċ import Ġcom . k re ait . slack . api . spring . group . Slack RequestBuilder Ċ import Ġorg . springframework . web . client . Rest Template ĊĊ Ċ /** Ċ Ġ* ĠSpring Ġbased Ġimplementation Ġof Ġ[ Channels Method Group . un archive ] Ċ Ġ*/ Ċ @ Suppress (" UN CHECK ED _ CAST ") Ċ class ĠSpring Channels Un archive Method ( private Ġval Ġauth Token : ĠString , Ġprivate Ġval Ġrest Template : ĠRest Template Ġ= ĠRest Template Factory . slack Template ()) Ġ: ĠChannels Un archive Method () Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġrequest (): ĠApi Call Result < Successful Channel Un archive Response , ĠError Channel Un archive Response > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= ĠSlack RequestBuilder < Channel Un archive Response >( auth Token , Ġrest Template ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. with ( this . params ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. to Method (" channels . un archive ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. return As Type ( Channel Un archive Response :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. post With Json Body () ĊĊĠĠĠĠĠĠĠ Ġreturn Ġwhen Ġ( response . body !! ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠSuccessful Channel Un archive Response Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġresponse Entity Ġ= Ġresponse . body Ġas ĠSuccessful Channel Un archive Response ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . on Success ?. invoke ( response Entity ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠApi Call Result ( success Ġ= Ġresponse Entity ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠError Channel Un archive Response Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġresponse Entity Ġ= Ġresponse . body Ġas ĠError Channel Un archive Response ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . on Failure ?. invoke ( response Entity ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠApi Call Result ( failure Ġ= Ġresponse Entity ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ