OLD | NEW |
| (Empty) |
1 // This is a generated file (see the discoveryapis_generator project). | |
2 | |
3 library googleapis.tracing.v2; | |
4 | |
5 import 'dart:core' as core; | |
6 import 'dart:async' as async; | |
7 import 'dart:convert' as convert; | |
8 | |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | |
10 import 'package:http/http.dart' as http; | |
11 | |
12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | |
13 ApiRequestError, DetailedApiRequestError; | |
14 | |
15 const core.String USER_AGENT = 'dart-api-client tracing/v2'; | |
16 | |
17 /** Send and retrieve trace data from Google Stackdriver Trace. */ | |
18 class TracingApi { | |
19 /** View and manage your data across Google Cloud Platform services */ | |
20 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; | |
21 | |
22 /** Write Trace data for a project or application */ | |
23 static const TraceAppendScope = "https://www.googleapis.com/auth/trace.append"
; | |
24 | |
25 /** Read Trace data for a project or application */ | |
26 static const TraceReadonlyScope = "https://www.googleapis.com/auth/trace.reado
nly"; | |
27 | |
28 | |
29 final commons.ApiRequester _requester; | |
30 | |
31 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); | |
32 | |
33 TracingApi(http.Client client, {core.String rootUrl: "https://tracing.googleap
is.com/", core.String servicePath: ""}) : | |
34 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | |
35 } | |
36 | |
37 | |
38 class ProjectsResourceApi { | |
39 final commons.ApiRequester _requester; | |
40 | |
41 ProjectsTracesResourceApi get traces => new ProjectsTracesResourceApi(_request
er); | |
42 | |
43 ProjectsResourceApi(commons.ApiRequester client) : | |
44 _requester = client; | |
45 } | |
46 | |
47 | |
48 class ProjectsTracesResourceApi { | |
49 final commons.ApiRequester _requester; | |
50 | |
51 ProjectsTracesSpansResourceApi get spans => new ProjectsTracesSpansResourceApi
(_requester); | |
52 | |
53 ProjectsTracesResourceApi(commons.ApiRequester client) : | |
54 _requester = client; | |
55 | |
56 /** | |
57 * Sends new spans to Stackdriver Trace or updates existing traces. If the | |
58 * name of a trace that you send matches that of an existing trace, new spans | |
59 * are added to the existing trace. Attempt to update existing spans results | |
60 * undefined behavior. If the name does not match, a new trace is created | |
61 * with given set of spans. | |
62 * | |
63 * [request] - The metadata request object. | |
64 * | |
65 * Request parameters: | |
66 * | |
67 * [name] - Name of the project where the spans belong to. Format is | |
68 * `projects/PROJECT_ID`. | |
69 * Value must have pattern "^projects/[^/]+$". | |
70 * | |
71 * Completes with a [Empty]. | |
72 * | |
73 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
74 * error. | |
75 * | |
76 * If the used [http.Client] completes with an error when making a REST call, | |
77 * this method will complete with the same error. | |
78 */ | |
79 async.Future<Empty> batchWrite(BatchWriteSpansRequest request, core.String nam
e) { | |
80 var _url = null; | |
81 var _queryParams = new core.Map(); | |
82 var _uploadMedia = null; | |
83 var _uploadOptions = null; | |
84 var _downloadOptions = commons.DownloadOptions.Metadata; | |
85 var _body = null; | |
86 | |
87 if (request != null) { | |
88 _body = convert.JSON.encode((request).toJson()); | |
89 } | |
90 if (name == null) { | |
91 throw new core.ArgumentError("Parameter name is required."); | |
92 } | |
93 | |
94 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$name') + '/traces:bat
chWrite'; | |
95 | |
96 var _response = _requester.request(_url, | |
97 "POST", | |
98 body: _body, | |
99 queryParams: _queryParams, | |
100 uploadOptions: _uploadOptions, | |
101 uploadMedia: _uploadMedia, | |
102 downloadOptions: _downloadOptions); | |
103 return _response.then((data) => new Empty.fromJson(data)); | |
104 } | |
105 | |
106 /** | |
107 * Returns of a list of traces that match the specified filter conditions. | |
108 * | |
109 * Request parameters: | |
110 * | |
111 * [parent] - ID of the Cloud project where the trace data is stored which is | |
112 * `projects/PROJECT_ID`. | |
113 * Value must have pattern "^projects/[^/]+$". | |
114 * | |
115 * [orderBy] - Field used to sort the returned traces. Optional. | |
116 * Can be one of the following: | |
117 * | |
118 * * `trace_id` | |
119 * * `name` (`name` field of root span in the trace) | |
120 * * `duration` (difference between `end_time` and `start_time` fields of | |
121 * the root span) | |
122 * * `start` (`start_time` field of the root span) | |
123 * | |
124 * Descending order can be specified by appending `desc` to the sort field | |
125 * (for example, `name desc`). | |
126 * | |
127 * Only one sort field is permitted. | |
128 * | |
129 * [filter] - An optional filter for the request. | |
130 * Example: | |
131 * `version_label_key:a some_label:some_label_key` | |
132 * returns traces from version `a` and has `some_label` with `some_label_key`. | |
133 * | |
134 * [endTime] - End of the time interval (inclusive) during which the trace | |
135 * data was | |
136 * collected from the application. | |
137 * | |
138 * [pageToken] - Token identifying the page of results to return. If provided, | |
139 * use the | |
140 * value of the `next_page_token` field from a previous request. Optional. | |
141 * | |
142 * [startTime] - Start of the time interval (inclusive) during which the trace | |
143 * data was | |
144 * collected from the application. | |
145 * | |
146 * [pageSize] - Maximum number of traces to return. If not specified or <= 0, | |
147 * the | |
148 * implementation selects a reasonable value. The implementation may | |
149 * return fewer traces than the requested page size. Optional. | |
150 * | |
151 * Completes with a [ListTracesResponse]. | |
152 * | |
153 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
154 * error. | |
155 * | |
156 * If the used [http.Client] completes with an error when making a REST call, | |
157 * this method will complete with the same error. | |
158 */ | |
159 async.Future<ListTracesResponse> list(core.String parent, {core.String orderBy
, core.String filter, core.String endTime, core.String pageToken, core.String st
artTime, core.int pageSize}) { | |
160 var _url = null; | |
161 var _queryParams = new core.Map(); | |
162 var _uploadMedia = null; | |
163 var _uploadOptions = null; | |
164 var _downloadOptions = commons.DownloadOptions.Metadata; | |
165 var _body = null; | |
166 | |
167 if (parent == null) { | |
168 throw new core.ArgumentError("Parameter parent is required."); | |
169 } | |
170 if (orderBy != null) { | |
171 _queryParams["orderBy"] = [orderBy]; | |
172 } | |
173 if (filter != null) { | |
174 _queryParams["filter"] = [filter]; | |
175 } | |
176 if (endTime != null) { | |
177 _queryParams["endTime"] = [endTime]; | |
178 } | |
179 if (pageToken != null) { | |
180 _queryParams["pageToken"] = [pageToken]; | |
181 } | |
182 if (startTime != null) { | |
183 _queryParams["startTime"] = [startTime]; | |
184 } | |
185 if (pageSize != null) { | |
186 _queryParams["pageSize"] = ["${pageSize}"]; | |
187 } | |
188 | |
189 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$parent') + '/traces'; | |
190 | |
191 var _response = _requester.request(_url, | |
192 "GET", | |
193 body: _body, | |
194 queryParams: _queryParams, | |
195 uploadOptions: _uploadOptions, | |
196 uploadMedia: _uploadMedia, | |
197 downloadOptions: _downloadOptions); | |
198 return _response.then((data) => new ListTracesResponse.fromJson(data)); | |
199 } | |
200 | |
201 /** | |
202 * Returns a list of spans within a trace. | |
203 * | |
204 * Request parameters: | |
205 * | |
206 * [parent] - ID of the trace for which to list child spans. Format is | |
207 * `projects/PROJECT_ID/traces/TRACE_ID`. | |
208 * Value must have pattern "^projects/[^/]+/traces/[^/]+$". | |
209 * | |
210 * [pageToken] - Token identifying the page of results to return. If provided, | |
211 * use the | |
212 * value of the `nextPageToken` field from a previous request. Optional. | |
213 * | |
214 * Completes with a [ListSpansResponse]. | |
215 * | |
216 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
217 * error. | |
218 * | |
219 * If the used [http.Client] completes with an error when making a REST call, | |
220 * this method will complete with the same error. | |
221 */ | |
222 async.Future<ListSpansResponse> listSpans(core.String parent, {core.String pag
eToken}) { | |
223 var _url = null; | |
224 var _queryParams = new core.Map(); | |
225 var _uploadMedia = null; | |
226 var _uploadOptions = null; | |
227 var _downloadOptions = commons.DownloadOptions.Metadata; | |
228 var _body = null; | |
229 | |
230 if (parent == null) { | |
231 throw new core.ArgumentError("Parameter parent is required."); | |
232 } | |
233 if (pageToken != null) { | |
234 _queryParams["pageToken"] = [pageToken]; | |
235 } | |
236 | |
237 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$parent') + ':listSpan
s'; | |
238 | |
239 var _response = _requester.request(_url, | |
240 "GET", | |
241 body: _body, | |
242 queryParams: _queryParams, | |
243 uploadOptions: _uploadOptions, | |
244 uploadMedia: _uploadMedia, | |
245 downloadOptions: _downloadOptions); | |
246 return _response.then((data) => new ListSpansResponse.fromJson(data)); | |
247 } | |
248 | |
249 } | |
250 | |
251 | |
252 class ProjectsTracesSpansResourceApi { | |
253 final commons.ApiRequester _requester; | |
254 | |
255 ProjectsTracesSpansResourceApi(commons.ApiRequester client) : | |
256 _requester = client; | |
257 | |
258 /** | |
259 * Creates a new Span. | |
260 * | |
261 * [request] - The metadata request object. | |
262 * | |
263 * Request parameters: | |
264 * | |
265 * [name] - The resource name of Span in the format | |
266 * `projects/PROJECT_ID/traces/TRACE_ID/spans/SPAN_ID`. | |
267 * `TRACE_ID` is a unique identifier for a trace within a project and is a | |
268 * base16-encoded, case-insensitive string and is required to be 32 char long. | |
269 * `SPAN_ID` is a unique identifier for a span within a trace. It is a | |
270 * base 16-encoded, case-insensitive string of a 8-bytes array and is required | |
271 * to be 16 char long. | |
272 * Value must have pattern "^projects/[^/]+/traces/[^/]+/spans/[^/]+$". | |
273 * | |
274 * Completes with a [Span]. | |
275 * | |
276 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
277 * error. | |
278 * | |
279 * If the used [http.Client] completes with an error when making a REST call, | |
280 * this method will complete with the same error. | |
281 */ | |
282 async.Future<Span> create(Span request, core.String name) { | |
283 var _url = null; | |
284 var _queryParams = new core.Map(); | |
285 var _uploadMedia = null; | |
286 var _uploadOptions = null; | |
287 var _downloadOptions = commons.DownloadOptions.Metadata; | |
288 var _body = null; | |
289 | |
290 if (request != null) { | |
291 _body = convert.JSON.encode((request).toJson()); | |
292 } | |
293 if (name == null) { | |
294 throw new core.ArgumentError("Parameter name is required."); | |
295 } | |
296 | |
297 _url = 'v2/' + commons.Escaper.ecapeVariableReserved('$name'); | |
298 | |
299 var _response = _requester.request(_url, | |
300 "PUT", | |
301 body: _body, | |
302 queryParams: _queryParams, | |
303 uploadOptions: _uploadOptions, | |
304 uploadMedia: _uploadMedia, | |
305 downloadOptions: _downloadOptions); | |
306 return _response.then((data) => new Span.fromJson(data)); | |
307 } | |
308 | |
309 } | |
310 | |
311 | |
312 | |
313 /** | |
314 * Text annotation with a set of attributes. A maximum of 32 annotations are | |
315 * allowed per Span. | |
316 */ | |
317 class Annotation { | |
318 /** | |
319 * A set of attributes on the annotation. A maximum of 4 attributes are | |
320 * allowed per Annotation. | |
321 */ | |
322 Attributes attributes; | |
323 /** | |
324 * A user-supplied message describing the event. The maximum length for | |
325 * the description is 256 bytes. | |
326 */ | |
327 TruncatableString description; | |
328 | |
329 Annotation(); | |
330 | |
331 Annotation.fromJson(core.Map _json) { | |
332 if (_json.containsKey("attributes")) { | |
333 attributes = new Attributes.fromJson(_json["attributes"]); | |
334 } | |
335 if (_json.containsKey("description")) { | |
336 description = new TruncatableString.fromJson(_json["description"]); | |
337 } | |
338 } | |
339 | |
340 core.Map<core.String, core.Object> toJson() { | |
341 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
342 if (attributes != null) { | |
343 _json["attributes"] = (attributes).toJson(); | |
344 } | |
345 if (description != null) { | |
346 _json["description"] = (description).toJson(); | |
347 } | |
348 return _json; | |
349 } | |
350 } | |
351 | |
352 /** The allowed types for the value side of an attribute key:value pair. */ | |
353 class AttributeValue { | |
354 /** A boolean value. */ | |
355 core.bool boolValue; | |
356 /** An integer value. */ | |
357 core.String intValue; | |
358 /** A string value (up to 256 bytes). */ | |
359 TruncatableString stringValue; | |
360 | |
361 AttributeValue(); | |
362 | |
363 AttributeValue.fromJson(core.Map _json) { | |
364 if (_json.containsKey("boolValue")) { | |
365 boolValue = _json["boolValue"]; | |
366 } | |
367 if (_json.containsKey("intValue")) { | |
368 intValue = _json["intValue"]; | |
369 } | |
370 if (_json.containsKey("stringValue")) { | |
371 stringValue = new TruncatableString.fromJson(_json["stringValue"]); | |
372 } | |
373 } | |
374 | |
375 core.Map<core.String, core.Object> toJson() { | |
376 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
377 if (boolValue != null) { | |
378 _json["boolValue"] = boolValue; | |
379 } | |
380 if (intValue != null) { | |
381 _json["intValue"] = intValue; | |
382 } | |
383 if (stringValue != null) { | |
384 _json["stringValue"] = (stringValue).toJson(); | |
385 } | |
386 return _json; | |
387 } | |
388 } | |
389 | |
390 /** Attributes of a span with a key:value format. */ | |
391 class Attributes { | |
392 /** | |
393 * The maximum key length is 128 bytes (attributes are dropped if the | |
394 * key size is larger than the maximum allowed). The value can be a string | |
395 * (up to 256 bytes), integer, or boolean (true/false). Some common pair | |
396 * examples: | |
397 * | |
398 * "/instance_id": "my-instance" | |
399 * "/zone": "us-central1-a" | |
400 * "/grpc/peer_address": "ip:port" (dns, etc.) | |
401 * "/grpc/deadline": "Duration" | |
402 * "/http/user_agent" | |
403 * "/http/request_bytes": 300 | |
404 * "/http/response_bytes": 1200 | |
405 * "/http/url": google.com/apis | |
406 * "abc.com/myattribute": true | |
407 */ | |
408 core.Map<core.String, AttributeValue> attributeMap; | |
409 /** | |
410 * The number of dropped attributes after the maximum size was enforced. If | |
411 * 0 then no attributes were dropped. | |
412 */ | |
413 core.int droppedAttributesCount; | |
414 | |
415 Attributes(); | |
416 | |
417 Attributes.fromJson(core.Map _json) { | |
418 if (_json.containsKey("attributeMap")) { | |
419 attributeMap = commons.mapMap<core.Map<core.String, core.Object>, Attribut
eValue>(_json["attributeMap"], (core.Map<core.String, core.Object> item) => new
AttributeValue.fromJson(item)); | |
420 } | |
421 if (_json.containsKey("droppedAttributesCount")) { | |
422 droppedAttributesCount = _json["droppedAttributesCount"]; | |
423 } | |
424 } | |
425 | |
426 core.Map<core.String, core.Object> toJson() { | |
427 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
428 if (attributeMap != null) { | |
429 _json["attributeMap"] = commons.mapMap<AttributeValue, core.Map<core.Strin
g, core.Object>>(attributeMap, (AttributeValue item) => (item).toJson()); | |
430 } | |
431 if (droppedAttributesCount != null) { | |
432 _json["droppedAttributesCount"] = droppedAttributesCount; | |
433 } | |
434 return _json; | |
435 } | |
436 } | |
437 | |
438 /** The request message for the `BatchWriteSpans` method. */ | |
439 class BatchWriteSpansRequest { | |
440 /** A collection of spans. */ | |
441 core.List<Span> spans; | |
442 | |
443 BatchWriteSpansRequest(); | |
444 | |
445 BatchWriteSpansRequest.fromJson(core.Map _json) { | |
446 if (_json.containsKey("spans")) { | |
447 spans = _json["spans"].map((value) => new Span.fromJson(value)).toList(); | |
448 } | |
449 } | |
450 | |
451 core.Map<core.String, core.Object> toJson() { | |
452 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
453 if (spans != null) { | |
454 _json["spans"] = spans.map((value) => (value).toJson()).toList(); | |
455 } | |
456 return _json; | |
457 } | |
458 } | |
459 | |
460 /** | |
461 * A generic empty message that you can re-use to avoid defining duplicated | |
462 * empty messages in your APIs. A typical example is to use it as the request | |
463 * or the response type of an API method. For instance: | |
464 * | |
465 * service Foo { | |
466 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); | |
467 * } | |
468 * | |
469 * The JSON representation for `Empty` is empty JSON object `{}`. | |
470 */ | |
471 class Empty { | |
472 | |
473 Empty(); | |
474 | |
475 Empty.fromJson(core.Map _json) { | |
476 } | |
477 | |
478 core.Map<core.String, core.Object> toJson() { | |
479 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
480 return _json; | |
481 } | |
482 } | |
483 | |
484 /** | |
485 * A pointer from this span to another span in a different `Trace` within | |
486 * the same service project or within a different service project. Used | |
487 * (for example) in batching operations, where a single batch handler | |
488 * processes multiple requests from different traces or when receives a | |
489 * request from a different service project. | |
490 */ | |
491 class Link { | |
492 /** | |
493 * `SPAN_ID` is a unique identifier for a span within a trace. It is a | |
494 * base16-encoded, case-insensitive string of a 8-bytes array and is | |
495 * required to be 16 char long. | |
496 */ | |
497 core.String spanId; | |
498 /** | |
499 * `TRACE_ID` is a unique identifier for a trace within a project. It is | |
500 * a base16-encoded, case-insensitive string of a 16-bytes array and is | |
501 * required to be 32 char long. | |
502 */ | |
503 core.String traceId; | |
504 /** | |
505 * The relationship of the current span relative to the linked span. | |
506 * Possible string values are: | |
507 * - "TYPE_UNSPECIFIED" : The relationship of the two spans is unknown. | |
508 * - "CHILD" : The current span is a child of the linked span. | |
509 * - "PARENT" : The current span is the parent of the linked span. | |
510 */ | |
511 core.String type; | |
512 | |
513 Link(); | |
514 | |
515 Link.fromJson(core.Map _json) { | |
516 if (_json.containsKey("spanId")) { | |
517 spanId = _json["spanId"]; | |
518 } | |
519 if (_json.containsKey("traceId")) { | |
520 traceId = _json["traceId"]; | |
521 } | |
522 if (_json.containsKey("type")) { | |
523 type = _json["type"]; | |
524 } | |
525 } | |
526 | |
527 core.Map<core.String, core.Object> toJson() { | |
528 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
529 if (spanId != null) { | |
530 _json["spanId"] = spanId; | |
531 } | |
532 if (traceId != null) { | |
533 _json["traceId"] = traceId; | |
534 } | |
535 if (type != null) { | |
536 _json["type"] = type; | |
537 } | |
538 return _json; | |
539 } | |
540 } | |
541 | |
542 /** | |
543 * A collection of links, which are references from this span to a span | |
544 * in the same or different trace. | |
545 */ | |
546 class Links { | |
547 /** | |
548 * The number of dropped links after the maximum size was enforced. If | |
549 * 0 then no links were dropped. | |
550 */ | |
551 core.int droppedLinksCount; | |
552 /** A collection of links. */ | |
553 core.List<Link> link; | |
554 | |
555 Links(); | |
556 | |
557 Links.fromJson(core.Map _json) { | |
558 if (_json.containsKey("droppedLinksCount")) { | |
559 droppedLinksCount = _json["droppedLinksCount"]; | |
560 } | |
561 if (_json.containsKey("link")) { | |
562 link = _json["link"].map((value) => new Link.fromJson(value)).toList(); | |
563 } | |
564 } | |
565 | |
566 core.Map<core.String, core.Object> toJson() { | |
567 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
568 if (droppedLinksCount != null) { | |
569 _json["droppedLinksCount"] = droppedLinksCount; | |
570 } | |
571 if (link != null) { | |
572 _json["link"] = link.map((value) => (value).toJson()).toList(); | |
573 } | |
574 return _json; | |
575 } | |
576 } | |
577 | |
578 /** The response message for the `ListSpans` method. */ | |
579 class ListSpansResponse { | |
580 /** | |
581 * If defined, indicates that there are more spans that match the request. | |
582 * Pass this as the value of `pageToken` in a subsequent request to retrieve | |
583 * additional spans. | |
584 */ | |
585 core.String nextPageToken; | |
586 /** The requested spans if there are any in the specified trace. */ | |
587 core.List<Span> spans; | |
588 | |
589 ListSpansResponse(); | |
590 | |
591 ListSpansResponse.fromJson(core.Map _json) { | |
592 if (_json.containsKey("nextPageToken")) { | |
593 nextPageToken = _json["nextPageToken"]; | |
594 } | |
595 if (_json.containsKey("spans")) { | |
596 spans = _json["spans"].map((value) => new Span.fromJson(value)).toList(); | |
597 } | |
598 } | |
599 | |
600 core.Map<core.String, core.Object> toJson() { | |
601 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
602 if (nextPageToken != null) { | |
603 _json["nextPageToken"] = nextPageToken; | |
604 } | |
605 if (spans != null) { | |
606 _json["spans"] = spans.map((value) => (value).toJson()).toList(); | |
607 } | |
608 return _json; | |
609 } | |
610 } | |
611 | |
612 /** The response message for the `ListTraces` method. */ | |
613 class ListTracesResponse { | |
614 /** | |
615 * If defined, indicates that there are more traces that match the request | |
616 * and that this value should be passed to the next request to continue | |
617 * retrieving additional traces. | |
618 */ | |
619 core.String nextPageToken; | |
620 /** List of trace records returned. */ | |
621 core.List<Trace> traces; | |
622 | |
623 ListTracesResponse(); | |
624 | |
625 ListTracesResponse.fromJson(core.Map _json) { | |
626 if (_json.containsKey("nextPageToken")) { | |
627 nextPageToken = _json["nextPageToken"]; | |
628 } | |
629 if (_json.containsKey("traces")) { | |
630 traces = _json["traces"].map((value) => new Trace.fromJson(value)).toList(
); | |
631 } | |
632 } | |
633 | |
634 core.Map<core.String, core.Object> toJson() { | |
635 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
636 if (nextPageToken != null) { | |
637 _json["nextPageToken"] = nextPageToken; | |
638 } | |
639 if (traces != null) { | |
640 _json["traces"] = traces.map((value) => (value).toJson()).toList(); | |
641 } | |
642 return _json; | |
643 } | |
644 } | |
645 | |
646 /** Binary module. */ | |
647 class Module { | |
648 /** | |
649 * Build_id is a unique identifier for the module, usually a hash of its | |
650 * contents (up to 128 characters). | |
651 */ | |
652 TruncatableString buildId; | |
653 /** | |
654 * E.g. main binary, kernel modules, and dynamic libraries | |
655 * such as libc.so, sharedlib.so (up to 256 characters). | |
656 */ | |
657 TruncatableString module; | |
658 | |
659 Module(); | |
660 | |
661 Module.fromJson(core.Map _json) { | |
662 if (_json.containsKey("buildId")) { | |
663 buildId = new TruncatableString.fromJson(_json["buildId"]); | |
664 } | |
665 if (_json.containsKey("module")) { | |
666 module = new TruncatableString.fromJson(_json["module"]); | |
667 } | |
668 } | |
669 | |
670 core.Map<core.String, core.Object> toJson() { | |
671 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
672 if (buildId != null) { | |
673 _json["buildId"] = (buildId).toJson(); | |
674 } | |
675 if (module != null) { | |
676 _json["module"] = (module).toJson(); | |
677 } | |
678 return _json; | |
679 } | |
680 } | |
681 | |
682 /** | |
683 * An event describing an RPC message sent/received on the network. A | |
684 * maximum of 128 network events are allowed per Span. | |
685 */ | |
686 class NetworkEvent { | |
687 /** An identifier for the message, which must be unique in this span. */ | |
688 core.String messageId; | |
689 /** The number of bytes sent or received. */ | |
690 core.String messageSize; | |
691 /** | |
692 * If available, this is the kernel time: | |
693 * | |
694 * * For sent messages, this is the time at which the first bit was sent. | |
695 * * For received messages, this is the time at which the last bit was | |
696 * received. | |
697 */ | |
698 core.String time; | |
699 /** | |
700 * Type of NetworkEvent. Indicates whether the RPC message was sent or | |
701 * received. | |
702 * Possible string values are: | |
703 * - "TYPE_UNSPECIFIED" : Unknown event type. | |
704 * - "SENT" : Indicates a sent RPC message. | |
705 * - "RECV" : Indicates a received RPC message. | |
706 */ | |
707 core.String type; | |
708 | |
709 NetworkEvent(); | |
710 | |
711 NetworkEvent.fromJson(core.Map _json) { | |
712 if (_json.containsKey("messageId")) { | |
713 messageId = _json["messageId"]; | |
714 } | |
715 if (_json.containsKey("messageSize")) { | |
716 messageSize = _json["messageSize"]; | |
717 } | |
718 if (_json.containsKey("time")) { | |
719 time = _json["time"]; | |
720 } | |
721 if (_json.containsKey("type")) { | |
722 type = _json["type"]; | |
723 } | |
724 } | |
725 | |
726 core.Map<core.String, core.Object> toJson() { | |
727 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
728 if (messageId != null) { | |
729 _json["messageId"] = messageId; | |
730 } | |
731 if (messageSize != null) { | |
732 _json["messageSize"] = messageSize; | |
733 } | |
734 if (time != null) { | |
735 _json["time"] = time; | |
736 } | |
737 if (type != null) { | |
738 _json["type"] = type; | |
739 } | |
740 return _json; | |
741 } | |
742 } | |
743 | |
744 /** | |
745 * A span represents a single operation within a trace. Spans can be nested | |
746 * to form a trace tree. Often, a trace contains a root span that | |
747 * describes the end-to-end latency and, optionally, one or more subspans for | |
748 * its sub-operations. (A trace could alternatively contain multiple root spans, | |
749 * or none at all.) Spans do not need to be contiguous. There may be gaps | |
750 * and/or overlaps between spans in a trace. | |
751 */ | |
752 class Span { | |
753 /** | |
754 * A set of attributes on the span. A maximum of 32 attributes are allowed per | |
755 * Span. | |
756 */ | |
757 Attributes attributes; | |
758 /** | |
759 * Description of the operation in the span. It is sanitized and displayed in | |
760 * the Stackdriver Trace tool in the | |
761 * {% dynamic print site_values.console_name %}. | |
762 * The display_name may be a method name or some other per-call site | |
763 * name. For the same executable and the same call point, a best practice is | |
764 * to use a consistent operation name, which makes it easier to correlate | |
765 * cross-trace spans. | |
766 * The maximum length for the display_name is 128 bytes. | |
767 */ | |
768 TruncatableString displayName; | |
769 /** | |
770 * End time of the span. | |
771 * On the client side, this is the local machine clock time at which the span | |
772 * execution was ended; on the server | |
773 * side, this is the time at which the server application handler stopped | |
774 * running. | |
775 */ | |
776 core.String endTime; | |
777 /** A maximum of 128 links are allowed per Span. */ | |
778 Links links; | |
779 /** | |
780 * The resource name of Span in the format | |
781 * `projects/PROJECT_ID/traces/TRACE_ID/spans/SPAN_ID`. | |
782 * `TRACE_ID` is a unique identifier for a trace within a project and is a | |
783 * base16-encoded, case-insensitive string and is required to be 32 char long. | |
784 * `SPAN_ID` is a unique identifier for a span within a trace. It is a | |
785 * base 16-encoded, case-insensitive string of a 8-bytes array and is required | |
786 * to be 16 char long. | |
787 */ | |
788 core.String name; | |
789 /** | |
790 * ID of parent span which is a base 16-encoded, case-insensitive string of | |
791 * a 8-bytes array and is required to be 16 char long. If this is a root span, | |
792 * the value must be empty. | |
793 */ | |
794 core.String parentSpanId; | |
795 /** | |
796 * Unique identifier for a span within a trace. It is a base 16-encoded, | |
797 * case-insensitive string of a 8-bytes array and is required. | |
798 */ | |
799 core.String spanId; | |
800 /** Stack trace captured at the start of the span. */ | |
801 StackTrace stackTrace; | |
802 /** | |
803 * Start time of the span. | |
804 * On the client side, this is the local machine clock time at which the span | |
805 * execution was started; on the server | |
806 * side, this is the time at which the server application handler started | |
807 * running. | |
808 */ | |
809 core.String startTime; | |
810 /** An optional final status for this span. */ | |
811 Status status; | |
812 /** | |
813 * A maximum of 32 annotations and 128 network events are allowed per Span. | |
814 */ | |
815 TimeEvents timeEvents; | |
816 | |
817 Span(); | |
818 | |
819 Span.fromJson(core.Map _json) { | |
820 if (_json.containsKey("attributes")) { | |
821 attributes = new Attributes.fromJson(_json["attributes"]); | |
822 } | |
823 if (_json.containsKey("displayName")) { | |
824 displayName = new TruncatableString.fromJson(_json["displayName"]); | |
825 } | |
826 if (_json.containsKey("endTime")) { | |
827 endTime = _json["endTime"]; | |
828 } | |
829 if (_json.containsKey("links")) { | |
830 links = new Links.fromJson(_json["links"]); | |
831 } | |
832 if (_json.containsKey("name")) { | |
833 name = _json["name"]; | |
834 } | |
835 if (_json.containsKey("parentSpanId")) { | |
836 parentSpanId = _json["parentSpanId"]; | |
837 } | |
838 if (_json.containsKey("spanId")) { | |
839 spanId = _json["spanId"]; | |
840 } | |
841 if (_json.containsKey("stackTrace")) { | |
842 stackTrace = new StackTrace.fromJson(_json["stackTrace"]); | |
843 } | |
844 if (_json.containsKey("startTime")) { | |
845 startTime = _json["startTime"]; | |
846 } | |
847 if (_json.containsKey("status")) { | |
848 status = new Status.fromJson(_json["status"]); | |
849 } | |
850 if (_json.containsKey("timeEvents")) { | |
851 timeEvents = new TimeEvents.fromJson(_json["timeEvents"]); | |
852 } | |
853 } | |
854 | |
855 core.Map<core.String, core.Object> toJson() { | |
856 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
857 if (attributes != null) { | |
858 _json["attributes"] = (attributes).toJson(); | |
859 } | |
860 if (displayName != null) { | |
861 _json["displayName"] = (displayName).toJson(); | |
862 } | |
863 if (endTime != null) { | |
864 _json["endTime"] = endTime; | |
865 } | |
866 if (links != null) { | |
867 _json["links"] = (links).toJson(); | |
868 } | |
869 if (name != null) { | |
870 _json["name"] = name; | |
871 } | |
872 if (parentSpanId != null) { | |
873 _json["parentSpanId"] = parentSpanId; | |
874 } | |
875 if (spanId != null) { | |
876 _json["spanId"] = spanId; | |
877 } | |
878 if (stackTrace != null) { | |
879 _json["stackTrace"] = (stackTrace).toJson(); | |
880 } | |
881 if (startTime != null) { | |
882 _json["startTime"] = startTime; | |
883 } | |
884 if (status != null) { | |
885 _json["status"] = (status).toJson(); | |
886 } | |
887 if (timeEvents != null) { | |
888 _json["timeEvents"] = (timeEvents).toJson(); | |
889 } | |
890 return _json; | |
891 } | |
892 } | |
893 | |
894 /** Represents a single stack frame in a stack trace. */ | |
895 class StackFrame { | |
896 /** | |
897 * Column number is important in JavaScript (anonymous functions). | |
898 * May not be available in some languages. | |
899 */ | |
900 core.String columnNumber; | |
901 /** The filename of the file containing this frame (up to 256 characters). */ | |
902 TruncatableString fileName; | |
903 /** | |
904 * The fully-qualified name that uniquely identifies this function or | |
905 * method (up to 1024 characters). | |
906 */ | |
907 TruncatableString functionName; | |
908 /** Line number of the frame. */ | |
909 core.String lineNumber; | |
910 /** Binary module the code is loaded from. */ | |
911 Module loadModule; | |
912 /** | |
913 * Used when the function name is | |
914 * [mangled](http://www.avabodh.com/cxxin/namemangling.html). May be | |
915 * fully-qualified (up to 1024 characters). | |
916 */ | |
917 TruncatableString originalFunctionName; | |
918 /** The version of the deployed source code (up to 128 characters). */ | |
919 TruncatableString sourceVersion; | |
920 | |
921 StackFrame(); | |
922 | |
923 StackFrame.fromJson(core.Map _json) { | |
924 if (_json.containsKey("columnNumber")) { | |
925 columnNumber = _json["columnNumber"]; | |
926 } | |
927 if (_json.containsKey("fileName")) { | |
928 fileName = new TruncatableString.fromJson(_json["fileName"]); | |
929 } | |
930 if (_json.containsKey("functionName")) { | |
931 functionName = new TruncatableString.fromJson(_json["functionName"]); | |
932 } | |
933 if (_json.containsKey("lineNumber")) { | |
934 lineNumber = _json["lineNumber"]; | |
935 } | |
936 if (_json.containsKey("loadModule")) { | |
937 loadModule = new Module.fromJson(_json["loadModule"]); | |
938 } | |
939 if (_json.containsKey("originalFunctionName")) { | |
940 originalFunctionName = new TruncatableString.fromJson(_json["originalFunct
ionName"]); | |
941 } | |
942 if (_json.containsKey("sourceVersion")) { | |
943 sourceVersion = new TruncatableString.fromJson(_json["sourceVersion"]); | |
944 } | |
945 } | |
946 | |
947 core.Map<core.String, core.Object> toJson() { | |
948 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
949 if (columnNumber != null) { | |
950 _json["columnNumber"] = columnNumber; | |
951 } | |
952 if (fileName != null) { | |
953 _json["fileName"] = (fileName).toJson(); | |
954 } | |
955 if (functionName != null) { | |
956 _json["functionName"] = (functionName).toJson(); | |
957 } | |
958 if (lineNumber != null) { | |
959 _json["lineNumber"] = lineNumber; | |
960 } | |
961 if (loadModule != null) { | |
962 _json["loadModule"] = (loadModule).toJson(); | |
963 } | |
964 if (originalFunctionName != null) { | |
965 _json["originalFunctionName"] = (originalFunctionName).toJson(); | |
966 } | |
967 if (sourceVersion != null) { | |
968 _json["sourceVersion"] = (sourceVersion).toJson(); | |
969 } | |
970 return _json; | |
971 } | |
972 } | |
973 | |
974 /** Represents collection of StackFrames that can be truncated. */ | |
975 class StackFrames { | |
976 /** | |
977 * The number of dropped stack frames after the maximum size was enforced. | |
978 * If 0 then no frames were dropped. | |
979 */ | |
980 core.int droppedFramesCount; | |
981 /** Stack frames in this stack trace. */ | |
982 core.List<StackFrame> frame; | |
983 | |
984 StackFrames(); | |
985 | |
986 StackFrames.fromJson(core.Map _json) { | |
987 if (_json.containsKey("droppedFramesCount")) { | |
988 droppedFramesCount = _json["droppedFramesCount"]; | |
989 } | |
990 if (_json.containsKey("frame")) { | |
991 frame = _json["frame"].map((value) => new StackFrame.fromJson(value)).toLi
st(); | |
992 } | |
993 } | |
994 | |
995 core.Map<core.String, core.Object> toJson() { | |
996 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
997 if (droppedFramesCount != null) { | |
998 _json["droppedFramesCount"] = droppedFramesCount; | |
999 } | |
1000 if (frame != null) { | |
1001 _json["frame"] = frame.map((value) => (value).toJson()).toList(); | |
1002 } | |
1003 return _json; | |
1004 } | |
1005 } | |
1006 | |
1007 /** StackTrace collected in a trace. */ | |
1008 class StackTrace { | |
1009 /** Stack frames in this stack trace. A maximum of 128 frames are allowed. */ | |
1010 StackFrames stackFrames; | |
1011 /** | |
1012 * The hash ID is used to conserve network bandwidth for duplicate | |
1013 * stack traces within a single trace. | |
1014 * | |
1015 * Often multiple spans will have identical stack traces. | |
1016 * The first occurrence of a stack trace should contain both the | |
1017 * `stackFrame` content and a value in `stackTraceHashId`. | |
1018 * | |
1019 * Subsequent spans within the same request can refer | |
1020 * to that stack trace by only setting `stackTraceHashId`. | |
1021 */ | |
1022 core.String stackTraceHashId; | |
1023 | |
1024 StackTrace(); | |
1025 | |
1026 StackTrace.fromJson(core.Map _json) { | |
1027 if (_json.containsKey("stackFrames")) { | |
1028 stackFrames = new StackFrames.fromJson(_json["stackFrames"]); | |
1029 } | |
1030 if (_json.containsKey("stackTraceHashId")) { | |
1031 stackTraceHashId = _json["stackTraceHashId"]; | |
1032 } | |
1033 } | |
1034 | |
1035 core.Map<core.String, core.Object> toJson() { | |
1036 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
1037 if (stackFrames != null) { | |
1038 _json["stackFrames"] = (stackFrames).toJson(); | |
1039 } | |
1040 if (stackTraceHashId != null) { | |
1041 _json["stackTraceHashId"] = stackTraceHashId; | |
1042 } | |
1043 return _json; | |
1044 } | |
1045 } | |
1046 | |
1047 /** | |
1048 * The `Status` type defines a logical error model that is suitable for | |
1049 * different | |
1050 * programming environments, including REST APIs and RPC APIs. It is used by | |
1051 * [gRPC](https://github.com/grpc). The error model is designed to be: | |
1052 * | |
1053 * - Simple to use and understand for most users | |
1054 * - Flexible enough to meet unexpected needs | |
1055 * | |
1056 * # Overview | |
1057 * | |
1058 * The `Status` message contains three pieces of data: error code, error | |
1059 * message, | |
1060 * and error details. The error code should be an enum value of | |
1061 * google.rpc.Code, but it may accept additional error codes if needed. The | |
1062 * error message should be a developer-facing English message that helps | |
1063 * developers *understand* and *resolve* the error. If a localized user-facing | |
1064 * error message is needed, put the localized message in the error details or | |
1065 * localize it in the client. The optional error details may contain arbitrary | |
1066 * information about the error. There is a predefined set of error detail types | |
1067 * in the package `google.rpc` that can be used for common error conditions. | |
1068 * | |
1069 * # Language mapping | |
1070 * | |
1071 * The `Status` message is the logical representation of the error model, but it | |
1072 * is not necessarily the actual wire format. When the `Status` message is | |
1073 * exposed in different client libraries and different wire protocols, it can be | |
1074 * mapped differently. For example, it will likely be mapped to some exceptions | |
1075 * in Java, but more likely mapped to some error codes in C. | |
1076 * | |
1077 * # Other uses | |
1078 * | |
1079 * The error model and the `Status` message can be used in a variety of | |
1080 * environments, either with or without APIs, to provide a | |
1081 * consistent developer experience across different environments. | |
1082 * | |
1083 * Example uses of this error model include: | |
1084 * | |
1085 * - Partial errors. If a service needs to return partial errors to the client, | |
1086 * it may embed the `Status` in the normal response to indicate the partial | |
1087 * errors. | |
1088 * | |
1089 * - Workflow errors. A typical workflow has multiple steps. Each step may | |
1090 * have a `Status` message for error reporting. | |
1091 * | |
1092 * - Batch operations. If a client uses batch request and batch response, the | |
1093 * `Status` message should be used directly inside batch response, one for | |
1094 * each error sub-response. | |
1095 * | |
1096 * - Asynchronous operations. If an API call embeds asynchronous operation | |
1097 * results in its response, the status of those operations should be | |
1098 * represented directly using the `Status` message. | |
1099 * | |
1100 * - Logging. If some API errors are stored in logs, the message `Status` could | |
1101 * be used directly after any stripping needed for security/privacy reasons. | |
1102 */ | |
1103 class Status { | |
1104 /** The status code, which should be an enum value of google.rpc.Code. */ | |
1105 core.int code; | |
1106 /** | |
1107 * A list of messages that carry the error details. There will be a | |
1108 * common set of message types for APIs to use. | |
1109 * | |
1110 * The values for Object must be JSON objects. It can consist of `num`, | |
1111 * `String`, `bool` and `null` as well as `Map` and `List` values. | |
1112 */ | |
1113 core.List<core.Map<core.String, core.Object>> details; | |
1114 /** | |
1115 * A developer-facing error message, which should be in English. Any | |
1116 * user-facing error message should be localized and sent in the | |
1117 * google.rpc.Status.details field, or localized by the client. | |
1118 */ | |
1119 core.String message; | |
1120 | |
1121 Status(); | |
1122 | |
1123 Status.fromJson(core.Map _json) { | |
1124 if (_json.containsKey("code")) { | |
1125 code = _json["code"]; | |
1126 } | |
1127 if (_json.containsKey("details")) { | |
1128 details = _json["details"]; | |
1129 } | |
1130 if (_json.containsKey("message")) { | |
1131 message = _json["message"]; | |
1132 } | |
1133 } | |
1134 | |
1135 core.Map<core.String, core.Object> toJson() { | |
1136 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
1137 if (code != null) { | |
1138 _json["code"] = code; | |
1139 } | |
1140 if (details != null) { | |
1141 _json["details"] = details; | |
1142 } | |
1143 if (message != null) { | |
1144 _json["message"] = message; | |
1145 } | |
1146 return _json; | |
1147 } | |
1148 } | |
1149 | |
1150 /** A time-stamped annotation in the Span. */ | |
1151 class TimeEvent { | |
1152 /** One or more key:value pairs. */ | |
1153 Annotation annotation; | |
1154 /** An event describing an RPC message sent/received on the network. */ | |
1155 NetworkEvent networkEvent; | |
1156 /** The timestamp indicating the time the event occurred. */ | |
1157 core.String time; | |
1158 | |
1159 TimeEvent(); | |
1160 | |
1161 TimeEvent.fromJson(core.Map _json) { | |
1162 if (_json.containsKey("annotation")) { | |
1163 annotation = new Annotation.fromJson(_json["annotation"]); | |
1164 } | |
1165 if (_json.containsKey("networkEvent")) { | |
1166 networkEvent = new NetworkEvent.fromJson(_json["networkEvent"]); | |
1167 } | |
1168 if (_json.containsKey("time")) { | |
1169 time = _json["time"]; | |
1170 } | |
1171 } | |
1172 | |
1173 core.Map<core.String, core.Object> toJson() { | |
1174 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
1175 if (annotation != null) { | |
1176 _json["annotation"] = (annotation).toJson(); | |
1177 } | |
1178 if (networkEvent != null) { | |
1179 _json["networkEvent"] = (networkEvent).toJson(); | |
1180 } | |
1181 if (time != null) { | |
1182 _json["time"] = time; | |
1183 } | |
1184 return _json; | |
1185 } | |
1186 } | |
1187 | |
1188 /** | |
1189 * A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation | |
1190 * on the span, consisting of either user-supplied key:value pairs, or | |
1191 * details of an RPC message sent/received on the network. | |
1192 */ | |
1193 class TimeEvents { | |
1194 /** | |
1195 * The number of dropped annotations after the maximum size was enforced. If | |
1196 * 0 then no annotations were dropped. | |
1197 */ | |
1198 core.int droppedAnnotationsCount; | |
1199 /** | |
1200 * The number of dropped network events after the maximum size was enforced. | |
1201 * If 0 then no annotations were dropped. | |
1202 */ | |
1203 core.int droppedNetworkEventsCount; | |
1204 /** A collection of `TimeEvent`s. */ | |
1205 core.List<TimeEvent> timeEvent; | |
1206 | |
1207 TimeEvents(); | |
1208 | |
1209 TimeEvents.fromJson(core.Map _json) { | |
1210 if (_json.containsKey("droppedAnnotationsCount")) { | |
1211 droppedAnnotationsCount = _json["droppedAnnotationsCount"]; | |
1212 } | |
1213 if (_json.containsKey("droppedNetworkEventsCount")) { | |
1214 droppedNetworkEventsCount = _json["droppedNetworkEventsCount"]; | |
1215 } | |
1216 if (_json.containsKey("timeEvent")) { | |
1217 timeEvent = _json["timeEvent"].map((value) => new TimeEvent.fromJson(value
)).toList(); | |
1218 } | |
1219 } | |
1220 | |
1221 core.Map<core.String, core.Object> toJson() { | |
1222 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
1223 if (droppedAnnotationsCount != null) { | |
1224 _json["droppedAnnotationsCount"] = droppedAnnotationsCount; | |
1225 } | |
1226 if (droppedNetworkEventsCount != null) { | |
1227 _json["droppedNetworkEventsCount"] = droppedNetworkEventsCount; | |
1228 } | |
1229 if (timeEvent != null) { | |
1230 _json["timeEvent"] = timeEvent.map((value) => (value).toJson()).toList(); | |
1231 } | |
1232 return _json; | |
1233 } | |
1234 } | |
1235 | |
1236 /** | |
1237 * A trace describes how long it takes for an application to perform some | |
1238 * operations. It consists of a set of spans, each representing | |
1239 * an operation and including time information and operation details. | |
1240 */ | |
1241 class Trace { | |
1242 /** | |
1243 * The resource name of Trace in the format | |
1244 * `projects/PROJECT_ID/traces/TRACE_ID`. `TRACE_ID` is a unique identifier | |
1245 * for a trace within a project and is a base16-encoded, case-insensitive | |
1246 * string and is required to be 32 char long. | |
1247 */ | |
1248 core.String name; | |
1249 | |
1250 Trace(); | |
1251 | |
1252 Trace.fromJson(core.Map _json) { | |
1253 if (_json.containsKey("name")) { | |
1254 name = _json["name"]; | |
1255 } | |
1256 } | |
1257 | |
1258 core.Map<core.String, core.Object> toJson() { | |
1259 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
1260 if (name != null) { | |
1261 _json["name"] = name; | |
1262 } | |
1263 return _json; | |
1264 } | |
1265 } | |
1266 | |
1267 /** Represents a string value that might be truncated. */ | |
1268 class TruncatableString { | |
1269 /** | |
1270 * The number of characters truncated from the original string value. If 0 it | |
1271 * means that the string value was not truncated. | |
1272 */ | |
1273 core.int truncatedCharacterCount; | |
1274 /** | |
1275 * The truncated string value. E.g. for a string attribute this may have up to | |
1276 * 256 bytes. | |
1277 */ | |
1278 core.String value; | |
1279 | |
1280 TruncatableString(); | |
1281 | |
1282 TruncatableString.fromJson(core.Map _json) { | |
1283 if (_json.containsKey("truncatedCharacterCount")) { | |
1284 truncatedCharacterCount = _json["truncatedCharacterCount"]; | |
1285 } | |
1286 if (_json.containsKey("value")) { | |
1287 value = _json["value"]; | |
1288 } | |
1289 } | |
1290 | |
1291 core.Map<core.String, core.Object> toJson() { | |
1292 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | |
1293 if (truncatedCharacterCount != null) { | |
1294 _json["truncatedCharacterCount"] = truncatedCharacterCount; | |
1295 } | |
1296 if (value != null) { | |
1297 _json["value"] = value; | |
1298 } | |
1299 return _json; | |
1300 } | |
1301 } | |
OLD | NEW |