generated-client.go 111 KB

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