event.go 44 KB

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