Skip to content

Commit 695d8f3

Browse files
committed
feat: proto
1 parent 4b6145a commit 695d8f3

File tree

8 files changed

+1142
-0
lines changed

8 files changed

+1142
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
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');
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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:convert' as $convert;
16+
import 'dart:core' as $core;
17+
import 'dart:typed_data' as $typed_data;
18+
19+
import '../../../common/v1/common.pbjson.dart' as $2;
20+
import '../../../logs/v1/logs.pbjson.dart' as $0;
21+
import '../../../resource/v1/resource.pbjson.dart' as $1;
22+
23+
@$core.Deprecated('Use exportLogsServiceRequestDescriptor instead')
24+
const ExportLogsServiceRequest$json = {
25+
'1': 'ExportLogsServiceRequest',
26+
'2': [
27+
{'1': 'resource_logs', '3': 1, '4': 3, '5': 11, '6': '.opentelemetry.proto.logs.v1.ResourceLogs', '10': 'resourceLogs'},
28+
],
29+
};
30+
31+
/// Descriptor for `ExportLogsServiceRequest`. Decode as a `google.protobuf.DescriptorProto`.
32+
final $typed_data.Uint8List exportLogsServiceRequestDescriptor = $convert.base64Decode(
33+
'ChhFeHBvcnRMb2dzU2VydmljZVJlcXVlc3QSTgoNcmVzb3VyY2VfbG9ncxgBIAMoCzIpLm9wZW'
34+
'50ZWxlbWV0cnkucHJvdG8ubG9ncy52MS5SZXNvdXJjZUxvZ3NSDHJlc291cmNlTG9ncw==');
35+
36+
@$core.Deprecated('Use exportLogsServiceResponseDescriptor instead')
37+
const ExportLogsServiceResponse$json = {
38+
'1': 'ExportLogsServiceResponse',
39+
'2': [
40+
{'1': 'partial_success', '3': 1, '4': 1, '5': 11, '6': '.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess', '10': 'partialSuccess'},
41+
],
42+
};
43+
44+
/// Descriptor for `ExportLogsServiceResponse`. Decode as a `google.protobuf.DescriptorProto`.
45+
final $typed_data.Uint8List exportLogsServiceResponseDescriptor = $convert.base64Decode(
46+
'ChlFeHBvcnRMb2dzU2VydmljZVJlc3BvbnNlEmgKD3BhcnRpYWxfc3VjY2VzcxgBIAEoCzI/Lm'
47+
'9wZW50ZWxlbWV0cnkucHJvdG8uY29sbGVjdG9yLmxvZ3MudjEuRXhwb3J0TG9nc1BhcnRpYWxT'
48+
'dWNjZXNzUg5wYXJ0aWFsU3VjY2Vzcw==');
49+
50+
@$core.Deprecated('Use exportLogsPartialSuccessDescriptor instead')
51+
const ExportLogsPartialSuccess$json = {
52+
'1': 'ExportLogsPartialSuccess',
53+
'2': [
54+
{'1': 'rejected_log_records', '3': 1, '4': 1, '5': 3, '10': 'rejectedLogRecords'},
55+
{'1': 'error_message', '3': 2, '4': 1, '5': 9, '10': 'errorMessage'},
56+
],
57+
};
58+
59+
/// Descriptor for `ExportLogsPartialSuccess`. Decode as a `google.protobuf.DescriptorProto`.
60+
final $typed_data.Uint8List exportLogsPartialSuccessDescriptor = $convert.base64Decode(
61+
'ChhFeHBvcnRMb2dzUGFydGlhbFN1Y2Nlc3MSMAoUcmVqZWN0ZWRfbG9nX3JlY29yZHMYASABKA'
62+
'NSEnJlamVjdGVkTG9nUmVjb3JkcxIjCg1lcnJvcl9tZXNzYWdlGAIgASgJUgxlcnJvck1lc3Nh'
63+
'Z2U=');
64+
65+
const $core.Map<$core.String, $core.dynamic> LogsServiceBase$json = {
66+
'1': 'LogsService',
67+
'2': [
68+
{'1': 'Export', '2': '.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest', '3': '.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse', '4': {}},
69+
],
70+
};
71+
72+
@$core.Deprecated('Use logsServiceDescriptor instead')
73+
const $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> LogsServiceBase$messageJson = {
74+
'.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest': ExportLogsServiceRequest$json,
75+
'.opentelemetry.proto.logs.v1.ResourceLogs': $0.ResourceLogs$json,
76+
'.opentelemetry.proto.resource.v1.Resource': $1.Resource$json,
77+
'.opentelemetry.proto.common.v1.KeyValue': $2.KeyValue$json,
78+
'.opentelemetry.proto.common.v1.AnyValue': $2.AnyValue$json,
79+
'.opentelemetry.proto.common.v1.ArrayValue': $2.ArrayValue$json,
80+
'.opentelemetry.proto.common.v1.KeyValueList': $2.KeyValueList$json,
81+
'.opentelemetry.proto.logs.v1.ScopeLogs': $0.ScopeLogs$json,
82+
'.opentelemetry.proto.common.v1.InstrumentationScope': $2.InstrumentationScope$json,
83+
'.opentelemetry.proto.logs.v1.LogRecord': $0.LogRecord$json,
84+
'.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse': ExportLogsServiceResponse$json,
85+
'.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess': ExportLogsPartialSuccess$json,
86+
};
87+
88+
/// Descriptor for `LogsService`. Decode as a `google.protobuf.ServiceDescriptorProto`.
89+
final $typed_data.Uint8List logsServiceDescriptor = $convert.base64Decode(
90+
'CgtMb2dzU2VydmljZRKNAQoGRXhwb3J0Ej8ub3BlbnRlbGVtZXRyeS5wcm90by5jb2xsZWN0b3'
91+
'IubG9ncy52MS5FeHBvcnRMb2dzU2VydmljZVJlcXVlc3QaQC5vcGVudGVsZW1ldHJ5LnByb3Rv'
92+
'LmNvbGxlY3Rvci5sb2dzLnYxLkV4cG9ydExvZ3NTZXJ2aWNlUmVzcG9uc2UiAA==');
93+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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
12+
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
13+
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
14+
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
15+
16+
import 'dart:async' as $async;
17+
import 'dart:core' as $core;
18+
19+
import 'package:protobuf/protobuf.dart' as $pb;
20+
21+
import 'logs_service.pb.dart' as $3;
22+
import 'logs_service.pbjson.dart';
23+
24+
export 'logs_service.pb.dart';
25+
26+
abstract class LogsServiceBase extends $pb.GeneratedService {
27+
$async.Future<$3.ExportLogsServiceResponse> export($pb.ServerContext ctx, $3.ExportLogsServiceRequest request);
28+
29+
$pb.GeneratedMessage createRequest($core.String methodName) {
30+
switch (methodName) {
31+
case 'Export': return $3.ExportLogsServiceRequest();
32+
default: throw $core.ArgumentError('Unknown method: $methodName');
33+
}
34+
}
35+
36+
$async.Future<$pb.GeneratedMessage> handleCall($pb.ServerContext ctx, $core.String methodName, $pb.GeneratedMessage request) {
37+
switch (methodName) {
38+
case 'Export': return this.export(ctx, request as $3.ExportLogsServiceRequest);
39+
default: throw $core.ArgumentError('Unknown method: $methodName');
40+
}
41+
}
42+
43+
$core.Map<$core.String, $core.dynamic> get $json => LogsServiceBase$json;
44+
$core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> get $messageJson => LogsServiceBase$messageJson;
45+
}
46+

0 commit comments

Comments
 (0)