Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: generated/googleapis/lib/cloudtrace/v2.dart

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

Powered by Google App Engine
This is Rietveld 408576698