@@ -15871,18 +15871,249 @@ class ServerGetVersionResult implements ResponseResult {
1587115871 int get hashCode => version.hashCode;
1587215872}
1587315873
15874+ /// ServerLogEntry
15875+ ///
15876+ /// {
15877+ /// "time": int
15878+ /// "kind": ServerLogEntryKind
15879+ /// "data": String
15880+ /// }
15881+ ///
15882+ /// Clients may not extend, implement or mix-in this class.
15883+ class ServerLogEntry implements HasToJson {
15884+ /// The time (milliseconds since epoch) at which the server created this log
15885+ /// entry.
15886+ int time;
15887+
15888+ /// The kind of the entry, used to determine how to interpret the "data"
15889+ /// field.
15890+ ServerLogEntryKind kind;
15891+
15892+ /// The payload of the entry, the actual format is determined by the "kind"
15893+ /// field.
15894+ String data;
15895+
15896+ ServerLogEntry (this .time, this .kind, this .data);
15897+
15898+ factory ServerLogEntry .fromJson (
15899+ JsonDecoder jsonDecoder, String jsonPath, Object ? json) {
15900+ json ?? = {};
15901+ if (json is Map ) {
15902+ int time;
15903+ if (json.containsKey ('time' )) {
15904+ time = jsonDecoder.decodeInt (jsonPath + '.time' , json['time' ]);
15905+ } else {
15906+ throw jsonDecoder.mismatch (jsonPath, 'time' );
15907+ }
15908+ ServerLogEntryKind kind;
15909+ if (json.containsKey ('kind' )) {
15910+ kind = ServerLogEntryKind .fromJson (
15911+ jsonDecoder, jsonPath + '.kind' , json['kind' ]);
15912+ } else {
15913+ throw jsonDecoder.mismatch (jsonPath, 'kind' );
15914+ }
15915+ String data;
15916+ if (json.containsKey ('data' )) {
15917+ data = jsonDecoder.decodeString (jsonPath + '.data' , json['data' ]);
15918+ } else {
15919+ throw jsonDecoder.mismatch (jsonPath, 'data' );
15920+ }
15921+ return ServerLogEntry (time, kind, data);
15922+ } else {
15923+ throw jsonDecoder.mismatch (jsonPath, 'ServerLogEntry' , json);
15924+ }
15925+ }
15926+
15927+ @override
15928+ Map <String , Object > toJson () {
15929+ var result = < String , Object > {};
15930+ result['time' ] = time;
15931+ result['kind' ] = kind.toJson ();
15932+ result['data' ] = data;
15933+ return result;
15934+ }
15935+
15936+ @override
15937+ String toString () => json.encode (toJson ());
15938+
15939+ @override
15940+ bool operator == (other) {
15941+ if (other is ServerLogEntry ) {
15942+ return time == other.time && kind == other.kind && data == other.data;
15943+ }
15944+ return false ;
15945+ }
15946+
15947+ @override
15948+ int get hashCode => Object .hash (
15949+ time,
15950+ kind,
15951+ data,
15952+ );
15953+ }
15954+
15955+ /// ServerLogEntryKind
15956+ ///
15957+ /// enum {
15958+ /// NOTIFICATION
15959+ /// RAW
15960+ /// REQUEST
15961+ /// RESPONSE
15962+ /// }
15963+ ///
15964+ /// Clients may not extend, implement or mix-in this class.
15965+ class ServerLogEntryKind implements Enum {
15966+ /// A notification from the server, such as "analysis.highlights". The "data"
15967+ /// field contains a JSON object with abbreviated notification.
15968+ static const ServerLogEntryKind NOTIFICATION =
15969+ ServerLogEntryKind ._('NOTIFICATION' );
15970+
15971+ /// Arbitrary string, describing some event that happened in the server, e.g.
15972+ /// starting a file analysis, and details which files were accessed. These
15973+ /// entries are not structured, but provide context information about
15974+ /// requests and notification, and can be related by "time" for further
15975+ /// manual analysis.
15976+ static const ServerLogEntryKind RAW = ServerLogEntryKind ._('RAW' );
15977+
15978+ /// A request from the client, as the server views it, e.g.
15979+ /// "edit.getAssists". The "data" field contains a JSON object with
15980+ /// abbreviated request.
15981+ static const ServerLogEntryKind REQUEST = ServerLogEntryKind ._('REQUEST' );
15982+
15983+ /// Various counters and measurements related to execution of a request. The
15984+ /// "data" field contains a JSON object with following fields:
15985+ ///
15986+ /// - "id" - the id of the request - copied from the request.
15987+ /// - "method" - the method of the request, e.g. "edit.getAssists".
15988+ /// - "clientRequestTime" - the time (milliseconds since epoch) at which the
15989+ /// client made the request - copied from the request.
15990+ /// - "serverRequestTime" - the time (milliseconds since epoch) at which the
15991+ /// server received and decoded the JSON request.
15992+ /// - "responseTime" - the time (milliseconds since epoch) at which the
15993+ /// server created the response to be encoded into JSON and sent to the
15994+ /// client.
15995+ static const ServerLogEntryKind RESPONSE = ServerLogEntryKind ._('RESPONSE' );
15996+
15997+ /// A list containing all of the enum values that are defined.
15998+ static const List <ServerLogEntryKind > VALUES = < ServerLogEntryKind > [
15999+ NOTIFICATION ,
16000+ RAW ,
16001+ REQUEST ,
16002+ RESPONSE
16003+ ];
16004+
16005+ @override
16006+ final String name;
16007+
16008+ const ServerLogEntryKind ._(this .name);
16009+
16010+ factory ServerLogEntryKind (String name) {
16011+ switch (name) {
16012+ case 'NOTIFICATION' :
16013+ return NOTIFICATION ;
16014+ case 'RAW' :
16015+ return RAW ;
16016+ case 'REQUEST' :
16017+ return REQUEST ;
16018+ case 'RESPONSE' :
16019+ return RESPONSE ;
16020+ }
16021+ throw Exception ('Illegal enum value: $name ' );
16022+ }
16023+
16024+ factory ServerLogEntryKind .fromJson (
16025+ JsonDecoder jsonDecoder, String jsonPath, Object ? json) {
16026+ if (json is String ) {
16027+ try {
16028+ return ServerLogEntryKind (json);
16029+ } catch (_) {
16030+ // Fall through
16031+ }
16032+ }
16033+ throw jsonDecoder.mismatch (jsonPath, 'ServerLogEntryKind' , json);
16034+ }
16035+
16036+ @override
16037+ String toString () => 'ServerLogEntryKind.$name ' ;
16038+
16039+ String toJson () => name;
16040+ }
16041+
16042+ /// server.log params
16043+ ///
16044+ /// {
16045+ /// "entry": ServerLogEntry
16046+ /// }
16047+ ///
16048+ /// Clients may not extend, implement or mix-in this class.
16049+ class ServerLogParams implements HasToJson {
16050+ ServerLogEntry entry;
16051+
16052+ ServerLogParams (this .entry);
16053+
16054+ factory ServerLogParams .fromJson (
16055+ JsonDecoder jsonDecoder, String jsonPath, Object ? json) {
16056+ json ?? = {};
16057+ if (json is Map ) {
16058+ ServerLogEntry entry;
16059+ if (json.containsKey ('entry' )) {
16060+ entry = ServerLogEntry .fromJson (
16061+ jsonDecoder, jsonPath + '.entry' , json['entry' ]);
16062+ } else {
16063+ throw jsonDecoder.mismatch (jsonPath, 'entry' );
16064+ }
16065+ return ServerLogParams (entry);
16066+ } else {
16067+ throw jsonDecoder.mismatch (jsonPath, 'server.log params' , json);
16068+ }
16069+ }
16070+
16071+ factory ServerLogParams .fromNotification (Notification notification) {
16072+ return ServerLogParams .fromJson (
16073+ ResponseDecoder (null ), 'params' , notification.params);
16074+ }
16075+
16076+ @override
16077+ Map <String , Object > toJson () {
16078+ var result = < String , Object > {};
16079+ result['entry' ] = entry.toJson ();
16080+ return result;
16081+ }
16082+
16083+ Notification toNotification () {
16084+ return Notification ('server.log' , toJson ());
16085+ }
16086+
16087+ @override
16088+ String toString () => json.encode (toJson ());
16089+
16090+ @override
16091+ bool operator == (other) {
16092+ if (other is ServerLogParams ) {
16093+ return entry == other.entry;
16094+ }
16095+ return false ;
16096+ }
16097+
16098+ @override
16099+ int get hashCode => entry.hashCode;
16100+ }
16101+
1587416102/// ServerService
1587516103///
1587616104/// enum {
16105+ /// LOG
1587716106/// STATUS
1587816107/// }
1587916108///
1588016109/// Clients may not extend, implement or mix-in this class.
1588116110class ServerService implements Enum {
16111+ static const ServerService LOG = ServerService ._('LOG' );
16112+
1588216113 static const ServerService STATUS = ServerService ._('STATUS' );
1588316114
1588416115 /// A list containing all of the enum values that are defined.
15885- static const List <ServerService > VALUES = < ServerService > [STATUS ];
16116+ static const List <ServerService > VALUES = < ServerService > [LOG , STATUS ];
1588616117
1588716118 @override
1588816119 final String name;
@@ -15891,6 +16122,8 @@ class ServerService implements Enum {
1589116122
1589216123 factory ServerService (String name) {
1589316124 switch (name) {
16125+ case 'LOG' :
16126+ return LOG ;
1589416127 case 'STATUS' :
1589516128 return STATUS ;
1589616129 }
0 commit comments