event.go 47 KB

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