event.go 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489
  1. // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
  2. package opencode
  3. import (
  4. "context"
  5. "net/http"
  6. "net/url"
  7. "reflect"
  8. "slices"
  9. "github.com/sst/opencode-sdk-go/internal/apijson"
  10. "github.com/sst/opencode-sdk-go/internal/apiquery"
  11. "github.com/sst/opencode-sdk-go/internal/param"
  12. "github.com/sst/opencode-sdk-go/internal/requestconfig"
  13. "github.com/sst/opencode-sdk-go/option"
  14. "github.com/sst/opencode-sdk-go/packages/ssestream"
  15. "github.com/sst/opencode-sdk-go/shared"
  16. "github.com/tidwall/gjson"
  17. )
  18. // EventService contains methods and other services that help with interacting with
  19. // the opencode API.
  20. //
  21. // Note, unlike clients, this service does not read variables from the environment
  22. // automatically. You should not instantiate this service directly, and instead use
  23. // the [NewEventService] method instead.
  24. type EventService struct {
  25. Options []option.RequestOption
  26. }
  27. // NewEventService generates a new service that applies the given options to each
  28. // request. These options are applied after the parent client's options (if there
  29. // is one), and before any request-specific options.
  30. func NewEventService(opts ...option.RequestOption) (r *EventService) {
  31. r = &EventService{}
  32. r.Options = opts
  33. return
  34. }
  35. // Get events
  36. func (r *EventService) ListStreaming(ctx context.Context, query EventListParams, opts ...option.RequestOption) (stream *ssestream.Stream[EventListResponse]) {
  37. var (
  38. raw *http.Response
  39. err error
  40. )
  41. opts = slices.Concat(r.Options, opts)
  42. opts = append([]option.RequestOption{option.WithHeader("Accept", "text/event-stream")}, opts...)
  43. path := "event"
  44. err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &raw, opts...)
  45. return ssestream.NewStream[EventListResponse](ssestream.NewDecoder(raw), err)
  46. }
  47. type EventListResponse struct {
  48. // This field can have the runtime type of
  49. // [EventListResponseEventInstallationUpdatedProperties],
  50. // [EventListResponseEventLspClientDiagnosticsProperties],
  51. // [EventListResponseEventMessageUpdatedProperties],
  52. // [EventListResponseEventMessageRemovedProperties],
  53. // [EventListResponseEventMessagePartUpdatedProperties],
  54. // [EventListResponseEventMessagePartRemovedProperties],
  55. // [EventListResponseEventSessionCompactedProperties], [Permission],
  56. // [EventListResponseEventPermissionRepliedProperties],
  57. // [EventListResponseEventFileEditedProperties],
  58. // [EventListResponseEventFileWatcherUpdatedProperties],
  59. // [EventListResponseEventTodoUpdatedProperties],
  60. // [EventListResponseEventSessionIdleProperties],
  61. // [EventListResponseEventSessionUpdatedProperties],
  62. // [EventListResponseEventSessionDeletedProperties],
  63. // [EventListResponseEventSessionErrorProperties], [interface{}],
  64. // [EventListResponseEventIdeInstalledProperties].
  65. Properties interface{} `json:"properties,required"`
  66. Type EventListResponseType `json:"type,required"`
  67. JSON eventListResponseJSON `json:"-"`
  68. union EventListResponseUnion
  69. }
  70. // eventListResponseJSON contains the JSON metadata for the struct
  71. // [EventListResponse]
  72. type eventListResponseJSON struct {
  73. Properties apijson.Field
  74. Type apijson.Field
  75. raw string
  76. ExtraFields map[string]apijson.Field
  77. }
  78. func (r eventListResponseJSON) RawJSON() string {
  79. return r.raw
  80. }
  81. func (r *EventListResponse) UnmarshalJSON(data []byte) (err error) {
  82. *r = EventListResponse{}
  83. err = apijson.UnmarshalRoot(data, &r.union)
  84. if err != nil {
  85. return err
  86. }
  87. return apijson.Port(r.union, &r)
  88. }
  89. // AsUnion returns a [EventListResponseUnion] interface which you can cast to the
  90. // specific types for more type safety.
  91. //
  92. // Possible runtime types of the union are
  93. // [EventListResponseEventInstallationUpdated],
  94. // [EventListResponseEventLspClientDiagnostics],
  95. // [EventListResponseEventMessageUpdated], [EventListResponseEventMessageRemoved],
  96. // [EventListResponseEventMessagePartUpdated],
  97. // [EventListResponseEventMessagePartRemoved],
  98. // [EventListResponseEventSessionCompacted],
  99. // [EventListResponseEventPermissionUpdated],
  100. // [EventListResponseEventPermissionReplied], [EventListResponseEventFileEdited],
  101. // [EventListResponseEventFileWatcherUpdated], [EventListResponseEventTodoUpdated],
  102. // [EventListResponseEventSessionIdle], [EventListResponseEventSessionUpdated],
  103. // [EventListResponseEventSessionDeleted], [EventListResponseEventSessionError],
  104. // [EventListResponseEventServerConnected], [EventListResponseEventIdeInstalled].
  105. func (r EventListResponse) AsUnion() EventListResponseUnion {
  106. return r.union
  107. }
  108. // Union satisfied by [EventListResponseEventInstallationUpdated],
  109. // [EventListResponseEventLspClientDiagnostics],
  110. // [EventListResponseEventMessageUpdated], [EventListResponseEventMessageRemoved],
  111. // [EventListResponseEventMessagePartUpdated],
  112. // [EventListResponseEventMessagePartRemoved],
  113. // [EventListResponseEventSessionCompacted],
  114. // [EventListResponseEventPermissionUpdated],
  115. // [EventListResponseEventPermissionReplied], [EventListResponseEventFileEdited],
  116. // [EventListResponseEventFileWatcherUpdated], [EventListResponseEventTodoUpdated],
  117. // [EventListResponseEventSessionIdle], [EventListResponseEventSessionUpdated],
  118. // [EventListResponseEventSessionDeleted], [EventListResponseEventSessionError],
  119. // [EventListResponseEventServerConnected] or [EventListResponseEventIdeInstalled].
  120. type EventListResponseUnion interface {
  121. implementsEventListResponse()
  122. }
  123. func init() {
  124. apijson.RegisterUnion(
  125. reflect.TypeOf((*EventListResponseUnion)(nil)).Elem(),
  126. "",
  127. apijson.UnionVariant{
  128. TypeFilter: gjson.JSON,
  129. Type: reflect.TypeOf(EventListResponseEventInstallationUpdated{}),
  130. },
  131. apijson.UnionVariant{
  132. TypeFilter: gjson.JSON,
  133. Type: reflect.TypeOf(EventListResponseEventLspClientDiagnostics{}),
  134. },
  135. apijson.UnionVariant{
  136. TypeFilter: gjson.JSON,
  137. Type: reflect.TypeOf(EventListResponseEventMessageUpdated{}),
  138. },
  139. apijson.UnionVariant{
  140. TypeFilter: gjson.JSON,
  141. Type: reflect.TypeOf(EventListResponseEventMessageRemoved{}),
  142. },
  143. apijson.UnionVariant{
  144. TypeFilter: gjson.JSON,
  145. Type: reflect.TypeOf(EventListResponseEventMessagePartUpdated{}),
  146. },
  147. apijson.UnionVariant{
  148. TypeFilter: gjson.JSON,
  149. Type: reflect.TypeOf(EventListResponseEventMessagePartRemoved{}),
  150. },
  151. apijson.UnionVariant{
  152. TypeFilter: gjson.JSON,
  153. Type: reflect.TypeOf(EventListResponseEventSessionCompacted{}),
  154. },
  155. apijson.UnionVariant{
  156. TypeFilter: gjson.JSON,
  157. Type: reflect.TypeOf(EventListResponseEventPermissionUpdated{}),
  158. },
  159. apijson.UnionVariant{
  160. TypeFilter: gjson.JSON,
  161. Type: reflect.TypeOf(EventListResponseEventPermissionReplied{}),
  162. },
  163. apijson.UnionVariant{
  164. TypeFilter: gjson.JSON,
  165. Type: reflect.TypeOf(EventListResponseEventFileEdited{}),
  166. },
  167. apijson.UnionVariant{
  168. TypeFilter: gjson.JSON,
  169. Type: reflect.TypeOf(EventListResponseEventFileWatcherUpdated{}),
  170. },
  171. apijson.UnionVariant{
  172. TypeFilter: gjson.JSON,
  173. Type: reflect.TypeOf(EventListResponseEventTodoUpdated{}),
  174. },
  175. apijson.UnionVariant{
  176. TypeFilter: gjson.JSON,
  177. Type: reflect.TypeOf(EventListResponseEventSessionIdle{}),
  178. },
  179. apijson.UnionVariant{
  180. TypeFilter: gjson.JSON,
  181. Type: reflect.TypeOf(EventListResponseEventSessionUpdated{}),
  182. },
  183. apijson.UnionVariant{
  184. TypeFilter: gjson.JSON,
  185. Type: reflect.TypeOf(EventListResponseEventSessionDeleted{}),
  186. },
  187. apijson.UnionVariant{
  188. TypeFilter: gjson.JSON,
  189. Type: reflect.TypeOf(EventListResponseEventSessionError{}),
  190. },
  191. apijson.UnionVariant{
  192. TypeFilter: gjson.JSON,
  193. Type: reflect.TypeOf(EventListResponseEventServerConnected{}),
  194. },
  195. apijson.UnionVariant{
  196. TypeFilter: gjson.JSON,
  197. Type: reflect.TypeOf(EventListResponseEventIdeInstalled{}),
  198. },
  199. )
  200. }
  201. type EventListResponseEventInstallationUpdated struct {
  202. Properties EventListResponseEventInstallationUpdatedProperties `json:"properties,required"`
  203. Type EventListResponseEventInstallationUpdatedType `json:"type,required"`
  204. JSON eventListResponseEventInstallationUpdatedJSON `json:"-"`
  205. }
  206. // eventListResponseEventInstallationUpdatedJSON contains the JSON metadata for the
  207. // struct [EventListResponseEventInstallationUpdated]
  208. type eventListResponseEventInstallationUpdatedJSON struct {
  209. Properties apijson.Field
  210. Type apijson.Field
  211. raw string
  212. ExtraFields map[string]apijson.Field
  213. }
  214. func (r *EventListResponseEventInstallationUpdated) UnmarshalJSON(data []byte) (err error) {
  215. return apijson.UnmarshalRoot(data, r)
  216. }
  217. func (r eventListResponseEventInstallationUpdatedJSON) RawJSON() string {
  218. return r.raw
  219. }
  220. func (r EventListResponseEventInstallationUpdated) implementsEventListResponse() {}
  221. type EventListResponseEventInstallationUpdatedProperties struct {
  222. Version string `json:"version,required"`
  223. JSON eventListResponseEventInstallationUpdatedPropertiesJSON `json:"-"`
  224. }
  225. // eventListResponseEventInstallationUpdatedPropertiesJSON contains the JSON
  226. // metadata for the struct [EventListResponseEventInstallationUpdatedProperties]
  227. type eventListResponseEventInstallationUpdatedPropertiesJSON struct {
  228. Version apijson.Field
  229. raw string
  230. ExtraFields map[string]apijson.Field
  231. }
  232. func (r *EventListResponseEventInstallationUpdatedProperties) UnmarshalJSON(data []byte) (err error) {
  233. return apijson.UnmarshalRoot(data, r)
  234. }
  235. func (r eventListResponseEventInstallationUpdatedPropertiesJSON) RawJSON() string {
  236. return r.raw
  237. }
  238. type EventListResponseEventInstallationUpdatedType string
  239. const (
  240. EventListResponseEventInstallationUpdatedTypeInstallationUpdated EventListResponseEventInstallationUpdatedType = "installation.updated"
  241. )
  242. func (r EventListResponseEventInstallationUpdatedType) IsKnown() bool {
  243. switch r {
  244. case EventListResponseEventInstallationUpdatedTypeInstallationUpdated:
  245. return true
  246. }
  247. return false
  248. }
  249. type EventListResponseEventLspClientDiagnostics struct {
  250. Properties EventListResponseEventLspClientDiagnosticsProperties `json:"properties,required"`
  251. Type EventListResponseEventLspClientDiagnosticsType `json:"type,required"`
  252. JSON eventListResponseEventLspClientDiagnosticsJSON `json:"-"`
  253. }
  254. // eventListResponseEventLspClientDiagnosticsJSON contains the JSON metadata for
  255. // the struct [EventListResponseEventLspClientDiagnostics]
  256. type eventListResponseEventLspClientDiagnosticsJSON struct {
  257. Properties apijson.Field
  258. Type apijson.Field
  259. raw string
  260. ExtraFields map[string]apijson.Field
  261. }
  262. func (r *EventListResponseEventLspClientDiagnostics) UnmarshalJSON(data []byte) (err error) {
  263. return apijson.UnmarshalRoot(data, r)
  264. }
  265. func (r eventListResponseEventLspClientDiagnosticsJSON) RawJSON() string {
  266. return r.raw
  267. }
  268. func (r EventListResponseEventLspClientDiagnostics) implementsEventListResponse() {}
  269. type EventListResponseEventLspClientDiagnosticsProperties struct {
  270. Path string `json:"path,required"`
  271. ServerID string `json:"serverID,required"`
  272. JSON eventListResponseEventLspClientDiagnosticsPropertiesJSON `json:"-"`
  273. }
  274. // eventListResponseEventLspClientDiagnosticsPropertiesJSON contains the JSON
  275. // metadata for the struct [EventListResponseEventLspClientDiagnosticsProperties]
  276. type eventListResponseEventLspClientDiagnosticsPropertiesJSON struct {
  277. Path apijson.Field
  278. ServerID apijson.Field
  279. raw string
  280. ExtraFields map[string]apijson.Field
  281. }
  282. func (r *EventListResponseEventLspClientDiagnosticsProperties) UnmarshalJSON(data []byte) (err error) {
  283. return apijson.UnmarshalRoot(data, r)
  284. }
  285. func (r eventListResponseEventLspClientDiagnosticsPropertiesJSON) RawJSON() string {
  286. return r.raw
  287. }
  288. type EventListResponseEventLspClientDiagnosticsType string
  289. const (
  290. EventListResponseEventLspClientDiagnosticsTypeLspClientDiagnostics EventListResponseEventLspClientDiagnosticsType = "lsp.client.diagnostics"
  291. )
  292. func (r EventListResponseEventLspClientDiagnosticsType) IsKnown() bool {
  293. switch r {
  294. case EventListResponseEventLspClientDiagnosticsTypeLspClientDiagnostics:
  295. return true
  296. }
  297. return false
  298. }
  299. type EventListResponseEventMessageUpdated struct {
  300. Properties EventListResponseEventMessageUpdatedProperties `json:"properties,required"`
  301. Type EventListResponseEventMessageUpdatedType `json:"type,required"`
  302. JSON eventListResponseEventMessageUpdatedJSON `json:"-"`
  303. }
  304. // eventListResponseEventMessageUpdatedJSON contains the JSON metadata for the
  305. // struct [EventListResponseEventMessageUpdated]
  306. type eventListResponseEventMessageUpdatedJSON struct {
  307. Properties apijson.Field
  308. Type apijson.Field
  309. raw string
  310. ExtraFields map[string]apijson.Field
  311. }
  312. func (r *EventListResponseEventMessageUpdated) UnmarshalJSON(data []byte) (err error) {
  313. return apijson.UnmarshalRoot(data, r)
  314. }
  315. func (r eventListResponseEventMessageUpdatedJSON) RawJSON() string {
  316. return r.raw
  317. }
  318. func (r EventListResponseEventMessageUpdated) implementsEventListResponse() {}
  319. type EventListResponseEventMessageUpdatedProperties struct {
  320. Info Message `json:"info,required"`
  321. JSON eventListResponseEventMessageUpdatedPropertiesJSON `json:"-"`
  322. }
  323. // eventListResponseEventMessageUpdatedPropertiesJSON contains the JSON metadata
  324. // for the struct [EventListResponseEventMessageUpdatedProperties]
  325. type eventListResponseEventMessageUpdatedPropertiesJSON struct {
  326. Info apijson.Field
  327. raw string
  328. ExtraFields map[string]apijson.Field
  329. }
  330. func (r *EventListResponseEventMessageUpdatedProperties) UnmarshalJSON(data []byte) (err error) {
  331. return apijson.UnmarshalRoot(data, r)
  332. }
  333. func (r eventListResponseEventMessageUpdatedPropertiesJSON) RawJSON() string {
  334. return r.raw
  335. }
  336. type EventListResponseEventMessageUpdatedType string
  337. const (
  338. EventListResponseEventMessageUpdatedTypeMessageUpdated EventListResponseEventMessageUpdatedType = "message.updated"
  339. )
  340. func (r EventListResponseEventMessageUpdatedType) IsKnown() bool {
  341. switch r {
  342. case EventListResponseEventMessageUpdatedTypeMessageUpdated:
  343. return true
  344. }
  345. return false
  346. }
  347. type EventListResponseEventMessageRemoved struct {
  348. Properties EventListResponseEventMessageRemovedProperties `json:"properties,required"`
  349. Type EventListResponseEventMessageRemovedType `json:"type,required"`
  350. JSON eventListResponseEventMessageRemovedJSON `json:"-"`
  351. }
  352. // eventListResponseEventMessageRemovedJSON contains the JSON metadata for the
  353. // struct [EventListResponseEventMessageRemoved]
  354. type eventListResponseEventMessageRemovedJSON struct {
  355. Properties apijson.Field
  356. Type apijson.Field
  357. raw string
  358. ExtraFields map[string]apijson.Field
  359. }
  360. func (r *EventListResponseEventMessageRemoved) UnmarshalJSON(data []byte) (err error) {
  361. return apijson.UnmarshalRoot(data, r)
  362. }
  363. func (r eventListResponseEventMessageRemovedJSON) RawJSON() string {
  364. return r.raw
  365. }
  366. func (r EventListResponseEventMessageRemoved) implementsEventListResponse() {}
  367. type EventListResponseEventMessageRemovedProperties struct {
  368. MessageID string `json:"messageID,required"`
  369. SessionID string `json:"sessionID,required"`
  370. JSON eventListResponseEventMessageRemovedPropertiesJSON `json:"-"`
  371. }
  372. // eventListResponseEventMessageRemovedPropertiesJSON contains the JSON metadata
  373. // for the struct [EventListResponseEventMessageRemovedProperties]
  374. type eventListResponseEventMessageRemovedPropertiesJSON struct {
  375. MessageID apijson.Field
  376. SessionID apijson.Field
  377. raw string
  378. ExtraFields map[string]apijson.Field
  379. }
  380. func (r *EventListResponseEventMessageRemovedProperties) UnmarshalJSON(data []byte) (err error) {
  381. return apijson.UnmarshalRoot(data, r)
  382. }
  383. func (r eventListResponseEventMessageRemovedPropertiesJSON) RawJSON() string {
  384. return r.raw
  385. }
  386. type EventListResponseEventMessageRemovedType string
  387. const (
  388. EventListResponseEventMessageRemovedTypeMessageRemoved EventListResponseEventMessageRemovedType = "message.removed"
  389. )
  390. func (r EventListResponseEventMessageRemovedType) IsKnown() bool {
  391. switch r {
  392. case EventListResponseEventMessageRemovedTypeMessageRemoved:
  393. return true
  394. }
  395. return false
  396. }
  397. type EventListResponseEventMessagePartUpdated struct {
  398. Properties EventListResponseEventMessagePartUpdatedProperties `json:"properties,required"`
  399. Type EventListResponseEventMessagePartUpdatedType `json:"type,required"`
  400. JSON eventListResponseEventMessagePartUpdatedJSON `json:"-"`
  401. }
  402. // eventListResponseEventMessagePartUpdatedJSON contains the JSON metadata for the
  403. // struct [EventListResponseEventMessagePartUpdated]
  404. type eventListResponseEventMessagePartUpdatedJSON struct {
  405. Properties apijson.Field
  406. Type apijson.Field
  407. raw string
  408. ExtraFields map[string]apijson.Field
  409. }
  410. func (r *EventListResponseEventMessagePartUpdated) UnmarshalJSON(data []byte) (err error) {
  411. return apijson.UnmarshalRoot(data, r)
  412. }
  413. func (r eventListResponseEventMessagePartUpdatedJSON) RawJSON() string {
  414. return r.raw
  415. }
  416. func (r EventListResponseEventMessagePartUpdated) implementsEventListResponse() {}
  417. type EventListResponseEventMessagePartUpdatedProperties struct {
  418. Part Part `json:"part,required"`
  419. JSON eventListResponseEventMessagePartUpdatedPropertiesJSON `json:"-"`
  420. }
  421. // eventListResponseEventMessagePartUpdatedPropertiesJSON contains the JSON
  422. // metadata for the struct [EventListResponseEventMessagePartUpdatedProperties]
  423. type eventListResponseEventMessagePartUpdatedPropertiesJSON struct {
  424. Part apijson.Field
  425. raw string
  426. ExtraFields map[string]apijson.Field
  427. }
  428. func (r *EventListResponseEventMessagePartUpdatedProperties) UnmarshalJSON(data []byte) (err error) {
  429. return apijson.UnmarshalRoot(data, r)
  430. }
  431. func (r eventListResponseEventMessagePartUpdatedPropertiesJSON) RawJSON() string {
  432. return r.raw
  433. }
  434. type EventListResponseEventMessagePartUpdatedType string
  435. const (
  436. EventListResponseEventMessagePartUpdatedTypeMessagePartUpdated EventListResponseEventMessagePartUpdatedType = "message.part.updated"
  437. )
  438. func (r EventListResponseEventMessagePartUpdatedType) IsKnown() bool {
  439. switch r {
  440. case EventListResponseEventMessagePartUpdatedTypeMessagePartUpdated:
  441. return true
  442. }
  443. return false
  444. }
  445. type EventListResponseEventMessagePartRemoved struct {
  446. Properties EventListResponseEventMessagePartRemovedProperties `json:"properties,required"`
  447. Type EventListResponseEventMessagePartRemovedType `json:"type,required"`
  448. JSON eventListResponseEventMessagePartRemovedJSON `json:"-"`
  449. }
  450. // eventListResponseEventMessagePartRemovedJSON contains the JSON metadata for the
  451. // struct [EventListResponseEventMessagePartRemoved]
  452. type eventListResponseEventMessagePartRemovedJSON struct {
  453. Properties apijson.Field
  454. Type apijson.Field
  455. raw string
  456. ExtraFields map[string]apijson.Field
  457. }
  458. func (r *EventListResponseEventMessagePartRemoved) UnmarshalJSON(data []byte) (err error) {
  459. return apijson.UnmarshalRoot(data, r)
  460. }
  461. func (r eventListResponseEventMessagePartRemovedJSON) RawJSON() string {
  462. return r.raw
  463. }
  464. func (r EventListResponseEventMessagePartRemoved) implementsEventListResponse() {}
  465. type EventListResponseEventMessagePartRemovedProperties struct {
  466. MessageID string `json:"messageID,required"`
  467. PartID string `json:"partID,required"`
  468. SessionID string `json:"sessionID,required"`
  469. JSON eventListResponseEventMessagePartRemovedPropertiesJSON `json:"-"`
  470. }
  471. // eventListResponseEventMessagePartRemovedPropertiesJSON contains the JSON
  472. // metadata for the struct [EventListResponseEventMessagePartRemovedProperties]
  473. type eventListResponseEventMessagePartRemovedPropertiesJSON struct {
  474. MessageID apijson.Field
  475. PartID apijson.Field
  476. SessionID apijson.Field
  477. raw string
  478. ExtraFields map[string]apijson.Field
  479. }
  480. func (r *EventListResponseEventMessagePartRemovedProperties) UnmarshalJSON(data []byte) (err error) {
  481. return apijson.UnmarshalRoot(data, r)
  482. }
  483. func (r eventListResponseEventMessagePartRemovedPropertiesJSON) RawJSON() string {
  484. return r.raw
  485. }
  486. type EventListResponseEventMessagePartRemovedType string
  487. const (
  488. EventListResponseEventMessagePartRemovedTypeMessagePartRemoved EventListResponseEventMessagePartRemovedType = "message.part.removed"
  489. )
  490. func (r EventListResponseEventMessagePartRemovedType) IsKnown() bool {
  491. switch r {
  492. case EventListResponseEventMessagePartRemovedTypeMessagePartRemoved:
  493. return true
  494. }
  495. return false
  496. }
  497. type EventListResponseEventSessionCompacted struct {
  498. Properties EventListResponseEventSessionCompactedProperties `json:"properties,required"`
  499. Type EventListResponseEventSessionCompactedType `json:"type,required"`
  500. JSON eventListResponseEventSessionCompactedJSON `json:"-"`
  501. }
  502. // eventListResponseEventSessionCompactedJSON contains the JSON metadata for the
  503. // struct [EventListResponseEventSessionCompacted]
  504. type eventListResponseEventSessionCompactedJSON struct {
  505. Properties apijson.Field
  506. Type apijson.Field
  507. raw string
  508. ExtraFields map[string]apijson.Field
  509. }
  510. func (r *EventListResponseEventSessionCompacted) UnmarshalJSON(data []byte) (err error) {
  511. return apijson.UnmarshalRoot(data, r)
  512. }
  513. func (r eventListResponseEventSessionCompactedJSON) RawJSON() string {
  514. return r.raw
  515. }
  516. func (r EventListResponseEventSessionCompacted) implementsEventListResponse() {}
  517. type EventListResponseEventSessionCompactedProperties struct {
  518. SessionID string `json:"sessionID,required"`
  519. JSON eventListResponseEventSessionCompactedPropertiesJSON `json:"-"`
  520. }
  521. // eventListResponseEventSessionCompactedPropertiesJSON contains the JSON metadata
  522. // for the struct [EventListResponseEventSessionCompactedProperties]
  523. type eventListResponseEventSessionCompactedPropertiesJSON struct {
  524. SessionID apijson.Field
  525. raw string
  526. ExtraFields map[string]apijson.Field
  527. }
  528. func (r *EventListResponseEventSessionCompactedProperties) UnmarshalJSON(data []byte) (err error) {
  529. return apijson.UnmarshalRoot(data, r)
  530. }
  531. func (r eventListResponseEventSessionCompactedPropertiesJSON) RawJSON() string {
  532. return r.raw
  533. }
  534. type EventListResponseEventSessionCompactedType string
  535. const (
  536. EventListResponseEventSessionCompactedTypeSessionCompacted EventListResponseEventSessionCompactedType = "session.compacted"
  537. )
  538. func (r EventListResponseEventSessionCompactedType) IsKnown() bool {
  539. switch r {
  540. case EventListResponseEventSessionCompactedTypeSessionCompacted:
  541. return true
  542. }
  543. return false
  544. }
  545. type EventListResponseEventPermissionUpdated struct {
  546. Properties Permission `json:"properties,required"`
  547. Type EventListResponseEventPermissionUpdatedType `json:"type,required"`
  548. JSON eventListResponseEventPermissionUpdatedJSON `json:"-"`
  549. }
  550. // eventListResponseEventPermissionUpdatedJSON contains the JSON metadata for the
  551. // struct [EventListResponseEventPermissionUpdated]
  552. type eventListResponseEventPermissionUpdatedJSON struct {
  553. Properties apijson.Field
  554. Type apijson.Field
  555. raw string
  556. ExtraFields map[string]apijson.Field
  557. }
  558. func (r *EventListResponseEventPermissionUpdated) UnmarshalJSON(data []byte) (err error) {
  559. return apijson.UnmarshalRoot(data, r)
  560. }
  561. func (r eventListResponseEventPermissionUpdatedJSON) RawJSON() string {
  562. return r.raw
  563. }
  564. func (r EventListResponseEventPermissionUpdated) implementsEventListResponse() {}
  565. type EventListResponseEventPermissionUpdatedType string
  566. const (
  567. EventListResponseEventPermissionUpdatedTypePermissionUpdated EventListResponseEventPermissionUpdatedType = "permission.updated"
  568. )
  569. func (r EventListResponseEventPermissionUpdatedType) IsKnown() bool {
  570. switch r {
  571. case EventListResponseEventPermissionUpdatedTypePermissionUpdated:
  572. return true
  573. }
  574. return false
  575. }
  576. type EventListResponseEventPermissionReplied struct {
  577. Properties EventListResponseEventPermissionRepliedProperties `json:"properties,required"`
  578. Type EventListResponseEventPermissionRepliedType `json:"type,required"`
  579. JSON eventListResponseEventPermissionRepliedJSON `json:"-"`
  580. }
  581. // eventListResponseEventPermissionRepliedJSON contains the JSON metadata for the
  582. // struct [EventListResponseEventPermissionReplied]
  583. type eventListResponseEventPermissionRepliedJSON struct {
  584. Properties apijson.Field
  585. Type apijson.Field
  586. raw string
  587. ExtraFields map[string]apijson.Field
  588. }
  589. func (r *EventListResponseEventPermissionReplied) UnmarshalJSON(data []byte) (err error) {
  590. return apijson.UnmarshalRoot(data, r)
  591. }
  592. func (r eventListResponseEventPermissionRepliedJSON) RawJSON() string {
  593. return r.raw
  594. }
  595. func (r EventListResponseEventPermissionReplied) implementsEventListResponse() {}
  596. type EventListResponseEventPermissionRepliedProperties struct {
  597. PermissionID string `json:"permissionID,required"`
  598. Response string `json:"response,required"`
  599. SessionID string `json:"sessionID,required"`
  600. JSON eventListResponseEventPermissionRepliedPropertiesJSON `json:"-"`
  601. }
  602. // eventListResponseEventPermissionRepliedPropertiesJSON contains the JSON metadata
  603. // for the struct [EventListResponseEventPermissionRepliedProperties]
  604. type eventListResponseEventPermissionRepliedPropertiesJSON struct {
  605. PermissionID apijson.Field
  606. Response apijson.Field
  607. SessionID apijson.Field
  608. raw string
  609. ExtraFields map[string]apijson.Field
  610. }
  611. func (r *EventListResponseEventPermissionRepliedProperties) UnmarshalJSON(data []byte) (err error) {
  612. return apijson.UnmarshalRoot(data, r)
  613. }
  614. func (r eventListResponseEventPermissionRepliedPropertiesJSON) RawJSON() string {
  615. return r.raw
  616. }
  617. type EventListResponseEventPermissionRepliedType string
  618. const (
  619. EventListResponseEventPermissionRepliedTypePermissionReplied EventListResponseEventPermissionRepliedType = "permission.replied"
  620. )
  621. func (r EventListResponseEventPermissionRepliedType) IsKnown() bool {
  622. switch r {
  623. case EventListResponseEventPermissionRepliedTypePermissionReplied:
  624. return true
  625. }
  626. return false
  627. }
  628. type EventListResponseEventFileEdited struct {
  629. Properties EventListResponseEventFileEditedProperties `json:"properties,required"`
  630. Type EventListResponseEventFileEditedType `json:"type,required"`
  631. JSON eventListResponseEventFileEditedJSON `json:"-"`
  632. }
  633. // eventListResponseEventFileEditedJSON contains the JSON metadata for the struct
  634. // [EventListResponseEventFileEdited]
  635. type eventListResponseEventFileEditedJSON struct {
  636. Properties apijson.Field
  637. Type apijson.Field
  638. raw string
  639. ExtraFields map[string]apijson.Field
  640. }
  641. func (r *EventListResponseEventFileEdited) UnmarshalJSON(data []byte) (err error) {
  642. return apijson.UnmarshalRoot(data, r)
  643. }
  644. func (r eventListResponseEventFileEditedJSON) RawJSON() string {
  645. return r.raw
  646. }
  647. func (r EventListResponseEventFileEdited) implementsEventListResponse() {}
  648. type EventListResponseEventFileEditedProperties struct {
  649. File string `json:"file,required"`
  650. JSON eventListResponseEventFileEditedPropertiesJSON `json:"-"`
  651. }
  652. // eventListResponseEventFileEditedPropertiesJSON contains the JSON metadata for
  653. // the struct [EventListResponseEventFileEditedProperties]
  654. type eventListResponseEventFileEditedPropertiesJSON struct {
  655. File apijson.Field
  656. raw string
  657. ExtraFields map[string]apijson.Field
  658. }
  659. func (r *EventListResponseEventFileEditedProperties) UnmarshalJSON(data []byte) (err error) {
  660. return apijson.UnmarshalRoot(data, r)
  661. }
  662. func (r eventListResponseEventFileEditedPropertiesJSON) RawJSON() string {
  663. return r.raw
  664. }
  665. type EventListResponseEventFileEditedType string
  666. const (
  667. EventListResponseEventFileEditedTypeFileEdited EventListResponseEventFileEditedType = "file.edited"
  668. )
  669. func (r EventListResponseEventFileEditedType) IsKnown() bool {
  670. switch r {
  671. case EventListResponseEventFileEditedTypeFileEdited:
  672. return true
  673. }
  674. return false
  675. }
  676. type EventListResponseEventFileWatcherUpdated struct {
  677. Properties EventListResponseEventFileWatcherUpdatedProperties `json:"properties,required"`
  678. Type EventListResponseEventFileWatcherUpdatedType `json:"type,required"`
  679. JSON eventListResponseEventFileWatcherUpdatedJSON `json:"-"`
  680. }
  681. // eventListResponseEventFileWatcherUpdatedJSON contains the JSON metadata for the
  682. // struct [EventListResponseEventFileWatcherUpdated]
  683. type eventListResponseEventFileWatcherUpdatedJSON struct {
  684. Properties apijson.Field
  685. Type apijson.Field
  686. raw string
  687. ExtraFields map[string]apijson.Field
  688. }
  689. func (r *EventListResponseEventFileWatcherUpdated) UnmarshalJSON(data []byte) (err error) {
  690. return apijson.UnmarshalRoot(data, r)
  691. }
  692. func (r eventListResponseEventFileWatcherUpdatedJSON) RawJSON() string {
  693. return r.raw
  694. }
  695. func (r EventListResponseEventFileWatcherUpdated) implementsEventListResponse() {}
  696. type EventListResponseEventFileWatcherUpdatedProperties struct {
  697. Event EventListResponseEventFileWatcherUpdatedPropertiesEvent `json:"event,required"`
  698. File string `json:"file,required"`
  699. JSON eventListResponseEventFileWatcherUpdatedPropertiesJSON `json:"-"`
  700. }
  701. // eventListResponseEventFileWatcherUpdatedPropertiesJSON contains the JSON
  702. // metadata for the struct [EventListResponseEventFileWatcherUpdatedProperties]
  703. type eventListResponseEventFileWatcherUpdatedPropertiesJSON struct {
  704. Event apijson.Field
  705. File apijson.Field
  706. raw string
  707. ExtraFields map[string]apijson.Field
  708. }
  709. func (r *EventListResponseEventFileWatcherUpdatedProperties) UnmarshalJSON(data []byte) (err error) {
  710. return apijson.UnmarshalRoot(data, r)
  711. }
  712. func (r eventListResponseEventFileWatcherUpdatedPropertiesJSON) RawJSON() string {
  713. return r.raw
  714. }
  715. type EventListResponseEventFileWatcherUpdatedPropertiesEvent string
  716. const (
  717. EventListResponseEventFileWatcherUpdatedPropertiesEventAdd EventListResponseEventFileWatcherUpdatedPropertiesEvent = "add"
  718. EventListResponseEventFileWatcherUpdatedPropertiesEventChange EventListResponseEventFileWatcherUpdatedPropertiesEvent = "change"
  719. EventListResponseEventFileWatcherUpdatedPropertiesEventUnlink EventListResponseEventFileWatcherUpdatedPropertiesEvent = "unlink"
  720. )
  721. func (r EventListResponseEventFileWatcherUpdatedPropertiesEvent) IsKnown() bool {
  722. switch r {
  723. case EventListResponseEventFileWatcherUpdatedPropertiesEventAdd, EventListResponseEventFileWatcherUpdatedPropertiesEventChange, EventListResponseEventFileWatcherUpdatedPropertiesEventUnlink:
  724. return true
  725. }
  726. return false
  727. }
  728. type EventListResponseEventFileWatcherUpdatedType string
  729. const (
  730. EventListResponseEventFileWatcherUpdatedTypeFileWatcherUpdated EventListResponseEventFileWatcherUpdatedType = "file.watcher.updated"
  731. )
  732. func (r EventListResponseEventFileWatcherUpdatedType) IsKnown() bool {
  733. switch r {
  734. case EventListResponseEventFileWatcherUpdatedTypeFileWatcherUpdated:
  735. return true
  736. }
  737. return false
  738. }
  739. type EventListResponseEventTodoUpdated struct {
  740. Properties EventListResponseEventTodoUpdatedProperties `json:"properties,required"`
  741. Type EventListResponseEventTodoUpdatedType `json:"type,required"`
  742. JSON eventListResponseEventTodoUpdatedJSON `json:"-"`
  743. }
  744. // eventListResponseEventTodoUpdatedJSON contains the JSON metadata for the struct
  745. // [EventListResponseEventTodoUpdated]
  746. type eventListResponseEventTodoUpdatedJSON struct {
  747. Properties apijson.Field
  748. Type apijson.Field
  749. raw string
  750. ExtraFields map[string]apijson.Field
  751. }
  752. func (r *EventListResponseEventTodoUpdated) UnmarshalJSON(data []byte) (err error) {
  753. return apijson.UnmarshalRoot(data, r)
  754. }
  755. func (r eventListResponseEventTodoUpdatedJSON) RawJSON() string {
  756. return r.raw
  757. }
  758. func (r EventListResponseEventTodoUpdated) implementsEventListResponse() {}
  759. type EventListResponseEventTodoUpdatedProperties struct {
  760. SessionID string `json:"sessionID,required"`
  761. Todos []EventListResponseEventTodoUpdatedPropertiesTodo `json:"todos,required"`
  762. JSON eventListResponseEventTodoUpdatedPropertiesJSON `json:"-"`
  763. }
  764. // eventListResponseEventTodoUpdatedPropertiesJSON contains the JSON metadata for
  765. // the struct [EventListResponseEventTodoUpdatedProperties]
  766. type eventListResponseEventTodoUpdatedPropertiesJSON struct {
  767. SessionID apijson.Field
  768. Todos apijson.Field
  769. raw string
  770. ExtraFields map[string]apijson.Field
  771. }
  772. func (r *EventListResponseEventTodoUpdatedProperties) UnmarshalJSON(data []byte) (err error) {
  773. return apijson.UnmarshalRoot(data, r)
  774. }
  775. func (r eventListResponseEventTodoUpdatedPropertiesJSON) RawJSON() string {
  776. return r.raw
  777. }
  778. type EventListResponseEventTodoUpdatedPropertiesTodo struct {
  779. // Unique identifier for the todo item
  780. ID string `json:"id,required"`
  781. // Brief description of the task
  782. Content string `json:"content,required"`
  783. // Priority level of the task: high, medium, low
  784. Priority string `json:"priority,required"`
  785. // Current status of the task: pending, in_progress, completed, cancelled
  786. Status string `json:"status,required"`
  787. JSON eventListResponseEventTodoUpdatedPropertiesTodoJSON `json:"-"`
  788. }
  789. // eventListResponseEventTodoUpdatedPropertiesTodoJSON contains the JSON metadata
  790. // for the struct [EventListResponseEventTodoUpdatedPropertiesTodo]
  791. type eventListResponseEventTodoUpdatedPropertiesTodoJSON struct {
  792. ID apijson.Field
  793. Content apijson.Field
  794. Priority apijson.Field
  795. Status apijson.Field
  796. raw string
  797. ExtraFields map[string]apijson.Field
  798. }
  799. func (r *EventListResponseEventTodoUpdatedPropertiesTodo) UnmarshalJSON(data []byte) (err error) {
  800. return apijson.UnmarshalRoot(data, r)
  801. }
  802. func (r eventListResponseEventTodoUpdatedPropertiesTodoJSON) RawJSON() string {
  803. return r.raw
  804. }
  805. type EventListResponseEventTodoUpdatedType string
  806. const (
  807. EventListResponseEventTodoUpdatedTypeTodoUpdated EventListResponseEventTodoUpdatedType = "todo.updated"
  808. )
  809. func (r EventListResponseEventTodoUpdatedType) IsKnown() bool {
  810. switch r {
  811. case EventListResponseEventTodoUpdatedTypeTodoUpdated:
  812. return true
  813. }
  814. return false
  815. }
  816. type EventListResponseEventSessionIdle struct {
  817. Properties EventListResponseEventSessionIdleProperties `json:"properties,required"`
  818. Type EventListResponseEventSessionIdleType `json:"type,required"`
  819. JSON eventListResponseEventSessionIdleJSON `json:"-"`
  820. }
  821. // eventListResponseEventSessionIdleJSON contains the JSON metadata for the struct
  822. // [EventListResponseEventSessionIdle]
  823. type eventListResponseEventSessionIdleJSON struct {
  824. Properties apijson.Field
  825. Type apijson.Field
  826. raw string
  827. ExtraFields map[string]apijson.Field
  828. }
  829. func (r *EventListResponseEventSessionIdle) UnmarshalJSON(data []byte) (err error) {
  830. return apijson.UnmarshalRoot(data, r)
  831. }
  832. func (r eventListResponseEventSessionIdleJSON) RawJSON() string {
  833. return r.raw
  834. }
  835. func (r EventListResponseEventSessionIdle) implementsEventListResponse() {}
  836. type EventListResponseEventSessionIdleProperties struct {
  837. SessionID string `json:"sessionID,required"`
  838. JSON eventListResponseEventSessionIdlePropertiesJSON `json:"-"`
  839. }
  840. // eventListResponseEventSessionIdlePropertiesJSON contains the JSON metadata for
  841. // the struct [EventListResponseEventSessionIdleProperties]
  842. type eventListResponseEventSessionIdlePropertiesJSON struct {
  843. SessionID apijson.Field
  844. raw string
  845. ExtraFields map[string]apijson.Field
  846. }
  847. func (r *EventListResponseEventSessionIdleProperties) UnmarshalJSON(data []byte) (err error) {
  848. return apijson.UnmarshalRoot(data, r)
  849. }
  850. func (r eventListResponseEventSessionIdlePropertiesJSON) RawJSON() string {
  851. return r.raw
  852. }
  853. type EventListResponseEventSessionIdleType string
  854. const (
  855. EventListResponseEventSessionIdleTypeSessionIdle EventListResponseEventSessionIdleType = "session.idle"
  856. )
  857. func (r EventListResponseEventSessionIdleType) IsKnown() bool {
  858. switch r {
  859. case EventListResponseEventSessionIdleTypeSessionIdle:
  860. return true
  861. }
  862. return false
  863. }
  864. type EventListResponseEventSessionUpdated struct {
  865. Properties EventListResponseEventSessionUpdatedProperties `json:"properties,required"`
  866. Type EventListResponseEventSessionUpdatedType `json:"type,required"`
  867. JSON eventListResponseEventSessionUpdatedJSON `json:"-"`
  868. }
  869. // eventListResponseEventSessionUpdatedJSON contains the JSON metadata for the
  870. // struct [EventListResponseEventSessionUpdated]
  871. type eventListResponseEventSessionUpdatedJSON struct {
  872. Properties apijson.Field
  873. Type apijson.Field
  874. raw string
  875. ExtraFields map[string]apijson.Field
  876. }
  877. func (r *EventListResponseEventSessionUpdated) UnmarshalJSON(data []byte) (err error) {
  878. return apijson.UnmarshalRoot(data, r)
  879. }
  880. func (r eventListResponseEventSessionUpdatedJSON) RawJSON() string {
  881. return r.raw
  882. }
  883. func (r EventListResponseEventSessionUpdated) implementsEventListResponse() {}
  884. type EventListResponseEventSessionUpdatedProperties struct {
  885. Info Session `json:"info,required"`
  886. JSON eventListResponseEventSessionUpdatedPropertiesJSON `json:"-"`
  887. }
  888. // eventListResponseEventSessionUpdatedPropertiesJSON contains the JSON metadata
  889. // for the struct [EventListResponseEventSessionUpdatedProperties]
  890. type eventListResponseEventSessionUpdatedPropertiesJSON struct {
  891. Info apijson.Field
  892. raw string
  893. ExtraFields map[string]apijson.Field
  894. }
  895. func (r *EventListResponseEventSessionUpdatedProperties) UnmarshalJSON(data []byte) (err error) {
  896. return apijson.UnmarshalRoot(data, r)
  897. }
  898. func (r eventListResponseEventSessionUpdatedPropertiesJSON) RawJSON() string {
  899. return r.raw
  900. }
  901. type EventListResponseEventSessionUpdatedType string
  902. const (
  903. EventListResponseEventSessionUpdatedTypeSessionUpdated EventListResponseEventSessionUpdatedType = "session.updated"
  904. )
  905. func (r EventListResponseEventSessionUpdatedType) IsKnown() bool {
  906. switch r {
  907. case EventListResponseEventSessionUpdatedTypeSessionUpdated:
  908. return true
  909. }
  910. return false
  911. }
  912. type EventListResponseEventSessionDeleted struct {
  913. Properties EventListResponseEventSessionDeletedProperties `json:"properties,required"`
  914. Type EventListResponseEventSessionDeletedType `json:"type,required"`
  915. JSON eventListResponseEventSessionDeletedJSON `json:"-"`
  916. }
  917. // eventListResponseEventSessionDeletedJSON contains the JSON metadata for the
  918. // struct [EventListResponseEventSessionDeleted]
  919. type eventListResponseEventSessionDeletedJSON struct {
  920. Properties apijson.Field
  921. Type apijson.Field
  922. raw string
  923. ExtraFields map[string]apijson.Field
  924. }
  925. func (r *EventListResponseEventSessionDeleted) UnmarshalJSON(data []byte) (err error) {
  926. return apijson.UnmarshalRoot(data, r)
  927. }
  928. func (r eventListResponseEventSessionDeletedJSON) RawJSON() string {
  929. return r.raw
  930. }
  931. func (r EventListResponseEventSessionDeleted) implementsEventListResponse() {}
  932. type EventListResponseEventSessionDeletedProperties struct {
  933. Info Session `json:"info,required"`
  934. JSON eventListResponseEventSessionDeletedPropertiesJSON `json:"-"`
  935. }
  936. // eventListResponseEventSessionDeletedPropertiesJSON contains the JSON metadata
  937. // for the struct [EventListResponseEventSessionDeletedProperties]
  938. type eventListResponseEventSessionDeletedPropertiesJSON struct {
  939. Info apijson.Field
  940. raw string
  941. ExtraFields map[string]apijson.Field
  942. }
  943. func (r *EventListResponseEventSessionDeletedProperties) UnmarshalJSON(data []byte) (err error) {
  944. return apijson.UnmarshalRoot(data, r)
  945. }
  946. func (r eventListResponseEventSessionDeletedPropertiesJSON) RawJSON() string {
  947. return r.raw
  948. }
  949. type EventListResponseEventSessionDeletedType string
  950. const (
  951. EventListResponseEventSessionDeletedTypeSessionDeleted EventListResponseEventSessionDeletedType = "session.deleted"
  952. )
  953. func (r EventListResponseEventSessionDeletedType) IsKnown() bool {
  954. switch r {
  955. case EventListResponseEventSessionDeletedTypeSessionDeleted:
  956. return true
  957. }
  958. return false
  959. }
  960. type EventListResponseEventSessionError struct {
  961. Properties EventListResponseEventSessionErrorProperties `json:"properties,required"`
  962. Type EventListResponseEventSessionErrorType `json:"type,required"`
  963. JSON eventListResponseEventSessionErrorJSON `json:"-"`
  964. }
  965. // eventListResponseEventSessionErrorJSON contains the JSON metadata for the struct
  966. // [EventListResponseEventSessionError]
  967. type eventListResponseEventSessionErrorJSON struct {
  968. Properties apijson.Field
  969. Type apijson.Field
  970. raw string
  971. ExtraFields map[string]apijson.Field
  972. }
  973. func (r *EventListResponseEventSessionError) UnmarshalJSON(data []byte) (err error) {
  974. return apijson.UnmarshalRoot(data, r)
  975. }
  976. func (r eventListResponseEventSessionErrorJSON) RawJSON() string {
  977. return r.raw
  978. }
  979. func (r EventListResponseEventSessionError) implementsEventListResponse() {}
  980. type EventListResponseEventSessionErrorProperties struct {
  981. Error EventListResponseEventSessionErrorPropertiesError `json:"error"`
  982. SessionID string `json:"sessionID"`
  983. JSON eventListResponseEventSessionErrorPropertiesJSON `json:"-"`
  984. }
  985. // eventListResponseEventSessionErrorPropertiesJSON contains the JSON metadata for
  986. // the struct [EventListResponseEventSessionErrorProperties]
  987. type eventListResponseEventSessionErrorPropertiesJSON struct {
  988. Error apijson.Field
  989. SessionID apijson.Field
  990. raw string
  991. ExtraFields map[string]apijson.Field
  992. }
  993. func (r *EventListResponseEventSessionErrorProperties) UnmarshalJSON(data []byte) (err error) {
  994. return apijson.UnmarshalRoot(data, r)
  995. }
  996. func (r eventListResponseEventSessionErrorPropertiesJSON) RawJSON() string {
  997. return r.raw
  998. }
  999. type EventListResponseEventSessionErrorPropertiesError struct {
  1000. // This field can have the runtime type of [shared.ProviderAuthErrorData],
  1001. // [shared.UnknownErrorData], [interface{}], [shared.MessageAbortedErrorData].
  1002. Data interface{} `json:"data,required"`
  1003. Name EventListResponseEventSessionErrorPropertiesErrorName `json:"name,required"`
  1004. JSON eventListResponseEventSessionErrorPropertiesErrorJSON `json:"-"`
  1005. union EventListResponseEventSessionErrorPropertiesErrorUnion
  1006. }
  1007. // eventListResponseEventSessionErrorPropertiesErrorJSON contains the JSON metadata
  1008. // for the struct [EventListResponseEventSessionErrorPropertiesError]
  1009. type eventListResponseEventSessionErrorPropertiesErrorJSON struct {
  1010. Data apijson.Field
  1011. Name apijson.Field
  1012. raw string
  1013. ExtraFields map[string]apijson.Field
  1014. }
  1015. func (r eventListResponseEventSessionErrorPropertiesErrorJSON) RawJSON() string {
  1016. return r.raw
  1017. }
  1018. func (r *EventListResponseEventSessionErrorPropertiesError) UnmarshalJSON(data []byte) (err error) {
  1019. *r = EventListResponseEventSessionErrorPropertiesError{}
  1020. err = apijson.UnmarshalRoot(data, &r.union)
  1021. if err != nil {
  1022. return err
  1023. }
  1024. return apijson.Port(r.union, &r)
  1025. }
  1026. // AsUnion returns a [EventListResponseEventSessionErrorPropertiesErrorUnion]
  1027. // interface which you can cast to the specific types for more type safety.
  1028. //
  1029. // Possible runtime types of the union are [shared.ProviderAuthError],
  1030. // [shared.UnknownError],
  1031. // [EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError],
  1032. // [shared.MessageAbortedError].
  1033. func (r EventListResponseEventSessionErrorPropertiesError) AsUnion() EventListResponseEventSessionErrorPropertiesErrorUnion {
  1034. return r.union
  1035. }
  1036. // Union satisfied by [shared.ProviderAuthError], [shared.UnknownError],
  1037. // [EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError] or
  1038. // [shared.MessageAbortedError].
  1039. type EventListResponseEventSessionErrorPropertiesErrorUnion interface {
  1040. ImplementsEventListResponseEventSessionErrorPropertiesError()
  1041. }
  1042. func init() {
  1043. apijson.RegisterUnion(
  1044. reflect.TypeOf((*EventListResponseEventSessionErrorPropertiesErrorUnion)(nil)).Elem(),
  1045. "",
  1046. apijson.UnionVariant{
  1047. TypeFilter: gjson.JSON,
  1048. Type: reflect.TypeOf(shared.ProviderAuthError{}),
  1049. },
  1050. apijson.UnionVariant{
  1051. TypeFilter: gjson.JSON,
  1052. Type: reflect.TypeOf(shared.UnknownError{}),
  1053. },
  1054. apijson.UnionVariant{
  1055. TypeFilter: gjson.JSON,
  1056. Type: reflect.TypeOf(EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError{}),
  1057. },
  1058. apijson.UnionVariant{
  1059. TypeFilter: gjson.JSON,
  1060. Type: reflect.TypeOf(shared.MessageAbortedError{}),
  1061. },
  1062. )
  1063. }
  1064. type EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError struct {
  1065. Data interface{} `json:"data,required"`
  1066. Name EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName `json:"name,required"`
  1067. JSON eventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorJSON `json:"-"`
  1068. }
  1069. // eventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorJSON
  1070. // contains the JSON metadata for the struct
  1071. // [EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError]
  1072. type eventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorJSON struct {
  1073. Data apijson.Field
  1074. Name apijson.Field
  1075. raw string
  1076. ExtraFields map[string]apijson.Field
  1077. }
  1078. func (r *EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError) UnmarshalJSON(data []byte) (err error) {
  1079. return apijson.UnmarshalRoot(data, r)
  1080. }
  1081. func (r eventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorJSON) RawJSON() string {
  1082. return r.raw
  1083. }
  1084. func (r EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError) ImplementsEventListResponseEventSessionErrorPropertiesError() {
  1085. }
  1086. type EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName string
  1087. const (
  1088. EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorNameMessageOutputLengthError EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName = "MessageOutputLengthError"
  1089. )
  1090. func (r EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName) IsKnown() bool {
  1091. switch r {
  1092. case EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorNameMessageOutputLengthError:
  1093. return true
  1094. }
  1095. return false
  1096. }
  1097. type EventListResponseEventSessionErrorPropertiesErrorName string
  1098. const (
  1099. EventListResponseEventSessionErrorPropertiesErrorNameProviderAuthError EventListResponseEventSessionErrorPropertiesErrorName = "ProviderAuthError"
  1100. EventListResponseEventSessionErrorPropertiesErrorNameUnknownError EventListResponseEventSessionErrorPropertiesErrorName = "UnknownError"
  1101. EventListResponseEventSessionErrorPropertiesErrorNameMessageOutputLengthError EventListResponseEventSessionErrorPropertiesErrorName = "MessageOutputLengthError"
  1102. EventListResponseEventSessionErrorPropertiesErrorNameMessageAbortedError EventListResponseEventSessionErrorPropertiesErrorName = "MessageAbortedError"
  1103. )
  1104. func (r EventListResponseEventSessionErrorPropertiesErrorName) IsKnown() bool {
  1105. switch r {
  1106. case EventListResponseEventSessionErrorPropertiesErrorNameProviderAuthError, EventListResponseEventSessionErrorPropertiesErrorNameUnknownError, EventListResponseEventSessionErrorPropertiesErrorNameMessageOutputLengthError, EventListResponseEventSessionErrorPropertiesErrorNameMessageAbortedError:
  1107. return true
  1108. }
  1109. return false
  1110. }
  1111. type EventListResponseEventSessionErrorType string
  1112. const (
  1113. EventListResponseEventSessionErrorTypeSessionError EventListResponseEventSessionErrorType = "session.error"
  1114. )
  1115. func (r EventListResponseEventSessionErrorType) IsKnown() bool {
  1116. switch r {
  1117. case EventListResponseEventSessionErrorTypeSessionError:
  1118. return true
  1119. }
  1120. return false
  1121. }
  1122. type EventListResponseEventServerConnected struct {
  1123. Properties interface{} `json:"properties,required"`
  1124. Type EventListResponseEventServerConnectedType `json:"type,required"`
  1125. JSON eventListResponseEventServerConnectedJSON `json:"-"`
  1126. }
  1127. // eventListResponseEventServerConnectedJSON contains the JSON metadata for the
  1128. // struct [EventListResponseEventServerConnected]
  1129. type eventListResponseEventServerConnectedJSON struct {
  1130. Properties apijson.Field
  1131. Type apijson.Field
  1132. raw string
  1133. ExtraFields map[string]apijson.Field
  1134. }
  1135. func (r *EventListResponseEventServerConnected) UnmarshalJSON(data []byte) (err error) {
  1136. return apijson.UnmarshalRoot(data, r)
  1137. }
  1138. func (r eventListResponseEventServerConnectedJSON) RawJSON() string {
  1139. return r.raw
  1140. }
  1141. func (r EventListResponseEventServerConnected) implementsEventListResponse() {}
  1142. type EventListResponseEventServerConnectedType string
  1143. const (
  1144. EventListResponseEventServerConnectedTypeServerConnected EventListResponseEventServerConnectedType = "server.connected"
  1145. )
  1146. func (r EventListResponseEventServerConnectedType) IsKnown() bool {
  1147. switch r {
  1148. case EventListResponseEventServerConnectedTypeServerConnected:
  1149. return true
  1150. }
  1151. return false
  1152. }
  1153. type EventListResponseEventIdeInstalled struct {
  1154. Properties EventListResponseEventIdeInstalledProperties `json:"properties,required"`
  1155. Type EventListResponseEventIdeInstalledType `json:"type,required"`
  1156. JSON eventListResponseEventIdeInstalledJSON `json:"-"`
  1157. }
  1158. // eventListResponseEventIdeInstalledJSON contains the JSON metadata for the struct
  1159. // [EventListResponseEventIdeInstalled]
  1160. type eventListResponseEventIdeInstalledJSON struct {
  1161. Properties apijson.Field
  1162. Type apijson.Field
  1163. raw string
  1164. ExtraFields map[string]apijson.Field
  1165. }
  1166. func (r *EventListResponseEventIdeInstalled) UnmarshalJSON(data []byte) (err error) {
  1167. return apijson.UnmarshalRoot(data, r)
  1168. }
  1169. func (r eventListResponseEventIdeInstalledJSON) RawJSON() string {
  1170. return r.raw
  1171. }
  1172. func (r EventListResponseEventIdeInstalled) implementsEventListResponse() {}
  1173. type EventListResponseEventIdeInstalledProperties struct {
  1174. Ide string `json:"ide,required"`
  1175. JSON eventListResponseEventIdeInstalledPropertiesJSON `json:"-"`
  1176. }
  1177. // eventListResponseEventIdeInstalledPropertiesJSON contains the JSON metadata for
  1178. // the struct [EventListResponseEventIdeInstalledProperties]
  1179. type eventListResponseEventIdeInstalledPropertiesJSON struct {
  1180. Ide apijson.Field
  1181. raw string
  1182. ExtraFields map[string]apijson.Field
  1183. }
  1184. func (r *EventListResponseEventIdeInstalledProperties) UnmarshalJSON(data []byte) (err error) {
  1185. return apijson.UnmarshalRoot(data, r)
  1186. }
  1187. func (r eventListResponseEventIdeInstalledPropertiesJSON) RawJSON() string {
  1188. return r.raw
  1189. }
  1190. type EventListResponseEventIdeInstalledType string
  1191. const (
  1192. EventListResponseEventIdeInstalledTypeIdeInstalled EventListResponseEventIdeInstalledType = "ide.installed"
  1193. )
  1194. func (r EventListResponseEventIdeInstalledType) IsKnown() bool {
  1195. switch r {
  1196. case EventListResponseEventIdeInstalledTypeIdeInstalled:
  1197. return true
  1198. }
  1199. return false
  1200. }
  1201. type EventListResponseType string
  1202. const (
  1203. EventListResponseTypeInstallationUpdated EventListResponseType = "installation.updated"
  1204. EventListResponseTypeLspClientDiagnostics EventListResponseType = "lsp.client.diagnostics"
  1205. EventListResponseTypeMessageUpdated EventListResponseType = "message.updated"
  1206. EventListResponseTypeMessageRemoved EventListResponseType = "message.removed"
  1207. EventListResponseTypeMessagePartUpdated EventListResponseType = "message.part.updated"
  1208. EventListResponseTypeMessagePartRemoved EventListResponseType = "message.part.removed"
  1209. EventListResponseTypeSessionCompacted EventListResponseType = "session.compacted"
  1210. EventListResponseTypePermissionUpdated EventListResponseType = "permission.updated"
  1211. EventListResponseTypePermissionReplied EventListResponseType = "permission.replied"
  1212. EventListResponseTypeFileEdited EventListResponseType = "file.edited"
  1213. EventListResponseTypeFileWatcherUpdated EventListResponseType = "file.watcher.updated"
  1214. EventListResponseTypeTodoUpdated EventListResponseType = "todo.updated"
  1215. EventListResponseTypeSessionIdle EventListResponseType = "session.idle"
  1216. EventListResponseTypeSessionUpdated EventListResponseType = "session.updated"
  1217. EventListResponseTypeSessionDeleted EventListResponseType = "session.deleted"
  1218. EventListResponseTypeSessionError EventListResponseType = "session.error"
  1219. EventListResponseTypeServerConnected EventListResponseType = "server.connected"
  1220. EventListResponseTypeIdeInstalled EventListResponseType = "ide.installed"
  1221. )
  1222. func (r EventListResponseType) IsKnown() bool {
  1223. switch r {
  1224. case EventListResponseTypeInstallationUpdated, EventListResponseTypeLspClientDiagnostics, EventListResponseTypeMessageUpdated, EventListResponseTypeMessageRemoved, EventListResponseTypeMessagePartUpdated, EventListResponseTypeMessagePartRemoved, EventListResponseTypeSessionCompacted, EventListResponseTypePermissionUpdated, EventListResponseTypePermissionReplied, EventListResponseTypeFileEdited, EventListResponseTypeFileWatcherUpdated, EventListResponseTypeTodoUpdated, EventListResponseTypeSessionIdle, EventListResponseTypeSessionUpdated, EventListResponseTypeSessionDeleted, EventListResponseTypeSessionError, EventListResponseTypeServerConnected, EventListResponseTypeIdeInstalled:
  1225. return true
  1226. }
  1227. return false
  1228. }
  1229. type EventListParams struct {
  1230. Directory param.Field[string] `query:"directory"`
  1231. }
  1232. // URLQuery serializes [EventListParams]'s query parameters as `url.Values`.
  1233. func (r EventListParams) URLQuery() (v url.Values) {
  1234. return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
  1235. ArrayFormat: apiquery.ArrayQueryFormatComma,
  1236. NestedFormat: apiquery.NestedQueryFormatBrackets,
  1237. })
  1238. }