| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952 |
- // Package client provides primitives to interact with the openapi HTTP API.
- //
- // Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
- package client
- import (
- "bytes"
- "context"
- "encoding/json"
- "errors"
- "fmt"
- "io"
- "net/http"
- "net/url"
- "strings"
- "github.com/oapi-codegen/runtime"
- )
- // Defines values for MessageInfoRole.
- const (
- Assistant MessageInfoRole = "assistant"
- User MessageInfoRole = "user"
- )
- // AppInfo defines model for App.Info.
- type AppInfo struct {
- Git bool `json:"git"`
- Hostname string `json:"hostname"`
- Path struct {
- Config string `json:"config"`
- Cwd string `json:"cwd"`
- Data string `json:"data"`
- Root string `json:"root"`
- State string `json:"state"`
- } `json:"path"`
- Project string `json:"project"`
- Time struct {
- Initialized *float32 `json:"initialized,omitempty"`
- } `json:"time"`
- User string `json:"user"`
- }
- // ConfigInfo defines model for Config.Info.
- type ConfigInfo struct {
- // Schema JSON schema reference for configuration validation
- Schema *string `json:"$schema,omitempty"`
- // Autoshare Share newly created sessions automatically
- Autoshare *bool `json:"autoshare,omitempty"`
- // Autoupdate Automatically update to the latest version
- Autoupdate *bool `json:"autoupdate,omitempty"`
- // DisabledProviders Disable providers that are loaded automatically
- DisabledProviders *[]string `json:"disabled_providers,omitempty"`
- Experimental *struct {
- Hook *struct {
- FileEdited *map[string][]struct {
- Command []string `json:"command"`
- Environment *map[string]string `json:"environment,omitempty"`
- } `json:"file_edited,omitempty"`
- SessionCompleted *[]struct {
- Command []string `json:"command"`
- Environment *map[string]string `json:"environment,omitempty"`
- } `json:"session_completed,omitempty"`
- } `json:"hook,omitempty"`
- } `json:"experimental,omitempty"`
- Keybinds *ConfigKeybinds `json:"keybinds,omitempty"`
- // Mcp MCP (Model Context Protocol) server configurations
- Mcp *map[string]ConfigInfo_Mcp_AdditionalProperties `json:"mcp,omitempty"`
- // Model Model to use in the format of provider/model, eg anthropic/claude-2
- Model *string `json:"model,omitempty"`
- // Provider Custom provider configurations and model overrides
- Provider *map[string]struct {
- Api *string `json:"api,omitempty"`
- Env *[]string `json:"env,omitempty"`
- Id *string `json:"id,omitempty"`
- Models map[string]struct {
- Attachment *bool `json:"attachment,omitempty"`
- Cost *struct {
- CacheRead *float32 `json:"cache_read,omitempty"`
- CacheWrite *float32 `json:"cache_write,omitempty"`
- Input float32 `json:"input"`
- Output float32 `json:"output"`
- } `json:"cost,omitempty"`
- Id *string `json:"id,omitempty"`
- Limit *struct {
- Context float32 `json:"context"`
- Output float32 `json:"output"`
- } `json:"limit,omitempty"`
- Name *string `json:"name,omitempty"`
- Options *map[string]interface{} `json:"options,omitempty"`
- Reasoning *bool `json:"reasoning,omitempty"`
- Temperature *bool `json:"temperature,omitempty"`
- ToolCall *bool `json:"tool_call,omitempty"`
- } `json:"models"`
- Name *string `json:"name,omitempty"`
- Npm *string `json:"npm,omitempty"`
- Options *map[string]interface{} `json:"options,omitempty"`
- } `json:"provider,omitempty"`
- // Theme Theme name to use for the interface
- Theme *string `json:"theme,omitempty"`
- }
- // ConfigInfo_Mcp_AdditionalProperties defines model for Config.Info.mcp.AdditionalProperties.
- type ConfigInfo_Mcp_AdditionalProperties struct {
- union json.RawMessage
- }
- // ConfigKeybinds defines model for Config.Keybinds.
- type ConfigKeybinds struct {
- // AppExit Exit the application
- AppExit *string `json:"app_exit,omitempty"`
- // EditorOpen Open external editor
- EditorOpen *string `json:"editor_open,omitempty"`
- // Help Show help dialog
- Help *string `json:"help,omitempty"`
- // HistoryNext Navigate to next history item
- HistoryNext *string `json:"history_next,omitempty"`
- // HistoryPrevious Navigate to previous history item
- HistoryPrevious *string `json:"history_previous,omitempty"`
- // InputClear Clear input field
- InputClear *string `json:"input_clear,omitempty"`
- // InputNewline Insert newline in input
- InputNewline *string `json:"input_newline,omitempty"`
- // InputPaste Paste from clipboard
- InputPaste *string `json:"input_paste,omitempty"`
- // InputSubmit Submit input
- InputSubmit *string `json:"input_submit,omitempty"`
- // Leader Leader key for keybind combinations
- Leader *string `json:"leader,omitempty"`
- // MessagesFirst Navigate to first message
- MessagesFirst *string `json:"messages_first,omitempty"`
- // MessagesHalfPageDown Scroll messages down by half page
- MessagesHalfPageDown *string `json:"messages_half_page_down,omitempty"`
- // MessagesHalfPageUp Scroll messages up by half page
- MessagesHalfPageUp *string `json:"messages_half_page_up,omitempty"`
- // MessagesLast Navigate to last message
- MessagesLast *string `json:"messages_last,omitempty"`
- // MessagesNext Navigate to next message
- MessagesNext *string `json:"messages_next,omitempty"`
- // MessagesPageDown Scroll messages down by one page
- MessagesPageDown *string `json:"messages_page_down,omitempty"`
- // MessagesPageUp Scroll messages up by one page
- MessagesPageUp *string `json:"messages_page_up,omitempty"`
- // MessagesPrevious Navigate to previous message
- MessagesPrevious *string `json:"messages_previous,omitempty"`
- // ModelList List available models
- ModelList *string `json:"model_list,omitempty"`
- // ProjectInit Initialize project configuration
- ProjectInit *string `json:"project_init,omitempty"`
- // SessionCompact Toggle compact mode for session
- SessionCompact *string `json:"session_compact,omitempty"`
- // SessionInterrupt Interrupt current session
- SessionInterrupt *string `json:"session_interrupt,omitempty"`
- // SessionList List all sessions
- SessionList *string `json:"session_list,omitempty"`
- // SessionNew Create a new session
- SessionNew *string `json:"session_new,omitempty"`
- // SessionShare Share current session
- SessionShare *string `json:"session_share,omitempty"`
- // ThemeList List available themes
- ThemeList *string `json:"theme_list,omitempty"`
- // ToolDetails Show tool details
- ToolDetails *string `json:"tool_details,omitempty"`
- }
- // ConfigMcpLocal defines model for Config.McpLocal.
- type ConfigMcpLocal struct {
- // Command Command and arguments to run the MCP server
- Command []string `json:"command"`
- // Environment Environment variables to set when running the MCP server
- Environment *map[string]string `json:"environment,omitempty"`
- // Type Type of MCP server connection
- Type string `json:"type"`
- }
- // ConfigMcpRemote defines model for Config.McpRemote.
- type ConfigMcpRemote struct {
- // Type Type of MCP server connection
- Type string `json:"type"`
- // Url URL of the remote MCP server
- Url string `json:"url"`
- }
- // Error defines model for Error.
- type Error struct {
- Data map[string]interface{} `json:"data"`
- }
- // Event defines model for Event.
- type Event struct {
- union json.RawMessage
- }
- // EventInstallationUpdated defines model for Event.installation.updated.
- type EventInstallationUpdated struct {
- Properties struct {
- Version string `json:"version"`
- } `json:"properties"`
- Type string `json:"type"`
- }
- // EventLspClientDiagnostics defines model for Event.lsp.client.diagnostics.
- type EventLspClientDiagnostics struct {
- Properties struct {
- Path string `json:"path"`
- ServerID string `json:"serverID"`
- } `json:"properties"`
- Type string `json:"type"`
- }
- // EventMessagePartUpdated defines model for Event.message.part.updated.
- type EventMessagePartUpdated struct {
- Properties struct {
- MessageID string `json:"messageID"`
- Part MessagePart `json:"part"`
- SessionID string `json:"sessionID"`
- } `json:"properties"`
- Type string `json:"type"`
- }
- // EventMessageUpdated defines model for Event.message.updated.
- type EventMessageUpdated struct {
- Properties struct {
- Info MessageInfo `json:"info"`
- } `json:"properties"`
- Type string `json:"type"`
- }
- // EventPermissionUpdated defines model for Event.permission.updated.
- type EventPermissionUpdated struct {
- Properties PermissionInfo `json:"properties"`
- Type string `json:"type"`
- }
- // EventSessionDeleted defines model for Event.session.deleted.
- type EventSessionDeleted struct {
- Properties struct {
- Info SessionInfo `json:"info"`
- } `json:"properties"`
- Type string `json:"type"`
- }
- // EventSessionError defines model for Event.session.error.
- type EventSessionError struct {
- Properties struct {
- Error *EventSessionError_Properties_Error `json:"error,omitempty"`
- } `json:"properties"`
- Type string `json:"type"`
- }
- // EventSessionError_Properties_Error defines model for EventSessionError.Properties.Error.
- type EventSessionError_Properties_Error struct {
- union json.RawMessage
- }
- // EventSessionUpdated defines model for Event.session.updated.
- type EventSessionUpdated struct {
- Properties struct {
- Info SessionInfo `json:"info"`
- } `json:"properties"`
- Type string `json:"type"`
- }
- // EventStorageWrite defines model for Event.storage.write.
- type EventStorageWrite struct {
- Properties struct {
- Content *interface{} `json:"content,omitempty"`
- Key string `json:"key"`
- } `json:"properties"`
- Type string `json:"type"`
- }
- // InstallationInfo defines model for InstallationInfo.
- type InstallationInfo struct {
- Latest string `json:"latest"`
- Version string `json:"version"`
- }
- // MessageInfo defines model for Message.Info.
- type MessageInfo struct {
- Id string `json:"id"`
- Metadata MessageMetadata `json:"metadata"`
- Parts []MessagePart `json:"parts"`
- Role MessageInfoRole `json:"role"`
- }
- // MessageInfoRole defines model for MessageInfo.Role.
- type MessageInfoRole string
- // MessageMetadata defines model for Message.Metadata.
- type MessageMetadata struct {
- Assistant *struct {
- Cost float32 `json:"cost"`
- ModelID string `json:"modelID"`
- Path struct {
- Cwd string `json:"cwd"`
- Root string `json:"root"`
- } `json:"path"`
- ProviderID string `json:"providerID"`
- Summary *bool `json:"summary,omitempty"`
- System []string `json:"system"`
- Tokens struct {
- Cache struct {
- Read float32 `json:"read"`
- Write float32 `json:"write"`
- } `json:"cache"`
- Input float32 `json:"input"`
- Output float32 `json:"output"`
- Reasoning float32 `json:"reasoning"`
- } `json:"tokens"`
- } `json:"assistant,omitempty"`
- Error *MessageMetadata_Error `json:"error,omitempty"`
- SessionID string `json:"sessionID"`
- Time struct {
- Completed *float32 `json:"completed,omitempty"`
- Created float32 `json:"created"`
- } `json:"time"`
- Tool map[string]MessageMetadata_Tool_AdditionalProperties `json:"tool"`
- }
- // MessageMetadata_Error defines model for MessageMetadata.Error.
- type MessageMetadata_Error struct {
- union json.RawMessage
- }
- // MessageMetadata_Tool_AdditionalProperties defines model for Message.Metadata.tool.AdditionalProperties.
- type MessageMetadata_Tool_AdditionalProperties struct {
- Time struct {
- End float32 `json:"end"`
- Start float32 `json:"start"`
- } `json:"time"`
- Title string `json:"title"`
- AdditionalProperties map[string]interface{} `json:"-"`
- }
- // MessagePart defines model for Message.Part.
- type MessagePart struct {
- union json.RawMessage
- }
- // MessagePartFile defines model for Message.Part.File.
- type MessagePartFile struct {
- Filename *string `json:"filename,omitempty"`
- MediaType string `json:"mediaType"`
- Type string `json:"type"`
- Url string `json:"url"`
- }
- // MessagePartReasoning defines model for Message.Part.Reasoning.
- type MessagePartReasoning struct {
- ProviderMetadata *map[string]interface{} `json:"providerMetadata,omitempty"`
- Text string `json:"text"`
- Type string `json:"type"`
- }
- // MessagePartSourceUrl defines model for Message.Part.SourceUrl.
- type MessagePartSourceUrl struct {
- ProviderMetadata *map[string]interface{} `json:"providerMetadata,omitempty"`
- SourceId string `json:"sourceId"`
- Title *string `json:"title,omitempty"`
- Type string `json:"type"`
- Url string `json:"url"`
- }
- // MessagePartStepStart defines model for Message.Part.StepStart.
- type MessagePartStepStart struct {
- Type string `json:"type"`
- }
- // MessagePartText defines model for Message.Part.Text.
- type MessagePartText struct {
- Text string `json:"text"`
- Type string `json:"type"`
- }
- // MessagePartToolInvocation defines model for Message.Part.ToolInvocation.
- type MessagePartToolInvocation struct {
- ToolInvocation MessageToolInvocation `json:"toolInvocation"`
- Type string `json:"type"`
- }
- // MessageToolInvocation defines model for Message.ToolInvocation.
- type MessageToolInvocation struct {
- union json.RawMessage
- }
- // MessageToolInvocationToolCall defines model for Message.ToolInvocation.ToolCall.
- type MessageToolInvocationToolCall struct {
- Args *interface{} `json:"args,omitempty"`
- State string `json:"state"`
- Step *float32 `json:"step,omitempty"`
- ToolCallId string `json:"toolCallId"`
- ToolName string `json:"toolName"`
- }
- // MessageToolInvocationToolPartialCall defines model for Message.ToolInvocation.ToolPartialCall.
- type MessageToolInvocationToolPartialCall struct {
- Args *interface{} `json:"args,omitempty"`
- State string `json:"state"`
- Step *float32 `json:"step,omitempty"`
- ToolCallId string `json:"toolCallId"`
- ToolName string `json:"toolName"`
- }
- // MessageToolInvocationToolResult defines model for Message.ToolInvocation.ToolResult.
- type MessageToolInvocationToolResult struct {
- Args *interface{} `json:"args,omitempty"`
- Result string `json:"result"`
- State string `json:"state"`
- Step *float32 `json:"step,omitempty"`
- ToolCallId string `json:"toolCallId"`
- ToolName string `json:"toolName"`
- }
- // MessageOutputLengthError defines model for MessageOutputLengthError.
- type MessageOutputLengthError struct {
- Data map[string]interface{} `json:"data"`
- Name string `json:"name"`
- }
- // ModelInfo defines model for Model.Info.
- type ModelInfo struct {
- Attachment bool `json:"attachment"`
- Cost struct {
- CacheRead *float32 `json:"cache_read,omitempty"`
- CacheWrite *float32 `json:"cache_write,omitempty"`
- Input float32 `json:"input"`
- Output float32 `json:"output"`
- } `json:"cost"`
- Id string `json:"id"`
- Limit struct {
- Context float32 `json:"context"`
- Output float32 `json:"output"`
- } `json:"limit"`
- Name string `json:"name"`
- Options map[string]interface{} `json:"options"`
- Reasoning bool `json:"reasoning"`
- Temperature bool `json:"temperature"`
- ToolCall bool `json:"tool_call"`
- }
- // ProviderInfo defines model for Provider.Info.
- type ProviderInfo struct {
- Api *string `json:"api,omitempty"`
- Env []string `json:"env"`
- Id string `json:"id"`
- Models map[string]ModelInfo `json:"models"`
- Name string `json:"name"`
- Npm *string `json:"npm,omitempty"`
- }
- // ProviderAuthError defines model for ProviderAuthError.
- type ProviderAuthError struct {
- Data struct {
- Message string `json:"message"`
- ProviderID string `json:"providerID"`
- } `json:"data"`
- Name string `json:"name"`
- }
- // UnknownError defines model for UnknownError.
- type UnknownError struct {
- Data struct {
- Message string `json:"message"`
- } `json:"data"`
- Name string `json:"name"`
- }
- // PermissionInfo defines model for permission.info.
- type PermissionInfo struct {
- Id string `json:"id"`
- Metadata map[string]interface{} `json:"metadata"`
- SessionID string `json:"sessionID"`
- Time struct {
- Created float32 `json:"created"`
- } `json:"time"`
- Title string `json:"title"`
- }
- // SessionInfo defines model for session.info.
- type SessionInfo struct {
- Id string `json:"id"`
- ParentID *string `json:"parentID,omitempty"`
- Share *struct {
- Url string `json:"url"`
- } `json:"share,omitempty"`
- Time struct {
- Created float32 `json:"created"`
- Updated float32 `json:"updated"`
- } `json:"time"`
- Title string `json:"title"`
- Version string `json:"version"`
- }
- // PostFileSearchJSONBody defines parameters for PostFileSearch.
- type PostFileSearchJSONBody struct {
- Query string `json:"query"`
- }
- // PostSessionAbortJSONBody defines parameters for PostSessionAbort.
- type PostSessionAbortJSONBody struct {
- SessionID string `json:"sessionID"`
- }
- // PostSessionChatJSONBody defines parameters for PostSessionChat.
- type PostSessionChatJSONBody struct {
- ModelID string `json:"modelID"`
- Parts []MessagePart `json:"parts"`
- ProviderID string `json:"providerID"`
- SessionID string `json:"sessionID"`
- }
- // PostSessionDeleteJSONBody defines parameters for PostSessionDelete.
- type PostSessionDeleteJSONBody struct {
- SessionID string `json:"sessionID"`
- }
- // PostSessionInitializeJSONBody defines parameters for PostSessionInitialize.
- type PostSessionInitializeJSONBody struct {
- ModelID string `json:"modelID"`
- ProviderID string `json:"providerID"`
- SessionID string `json:"sessionID"`
- }
- // PostSessionMessagesJSONBody defines parameters for PostSessionMessages.
- type PostSessionMessagesJSONBody struct {
- SessionID string `json:"sessionID"`
- }
- // PostSessionShareJSONBody defines parameters for PostSessionShare.
- type PostSessionShareJSONBody struct {
- SessionID string `json:"sessionID"`
- }
- // PostSessionSummarizeJSONBody defines parameters for PostSessionSummarize.
- type PostSessionSummarizeJSONBody struct {
- ModelID string `json:"modelID"`
- ProviderID string `json:"providerID"`
- SessionID string `json:"sessionID"`
- }
- // PostSessionUnshareJSONBody defines parameters for PostSessionUnshare.
- type PostSessionUnshareJSONBody struct {
- SessionID string `json:"sessionID"`
- }
- // PostFileSearchJSONRequestBody defines body for PostFileSearch for application/json ContentType.
- type PostFileSearchJSONRequestBody PostFileSearchJSONBody
- // PostSessionAbortJSONRequestBody defines body for PostSessionAbort for application/json ContentType.
- type PostSessionAbortJSONRequestBody PostSessionAbortJSONBody
- // PostSessionChatJSONRequestBody defines body for PostSessionChat for application/json ContentType.
- type PostSessionChatJSONRequestBody PostSessionChatJSONBody
- // PostSessionDeleteJSONRequestBody defines body for PostSessionDelete for application/json ContentType.
- type PostSessionDeleteJSONRequestBody PostSessionDeleteJSONBody
- // PostSessionInitializeJSONRequestBody defines body for PostSessionInitialize for application/json ContentType.
- type PostSessionInitializeJSONRequestBody PostSessionInitializeJSONBody
- // PostSessionMessagesJSONRequestBody defines body for PostSessionMessages for application/json ContentType.
- type PostSessionMessagesJSONRequestBody PostSessionMessagesJSONBody
- // PostSessionShareJSONRequestBody defines body for PostSessionShare for application/json ContentType.
- type PostSessionShareJSONRequestBody PostSessionShareJSONBody
- // PostSessionSummarizeJSONRequestBody defines body for PostSessionSummarize for application/json ContentType.
- type PostSessionSummarizeJSONRequestBody PostSessionSummarizeJSONBody
- // PostSessionUnshareJSONRequestBody defines body for PostSessionUnshare for application/json ContentType.
- type PostSessionUnshareJSONRequestBody PostSessionUnshareJSONBody
- // Getter for additional properties for MessageMetadata_Tool_AdditionalProperties. Returns the specified
- // element and whether it was found
- func (a MessageMetadata_Tool_AdditionalProperties) Get(fieldName string) (value interface{}, found bool) {
- if a.AdditionalProperties != nil {
- value, found = a.AdditionalProperties[fieldName]
- }
- return
- }
- // Setter for additional properties for MessageMetadata_Tool_AdditionalProperties
- func (a *MessageMetadata_Tool_AdditionalProperties) Set(fieldName string, value interface{}) {
- if a.AdditionalProperties == nil {
- a.AdditionalProperties = make(map[string]interface{})
- }
- a.AdditionalProperties[fieldName] = value
- }
- // Override default JSON handling for MessageMetadata_Tool_AdditionalProperties to handle AdditionalProperties
- func (a *MessageMetadata_Tool_AdditionalProperties) UnmarshalJSON(b []byte) error {
- object := make(map[string]json.RawMessage)
- err := json.Unmarshal(b, &object)
- if err != nil {
- return err
- }
- if raw, found := object["time"]; found {
- err = json.Unmarshal(raw, &a.Time)
- if err != nil {
- return fmt.Errorf("error reading 'time': %w", err)
- }
- delete(object, "time")
- }
- if raw, found := object["title"]; found {
- err = json.Unmarshal(raw, &a.Title)
- if err != nil {
- return fmt.Errorf("error reading 'title': %w", err)
- }
- delete(object, "title")
- }
- if len(object) != 0 {
- a.AdditionalProperties = make(map[string]interface{})
- for fieldName, fieldBuf := range object {
- var fieldVal interface{}
- err := json.Unmarshal(fieldBuf, &fieldVal)
- if err != nil {
- return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err)
- }
- a.AdditionalProperties[fieldName] = fieldVal
- }
- }
- return nil
- }
- // Override default JSON handling for MessageMetadata_Tool_AdditionalProperties to handle AdditionalProperties
- func (a MessageMetadata_Tool_AdditionalProperties) MarshalJSON() ([]byte, error) {
- var err error
- object := make(map[string]json.RawMessage)
- object["time"], err = json.Marshal(a.Time)
- if err != nil {
- return nil, fmt.Errorf("error marshaling 'time': %w", err)
- }
- object["title"], err = json.Marshal(a.Title)
- if err != nil {
- return nil, fmt.Errorf("error marshaling 'title': %w", err)
- }
- for fieldName, field := range a.AdditionalProperties {
- object[fieldName], err = json.Marshal(field)
- if err != nil {
- return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err)
- }
- }
- return json.Marshal(object)
- }
- // AsConfigMcpLocal returns the union data inside the ConfigInfo_Mcp_AdditionalProperties as a ConfigMcpLocal
- func (t ConfigInfo_Mcp_AdditionalProperties) AsConfigMcpLocal() (ConfigMcpLocal, error) {
- var body ConfigMcpLocal
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromConfigMcpLocal overwrites any union data inside the ConfigInfo_Mcp_AdditionalProperties as the provided ConfigMcpLocal
- func (t *ConfigInfo_Mcp_AdditionalProperties) FromConfigMcpLocal(v ConfigMcpLocal) error {
- v.Type = "local"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeConfigMcpLocal performs a merge with any union data inside the ConfigInfo_Mcp_AdditionalProperties, using the provided ConfigMcpLocal
- func (t *ConfigInfo_Mcp_AdditionalProperties) MergeConfigMcpLocal(v ConfigMcpLocal) error {
- v.Type = "local"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsConfigMcpRemote returns the union data inside the ConfigInfo_Mcp_AdditionalProperties as a ConfigMcpRemote
- func (t ConfigInfo_Mcp_AdditionalProperties) AsConfigMcpRemote() (ConfigMcpRemote, error) {
- var body ConfigMcpRemote
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromConfigMcpRemote overwrites any union data inside the ConfigInfo_Mcp_AdditionalProperties as the provided ConfigMcpRemote
- func (t *ConfigInfo_Mcp_AdditionalProperties) FromConfigMcpRemote(v ConfigMcpRemote) error {
- v.Type = "remote"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeConfigMcpRemote performs a merge with any union data inside the ConfigInfo_Mcp_AdditionalProperties, using the provided ConfigMcpRemote
- func (t *ConfigInfo_Mcp_AdditionalProperties) MergeConfigMcpRemote(v ConfigMcpRemote) error {
- v.Type = "remote"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- func (t ConfigInfo_Mcp_AdditionalProperties) Discriminator() (string, error) {
- var discriminator struct {
- Discriminator string `json:"type"`
- }
- err := json.Unmarshal(t.union, &discriminator)
- return discriminator.Discriminator, err
- }
- func (t ConfigInfo_Mcp_AdditionalProperties) ValueByDiscriminator() (interface{}, error) {
- discriminator, err := t.Discriminator()
- if err != nil {
- return nil, err
- }
- switch discriminator {
- case "local":
- return t.AsConfigMcpLocal()
- case "remote":
- return t.AsConfigMcpRemote()
- default:
- return nil, errors.New("unknown discriminator value: " + discriminator)
- }
- }
- func (t ConfigInfo_Mcp_AdditionalProperties) MarshalJSON() ([]byte, error) {
- b, err := t.union.MarshalJSON()
- return b, err
- }
- func (t *ConfigInfo_Mcp_AdditionalProperties) UnmarshalJSON(b []byte) error {
- err := t.union.UnmarshalJSON(b)
- return err
- }
- // AsEventStorageWrite returns the union data inside the Event as a EventStorageWrite
- func (t Event) AsEventStorageWrite() (EventStorageWrite, error) {
- var body EventStorageWrite
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromEventStorageWrite overwrites any union data inside the Event as the provided EventStorageWrite
- func (t *Event) FromEventStorageWrite(v EventStorageWrite) error {
- v.Type = "storage.write"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeEventStorageWrite performs a merge with any union data inside the Event, using the provided EventStorageWrite
- func (t *Event) MergeEventStorageWrite(v EventStorageWrite) error {
- v.Type = "storage.write"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsEventInstallationUpdated returns the union data inside the Event as a EventInstallationUpdated
- func (t Event) AsEventInstallationUpdated() (EventInstallationUpdated, error) {
- var body EventInstallationUpdated
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromEventInstallationUpdated overwrites any union data inside the Event as the provided EventInstallationUpdated
- func (t *Event) FromEventInstallationUpdated(v EventInstallationUpdated) error {
- v.Type = "installation.updated"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeEventInstallationUpdated performs a merge with any union data inside the Event, using the provided EventInstallationUpdated
- func (t *Event) MergeEventInstallationUpdated(v EventInstallationUpdated) error {
- v.Type = "installation.updated"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsEventLspClientDiagnostics returns the union data inside the Event as a EventLspClientDiagnostics
- func (t Event) AsEventLspClientDiagnostics() (EventLspClientDiagnostics, error) {
- var body EventLspClientDiagnostics
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromEventLspClientDiagnostics overwrites any union data inside the Event as the provided EventLspClientDiagnostics
- func (t *Event) FromEventLspClientDiagnostics(v EventLspClientDiagnostics) error {
- v.Type = "lsp.client.diagnostics"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeEventLspClientDiagnostics performs a merge with any union data inside the Event, using the provided EventLspClientDiagnostics
- func (t *Event) MergeEventLspClientDiagnostics(v EventLspClientDiagnostics) error {
- v.Type = "lsp.client.diagnostics"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsEventPermissionUpdated returns the union data inside the Event as a EventPermissionUpdated
- func (t Event) AsEventPermissionUpdated() (EventPermissionUpdated, error) {
- var body EventPermissionUpdated
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromEventPermissionUpdated overwrites any union data inside the Event as the provided EventPermissionUpdated
- func (t *Event) FromEventPermissionUpdated(v EventPermissionUpdated) error {
- v.Type = "permission.updated"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeEventPermissionUpdated performs a merge with any union data inside the Event, using the provided EventPermissionUpdated
- func (t *Event) MergeEventPermissionUpdated(v EventPermissionUpdated) error {
- v.Type = "permission.updated"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsEventMessageUpdated returns the union data inside the Event as a EventMessageUpdated
- func (t Event) AsEventMessageUpdated() (EventMessageUpdated, error) {
- var body EventMessageUpdated
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromEventMessageUpdated overwrites any union data inside the Event as the provided EventMessageUpdated
- func (t *Event) FromEventMessageUpdated(v EventMessageUpdated) error {
- v.Type = "message.updated"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeEventMessageUpdated performs a merge with any union data inside the Event, using the provided EventMessageUpdated
- func (t *Event) MergeEventMessageUpdated(v EventMessageUpdated) error {
- v.Type = "message.updated"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsEventMessagePartUpdated returns the union data inside the Event as a EventMessagePartUpdated
- func (t Event) AsEventMessagePartUpdated() (EventMessagePartUpdated, error) {
- var body EventMessagePartUpdated
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromEventMessagePartUpdated overwrites any union data inside the Event as the provided EventMessagePartUpdated
- func (t *Event) FromEventMessagePartUpdated(v EventMessagePartUpdated) error {
- v.Type = "message.part.updated"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeEventMessagePartUpdated performs a merge with any union data inside the Event, using the provided EventMessagePartUpdated
- func (t *Event) MergeEventMessagePartUpdated(v EventMessagePartUpdated) error {
- v.Type = "message.part.updated"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsEventSessionUpdated returns the union data inside the Event as a EventSessionUpdated
- func (t Event) AsEventSessionUpdated() (EventSessionUpdated, error) {
- var body EventSessionUpdated
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromEventSessionUpdated overwrites any union data inside the Event as the provided EventSessionUpdated
- func (t *Event) FromEventSessionUpdated(v EventSessionUpdated) error {
- v.Type = "session.updated"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeEventSessionUpdated performs a merge with any union data inside the Event, using the provided EventSessionUpdated
- func (t *Event) MergeEventSessionUpdated(v EventSessionUpdated) error {
- v.Type = "session.updated"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsEventSessionDeleted returns the union data inside the Event as a EventSessionDeleted
- func (t Event) AsEventSessionDeleted() (EventSessionDeleted, error) {
- var body EventSessionDeleted
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromEventSessionDeleted overwrites any union data inside the Event as the provided EventSessionDeleted
- func (t *Event) FromEventSessionDeleted(v EventSessionDeleted) error {
- v.Type = "session.deleted"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeEventSessionDeleted performs a merge with any union data inside the Event, using the provided EventSessionDeleted
- func (t *Event) MergeEventSessionDeleted(v EventSessionDeleted) error {
- v.Type = "session.deleted"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsEventSessionError returns the union data inside the Event as a EventSessionError
- func (t Event) AsEventSessionError() (EventSessionError, error) {
- var body EventSessionError
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromEventSessionError overwrites any union data inside the Event as the provided EventSessionError
- func (t *Event) FromEventSessionError(v EventSessionError) error {
- v.Type = "session.error"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeEventSessionError performs a merge with any union data inside the Event, using the provided EventSessionError
- func (t *Event) MergeEventSessionError(v EventSessionError) error {
- v.Type = "session.error"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- func (t Event) Discriminator() (string, error) {
- var discriminator struct {
- Discriminator string `json:"type"`
- }
- err := json.Unmarshal(t.union, &discriminator)
- return discriminator.Discriminator, err
- }
- func (t Event) ValueByDiscriminator() (interface{}, error) {
- discriminator, err := t.Discriminator()
- if err != nil {
- return nil, err
- }
- switch discriminator {
- case "installation.updated":
- return t.AsEventInstallationUpdated()
- case "lsp.client.diagnostics":
- return t.AsEventLspClientDiagnostics()
- case "message.part.updated":
- return t.AsEventMessagePartUpdated()
- case "message.updated":
- return t.AsEventMessageUpdated()
- case "permission.updated":
- return t.AsEventPermissionUpdated()
- case "session.deleted":
- return t.AsEventSessionDeleted()
- case "session.error":
- return t.AsEventSessionError()
- case "session.updated":
- return t.AsEventSessionUpdated()
- case "storage.write":
- return t.AsEventStorageWrite()
- default:
- return nil, errors.New("unknown discriminator value: " + discriminator)
- }
- }
- func (t Event) MarshalJSON() ([]byte, error) {
- b, err := t.union.MarshalJSON()
- return b, err
- }
- func (t *Event) UnmarshalJSON(b []byte) error {
- err := t.union.UnmarshalJSON(b)
- return err
- }
- // AsProviderAuthError returns the union data inside the EventSessionError_Properties_Error as a ProviderAuthError
- func (t EventSessionError_Properties_Error) AsProviderAuthError() (ProviderAuthError, error) {
- var body ProviderAuthError
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromProviderAuthError overwrites any union data inside the EventSessionError_Properties_Error as the provided ProviderAuthError
- func (t *EventSessionError_Properties_Error) FromProviderAuthError(v ProviderAuthError) error {
- v.Name = "ProviderAuthError"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeProviderAuthError performs a merge with any union data inside the EventSessionError_Properties_Error, using the provided ProviderAuthError
- func (t *EventSessionError_Properties_Error) MergeProviderAuthError(v ProviderAuthError) error {
- v.Name = "ProviderAuthError"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsUnknownError returns the union data inside the EventSessionError_Properties_Error as a UnknownError
- func (t EventSessionError_Properties_Error) AsUnknownError() (UnknownError, error) {
- var body UnknownError
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromUnknownError overwrites any union data inside the EventSessionError_Properties_Error as the provided UnknownError
- func (t *EventSessionError_Properties_Error) FromUnknownError(v UnknownError) error {
- v.Name = "UnknownError"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeUnknownError performs a merge with any union data inside the EventSessionError_Properties_Error, using the provided UnknownError
- func (t *EventSessionError_Properties_Error) MergeUnknownError(v UnknownError) error {
- v.Name = "UnknownError"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsMessageOutputLengthError returns the union data inside the EventSessionError_Properties_Error as a MessageOutputLengthError
- func (t EventSessionError_Properties_Error) AsMessageOutputLengthError() (MessageOutputLengthError, error) {
- var body MessageOutputLengthError
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromMessageOutputLengthError overwrites any union data inside the EventSessionError_Properties_Error as the provided MessageOutputLengthError
- func (t *EventSessionError_Properties_Error) FromMessageOutputLengthError(v MessageOutputLengthError) error {
- v.Name = "MessageOutputLengthError"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeMessageOutputLengthError performs a merge with any union data inside the EventSessionError_Properties_Error, using the provided MessageOutputLengthError
- func (t *EventSessionError_Properties_Error) MergeMessageOutputLengthError(v MessageOutputLengthError) error {
- v.Name = "MessageOutputLengthError"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- func (t EventSessionError_Properties_Error) Discriminator() (string, error) {
- var discriminator struct {
- Discriminator string `json:"name"`
- }
- err := json.Unmarshal(t.union, &discriminator)
- return discriminator.Discriminator, err
- }
- func (t EventSessionError_Properties_Error) ValueByDiscriminator() (interface{}, error) {
- discriminator, err := t.Discriminator()
- if err != nil {
- return nil, err
- }
- switch discriminator {
- case "MessageOutputLengthError":
- return t.AsMessageOutputLengthError()
- case "ProviderAuthError":
- return t.AsProviderAuthError()
- case "UnknownError":
- return t.AsUnknownError()
- default:
- return nil, errors.New("unknown discriminator value: " + discriminator)
- }
- }
- func (t EventSessionError_Properties_Error) MarshalJSON() ([]byte, error) {
- b, err := t.union.MarshalJSON()
- return b, err
- }
- func (t *EventSessionError_Properties_Error) UnmarshalJSON(b []byte) error {
- err := t.union.UnmarshalJSON(b)
- return err
- }
- // AsProviderAuthError returns the union data inside the MessageMetadata_Error as a ProviderAuthError
- func (t MessageMetadata_Error) AsProviderAuthError() (ProviderAuthError, error) {
- var body ProviderAuthError
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromProviderAuthError overwrites any union data inside the MessageMetadata_Error as the provided ProviderAuthError
- func (t *MessageMetadata_Error) FromProviderAuthError(v ProviderAuthError) error {
- v.Name = "ProviderAuthError"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeProviderAuthError performs a merge with any union data inside the MessageMetadata_Error, using the provided ProviderAuthError
- func (t *MessageMetadata_Error) MergeProviderAuthError(v ProviderAuthError) error {
- v.Name = "ProviderAuthError"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsUnknownError returns the union data inside the MessageMetadata_Error as a UnknownError
- func (t MessageMetadata_Error) AsUnknownError() (UnknownError, error) {
- var body UnknownError
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromUnknownError overwrites any union data inside the MessageMetadata_Error as the provided UnknownError
- func (t *MessageMetadata_Error) FromUnknownError(v UnknownError) error {
- v.Name = "UnknownError"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeUnknownError performs a merge with any union data inside the MessageMetadata_Error, using the provided UnknownError
- func (t *MessageMetadata_Error) MergeUnknownError(v UnknownError) error {
- v.Name = "UnknownError"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsMessageOutputLengthError returns the union data inside the MessageMetadata_Error as a MessageOutputLengthError
- func (t MessageMetadata_Error) AsMessageOutputLengthError() (MessageOutputLengthError, error) {
- var body MessageOutputLengthError
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromMessageOutputLengthError overwrites any union data inside the MessageMetadata_Error as the provided MessageOutputLengthError
- func (t *MessageMetadata_Error) FromMessageOutputLengthError(v MessageOutputLengthError) error {
- v.Name = "MessageOutputLengthError"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeMessageOutputLengthError performs a merge with any union data inside the MessageMetadata_Error, using the provided MessageOutputLengthError
- func (t *MessageMetadata_Error) MergeMessageOutputLengthError(v MessageOutputLengthError) error {
- v.Name = "MessageOutputLengthError"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- func (t MessageMetadata_Error) Discriminator() (string, error) {
- var discriminator struct {
- Discriminator string `json:"name"`
- }
- err := json.Unmarshal(t.union, &discriminator)
- return discriminator.Discriminator, err
- }
- func (t MessageMetadata_Error) ValueByDiscriminator() (interface{}, error) {
- discriminator, err := t.Discriminator()
- if err != nil {
- return nil, err
- }
- switch discriminator {
- case "MessageOutputLengthError":
- return t.AsMessageOutputLengthError()
- case "ProviderAuthError":
- return t.AsProviderAuthError()
- case "UnknownError":
- return t.AsUnknownError()
- default:
- return nil, errors.New("unknown discriminator value: " + discriminator)
- }
- }
- func (t MessageMetadata_Error) MarshalJSON() ([]byte, error) {
- b, err := t.union.MarshalJSON()
- return b, err
- }
- func (t *MessageMetadata_Error) UnmarshalJSON(b []byte) error {
- err := t.union.UnmarshalJSON(b)
- return err
- }
- // AsMessagePartText returns the union data inside the MessagePart as a MessagePartText
- func (t MessagePart) AsMessagePartText() (MessagePartText, error) {
- var body MessagePartText
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromMessagePartText overwrites any union data inside the MessagePart as the provided MessagePartText
- func (t *MessagePart) FromMessagePartText(v MessagePartText) error {
- v.Type = "text"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeMessagePartText performs a merge with any union data inside the MessagePart, using the provided MessagePartText
- func (t *MessagePart) MergeMessagePartText(v MessagePartText) error {
- v.Type = "text"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsMessagePartReasoning returns the union data inside the MessagePart as a MessagePartReasoning
- func (t MessagePart) AsMessagePartReasoning() (MessagePartReasoning, error) {
- var body MessagePartReasoning
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromMessagePartReasoning overwrites any union data inside the MessagePart as the provided MessagePartReasoning
- func (t *MessagePart) FromMessagePartReasoning(v MessagePartReasoning) error {
- v.Type = "reasoning"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeMessagePartReasoning performs a merge with any union data inside the MessagePart, using the provided MessagePartReasoning
- func (t *MessagePart) MergeMessagePartReasoning(v MessagePartReasoning) error {
- v.Type = "reasoning"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsMessagePartToolInvocation returns the union data inside the MessagePart as a MessagePartToolInvocation
- func (t MessagePart) AsMessagePartToolInvocation() (MessagePartToolInvocation, error) {
- var body MessagePartToolInvocation
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromMessagePartToolInvocation overwrites any union data inside the MessagePart as the provided MessagePartToolInvocation
- func (t *MessagePart) FromMessagePartToolInvocation(v MessagePartToolInvocation) error {
- v.Type = "tool-invocation"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeMessagePartToolInvocation performs a merge with any union data inside the MessagePart, using the provided MessagePartToolInvocation
- func (t *MessagePart) MergeMessagePartToolInvocation(v MessagePartToolInvocation) error {
- v.Type = "tool-invocation"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsMessagePartSourceUrl returns the union data inside the MessagePart as a MessagePartSourceUrl
- func (t MessagePart) AsMessagePartSourceUrl() (MessagePartSourceUrl, error) {
- var body MessagePartSourceUrl
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromMessagePartSourceUrl overwrites any union data inside the MessagePart as the provided MessagePartSourceUrl
- func (t *MessagePart) FromMessagePartSourceUrl(v MessagePartSourceUrl) error {
- v.Type = "source-url"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeMessagePartSourceUrl performs a merge with any union data inside the MessagePart, using the provided MessagePartSourceUrl
- func (t *MessagePart) MergeMessagePartSourceUrl(v MessagePartSourceUrl) error {
- v.Type = "source-url"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsMessagePartFile returns the union data inside the MessagePart as a MessagePartFile
- func (t MessagePart) AsMessagePartFile() (MessagePartFile, error) {
- var body MessagePartFile
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromMessagePartFile overwrites any union data inside the MessagePart as the provided MessagePartFile
- func (t *MessagePart) FromMessagePartFile(v MessagePartFile) error {
- v.Type = "file"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeMessagePartFile performs a merge with any union data inside the MessagePart, using the provided MessagePartFile
- func (t *MessagePart) MergeMessagePartFile(v MessagePartFile) error {
- v.Type = "file"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsMessagePartStepStart returns the union data inside the MessagePart as a MessagePartStepStart
- func (t MessagePart) AsMessagePartStepStart() (MessagePartStepStart, error) {
- var body MessagePartStepStart
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromMessagePartStepStart overwrites any union data inside the MessagePart as the provided MessagePartStepStart
- func (t *MessagePart) FromMessagePartStepStart(v MessagePartStepStart) error {
- v.Type = "step-start"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeMessagePartStepStart performs a merge with any union data inside the MessagePart, using the provided MessagePartStepStart
- func (t *MessagePart) MergeMessagePartStepStart(v MessagePartStepStart) error {
- v.Type = "step-start"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- func (t MessagePart) Discriminator() (string, error) {
- var discriminator struct {
- Discriminator string `json:"type"`
- }
- err := json.Unmarshal(t.union, &discriminator)
- return discriminator.Discriminator, err
- }
- func (t MessagePart) ValueByDiscriminator() (interface{}, error) {
- discriminator, err := t.Discriminator()
- if err != nil {
- return nil, err
- }
- switch discriminator {
- case "file":
- return t.AsMessagePartFile()
- case "reasoning":
- return t.AsMessagePartReasoning()
- case "source-url":
- return t.AsMessagePartSourceUrl()
- case "step-start":
- return t.AsMessagePartStepStart()
- case "text":
- return t.AsMessagePartText()
- case "tool-invocation":
- return t.AsMessagePartToolInvocation()
- default:
- return nil, errors.New("unknown discriminator value: " + discriminator)
- }
- }
- func (t MessagePart) MarshalJSON() ([]byte, error) {
- b, err := t.union.MarshalJSON()
- return b, err
- }
- func (t *MessagePart) UnmarshalJSON(b []byte) error {
- err := t.union.UnmarshalJSON(b)
- return err
- }
- // AsMessageToolInvocationToolCall returns the union data inside the MessageToolInvocation as a MessageToolInvocationToolCall
- func (t MessageToolInvocation) AsMessageToolInvocationToolCall() (MessageToolInvocationToolCall, error) {
- var body MessageToolInvocationToolCall
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromMessageToolInvocationToolCall overwrites any union data inside the MessageToolInvocation as the provided MessageToolInvocationToolCall
- func (t *MessageToolInvocation) FromMessageToolInvocationToolCall(v MessageToolInvocationToolCall) error {
- v.State = "call"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeMessageToolInvocationToolCall performs a merge with any union data inside the MessageToolInvocation, using the provided MessageToolInvocationToolCall
- func (t *MessageToolInvocation) MergeMessageToolInvocationToolCall(v MessageToolInvocationToolCall) error {
- v.State = "call"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsMessageToolInvocationToolPartialCall returns the union data inside the MessageToolInvocation as a MessageToolInvocationToolPartialCall
- func (t MessageToolInvocation) AsMessageToolInvocationToolPartialCall() (MessageToolInvocationToolPartialCall, error) {
- var body MessageToolInvocationToolPartialCall
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromMessageToolInvocationToolPartialCall overwrites any union data inside the MessageToolInvocation as the provided MessageToolInvocationToolPartialCall
- func (t *MessageToolInvocation) FromMessageToolInvocationToolPartialCall(v MessageToolInvocationToolPartialCall) error {
- v.State = "partial-call"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeMessageToolInvocationToolPartialCall performs a merge with any union data inside the MessageToolInvocation, using the provided MessageToolInvocationToolPartialCall
- func (t *MessageToolInvocation) MergeMessageToolInvocationToolPartialCall(v MessageToolInvocationToolPartialCall) error {
- v.State = "partial-call"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- // AsMessageToolInvocationToolResult returns the union data inside the MessageToolInvocation as a MessageToolInvocationToolResult
- func (t MessageToolInvocation) AsMessageToolInvocationToolResult() (MessageToolInvocationToolResult, error) {
- var body MessageToolInvocationToolResult
- err := json.Unmarshal(t.union, &body)
- return body, err
- }
- // FromMessageToolInvocationToolResult overwrites any union data inside the MessageToolInvocation as the provided MessageToolInvocationToolResult
- func (t *MessageToolInvocation) FromMessageToolInvocationToolResult(v MessageToolInvocationToolResult) error {
- v.State = "result"
- b, err := json.Marshal(v)
- t.union = b
- return err
- }
- // MergeMessageToolInvocationToolResult performs a merge with any union data inside the MessageToolInvocation, using the provided MessageToolInvocationToolResult
- func (t *MessageToolInvocation) MergeMessageToolInvocationToolResult(v MessageToolInvocationToolResult) error {
- v.State = "result"
- b, err := json.Marshal(v)
- if err != nil {
- return err
- }
- merged, err := runtime.JSONMerge(t.union, b)
- t.union = merged
- return err
- }
- func (t MessageToolInvocation) Discriminator() (string, error) {
- var discriminator struct {
- Discriminator string `json:"state"`
- }
- err := json.Unmarshal(t.union, &discriminator)
- return discriminator.Discriminator, err
- }
- func (t MessageToolInvocation) ValueByDiscriminator() (interface{}, error) {
- discriminator, err := t.Discriminator()
- if err != nil {
- return nil, err
- }
- switch discriminator {
- case "call":
- return t.AsMessageToolInvocationToolCall()
- case "partial-call":
- return t.AsMessageToolInvocationToolPartialCall()
- case "result":
- return t.AsMessageToolInvocationToolResult()
- default:
- return nil, errors.New("unknown discriminator value: " + discriminator)
- }
- }
- func (t MessageToolInvocation) MarshalJSON() ([]byte, error) {
- b, err := t.union.MarshalJSON()
- return b, err
- }
- func (t *MessageToolInvocation) UnmarshalJSON(b []byte) error {
- err := t.union.UnmarshalJSON(b)
- return err
- }
- // RequestEditorFn is the function signature for the RequestEditor callback function
- type RequestEditorFn func(ctx context.Context, req *http.Request) error
- // Doer performs HTTP requests.
- //
- // The standard http.Client implements this interface.
- type HttpRequestDoer interface {
- Do(req *http.Request) (*http.Response, error)
- }
- // Client which conforms to the OpenAPI3 specification for this service.
- type Client struct {
- // The endpoint of the server conforming to this interface, with scheme,
- // https://api.deepmap.com for example. This can contain a path relative
- // to the server, such as https://api.deepmap.com/dev-test, and all the
- // paths in the swagger spec will be appended to the server.
- Server string
- // Doer for performing requests, typically a *http.Client with any
- // customized settings, such as certificate chains.
- Client HttpRequestDoer
- // A list of callbacks for modifying requests which are generated before sending over
- // the network.
- RequestEditors []RequestEditorFn
- }
- // ClientOption allows setting custom parameters during construction
- type ClientOption func(*Client) error
- // Creates a new Client, with reasonable defaults
- func NewClient(server string, opts ...ClientOption) (*Client, error) {
- // create a client with sane default values
- client := Client{
- Server: server,
- }
- // mutate client and add all optional params
- for _, o := range opts {
- if err := o(&client); err != nil {
- return nil, err
- }
- }
- // ensure the server URL always has a trailing slash
- if !strings.HasSuffix(client.Server, "/") {
- client.Server += "/"
- }
- // create httpClient, if not already present
- if client.Client == nil {
- client.Client = &http.Client{}
- }
- return &client, nil
- }
- // WithHTTPClient allows overriding the default Doer, which is
- // automatically created using http.Client. This is useful for tests.
- func WithHTTPClient(doer HttpRequestDoer) ClientOption {
- return func(c *Client) error {
- c.Client = doer
- return nil
- }
- }
- // WithRequestEditorFn allows setting up a callback function, which will be
- // called right before sending the request. This can be used to mutate the request.
- func WithRequestEditorFn(fn RequestEditorFn) ClientOption {
- return func(c *Client) error {
- c.RequestEditors = append(c.RequestEditors, fn)
- return nil
- }
- }
- // The interface specification for the client above.
- type ClientInterface interface {
- // PostAppInfo request
- PostAppInfo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- // PostAppInitialize request
- PostAppInitialize(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- // PostConfigGet request
- PostConfigGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- // GetEvent request
- GetEvent(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- // PostFileSearchWithBody request with any body
- PostFileSearchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
- PostFileSearch(ctx context.Context, body PostFileSearchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
- // PostInstallationInfo request
- PostInstallationInfo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- // PostPathGet request
- PostPathGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- // PostProviderList request
- PostProviderList(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- // PostSessionAbortWithBody request with any body
- PostSessionAbortWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
- PostSessionAbort(ctx context.Context, body PostSessionAbortJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
- // PostSessionChatWithBody request with any body
- PostSessionChatWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
- PostSessionChat(ctx context.Context, body PostSessionChatJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
- // PostSessionCreate request
- PostSessionCreate(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- // PostSessionDeleteWithBody request with any body
- PostSessionDeleteWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
- PostSessionDelete(ctx context.Context, body PostSessionDeleteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
- // PostSessionInitializeWithBody request with any body
- PostSessionInitializeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
- PostSessionInitialize(ctx context.Context, body PostSessionInitializeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
- // PostSessionList request
- PostSessionList(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- // PostSessionMessagesWithBody request with any body
- PostSessionMessagesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
- PostSessionMessages(ctx context.Context, body PostSessionMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
- // PostSessionShareWithBody request with any body
- PostSessionShareWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
- PostSessionShare(ctx context.Context, body PostSessionShareJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
- // PostSessionSummarizeWithBody request with any body
- PostSessionSummarizeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
- PostSessionSummarize(ctx context.Context, body PostSessionSummarizeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
- // PostSessionUnshareWithBody request with any body
- PostSessionUnshareWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
- PostSessionUnshare(ctx context.Context, body PostSessionUnshareJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
- }
- func (c *Client) PostAppInfo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostAppInfoRequest(c.Server)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostAppInitialize(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostAppInitializeRequest(c.Server)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostConfigGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostConfigGetRequest(c.Server)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) GetEvent(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewGetEventRequest(c.Server)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostFileSearchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostFileSearchRequestWithBody(c.Server, contentType, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostFileSearch(ctx context.Context, body PostFileSearchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostFileSearchRequest(c.Server, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostInstallationInfo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostInstallationInfoRequest(c.Server)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostPathGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostPathGetRequest(c.Server)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostProviderList(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostProviderListRequest(c.Server)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionAbortWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionAbortRequestWithBody(c.Server, contentType, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionAbort(ctx context.Context, body PostSessionAbortJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionAbortRequest(c.Server, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionChatWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionChatRequestWithBody(c.Server, contentType, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionChat(ctx context.Context, body PostSessionChatJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionChatRequest(c.Server, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionCreate(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionCreateRequest(c.Server)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionDeleteWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionDeleteRequestWithBody(c.Server, contentType, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionDelete(ctx context.Context, body PostSessionDeleteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionDeleteRequest(c.Server, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionInitializeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionInitializeRequestWithBody(c.Server, contentType, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionInitialize(ctx context.Context, body PostSessionInitializeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionInitializeRequest(c.Server, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionList(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionListRequest(c.Server)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionMessagesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionMessagesRequestWithBody(c.Server, contentType, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionMessages(ctx context.Context, body PostSessionMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionMessagesRequest(c.Server, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionShareWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionShareRequestWithBody(c.Server, contentType, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionShare(ctx context.Context, body PostSessionShareJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionShareRequest(c.Server, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionSummarizeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionSummarizeRequestWithBody(c.Server, contentType, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionSummarize(ctx context.Context, body PostSessionSummarizeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionSummarizeRequest(c.Server, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionUnshareWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionUnshareRequestWithBody(c.Server, contentType, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- func (c *Client) PostSessionUnshare(ctx context.Context, body PostSessionUnshareJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
- req, err := NewPostSessionUnshareRequest(c.Server, body)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
- if err := c.applyEditors(ctx, req, reqEditors); err != nil {
- return nil, err
- }
- return c.Client.Do(req)
- }
- // NewPostAppInfoRequest generates requests for PostAppInfo
- func NewPostAppInfoRequest(server string) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/app_info")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), nil)
- if err != nil {
- return nil, err
- }
- return req, nil
- }
- // NewPostAppInitializeRequest generates requests for PostAppInitialize
- func NewPostAppInitializeRequest(server string) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/app_initialize")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), nil)
- if err != nil {
- return nil, err
- }
- return req, nil
- }
- // NewPostConfigGetRequest generates requests for PostConfigGet
- func NewPostConfigGetRequest(server string) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/config_get")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), nil)
- if err != nil {
- return nil, err
- }
- return req, nil
- }
- // NewGetEventRequest generates requests for GetEvent
- func NewGetEventRequest(server string) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/event")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("GET", queryURL.String(), nil)
- if err != nil {
- return nil, err
- }
- return req, nil
- }
- // NewPostFileSearchRequest calls the generic PostFileSearch builder with application/json body
- func NewPostFileSearchRequest(server string, body PostFileSearchJSONRequestBody) (*http.Request, error) {
- var bodyReader io.Reader
- buf, err := json.Marshal(body)
- if err != nil {
- return nil, err
- }
- bodyReader = bytes.NewReader(buf)
- return NewPostFileSearchRequestWithBody(server, "application/json", bodyReader)
- }
- // NewPostFileSearchRequestWithBody generates requests for PostFileSearch with any type of body
- func NewPostFileSearchRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/file_search")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), body)
- if err != nil {
- return nil, err
- }
- req.Header.Add("Content-Type", contentType)
- return req, nil
- }
- // NewPostInstallationInfoRequest generates requests for PostInstallationInfo
- func NewPostInstallationInfoRequest(server string) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/installation_info")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), nil)
- if err != nil {
- return nil, err
- }
- return req, nil
- }
- // NewPostPathGetRequest generates requests for PostPathGet
- func NewPostPathGetRequest(server string) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/path_get")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), nil)
- if err != nil {
- return nil, err
- }
- return req, nil
- }
- // NewPostProviderListRequest generates requests for PostProviderList
- func NewPostProviderListRequest(server string) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/provider_list")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), nil)
- if err != nil {
- return nil, err
- }
- return req, nil
- }
- // NewPostSessionAbortRequest calls the generic PostSessionAbort builder with application/json body
- func NewPostSessionAbortRequest(server string, body PostSessionAbortJSONRequestBody) (*http.Request, error) {
- var bodyReader io.Reader
- buf, err := json.Marshal(body)
- if err != nil {
- return nil, err
- }
- bodyReader = bytes.NewReader(buf)
- return NewPostSessionAbortRequestWithBody(server, "application/json", bodyReader)
- }
- // NewPostSessionAbortRequestWithBody generates requests for PostSessionAbort with any type of body
- func NewPostSessionAbortRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/session_abort")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), body)
- if err != nil {
- return nil, err
- }
- req.Header.Add("Content-Type", contentType)
- return req, nil
- }
- // NewPostSessionChatRequest calls the generic PostSessionChat builder with application/json body
- func NewPostSessionChatRequest(server string, body PostSessionChatJSONRequestBody) (*http.Request, error) {
- var bodyReader io.Reader
- buf, err := json.Marshal(body)
- if err != nil {
- return nil, err
- }
- bodyReader = bytes.NewReader(buf)
- return NewPostSessionChatRequestWithBody(server, "application/json", bodyReader)
- }
- // NewPostSessionChatRequestWithBody generates requests for PostSessionChat with any type of body
- func NewPostSessionChatRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/session_chat")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), body)
- if err != nil {
- return nil, err
- }
- req.Header.Add("Content-Type", contentType)
- return req, nil
- }
- // NewPostSessionCreateRequest generates requests for PostSessionCreate
- func NewPostSessionCreateRequest(server string) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/session_create")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), nil)
- if err != nil {
- return nil, err
- }
- return req, nil
- }
- // NewPostSessionDeleteRequest calls the generic PostSessionDelete builder with application/json body
- func NewPostSessionDeleteRequest(server string, body PostSessionDeleteJSONRequestBody) (*http.Request, error) {
- var bodyReader io.Reader
- buf, err := json.Marshal(body)
- if err != nil {
- return nil, err
- }
- bodyReader = bytes.NewReader(buf)
- return NewPostSessionDeleteRequestWithBody(server, "application/json", bodyReader)
- }
- // NewPostSessionDeleteRequestWithBody generates requests for PostSessionDelete with any type of body
- func NewPostSessionDeleteRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/session_delete")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), body)
- if err != nil {
- return nil, err
- }
- req.Header.Add("Content-Type", contentType)
- return req, nil
- }
- // NewPostSessionInitializeRequest calls the generic PostSessionInitialize builder with application/json body
- func NewPostSessionInitializeRequest(server string, body PostSessionInitializeJSONRequestBody) (*http.Request, error) {
- var bodyReader io.Reader
- buf, err := json.Marshal(body)
- if err != nil {
- return nil, err
- }
- bodyReader = bytes.NewReader(buf)
- return NewPostSessionInitializeRequestWithBody(server, "application/json", bodyReader)
- }
- // NewPostSessionInitializeRequestWithBody generates requests for PostSessionInitialize with any type of body
- func NewPostSessionInitializeRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/session_initialize")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), body)
- if err != nil {
- return nil, err
- }
- req.Header.Add("Content-Type", contentType)
- return req, nil
- }
- // NewPostSessionListRequest generates requests for PostSessionList
- func NewPostSessionListRequest(server string) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/session_list")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), nil)
- if err != nil {
- return nil, err
- }
- return req, nil
- }
- // NewPostSessionMessagesRequest calls the generic PostSessionMessages builder with application/json body
- func NewPostSessionMessagesRequest(server string, body PostSessionMessagesJSONRequestBody) (*http.Request, error) {
- var bodyReader io.Reader
- buf, err := json.Marshal(body)
- if err != nil {
- return nil, err
- }
- bodyReader = bytes.NewReader(buf)
- return NewPostSessionMessagesRequestWithBody(server, "application/json", bodyReader)
- }
- // NewPostSessionMessagesRequestWithBody generates requests for PostSessionMessages with any type of body
- func NewPostSessionMessagesRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/session_messages")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), body)
- if err != nil {
- return nil, err
- }
- req.Header.Add("Content-Type", contentType)
- return req, nil
- }
- // NewPostSessionShareRequest calls the generic PostSessionShare builder with application/json body
- func NewPostSessionShareRequest(server string, body PostSessionShareJSONRequestBody) (*http.Request, error) {
- var bodyReader io.Reader
- buf, err := json.Marshal(body)
- if err != nil {
- return nil, err
- }
- bodyReader = bytes.NewReader(buf)
- return NewPostSessionShareRequestWithBody(server, "application/json", bodyReader)
- }
- // NewPostSessionShareRequestWithBody generates requests for PostSessionShare with any type of body
- func NewPostSessionShareRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/session_share")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), body)
- if err != nil {
- return nil, err
- }
- req.Header.Add("Content-Type", contentType)
- return req, nil
- }
- // NewPostSessionSummarizeRequest calls the generic PostSessionSummarize builder with application/json body
- func NewPostSessionSummarizeRequest(server string, body PostSessionSummarizeJSONRequestBody) (*http.Request, error) {
- var bodyReader io.Reader
- buf, err := json.Marshal(body)
- if err != nil {
- return nil, err
- }
- bodyReader = bytes.NewReader(buf)
- return NewPostSessionSummarizeRequestWithBody(server, "application/json", bodyReader)
- }
- // NewPostSessionSummarizeRequestWithBody generates requests for PostSessionSummarize with any type of body
- func NewPostSessionSummarizeRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/session_summarize")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), body)
- if err != nil {
- return nil, err
- }
- req.Header.Add("Content-Type", contentType)
- return req, nil
- }
- // NewPostSessionUnshareRequest calls the generic PostSessionUnshare builder with application/json body
- func NewPostSessionUnshareRequest(server string, body PostSessionUnshareJSONRequestBody) (*http.Request, error) {
- var bodyReader io.Reader
- buf, err := json.Marshal(body)
- if err != nil {
- return nil, err
- }
- bodyReader = bytes.NewReader(buf)
- return NewPostSessionUnshareRequestWithBody(server, "application/json", bodyReader)
- }
- // NewPostSessionUnshareRequestWithBody generates requests for PostSessionUnshare with any type of body
- func NewPostSessionUnshareRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
- var err error
- serverURL, err := url.Parse(server)
- if err != nil {
- return nil, err
- }
- operationPath := fmt.Sprintf("/session_unshare")
- if operationPath[0] == '/' {
- operationPath = "." + operationPath
- }
- queryURL, err := serverURL.Parse(operationPath)
- if err != nil {
- return nil, err
- }
- req, err := http.NewRequest("POST", queryURL.String(), body)
- if err != nil {
- return nil, err
- }
- req.Header.Add("Content-Type", contentType)
- return req, nil
- }
- func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error {
- for _, r := range c.RequestEditors {
- if err := r(ctx, req); err != nil {
- return err
- }
- }
- for _, r := range additionalEditors {
- if err := r(ctx, req); err != nil {
- return err
- }
- }
- return nil
- }
- // ClientWithResponses builds on ClientInterface to offer response payloads
- type ClientWithResponses struct {
- ClientInterface
- }
- // NewClientWithResponses creates a new ClientWithResponses, which wraps
- // Client with return type handling
- func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) {
- client, err := NewClient(server, opts...)
- if err != nil {
- return nil, err
- }
- return &ClientWithResponses{client}, nil
- }
- // WithBaseURL overrides the baseURL.
- func WithBaseURL(baseURL string) ClientOption {
- return func(c *Client) error {
- newBaseURL, err := url.Parse(baseURL)
- if err != nil {
- return err
- }
- c.Server = newBaseURL.String()
- return nil
- }
- }
- // ClientWithResponsesInterface is the interface specification for the client with responses above.
- type ClientWithResponsesInterface interface {
- // PostAppInfoWithResponse request
- PostAppInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostAppInfoResponse, error)
- // PostAppInitializeWithResponse request
- PostAppInitializeWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostAppInitializeResponse, error)
- // PostConfigGetWithResponse request
- PostConfigGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostConfigGetResponse, error)
- // GetEventWithResponse request
- GetEventWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetEventResponse, error)
- // PostFileSearchWithBodyWithResponse request with any body
- PostFileSearchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFileSearchResponse, error)
- PostFileSearchWithResponse(ctx context.Context, body PostFileSearchJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFileSearchResponse, error)
- // PostInstallationInfoWithResponse request
- PostInstallationInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostInstallationInfoResponse, error)
- // PostPathGetWithResponse request
- PostPathGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostPathGetResponse, error)
- // PostProviderListWithResponse request
- PostProviderListWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostProviderListResponse, error)
- // PostSessionAbortWithBodyWithResponse request with any body
- PostSessionAbortWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionAbortResponse, error)
- PostSessionAbortWithResponse(ctx context.Context, body PostSessionAbortJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionAbortResponse, error)
- // PostSessionChatWithBodyWithResponse request with any body
- PostSessionChatWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionChatResponse, error)
- PostSessionChatWithResponse(ctx context.Context, body PostSessionChatJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionChatResponse, error)
- // PostSessionCreateWithResponse request
- PostSessionCreateWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostSessionCreateResponse, error)
- // PostSessionDeleteWithBodyWithResponse request with any body
- PostSessionDeleteWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionDeleteResponse, error)
- PostSessionDeleteWithResponse(ctx context.Context, body PostSessionDeleteJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionDeleteResponse, error)
- // PostSessionInitializeWithBodyWithResponse request with any body
- PostSessionInitializeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionInitializeResponse, error)
- PostSessionInitializeWithResponse(ctx context.Context, body PostSessionInitializeJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionInitializeResponse, error)
- // PostSessionListWithResponse request
- PostSessionListWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostSessionListResponse, error)
- // PostSessionMessagesWithBodyWithResponse request with any body
- PostSessionMessagesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionMessagesResponse, error)
- PostSessionMessagesWithResponse(ctx context.Context, body PostSessionMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionMessagesResponse, error)
- // PostSessionShareWithBodyWithResponse request with any body
- PostSessionShareWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionShareResponse, error)
- PostSessionShareWithResponse(ctx context.Context, body PostSessionShareJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionShareResponse, error)
- // PostSessionSummarizeWithBodyWithResponse request with any body
- PostSessionSummarizeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionSummarizeResponse, error)
- PostSessionSummarizeWithResponse(ctx context.Context, body PostSessionSummarizeJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionSummarizeResponse, error)
- // PostSessionUnshareWithBodyWithResponse request with any body
- PostSessionUnshareWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionUnshareResponse, error)
- PostSessionUnshareWithResponse(ctx context.Context, body PostSessionUnshareJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionUnshareResponse, error)
- }
- type PostAppInfoResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *AppInfo
- }
- // Status returns HTTPResponse.Status
- func (r PostAppInfoResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostAppInfoResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type PostAppInitializeResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *bool
- }
- // Status returns HTTPResponse.Status
- func (r PostAppInitializeResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostAppInitializeResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type PostConfigGetResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *ConfigInfo
- }
- // Status returns HTTPResponse.Status
- func (r PostConfigGetResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostConfigGetResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type GetEventResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *Event
- }
- // Status returns HTTPResponse.Status
- func (r GetEventResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r GetEventResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type PostFileSearchResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *[]string
- }
- // Status returns HTTPResponse.Status
- func (r PostFileSearchResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostFileSearchResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type PostInstallationInfoResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *InstallationInfo
- }
- // Status returns HTTPResponse.Status
- func (r PostInstallationInfoResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostInstallationInfoResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type PostPathGetResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *struct {
- Config string `json:"config"`
- Cwd string `json:"cwd"`
- Data string `json:"data"`
- Root string `json:"root"`
- }
- }
- // Status returns HTTPResponse.Status
- func (r PostPathGetResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostPathGetResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type PostProviderListResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *struct {
- Default map[string]string `json:"default"`
- Providers []ProviderInfo `json:"providers"`
- }
- }
- // Status returns HTTPResponse.Status
- func (r PostProviderListResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostProviderListResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type PostSessionAbortResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *bool
- }
- // Status returns HTTPResponse.Status
- func (r PostSessionAbortResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostSessionAbortResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type PostSessionChatResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *MessageInfo
- }
- // Status returns HTTPResponse.Status
- func (r PostSessionChatResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostSessionChatResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type PostSessionCreateResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *SessionInfo
- JSON400 *Error
- }
- // Status returns HTTPResponse.Status
- func (r PostSessionCreateResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostSessionCreateResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type PostSessionDeleteResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *bool
- }
- // Status returns HTTPResponse.Status
- func (r PostSessionDeleteResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostSessionDeleteResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type PostSessionInitializeResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *bool
- }
- // Status returns HTTPResponse.Status
- func (r PostSessionInitializeResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostSessionInitializeResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type PostSessionListResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *[]SessionInfo
- }
- // Status returns HTTPResponse.Status
- func (r PostSessionListResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostSessionListResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type PostSessionMessagesResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *[]MessageInfo
- }
- // Status returns HTTPResponse.Status
- func (r PostSessionMessagesResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostSessionMessagesResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type PostSessionShareResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *SessionInfo
- }
- // Status returns HTTPResponse.Status
- func (r PostSessionShareResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostSessionShareResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type PostSessionSummarizeResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *bool
- }
- // Status returns HTTPResponse.Status
- func (r PostSessionSummarizeResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostSessionSummarizeResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- type PostSessionUnshareResponse struct {
- Body []byte
- HTTPResponse *http.Response
- JSON200 *SessionInfo
- }
- // Status returns HTTPResponse.Status
- func (r PostSessionUnshareResponse) Status() string {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.Status
- }
- return http.StatusText(0)
- }
- // StatusCode returns HTTPResponse.StatusCode
- func (r PostSessionUnshareResponse) StatusCode() int {
- if r.HTTPResponse != nil {
- return r.HTTPResponse.StatusCode
- }
- return 0
- }
- // PostAppInfoWithResponse request returning *PostAppInfoResponse
- func (c *ClientWithResponses) PostAppInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostAppInfoResponse, error) {
- rsp, err := c.PostAppInfo(ctx, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostAppInfoResponse(rsp)
- }
- // PostAppInitializeWithResponse request returning *PostAppInitializeResponse
- func (c *ClientWithResponses) PostAppInitializeWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostAppInitializeResponse, error) {
- rsp, err := c.PostAppInitialize(ctx, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostAppInitializeResponse(rsp)
- }
- // PostConfigGetWithResponse request returning *PostConfigGetResponse
- func (c *ClientWithResponses) PostConfigGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostConfigGetResponse, error) {
- rsp, err := c.PostConfigGet(ctx, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostConfigGetResponse(rsp)
- }
- // GetEventWithResponse request returning *GetEventResponse
- func (c *ClientWithResponses) GetEventWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetEventResponse, error) {
- rsp, err := c.GetEvent(ctx, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParseGetEventResponse(rsp)
- }
- // PostFileSearchWithBodyWithResponse request with arbitrary body returning *PostFileSearchResponse
- func (c *ClientWithResponses) PostFileSearchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFileSearchResponse, error) {
- rsp, err := c.PostFileSearchWithBody(ctx, contentType, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostFileSearchResponse(rsp)
- }
- func (c *ClientWithResponses) PostFileSearchWithResponse(ctx context.Context, body PostFileSearchJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFileSearchResponse, error) {
- rsp, err := c.PostFileSearch(ctx, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostFileSearchResponse(rsp)
- }
- // PostInstallationInfoWithResponse request returning *PostInstallationInfoResponse
- func (c *ClientWithResponses) PostInstallationInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostInstallationInfoResponse, error) {
- rsp, err := c.PostInstallationInfo(ctx, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostInstallationInfoResponse(rsp)
- }
- // PostPathGetWithResponse request returning *PostPathGetResponse
- func (c *ClientWithResponses) PostPathGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostPathGetResponse, error) {
- rsp, err := c.PostPathGet(ctx, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostPathGetResponse(rsp)
- }
- // PostProviderListWithResponse request returning *PostProviderListResponse
- func (c *ClientWithResponses) PostProviderListWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostProviderListResponse, error) {
- rsp, err := c.PostProviderList(ctx, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostProviderListResponse(rsp)
- }
- // PostSessionAbortWithBodyWithResponse request with arbitrary body returning *PostSessionAbortResponse
- func (c *ClientWithResponses) PostSessionAbortWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionAbortResponse, error) {
- rsp, err := c.PostSessionAbortWithBody(ctx, contentType, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionAbortResponse(rsp)
- }
- func (c *ClientWithResponses) PostSessionAbortWithResponse(ctx context.Context, body PostSessionAbortJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionAbortResponse, error) {
- rsp, err := c.PostSessionAbort(ctx, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionAbortResponse(rsp)
- }
- // PostSessionChatWithBodyWithResponse request with arbitrary body returning *PostSessionChatResponse
- func (c *ClientWithResponses) PostSessionChatWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionChatResponse, error) {
- rsp, err := c.PostSessionChatWithBody(ctx, contentType, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionChatResponse(rsp)
- }
- func (c *ClientWithResponses) PostSessionChatWithResponse(ctx context.Context, body PostSessionChatJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionChatResponse, error) {
- rsp, err := c.PostSessionChat(ctx, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionChatResponse(rsp)
- }
- // PostSessionCreateWithResponse request returning *PostSessionCreateResponse
- func (c *ClientWithResponses) PostSessionCreateWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostSessionCreateResponse, error) {
- rsp, err := c.PostSessionCreate(ctx, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionCreateResponse(rsp)
- }
- // PostSessionDeleteWithBodyWithResponse request with arbitrary body returning *PostSessionDeleteResponse
- func (c *ClientWithResponses) PostSessionDeleteWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionDeleteResponse, error) {
- rsp, err := c.PostSessionDeleteWithBody(ctx, contentType, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionDeleteResponse(rsp)
- }
- func (c *ClientWithResponses) PostSessionDeleteWithResponse(ctx context.Context, body PostSessionDeleteJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionDeleteResponse, error) {
- rsp, err := c.PostSessionDelete(ctx, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionDeleteResponse(rsp)
- }
- // PostSessionInitializeWithBodyWithResponse request with arbitrary body returning *PostSessionInitializeResponse
- func (c *ClientWithResponses) PostSessionInitializeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionInitializeResponse, error) {
- rsp, err := c.PostSessionInitializeWithBody(ctx, contentType, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionInitializeResponse(rsp)
- }
- func (c *ClientWithResponses) PostSessionInitializeWithResponse(ctx context.Context, body PostSessionInitializeJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionInitializeResponse, error) {
- rsp, err := c.PostSessionInitialize(ctx, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionInitializeResponse(rsp)
- }
- // PostSessionListWithResponse request returning *PostSessionListResponse
- func (c *ClientWithResponses) PostSessionListWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostSessionListResponse, error) {
- rsp, err := c.PostSessionList(ctx, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionListResponse(rsp)
- }
- // PostSessionMessagesWithBodyWithResponse request with arbitrary body returning *PostSessionMessagesResponse
- func (c *ClientWithResponses) PostSessionMessagesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionMessagesResponse, error) {
- rsp, err := c.PostSessionMessagesWithBody(ctx, contentType, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionMessagesResponse(rsp)
- }
- func (c *ClientWithResponses) PostSessionMessagesWithResponse(ctx context.Context, body PostSessionMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionMessagesResponse, error) {
- rsp, err := c.PostSessionMessages(ctx, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionMessagesResponse(rsp)
- }
- // PostSessionShareWithBodyWithResponse request with arbitrary body returning *PostSessionShareResponse
- func (c *ClientWithResponses) PostSessionShareWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionShareResponse, error) {
- rsp, err := c.PostSessionShareWithBody(ctx, contentType, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionShareResponse(rsp)
- }
- func (c *ClientWithResponses) PostSessionShareWithResponse(ctx context.Context, body PostSessionShareJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionShareResponse, error) {
- rsp, err := c.PostSessionShare(ctx, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionShareResponse(rsp)
- }
- // PostSessionSummarizeWithBodyWithResponse request with arbitrary body returning *PostSessionSummarizeResponse
- func (c *ClientWithResponses) PostSessionSummarizeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionSummarizeResponse, error) {
- rsp, err := c.PostSessionSummarizeWithBody(ctx, contentType, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionSummarizeResponse(rsp)
- }
- func (c *ClientWithResponses) PostSessionSummarizeWithResponse(ctx context.Context, body PostSessionSummarizeJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionSummarizeResponse, error) {
- rsp, err := c.PostSessionSummarize(ctx, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionSummarizeResponse(rsp)
- }
- // PostSessionUnshareWithBodyWithResponse request with arbitrary body returning *PostSessionUnshareResponse
- func (c *ClientWithResponses) PostSessionUnshareWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionUnshareResponse, error) {
- rsp, err := c.PostSessionUnshareWithBody(ctx, contentType, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionUnshareResponse(rsp)
- }
- func (c *ClientWithResponses) PostSessionUnshareWithResponse(ctx context.Context, body PostSessionUnshareJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionUnshareResponse, error) {
- rsp, err := c.PostSessionUnshare(ctx, body, reqEditors...)
- if err != nil {
- return nil, err
- }
- return ParsePostSessionUnshareResponse(rsp)
- }
- // ParsePostAppInfoResponse parses an HTTP response from a PostAppInfoWithResponse call
- func ParsePostAppInfoResponse(rsp *http.Response) (*PostAppInfoResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostAppInfoResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest AppInfo
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
- // ParsePostAppInitializeResponse parses an HTTP response from a PostAppInitializeWithResponse call
- func ParsePostAppInitializeResponse(rsp *http.Response) (*PostAppInitializeResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostAppInitializeResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest bool
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
- // ParsePostConfigGetResponse parses an HTTP response from a PostConfigGetWithResponse call
- func ParsePostConfigGetResponse(rsp *http.Response) (*PostConfigGetResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostConfigGetResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest ConfigInfo
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
- // ParseGetEventResponse parses an HTTP response from a GetEventWithResponse call
- func ParseGetEventResponse(rsp *http.Response) (*GetEventResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &GetEventResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest Event
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
- // ParsePostFileSearchResponse parses an HTTP response from a PostFileSearchWithResponse call
- func ParsePostFileSearchResponse(rsp *http.Response) (*PostFileSearchResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostFileSearchResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest []string
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
- // ParsePostInstallationInfoResponse parses an HTTP response from a PostInstallationInfoWithResponse call
- func ParsePostInstallationInfoResponse(rsp *http.Response) (*PostInstallationInfoResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostInstallationInfoResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest InstallationInfo
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
- // ParsePostPathGetResponse parses an HTTP response from a PostPathGetWithResponse call
- func ParsePostPathGetResponse(rsp *http.Response) (*PostPathGetResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostPathGetResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest struct {
- Config string `json:"config"`
- Cwd string `json:"cwd"`
- Data string `json:"data"`
- Root string `json:"root"`
- }
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
- // ParsePostProviderListResponse parses an HTTP response from a PostProviderListWithResponse call
- func ParsePostProviderListResponse(rsp *http.Response) (*PostProviderListResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostProviderListResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest struct {
- Default map[string]string `json:"default"`
- Providers []ProviderInfo `json:"providers"`
- }
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
- // ParsePostSessionAbortResponse parses an HTTP response from a PostSessionAbortWithResponse call
- func ParsePostSessionAbortResponse(rsp *http.Response) (*PostSessionAbortResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostSessionAbortResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest bool
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
- // ParsePostSessionChatResponse parses an HTTP response from a PostSessionChatWithResponse call
- func ParsePostSessionChatResponse(rsp *http.Response) (*PostSessionChatResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostSessionChatResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest MessageInfo
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
- // ParsePostSessionCreateResponse parses an HTTP response from a PostSessionCreateWithResponse call
- func ParsePostSessionCreateResponse(rsp *http.Response) (*PostSessionCreateResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostSessionCreateResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest SessionInfo
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
- var dest Error
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON400 = &dest
- }
- return response, nil
- }
- // ParsePostSessionDeleteResponse parses an HTTP response from a PostSessionDeleteWithResponse call
- func ParsePostSessionDeleteResponse(rsp *http.Response) (*PostSessionDeleteResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostSessionDeleteResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest bool
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
- // ParsePostSessionInitializeResponse parses an HTTP response from a PostSessionInitializeWithResponse call
- func ParsePostSessionInitializeResponse(rsp *http.Response) (*PostSessionInitializeResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostSessionInitializeResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest bool
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
- // ParsePostSessionListResponse parses an HTTP response from a PostSessionListWithResponse call
- func ParsePostSessionListResponse(rsp *http.Response) (*PostSessionListResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostSessionListResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest []SessionInfo
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
- // ParsePostSessionMessagesResponse parses an HTTP response from a PostSessionMessagesWithResponse call
- func ParsePostSessionMessagesResponse(rsp *http.Response) (*PostSessionMessagesResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostSessionMessagesResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest []MessageInfo
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
- // ParsePostSessionShareResponse parses an HTTP response from a PostSessionShareWithResponse call
- func ParsePostSessionShareResponse(rsp *http.Response) (*PostSessionShareResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostSessionShareResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest SessionInfo
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
- // ParsePostSessionSummarizeResponse parses an HTTP response from a PostSessionSummarizeWithResponse call
- func ParsePostSessionSummarizeResponse(rsp *http.Response) (*PostSessionSummarizeResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostSessionSummarizeResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest bool
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
- // ParsePostSessionUnshareResponse parses an HTTP response from a PostSessionUnshareWithResponse call
- func ParsePostSessionUnshareResponse(rsp *http.Response) (*PostSessionUnshareResponse, error) {
- bodyBytes, err := io.ReadAll(rsp.Body)
- defer func() { _ = rsp.Body.Close() }()
- if err != nil {
- return nil, err
- }
- response := &PostSessionUnshareResponse{
- Body: bodyBytes,
- HTTPResponse: rsp,
- }
- switch {
- case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
- var dest SessionInfo
- if err := json.Unmarshal(bodyBytes, &dest); err != nil {
- return nil, err
- }
- response.JSON200 = &dest
- }
- return response, nil
- }
|