package Ġuk . gov . just ice . digital . h mp ps . manager ec alls api . documents Ċ Ċ import Ġorg . springframework . beans . factory . annotation . Value Ċ import Ġorg . springframework . http . Http Entity Ċ import Ġorg . springframework . http . MediaType . MULTI PART _ FORM _ DATA Ċ import Ġorg . springframework . stereotype . Component Ċ import Ġorg . springframework . util . Multi Value Map Ċ import Ġorg . springframework . web . reactive . function . client . Web Client Ċ import Ġreactor . core . publisher . Mono Ċ import Ġreactor . netty . http . client . HttpClient Request Ċ import Ġjava . time . Duration . of Seconds Ċ Ċ @ Component Ċ class ĠGot en berg Api ( ĊĠ Ġprivate Ġval Ġweb Client : ĠWeb Client , ĊĠ Ġ@ Value ("\ ${ got en berg . endpoint . url }") Ġprivate Ġval Ġgot en berg Endpoint Url : ĠString Ċ ) Ġ{ ĊĠ Ġfun Ġmerge ( merge Request : ĠMulti Value Map < String , ĠHttp Entity <* >> ): ĠMono < ByteArray > Ġ= ĊĠĠĠ Ġgot en berg Response ("/ merge ", Ġmerge Request ) ĊĊĠ Ġfun Ġconvert Html ( convert Html Request : ĠMulti Value Map < String , ĠHttp Entity <* >> ): ĠMono < ByteArray > Ġ= ĊĠĠĠ Ġgot en berg Response ("/ convert / html ", Ġconvert Html Request ) ĊĊĠ Ġprivate Ġfun Ġgot en berg Response ( ĊĠĠĠ Ġpath : ĠString , ĊĠĠĠ Ġdocument Body : ĠMulti Value Map < String , ĠHttp Entity <* >> ĊĠ Ġ) Ġ= Ġweb Client ĊĠĠĠ Ġ. post () ĊĠĠĠ Ġ. uri ("$ got en berg Endpoint Url $ path ") ĊĠĠĠ Ġ. httpRequest Ġ{ Ġit . get Native Request < HttpClient Request >(). response Timeout ( of Seconds ( 1 0 )) Ġ} ĊĠĠĠ Ġ. contentType ( MULTI PART _ FORM _ DATA ) ĊĠĠĠ Ġ. body Value ( document Body ) ĊĠĠĠ Ġ. retrieve () ĊĠĠĠ Ġ. body To Mono ( ByteArray :: class . java ) Ċ } Ċ