event.go 42 KB

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