generated-client.go 105 KB

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