event.go 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190
  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. MessageID string `json:"messageID,required"`
  519. Part AssistantMessagePart `json:"part,required"`
  520. SessionID string `json:"sessionID,required"`
  521. JSON eventListResponseEventMessagePartUpdatedPropertiesJSON `json:"-"`
  522. }
  523. // eventListResponseEventMessagePartUpdatedPropertiesJSON contains the JSON
  524. // metadata for the struct [EventListResponseEventMessagePartUpdatedProperties]
  525. type eventListResponseEventMessagePartUpdatedPropertiesJSON struct {
  526. MessageID apijson.Field
  527. Part apijson.Field
  528. SessionID apijson.Field
  529. raw string
  530. ExtraFields map[string]apijson.Field
  531. }
  532. func (r *EventListResponseEventMessagePartUpdatedProperties) UnmarshalJSON(data []byte) (err error) {
  533. return apijson.UnmarshalRoot(data, r)
  534. }
  535. func (r eventListResponseEventMessagePartUpdatedPropertiesJSON) RawJSON() string {
  536. return r.raw
  537. }
  538. type EventListResponseEventMessagePartUpdatedType string
  539. const (
  540. EventListResponseEventMessagePartUpdatedTypeMessagePartUpdated EventListResponseEventMessagePartUpdatedType = "message.part.updated"
  541. )
  542. func (r EventListResponseEventMessagePartUpdatedType) IsKnown() bool {
  543. switch r {
  544. case EventListResponseEventMessagePartUpdatedTypeMessagePartUpdated:
  545. return true
  546. }
  547. return false
  548. }
  549. type EventListResponseEventStorageWrite struct {
  550. Properties EventListResponseEventStorageWriteProperties `json:"properties,required"`
  551. Type EventListResponseEventStorageWriteType `json:"type,required"`
  552. JSON eventListResponseEventStorageWriteJSON `json:"-"`
  553. }
  554. // eventListResponseEventStorageWriteJSON contains the JSON metadata for the struct
  555. // [EventListResponseEventStorageWrite]
  556. type eventListResponseEventStorageWriteJSON struct {
  557. Properties apijson.Field
  558. Type apijson.Field
  559. raw string
  560. ExtraFields map[string]apijson.Field
  561. }
  562. func (r *EventListResponseEventStorageWrite) UnmarshalJSON(data []byte) (err error) {
  563. return apijson.UnmarshalRoot(data, r)
  564. }
  565. func (r eventListResponseEventStorageWriteJSON) RawJSON() string {
  566. return r.raw
  567. }
  568. func (r EventListResponseEventStorageWrite) implementsEventListResponse() {}
  569. type EventListResponseEventStorageWriteProperties struct {
  570. Key string `json:"key,required"`
  571. Content interface{} `json:"content"`
  572. JSON eventListResponseEventStorageWritePropertiesJSON `json:"-"`
  573. }
  574. // eventListResponseEventStorageWritePropertiesJSON contains the JSON metadata for
  575. // the struct [EventListResponseEventStorageWriteProperties]
  576. type eventListResponseEventStorageWritePropertiesJSON struct {
  577. Key apijson.Field
  578. Content apijson.Field
  579. raw string
  580. ExtraFields map[string]apijson.Field
  581. }
  582. func (r *EventListResponseEventStorageWriteProperties) UnmarshalJSON(data []byte) (err error) {
  583. return apijson.UnmarshalRoot(data, r)
  584. }
  585. func (r eventListResponseEventStorageWritePropertiesJSON) RawJSON() string {
  586. return r.raw
  587. }
  588. type EventListResponseEventStorageWriteType string
  589. const (
  590. EventListResponseEventStorageWriteTypeStorageWrite EventListResponseEventStorageWriteType = "storage.write"
  591. )
  592. func (r EventListResponseEventStorageWriteType) IsKnown() bool {
  593. switch r {
  594. case EventListResponseEventStorageWriteTypeStorageWrite:
  595. return true
  596. }
  597. return false
  598. }
  599. type EventListResponseEventSessionUpdated struct {
  600. Properties EventListResponseEventSessionUpdatedProperties `json:"properties,required"`
  601. Type EventListResponseEventSessionUpdatedType `json:"type,required"`
  602. JSON eventListResponseEventSessionUpdatedJSON `json:"-"`
  603. }
  604. // eventListResponseEventSessionUpdatedJSON contains the JSON metadata for the
  605. // struct [EventListResponseEventSessionUpdated]
  606. type eventListResponseEventSessionUpdatedJSON struct {
  607. Properties apijson.Field
  608. Type apijson.Field
  609. raw string
  610. ExtraFields map[string]apijson.Field
  611. }
  612. func (r *EventListResponseEventSessionUpdated) UnmarshalJSON(data []byte) (err error) {
  613. return apijson.UnmarshalRoot(data, r)
  614. }
  615. func (r eventListResponseEventSessionUpdatedJSON) RawJSON() string {
  616. return r.raw
  617. }
  618. func (r EventListResponseEventSessionUpdated) implementsEventListResponse() {}
  619. type EventListResponseEventSessionUpdatedProperties struct {
  620. Info Session `json:"info,required"`
  621. JSON eventListResponseEventSessionUpdatedPropertiesJSON `json:"-"`
  622. }
  623. // eventListResponseEventSessionUpdatedPropertiesJSON contains the JSON metadata
  624. // for the struct [EventListResponseEventSessionUpdatedProperties]
  625. type eventListResponseEventSessionUpdatedPropertiesJSON struct {
  626. Info apijson.Field
  627. raw string
  628. ExtraFields map[string]apijson.Field
  629. }
  630. func (r *EventListResponseEventSessionUpdatedProperties) UnmarshalJSON(data []byte) (err error) {
  631. return apijson.UnmarshalRoot(data, r)
  632. }
  633. func (r eventListResponseEventSessionUpdatedPropertiesJSON) RawJSON() string {
  634. return r.raw
  635. }
  636. type EventListResponseEventSessionUpdatedType string
  637. const (
  638. EventListResponseEventSessionUpdatedTypeSessionUpdated EventListResponseEventSessionUpdatedType = "session.updated"
  639. )
  640. func (r EventListResponseEventSessionUpdatedType) IsKnown() bool {
  641. switch r {
  642. case EventListResponseEventSessionUpdatedTypeSessionUpdated:
  643. return true
  644. }
  645. return false
  646. }
  647. type EventListResponseEventSessionDeleted struct {
  648. Properties EventListResponseEventSessionDeletedProperties `json:"properties,required"`
  649. Type EventListResponseEventSessionDeletedType `json:"type,required"`
  650. JSON eventListResponseEventSessionDeletedJSON `json:"-"`
  651. }
  652. // eventListResponseEventSessionDeletedJSON contains the JSON metadata for the
  653. // struct [EventListResponseEventSessionDeleted]
  654. type eventListResponseEventSessionDeletedJSON struct {
  655. Properties apijson.Field
  656. Type apijson.Field
  657. raw string
  658. ExtraFields map[string]apijson.Field
  659. }
  660. func (r *EventListResponseEventSessionDeleted) UnmarshalJSON(data []byte) (err error) {
  661. return apijson.UnmarshalRoot(data, r)
  662. }
  663. func (r eventListResponseEventSessionDeletedJSON) RawJSON() string {
  664. return r.raw
  665. }
  666. func (r EventListResponseEventSessionDeleted) implementsEventListResponse() {}
  667. type EventListResponseEventSessionDeletedProperties struct {
  668. Info Session `json:"info,required"`
  669. JSON eventListResponseEventSessionDeletedPropertiesJSON `json:"-"`
  670. }
  671. // eventListResponseEventSessionDeletedPropertiesJSON contains the JSON metadata
  672. // for the struct [EventListResponseEventSessionDeletedProperties]
  673. type eventListResponseEventSessionDeletedPropertiesJSON struct {
  674. Info apijson.Field
  675. raw string
  676. ExtraFields map[string]apijson.Field
  677. }
  678. func (r *EventListResponseEventSessionDeletedProperties) UnmarshalJSON(data []byte) (err error) {
  679. return apijson.UnmarshalRoot(data, r)
  680. }
  681. func (r eventListResponseEventSessionDeletedPropertiesJSON) RawJSON() string {
  682. return r.raw
  683. }
  684. type EventListResponseEventSessionDeletedType string
  685. const (
  686. EventListResponseEventSessionDeletedTypeSessionDeleted EventListResponseEventSessionDeletedType = "session.deleted"
  687. )
  688. func (r EventListResponseEventSessionDeletedType) IsKnown() bool {
  689. switch r {
  690. case EventListResponseEventSessionDeletedTypeSessionDeleted:
  691. return true
  692. }
  693. return false
  694. }
  695. type EventListResponseEventSessionIdle struct {
  696. Properties EventListResponseEventSessionIdleProperties `json:"properties,required"`
  697. Type EventListResponseEventSessionIdleType `json:"type,required"`
  698. JSON eventListResponseEventSessionIdleJSON `json:"-"`
  699. }
  700. // eventListResponseEventSessionIdleJSON contains the JSON metadata for the struct
  701. // [EventListResponseEventSessionIdle]
  702. type eventListResponseEventSessionIdleJSON struct {
  703. Properties apijson.Field
  704. Type apijson.Field
  705. raw string
  706. ExtraFields map[string]apijson.Field
  707. }
  708. func (r *EventListResponseEventSessionIdle) UnmarshalJSON(data []byte) (err error) {
  709. return apijson.UnmarshalRoot(data, r)
  710. }
  711. func (r eventListResponseEventSessionIdleJSON) RawJSON() string {
  712. return r.raw
  713. }
  714. func (r EventListResponseEventSessionIdle) implementsEventListResponse() {}
  715. type EventListResponseEventSessionIdleProperties struct {
  716. SessionID string `json:"sessionID,required"`
  717. JSON eventListResponseEventSessionIdlePropertiesJSON `json:"-"`
  718. }
  719. // eventListResponseEventSessionIdlePropertiesJSON contains the JSON metadata for
  720. // the struct [EventListResponseEventSessionIdleProperties]
  721. type eventListResponseEventSessionIdlePropertiesJSON struct {
  722. SessionID apijson.Field
  723. raw string
  724. ExtraFields map[string]apijson.Field
  725. }
  726. func (r *EventListResponseEventSessionIdleProperties) UnmarshalJSON(data []byte) (err error) {
  727. return apijson.UnmarshalRoot(data, r)
  728. }
  729. func (r eventListResponseEventSessionIdlePropertiesJSON) RawJSON() string {
  730. return r.raw
  731. }
  732. type EventListResponseEventSessionIdleType string
  733. const (
  734. EventListResponseEventSessionIdleTypeSessionIdle EventListResponseEventSessionIdleType = "session.idle"
  735. )
  736. func (r EventListResponseEventSessionIdleType) IsKnown() bool {
  737. switch r {
  738. case EventListResponseEventSessionIdleTypeSessionIdle:
  739. return true
  740. }
  741. return false
  742. }
  743. type EventListResponseEventSessionError struct {
  744. Properties EventListResponseEventSessionErrorProperties `json:"properties,required"`
  745. Type EventListResponseEventSessionErrorType `json:"type,required"`
  746. JSON eventListResponseEventSessionErrorJSON `json:"-"`
  747. }
  748. // eventListResponseEventSessionErrorJSON contains the JSON metadata for the struct
  749. // [EventListResponseEventSessionError]
  750. type eventListResponseEventSessionErrorJSON struct {
  751. Properties apijson.Field
  752. Type apijson.Field
  753. raw string
  754. ExtraFields map[string]apijson.Field
  755. }
  756. func (r *EventListResponseEventSessionError) UnmarshalJSON(data []byte) (err error) {
  757. return apijson.UnmarshalRoot(data, r)
  758. }
  759. func (r eventListResponseEventSessionErrorJSON) RawJSON() string {
  760. return r.raw
  761. }
  762. func (r EventListResponseEventSessionError) implementsEventListResponse() {}
  763. type EventListResponseEventSessionErrorProperties struct {
  764. Error EventListResponseEventSessionErrorPropertiesError `json:"error"`
  765. SessionID string `json:"sessionID"`
  766. JSON eventListResponseEventSessionErrorPropertiesJSON `json:"-"`
  767. }
  768. // eventListResponseEventSessionErrorPropertiesJSON contains the JSON metadata for
  769. // the struct [EventListResponseEventSessionErrorProperties]
  770. type eventListResponseEventSessionErrorPropertiesJSON struct {
  771. Error apijson.Field
  772. SessionID apijson.Field
  773. raw string
  774. ExtraFields map[string]apijson.Field
  775. }
  776. func (r *EventListResponseEventSessionErrorProperties) UnmarshalJSON(data []byte) (err error) {
  777. return apijson.UnmarshalRoot(data, r)
  778. }
  779. func (r eventListResponseEventSessionErrorPropertiesJSON) RawJSON() string {
  780. return r.raw
  781. }
  782. type EventListResponseEventSessionErrorPropertiesError struct {
  783. // This field can have the runtime type of [shared.ProviderAuthErrorData],
  784. // [shared.UnknownErrorData], [interface{}].
  785. Data interface{} `json:"data,required"`
  786. Name EventListResponseEventSessionErrorPropertiesErrorName `json:"name,required"`
  787. JSON eventListResponseEventSessionErrorPropertiesErrorJSON `json:"-"`
  788. union EventListResponseEventSessionErrorPropertiesErrorUnion
  789. }
  790. // eventListResponseEventSessionErrorPropertiesErrorJSON contains the JSON metadata
  791. // for the struct [EventListResponseEventSessionErrorPropertiesError]
  792. type eventListResponseEventSessionErrorPropertiesErrorJSON struct {
  793. Data apijson.Field
  794. Name apijson.Field
  795. raw string
  796. ExtraFields map[string]apijson.Field
  797. }
  798. func (r eventListResponseEventSessionErrorPropertiesErrorJSON) RawJSON() string {
  799. return r.raw
  800. }
  801. func (r *EventListResponseEventSessionErrorPropertiesError) UnmarshalJSON(data []byte) (err error) {
  802. *r = EventListResponseEventSessionErrorPropertiesError{}
  803. err = apijson.UnmarshalRoot(data, &r.union)
  804. if err != nil {
  805. return err
  806. }
  807. return apijson.Port(r.union, &r)
  808. }
  809. // AsUnion returns a [EventListResponseEventSessionErrorPropertiesErrorUnion]
  810. // interface which you can cast to the specific types for more type safety.
  811. //
  812. // Possible runtime types of the union are [shared.ProviderAuthError],
  813. // [shared.UnknownError],
  814. // [EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError],
  815. // [shared.MessageAbortedError].
  816. func (r EventListResponseEventSessionErrorPropertiesError) AsUnion() EventListResponseEventSessionErrorPropertiesErrorUnion {
  817. return r.union
  818. }
  819. // Union satisfied by [shared.ProviderAuthError], [shared.UnknownError],
  820. // [EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError] or
  821. // [shared.MessageAbortedError].
  822. type EventListResponseEventSessionErrorPropertiesErrorUnion interface {
  823. ImplementsEventListResponseEventSessionErrorPropertiesError()
  824. }
  825. func init() {
  826. apijson.RegisterUnion(
  827. reflect.TypeOf((*EventListResponseEventSessionErrorPropertiesErrorUnion)(nil)).Elem(),
  828. "name",
  829. apijson.UnionVariant{
  830. TypeFilter: gjson.JSON,
  831. Type: reflect.TypeOf(shared.ProviderAuthError{}),
  832. DiscriminatorValue: "ProviderAuthError",
  833. },
  834. apijson.UnionVariant{
  835. TypeFilter: gjson.JSON,
  836. Type: reflect.TypeOf(shared.UnknownError{}),
  837. DiscriminatorValue: "UnknownError",
  838. },
  839. apijson.UnionVariant{
  840. TypeFilter: gjson.JSON,
  841. Type: reflect.TypeOf(EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError{}),
  842. DiscriminatorValue: "MessageOutputLengthError",
  843. },
  844. apijson.UnionVariant{
  845. TypeFilter: gjson.JSON,
  846. Type: reflect.TypeOf(shared.MessageAbortedError{}),
  847. DiscriminatorValue: "MessageAbortedError",
  848. },
  849. )
  850. }
  851. type EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError struct {
  852. Data interface{} `json:"data,required"`
  853. Name EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName `json:"name,required"`
  854. JSON eventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorJSON `json:"-"`
  855. }
  856. // eventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorJSON
  857. // contains the JSON metadata for the struct
  858. // [EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError]
  859. type eventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorJSON struct {
  860. Data apijson.Field
  861. Name apijson.Field
  862. raw string
  863. ExtraFields map[string]apijson.Field
  864. }
  865. func (r *EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError) UnmarshalJSON(data []byte) (err error) {
  866. return apijson.UnmarshalRoot(data, r)
  867. }
  868. func (r eventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorJSON) RawJSON() string {
  869. return r.raw
  870. }
  871. func (r EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError) ImplementsEventListResponseEventSessionErrorPropertiesError() {
  872. }
  873. type EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName string
  874. const (
  875. EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorNameMessageOutputLengthError EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName = "MessageOutputLengthError"
  876. )
  877. func (r EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName) IsKnown() bool {
  878. switch r {
  879. case EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorNameMessageOutputLengthError:
  880. return true
  881. }
  882. return false
  883. }
  884. type EventListResponseEventSessionErrorPropertiesErrorName string
  885. const (
  886. EventListResponseEventSessionErrorPropertiesErrorNameProviderAuthError EventListResponseEventSessionErrorPropertiesErrorName = "ProviderAuthError"
  887. EventListResponseEventSessionErrorPropertiesErrorNameUnknownError EventListResponseEventSessionErrorPropertiesErrorName = "UnknownError"
  888. EventListResponseEventSessionErrorPropertiesErrorNameMessageOutputLengthError EventListResponseEventSessionErrorPropertiesErrorName = "MessageOutputLengthError"
  889. EventListResponseEventSessionErrorPropertiesErrorNameMessageAbortedError EventListResponseEventSessionErrorPropertiesErrorName = "MessageAbortedError"
  890. )
  891. func (r EventListResponseEventSessionErrorPropertiesErrorName) IsKnown() bool {
  892. switch r {
  893. case EventListResponseEventSessionErrorPropertiesErrorNameProviderAuthError, EventListResponseEventSessionErrorPropertiesErrorNameUnknownError, EventListResponseEventSessionErrorPropertiesErrorNameMessageOutputLengthError, EventListResponseEventSessionErrorPropertiesErrorNameMessageAbortedError:
  894. return true
  895. }
  896. return false
  897. }
  898. type EventListResponseEventSessionErrorType string
  899. const (
  900. EventListResponseEventSessionErrorTypeSessionError EventListResponseEventSessionErrorType = "session.error"
  901. )
  902. func (r EventListResponseEventSessionErrorType) IsKnown() bool {
  903. switch r {
  904. case EventListResponseEventSessionErrorTypeSessionError:
  905. return true
  906. }
  907. return false
  908. }
  909. type EventListResponseEventFileWatcherUpdated struct {
  910. Properties EventListResponseEventFileWatcherUpdatedProperties `json:"properties,required"`
  911. Type EventListResponseEventFileWatcherUpdatedType `json:"type,required"`
  912. JSON eventListResponseEventFileWatcherUpdatedJSON `json:"-"`
  913. }
  914. // eventListResponseEventFileWatcherUpdatedJSON contains the JSON metadata for the
  915. // struct [EventListResponseEventFileWatcherUpdated]
  916. type eventListResponseEventFileWatcherUpdatedJSON struct {
  917. Properties apijson.Field
  918. Type apijson.Field
  919. raw string
  920. ExtraFields map[string]apijson.Field
  921. }
  922. func (r *EventListResponseEventFileWatcherUpdated) UnmarshalJSON(data []byte) (err error) {
  923. return apijson.UnmarshalRoot(data, r)
  924. }
  925. func (r eventListResponseEventFileWatcherUpdatedJSON) RawJSON() string {
  926. return r.raw
  927. }
  928. func (r EventListResponseEventFileWatcherUpdated) implementsEventListResponse() {}
  929. type EventListResponseEventFileWatcherUpdatedProperties struct {
  930. Event EventListResponseEventFileWatcherUpdatedPropertiesEvent `json:"event,required"`
  931. File string `json:"file,required"`
  932. JSON eventListResponseEventFileWatcherUpdatedPropertiesJSON `json:"-"`
  933. }
  934. // eventListResponseEventFileWatcherUpdatedPropertiesJSON contains the JSON
  935. // metadata for the struct [EventListResponseEventFileWatcherUpdatedProperties]
  936. type eventListResponseEventFileWatcherUpdatedPropertiesJSON struct {
  937. Event apijson.Field
  938. File apijson.Field
  939. raw string
  940. ExtraFields map[string]apijson.Field
  941. }
  942. func (r *EventListResponseEventFileWatcherUpdatedProperties) UnmarshalJSON(data []byte) (err error) {
  943. return apijson.UnmarshalRoot(data, r)
  944. }
  945. func (r eventListResponseEventFileWatcherUpdatedPropertiesJSON) RawJSON() string {
  946. return r.raw
  947. }
  948. type EventListResponseEventFileWatcherUpdatedPropertiesEvent string
  949. const (
  950. EventListResponseEventFileWatcherUpdatedPropertiesEventRename EventListResponseEventFileWatcherUpdatedPropertiesEvent = "rename"
  951. EventListResponseEventFileWatcherUpdatedPropertiesEventChange EventListResponseEventFileWatcherUpdatedPropertiesEvent = "change"
  952. )
  953. func (r EventListResponseEventFileWatcherUpdatedPropertiesEvent) IsKnown() bool {
  954. switch r {
  955. case EventListResponseEventFileWatcherUpdatedPropertiesEventRename, EventListResponseEventFileWatcherUpdatedPropertiesEventChange:
  956. return true
  957. }
  958. return false
  959. }
  960. type EventListResponseEventFileWatcherUpdatedType string
  961. const (
  962. EventListResponseEventFileWatcherUpdatedTypeFileWatcherUpdated EventListResponseEventFileWatcherUpdatedType = "file.watcher.updated"
  963. )
  964. func (r EventListResponseEventFileWatcherUpdatedType) IsKnown() bool {
  965. switch r {
  966. case EventListResponseEventFileWatcherUpdatedTypeFileWatcherUpdated:
  967. return true
  968. }
  969. return false
  970. }
  971. type EventListResponseType string
  972. const (
  973. EventListResponseTypeLspClientDiagnostics EventListResponseType = "lsp.client.diagnostics"
  974. EventListResponseTypePermissionUpdated EventListResponseType = "permission.updated"
  975. EventListResponseTypeFileEdited EventListResponseType = "file.edited"
  976. EventListResponseTypeInstallationUpdated EventListResponseType = "installation.updated"
  977. EventListResponseTypeMessageUpdated EventListResponseType = "message.updated"
  978. EventListResponseTypeMessageRemoved EventListResponseType = "message.removed"
  979. EventListResponseTypeMessagePartUpdated EventListResponseType = "message.part.updated"
  980. EventListResponseTypeStorageWrite EventListResponseType = "storage.write"
  981. EventListResponseTypeSessionUpdated EventListResponseType = "session.updated"
  982. EventListResponseTypeSessionDeleted EventListResponseType = "session.deleted"
  983. EventListResponseTypeSessionIdle EventListResponseType = "session.idle"
  984. EventListResponseTypeSessionError EventListResponseType = "session.error"
  985. EventListResponseTypeFileWatcherUpdated EventListResponseType = "file.watcher.updated"
  986. )
  987. func (r EventListResponseType) IsKnown() bool {
  988. switch r {
  989. case EventListResponseTypeLspClientDiagnostics, EventListResponseTypePermissionUpdated, EventListResponseTypeFileEdited, EventListResponseTypeInstallationUpdated, EventListResponseTypeMessageUpdated, EventListResponseTypeMessageRemoved, EventListResponseTypeMessagePartUpdated, EventListResponseTypeStorageWrite, EventListResponseTypeSessionUpdated, EventListResponseTypeSessionDeleted, EventListResponseTypeSessionIdle, EventListResponseTypeSessionError, EventListResponseTypeFileWatcherUpdated:
  990. return true
  991. }
  992. return false
  993. }