package Ġcom . network ed assets . git 4 c . core Ċ Ċ import Ġcom . atlassian . con fluence . core . service . Not Authorized Exception Ċ import Ġcom . network ed assets . git 4 c . application . Bus s ines Plugin Components Ċ import Ġcom . network ed assets . git 4 c . boundary . Get Branches By Document ations Macro Id Query Ċ import Ġcom . network ed assets . git 4 c . boundary . Get Branches By Document ations Macro Id Result Request Ċ import Ġcom . network ed assets . git 4 c . boundary . outbound . Branches Ċ import Ġcom . network ed assets . git 4 c . boundary . outbound . Verification Status Ċ import Ġcom . network ed assets . git 4 c . boundary . outbound . exceptions . NotFoundException Ċ import Ġcom . network ed assets . git 4 c . core . bus s iness . Computation Cache Ċ import Ġcom . network ed assets . git 4 c . core . datastore . repositories . Macro Settings Database Ċ import Ġcom . network ed assets . git 4 c . core . datastore . repositories . Repository Database Ċ import Ġcom . network ed assets . git 4 c . core . process . Get Branches Process Ċ import Ġcom . network ed assets . git 4 c . core . process . IC heck User Permission Process Ċ import Ġcom . network ed assets . git 4 c . core . use case . async . Computation Result UseCase Ċ import Ġcom . network ed assets . git 4 c . core . use case . async . Multi Thread Async UseCase Ċ import Ġcom . network ed assets . git 4 c . data . Macro Settings Ċ import Ġcom . network ed assets . git 4 c . data . Repository Ċ Ċ class ĠGet Branches By Document ations Macro Id UseCase ( ĊĠĠĠĠĠĠĠ Ġcomponents : ĠB uss ines Plugin Components , ĊĠĠĠĠĠĠĠ Ġval Ġget Branches Process : ĠGet Branches Process Ġ= Ġcomponents . processing . get Branches Process , ĊĠĠĠĠĠĠĠ Ġval Ġmacro Settings Database : ĠMacro Settings Database Ġ= Ġcomponents . providers . macro Settings Provider , ĊĠĠĠĠĠĠĠ Ġval Ġrepository Database : ĠRepository Database Ġ= Ġcomponents . providers . repository Provider , ĊĠĠĠĠĠĠĠ Ġval Ġcheck User Permission Process : ĠI Check User Permission Process Ġ= Ġcomponents . processing . check User Permission Process , ĊĠĠĠĠĠĠĠ Ġcomput ations : ĠComp utation Cache < Branches > Ġ= Ġcomponents . async . get Branches By Document ations Macro Id UseCase Cache Ċ ) Ġ: ĠMulti Thread Async UseCase < Get Branches By Document ations Macro Id Query , ĠBr anches > Ċ ( components , Ġcomput ations , Ġ 6 ) Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġexecuted Async ( requestId : ĠString , Ġrequest : ĠGet Branches By Document ations Macro Id Query ) Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġmacro Id Ġ= Ġrequest . macro Id ĊĠĠĠĠĠĠĠ Ġval Ġuser Ġ= Ġrequest . user ĊĊĠĠĠĠĠĠĠ Ġif Ġ( check User Permission Process . user Has Permission To Macro ( macro Id , Ġuser ) Ġ== Ġfalse ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġerror ( requestId , ĠNot Authorized Exception (" User Ġdoesn 't Ġhave Ġpermission Ġto Ġthis Ġspace ")) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġval Ġmacro Settings Ġ= Ġmacro Settings Database . get ( request . macro Id ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ?: Ġreturn Ġerror ( requestId , ĠNotFound Exception ( request . transaction Info , ĠVerification Status . RE MOVED )) ĊĠĠĠĠĠĠĠ Ġif Ġ( macro Settings . repository Uuid Ġ== Ġnull ) Ġreturn Ġerror ( requestId , ĠNotFound Exception ( request . transaction Info , ĠVerification Status . RE MOVED )) ĊĠĠĠĠĠĠĠ Ġval Ġrepository Ġ= Ġrepository Database . get ( macro Settings . repository Uuid ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ?: Ġreturn Ġerror ( requestId , ĠNotFound Exception ( request . transaction Info , ĠVerification Status . RE MOVED )) ĊĊĠĠĠĠĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġanswer Ġ= Ġget Branches ( macro Settings , Ġrepository ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsuccess ( requestId , Ġanswer ) ĊĠĠĠĠĠĠĠ Ġ} Ġcatch Ġ( e : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġerror ( requestId , Ġe ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġget Branches ( macro Settings : ĠMacro Settings , Ġrepository : ĠRepository ) Ġ= Ġget Branches Process . fetch Branch List ( macro Settings , Ġrepository ) Ċ } Ċ Ċ class ĠGet Branches By Document ations Macro Id Result UseCase ( ĊĠĠĠĠĠĠĠ Ġcomponents : ĠB uss ines Plugin Components , ĊĠĠĠĠĠĠĠ Ġcomput ations : ĠComp utation Cache < Branches > Ġ= Ġcomponents . async . get Branches By Document ations Macro Id UseCase Cache Ċ ) Ġ: ĠComp utation Result UseCase < Get Branches By Document ations Macro Id Result Request , ĠBr anches >( components , Ġcomput ations )