generated-client.go 104 KB

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