|
| 1 | +// Copyright 2021-2022 Workiva. |
| 2 | +// Licensed under the Apache License, Version 2.0. Please see https://github.com/Workiva/opentelemetry-dart/blob/master/LICENSE for more information |
| 3 | + |
| 4 | +// |
| 5 | +// Generated code. Do not modify. |
| 6 | +// source: opentelemetry/proto/collector/logs/v1/logs_service.proto |
| 7 | +// |
| 8 | +// @dart = 2.12 |
| 9 | + |
| 10 | +// ignore_for_file: annotate_overrides, camel_case_types, comment_references |
| 11 | +// ignore_for_file: constant_identifier_names, library_prefixes |
| 12 | +// ignore_for_file: non_constant_identifier_names, prefer_final_fields |
| 13 | +// ignore_for_file: unnecessary_import, unnecessary_this, unused_import |
| 14 | + |
| 15 | +import 'dart:async' as $async; |
| 16 | +import 'dart:core' as $core; |
| 17 | + |
| 18 | +import 'package:fixnum/fixnum.dart' as $fixnum; |
| 19 | +import 'package:opentelemetry/src/sdk/proto/opentelemetry/proto/logs/v1/logs.pbserver.dart' as $0; |
| 20 | +import 'package:protobuf/protobuf.dart' as $pb; |
| 21 | + |
| 22 | +class ExportLogsServiceRequest extends $pb.GeneratedMessage { |
| 23 | + factory ExportLogsServiceRequest({ |
| 24 | + $core.Iterable<$0.ResourceLogs>? resourceLogs, |
| 25 | + }) { |
| 26 | + final $result = create(); |
| 27 | + if (resourceLogs != null) { |
| 28 | + $result.resourceLogs.addAll(resourceLogs); |
| 29 | + } |
| 30 | + return $result; |
| 31 | + } |
| 32 | + ExportLogsServiceRequest._() : super(); |
| 33 | + factory ExportLogsServiceRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); |
| 34 | + factory ExportLogsServiceRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); |
| 35 | + |
| 36 | + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ExportLogsServiceRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'opentelemetry.proto.collector.logs.v1'), createEmptyInstance: create) |
| 37 | + ..pc<$0.ResourceLogs>(1, _omitFieldNames ? '' : 'resourceLogs', $pb.PbFieldType.PM, subBuilder: $0.ResourceLogs.create) |
| 38 | + ..hasRequiredFields = false |
| 39 | + ; |
| 40 | + |
| 41 | + @$core.Deprecated( |
| 42 | + 'Using this can add significant overhead to your binary. ' |
| 43 | + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
| 44 | + 'Will be removed in next major version') |
| 45 | + ExportLogsServiceRequest clone() => ExportLogsServiceRequest()..mergeFromMessage(this); |
| 46 | + @$core.Deprecated( |
| 47 | + 'Using this can add significant overhead to your binary. ' |
| 48 | + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
| 49 | + 'Will be removed in next major version') |
| 50 | + ExportLogsServiceRequest copyWith(void Function(ExportLogsServiceRequest) updates) => super.copyWith((message) => updates(message as ExportLogsServiceRequest)) as ExportLogsServiceRequest; |
| 51 | + |
| 52 | + $pb.BuilderInfo get info_ => _i; |
| 53 | + |
| 54 | + @$core.pragma('dart2js:noInline') |
| 55 | + static ExportLogsServiceRequest create() => ExportLogsServiceRequest._(); |
| 56 | + ExportLogsServiceRequest createEmptyInstance() => create(); |
| 57 | + static $pb.PbList<ExportLogsServiceRequest> createRepeated() => $pb.PbList<ExportLogsServiceRequest>(); |
| 58 | + @$core.pragma('dart2js:noInline') |
| 59 | + static ExportLogsServiceRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ExportLogsServiceRequest>(create); |
| 60 | + static ExportLogsServiceRequest? _defaultInstance; |
| 61 | + |
| 62 | + /// An array of ResourceLogs. |
| 63 | + /// For data coming from a single resource this array will typically contain one |
| 64 | + /// element. Intermediary nodes (such as OpenTelemetry Collector) that receive |
| 65 | + /// data from multiple origins typically batch the data before forwarding further and |
| 66 | + /// in that case this array will contain multiple elements. |
| 67 | + @$pb.TagNumber(1) |
| 68 | + $core.List<$0.ResourceLogs> get resourceLogs => $_getList(0); |
| 69 | +} |
| 70 | + |
| 71 | +class ExportLogsServiceResponse extends $pb.GeneratedMessage { |
| 72 | + factory ExportLogsServiceResponse({ |
| 73 | + ExportLogsPartialSuccess? partialSuccess, |
| 74 | + }) { |
| 75 | + final $result = create(); |
| 76 | + if (partialSuccess != null) { |
| 77 | + $result.partialSuccess = partialSuccess; |
| 78 | + } |
| 79 | + return $result; |
| 80 | + } |
| 81 | + ExportLogsServiceResponse._() : super(); |
| 82 | + factory ExportLogsServiceResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); |
| 83 | + factory ExportLogsServiceResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); |
| 84 | + |
| 85 | + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ExportLogsServiceResponse', package: const $pb.PackageName(_omitMessageNames ? '' : 'opentelemetry.proto.collector.logs.v1'), createEmptyInstance: create) |
| 86 | + ..aOM<ExportLogsPartialSuccess>(1, _omitFieldNames ? '' : 'partialSuccess', subBuilder: ExportLogsPartialSuccess.create) |
| 87 | + ..hasRequiredFields = false |
| 88 | + ; |
| 89 | + |
| 90 | + @$core.Deprecated( |
| 91 | + 'Using this can add significant overhead to your binary. ' |
| 92 | + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
| 93 | + 'Will be removed in next major version') |
| 94 | + ExportLogsServiceResponse clone() => ExportLogsServiceResponse()..mergeFromMessage(this); |
| 95 | + @$core.Deprecated( |
| 96 | + 'Using this can add significant overhead to your binary. ' |
| 97 | + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
| 98 | + 'Will be removed in next major version') |
| 99 | + ExportLogsServiceResponse copyWith(void Function(ExportLogsServiceResponse) updates) => super.copyWith((message) => updates(message as ExportLogsServiceResponse)) as ExportLogsServiceResponse; |
| 100 | + |
| 101 | + $pb.BuilderInfo get info_ => _i; |
| 102 | + |
| 103 | + @$core.pragma('dart2js:noInline') |
| 104 | + static ExportLogsServiceResponse create() => ExportLogsServiceResponse._(); |
| 105 | + ExportLogsServiceResponse createEmptyInstance() => create(); |
| 106 | + static $pb.PbList<ExportLogsServiceResponse> createRepeated() => $pb.PbList<ExportLogsServiceResponse>(); |
| 107 | + @$core.pragma('dart2js:noInline') |
| 108 | + static ExportLogsServiceResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ExportLogsServiceResponse>(create); |
| 109 | + static ExportLogsServiceResponse? _defaultInstance; |
| 110 | + |
| 111 | + /// The details of a partially successful export request. |
| 112 | + /// |
| 113 | + /// If the request is only partially accepted |
| 114 | + /// (i.e. when the server accepts only parts of the data and rejects the rest) |
| 115 | + /// the server MUST initialize the `partial_success` field and MUST |
| 116 | + /// set the `rejected_<signal>` with the number of items it rejected. |
| 117 | + /// |
| 118 | + /// Servers MAY also make use of the `partial_success` field to convey |
| 119 | + /// warnings/suggestions to senders even when the request was fully accepted. |
| 120 | + /// In such cases, the `rejected_<signal>` MUST have a value of `0` and |
| 121 | + /// the `error_message` MUST be non-empty. |
| 122 | + /// |
| 123 | + /// A `partial_success` message with an empty value (rejected_<signal> = 0 and |
| 124 | + /// `error_message` = "") is equivalent to it not being set/present. Senders |
| 125 | + /// SHOULD interpret it the same way as in the full success case. |
| 126 | + @$pb.TagNumber(1) |
| 127 | + ExportLogsPartialSuccess get partialSuccess => $_getN(0); |
| 128 | + @$pb.TagNumber(1) |
| 129 | + set partialSuccess(ExportLogsPartialSuccess v) { setField(1, v); } |
| 130 | + @$pb.TagNumber(1) |
| 131 | + $core.bool hasPartialSuccess() => $_has(0); |
| 132 | + @$pb.TagNumber(1) |
| 133 | + void clearPartialSuccess() => clearField(1); |
| 134 | + @$pb.TagNumber(1) |
| 135 | + ExportLogsPartialSuccess ensurePartialSuccess() => $_ensure(0); |
| 136 | +} |
| 137 | + |
| 138 | +class ExportLogsPartialSuccess extends $pb.GeneratedMessage { |
| 139 | + factory ExportLogsPartialSuccess({ |
| 140 | + $fixnum.Int64? rejectedLogRecords, |
| 141 | + $core.String? errorMessage, |
| 142 | + }) { |
| 143 | + final $result = create(); |
| 144 | + if (rejectedLogRecords != null) { |
| 145 | + $result.rejectedLogRecords = rejectedLogRecords; |
| 146 | + } |
| 147 | + if (errorMessage != null) { |
| 148 | + $result.errorMessage = errorMessage; |
| 149 | + } |
| 150 | + return $result; |
| 151 | + } |
| 152 | + ExportLogsPartialSuccess._() : super(); |
| 153 | + factory ExportLogsPartialSuccess.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); |
| 154 | + factory ExportLogsPartialSuccess.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); |
| 155 | + |
| 156 | + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ExportLogsPartialSuccess', package: const $pb.PackageName(_omitMessageNames ? '' : 'opentelemetry.proto.collector.logs.v1'), createEmptyInstance: create) |
| 157 | + ..aInt64(1, _omitFieldNames ? '' : 'rejectedLogRecords') |
| 158 | + ..aOS(2, _omitFieldNames ? '' : 'errorMessage') |
| 159 | + ..hasRequiredFields = false |
| 160 | + ; |
| 161 | + |
| 162 | + @$core.Deprecated( |
| 163 | + 'Using this can add significant overhead to your binary. ' |
| 164 | + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' |
| 165 | + 'Will be removed in next major version') |
| 166 | + ExportLogsPartialSuccess clone() => ExportLogsPartialSuccess()..mergeFromMessage(this); |
| 167 | + @$core.Deprecated( |
| 168 | + 'Using this can add significant overhead to your binary. ' |
| 169 | + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' |
| 170 | + 'Will be removed in next major version') |
| 171 | + ExportLogsPartialSuccess copyWith(void Function(ExportLogsPartialSuccess) updates) => super.copyWith((message) => updates(message as ExportLogsPartialSuccess)) as ExportLogsPartialSuccess; |
| 172 | + |
| 173 | + $pb.BuilderInfo get info_ => _i; |
| 174 | + |
| 175 | + @$core.pragma('dart2js:noInline') |
| 176 | + static ExportLogsPartialSuccess create() => ExportLogsPartialSuccess._(); |
| 177 | + ExportLogsPartialSuccess createEmptyInstance() => create(); |
| 178 | + static $pb.PbList<ExportLogsPartialSuccess> createRepeated() => $pb.PbList<ExportLogsPartialSuccess>(); |
| 179 | + @$core.pragma('dart2js:noInline') |
| 180 | + static ExportLogsPartialSuccess getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ExportLogsPartialSuccess>(create); |
| 181 | + static ExportLogsPartialSuccess? _defaultInstance; |
| 182 | + |
| 183 | + /// The number of rejected log records. |
| 184 | + /// |
| 185 | + /// A `rejected_<signal>` field holding a `0` value indicates that the |
| 186 | + /// request was fully accepted. |
| 187 | + @$pb.TagNumber(1) |
| 188 | + $fixnum.Int64 get rejectedLogRecords => $_getI64(0); |
| 189 | + @$pb.TagNumber(1) |
| 190 | + set rejectedLogRecords($fixnum.Int64 v) { $_setInt64(0, v); } |
| 191 | + @$pb.TagNumber(1) |
| 192 | + $core.bool hasRejectedLogRecords() => $_has(0); |
| 193 | + @$pb.TagNumber(1) |
| 194 | + void clearRejectedLogRecords() => clearField(1); |
| 195 | + |
| 196 | + /// A developer-facing human-readable message in English. It should be used |
| 197 | + /// either to explain why the server rejected parts of the data during a partial |
| 198 | + /// success or to convey warnings/suggestions during a full success. The message |
| 199 | + /// should offer guidance on how users can address such issues. |
| 200 | + /// |
| 201 | + /// error_message is an optional field. An error_message with an empty value |
| 202 | + /// is equivalent to it not being set. |
| 203 | + @$pb.TagNumber(2) |
| 204 | + $core.String get errorMessage => $_getSZ(1); |
| 205 | + @$pb.TagNumber(2) |
| 206 | + set errorMessage($core.String v) { $_setString(1, v); } |
| 207 | + @$pb.TagNumber(2) |
| 208 | + $core.bool hasErrorMessage() => $_has(1); |
| 209 | + @$pb.TagNumber(2) |
| 210 | + void clearErrorMessage() => clearField(2); |
| 211 | +} |
| 212 | + |
| 213 | +class LogsServiceApi { |
| 214 | + $pb.RpcClient _client; |
| 215 | + LogsServiceApi(this._client); |
| 216 | + |
| 217 | + $async.Future<ExportLogsServiceResponse> export($pb.ClientContext? ctx, ExportLogsServiceRequest request) => |
| 218 | + _client.invoke<ExportLogsServiceResponse>(ctx, 'LogsService', 'Export', request, ExportLogsServiceResponse()) |
| 219 | + ; |
| 220 | +} |
| 221 | + |
| 222 | + |
| 223 | +const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); |
| 224 | +const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); |
0 commit comments