generated-client.go 116 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872
  1. // Package client provides primitives to interact with the openapi HTTP API.
  2. //
  3. // Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
  4. package client
  5. import (
  6. "bytes"
  7. "context"
  8. "encoding/json"
  9. "errors"
  10. "fmt"
  11. "io"
  12. "net/http"
  13. "net/url"
  14. "strings"
  15. "github.com/oapi-codegen/runtime"
  16. )
  17. // Defines values for MessageInfoRole.
  18. const (
  19. Assistant MessageInfoRole = "assistant"
  20. User MessageInfoRole = "user"
  21. )
  22. // AppInfo defines model for App.Info.
  23. type AppInfo struct {
  24. Git bool `json:"git"`
  25. Path struct {
  26. Config string `json:"config"`
  27. Cwd string `json:"cwd"`
  28. Data string `json:"data"`
  29. Root string `json:"root"`
  30. State string `json:"state"`
  31. } `json:"path"`
  32. Time struct {
  33. Initialized *float32 `json:"initialized,omitempty"`
  34. } `json:"time"`
  35. User string `json:"user"`
  36. }
  37. // ConfigInfo defines model for Config.Info.
  38. type ConfigInfo struct {
  39. // Schema JSON schema reference for configuration validation
  40. Schema *string `json:"$schema,omitempty"`
  41. // Autoshare Share newly created sessions automatically
  42. Autoshare *bool `json:"autoshare,omitempty"`
  43. // Autoupdate Automatically update to the latest version
  44. Autoupdate *bool `json:"autoupdate,omitempty"`
  45. // DisabledProviders Disable providers that are loaded automatically
  46. DisabledProviders *[]string `json:"disabled_providers,omitempty"`
  47. Keybinds *ConfigKeybinds `json:"keybinds,omitempty"`
  48. // Mcp MCP (Model Context Protocol) server configurations
  49. Mcp *map[string]ConfigInfo_Mcp_AdditionalProperties `json:"mcp,omitempty"`
  50. // Model Model to use in the format of provider/model, eg anthropic/claude-2
  51. Model *string `json:"model,omitempty"`
  52. // Provider Custom provider configurations and model overrides
  53. Provider *map[string]struct {
  54. Api *string `json:"api,omitempty"`
  55. Env *[]string `json:"env,omitempty"`
  56. Id *string `json:"id,omitempty"`
  57. Models map[string]struct {
  58. Attachment *bool `json:"attachment,omitempty"`
  59. Cost *struct {
  60. CacheRead *float32 `json:"cache_read,omitempty"`
  61. CacheWrite *float32 `json:"cache_write,omitempty"`
  62. Input float32 `json:"input"`
  63. Output float32 `json:"output"`
  64. } `json:"cost,omitempty"`
  65. Id *string `json:"id,omitempty"`
  66. Limit *struct {
  67. Context float32 `json:"context"`
  68. Output float32 `json:"output"`
  69. } `json:"limit,omitempty"`
  70. Name *string `json:"name,omitempty"`
  71. Options *map[string]interface{} `json:"options,omitempty"`
  72. Reasoning *bool `json:"reasoning,omitempty"`
  73. Temperature *bool `json:"temperature,omitempty"`
  74. ToolCall *bool `json:"tool_call,omitempty"`
  75. } `json:"models"`
  76. Name *string `json:"name,omitempty"`
  77. Npm *string `json:"npm,omitempty"`
  78. Options *map[string]interface{} `json:"options,omitempty"`
  79. } `json:"provider,omitempty"`
  80. // Theme Theme name to use for the interface
  81. Theme *string `json:"theme,omitempty"`
  82. }
  83. // ConfigInfo_Mcp_AdditionalProperties defines model for Config.Info.mcp.AdditionalProperties.
  84. type ConfigInfo_Mcp_AdditionalProperties struct {
  85. union json.RawMessage
  86. }
  87. // ConfigKeybinds defines model for Config.Keybinds.
  88. type ConfigKeybinds struct {
  89. // AppExit Exit the application
  90. AppExit *string `json:"app_exit,omitempty"`
  91. // EditorOpen Open external editor
  92. EditorOpen *string `json:"editor_open,omitempty"`
  93. // Help Show help dialog
  94. Help *string `json:"help,omitempty"`
  95. // HistoryNext Navigate to next history item
  96. HistoryNext *string `json:"history_next,omitempty"`
  97. // HistoryPrevious Navigate to previous history item
  98. HistoryPrevious *string `json:"history_previous,omitempty"`
  99. // InputClear Clear input field
  100. InputClear *string `json:"input_clear,omitempty"`
  101. // InputNewline Insert newline in input
  102. InputNewline *string `json:"input_newline,omitempty"`
  103. // InputPaste Paste from clipboard
  104. InputPaste *string `json:"input_paste,omitempty"`
  105. // InputSubmit Submit input
  106. InputSubmit *string `json:"input_submit,omitempty"`
  107. // Leader Leader key for keybind combinations
  108. Leader *string `json:"leader,omitempty"`
  109. // MessagesFirst Navigate to first message
  110. MessagesFirst *string `json:"messages_first,omitempty"`
  111. // MessagesHalfPageDown Scroll messages down by half page
  112. MessagesHalfPageDown *string `json:"messages_half_page_down,omitempty"`
  113. // MessagesHalfPageUp Scroll messages up by half page
  114. MessagesHalfPageUp *string `json:"messages_half_page_up,omitempty"`
  115. // MessagesLast Navigate to last message
  116. MessagesLast *string `json:"messages_last,omitempty"`
  117. // MessagesNext Navigate to next message
  118. MessagesNext *string `json:"messages_next,omitempty"`
  119. // MessagesPageDown Scroll messages down by one page
  120. MessagesPageDown *string `json:"messages_page_down,omitempty"`
  121. // MessagesPageUp Scroll messages up by one page
  122. MessagesPageUp *string `json:"messages_page_up,omitempty"`
  123. // MessagesPrevious Navigate to previous message
  124. MessagesPrevious *string `json:"messages_previous,omitempty"`
  125. // ModelList List available models
  126. ModelList *string `json:"model_list,omitempty"`
  127. // ProjectInit Initialize project configuration
  128. ProjectInit *string `json:"project_init,omitempty"`
  129. // SessionCompact Toggle compact mode for session
  130. SessionCompact *string `json:"session_compact,omitempty"`
  131. // SessionInterrupt Interrupt current session
  132. SessionInterrupt *string `json:"session_interrupt,omitempty"`
  133. // SessionList List all sessions
  134. SessionList *string `json:"session_list,omitempty"`
  135. // SessionNew Create a new session
  136. SessionNew *string `json:"session_new,omitempty"`
  137. // SessionShare Share current session
  138. SessionShare *string `json:"session_share,omitempty"`
  139. // ThemeList List available themes
  140. ThemeList *string `json:"theme_list,omitempty"`
  141. // ToolDetails Show tool details
  142. ToolDetails *string `json:"tool_details,omitempty"`
  143. }
  144. // ConfigMcpLocal defines model for Config.McpLocal.
  145. type ConfigMcpLocal struct {
  146. // Command Command and arguments to run the MCP server
  147. Command []string `json:"command"`
  148. // Environment Environment variables to set when running the MCP server
  149. Environment *map[string]string `json:"environment,omitempty"`
  150. // Type Type of MCP server connection
  151. Type string `json:"type"`
  152. }
  153. // ConfigMcpRemote defines model for Config.McpRemote.
  154. type ConfigMcpRemote struct {
  155. // Type Type of MCP server connection
  156. Type string `json:"type"`
  157. // Url URL of the remote MCP server
  158. Url string `json:"url"`
  159. }
  160. // Error defines model for Error.
  161. type Error struct {
  162. Data map[string]interface{} `json:"data"`
  163. }
  164. // Event defines model for Event.
  165. type Event struct {
  166. union json.RawMessage
  167. }
  168. // EventInstallationUpdated defines model for Event.installation.updated.
  169. type EventInstallationUpdated struct {
  170. Properties struct {
  171. Version string `json:"version"`
  172. } `json:"properties"`
  173. Type string `json:"type"`
  174. }
  175. // EventLspClientDiagnostics defines model for Event.lsp.client.diagnostics.
  176. type EventLspClientDiagnostics struct {
  177. Properties struct {
  178. Path string `json:"path"`
  179. ServerID string `json:"serverID"`
  180. } `json:"properties"`
  181. Type string `json:"type"`
  182. }
  183. // EventMessagePartUpdated defines model for Event.message.part.updated.
  184. type EventMessagePartUpdated struct {
  185. Properties struct {
  186. MessageID string `json:"messageID"`
  187. Part MessagePart `json:"part"`
  188. SessionID string `json:"sessionID"`
  189. } `json:"properties"`
  190. Type string `json:"type"`
  191. }
  192. // EventMessageUpdated defines model for Event.message.updated.
  193. type EventMessageUpdated struct {
  194. Properties struct {
  195. Info MessageInfo `json:"info"`
  196. } `json:"properties"`
  197. Type string `json:"type"`
  198. }
  199. // EventPermissionUpdated defines model for Event.permission.updated.
  200. type EventPermissionUpdated struct {
  201. Properties PermissionInfo `json:"properties"`
  202. Type string `json:"type"`
  203. }
  204. // EventSessionDeleted defines model for Event.session.deleted.
  205. type EventSessionDeleted struct {
  206. Properties struct {
  207. Info SessionInfo `json:"info"`
  208. } `json:"properties"`
  209. Type string `json:"type"`
  210. }
  211. // EventSessionError defines model for Event.session.error.
  212. type EventSessionError struct {
  213. Properties struct {
  214. Error *EventSessionError_Properties_Error `json:"error,omitempty"`
  215. } `json:"properties"`
  216. Type string `json:"type"`
  217. }
  218. // EventSessionError_Properties_Error defines model for EventSessionError.Properties.Error.
  219. type EventSessionError_Properties_Error struct {
  220. union json.RawMessage
  221. }
  222. // EventSessionUpdated defines model for Event.session.updated.
  223. type EventSessionUpdated struct {
  224. Properties struct {
  225. Info SessionInfo `json:"info"`
  226. } `json:"properties"`
  227. Type string `json:"type"`
  228. }
  229. // EventStorageWrite defines model for Event.storage.write.
  230. type EventStorageWrite struct {
  231. Properties struct {
  232. Content *interface{} `json:"content,omitempty"`
  233. Key string `json:"key"`
  234. } `json:"properties"`
  235. Type string `json:"type"`
  236. }
  237. // InstallationInfo defines model for InstallationInfo.
  238. type InstallationInfo struct {
  239. Latest string `json:"latest"`
  240. Version string `json:"version"`
  241. }
  242. // MessageInfo defines model for Message.Info.
  243. type MessageInfo struct {
  244. Id string `json:"id"`
  245. Metadata MessageMetadata `json:"metadata"`
  246. Parts []MessagePart `json:"parts"`
  247. Role MessageInfoRole `json:"role"`
  248. }
  249. // MessageInfoRole defines model for MessageInfo.Role.
  250. type MessageInfoRole string
  251. // MessageMetadata defines model for Message.Metadata.
  252. type MessageMetadata struct {
  253. Assistant *struct {
  254. Cost float32 `json:"cost"`
  255. ModelID string `json:"modelID"`
  256. Path struct {
  257. Cwd string `json:"cwd"`
  258. Root string `json:"root"`
  259. } `json:"path"`
  260. ProviderID string `json:"providerID"`
  261. Summary *bool `json:"summary,omitempty"`
  262. System []string `json:"system"`
  263. Tokens struct {
  264. Cache struct {
  265. Read float32 `json:"read"`
  266. Write float32 `json:"write"`
  267. } `json:"cache"`
  268. Input float32 `json:"input"`
  269. Output float32 `json:"output"`
  270. Reasoning float32 `json:"reasoning"`
  271. } `json:"tokens"`
  272. } `json:"assistant,omitempty"`
  273. Error *MessageMetadata_Error `json:"error,omitempty"`
  274. SessionID string `json:"sessionID"`
  275. Time struct {
  276. Completed *float32 `json:"completed,omitempty"`
  277. Created float32 `json:"created"`
  278. } `json:"time"`
  279. Tool map[string]MessageMetadata_Tool_AdditionalProperties `json:"tool"`
  280. }
  281. // MessageMetadata_Error defines model for MessageMetadata.Error.
  282. type MessageMetadata_Error struct {
  283. union json.RawMessage
  284. }
  285. // MessageMetadata_Tool_AdditionalProperties defines model for Message.Metadata.tool.AdditionalProperties.
  286. type MessageMetadata_Tool_AdditionalProperties struct {
  287. Time struct {
  288. End float32 `json:"end"`
  289. Start float32 `json:"start"`
  290. } `json:"time"`
  291. Title string `json:"title"`
  292. AdditionalProperties map[string]interface{} `json:"-"`
  293. }
  294. // MessagePart defines model for Message.Part.
  295. type MessagePart struct {
  296. union json.RawMessage
  297. }
  298. // MessagePartFile defines model for Message.Part.File.
  299. type MessagePartFile struct {
  300. Filename *string `json:"filename,omitempty"`
  301. MediaType string `json:"mediaType"`
  302. Type string `json:"type"`
  303. Url string `json:"url"`
  304. }
  305. // MessagePartReasoning defines model for Message.Part.Reasoning.
  306. type MessagePartReasoning struct {
  307. ProviderMetadata *map[string]interface{} `json:"providerMetadata,omitempty"`
  308. Text string `json:"text"`
  309. Type string `json:"type"`
  310. }
  311. // MessagePartSourceUrl defines model for Message.Part.SourceUrl.
  312. type MessagePartSourceUrl struct {
  313. ProviderMetadata *map[string]interface{} `json:"providerMetadata,omitempty"`
  314. SourceId string `json:"sourceId"`
  315. Title *string `json:"title,omitempty"`
  316. Type string `json:"type"`
  317. Url string `json:"url"`
  318. }
  319. // MessagePartStepStart defines model for Message.Part.StepStart.
  320. type MessagePartStepStart struct {
  321. Type string `json:"type"`
  322. }
  323. // MessagePartText defines model for Message.Part.Text.
  324. type MessagePartText struct {
  325. Text string `json:"text"`
  326. Type string `json:"type"`
  327. }
  328. // MessagePartToolInvocation defines model for Message.Part.ToolInvocation.
  329. type MessagePartToolInvocation struct {
  330. ToolInvocation MessageToolInvocation `json:"toolInvocation"`
  331. Type string `json:"type"`
  332. }
  333. // MessageToolInvocation defines model for Message.ToolInvocation.
  334. type MessageToolInvocation struct {
  335. union json.RawMessage
  336. }
  337. // MessageToolInvocationToolCall defines model for Message.ToolInvocation.ToolCall.
  338. type MessageToolInvocationToolCall struct {
  339. Args *interface{} `json:"args,omitempty"`
  340. State string `json:"state"`
  341. Step *float32 `json:"step,omitempty"`
  342. ToolCallId string `json:"toolCallId"`
  343. ToolName string `json:"toolName"`
  344. }
  345. // MessageToolInvocationToolPartialCall defines model for Message.ToolInvocation.ToolPartialCall.
  346. type MessageToolInvocationToolPartialCall struct {
  347. Args *interface{} `json:"args,omitempty"`
  348. State string `json:"state"`
  349. Step *float32 `json:"step,omitempty"`
  350. ToolCallId string `json:"toolCallId"`
  351. ToolName string `json:"toolName"`
  352. }
  353. // MessageToolInvocationToolResult defines model for Message.ToolInvocation.ToolResult.
  354. type MessageToolInvocationToolResult struct {
  355. Args *interface{} `json:"args,omitempty"`
  356. Result string `json:"result"`
  357. State string `json:"state"`
  358. Step *float32 `json:"step,omitempty"`
  359. ToolCallId string `json:"toolCallId"`
  360. ToolName string `json:"toolName"`
  361. }
  362. // ModelInfo defines model for Model.Info.
  363. type ModelInfo struct {
  364. Attachment bool `json:"attachment"`
  365. Cost struct {
  366. CacheRead *float32 `json:"cache_read,omitempty"`
  367. CacheWrite *float32 `json:"cache_write,omitempty"`
  368. Input float32 `json:"input"`
  369. Output float32 `json:"output"`
  370. } `json:"cost"`
  371. Id string `json:"id"`
  372. Limit struct {
  373. Context float32 `json:"context"`
  374. Output float32 `json:"output"`
  375. } `json:"limit"`
  376. Name string `json:"name"`
  377. Options map[string]interface{} `json:"options"`
  378. Reasoning bool `json:"reasoning"`
  379. Temperature bool `json:"temperature"`
  380. ToolCall bool `json:"tool_call"`
  381. }
  382. // ProviderInfo defines model for Provider.Info.
  383. type ProviderInfo struct {
  384. Api *string `json:"api,omitempty"`
  385. Env []string `json:"env"`
  386. Id string `json:"id"`
  387. Models map[string]ModelInfo `json:"models"`
  388. Name string `json:"name"`
  389. Npm *string `json:"npm,omitempty"`
  390. }
  391. // ProviderAuthError defines model for ProviderAuthError.
  392. type ProviderAuthError struct {
  393. Data struct {
  394. Message string `json:"message"`
  395. ProviderID string `json:"providerID"`
  396. } `json:"data"`
  397. Name string `json:"name"`
  398. }
  399. // UnknownError defines model for UnknownError.
  400. type UnknownError struct {
  401. Data struct {
  402. Message string `json:"message"`
  403. } `json:"data"`
  404. Name string `json:"name"`
  405. }
  406. // PermissionInfo defines model for permission.info.
  407. type PermissionInfo struct {
  408. Id string `json:"id"`
  409. Metadata map[string]interface{} `json:"metadata"`
  410. SessionID string `json:"sessionID"`
  411. Time struct {
  412. Created float32 `json:"created"`
  413. } `json:"time"`
  414. Title string `json:"title"`
  415. }
  416. // SessionInfo defines model for session.info.
  417. type SessionInfo struct {
  418. Id string `json:"id"`
  419. ParentID *string `json:"parentID,omitempty"`
  420. Share *struct {
  421. Url string `json:"url"`
  422. } `json:"share,omitempty"`
  423. Time struct {
  424. Created float32 `json:"created"`
  425. Updated float32 `json:"updated"`
  426. } `json:"time"`
  427. Title string `json:"title"`
  428. Version string `json:"version"`
  429. }
  430. // PostFileSearchJSONBody defines parameters for PostFileSearch.
  431. type PostFileSearchJSONBody struct {
  432. Query string `json:"query"`
  433. }
  434. // PostSessionAbortJSONBody defines parameters for PostSessionAbort.
  435. type PostSessionAbortJSONBody struct {
  436. SessionID string `json:"sessionID"`
  437. }
  438. // PostSessionChatJSONBody defines parameters for PostSessionChat.
  439. type PostSessionChatJSONBody struct {
  440. ModelID string `json:"modelID"`
  441. Parts []MessagePart `json:"parts"`
  442. ProviderID string `json:"providerID"`
  443. SessionID string `json:"sessionID"`
  444. }
  445. // PostSessionDeleteJSONBody defines parameters for PostSessionDelete.
  446. type PostSessionDeleteJSONBody struct {
  447. SessionID string `json:"sessionID"`
  448. }
  449. // PostSessionInitializeJSONBody defines parameters for PostSessionInitialize.
  450. type PostSessionInitializeJSONBody struct {
  451. ModelID string `json:"modelID"`
  452. ProviderID string `json:"providerID"`
  453. SessionID string `json:"sessionID"`
  454. }
  455. // PostSessionMessagesJSONBody defines parameters for PostSessionMessages.
  456. type PostSessionMessagesJSONBody struct {
  457. SessionID string `json:"sessionID"`
  458. }
  459. // PostSessionShareJSONBody defines parameters for PostSessionShare.
  460. type PostSessionShareJSONBody struct {
  461. SessionID string `json:"sessionID"`
  462. }
  463. // PostSessionSummarizeJSONBody defines parameters for PostSessionSummarize.
  464. type PostSessionSummarizeJSONBody struct {
  465. ModelID string `json:"modelID"`
  466. ProviderID string `json:"providerID"`
  467. SessionID string `json:"sessionID"`
  468. }
  469. // PostSessionUnshareJSONBody defines parameters for PostSessionUnshare.
  470. type PostSessionUnshareJSONBody struct {
  471. SessionID string `json:"sessionID"`
  472. }
  473. // PostFileSearchJSONRequestBody defines body for PostFileSearch for application/json ContentType.
  474. type PostFileSearchJSONRequestBody PostFileSearchJSONBody
  475. // PostSessionAbortJSONRequestBody defines body for PostSessionAbort for application/json ContentType.
  476. type PostSessionAbortJSONRequestBody PostSessionAbortJSONBody
  477. // PostSessionChatJSONRequestBody defines body for PostSessionChat for application/json ContentType.
  478. type PostSessionChatJSONRequestBody PostSessionChatJSONBody
  479. // PostSessionDeleteJSONRequestBody defines body for PostSessionDelete for application/json ContentType.
  480. type PostSessionDeleteJSONRequestBody PostSessionDeleteJSONBody
  481. // PostSessionInitializeJSONRequestBody defines body for PostSessionInitialize for application/json ContentType.
  482. type PostSessionInitializeJSONRequestBody PostSessionInitializeJSONBody
  483. // PostSessionMessagesJSONRequestBody defines body for PostSessionMessages for application/json ContentType.
  484. type PostSessionMessagesJSONRequestBody PostSessionMessagesJSONBody
  485. // PostSessionShareJSONRequestBody defines body for PostSessionShare for application/json ContentType.
  486. type PostSessionShareJSONRequestBody PostSessionShareJSONBody
  487. // PostSessionSummarizeJSONRequestBody defines body for PostSessionSummarize for application/json ContentType.
  488. type PostSessionSummarizeJSONRequestBody PostSessionSummarizeJSONBody
  489. // PostSessionUnshareJSONRequestBody defines body for PostSessionUnshare for application/json ContentType.
  490. type PostSessionUnshareJSONRequestBody PostSessionUnshareJSONBody
  491. // Getter for additional properties for MessageMetadata_Tool_AdditionalProperties. Returns the specified
  492. // element and whether it was found
  493. func (a MessageMetadata_Tool_AdditionalProperties) Get(fieldName string) (value interface{}, found bool) {
  494. if a.AdditionalProperties != nil {
  495. value, found = a.AdditionalProperties[fieldName]
  496. }
  497. return
  498. }
  499. // Setter for additional properties for MessageMetadata_Tool_AdditionalProperties
  500. func (a *MessageMetadata_Tool_AdditionalProperties) Set(fieldName string, value interface{}) {
  501. if a.AdditionalProperties == nil {
  502. a.AdditionalProperties = make(map[string]interface{})
  503. }
  504. a.AdditionalProperties[fieldName] = value
  505. }
  506. // Override default JSON handling for MessageMetadata_Tool_AdditionalProperties to handle AdditionalProperties
  507. func (a *MessageMetadata_Tool_AdditionalProperties) UnmarshalJSON(b []byte) error {
  508. object := make(map[string]json.RawMessage)
  509. err := json.Unmarshal(b, &object)
  510. if err != nil {
  511. return err
  512. }
  513. if raw, found := object["time"]; found {
  514. err = json.Unmarshal(raw, &a.Time)
  515. if err != nil {
  516. return fmt.Errorf("error reading 'time': %w", err)
  517. }
  518. delete(object, "time")
  519. }
  520. if raw, found := object["title"]; found {
  521. err = json.Unmarshal(raw, &a.Title)
  522. if err != nil {
  523. return fmt.Errorf("error reading 'title': %w", err)
  524. }
  525. delete(object, "title")
  526. }
  527. if len(object) != 0 {
  528. a.AdditionalProperties = make(map[string]interface{})
  529. for fieldName, fieldBuf := range object {
  530. var fieldVal interface{}
  531. err := json.Unmarshal(fieldBuf, &fieldVal)
  532. if err != nil {
  533. return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err)
  534. }
  535. a.AdditionalProperties[fieldName] = fieldVal
  536. }
  537. }
  538. return nil
  539. }
  540. // Override default JSON handling for MessageMetadata_Tool_AdditionalProperties to handle AdditionalProperties
  541. func (a MessageMetadata_Tool_AdditionalProperties) MarshalJSON() ([]byte, error) {
  542. var err error
  543. object := make(map[string]json.RawMessage)
  544. object["time"], err = json.Marshal(a.Time)
  545. if err != nil {
  546. return nil, fmt.Errorf("error marshaling 'time': %w", err)
  547. }
  548. object["title"], err = json.Marshal(a.Title)
  549. if err != nil {
  550. return nil, fmt.Errorf("error marshaling 'title': %w", err)
  551. }
  552. for fieldName, field := range a.AdditionalProperties {
  553. object[fieldName], err = json.Marshal(field)
  554. if err != nil {
  555. return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err)
  556. }
  557. }
  558. return json.Marshal(object)
  559. }
  560. // AsConfigMcpLocal returns the union data inside the ConfigInfo_Mcp_AdditionalProperties as a ConfigMcpLocal
  561. func (t ConfigInfo_Mcp_AdditionalProperties) AsConfigMcpLocal() (ConfigMcpLocal, error) {
  562. var body ConfigMcpLocal
  563. err := json.Unmarshal(t.union, &body)
  564. return body, err
  565. }
  566. // FromConfigMcpLocal overwrites any union data inside the ConfigInfo_Mcp_AdditionalProperties as the provided ConfigMcpLocal
  567. func (t *ConfigInfo_Mcp_AdditionalProperties) FromConfigMcpLocal(v ConfigMcpLocal) error {
  568. v.Type = "local"
  569. b, err := json.Marshal(v)
  570. t.union = b
  571. return err
  572. }
  573. // MergeConfigMcpLocal performs a merge with any union data inside the ConfigInfo_Mcp_AdditionalProperties, using the provided ConfigMcpLocal
  574. func (t *ConfigInfo_Mcp_AdditionalProperties) MergeConfigMcpLocal(v ConfigMcpLocal) error {
  575. v.Type = "local"
  576. b, err := json.Marshal(v)
  577. if err != nil {
  578. return err
  579. }
  580. merged, err := runtime.JSONMerge(t.union, b)
  581. t.union = merged
  582. return err
  583. }
  584. // AsConfigMcpRemote returns the union data inside the ConfigInfo_Mcp_AdditionalProperties as a ConfigMcpRemote
  585. func (t ConfigInfo_Mcp_AdditionalProperties) AsConfigMcpRemote() (ConfigMcpRemote, error) {
  586. var body ConfigMcpRemote
  587. err := json.Unmarshal(t.union, &body)
  588. return body, err
  589. }
  590. // FromConfigMcpRemote overwrites any union data inside the ConfigInfo_Mcp_AdditionalProperties as the provided ConfigMcpRemote
  591. func (t *ConfigInfo_Mcp_AdditionalProperties) FromConfigMcpRemote(v ConfigMcpRemote) error {
  592. v.Type = "remote"
  593. b, err := json.Marshal(v)
  594. t.union = b
  595. return err
  596. }
  597. // MergeConfigMcpRemote performs a merge with any union data inside the ConfigInfo_Mcp_AdditionalProperties, using the provided ConfigMcpRemote
  598. func (t *ConfigInfo_Mcp_AdditionalProperties) MergeConfigMcpRemote(v ConfigMcpRemote) error {
  599. v.Type = "remote"
  600. b, err := json.Marshal(v)
  601. if err != nil {
  602. return err
  603. }
  604. merged, err := runtime.JSONMerge(t.union, b)
  605. t.union = merged
  606. return err
  607. }
  608. func (t ConfigInfo_Mcp_AdditionalProperties) Discriminator() (string, error) {
  609. var discriminator struct {
  610. Discriminator string `json:"type"`
  611. }
  612. err := json.Unmarshal(t.union, &discriminator)
  613. return discriminator.Discriminator, err
  614. }
  615. func (t ConfigInfo_Mcp_AdditionalProperties) ValueByDiscriminator() (interface{}, error) {
  616. discriminator, err := t.Discriminator()
  617. if err != nil {
  618. return nil, err
  619. }
  620. switch discriminator {
  621. case "local":
  622. return t.AsConfigMcpLocal()
  623. case "remote":
  624. return t.AsConfigMcpRemote()
  625. default:
  626. return nil, errors.New("unknown discriminator value: " + discriminator)
  627. }
  628. }
  629. func (t ConfigInfo_Mcp_AdditionalProperties) MarshalJSON() ([]byte, error) {
  630. b, err := t.union.MarshalJSON()
  631. return b, err
  632. }
  633. func (t *ConfigInfo_Mcp_AdditionalProperties) UnmarshalJSON(b []byte) error {
  634. err := t.union.UnmarshalJSON(b)
  635. return err
  636. }
  637. // AsEventStorageWrite returns the union data inside the Event as a EventStorageWrite
  638. func (t Event) AsEventStorageWrite() (EventStorageWrite, error) {
  639. var body EventStorageWrite
  640. err := json.Unmarshal(t.union, &body)
  641. return body, err
  642. }
  643. // FromEventStorageWrite overwrites any union data inside the Event as the provided EventStorageWrite
  644. func (t *Event) FromEventStorageWrite(v EventStorageWrite) error {
  645. v.Type = "storage.write"
  646. b, err := json.Marshal(v)
  647. t.union = b
  648. return err
  649. }
  650. // MergeEventStorageWrite performs a merge with any union data inside the Event, using the provided EventStorageWrite
  651. func (t *Event) MergeEventStorageWrite(v EventStorageWrite) error {
  652. v.Type = "storage.write"
  653. b, err := json.Marshal(v)
  654. if err != nil {
  655. return err
  656. }
  657. merged, err := runtime.JSONMerge(t.union, b)
  658. t.union = merged
  659. return err
  660. }
  661. // AsEventInstallationUpdated returns the union data inside the Event as a EventInstallationUpdated
  662. func (t Event) AsEventInstallationUpdated() (EventInstallationUpdated, error) {
  663. var body EventInstallationUpdated
  664. err := json.Unmarshal(t.union, &body)
  665. return body, err
  666. }
  667. // FromEventInstallationUpdated overwrites any union data inside the Event as the provided EventInstallationUpdated
  668. func (t *Event) FromEventInstallationUpdated(v EventInstallationUpdated) error {
  669. v.Type = "installation.updated"
  670. b, err := json.Marshal(v)
  671. t.union = b
  672. return err
  673. }
  674. // MergeEventInstallationUpdated performs a merge with any union data inside the Event, using the provided EventInstallationUpdated
  675. func (t *Event) MergeEventInstallationUpdated(v EventInstallationUpdated) error {
  676. v.Type = "installation.updated"
  677. b, err := json.Marshal(v)
  678. if err != nil {
  679. return err
  680. }
  681. merged, err := runtime.JSONMerge(t.union, b)
  682. t.union = merged
  683. return err
  684. }
  685. // AsEventLspClientDiagnostics returns the union data inside the Event as a EventLspClientDiagnostics
  686. func (t Event) AsEventLspClientDiagnostics() (EventLspClientDiagnostics, error) {
  687. var body EventLspClientDiagnostics
  688. err := json.Unmarshal(t.union, &body)
  689. return body, err
  690. }
  691. // FromEventLspClientDiagnostics overwrites any union data inside the Event as the provided EventLspClientDiagnostics
  692. func (t *Event) FromEventLspClientDiagnostics(v EventLspClientDiagnostics) error {
  693. v.Type = "lsp.client.diagnostics"
  694. b, err := json.Marshal(v)
  695. t.union = b
  696. return err
  697. }
  698. // MergeEventLspClientDiagnostics performs a merge with any union data inside the Event, using the provided EventLspClientDiagnostics
  699. func (t *Event) MergeEventLspClientDiagnostics(v EventLspClientDiagnostics) error {
  700. v.Type = "lsp.client.diagnostics"
  701. b, err := json.Marshal(v)
  702. if err != nil {
  703. return err
  704. }
  705. merged, err := runtime.JSONMerge(t.union, b)
  706. t.union = merged
  707. return err
  708. }
  709. // AsEventPermissionUpdated returns the union data inside the Event as a EventPermissionUpdated
  710. func (t Event) AsEventPermissionUpdated() (EventPermissionUpdated, error) {
  711. var body EventPermissionUpdated
  712. err := json.Unmarshal(t.union, &body)
  713. return body, err
  714. }
  715. // FromEventPermissionUpdated overwrites any union data inside the Event as the provided EventPermissionUpdated
  716. func (t *Event) FromEventPermissionUpdated(v EventPermissionUpdated) error {
  717. v.Type = "permission.updated"
  718. b, err := json.Marshal(v)
  719. t.union = b
  720. return err
  721. }
  722. // MergeEventPermissionUpdated performs a merge with any union data inside the Event, using the provided EventPermissionUpdated
  723. func (t *Event) MergeEventPermissionUpdated(v EventPermissionUpdated) error {
  724. v.Type = "permission.updated"
  725. b, err := json.Marshal(v)
  726. if err != nil {
  727. return err
  728. }
  729. merged, err := runtime.JSONMerge(t.union, b)
  730. t.union = merged
  731. return err
  732. }
  733. // AsEventMessageUpdated returns the union data inside the Event as a EventMessageUpdated
  734. func (t Event) AsEventMessageUpdated() (EventMessageUpdated, error) {
  735. var body EventMessageUpdated
  736. err := json.Unmarshal(t.union, &body)
  737. return body, err
  738. }
  739. // FromEventMessageUpdated overwrites any union data inside the Event as the provided EventMessageUpdated
  740. func (t *Event) FromEventMessageUpdated(v EventMessageUpdated) error {
  741. v.Type = "message.updated"
  742. b, err := json.Marshal(v)
  743. t.union = b
  744. return err
  745. }
  746. // MergeEventMessageUpdated performs a merge with any union data inside the Event, using the provided EventMessageUpdated
  747. func (t *Event) MergeEventMessageUpdated(v EventMessageUpdated) error {
  748. v.Type = "message.updated"
  749. b, err := json.Marshal(v)
  750. if err != nil {
  751. return err
  752. }
  753. merged, err := runtime.JSONMerge(t.union, b)
  754. t.union = merged
  755. return err
  756. }
  757. // AsEventMessagePartUpdated returns the union data inside the Event as a EventMessagePartUpdated
  758. func (t Event) AsEventMessagePartUpdated() (EventMessagePartUpdated, error) {
  759. var body EventMessagePartUpdated
  760. err := json.Unmarshal(t.union, &body)
  761. return body, err
  762. }
  763. // FromEventMessagePartUpdated overwrites any union data inside the Event as the provided EventMessagePartUpdated
  764. func (t *Event) FromEventMessagePartUpdated(v EventMessagePartUpdated) error {
  765. v.Type = "message.part.updated"
  766. b, err := json.Marshal(v)
  767. t.union = b
  768. return err
  769. }
  770. // MergeEventMessagePartUpdated performs a merge with any union data inside the Event, using the provided EventMessagePartUpdated
  771. func (t *Event) MergeEventMessagePartUpdated(v EventMessagePartUpdated) error {
  772. v.Type = "message.part.updated"
  773. b, err := json.Marshal(v)
  774. if err != nil {
  775. return err
  776. }
  777. merged, err := runtime.JSONMerge(t.union, b)
  778. t.union = merged
  779. return err
  780. }
  781. // AsEventSessionUpdated returns the union data inside the Event as a EventSessionUpdated
  782. func (t Event) AsEventSessionUpdated() (EventSessionUpdated, error) {
  783. var body EventSessionUpdated
  784. err := json.Unmarshal(t.union, &body)
  785. return body, err
  786. }
  787. // FromEventSessionUpdated overwrites any union data inside the Event as the provided EventSessionUpdated
  788. func (t *Event) FromEventSessionUpdated(v EventSessionUpdated) error {
  789. v.Type = "session.updated"
  790. b, err := json.Marshal(v)
  791. t.union = b
  792. return err
  793. }
  794. // MergeEventSessionUpdated performs a merge with any union data inside the Event, using the provided EventSessionUpdated
  795. func (t *Event) MergeEventSessionUpdated(v EventSessionUpdated) error {
  796. v.Type = "session.updated"
  797. b, err := json.Marshal(v)
  798. if err != nil {
  799. return err
  800. }
  801. merged, err := runtime.JSONMerge(t.union, b)
  802. t.union = merged
  803. return err
  804. }
  805. // AsEventSessionDeleted returns the union data inside the Event as a EventSessionDeleted
  806. func (t Event) AsEventSessionDeleted() (EventSessionDeleted, error) {
  807. var body EventSessionDeleted
  808. err := json.Unmarshal(t.union, &body)
  809. return body, err
  810. }
  811. // FromEventSessionDeleted overwrites any union data inside the Event as the provided EventSessionDeleted
  812. func (t *Event) FromEventSessionDeleted(v EventSessionDeleted) error {
  813. v.Type = "session.deleted"
  814. b, err := json.Marshal(v)
  815. t.union = b
  816. return err
  817. }
  818. // MergeEventSessionDeleted performs a merge with any union data inside the Event, using the provided EventSessionDeleted
  819. func (t *Event) MergeEventSessionDeleted(v EventSessionDeleted) error {
  820. v.Type = "session.deleted"
  821. b, err := json.Marshal(v)
  822. if err != nil {
  823. return err
  824. }
  825. merged, err := runtime.JSONMerge(t.union, b)
  826. t.union = merged
  827. return err
  828. }
  829. // AsEventSessionError returns the union data inside the Event as a EventSessionError
  830. func (t Event) AsEventSessionError() (EventSessionError, error) {
  831. var body EventSessionError
  832. err := json.Unmarshal(t.union, &body)
  833. return body, err
  834. }
  835. // FromEventSessionError overwrites any union data inside the Event as the provided EventSessionError
  836. func (t *Event) FromEventSessionError(v EventSessionError) error {
  837. v.Type = "session.error"
  838. b, err := json.Marshal(v)
  839. t.union = b
  840. return err
  841. }
  842. // MergeEventSessionError performs a merge with any union data inside the Event, using the provided EventSessionError
  843. func (t *Event) MergeEventSessionError(v EventSessionError) error {
  844. v.Type = "session.error"
  845. b, err := json.Marshal(v)
  846. if err != nil {
  847. return err
  848. }
  849. merged, err := runtime.JSONMerge(t.union, b)
  850. t.union = merged
  851. return err
  852. }
  853. func (t Event) Discriminator() (string, error) {
  854. var discriminator struct {
  855. Discriminator string `json:"type"`
  856. }
  857. err := json.Unmarshal(t.union, &discriminator)
  858. return discriminator.Discriminator, err
  859. }
  860. func (t Event) ValueByDiscriminator() (interface{}, error) {
  861. discriminator, err := t.Discriminator()
  862. if err != nil {
  863. return nil, err
  864. }
  865. switch discriminator {
  866. case "installation.updated":
  867. return t.AsEventInstallationUpdated()
  868. case "lsp.client.diagnostics":
  869. return t.AsEventLspClientDiagnostics()
  870. case "message.part.updated":
  871. return t.AsEventMessagePartUpdated()
  872. case "message.updated":
  873. return t.AsEventMessageUpdated()
  874. case "permission.updated":
  875. return t.AsEventPermissionUpdated()
  876. case "session.deleted":
  877. return t.AsEventSessionDeleted()
  878. case "session.error":
  879. return t.AsEventSessionError()
  880. case "session.updated":
  881. return t.AsEventSessionUpdated()
  882. case "storage.write":
  883. return t.AsEventStorageWrite()
  884. default:
  885. return nil, errors.New("unknown discriminator value: " + discriminator)
  886. }
  887. }
  888. func (t Event) MarshalJSON() ([]byte, error) {
  889. b, err := t.union.MarshalJSON()
  890. return b, err
  891. }
  892. func (t *Event) UnmarshalJSON(b []byte) error {
  893. err := t.union.UnmarshalJSON(b)
  894. return err
  895. }
  896. // AsProviderAuthError returns the union data inside the EventSessionError_Properties_Error as a ProviderAuthError
  897. func (t EventSessionError_Properties_Error) AsProviderAuthError() (ProviderAuthError, error) {
  898. var body ProviderAuthError
  899. err := json.Unmarshal(t.union, &body)
  900. return body, err
  901. }
  902. // FromProviderAuthError overwrites any union data inside the EventSessionError_Properties_Error as the provided ProviderAuthError
  903. func (t *EventSessionError_Properties_Error) FromProviderAuthError(v ProviderAuthError) error {
  904. v.Name = "ProviderAuthError"
  905. b, err := json.Marshal(v)
  906. t.union = b
  907. return err
  908. }
  909. // MergeProviderAuthError performs a merge with any union data inside the EventSessionError_Properties_Error, using the provided ProviderAuthError
  910. func (t *EventSessionError_Properties_Error) MergeProviderAuthError(v ProviderAuthError) error {
  911. v.Name = "ProviderAuthError"
  912. b, err := json.Marshal(v)
  913. if err != nil {
  914. return err
  915. }
  916. merged, err := runtime.JSONMerge(t.union, b)
  917. t.union = merged
  918. return err
  919. }
  920. // AsUnknownError returns the union data inside the EventSessionError_Properties_Error as a UnknownError
  921. func (t EventSessionError_Properties_Error) AsUnknownError() (UnknownError, error) {
  922. var body UnknownError
  923. err := json.Unmarshal(t.union, &body)
  924. return body, err
  925. }
  926. // FromUnknownError overwrites any union data inside the EventSessionError_Properties_Error as the provided UnknownError
  927. func (t *EventSessionError_Properties_Error) FromUnknownError(v UnknownError) error {
  928. v.Name = "UnknownError"
  929. b, err := json.Marshal(v)
  930. t.union = b
  931. return err
  932. }
  933. // MergeUnknownError performs a merge with any union data inside the EventSessionError_Properties_Error, using the provided UnknownError
  934. func (t *EventSessionError_Properties_Error) MergeUnknownError(v UnknownError) error {
  935. v.Name = "UnknownError"
  936. b, err := json.Marshal(v)
  937. if err != nil {
  938. return err
  939. }
  940. merged, err := runtime.JSONMerge(t.union, b)
  941. t.union = merged
  942. return err
  943. }
  944. func (t EventSessionError_Properties_Error) Discriminator() (string, error) {
  945. var discriminator struct {
  946. Discriminator string `json:"name"`
  947. }
  948. err := json.Unmarshal(t.union, &discriminator)
  949. return discriminator.Discriminator, err
  950. }
  951. func (t EventSessionError_Properties_Error) ValueByDiscriminator() (interface{}, error) {
  952. discriminator, err := t.Discriminator()
  953. if err != nil {
  954. return nil, err
  955. }
  956. switch discriminator {
  957. case "ProviderAuthError":
  958. return t.AsProviderAuthError()
  959. case "UnknownError":
  960. return t.AsUnknownError()
  961. default:
  962. return nil, errors.New("unknown discriminator value: " + discriminator)
  963. }
  964. }
  965. func (t EventSessionError_Properties_Error) MarshalJSON() ([]byte, error) {
  966. b, err := t.union.MarshalJSON()
  967. return b, err
  968. }
  969. func (t *EventSessionError_Properties_Error) UnmarshalJSON(b []byte) error {
  970. err := t.union.UnmarshalJSON(b)
  971. return err
  972. }
  973. // AsProviderAuthError returns the union data inside the MessageMetadata_Error as a ProviderAuthError
  974. func (t MessageMetadata_Error) AsProviderAuthError() (ProviderAuthError, error) {
  975. var body ProviderAuthError
  976. err := json.Unmarshal(t.union, &body)
  977. return body, err
  978. }
  979. // FromProviderAuthError overwrites any union data inside the MessageMetadata_Error as the provided ProviderAuthError
  980. func (t *MessageMetadata_Error) FromProviderAuthError(v ProviderAuthError) error {
  981. v.Name = "ProviderAuthError"
  982. b, err := json.Marshal(v)
  983. t.union = b
  984. return err
  985. }
  986. // MergeProviderAuthError performs a merge with any union data inside the MessageMetadata_Error, using the provided ProviderAuthError
  987. func (t *MessageMetadata_Error) MergeProviderAuthError(v ProviderAuthError) error {
  988. v.Name = "ProviderAuthError"
  989. b, err := json.Marshal(v)
  990. if err != nil {
  991. return err
  992. }
  993. merged, err := runtime.JSONMerge(t.union, b)
  994. t.union = merged
  995. return err
  996. }
  997. // AsUnknownError returns the union data inside the MessageMetadata_Error as a UnknownError
  998. func (t MessageMetadata_Error) AsUnknownError() (UnknownError, error) {
  999. var body UnknownError
  1000. err := json.Unmarshal(t.union, &body)
  1001. return body, err
  1002. }
  1003. // FromUnknownError overwrites any union data inside the MessageMetadata_Error as the provided UnknownError
  1004. func (t *MessageMetadata_Error) FromUnknownError(v UnknownError) error {
  1005. v.Name = "UnknownError"
  1006. b, err := json.Marshal(v)
  1007. t.union = b
  1008. return err
  1009. }
  1010. // MergeUnknownError performs a merge with any union data inside the MessageMetadata_Error, using the provided UnknownError
  1011. func (t *MessageMetadata_Error) MergeUnknownError(v UnknownError) error {
  1012. v.Name = "UnknownError"
  1013. b, err := json.Marshal(v)
  1014. if err != nil {
  1015. return err
  1016. }
  1017. merged, err := runtime.JSONMerge(t.union, b)
  1018. t.union = merged
  1019. return err
  1020. }
  1021. func (t MessageMetadata_Error) Discriminator() (string, error) {
  1022. var discriminator struct {
  1023. Discriminator string `json:"name"`
  1024. }
  1025. err := json.Unmarshal(t.union, &discriminator)
  1026. return discriminator.Discriminator, err
  1027. }
  1028. func (t MessageMetadata_Error) ValueByDiscriminator() (interface{}, error) {
  1029. discriminator, err := t.Discriminator()
  1030. if err != nil {
  1031. return nil, err
  1032. }
  1033. switch discriminator {
  1034. case "ProviderAuthError":
  1035. return t.AsProviderAuthError()
  1036. case "UnknownError":
  1037. return t.AsUnknownError()
  1038. default:
  1039. return nil, errors.New("unknown discriminator value: " + discriminator)
  1040. }
  1041. }
  1042. func (t MessageMetadata_Error) MarshalJSON() ([]byte, error) {
  1043. b, err := t.union.MarshalJSON()
  1044. return b, err
  1045. }
  1046. func (t *MessageMetadata_Error) UnmarshalJSON(b []byte) error {
  1047. err := t.union.UnmarshalJSON(b)
  1048. return err
  1049. }
  1050. // AsMessagePartText returns the union data inside the MessagePart as a MessagePartText
  1051. func (t MessagePart) AsMessagePartText() (MessagePartText, error) {
  1052. var body MessagePartText
  1053. err := json.Unmarshal(t.union, &body)
  1054. return body, err
  1055. }
  1056. // FromMessagePartText overwrites any union data inside the MessagePart as the provided MessagePartText
  1057. func (t *MessagePart) FromMessagePartText(v MessagePartText) error {
  1058. v.Type = "text"
  1059. b, err := json.Marshal(v)
  1060. t.union = b
  1061. return err
  1062. }
  1063. // MergeMessagePartText performs a merge with any union data inside the MessagePart, using the provided MessagePartText
  1064. func (t *MessagePart) MergeMessagePartText(v MessagePartText) error {
  1065. v.Type = "text"
  1066. b, err := json.Marshal(v)
  1067. if err != nil {
  1068. return err
  1069. }
  1070. merged, err := runtime.JSONMerge(t.union, b)
  1071. t.union = merged
  1072. return err
  1073. }
  1074. // AsMessagePartReasoning returns the union data inside the MessagePart as a MessagePartReasoning
  1075. func (t MessagePart) AsMessagePartReasoning() (MessagePartReasoning, error) {
  1076. var body MessagePartReasoning
  1077. err := json.Unmarshal(t.union, &body)
  1078. return body, err
  1079. }
  1080. // FromMessagePartReasoning overwrites any union data inside the MessagePart as the provided MessagePartReasoning
  1081. func (t *MessagePart) FromMessagePartReasoning(v MessagePartReasoning) error {
  1082. v.Type = "reasoning"
  1083. b, err := json.Marshal(v)
  1084. t.union = b
  1085. return err
  1086. }
  1087. // MergeMessagePartReasoning performs a merge with any union data inside the MessagePart, using the provided MessagePartReasoning
  1088. func (t *MessagePart) MergeMessagePartReasoning(v MessagePartReasoning) error {
  1089. v.Type = "reasoning"
  1090. b, err := json.Marshal(v)
  1091. if err != nil {
  1092. return err
  1093. }
  1094. merged, err := runtime.JSONMerge(t.union, b)
  1095. t.union = merged
  1096. return err
  1097. }
  1098. // AsMessagePartToolInvocation returns the union data inside the MessagePart as a MessagePartToolInvocation
  1099. func (t MessagePart) AsMessagePartToolInvocation() (MessagePartToolInvocation, error) {
  1100. var body MessagePartToolInvocation
  1101. err := json.Unmarshal(t.union, &body)
  1102. return body, err
  1103. }
  1104. // FromMessagePartToolInvocation overwrites any union data inside the MessagePart as the provided MessagePartToolInvocation
  1105. func (t *MessagePart) FromMessagePartToolInvocation(v MessagePartToolInvocation) error {
  1106. v.Type = "tool-invocation"
  1107. b, err := json.Marshal(v)
  1108. t.union = b
  1109. return err
  1110. }
  1111. // MergeMessagePartToolInvocation performs a merge with any union data inside the MessagePart, using the provided MessagePartToolInvocation
  1112. func (t *MessagePart) MergeMessagePartToolInvocation(v MessagePartToolInvocation) error {
  1113. v.Type = "tool-invocation"
  1114. b, err := json.Marshal(v)
  1115. if err != nil {
  1116. return err
  1117. }
  1118. merged, err := runtime.JSONMerge(t.union, b)
  1119. t.union = merged
  1120. return err
  1121. }
  1122. // AsMessagePartSourceUrl returns the union data inside the MessagePart as a MessagePartSourceUrl
  1123. func (t MessagePart) AsMessagePartSourceUrl() (MessagePartSourceUrl, error) {
  1124. var body MessagePartSourceUrl
  1125. err := json.Unmarshal(t.union, &body)
  1126. return body, err
  1127. }
  1128. // FromMessagePartSourceUrl overwrites any union data inside the MessagePart as the provided MessagePartSourceUrl
  1129. func (t *MessagePart) FromMessagePartSourceUrl(v MessagePartSourceUrl) error {
  1130. v.Type = "source-url"
  1131. b, err := json.Marshal(v)
  1132. t.union = b
  1133. return err
  1134. }
  1135. // MergeMessagePartSourceUrl performs a merge with any union data inside the MessagePart, using the provided MessagePartSourceUrl
  1136. func (t *MessagePart) MergeMessagePartSourceUrl(v MessagePartSourceUrl) error {
  1137. v.Type = "source-url"
  1138. b, err := json.Marshal(v)
  1139. if err != nil {
  1140. return err
  1141. }
  1142. merged, err := runtime.JSONMerge(t.union, b)
  1143. t.union = merged
  1144. return err
  1145. }
  1146. // AsMessagePartFile returns the union data inside the MessagePart as a MessagePartFile
  1147. func (t MessagePart) AsMessagePartFile() (MessagePartFile, error) {
  1148. var body MessagePartFile
  1149. err := json.Unmarshal(t.union, &body)
  1150. return body, err
  1151. }
  1152. // FromMessagePartFile overwrites any union data inside the MessagePart as the provided MessagePartFile
  1153. func (t *MessagePart) FromMessagePartFile(v MessagePartFile) error {
  1154. v.Type = "file"
  1155. b, err := json.Marshal(v)
  1156. t.union = b
  1157. return err
  1158. }
  1159. // MergeMessagePartFile performs a merge with any union data inside the MessagePart, using the provided MessagePartFile
  1160. func (t *MessagePart) MergeMessagePartFile(v MessagePartFile) error {
  1161. v.Type = "file"
  1162. b, err := json.Marshal(v)
  1163. if err != nil {
  1164. return err
  1165. }
  1166. merged, err := runtime.JSONMerge(t.union, b)
  1167. t.union = merged
  1168. return err
  1169. }
  1170. // AsMessagePartStepStart returns the union data inside the MessagePart as a MessagePartStepStart
  1171. func (t MessagePart) AsMessagePartStepStart() (MessagePartStepStart, error) {
  1172. var body MessagePartStepStart
  1173. err := json.Unmarshal(t.union, &body)
  1174. return body, err
  1175. }
  1176. // FromMessagePartStepStart overwrites any union data inside the MessagePart as the provided MessagePartStepStart
  1177. func (t *MessagePart) FromMessagePartStepStart(v MessagePartStepStart) error {
  1178. v.Type = "step-start"
  1179. b, err := json.Marshal(v)
  1180. t.union = b
  1181. return err
  1182. }
  1183. // MergeMessagePartStepStart performs a merge with any union data inside the MessagePart, using the provided MessagePartStepStart
  1184. func (t *MessagePart) MergeMessagePartStepStart(v MessagePartStepStart) error {
  1185. v.Type = "step-start"
  1186. b, err := json.Marshal(v)
  1187. if err != nil {
  1188. return err
  1189. }
  1190. merged, err := runtime.JSONMerge(t.union, b)
  1191. t.union = merged
  1192. return err
  1193. }
  1194. func (t MessagePart) Discriminator() (string, error) {
  1195. var discriminator struct {
  1196. Discriminator string `json:"type"`
  1197. }
  1198. err := json.Unmarshal(t.union, &discriminator)
  1199. return discriminator.Discriminator, err
  1200. }
  1201. func (t MessagePart) ValueByDiscriminator() (interface{}, error) {
  1202. discriminator, err := t.Discriminator()
  1203. if err != nil {
  1204. return nil, err
  1205. }
  1206. switch discriminator {
  1207. case "file":
  1208. return t.AsMessagePartFile()
  1209. case "reasoning":
  1210. return t.AsMessagePartReasoning()
  1211. case "source-url":
  1212. return t.AsMessagePartSourceUrl()
  1213. case "step-start":
  1214. return t.AsMessagePartStepStart()
  1215. case "text":
  1216. return t.AsMessagePartText()
  1217. case "tool-invocation":
  1218. return t.AsMessagePartToolInvocation()
  1219. default:
  1220. return nil, errors.New("unknown discriminator value: " + discriminator)
  1221. }
  1222. }
  1223. func (t MessagePart) MarshalJSON() ([]byte, error) {
  1224. b, err := t.union.MarshalJSON()
  1225. return b, err
  1226. }
  1227. func (t *MessagePart) UnmarshalJSON(b []byte) error {
  1228. err := t.union.UnmarshalJSON(b)
  1229. return err
  1230. }
  1231. // AsMessageToolInvocationToolCall returns the union data inside the MessageToolInvocation as a MessageToolInvocationToolCall
  1232. func (t MessageToolInvocation) AsMessageToolInvocationToolCall() (MessageToolInvocationToolCall, error) {
  1233. var body MessageToolInvocationToolCall
  1234. err := json.Unmarshal(t.union, &body)
  1235. return body, err
  1236. }
  1237. // FromMessageToolInvocationToolCall overwrites any union data inside the MessageToolInvocation as the provided MessageToolInvocationToolCall
  1238. func (t *MessageToolInvocation) FromMessageToolInvocationToolCall(v MessageToolInvocationToolCall) error {
  1239. v.State = "call"
  1240. b, err := json.Marshal(v)
  1241. t.union = b
  1242. return err
  1243. }
  1244. // MergeMessageToolInvocationToolCall performs a merge with any union data inside the MessageToolInvocation, using the provided MessageToolInvocationToolCall
  1245. func (t *MessageToolInvocation) MergeMessageToolInvocationToolCall(v MessageToolInvocationToolCall) error {
  1246. v.State = "call"
  1247. b, err := json.Marshal(v)
  1248. if err != nil {
  1249. return err
  1250. }
  1251. merged, err := runtime.JSONMerge(t.union, b)
  1252. t.union = merged
  1253. return err
  1254. }
  1255. // AsMessageToolInvocationToolPartialCall returns the union data inside the MessageToolInvocation as a MessageToolInvocationToolPartialCall
  1256. func (t MessageToolInvocation) AsMessageToolInvocationToolPartialCall() (MessageToolInvocationToolPartialCall, error) {
  1257. var body MessageToolInvocationToolPartialCall
  1258. err := json.Unmarshal(t.union, &body)
  1259. return body, err
  1260. }
  1261. // FromMessageToolInvocationToolPartialCall overwrites any union data inside the MessageToolInvocation as the provided MessageToolInvocationToolPartialCall
  1262. func (t *MessageToolInvocation) FromMessageToolInvocationToolPartialCall(v MessageToolInvocationToolPartialCall) error {
  1263. v.State = "partial-call"
  1264. b, err := json.Marshal(v)
  1265. t.union = b
  1266. return err
  1267. }
  1268. // MergeMessageToolInvocationToolPartialCall performs a merge with any union data inside the MessageToolInvocation, using the provided MessageToolInvocationToolPartialCall
  1269. func (t *MessageToolInvocation) MergeMessageToolInvocationToolPartialCall(v MessageToolInvocationToolPartialCall) error {
  1270. v.State = "partial-call"
  1271. b, err := json.Marshal(v)
  1272. if err != nil {
  1273. return err
  1274. }
  1275. merged, err := runtime.JSONMerge(t.union, b)
  1276. t.union = merged
  1277. return err
  1278. }
  1279. // AsMessageToolInvocationToolResult returns the union data inside the MessageToolInvocation as a MessageToolInvocationToolResult
  1280. func (t MessageToolInvocation) AsMessageToolInvocationToolResult() (MessageToolInvocationToolResult, error) {
  1281. var body MessageToolInvocationToolResult
  1282. err := json.Unmarshal(t.union, &body)
  1283. return body, err
  1284. }
  1285. // FromMessageToolInvocationToolResult overwrites any union data inside the MessageToolInvocation as the provided MessageToolInvocationToolResult
  1286. func (t *MessageToolInvocation) FromMessageToolInvocationToolResult(v MessageToolInvocationToolResult) error {
  1287. v.State = "result"
  1288. b, err := json.Marshal(v)
  1289. t.union = b
  1290. return err
  1291. }
  1292. // MergeMessageToolInvocationToolResult performs a merge with any union data inside the MessageToolInvocation, using the provided MessageToolInvocationToolResult
  1293. func (t *MessageToolInvocation) MergeMessageToolInvocationToolResult(v MessageToolInvocationToolResult) error {
  1294. v.State = "result"
  1295. b, err := json.Marshal(v)
  1296. if err != nil {
  1297. return err
  1298. }
  1299. merged, err := runtime.JSONMerge(t.union, b)
  1300. t.union = merged
  1301. return err
  1302. }
  1303. func (t MessageToolInvocation) Discriminator() (string, error) {
  1304. var discriminator struct {
  1305. Discriminator string `json:"state"`
  1306. }
  1307. err := json.Unmarshal(t.union, &discriminator)
  1308. return discriminator.Discriminator, err
  1309. }
  1310. func (t MessageToolInvocation) ValueByDiscriminator() (interface{}, error) {
  1311. discriminator, err := t.Discriminator()
  1312. if err != nil {
  1313. return nil, err
  1314. }
  1315. switch discriminator {
  1316. case "call":
  1317. return t.AsMessageToolInvocationToolCall()
  1318. case "partial-call":
  1319. return t.AsMessageToolInvocationToolPartialCall()
  1320. case "result":
  1321. return t.AsMessageToolInvocationToolResult()
  1322. default:
  1323. return nil, errors.New("unknown discriminator value: " + discriminator)
  1324. }
  1325. }
  1326. func (t MessageToolInvocation) MarshalJSON() ([]byte, error) {
  1327. b, err := t.union.MarshalJSON()
  1328. return b, err
  1329. }
  1330. func (t *MessageToolInvocation) UnmarshalJSON(b []byte) error {
  1331. err := t.union.UnmarshalJSON(b)
  1332. return err
  1333. }
  1334. // RequestEditorFn is the function signature for the RequestEditor callback function
  1335. type RequestEditorFn func(ctx context.Context, req *http.Request) error
  1336. // Doer performs HTTP requests.
  1337. //
  1338. // The standard http.Client implements this interface.
  1339. type HttpRequestDoer interface {
  1340. Do(req *http.Request) (*http.Response, error)
  1341. }
  1342. // Client which conforms to the OpenAPI3 specification for this service.
  1343. type Client struct {
  1344. // The endpoint of the server conforming to this interface, with scheme,
  1345. // https://api.deepmap.com for example. This can contain a path relative
  1346. // to the server, such as https://api.deepmap.com/dev-test, and all the
  1347. // paths in the swagger spec will be appended to the server.
  1348. Server string
  1349. // Doer for performing requests, typically a *http.Client with any
  1350. // customized settings, such as certificate chains.
  1351. Client HttpRequestDoer
  1352. // A list of callbacks for modifying requests which are generated before sending over
  1353. // the network.
  1354. RequestEditors []RequestEditorFn
  1355. }
  1356. // ClientOption allows setting custom parameters during construction
  1357. type ClientOption func(*Client) error
  1358. // Creates a new Client, with reasonable defaults
  1359. func NewClient(server string, opts ...ClientOption) (*Client, error) {
  1360. // create a client with sane default values
  1361. client := Client{
  1362. Server: server,
  1363. }
  1364. // mutate client and add all optional params
  1365. for _, o := range opts {
  1366. if err := o(&client); err != nil {
  1367. return nil, err
  1368. }
  1369. }
  1370. // ensure the server URL always has a trailing slash
  1371. if !strings.HasSuffix(client.Server, "/") {
  1372. client.Server += "/"
  1373. }
  1374. // create httpClient, if not already present
  1375. if client.Client == nil {
  1376. client.Client = &http.Client{}
  1377. }
  1378. return &client, nil
  1379. }
  1380. // WithHTTPClient allows overriding the default Doer, which is
  1381. // automatically created using http.Client. This is useful for tests.
  1382. func WithHTTPClient(doer HttpRequestDoer) ClientOption {
  1383. return func(c *Client) error {
  1384. c.Client = doer
  1385. return nil
  1386. }
  1387. }
  1388. // WithRequestEditorFn allows setting up a callback function, which will be
  1389. // called right before sending the request. This can be used to mutate the request.
  1390. func WithRequestEditorFn(fn RequestEditorFn) ClientOption {
  1391. return func(c *Client) error {
  1392. c.RequestEditors = append(c.RequestEditors, fn)
  1393. return nil
  1394. }
  1395. }
  1396. // The interface specification for the client above.
  1397. type ClientInterface interface {
  1398. // PostAppInfo request
  1399. PostAppInfo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
  1400. // PostAppInitialize request
  1401. PostAppInitialize(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
  1402. // PostConfigGet request
  1403. PostConfigGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
  1404. // GetEvent request
  1405. GetEvent(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
  1406. // PostFileSearchWithBody request with any body
  1407. PostFileSearchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
  1408. PostFileSearch(ctx context.Context, body PostFileSearchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
  1409. // PostInstallationInfo request
  1410. PostInstallationInfo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
  1411. // PostPathGet request
  1412. PostPathGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
  1413. // PostProviderList request
  1414. PostProviderList(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
  1415. // PostSessionAbortWithBody request with any body
  1416. PostSessionAbortWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
  1417. PostSessionAbort(ctx context.Context, body PostSessionAbortJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
  1418. // PostSessionChatWithBody request with any body
  1419. PostSessionChatWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
  1420. PostSessionChat(ctx context.Context, body PostSessionChatJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
  1421. // PostSessionCreate request
  1422. PostSessionCreate(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
  1423. // PostSessionDeleteWithBody request with any body
  1424. PostSessionDeleteWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
  1425. PostSessionDelete(ctx context.Context, body PostSessionDeleteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
  1426. // PostSessionInitializeWithBody request with any body
  1427. PostSessionInitializeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
  1428. PostSessionInitialize(ctx context.Context, body PostSessionInitializeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
  1429. // PostSessionList request
  1430. PostSessionList(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
  1431. // PostSessionMessagesWithBody request with any body
  1432. PostSessionMessagesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
  1433. PostSessionMessages(ctx context.Context, body PostSessionMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
  1434. // PostSessionShareWithBody request with any body
  1435. PostSessionShareWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
  1436. PostSessionShare(ctx context.Context, body PostSessionShareJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
  1437. // PostSessionSummarizeWithBody request with any body
  1438. PostSessionSummarizeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
  1439. PostSessionSummarize(ctx context.Context, body PostSessionSummarizeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
  1440. // PostSessionUnshareWithBody request with any body
  1441. PostSessionUnshareWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
  1442. PostSessionUnshare(ctx context.Context, body PostSessionUnshareJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
  1443. }
  1444. func (c *Client) PostAppInfo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1445. req, err := NewPostAppInfoRequest(c.Server)
  1446. if err != nil {
  1447. return nil, err
  1448. }
  1449. req = req.WithContext(ctx)
  1450. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1451. return nil, err
  1452. }
  1453. return c.Client.Do(req)
  1454. }
  1455. func (c *Client) PostAppInitialize(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1456. req, err := NewPostAppInitializeRequest(c.Server)
  1457. if err != nil {
  1458. return nil, err
  1459. }
  1460. req = req.WithContext(ctx)
  1461. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1462. return nil, err
  1463. }
  1464. return c.Client.Do(req)
  1465. }
  1466. func (c *Client) PostConfigGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1467. req, err := NewPostConfigGetRequest(c.Server)
  1468. if err != nil {
  1469. return nil, err
  1470. }
  1471. req = req.WithContext(ctx)
  1472. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1473. return nil, err
  1474. }
  1475. return c.Client.Do(req)
  1476. }
  1477. func (c *Client) GetEvent(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1478. req, err := NewGetEventRequest(c.Server)
  1479. if err != nil {
  1480. return nil, err
  1481. }
  1482. req = req.WithContext(ctx)
  1483. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1484. return nil, err
  1485. }
  1486. return c.Client.Do(req)
  1487. }
  1488. func (c *Client) PostFileSearchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1489. req, err := NewPostFileSearchRequestWithBody(c.Server, contentType, body)
  1490. if err != nil {
  1491. return nil, err
  1492. }
  1493. req = req.WithContext(ctx)
  1494. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1495. return nil, err
  1496. }
  1497. return c.Client.Do(req)
  1498. }
  1499. func (c *Client) PostFileSearch(ctx context.Context, body PostFileSearchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1500. req, err := NewPostFileSearchRequest(c.Server, body)
  1501. if err != nil {
  1502. return nil, err
  1503. }
  1504. req = req.WithContext(ctx)
  1505. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1506. return nil, err
  1507. }
  1508. return c.Client.Do(req)
  1509. }
  1510. func (c *Client) PostInstallationInfo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1511. req, err := NewPostInstallationInfoRequest(c.Server)
  1512. if err != nil {
  1513. return nil, err
  1514. }
  1515. req = req.WithContext(ctx)
  1516. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1517. return nil, err
  1518. }
  1519. return c.Client.Do(req)
  1520. }
  1521. func (c *Client) PostPathGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1522. req, err := NewPostPathGetRequest(c.Server)
  1523. if err != nil {
  1524. return nil, err
  1525. }
  1526. req = req.WithContext(ctx)
  1527. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1528. return nil, err
  1529. }
  1530. return c.Client.Do(req)
  1531. }
  1532. func (c *Client) PostProviderList(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1533. req, err := NewPostProviderListRequest(c.Server)
  1534. if err != nil {
  1535. return nil, err
  1536. }
  1537. req = req.WithContext(ctx)
  1538. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1539. return nil, err
  1540. }
  1541. return c.Client.Do(req)
  1542. }
  1543. func (c *Client) PostSessionAbortWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1544. req, err := NewPostSessionAbortRequestWithBody(c.Server, contentType, body)
  1545. if err != nil {
  1546. return nil, err
  1547. }
  1548. req = req.WithContext(ctx)
  1549. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1550. return nil, err
  1551. }
  1552. return c.Client.Do(req)
  1553. }
  1554. func (c *Client) PostSessionAbort(ctx context.Context, body PostSessionAbortJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1555. req, err := NewPostSessionAbortRequest(c.Server, body)
  1556. if err != nil {
  1557. return nil, err
  1558. }
  1559. req = req.WithContext(ctx)
  1560. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1561. return nil, err
  1562. }
  1563. return c.Client.Do(req)
  1564. }
  1565. func (c *Client) PostSessionChatWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1566. req, err := NewPostSessionChatRequestWithBody(c.Server, contentType, body)
  1567. if err != nil {
  1568. return nil, err
  1569. }
  1570. req = req.WithContext(ctx)
  1571. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1572. return nil, err
  1573. }
  1574. return c.Client.Do(req)
  1575. }
  1576. func (c *Client) PostSessionChat(ctx context.Context, body PostSessionChatJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1577. req, err := NewPostSessionChatRequest(c.Server, body)
  1578. if err != nil {
  1579. return nil, err
  1580. }
  1581. req = req.WithContext(ctx)
  1582. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1583. return nil, err
  1584. }
  1585. return c.Client.Do(req)
  1586. }
  1587. func (c *Client) PostSessionCreate(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1588. req, err := NewPostSessionCreateRequest(c.Server)
  1589. if err != nil {
  1590. return nil, err
  1591. }
  1592. req = req.WithContext(ctx)
  1593. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1594. return nil, err
  1595. }
  1596. return c.Client.Do(req)
  1597. }
  1598. func (c *Client) PostSessionDeleteWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1599. req, err := NewPostSessionDeleteRequestWithBody(c.Server, contentType, body)
  1600. if err != nil {
  1601. return nil, err
  1602. }
  1603. req = req.WithContext(ctx)
  1604. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1605. return nil, err
  1606. }
  1607. return c.Client.Do(req)
  1608. }
  1609. func (c *Client) PostSessionDelete(ctx context.Context, body PostSessionDeleteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1610. req, err := NewPostSessionDeleteRequest(c.Server, body)
  1611. if err != nil {
  1612. return nil, err
  1613. }
  1614. req = req.WithContext(ctx)
  1615. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1616. return nil, err
  1617. }
  1618. return c.Client.Do(req)
  1619. }
  1620. func (c *Client) PostSessionInitializeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1621. req, err := NewPostSessionInitializeRequestWithBody(c.Server, contentType, body)
  1622. if err != nil {
  1623. return nil, err
  1624. }
  1625. req = req.WithContext(ctx)
  1626. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1627. return nil, err
  1628. }
  1629. return c.Client.Do(req)
  1630. }
  1631. func (c *Client) PostSessionInitialize(ctx context.Context, body PostSessionInitializeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1632. req, err := NewPostSessionInitializeRequest(c.Server, body)
  1633. if err != nil {
  1634. return nil, err
  1635. }
  1636. req = req.WithContext(ctx)
  1637. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1638. return nil, err
  1639. }
  1640. return c.Client.Do(req)
  1641. }
  1642. func (c *Client) PostSessionList(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1643. req, err := NewPostSessionListRequest(c.Server)
  1644. if err != nil {
  1645. return nil, err
  1646. }
  1647. req = req.WithContext(ctx)
  1648. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1649. return nil, err
  1650. }
  1651. return c.Client.Do(req)
  1652. }
  1653. func (c *Client) PostSessionMessagesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1654. req, err := NewPostSessionMessagesRequestWithBody(c.Server, contentType, body)
  1655. if err != nil {
  1656. return nil, err
  1657. }
  1658. req = req.WithContext(ctx)
  1659. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1660. return nil, err
  1661. }
  1662. return c.Client.Do(req)
  1663. }
  1664. func (c *Client) PostSessionMessages(ctx context.Context, body PostSessionMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1665. req, err := NewPostSessionMessagesRequest(c.Server, body)
  1666. if err != nil {
  1667. return nil, err
  1668. }
  1669. req = req.WithContext(ctx)
  1670. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1671. return nil, err
  1672. }
  1673. return c.Client.Do(req)
  1674. }
  1675. func (c *Client) PostSessionShareWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1676. req, err := NewPostSessionShareRequestWithBody(c.Server, contentType, body)
  1677. if err != nil {
  1678. return nil, err
  1679. }
  1680. req = req.WithContext(ctx)
  1681. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1682. return nil, err
  1683. }
  1684. return c.Client.Do(req)
  1685. }
  1686. func (c *Client) PostSessionShare(ctx context.Context, body PostSessionShareJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1687. req, err := NewPostSessionShareRequest(c.Server, body)
  1688. if err != nil {
  1689. return nil, err
  1690. }
  1691. req = req.WithContext(ctx)
  1692. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1693. return nil, err
  1694. }
  1695. return c.Client.Do(req)
  1696. }
  1697. func (c *Client) PostSessionSummarizeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1698. req, err := NewPostSessionSummarizeRequestWithBody(c.Server, contentType, body)
  1699. if err != nil {
  1700. return nil, err
  1701. }
  1702. req = req.WithContext(ctx)
  1703. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1704. return nil, err
  1705. }
  1706. return c.Client.Do(req)
  1707. }
  1708. func (c *Client) PostSessionSummarize(ctx context.Context, body PostSessionSummarizeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1709. req, err := NewPostSessionSummarizeRequest(c.Server, body)
  1710. if err != nil {
  1711. return nil, err
  1712. }
  1713. req = req.WithContext(ctx)
  1714. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1715. return nil, err
  1716. }
  1717. return c.Client.Do(req)
  1718. }
  1719. func (c *Client) PostSessionUnshareWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1720. req, err := NewPostSessionUnshareRequestWithBody(c.Server, contentType, body)
  1721. if err != nil {
  1722. return nil, err
  1723. }
  1724. req = req.WithContext(ctx)
  1725. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1726. return nil, err
  1727. }
  1728. return c.Client.Do(req)
  1729. }
  1730. func (c *Client) PostSessionUnshare(ctx context.Context, body PostSessionUnshareJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
  1731. req, err := NewPostSessionUnshareRequest(c.Server, body)
  1732. if err != nil {
  1733. return nil, err
  1734. }
  1735. req = req.WithContext(ctx)
  1736. if err := c.applyEditors(ctx, req, reqEditors); err != nil {
  1737. return nil, err
  1738. }
  1739. return c.Client.Do(req)
  1740. }
  1741. // NewPostAppInfoRequest generates requests for PostAppInfo
  1742. func NewPostAppInfoRequest(server string) (*http.Request, error) {
  1743. var err error
  1744. serverURL, err := url.Parse(server)
  1745. if err != nil {
  1746. return nil, err
  1747. }
  1748. operationPath := fmt.Sprintf("/app_info")
  1749. if operationPath[0] == '/' {
  1750. operationPath = "." + operationPath
  1751. }
  1752. queryURL, err := serverURL.Parse(operationPath)
  1753. if err != nil {
  1754. return nil, err
  1755. }
  1756. req, err := http.NewRequest("POST", queryURL.String(), nil)
  1757. if err != nil {
  1758. return nil, err
  1759. }
  1760. return req, nil
  1761. }
  1762. // NewPostAppInitializeRequest generates requests for PostAppInitialize
  1763. func NewPostAppInitializeRequest(server string) (*http.Request, error) {
  1764. var err error
  1765. serverURL, err := url.Parse(server)
  1766. if err != nil {
  1767. return nil, err
  1768. }
  1769. operationPath := fmt.Sprintf("/app_initialize")
  1770. if operationPath[0] == '/' {
  1771. operationPath = "." + operationPath
  1772. }
  1773. queryURL, err := serverURL.Parse(operationPath)
  1774. if err != nil {
  1775. return nil, err
  1776. }
  1777. req, err := http.NewRequest("POST", queryURL.String(), nil)
  1778. if err != nil {
  1779. return nil, err
  1780. }
  1781. return req, nil
  1782. }
  1783. // NewPostConfigGetRequest generates requests for PostConfigGet
  1784. func NewPostConfigGetRequest(server string) (*http.Request, error) {
  1785. var err error
  1786. serverURL, err := url.Parse(server)
  1787. if err != nil {
  1788. return nil, err
  1789. }
  1790. operationPath := fmt.Sprintf("/config_get")
  1791. if operationPath[0] == '/' {
  1792. operationPath = "." + operationPath
  1793. }
  1794. queryURL, err := serverURL.Parse(operationPath)
  1795. if err != nil {
  1796. return nil, err
  1797. }
  1798. req, err := http.NewRequest("POST", queryURL.String(), nil)
  1799. if err != nil {
  1800. return nil, err
  1801. }
  1802. return req, nil
  1803. }
  1804. // NewGetEventRequest generates requests for GetEvent
  1805. func NewGetEventRequest(server string) (*http.Request, error) {
  1806. var err error
  1807. serverURL, err := url.Parse(server)
  1808. if err != nil {
  1809. return nil, err
  1810. }
  1811. operationPath := fmt.Sprintf("/event")
  1812. if operationPath[0] == '/' {
  1813. operationPath = "." + operationPath
  1814. }
  1815. queryURL, err := serverURL.Parse(operationPath)
  1816. if err != nil {
  1817. return nil, err
  1818. }
  1819. req, err := http.NewRequest("GET", queryURL.String(), nil)
  1820. if err != nil {
  1821. return nil, err
  1822. }
  1823. return req, nil
  1824. }
  1825. // NewPostFileSearchRequest calls the generic PostFileSearch builder with application/json body
  1826. func NewPostFileSearchRequest(server string, body PostFileSearchJSONRequestBody) (*http.Request, error) {
  1827. var bodyReader io.Reader
  1828. buf, err := json.Marshal(body)
  1829. if err != nil {
  1830. return nil, err
  1831. }
  1832. bodyReader = bytes.NewReader(buf)
  1833. return NewPostFileSearchRequestWithBody(server, "application/json", bodyReader)
  1834. }
  1835. // NewPostFileSearchRequestWithBody generates requests for PostFileSearch with any type of body
  1836. func NewPostFileSearchRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
  1837. var err error
  1838. serverURL, err := url.Parse(server)
  1839. if err != nil {
  1840. return nil, err
  1841. }
  1842. operationPath := fmt.Sprintf("/file_search")
  1843. if operationPath[0] == '/' {
  1844. operationPath = "." + operationPath
  1845. }
  1846. queryURL, err := serverURL.Parse(operationPath)
  1847. if err != nil {
  1848. return nil, err
  1849. }
  1850. req, err := http.NewRequest("POST", queryURL.String(), body)
  1851. if err != nil {
  1852. return nil, err
  1853. }
  1854. req.Header.Add("Content-Type", contentType)
  1855. return req, nil
  1856. }
  1857. // NewPostInstallationInfoRequest generates requests for PostInstallationInfo
  1858. func NewPostInstallationInfoRequest(server string) (*http.Request, error) {
  1859. var err error
  1860. serverURL, err := url.Parse(server)
  1861. if err != nil {
  1862. return nil, err
  1863. }
  1864. operationPath := fmt.Sprintf("/installation_info")
  1865. if operationPath[0] == '/' {
  1866. operationPath = "." + operationPath
  1867. }
  1868. queryURL, err := serverURL.Parse(operationPath)
  1869. if err != nil {
  1870. return nil, err
  1871. }
  1872. req, err := http.NewRequest("POST", queryURL.String(), nil)
  1873. if err != nil {
  1874. return nil, err
  1875. }
  1876. return req, nil
  1877. }
  1878. // NewPostPathGetRequest generates requests for PostPathGet
  1879. func NewPostPathGetRequest(server string) (*http.Request, error) {
  1880. var err error
  1881. serverURL, err := url.Parse(server)
  1882. if err != nil {
  1883. return nil, err
  1884. }
  1885. operationPath := fmt.Sprintf("/path_get")
  1886. if operationPath[0] == '/' {
  1887. operationPath = "." + operationPath
  1888. }
  1889. queryURL, err := serverURL.Parse(operationPath)
  1890. if err != nil {
  1891. return nil, err
  1892. }
  1893. req, err := http.NewRequest("POST", queryURL.String(), nil)
  1894. if err != nil {
  1895. return nil, err
  1896. }
  1897. return req, nil
  1898. }
  1899. // NewPostProviderListRequest generates requests for PostProviderList
  1900. func NewPostProviderListRequest(server string) (*http.Request, error) {
  1901. var err error
  1902. serverURL, err := url.Parse(server)
  1903. if err != nil {
  1904. return nil, err
  1905. }
  1906. operationPath := fmt.Sprintf("/provider_list")
  1907. if operationPath[0] == '/' {
  1908. operationPath = "." + operationPath
  1909. }
  1910. queryURL, err := serverURL.Parse(operationPath)
  1911. if err != nil {
  1912. return nil, err
  1913. }
  1914. req, err := http.NewRequest("POST", queryURL.String(), nil)
  1915. if err != nil {
  1916. return nil, err
  1917. }
  1918. return req, nil
  1919. }
  1920. // NewPostSessionAbortRequest calls the generic PostSessionAbort builder with application/json body
  1921. func NewPostSessionAbortRequest(server string, body PostSessionAbortJSONRequestBody) (*http.Request, error) {
  1922. var bodyReader io.Reader
  1923. buf, err := json.Marshal(body)
  1924. if err != nil {
  1925. return nil, err
  1926. }
  1927. bodyReader = bytes.NewReader(buf)
  1928. return NewPostSessionAbortRequestWithBody(server, "application/json", bodyReader)
  1929. }
  1930. // NewPostSessionAbortRequestWithBody generates requests for PostSessionAbort with any type of body
  1931. func NewPostSessionAbortRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
  1932. var err error
  1933. serverURL, err := url.Parse(server)
  1934. if err != nil {
  1935. return nil, err
  1936. }
  1937. operationPath := fmt.Sprintf("/session_abort")
  1938. if operationPath[0] == '/' {
  1939. operationPath = "." + operationPath
  1940. }
  1941. queryURL, err := serverURL.Parse(operationPath)
  1942. if err != nil {
  1943. return nil, err
  1944. }
  1945. req, err := http.NewRequest("POST", queryURL.String(), body)
  1946. if err != nil {
  1947. return nil, err
  1948. }
  1949. req.Header.Add("Content-Type", contentType)
  1950. return req, nil
  1951. }
  1952. // NewPostSessionChatRequest calls the generic PostSessionChat builder with application/json body
  1953. func NewPostSessionChatRequest(server string, body PostSessionChatJSONRequestBody) (*http.Request, error) {
  1954. var bodyReader io.Reader
  1955. buf, err := json.Marshal(body)
  1956. if err != nil {
  1957. return nil, err
  1958. }
  1959. bodyReader = bytes.NewReader(buf)
  1960. return NewPostSessionChatRequestWithBody(server, "application/json", bodyReader)
  1961. }
  1962. // NewPostSessionChatRequestWithBody generates requests for PostSessionChat with any type of body
  1963. func NewPostSessionChatRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
  1964. var err error
  1965. serverURL, err := url.Parse(server)
  1966. if err != nil {
  1967. return nil, err
  1968. }
  1969. operationPath := fmt.Sprintf("/session_chat")
  1970. if operationPath[0] == '/' {
  1971. operationPath = "." + operationPath
  1972. }
  1973. queryURL, err := serverURL.Parse(operationPath)
  1974. if err != nil {
  1975. return nil, err
  1976. }
  1977. req, err := http.NewRequest("POST", queryURL.String(), body)
  1978. if err != nil {
  1979. return nil, err
  1980. }
  1981. req.Header.Add("Content-Type", contentType)
  1982. return req, nil
  1983. }
  1984. // NewPostSessionCreateRequest generates requests for PostSessionCreate
  1985. func NewPostSessionCreateRequest(server string) (*http.Request, error) {
  1986. var err error
  1987. serverURL, err := url.Parse(server)
  1988. if err != nil {
  1989. return nil, err
  1990. }
  1991. operationPath := fmt.Sprintf("/session_create")
  1992. if operationPath[0] == '/' {
  1993. operationPath = "." + operationPath
  1994. }
  1995. queryURL, err := serverURL.Parse(operationPath)
  1996. if err != nil {
  1997. return nil, err
  1998. }
  1999. req, err := http.NewRequest("POST", queryURL.String(), nil)
  2000. if err != nil {
  2001. return nil, err
  2002. }
  2003. return req, nil
  2004. }
  2005. // NewPostSessionDeleteRequest calls the generic PostSessionDelete builder with application/json body
  2006. func NewPostSessionDeleteRequest(server string, body PostSessionDeleteJSONRequestBody) (*http.Request, error) {
  2007. var bodyReader io.Reader
  2008. buf, err := json.Marshal(body)
  2009. if err != nil {
  2010. return nil, err
  2011. }
  2012. bodyReader = bytes.NewReader(buf)
  2013. return NewPostSessionDeleteRequestWithBody(server, "application/json", bodyReader)
  2014. }
  2015. // NewPostSessionDeleteRequestWithBody generates requests for PostSessionDelete with any type of body
  2016. func NewPostSessionDeleteRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
  2017. var err error
  2018. serverURL, err := url.Parse(server)
  2019. if err != nil {
  2020. return nil, err
  2021. }
  2022. operationPath := fmt.Sprintf("/session_delete")
  2023. if operationPath[0] == '/' {
  2024. operationPath = "." + operationPath
  2025. }
  2026. queryURL, err := serverURL.Parse(operationPath)
  2027. if err != nil {
  2028. return nil, err
  2029. }
  2030. req, err := http.NewRequest("POST", queryURL.String(), body)
  2031. if err != nil {
  2032. return nil, err
  2033. }
  2034. req.Header.Add("Content-Type", contentType)
  2035. return req, nil
  2036. }
  2037. // NewPostSessionInitializeRequest calls the generic PostSessionInitialize builder with application/json body
  2038. func NewPostSessionInitializeRequest(server string, body PostSessionInitializeJSONRequestBody) (*http.Request, error) {
  2039. var bodyReader io.Reader
  2040. buf, err := json.Marshal(body)
  2041. if err != nil {
  2042. return nil, err
  2043. }
  2044. bodyReader = bytes.NewReader(buf)
  2045. return NewPostSessionInitializeRequestWithBody(server, "application/json", bodyReader)
  2046. }
  2047. // NewPostSessionInitializeRequestWithBody generates requests for PostSessionInitialize with any type of body
  2048. func NewPostSessionInitializeRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
  2049. var err error
  2050. serverURL, err := url.Parse(server)
  2051. if err != nil {
  2052. return nil, err
  2053. }
  2054. operationPath := fmt.Sprintf("/session_initialize")
  2055. if operationPath[0] == '/' {
  2056. operationPath = "." + operationPath
  2057. }
  2058. queryURL, err := serverURL.Parse(operationPath)
  2059. if err != nil {
  2060. return nil, err
  2061. }
  2062. req, err := http.NewRequest("POST", queryURL.String(), body)
  2063. if err != nil {
  2064. return nil, err
  2065. }
  2066. req.Header.Add("Content-Type", contentType)
  2067. return req, nil
  2068. }
  2069. // NewPostSessionListRequest generates requests for PostSessionList
  2070. func NewPostSessionListRequest(server string) (*http.Request, error) {
  2071. var err error
  2072. serverURL, err := url.Parse(server)
  2073. if err != nil {
  2074. return nil, err
  2075. }
  2076. operationPath := fmt.Sprintf("/session_list")
  2077. if operationPath[0] == '/' {
  2078. operationPath = "." + operationPath
  2079. }
  2080. queryURL, err := serverURL.Parse(operationPath)
  2081. if err != nil {
  2082. return nil, err
  2083. }
  2084. req, err := http.NewRequest("POST", queryURL.String(), nil)
  2085. if err != nil {
  2086. return nil, err
  2087. }
  2088. return req, nil
  2089. }
  2090. // NewPostSessionMessagesRequest calls the generic PostSessionMessages builder with application/json body
  2091. func NewPostSessionMessagesRequest(server string, body PostSessionMessagesJSONRequestBody) (*http.Request, error) {
  2092. var bodyReader io.Reader
  2093. buf, err := json.Marshal(body)
  2094. if err != nil {
  2095. return nil, err
  2096. }
  2097. bodyReader = bytes.NewReader(buf)
  2098. return NewPostSessionMessagesRequestWithBody(server, "application/json", bodyReader)
  2099. }
  2100. // NewPostSessionMessagesRequestWithBody generates requests for PostSessionMessages with any type of body
  2101. func NewPostSessionMessagesRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
  2102. var err error
  2103. serverURL, err := url.Parse(server)
  2104. if err != nil {
  2105. return nil, err
  2106. }
  2107. operationPath := fmt.Sprintf("/session_messages")
  2108. if operationPath[0] == '/' {
  2109. operationPath = "." + operationPath
  2110. }
  2111. queryURL, err := serverURL.Parse(operationPath)
  2112. if err != nil {
  2113. return nil, err
  2114. }
  2115. req, err := http.NewRequest("POST", queryURL.String(), body)
  2116. if err != nil {
  2117. return nil, err
  2118. }
  2119. req.Header.Add("Content-Type", contentType)
  2120. return req, nil
  2121. }
  2122. // NewPostSessionShareRequest calls the generic PostSessionShare builder with application/json body
  2123. func NewPostSessionShareRequest(server string, body PostSessionShareJSONRequestBody) (*http.Request, error) {
  2124. var bodyReader io.Reader
  2125. buf, err := json.Marshal(body)
  2126. if err != nil {
  2127. return nil, err
  2128. }
  2129. bodyReader = bytes.NewReader(buf)
  2130. return NewPostSessionShareRequestWithBody(server, "application/json", bodyReader)
  2131. }
  2132. // NewPostSessionShareRequestWithBody generates requests for PostSessionShare with any type of body
  2133. func NewPostSessionShareRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
  2134. var err error
  2135. serverURL, err := url.Parse(server)
  2136. if err != nil {
  2137. return nil, err
  2138. }
  2139. operationPath := fmt.Sprintf("/session_share")
  2140. if operationPath[0] == '/' {
  2141. operationPath = "." + operationPath
  2142. }
  2143. queryURL, err := serverURL.Parse(operationPath)
  2144. if err != nil {
  2145. return nil, err
  2146. }
  2147. req, err := http.NewRequest("POST", queryURL.String(), body)
  2148. if err != nil {
  2149. return nil, err
  2150. }
  2151. req.Header.Add("Content-Type", contentType)
  2152. return req, nil
  2153. }
  2154. // NewPostSessionSummarizeRequest calls the generic PostSessionSummarize builder with application/json body
  2155. func NewPostSessionSummarizeRequest(server string, body PostSessionSummarizeJSONRequestBody) (*http.Request, error) {
  2156. var bodyReader io.Reader
  2157. buf, err := json.Marshal(body)
  2158. if err != nil {
  2159. return nil, err
  2160. }
  2161. bodyReader = bytes.NewReader(buf)
  2162. return NewPostSessionSummarizeRequestWithBody(server, "application/json", bodyReader)
  2163. }
  2164. // NewPostSessionSummarizeRequestWithBody generates requests for PostSessionSummarize with any type of body
  2165. func NewPostSessionSummarizeRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
  2166. var err error
  2167. serverURL, err := url.Parse(server)
  2168. if err != nil {
  2169. return nil, err
  2170. }
  2171. operationPath := fmt.Sprintf("/session_summarize")
  2172. if operationPath[0] == '/' {
  2173. operationPath = "." + operationPath
  2174. }
  2175. queryURL, err := serverURL.Parse(operationPath)
  2176. if err != nil {
  2177. return nil, err
  2178. }
  2179. req, err := http.NewRequest("POST", queryURL.String(), body)
  2180. if err != nil {
  2181. return nil, err
  2182. }
  2183. req.Header.Add("Content-Type", contentType)
  2184. return req, nil
  2185. }
  2186. // NewPostSessionUnshareRequest calls the generic PostSessionUnshare builder with application/json body
  2187. func NewPostSessionUnshareRequest(server string, body PostSessionUnshareJSONRequestBody) (*http.Request, error) {
  2188. var bodyReader io.Reader
  2189. buf, err := json.Marshal(body)
  2190. if err != nil {
  2191. return nil, err
  2192. }
  2193. bodyReader = bytes.NewReader(buf)
  2194. return NewPostSessionUnshareRequestWithBody(server, "application/json", bodyReader)
  2195. }
  2196. // NewPostSessionUnshareRequestWithBody generates requests for PostSessionUnshare with any type of body
  2197. func NewPostSessionUnshareRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
  2198. var err error
  2199. serverURL, err := url.Parse(server)
  2200. if err != nil {
  2201. return nil, err
  2202. }
  2203. operationPath := fmt.Sprintf("/session_unshare")
  2204. if operationPath[0] == '/' {
  2205. operationPath = "." + operationPath
  2206. }
  2207. queryURL, err := serverURL.Parse(operationPath)
  2208. if err != nil {
  2209. return nil, err
  2210. }
  2211. req, err := http.NewRequest("POST", queryURL.String(), body)
  2212. if err != nil {
  2213. return nil, err
  2214. }
  2215. req.Header.Add("Content-Type", contentType)
  2216. return req, nil
  2217. }
  2218. func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error {
  2219. for _, r := range c.RequestEditors {
  2220. if err := r(ctx, req); err != nil {
  2221. return err
  2222. }
  2223. }
  2224. for _, r := range additionalEditors {
  2225. if err := r(ctx, req); err != nil {
  2226. return err
  2227. }
  2228. }
  2229. return nil
  2230. }
  2231. // ClientWithResponses builds on ClientInterface to offer response payloads
  2232. type ClientWithResponses struct {
  2233. ClientInterface
  2234. }
  2235. // NewClientWithResponses creates a new ClientWithResponses, which wraps
  2236. // Client with return type handling
  2237. func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) {
  2238. client, err := NewClient(server, opts...)
  2239. if err != nil {
  2240. return nil, err
  2241. }
  2242. return &ClientWithResponses{client}, nil
  2243. }
  2244. // WithBaseURL overrides the baseURL.
  2245. func WithBaseURL(baseURL string) ClientOption {
  2246. return func(c *Client) error {
  2247. newBaseURL, err := url.Parse(baseURL)
  2248. if err != nil {
  2249. return err
  2250. }
  2251. c.Server = newBaseURL.String()
  2252. return nil
  2253. }
  2254. }
  2255. // ClientWithResponsesInterface is the interface specification for the client with responses above.
  2256. type ClientWithResponsesInterface interface {
  2257. // PostAppInfoWithResponse request
  2258. PostAppInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostAppInfoResponse, error)
  2259. // PostAppInitializeWithResponse request
  2260. PostAppInitializeWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostAppInitializeResponse, error)
  2261. // PostConfigGetWithResponse request
  2262. PostConfigGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostConfigGetResponse, error)
  2263. // GetEventWithResponse request
  2264. GetEventWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetEventResponse, error)
  2265. // PostFileSearchWithBodyWithResponse request with any body
  2266. PostFileSearchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFileSearchResponse, error)
  2267. PostFileSearchWithResponse(ctx context.Context, body PostFileSearchJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFileSearchResponse, error)
  2268. // PostInstallationInfoWithResponse request
  2269. PostInstallationInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostInstallationInfoResponse, error)
  2270. // PostPathGetWithResponse request
  2271. PostPathGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostPathGetResponse, error)
  2272. // PostProviderListWithResponse request
  2273. PostProviderListWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostProviderListResponse, error)
  2274. // PostSessionAbortWithBodyWithResponse request with any body
  2275. PostSessionAbortWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionAbortResponse, error)
  2276. PostSessionAbortWithResponse(ctx context.Context, body PostSessionAbortJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionAbortResponse, error)
  2277. // PostSessionChatWithBodyWithResponse request with any body
  2278. PostSessionChatWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionChatResponse, error)
  2279. PostSessionChatWithResponse(ctx context.Context, body PostSessionChatJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionChatResponse, error)
  2280. // PostSessionCreateWithResponse request
  2281. PostSessionCreateWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostSessionCreateResponse, error)
  2282. // PostSessionDeleteWithBodyWithResponse request with any body
  2283. PostSessionDeleteWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionDeleteResponse, error)
  2284. PostSessionDeleteWithResponse(ctx context.Context, body PostSessionDeleteJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionDeleteResponse, error)
  2285. // PostSessionInitializeWithBodyWithResponse request with any body
  2286. PostSessionInitializeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionInitializeResponse, error)
  2287. PostSessionInitializeWithResponse(ctx context.Context, body PostSessionInitializeJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionInitializeResponse, error)
  2288. // PostSessionListWithResponse request
  2289. PostSessionListWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostSessionListResponse, error)
  2290. // PostSessionMessagesWithBodyWithResponse request with any body
  2291. PostSessionMessagesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionMessagesResponse, error)
  2292. PostSessionMessagesWithResponse(ctx context.Context, body PostSessionMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionMessagesResponse, error)
  2293. // PostSessionShareWithBodyWithResponse request with any body
  2294. PostSessionShareWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionShareResponse, error)
  2295. PostSessionShareWithResponse(ctx context.Context, body PostSessionShareJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionShareResponse, error)
  2296. // PostSessionSummarizeWithBodyWithResponse request with any body
  2297. PostSessionSummarizeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionSummarizeResponse, error)
  2298. PostSessionSummarizeWithResponse(ctx context.Context, body PostSessionSummarizeJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionSummarizeResponse, error)
  2299. // PostSessionUnshareWithBodyWithResponse request with any body
  2300. PostSessionUnshareWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionUnshareResponse, error)
  2301. PostSessionUnshareWithResponse(ctx context.Context, body PostSessionUnshareJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionUnshareResponse, error)
  2302. }
  2303. type PostAppInfoResponse struct {
  2304. Body []byte
  2305. HTTPResponse *http.Response
  2306. JSON200 *AppInfo
  2307. }
  2308. // Status returns HTTPResponse.Status
  2309. func (r PostAppInfoResponse) Status() string {
  2310. if r.HTTPResponse != nil {
  2311. return r.HTTPResponse.Status
  2312. }
  2313. return http.StatusText(0)
  2314. }
  2315. // StatusCode returns HTTPResponse.StatusCode
  2316. func (r PostAppInfoResponse) StatusCode() int {
  2317. if r.HTTPResponse != nil {
  2318. return r.HTTPResponse.StatusCode
  2319. }
  2320. return 0
  2321. }
  2322. type PostAppInitializeResponse struct {
  2323. Body []byte
  2324. HTTPResponse *http.Response
  2325. JSON200 *bool
  2326. }
  2327. // Status returns HTTPResponse.Status
  2328. func (r PostAppInitializeResponse) Status() string {
  2329. if r.HTTPResponse != nil {
  2330. return r.HTTPResponse.Status
  2331. }
  2332. return http.StatusText(0)
  2333. }
  2334. // StatusCode returns HTTPResponse.StatusCode
  2335. func (r PostAppInitializeResponse) StatusCode() int {
  2336. if r.HTTPResponse != nil {
  2337. return r.HTTPResponse.StatusCode
  2338. }
  2339. return 0
  2340. }
  2341. type PostConfigGetResponse struct {
  2342. Body []byte
  2343. HTTPResponse *http.Response
  2344. JSON200 *ConfigInfo
  2345. }
  2346. // Status returns HTTPResponse.Status
  2347. func (r PostConfigGetResponse) Status() string {
  2348. if r.HTTPResponse != nil {
  2349. return r.HTTPResponse.Status
  2350. }
  2351. return http.StatusText(0)
  2352. }
  2353. // StatusCode returns HTTPResponse.StatusCode
  2354. func (r PostConfigGetResponse) StatusCode() int {
  2355. if r.HTTPResponse != nil {
  2356. return r.HTTPResponse.StatusCode
  2357. }
  2358. return 0
  2359. }
  2360. type GetEventResponse struct {
  2361. Body []byte
  2362. HTTPResponse *http.Response
  2363. JSON200 *Event
  2364. }
  2365. // Status returns HTTPResponse.Status
  2366. func (r GetEventResponse) Status() string {
  2367. if r.HTTPResponse != nil {
  2368. return r.HTTPResponse.Status
  2369. }
  2370. return http.StatusText(0)
  2371. }
  2372. // StatusCode returns HTTPResponse.StatusCode
  2373. func (r GetEventResponse) StatusCode() int {
  2374. if r.HTTPResponse != nil {
  2375. return r.HTTPResponse.StatusCode
  2376. }
  2377. return 0
  2378. }
  2379. type PostFileSearchResponse struct {
  2380. Body []byte
  2381. HTTPResponse *http.Response
  2382. JSON200 *[]string
  2383. }
  2384. // Status returns HTTPResponse.Status
  2385. func (r PostFileSearchResponse) Status() string {
  2386. if r.HTTPResponse != nil {
  2387. return r.HTTPResponse.Status
  2388. }
  2389. return http.StatusText(0)
  2390. }
  2391. // StatusCode returns HTTPResponse.StatusCode
  2392. func (r PostFileSearchResponse) StatusCode() int {
  2393. if r.HTTPResponse != nil {
  2394. return r.HTTPResponse.StatusCode
  2395. }
  2396. return 0
  2397. }
  2398. type PostInstallationInfoResponse struct {
  2399. Body []byte
  2400. HTTPResponse *http.Response
  2401. JSON200 *InstallationInfo
  2402. }
  2403. // Status returns HTTPResponse.Status
  2404. func (r PostInstallationInfoResponse) Status() string {
  2405. if r.HTTPResponse != nil {
  2406. return r.HTTPResponse.Status
  2407. }
  2408. return http.StatusText(0)
  2409. }
  2410. // StatusCode returns HTTPResponse.StatusCode
  2411. func (r PostInstallationInfoResponse) StatusCode() int {
  2412. if r.HTTPResponse != nil {
  2413. return r.HTTPResponse.StatusCode
  2414. }
  2415. return 0
  2416. }
  2417. type PostPathGetResponse struct {
  2418. Body []byte
  2419. HTTPResponse *http.Response
  2420. JSON200 *struct {
  2421. Config string `json:"config"`
  2422. Cwd string `json:"cwd"`
  2423. Data string `json:"data"`
  2424. Root string `json:"root"`
  2425. }
  2426. }
  2427. // Status returns HTTPResponse.Status
  2428. func (r PostPathGetResponse) Status() string {
  2429. if r.HTTPResponse != nil {
  2430. return r.HTTPResponse.Status
  2431. }
  2432. return http.StatusText(0)
  2433. }
  2434. // StatusCode returns HTTPResponse.StatusCode
  2435. func (r PostPathGetResponse) StatusCode() int {
  2436. if r.HTTPResponse != nil {
  2437. return r.HTTPResponse.StatusCode
  2438. }
  2439. return 0
  2440. }
  2441. type PostProviderListResponse struct {
  2442. Body []byte
  2443. HTTPResponse *http.Response
  2444. JSON200 *struct {
  2445. Default map[string]string `json:"default"`
  2446. Providers []ProviderInfo `json:"providers"`
  2447. }
  2448. }
  2449. // Status returns HTTPResponse.Status
  2450. func (r PostProviderListResponse) Status() string {
  2451. if r.HTTPResponse != nil {
  2452. return r.HTTPResponse.Status
  2453. }
  2454. return http.StatusText(0)
  2455. }
  2456. // StatusCode returns HTTPResponse.StatusCode
  2457. func (r PostProviderListResponse) StatusCode() int {
  2458. if r.HTTPResponse != nil {
  2459. return r.HTTPResponse.StatusCode
  2460. }
  2461. return 0
  2462. }
  2463. type PostSessionAbortResponse struct {
  2464. Body []byte
  2465. HTTPResponse *http.Response
  2466. JSON200 *bool
  2467. }
  2468. // Status returns HTTPResponse.Status
  2469. func (r PostSessionAbortResponse) Status() string {
  2470. if r.HTTPResponse != nil {
  2471. return r.HTTPResponse.Status
  2472. }
  2473. return http.StatusText(0)
  2474. }
  2475. // StatusCode returns HTTPResponse.StatusCode
  2476. func (r PostSessionAbortResponse) StatusCode() int {
  2477. if r.HTTPResponse != nil {
  2478. return r.HTTPResponse.StatusCode
  2479. }
  2480. return 0
  2481. }
  2482. type PostSessionChatResponse struct {
  2483. Body []byte
  2484. HTTPResponse *http.Response
  2485. JSON200 *MessageInfo
  2486. }
  2487. // Status returns HTTPResponse.Status
  2488. func (r PostSessionChatResponse) Status() string {
  2489. if r.HTTPResponse != nil {
  2490. return r.HTTPResponse.Status
  2491. }
  2492. return http.StatusText(0)
  2493. }
  2494. // StatusCode returns HTTPResponse.StatusCode
  2495. func (r PostSessionChatResponse) StatusCode() int {
  2496. if r.HTTPResponse != nil {
  2497. return r.HTTPResponse.StatusCode
  2498. }
  2499. return 0
  2500. }
  2501. type PostSessionCreateResponse struct {
  2502. Body []byte
  2503. HTTPResponse *http.Response
  2504. JSON200 *SessionInfo
  2505. JSON400 *Error
  2506. }
  2507. // Status returns HTTPResponse.Status
  2508. func (r PostSessionCreateResponse) Status() string {
  2509. if r.HTTPResponse != nil {
  2510. return r.HTTPResponse.Status
  2511. }
  2512. return http.StatusText(0)
  2513. }
  2514. // StatusCode returns HTTPResponse.StatusCode
  2515. func (r PostSessionCreateResponse) StatusCode() int {
  2516. if r.HTTPResponse != nil {
  2517. return r.HTTPResponse.StatusCode
  2518. }
  2519. return 0
  2520. }
  2521. type PostSessionDeleteResponse struct {
  2522. Body []byte
  2523. HTTPResponse *http.Response
  2524. JSON200 *bool
  2525. }
  2526. // Status returns HTTPResponse.Status
  2527. func (r PostSessionDeleteResponse) Status() string {
  2528. if r.HTTPResponse != nil {
  2529. return r.HTTPResponse.Status
  2530. }
  2531. return http.StatusText(0)
  2532. }
  2533. // StatusCode returns HTTPResponse.StatusCode
  2534. func (r PostSessionDeleteResponse) StatusCode() int {
  2535. if r.HTTPResponse != nil {
  2536. return r.HTTPResponse.StatusCode
  2537. }
  2538. return 0
  2539. }
  2540. type PostSessionInitializeResponse struct {
  2541. Body []byte
  2542. HTTPResponse *http.Response
  2543. JSON200 *bool
  2544. }
  2545. // Status returns HTTPResponse.Status
  2546. func (r PostSessionInitializeResponse) Status() string {
  2547. if r.HTTPResponse != nil {
  2548. return r.HTTPResponse.Status
  2549. }
  2550. return http.StatusText(0)
  2551. }
  2552. // StatusCode returns HTTPResponse.StatusCode
  2553. func (r PostSessionInitializeResponse) StatusCode() int {
  2554. if r.HTTPResponse != nil {
  2555. return r.HTTPResponse.StatusCode
  2556. }
  2557. return 0
  2558. }
  2559. type PostSessionListResponse struct {
  2560. Body []byte
  2561. HTTPResponse *http.Response
  2562. JSON200 *[]SessionInfo
  2563. }
  2564. // Status returns HTTPResponse.Status
  2565. func (r PostSessionListResponse) Status() string {
  2566. if r.HTTPResponse != nil {
  2567. return r.HTTPResponse.Status
  2568. }
  2569. return http.StatusText(0)
  2570. }
  2571. // StatusCode returns HTTPResponse.StatusCode
  2572. func (r PostSessionListResponse) StatusCode() int {
  2573. if r.HTTPResponse != nil {
  2574. return r.HTTPResponse.StatusCode
  2575. }
  2576. return 0
  2577. }
  2578. type PostSessionMessagesResponse struct {
  2579. Body []byte
  2580. HTTPResponse *http.Response
  2581. JSON200 *[]MessageInfo
  2582. }
  2583. // Status returns HTTPResponse.Status
  2584. func (r PostSessionMessagesResponse) Status() string {
  2585. if r.HTTPResponse != nil {
  2586. return r.HTTPResponse.Status
  2587. }
  2588. return http.StatusText(0)
  2589. }
  2590. // StatusCode returns HTTPResponse.StatusCode
  2591. func (r PostSessionMessagesResponse) StatusCode() int {
  2592. if r.HTTPResponse != nil {
  2593. return r.HTTPResponse.StatusCode
  2594. }
  2595. return 0
  2596. }
  2597. type PostSessionShareResponse struct {
  2598. Body []byte
  2599. HTTPResponse *http.Response
  2600. JSON200 *SessionInfo
  2601. }
  2602. // Status returns HTTPResponse.Status
  2603. func (r PostSessionShareResponse) Status() string {
  2604. if r.HTTPResponse != nil {
  2605. return r.HTTPResponse.Status
  2606. }
  2607. return http.StatusText(0)
  2608. }
  2609. // StatusCode returns HTTPResponse.StatusCode
  2610. func (r PostSessionShareResponse) StatusCode() int {
  2611. if r.HTTPResponse != nil {
  2612. return r.HTTPResponse.StatusCode
  2613. }
  2614. return 0
  2615. }
  2616. type PostSessionSummarizeResponse struct {
  2617. Body []byte
  2618. HTTPResponse *http.Response
  2619. JSON200 *bool
  2620. }
  2621. // Status returns HTTPResponse.Status
  2622. func (r PostSessionSummarizeResponse) Status() string {
  2623. if r.HTTPResponse != nil {
  2624. return r.HTTPResponse.Status
  2625. }
  2626. return http.StatusText(0)
  2627. }
  2628. // StatusCode returns HTTPResponse.StatusCode
  2629. func (r PostSessionSummarizeResponse) StatusCode() int {
  2630. if r.HTTPResponse != nil {
  2631. return r.HTTPResponse.StatusCode
  2632. }
  2633. return 0
  2634. }
  2635. type PostSessionUnshareResponse struct {
  2636. Body []byte
  2637. HTTPResponse *http.Response
  2638. JSON200 *SessionInfo
  2639. }
  2640. // Status returns HTTPResponse.Status
  2641. func (r PostSessionUnshareResponse) Status() string {
  2642. if r.HTTPResponse != nil {
  2643. return r.HTTPResponse.Status
  2644. }
  2645. return http.StatusText(0)
  2646. }
  2647. // StatusCode returns HTTPResponse.StatusCode
  2648. func (r PostSessionUnshareResponse) StatusCode() int {
  2649. if r.HTTPResponse != nil {
  2650. return r.HTTPResponse.StatusCode
  2651. }
  2652. return 0
  2653. }
  2654. // PostAppInfoWithResponse request returning *PostAppInfoResponse
  2655. func (c *ClientWithResponses) PostAppInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostAppInfoResponse, error) {
  2656. rsp, err := c.PostAppInfo(ctx, reqEditors...)
  2657. if err != nil {
  2658. return nil, err
  2659. }
  2660. return ParsePostAppInfoResponse(rsp)
  2661. }
  2662. // PostAppInitializeWithResponse request returning *PostAppInitializeResponse
  2663. func (c *ClientWithResponses) PostAppInitializeWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostAppInitializeResponse, error) {
  2664. rsp, err := c.PostAppInitialize(ctx, reqEditors...)
  2665. if err != nil {
  2666. return nil, err
  2667. }
  2668. return ParsePostAppInitializeResponse(rsp)
  2669. }
  2670. // PostConfigGetWithResponse request returning *PostConfigGetResponse
  2671. func (c *ClientWithResponses) PostConfigGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostConfigGetResponse, error) {
  2672. rsp, err := c.PostConfigGet(ctx, reqEditors...)
  2673. if err != nil {
  2674. return nil, err
  2675. }
  2676. return ParsePostConfigGetResponse(rsp)
  2677. }
  2678. // GetEventWithResponse request returning *GetEventResponse
  2679. func (c *ClientWithResponses) GetEventWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetEventResponse, error) {
  2680. rsp, err := c.GetEvent(ctx, reqEditors...)
  2681. if err != nil {
  2682. return nil, err
  2683. }
  2684. return ParseGetEventResponse(rsp)
  2685. }
  2686. // PostFileSearchWithBodyWithResponse request with arbitrary body returning *PostFileSearchResponse
  2687. func (c *ClientWithResponses) PostFileSearchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFileSearchResponse, error) {
  2688. rsp, err := c.PostFileSearchWithBody(ctx, contentType, body, reqEditors...)
  2689. if err != nil {
  2690. return nil, err
  2691. }
  2692. return ParsePostFileSearchResponse(rsp)
  2693. }
  2694. func (c *ClientWithResponses) PostFileSearchWithResponse(ctx context.Context, body PostFileSearchJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFileSearchResponse, error) {
  2695. rsp, err := c.PostFileSearch(ctx, body, reqEditors...)
  2696. if err != nil {
  2697. return nil, err
  2698. }
  2699. return ParsePostFileSearchResponse(rsp)
  2700. }
  2701. // PostInstallationInfoWithResponse request returning *PostInstallationInfoResponse
  2702. func (c *ClientWithResponses) PostInstallationInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostInstallationInfoResponse, error) {
  2703. rsp, err := c.PostInstallationInfo(ctx, reqEditors...)
  2704. if err != nil {
  2705. return nil, err
  2706. }
  2707. return ParsePostInstallationInfoResponse(rsp)
  2708. }
  2709. // PostPathGetWithResponse request returning *PostPathGetResponse
  2710. func (c *ClientWithResponses) PostPathGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostPathGetResponse, error) {
  2711. rsp, err := c.PostPathGet(ctx, reqEditors...)
  2712. if err != nil {
  2713. return nil, err
  2714. }
  2715. return ParsePostPathGetResponse(rsp)
  2716. }
  2717. // PostProviderListWithResponse request returning *PostProviderListResponse
  2718. func (c *ClientWithResponses) PostProviderListWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostProviderListResponse, error) {
  2719. rsp, err := c.PostProviderList(ctx, reqEditors...)
  2720. if err != nil {
  2721. return nil, err
  2722. }
  2723. return ParsePostProviderListResponse(rsp)
  2724. }
  2725. // PostSessionAbortWithBodyWithResponse request with arbitrary body returning *PostSessionAbortResponse
  2726. func (c *ClientWithResponses) PostSessionAbortWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionAbortResponse, error) {
  2727. rsp, err := c.PostSessionAbortWithBody(ctx, contentType, body, reqEditors...)
  2728. if err != nil {
  2729. return nil, err
  2730. }
  2731. return ParsePostSessionAbortResponse(rsp)
  2732. }
  2733. func (c *ClientWithResponses) PostSessionAbortWithResponse(ctx context.Context, body PostSessionAbortJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionAbortResponse, error) {
  2734. rsp, err := c.PostSessionAbort(ctx, body, reqEditors...)
  2735. if err != nil {
  2736. return nil, err
  2737. }
  2738. return ParsePostSessionAbortResponse(rsp)
  2739. }
  2740. // PostSessionChatWithBodyWithResponse request with arbitrary body returning *PostSessionChatResponse
  2741. func (c *ClientWithResponses) PostSessionChatWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionChatResponse, error) {
  2742. rsp, err := c.PostSessionChatWithBody(ctx, contentType, body, reqEditors...)
  2743. if err != nil {
  2744. return nil, err
  2745. }
  2746. return ParsePostSessionChatResponse(rsp)
  2747. }
  2748. func (c *ClientWithResponses) PostSessionChatWithResponse(ctx context.Context, body PostSessionChatJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionChatResponse, error) {
  2749. rsp, err := c.PostSessionChat(ctx, body, reqEditors...)
  2750. if err != nil {
  2751. return nil, err
  2752. }
  2753. return ParsePostSessionChatResponse(rsp)
  2754. }
  2755. // PostSessionCreateWithResponse request returning *PostSessionCreateResponse
  2756. func (c *ClientWithResponses) PostSessionCreateWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostSessionCreateResponse, error) {
  2757. rsp, err := c.PostSessionCreate(ctx, reqEditors...)
  2758. if err != nil {
  2759. return nil, err
  2760. }
  2761. return ParsePostSessionCreateResponse(rsp)
  2762. }
  2763. // PostSessionDeleteWithBodyWithResponse request with arbitrary body returning *PostSessionDeleteResponse
  2764. func (c *ClientWithResponses) PostSessionDeleteWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionDeleteResponse, error) {
  2765. rsp, err := c.PostSessionDeleteWithBody(ctx, contentType, body, reqEditors...)
  2766. if err != nil {
  2767. return nil, err
  2768. }
  2769. return ParsePostSessionDeleteResponse(rsp)
  2770. }
  2771. func (c *ClientWithResponses) PostSessionDeleteWithResponse(ctx context.Context, body PostSessionDeleteJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionDeleteResponse, error) {
  2772. rsp, err := c.PostSessionDelete(ctx, body, reqEditors...)
  2773. if err != nil {
  2774. return nil, err
  2775. }
  2776. return ParsePostSessionDeleteResponse(rsp)
  2777. }
  2778. // PostSessionInitializeWithBodyWithResponse request with arbitrary body returning *PostSessionInitializeResponse
  2779. func (c *ClientWithResponses) PostSessionInitializeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionInitializeResponse, error) {
  2780. rsp, err := c.PostSessionInitializeWithBody(ctx, contentType, body, reqEditors...)
  2781. if err != nil {
  2782. return nil, err
  2783. }
  2784. return ParsePostSessionInitializeResponse(rsp)
  2785. }
  2786. func (c *ClientWithResponses) PostSessionInitializeWithResponse(ctx context.Context, body PostSessionInitializeJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionInitializeResponse, error) {
  2787. rsp, err := c.PostSessionInitialize(ctx, body, reqEditors...)
  2788. if err != nil {
  2789. return nil, err
  2790. }
  2791. return ParsePostSessionInitializeResponse(rsp)
  2792. }
  2793. // PostSessionListWithResponse request returning *PostSessionListResponse
  2794. func (c *ClientWithResponses) PostSessionListWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostSessionListResponse, error) {
  2795. rsp, err := c.PostSessionList(ctx, reqEditors...)
  2796. if err != nil {
  2797. return nil, err
  2798. }
  2799. return ParsePostSessionListResponse(rsp)
  2800. }
  2801. // PostSessionMessagesWithBodyWithResponse request with arbitrary body returning *PostSessionMessagesResponse
  2802. func (c *ClientWithResponses) PostSessionMessagesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionMessagesResponse, error) {
  2803. rsp, err := c.PostSessionMessagesWithBody(ctx, contentType, body, reqEditors...)
  2804. if err != nil {
  2805. return nil, err
  2806. }
  2807. return ParsePostSessionMessagesResponse(rsp)
  2808. }
  2809. func (c *ClientWithResponses) PostSessionMessagesWithResponse(ctx context.Context, body PostSessionMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionMessagesResponse, error) {
  2810. rsp, err := c.PostSessionMessages(ctx, body, reqEditors...)
  2811. if err != nil {
  2812. return nil, err
  2813. }
  2814. return ParsePostSessionMessagesResponse(rsp)
  2815. }
  2816. // PostSessionShareWithBodyWithResponse request with arbitrary body returning *PostSessionShareResponse
  2817. func (c *ClientWithResponses) PostSessionShareWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionShareResponse, error) {
  2818. rsp, err := c.PostSessionShareWithBody(ctx, contentType, body, reqEditors...)
  2819. if err != nil {
  2820. return nil, err
  2821. }
  2822. return ParsePostSessionShareResponse(rsp)
  2823. }
  2824. func (c *ClientWithResponses) PostSessionShareWithResponse(ctx context.Context, body PostSessionShareJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionShareResponse, error) {
  2825. rsp, err := c.PostSessionShare(ctx, body, reqEditors...)
  2826. if err != nil {
  2827. return nil, err
  2828. }
  2829. return ParsePostSessionShareResponse(rsp)
  2830. }
  2831. // PostSessionSummarizeWithBodyWithResponse request with arbitrary body returning *PostSessionSummarizeResponse
  2832. func (c *ClientWithResponses) PostSessionSummarizeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionSummarizeResponse, error) {
  2833. rsp, err := c.PostSessionSummarizeWithBody(ctx, contentType, body, reqEditors...)
  2834. if err != nil {
  2835. return nil, err
  2836. }
  2837. return ParsePostSessionSummarizeResponse(rsp)
  2838. }
  2839. func (c *ClientWithResponses) PostSessionSummarizeWithResponse(ctx context.Context, body PostSessionSummarizeJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionSummarizeResponse, error) {
  2840. rsp, err := c.PostSessionSummarize(ctx, body, reqEditors...)
  2841. if err != nil {
  2842. return nil, err
  2843. }
  2844. return ParsePostSessionSummarizeResponse(rsp)
  2845. }
  2846. // PostSessionUnshareWithBodyWithResponse request with arbitrary body returning *PostSessionUnshareResponse
  2847. func (c *ClientWithResponses) PostSessionUnshareWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionUnshareResponse, error) {
  2848. rsp, err := c.PostSessionUnshareWithBody(ctx, contentType, body, reqEditors...)
  2849. if err != nil {
  2850. return nil, err
  2851. }
  2852. return ParsePostSessionUnshareResponse(rsp)
  2853. }
  2854. func (c *ClientWithResponses) PostSessionUnshareWithResponse(ctx context.Context, body PostSessionUnshareJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionUnshareResponse, error) {
  2855. rsp, err := c.PostSessionUnshare(ctx, body, reqEditors...)
  2856. if err != nil {
  2857. return nil, err
  2858. }
  2859. return ParsePostSessionUnshareResponse(rsp)
  2860. }
  2861. // ParsePostAppInfoResponse parses an HTTP response from a PostAppInfoWithResponse call
  2862. func ParsePostAppInfoResponse(rsp *http.Response) (*PostAppInfoResponse, error) {
  2863. bodyBytes, err := io.ReadAll(rsp.Body)
  2864. defer func() { _ = rsp.Body.Close() }()
  2865. if err != nil {
  2866. return nil, err
  2867. }
  2868. response := &PostAppInfoResponse{
  2869. Body: bodyBytes,
  2870. HTTPResponse: rsp,
  2871. }
  2872. switch {
  2873. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  2874. var dest AppInfo
  2875. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  2876. return nil, err
  2877. }
  2878. response.JSON200 = &dest
  2879. }
  2880. return response, nil
  2881. }
  2882. // ParsePostAppInitializeResponse parses an HTTP response from a PostAppInitializeWithResponse call
  2883. func ParsePostAppInitializeResponse(rsp *http.Response) (*PostAppInitializeResponse, error) {
  2884. bodyBytes, err := io.ReadAll(rsp.Body)
  2885. defer func() { _ = rsp.Body.Close() }()
  2886. if err != nil {
  2887. return nil, err
  2888. }
  2889. response := &PostAppInitializeResponse{
  2890. Body: bodyBytes,
  2891. HTTPResponse: rsp,
  2892. }
  2893. switch {
  2894. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  2895. var dest bool
  2896. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  2897. return nil, err
  2898. }
  2899. response.JSON200 = &dest
  2900. }
  2901. return response, nil
  2902. }
  2903. // ParsePostConfigGetResponse parses an HTTP response from a PostConfigGetWithResponse call
  2904. func ParsePostConfigGetResponse(rsp *http.Response) (*PostConfigGetResponse, error) {
  2905. bodyBytes, err := io.ReadAll(rsp.Body)
  2906. defer func() { _ = rsp.Body.Close() }()
  2907. if err != nil {
  2908. return nil, err
  2909. }
  2910. response := &PostConfigGetResponse{
  2911. Body: bodyBytes,
  2912. HTTPResponse: rsp,
  2913. }
  2914. switch {
  2915. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  2916. var dest ConfigInfo
  2917. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  2918. return nil, err
  2919. }
  2920. response.JSON200 = &dest
  2921. }
  2922. return response, nil
  2923. }
  2924. // ParseGetEventResponse parses an HTTP response from a GetEventWithResponse call
  2925. func ParseGetEventResponse(rsp *http.Response) (*GetEventResponse, error) {
  2926. bodyBytes, err := io.ReadAll(rsp.Body)
  2927. defer func() { _ = rsp.Body.Close() }()
  2928. if err != nil {
  2929. return nil, err
  2930. }
  2931. response := &GetEventResponse{
  2932. Body: bodyBytes,
  2933. HTTPResponse: rsp,
  2934. }
  2935. switch {
  2936. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  2937. var dest Event
  2938. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  2939. return nil, err
  2940. }
  2941. response.JSON200 = &dest
  2942. }
  2943. return response, nil
  2944. }
  2945. // ParsePostFileSearchResponse parses an HTTP response from a PostFileSearchWithResponse call
  2946. func ParsePostFileSearchResponse(rsp *http.Response) (*PostFileSearchResponse, error) {
  2947. bodyBytes, err := io.ReadAll(rsp.Body)
  2948. defer func() { _ = rsp.Body.Close() }()
  2949. if err != nil {
  2950. return nil, err
  2951. }
  2952. response := &PostFileSearchResponse{
  2953. Body: bodyBytes,
  2954. HTTPResponse: rsp,
  2955. }
  2956. switch {
  2957. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  2958. var dest []string
  2959. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  2960. return nil, err
  2961. }
  2962. response.JSON200 = &dest
  2963. }
  2964. return response, nil
  2965. }
  2966. // ParsePostInstallationInfoResponse parses an HTTP response from a PostInstallationInfoWithResponse call
  2967. func ParsePostInstallationInfoResponse(rsp *http.Response) (*PostInstallationInfoResponse, error) {
  2968. bodyBytes, err := io.ReadAll(rsp.Body)
  2969. defer func() { _ = rsp.Body.Close() }()
  2970. if err != nil {
  2971. return nil, err
  2972. }
  2973. response := &PostInstallationInfoResponse{
  2974. Body: bodyBytes,
  2975. HTTPResponse: rsp,
  2976. }
  2977. switch {
  2978. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  2979. var dest InstallationInfo
  2980. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  2981. return nil, err
  2982. }
  2983. response.JSON200 = &dest
  2984. }
  2985. return response, nil
  2986. }
  2987. // ParsePostPathGetResponse parses an HTTP response from a PostPathGetWithResponse call
  2988. func ParsePostPathGetResponse(rsp *http.Response) (*PostPathGetResponse, error) {
  2989. bodyBytes, err := io.ReadAll(rsp.Body)
  2990. defer func() { _ = rsp.Body.Close() }()
  2991. if err != nil {
  2992. return nil, err
  2993. }
  2994. response := &PostPathGetResponse{
  2995. Body: bodyBytes,
  2996. HTTPResponse: rsp,
  2997. }
  2998. switch {
  2999. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  3000. var dest struct {
  3001. Config string `json:"config"`
  3002. Cwd string `json:"cwd"`
  3003. Data string `json:"data"`
  3004. Root string `json:"root"`
  3005. }
  3006. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  3007. return nil, err
  3008. }
  3009. response.JSON200 = &dest
  3010. }
  3011. return response, nil
  3012. }
  3013. // ParsePostProviderListResponse parses an HTTP response from a PostProviderListWithResponse call
  3014. func ParsePostProviderListResponse(rsp *http.Response) (*PostProviderListResponse, error) {
  3015. bodyBytes, err := io.ReadAll(rsp.Body)
  3016. defer func() { _ = rsp.Body.Close() }()
  3017. if err != nil {
  3018. return nil, err
  3019. }
  3020. response := &PostProviderListResponse{
  3021. Body: bodyBytes,
  3022. HTTPResponse: rsp,
  3023. }
  3024. switch {
  3025. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  3026. var dest struct {
  3027. Default map[string]string `json:"default"`
  3028. Providers []ProviderInfo `json:"providers"`
  3029. }
  3030. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  3031. return nil, err
  3032. }
  3033. response.JSON200 = &dest
  3034. }
  3035. return response, nil
  3036. }
  3037. // ParsePostSessionAbortResponse parses an HTTP response from a PostSessionAbortWithResponse call
  3038. func ParsePostSessionAbortResponse(rsp *http.Response) (*PostSessionAbortResponse, error) {
  3039. bodyBytes, err := io.ReadAll(rsp.Body)
  3040. defer func() { _ = rsp.Body.Close() }()
  3041. if err != nil {
  3042. return nil, err
  3043. }
  3044. response := &PostSessionAbortResponse{
  3045. Body: bodyBytes,
  3046. HTTPResponse: rsp,
  3047. }
  3048. switch {
  3049. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  3050. var dest bool
  3051. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  3052. return nil, err
  3053. }
  3054. response.JSON200 = &dest
  3055. }
  3056. return response, nil
  3057. }
  3058. // ParsePostSessionChatResponse parses an HTTP response from a PostSessionChatWithResponse call
  3059. func ParsePostSessionChatResponse(rsp *http.Response) (*PostSessionChatResponse, error) {
  3060. bodyBytes, err := io.ReadAll(rsp.Body)
  3061. defer func() { _ = rsp.Body.Close() }()
  3062. if err != nil {
  3063. return nil, err
  3064. }
  3065. response := &PostSessionChatResponse{
  3066. Body: bodyBytes,
  3067. HTTPResponse: rsp,
  3068. }
  3069. switch {
  3070. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  3071. var dest MessageInfo
  3072. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  3073. return nil, err
  3074. }
  3075. response.JSON200 = &dest
  3076. }
  3077. return response, nil
  3078. }
  3079. // ParsePostSessionCreateResponse parses an HTTP response from a PostSessionCreateWithResponse call
  3080. func ParsePostSessionCreateResponse(rsp *http.Response) (*PostSessionCreateResponse, error) {
  3081. bodyBytes, err := io.ReadAll(rsp.Body)
  3082. defer func() { _ = rsp.Body.Close() }()
  3083. if err != nil {
  3084. return nil, err
  3085. }
  3086. response := &PostSessionCreateResponse{
  3087. Body: bodyBytes,
  3088. HTTPResponse: rsp,
  3089. }
  3090. switch {
  3091. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  3092. var dest SessionInfo
  3093. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  3094. return nil, err
  3095. }
  3096. response.JSON200 = &dest
  3097. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
  3098. var dest Error
  3099. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  3100. return nil, err
  3101. }
  3102. response.JSON400 = &dest
  3103. }
  3104. return response, nil
  3105. }
  3106. // ParsePostSessionDeleteResponse parses an HTTP response from a PostSessionDeleteWithResponse call
  3107. func ParsePostSessionDeleteResponse(rsp *http.Response) (*PostSessionDeleteResponse, error) {
  3108. bodyBytes, err := io.ReadAll(rsp.Body)
  3109. defer func() { _ = rsp.Body.Close() }()
  3110. if err != nil {
  3111. return nil, err
  3112. }
  3113. response := &PostSessionDeleteResponse{
  3114. Body: bodyBytes,
  3115. HTTPResponse: rsp,
  3116. }
  3117. switch {
  3118. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  3119. var dest bool
  3120. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  3121. return nil, err
  3122. }
  3123. response.JSON200 = &dest
  3124. }
  3125. return response, nil
  3126. }
  3127. // ParsePostSessionInitializeResponse parses an HTTP response from a PostSessionInitializeWithResponse call
  3128. func ParsePostSessionInitializeResponse(rsp *http.Response) (*PostSessionInitializeResponse, error) {
  3129. bodyBytes, err := io.ReadAll(rsp.Body)
  3130. defer func() { _ = rsp.Body.Close() }()
  3131. if err != nil {
  3132. return nil, err
  3133. }
  3134. response := &PostSessionInitializeResponse{
  3135. Body: bodyBytes,
  3136. HTTPResponse: rsp,
  3137. }
  3138. switch {
  3139. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  3140. var dest bool
  3141. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  3142. return nil, err
  3143. }
  3144. response.JSON200 = &dest
  3145. }
  3146. return response, nil
  3147. }
  3148. // ParsePostSessionListResponse parses an HTTP response from a PostSessionListWithResponse call
  3149. func ParsePostSessionListResponse(rsp *http.Response) (*PostSessionListResponse, error) {
  3150. bodyBytes, err := io.ReadAll(rsp.Body)
  3151. defer func() { _ = rsp.Body.Close() }()
  3152. if err != nil {
  3153. return nil, err
  3154. }
  3155. response := &PostSessionListResponse{
  3156. Body: bodyBytes,
  3157. HTTPResponse: rsp,
  3158. }
  3159. switch {
  3160. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  3161. var dest []SessionInfo
  3162. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  3163. return nil, err
  3164. }
  3165. response.JSON200 = &dest
  3166. }
  3167. return response, nil
  3168. }
  3169. // ParsePostSessionMessagesResponse parses an HTTP response from a PostSessionMessagesWithResponse call
  3170. func ParsePostSessionMessagesResponse(rsp *http.Response) (*PostSessionMessagesResponse, error) {
  3171. bodyBytes, err := io.ReadAll(rsp.Body)
  3172. defer func() { _ = rsp.Body.Close() }()
  3173. if err != nil {
  3174. return nil, err
  3175. }
  3176. response := &PostSessionMessagesResponse{
  3177. Body: bodyBytes,
  3178. HTTPResponse: rsp,
  3179. }
  3180. switch {
  3181. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  3182. var dest []MessageInfo
  3183. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  3184. return nil, err
  3185. }
  3186. response.JSON200 = &dest
  3187. }
  3188. return response, nil
  3189. }
  3190. // ParsePostSessionShareResponse parses an HTTP response from a PostSessionShareWithResponse call
  3191. func ParsePostSessionShareResponse(rsp *http.Response) (*PostSessionShareResponse, error) {
  3192. bodyBytes, err := io.ReadAll(rsp.Body)
  3193. defer func() { _ = rsp.Body.Close() }()
  3194. if err != nil {
  3195. return nil, err
  3196. }
  3197. response := &PostSessionShareResponse{
  3198. Body: bodyBytes,
  3199. HTTPResponse: rsp,
  3200. }
  3201. switch {
  3202. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  3203. var dest SessionInfo
  3204. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  3205. return nil, err
  3206. }
  3207. response.JSON200 = &dest
  3208. }
  3209. return response, nil
  3210. }
  3211. // ParsePostSessionSummarizeResponse parses an HTTP response from a PostSessionSummarizeWithResponse call
  3212. func ParsePostSessionSummarizeResponse(rsp *http.Response) (*PostSessionSummarizeResponse, error) {
  3213. bodyBytes, err := io.ReadAll(rsp.Body)
  3214. defer func() { _ = rsp.Body.Close() }()
  3215. if err != nil {
  3216. return nil, err
  3217. }
  3218. response := &PostSessionSummarizeResponse{
  3219. Body: bodyBytes,
  3220. HTTPResponse: rsp,
  3221. }
  3222. switch {
  3223. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  3224. var dest bool
  3225. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  3226. return nil, err
  3227. }
  3228. response.JSON200 = &dest
  3229. }
  3230. return response, nil
  3231. }
  3232. // ParsePostSessionUnshareResponse parses an HTTP response from a PostSessionUnshareWithResponse call
  3233. func ParsePostSessionUnshareResponse(rsp *http.Response) (*PostSessionUnshareResponse, error) {
  3234. bodyBytes, err := io.ReadAll(rsp.Body)
  3235. defer func() { _ = rsp.Body.Close() }()
  3236. if err != nil {
  3237. return nil, err
  3238. }
  3239. response := &PostSessionUnshareResponse{
  3240. Body: bodyBytes,
  3241. HTTPResponse: rsp,
  3242. }
  3243. switch {
  3244. case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
  3245. var dest SessionInfo
  3246. if err := json.Unmarshal(bodyBytes, &dest); err != nil {
  3247. return nil, err
  3248. }
  3249. response.JSON200 = &dest
  3250. }
  3251. return response, nil
  3252. }