generated-client.go 119 KB

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